X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameInitDispose.cpp;h=fefba877857be0d8a1c4abc12158fcb1aa3ac623;hb=3326a4860ff8b052e7abfe86698ce7e51cfc441a;hp=d1f7b9d5450ed553140db8d78f67667b3802f3c2;hpb=e08372a2095837a0b951ccb68c3499ef67c1a827;p=lugaru.git diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index d1f7b9d..fefba87 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -18,12 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "openal_wrapper.h" -#include "Animation/Animation.h" -#include "Texture.h" -#include "Utils/Folders.h" -#include "Menu.h" +#include "Game.hpp" + +#include "Animation/Animation.hpp" +#include "Audio/openal_wrapper.hpp" +#include "Graphic/Texture.hpp" +#include "Menu/Menu.hpp" +#include "Utils/Folders.hpp" extern float screenwidth, screenheight; extern float viewdistance; @@ -57,7 +58,6 @@ extern float flashamount, flashr, flashg, flashb; extern int flashdelay; extern int whichjointstartarray[26]; extern int whichjointendarray[26]; -extern int difficulty; extern float slomospeed; extern bool gamestarted; @@ -651,12 +651,11 @@ void Game::LoadScreenTexture() glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0); } -//TODO: move LoadStuff() closer to GameTick.cpp to get rid of various vars shared in Game.h +//TODO: move LoadStuff() closer to GameTick.cpp to get rid of various vars shared in Game.hpp void Game::LoadStuff() { static float temptexdetail; static float viewdistdetail; - static int i, j; float megascale = 1; LOGFUNC; @@ -669,7 +668,6 @@ void Game::LoadStuff() p->skeleton.drawmodel.textureptr.destroy(); } - i = abs(Random() % 4); visibleloading = 0; //don't use loadscreentexture yet loadscreentexture.load("Textures/Fire.jpg", 1); visibleloading = 1; @@ -685,12 +683,13 @@ void Game::LoadStuff() if (detail == 2) { texdetail = 1; - } - if (detail == 1) { + kTextureSize = 1024; + } else if (detail == 1) { texdetail = 2; - } - if (detail == 0) { + kTextureSize = 512; + } else { texdetail = 4; + kTextureSize = 256; } realtexdetail = texdetail; @@ -757,14 +756,6 @@ void Game::LoadStuff() viewer = 0; - - if (detail) - kTextureSize = 1024; - if (detail == 1) - kTextureSize = 512; - if (detail == 0) - kTextureSize = 256; - //Set up distant light light.color[0] = .95; light.color[1] = .95; @@ -828,23 +819,23 @@ void Game::LoadStuff() moveamount.z = 2; // FIXME - Why this uses skeleton.joints.size() and not Animation::numjoints? (are they equal?) // It seems skeleton.joints.size() is 0 at this point, so this is useless. - for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { - for (j = 0; j < Animation::animations[knifesneakattackanim].frames.size(); j++) { + for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { + for (unsigned j = 0; j < Animation::animations[knifesneakattackanim].frames.size(); j++) { Animation::animations[knifesneakattackanim].frames[j].joints[i].position += moveamount; } } LoadingScreen(); - for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { - for (j = 0; j < Animation::animations[knifesneakattackedanim].frames.size(); j++) { + for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { + for (unsigned j = 0; j < Animation::animations[knifesneakattackedanim].frames.size(); j++) { Animation::animations[knifesneakattackedanim].frames[j].joints[i].position += moveamount; } } LoadingScreen(); - for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { + for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { Animation::animations[dead1anim].frames[1].joints[i].position = Animation::animations[dead1anim].frames[0].joints[i].position; Animation::animations[dead2anim].frames[1].joints[i].position = Animation::animations[dead2anim].frames[0].joints[i].position; Animation::animations[dead3anim].frames[1].joints[i].position = Animation::animations[dead3anim].frames[0].joints[i].position; @@ -860,20 +851,20 @@ void Game::LoadStuff() Animation::animations[dead3anim].frames[1].speed = 0.001; Animation::animations[dead4anim].frames[1].speed = 0.001; - for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { - for (j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) { + for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { + for (unsigned j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) { Animation::animations[swordsneakattackanim].frames[j].joints[i].position += moveamount; } } LoadingScreen(); - for (j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) { + for (unsigned j = 0; j < Animation::animations[swordsneakattackanim].frames.size(); j++) { Animation::animations[swordsneakattackanim].frames[j].weapontarget += moveamount; } LoadingScreen(); - for (i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { - for (j = 0; j < Animation::animations[swordsneakattackedanim].frames.size(); j++) { + for (unsigned i = 0; i < Person::players[0]->skeleton.joints.size(); i++) { + for (unsigned j = 0; j < Animation::animations[swordsneakattackedanim].frames.size(); j++) { Animation::animations[swordsneakattackedanim].frames[j].joints[i].position += moveamount; } }