git repos / blockattack-game

commit d8a5a6f4

sago007 · 2018-03-26 13:47
d8a5a6f4a18178187ac337640fa9c62b0a61880d patch · browse files
parent 906183f810e0d711a684012895c7feab5958a8e4

Removed debug print and finnished the bug fix

Changed files

M source/code/sago/SagoSpriteHolder.cpp before
diff --git a/source/code/sago/SagoSpriteHolder.cpp b/source/code/sago/SagoSpriteHolder.cpp index 2b24e6a..d219487 100644 --- a/source/code/sago/SagoSpriteHolder.cpp +++ b/source/code/sago/SagoSpriteHolder.cpp
@@ -73,7 +73,7 @@ static int getDefaultValue(const rapidjson::Value& value, const char* name, int
static std::string getDefaultValue(const rapidjson::Value& value, const char* name, std::string defaultValue) {
assert(value.IsObject());
const auto& t = value.GetObject().FindMember(name);
- if (t->value.IsString()) {
+ if (t != value.MemberEnd() && t->value.IsString()) {
defaultValue = t->value.GetString();
}
return defaultValue;
@@ -106,9 +106,6 @@ void SagoSpriteHolder::ReadSpriteFile(const std::string& filename) {
SDL_Rect origin = {};
origin.x = getDefaultValue(m.value, "originx",0);
origin.y = getDefaultValue(m.value, "originy",0);
- if (origin.x != 0) {
- cerr << "Origin: " << origin.x << ", " << origin.y << "\n";
- }
if (number_of_frames < 1) {
number_of_frames = 1;
}