X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FGameInitDispose.cpp;h=57f6958faba924144401c348bb146e0ae268dcb9;hp=b082ef10676417feb07b91ddf202ac5a5ddd15d8;hb=b9a46d8e2b7e7e22c706e7dd3734f31015db4408;hpb=8b6e8f3ad7390309795eb35c0959264cb7924402 diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index b082ef1..57f6958 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -179,16 +179,19 @@ void Game::LoadingScreen() AbsoluteTime currTime = UpTime(); double deltaTime = (float)AbsoluteDeltaToDuration(currTime, frametime); - if (0 > deltaTime) // if negative microseconds + if (0 > deltaTime) { // if negative microseconds deltaTime /= -1000000.0; - else // else milliseconds + } else { // else milliseconds deltaTime /= 1000.0; + } multiplier = deltaTime; - if (multiplier < .001) + if (multiplier < .001) { multiplier = .001; - if (multiplier > 10) + } + if (multiplier > 10) { multiplier = 10; + } if (multiplier > .05) { frametime = currTime; // reset for next time interval @@ -200,8 +203,9 @@ void Game::LoadingScreen() loadtime += multiplier * 4; loadprogress = loadtime; - if (loadprogress > 100) + if (loadprogress > 100) { loadprogress = 100; + } //Background @@ -341,13 +345,16 @@ void Game::LoadingScreen() //Text if (flashamount > 0) { - if (flashamount > 1) + if (flashamount > 1) { flashamount = 1; - if (flashdelay <= 0) + } + if (flashdelay <= 0) { flashamount -= multiplier; + } flashdelay--; - if (flashamount < 0) + if (flashamount < 0) { flashamount = 0; + } glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glDisable(GL_LIGHTING); @@ -556,8 +563,9 @@ void Game::InitGame() OPENAL_SetSFXMasterVolume((int)(volume * 255)); loadAllSounds(); - if (musictoggle) + if (musictoggle) { emit_stream_np(stream_menutheme); + } cursortexture.load("Textures/Cursor.png", 0); @@ -566,8 +574,9 @@ void Game::InitGame() Maparrowtexture.load("Textures/MapArrow.png", 0); temptexdetail = texdetail; - if (texdetail > 2) + if (texdetail > 2) { texdetail = 2; + } Mainmenuitems[0].load("Textures/Lugaru.png", 0); Mainmenuitems[1].load("Textures/NewGame.png", 0); Mainmenuitems[2].load("Textures/Options.png", 0); @@ -599,8 +608,9 @@ void Game::LoadScreenTexture() { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!Game::screentexture) + if (!Game::screentexture) { glGenTextures(1, &Game::screentexture); + } glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glEnable(GL_TEXTURE_2D);