From: Côme Chilliet Date: Wed, 14 Dec 2016 16:20:00 +0000 (+0700) Subject: Fixed a few ifs X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=1f7114ce6178de7231a890c31535acbbc34b3c6b;p=lugaru.git Fixed a few ifs --- diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 0cc214e..8f33c0c 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -237,10 +237,11 @@ int Game::DrawGLScene(StereoSide side) static XYZ terrainlight; static float distance; - if (drawmode == normalmode) + if (drawmode == normalmode) { Game::ReSizeGLScene(90, .1f); - if (drawmode != normalmode) + } else { glViewport(0, 0, texviewwidth, texviewheight); + } glDepthFunc(GL_LEQUAL); glDepthMask(1); glAlphaFunc(GL_GREATER, 0.0001f); @@ -286,9 +287,10 @@ int Game::DrawGLScene(StereoSide side) else blurness -= multiplier * 5; - if (environment == desertenvironment && detail == 2) - glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, blurness + .4 ); if (environment == desertenvironment) { + if (detail == 2) { + glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, blurness + .4 ); + } glRotatef((float)(abs(Random() % 100)) / 1000, 1, 0, 0); glRotatef((float)(abs(Random() % 100)) / 1000, 0, 1, 0); } diff --git a/Source/Objects/Objects.cpp b/Source/Objects/Objects.cpp index 4b97666..3877b9e 100644 --- a/Source/Objects/Objects.cpp +++ b/Source/Objects/Objects.cpp @@ -595,14 +595,14 @@ void Objects::MakeObject(int atype, XYZ where, float ayaw, float ascale) model[numobjects].CalculateNormals(1); model[numobjects].ScaleNormals(-1, -1, -1); - if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { - if (detail == 2) + if (detail == 2) { + if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 2, .4, 0); - } + } - if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { - if (detail == 2) + if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 1, .4, 0); + } } if (atype != treeleavestype && atype != bushtype && atype != firetype) @@ -689,18 +689,19 @@ void Objects::MakeObject(int atype, XYZ where, float ayaw, float apitch, float a model[numobjects].CalculateNormals(1); model[numobjects].ScaleNormals(-1, -1, -1); - if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { - if (detail == 2) + if (detail == 2) { + if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 2, .4, 0); - } + } - if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { - if (detail == 2) + if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) { terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 1, .4, 0); + } } - if (atype != treeleavestype && atype != bushtype && atype != firetype) + if (atype != treeleavestype && atype != bushtype && atype != firetype) { terrain.AddObject(where + DoRotation(model[numobjects].boundingspherecenter, 0, ayaw, 0), model[numobjects].boundingsphereradius, numobjects); + } numobjects++; }