Use tabs instead of spaces if the file uses tabs

This commit is contained in:
Tobias Loose
2013-11-29 13:51:13 +01:00
parent 6699902c24
commit dbece750f8
5 changed files with 33 additions and 33 deletions

View File

@@ -67,7 +67,7 @@ bool JAnimator::Load(const char* scriptFile)
element = script->ToElement(); element = script->ToElement();
printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name")); printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name"));
string type[] = string type[] =
{ {
"ANIMATION_TYPE_LOOPING", "ANIMATION_TYPE_LOOPING",
"ANIMATION_TYPE_ONCE_AND_STAY", "ANIMATION_TYPE_ONCE_AND_STAY",
@@ -76,9 +76,9 @@ bool JAnimator::Load(const char* scriptFile)
"ANIMATION_TYPE_PINGPONG" "ANIMATION_TYPE_PINGPONG"
}; };
const char* aniType = element->Attribute("type"); const char* aniType = element->Attribute("type");
for (int i=0;i<5;i++) for (int i=0;i<5;i++)
if (type[i] == aniType) if (type[i] == aniType)
{ {
SetAnimationType(i); SetAnimationType(i);
break; break;
@@ -108,7 +108,7 @@ bool JAnimator::Load(const char* scriptFile)
element = param->ToElement(); element = param->ToElement();
if (element != NULL) if (element != NULL)
{ {
if (element->ValueStr() == "settings") if (element->ValueStr() == "settings")
{ {
const char* quadName = element->Attribute("quad"); const char* quadName = element->Attribute("quad");
JQuad* quad = mResource->GetQuad(quadName); JQuad* quad = mResource->GetQuad(quadName);

View File

@@ -75,10 +75,10 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
int count; int count;
while (filePtr < size) while (filePtr < size)
{ {
filePtr = ReadLine(tmpLine, buffer, filePtr, size); filePtr = ReadLine(tmpLine, buffer, filePtr, size);
{ {
if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3)) if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3))
{ {
@@ -89,19 +89,19 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
if (count == 4) if (count == 4)
{ {
if (string("vn") == s1) if (string("vn") == s1)
normalList.push_back(vert); normalList.push_back(vert);
else if (string("vt") == s1) else if (string("vt") == s1)
texList.push_back(vert); texList.push_back(vert);
else if (string("v") == s1) else if (string("v") == s1)
vertList.push_back(vert); vertList.push_back(vert);
} }
else if (count == 3) else if (count == 3)
{ {
if (string("vt") == s1) if (string("vt") == s1)
texList.push_back(vert); texList.push_back(vert);
} }
} }
else if (tmpLine[0] == 'f') else if (tmpLine[0] == 'f')
{ {
@@ -211,7 +211,7 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
if (textureName != NULL) if (textureName != NULL)
mTexture = JRenderer::GetInstance()->LoadTexture(textureName); mTexture = JRenderer::GetInstance()->LoadTexture(textureName);
return true; return true;
} }

View File

@@ -90,7 +90,7 @@ bool JParticleEffect::Load(const char* filename)
// FIELD_COUNT // FIELD_COUNT
// }; // };
const string lifeValues[] = const string lifeValues[] =
{ {
"speed", "speed",
"size", "size",
@@ -104,7 +104,7 @@ bool JParticleEffect::Load(const char* filename)
"gravity" "gravity"
}; };
const string typeNames[] = const string typeNames[] =
{ {
"POINT", "POINT",
"AREA", "AREA",
@@ -113,7 +113,7 @@ bool JParticleEffect::Load(const char* filename)
"CIRCLE" "CIRCLE"
}; };
const string modeNames[] = const string modeNames[] =
{ {
"REPEAT", "REPEAT",
"ONCE", "ONCE",
@@ -149,32 +149,32 @@ bool JParticleEffect::Load(const char* filename)
{ {
element = param->ToElement(); 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); 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); mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE);
for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++) for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++)
{ {
if (modeNames[i] == element->Attribute("mode")) if (modeNames[i] == element->Attribute("mode"))
{ {
mParticleEmitters[mEmitterCount]->mEmitterMode = i; mParticleEmitters[mEmitterCount]->mEmitterMode = i;
#if defined (_DEBUG) #if defined (_DEBUG)
printf("emitter mode:%s\n", modeNames[i].c_str()); printf("emitter mode:%s\n", modeNames[i].c_str());
#endif #endif
break; break;
} }
} }
for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++) for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++)
{ {
if (typeNames[i] == element->Attribute("type")) if (typeNames[i] == element->Attribute("type"))
{ {
mParticleEmitters[mEmitterCount]->mType = i; mParticleEmitters[mEmitterCount]->mType = i;
#if defined (_DEBUG) #if defined (_DEBUG)
printf("emitter type:%s\n", typeNames[i].c_str()); printf("emitter type:%s\n", typeNames[i].c_str());
#endif #endif
break; 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()) 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 && if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -236,7 +236,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mLifeMax= value; 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 && if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -245,7 +245,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD; 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 && if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -254,7 +254,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mSpeedMax= value; 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 && if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -267,7 +267,7 @@ bool JParticleEffect::Load(const char* filename)
{ {
for (int i=0;i<FIELD_COUNT;i++) for (int i=0;i<FIELD_COUNT;i++)
{ {
if (lifeValues[i] == element->Attribute("name")) if (lifeValues[i] == element->Attribute("name"))
{ {
for (key = param->FirstChild(); key; key = key->NextSibling()) for (key = param->FirstChild(); key; key = key->NextSibling())
{ {

View File

@@ -119,11 +119,11 @@ bool JResourceManager::LoadResource(const string& resourceName)
element = node->ToElement(); element = node->ToElement();
if (element != NULL) if (element != NULL)
{ {
if (element->ValueStr() == "texture") if (element->ValueStr() == "texture")
{ {
CreateTexture(element->Attribute("name")); CreateTexture(element->Attribute("name"));
} }
else if (element->ValueStr() == "quad") else if (element->ValueStr() == "quad")
{ {
string quadName = element->Attribute("name"); string quadName = element->Attribute("name");
string textureName = element->Attribute("texture"); string textureName = element->Attribute("texture");
@@ -170,7 +170,7 @@ bool JResourceManager::LoadResource(const string& resourceName)
GetQuad(id)->SetHotSpot(hotspotX, hotspotY); GetQuad(id)->SetHotSpot(hotspotX, hotspotY);
} }
} }
else if (element->ValueStr() == "font") else if (element->ValueStr() == "font")
{ {
} }

View File

@@ -72,7 +72,7 @@ hgeFont::hgeFont(const char *szFont, bool bMipmap __attribute__((unused)))
fileSys->CloseFile(); fileSys->CloseFile();
pdesc=_get_line(desc,linebuf); pdesc=_get_line(desc,linebuf);
if(strcmp(linebuf, FNTHEADERTAG)) if(strcmp(linebuf, FNTHEADERTAG))
{ {
// hge->System_Log("Font %s has incorrect format.", szFont); // hge->System_Log("Font %s has incorrect format.", szFont);
delete[] desc; delete[] desc;