diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-01-28 19:34:06 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-02-03 16:05:58 +0100 |
commit | 73bfd66285f1697abd3cffce4b12e09df814ecce (patch) | |
tree | 8fe987f94fe7a7657ab23d1ac255e8ed83e8128c /plugingui/resource.cc | |
parent | cd8c6ffd87e8c53724d608c4084305c67c371548 (diff) |
Integrate clicky-kit with DOM to get click colours, image and image map from the drumkit xml.
Diffstat (limited to 'plugingui/resource.cc')
-rw-r--r-- | plugingui/resource.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugingui/resource.cc b/plugingui/resource.cc index 7d1c5b0..2435668 100644 --- a/plugingui/resource.cc +++ b/plugingui/resource.cc @@ -42,6 +42,8 @@ static bool nameIsInternal(const std::string& name) Resource::Resource(const std::string& name) { + isValid = false; + if(nameIsInternal(name)) { // Use internal resource: @@ -78,7 +80,11 @@ Resource::Resource(const std::string& name) } // Get the file size - std::fseek(fp, 0, SEEK_END); + if(std::fseek(fp, 0, SEEK_END) == -1) + { + std::fclose(fp); + return; + } size_t filesize = ftell(fp); // Reserve space in the string for the data. @@ -97,7 +103,7 @@ Resource::Resource(const std::string& name) std::fclose(fp); isInternal = false; - } + } isValid = true; } |