X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=a47edc9d765065e911bae8ee0b04ca6262d07d65;hb=75f57e08723a98ddbd4383be19c228f031c18b53;hp=2b0f4c469689bc21231dcf049d525fe0661ec57d;hpb=8dda34d525dcb410195a05592fa72cef1954777b;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 2b0f4c4..a47edc9 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif +#include #include #include "Game.h" #include "openal_wrapper.h" @@ -63,7 +64,6 @@ extern Light light; extern float texdetail; extern GLubyte bloodText[512*512*3]; extern GLubyte wolfbloodText[512*512*3]; -extern float terraindetail; extern float camerashake; extern float woozy; extern float blackout; @@ -107,7 +107,6 @@ extern bool texttoggle; extern bool alwaysblur; extern float gamespeed; extern bool decals; -extern bool vblsync; extern bool immediate; extern bool velocityblur; extern float tintr,tintg,tintb; @@ -433,7 +432,7 @@ static void ch_size(Game *game, const char *args) static int find_closest() { int closest = 0; - float closestdist = 1.0/0.0; + float closestdist = std::numeric_limits::max(); for (int i = 1; i < numplayers; i++) { float distance; @@ -2373,7 +2372,7 @@ void Game::Tick() } } } - if(mainmenu==3){ + else if(mainmenu==3){ if(Input::Button()&&!oldbutton&&selected!=-1){ fireSound(); } @@ -2509,7 +2508,7 @@ void Game::Tick() if(mainmenu==3&&!gameon)mainmenu=1; } } - if(mainmenu==4){ + else if(mainmenu==4){ if(Input::Button()&&!oldbutton&&selected!=-1&&!waiting){ fireSound(); if(selected<9&&keyselect==-1) @@ -2531,7 +2530,7 @@ void Game::Tick() } } - if(mainmenu==5){ + else if(mainmenu==5){ if(endgame==2){ accountactive->endGame(); @@ -2640,7 +2639,7 @@ void Game::Tick() mainmenu=5; } } - if(mainmenu==10){ + else if(mainmenu==10){ endgame=2; if(Input::Button()&&!oldbutton&&selected==3){ fireSound(); @@ -2651,7 +2650,7 @@ void Game::Tick() } } - if(mainmenu==6){ + else if(mainmenu==6){ if(Input::Button()&&!oldbutton) { if(selected>-1){ fireSound(); @@ -2666,7 +2665,7 @@ void Game::Tick() } } } - if(mainmenu==7){ + else if(mainmenu==7){ if(Input::Button()&&!oldbutton) { if(selected!=-1){ fireSound(); @@ -2691,7 +2690,7 @@ void Game::Tick() } } } - if(mainmenu==8){ + else if(mainmenu==8){ if(Input::Button()&&!oldbutton&&selected>-1){ fireSound(); @@ -2704,7 +2703,7 @@ void Game::Tick() } } - if (mainmenu==18) { + else if (mainmenu==18) { if(Input::Button()&&!oldbutton&&selected==0) { newstereomode = (StereoMode)(newstereomode + 1); while(!CanInitStereo(newstereomode)) { @@ -7188,8 +7187,8 @@ void Game::Tick() for(k=0;k