diff --git a/JGE/src/JAnimator.cpp b/JGE/src/JAnimator.cpp index 802d2badd..fca367832 100644 --- a/JGE/src/JAnimator.cpp +++ b/JGE/src/JAnimator.cpp @@ -67,7 +67,7 @@ bool JAnimator::Load(const char* scriptFile) element = script->ToElement(); printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name")); - string type[] = + string type[] = { "ANIMATION_TYPE_LOOPING", "ANIMATION_TYPE_ONCE_AND_STAY", @@ -76,9 +76,9 @@ bool JAnimator::Load(const char* scriptFile) "ANIMATION_TYPE_PINGPONG" }; - const char* aniType = element->Attribute("type"); + const char* aniType = element->Attribute("type"); for (int i=0;i<5;i++) - if (type[i] == aniType) + if (type[i] == aniType) { SetAnimationType(i); break; @@ -108,7 +108,7 @@ bool JAnimator::Load(const char* scriptFile) element = param->ToElement(); if (element != NULL) { - if (element->ValueStr() == "settings") + if (element->ValueStr() == "settings") { const char* quadName = element->Attribute("quad"); JQuad* quad = mResource->GetQuad(quadName); diff --git a/JGE/src/JOBJModel.cpp b/JGE/src/JOBJModel.cpp index 276c46a59..04e504a02 100644 --- a/JGE/src/JOBJModel.cpp +++ b/JGE/src/JOBJModel.cpp @@ -75,10 +75,10 @@ bool JOBJModel::Load(const char *modelName, const char *textureName) int count; - while (filePtr < size) - { + while (filePtr < size) + { filePtr = ReadLine(tmpLine, buffer, filePtr, size); - { + { if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3)) { @@ -89,19 +89,19 @@ bool JOBJModel::Load(const char *modelName, const char *textureName) if (count == 4) { - if (string("vn") == s1) + if (string("vn") == s1) normalList.push_back(vert); - else if (string("vt") == s1) + else if (string("vt") == s1) texList.push_back(vert); - else if (string("v") == s1) + else if (string("v") == s1) vertList.push_back(vert); } else if (count == 3) { - if (string("vt") == s1) + if (string("vt") == s1) texList.push_back(vert); } - + } else if (tmpLine[0] == 'f') { @@ -211,7 +211,7 @@ bool JOBJModel::Load(const char *modelName, const char *textureName) if (textureName != NULL) mTexture = JRenderer::GetInstance()->LoadTexture(textureName); - return true; + return true; } diff --git a/JGE/src/JParticleEffect.cpp b/JGE/src/JParticleEffect.cpp index d56606846..a991b4f4e 100644 --- a/JGE/src/JParticleEffect.cpp +++ b/JGE/src/JParticleEffect.cpp @@ -90,7 +90,7 @@ bool JParticleEffect::Load(const char* filename) // FIELD_COUNT // }; - const string lifeValues[] = + const string lifeValues[] = { "speed", "size", @@ -104,7 +104,7 @@ bool JParticleEffect::Load(const char* filename) "gravity" }; - const string typeNames[] = + const string typeNames[] = { "POINT", "AREA", @@ -113,7 +113,7 @@ bool JParticleEffect::Load(const char* filename) "CIRCLE" }; - const string modeNames[] = + const string modeNames[] = { "REPEAT", "ONCE", @@ -149,32 +149,32 @@ bool JParticleEffect::Load(const char* filename) { element = param->ToElement(); - if (string("settings") == element->Attribute("name")) + if (string("settings") == element->Attribute("name")) { - if (string("NORMAL") == element->Attribute("blend")) + if (string("NORMAL") == element->Attribute("blend")) mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - else if (string("ADDITIVE") == element->Attribute("blend")) + else if (string("ADDITIVE") == element->Attribute("blend")) mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE); for (unsigned int i=0;iAttribute("mode")) + if (modeNames[i] == element->Attribute("mode")) { mParticleEmitters[mEmitterCount]->mEmitterMode = i; #if defined (_DEBUG) - printf("emitter mode:%s\n", modeNames[i].c_str()); + printf("emitter mode:%s\n", modeNames[i].c_str()); #endif break; } } for (unsigned i=0;iAttribute("type")) + if (typeNames[i] == element->Attribute("type")) { mParticleEmitters[mEmitterCount]->mType = i; #if defined (_DEBUG) - printf("emitter type:%s\n", typeNames[i].c_str()); + printf("emitter type:%s\n", typeNames[i].c_str()); #endif break; } @@ -213,7 +213,7 @@ bool JParticleEffect::Load(const char* filename) } } - else if (string("quantity") == element->Attribute("name")) + else if (string("quantity") == element->Attribute("name")) { for (key = param->FirstChild(); key; key = key->NextSibling()) { @@ -227,7 +227,7 @@ bool JParticleEffect::Load(const char* filename) } } - else if (string("lifex") == element->Attribute("name")) + else if (string("lifex") == element->Attribute("name")) { if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) @@ -236,7 +236,7 @@ bool JParticleEffect::Load(const char* filename) mParticleEmitters[mEmitterCount]->mLifeMax= value; } } - else if (string("anglex") == element->Attribute("name")) + else if (string("anglex") == element->Attribute("name")) { if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) @@ -245,7 +245,7 @@ bool JParticleEffect::Load(const char* filename) mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD; } } - else if (string("speedx") == element->Attribute("name")) + else if (string("speedx") == element->Attribute("name")) { if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) @@ -254,7 +254,7 @@ bool JParticleEffect::Load(const char* filename) mParticleEmitters[mEmitterCount]->mSpeedMax= value; } } - else if (string("sizex") == element->Attribute("name")) + else if (string("sizex") == element->Attribute("name")) { if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) @@ -267,7 +267,7 @@ bool JParticleEffect::Load(const char* filename) { for (int i=0;iAttribute("name")) + if (lifeValues[i] == element->Attribute("name")) { for (key = param->FirstChild(); key; key = key->NextSibling()) { diff --git a/JGE/src/JResourceManager.cpp b/JGE/src/JResourceManager.cpp index 6d7702f02..bd557d1f4 100644 --- a/JGE/src/JResourceManager.cpp +++ b/JGE/src/JResourceManager.cpp @@ -119,11 +119,11 @@ bool JResourceManager::LoadResource(const string& resourceName) element = node->ToElement(); if (element != NULL) { - if (element->ValueStr() == "texture") + if (element->ValueStr() == "texture") { CreateTexture(element->Attribute("name")); } - else if (element->ValueStr() == "quad") + else if (element->ValueStr() == "quad") { string quadName = element->Attribute("name"); string textureName = element->Attribute("texture"); @@ -170,7 +170,7 @@ bool JResourceManager::LoadResource(const string& resourceName) GetQuad(id)->SetHotSpot(hotspotX, hotspotY); } } - else if (element->ValueStr() == "font") + else if (element->ValueStr() == "font") { } diff --git a/JGE/src/hge/hgefont.cpp b/JGE/src/hge/hgefont.cpp index 02c18a4e5..9adc621b2 100644 --- a/JGE/src/hge/hgefont.cpp +++ b/JGE/src/hge/hgefont.cpp @@ -72,7 +72,7 @@ hgeFont::hgeFont(const char *szFont, bool bMipmap __attribute__((unused))) fileSys->CloseFile(); pdesc=_get_line(desc,linebuf); - if(strcmp(linebuf, FNTHEADERTAG)) + if(strcmp(linebuf, FNTHEADERTAG)) { // hge->System_Log("Font %s has incorrect format.", szFont); delete[] desc;