commit 6dcd75df
Fixed a problem with the comments not being correctly ignored
Changed files
| M | source/code/sago/SagoMisc.hpp before |
| M | source/code/sago/SagoSpriteHolder.cpp before |
diff --git a/source/code/sago/SagoMisc.hpp b/source/code/sago/SagoMisc.hpp
index 1904237..55bc097 100644
--- a/source/code/sago/SagoMisc.hpp
+++ b/source/code/sago/SagoMisc.hpp
@@ -46,6 +46,14 @@ namespace sago {
*/
std::string GetFileContent(const char* filename);
+ /**
+ * Reads an entire file into memory.
+ * PHYSFS must be setup before hand
+ * @param filename The file to read
+ * @return The content of the file. If empty either the file was empty, did not exist or could not be opened
+ */
+ inline std::string GetFileContent(const std::string& filename) { return GetFileContent(filename.c_str()); };
+
bool FileExists(const char* filename);
void WriteFileContent(const char* filename, const std::string& content);
diff --git a/source/code/sago/SagoSpriteHolder.cpp b/source/code/sago/SagoSpriteHolder.cpp
index d880f52..138b3e0 100644
--- a/source/code/sago/SagoSpriteHolder.cpp
+++ b/source/code/sago/SagoSpriteHolder.cpp
@@ -91,7 +91,7 @@ void SagoSpriteHolder::ReadSpriteFile(const std::string& filename) {
for (auto& m : document.GetObject()) {
const std::string& spriteName = m.name.GetString();
if (!m.value.IsObject()) {
- if (spriteName[0] == '_') {
+ if (spriteName[0] != '_') {
std::cerr << "Invalid sprite: " << spriteName << "\n";
}
continue;