X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=5c8b4acd77ef67faaadbdaee4fe991ef27b0d20b;hb=c0a6dc9211fd7855250be34151a70ec4bceb5126;hp=a8d0c28dbf130b2aa06e70696d5b696fdef32806;hpb=95f9e53a3672d79b13521d18d744a0c872fdeb6e;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index a8d0c28..5c8b4ac 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "Game.h" #include "openal_wrapper.h" +#include "Settings.h" using namespace std; @@ -736,6 +737,11 @@ static void ch_wolfie(Game *game, const char *args) set_proportion(0, "1 1 1 1"); } +static void ch_wolfieisgod(Game *game, const char *args) +{ + ch_wolfie(game, args); +} + static void ch_wolf(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:Wolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, @@ -754,6 +760,12 @@ static void ch_darkwolf(Game *game, const char *args) &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); } +static void ch_lizardwolf(Game *game, const char *args) +{ + game->LoadTextureSave(":Data:Textures:Lizardwolf.jpg",&player[0].skeleton.drawmodel.textureptr,1, + &player[0].skeleton.skinText[0],&player[0].skeleton.skinsize); +} + static void ch_white(Game *game, const char *args) { game->LoadTextureSave(":Data:Textures:fur.jpg",&player[0].skeleton.drawmodel.textureptr,1, @@ -1184,7 +1196,7 @@ void Screenshot (void) char temp[1024]; time_t t = time(NULL); struct tm *tme = localtime(&t); - sprintf(temp, "Screenshots\\Screenshot_%04d_%02d_%02d--%02d_%02d_%02d.png", tme->tm_year + 1900, tme->tm_mon + 1, tme->tm_mday, tme->tm_hour, tme->tm_min, tme->tm_sec); + sprintf(temp, "Screenshots/Screenshot_%04d_%02d_%02d--%02d_%02d_%02d.png", tme->tm_year + 1900, tme->tm_mon + 1, tme->tm_mday, tme->tm_hour, tme->tm_min, tme->tm_sec); #if defined(_WIN32) mkdir("Screenshots"); @@ -2787,87 +2799,7 @@ void Game::Tick() if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; - ofstream opstream(ConvertFileName(":Data:config.txt", "w")); - opstream << "Screenwidth:\n"; - opstream << newscreenwidth; - opstream << "\nScreenheight:\n"; - opstream << newscreenheight; - opstream << "\nMouse sensitivity:\n"; - opstream << usermousesensitivity; - opstream << "\nBlur(0,1):\n"; - opstream << ismotionblur; - opstream << "\nOverall Detail(0,1,2) higher=better:\n"; - opstream << newdetail; - opstream << "\nFloating jump:\n"; - opstream << floatjump; - opstream << "\nMouse jump:\n"; - opstream << mousejump; - opstream << "\nAmbient sound:\n"; - opstream << ambientsound; - opstream << "\nBlood (0,1,2):\n"; - opstream << bloodtoggle; - opstream << "\nAuto slomo:\n"; - opstream << autoslomo; - opstream << "\nFoliage:\n"; - opstream << foliage; - opstream << "\nMusic:\n"; - opstream << musictoggle; - opstream << "\nTrilinear:\n"; - opstream << trilinear; - opstream << "\nDecals(shadows,blood puddles,etc):\n"; - opstream << decals; - opstream << "\nInvert mouse:\n"; - opstream << invertmouse; - opstream << "\nGamespeed:\n"; - if(oldgamespeed==0)oldgamespeed=1; - opstream << oldgamespeed; - opstream << "\nDifficulty(0,1,2) higher=harder:\n"; - opstream << difficulty; - opstream << "\nDamage effects(blackout, doublevision):\n"; - opstream << damageeffects; - opstream << "\nText:\n"; - opstream << texttoggle; - opstream << "\nDebug:\n"; - opstream << debugmode; - opstream << "\nVBL Sync:\n"; - opstream << vblsync; - opstream << "\nShow Points:\n"; - opstream << showpoints; - opstream << "\nAlways Blur:\n"; - opstream << alwaysblur; - opstream << "\nImmediate mode (turn on on G5):\n"; - opstream << immediate; - opstream << "\nVelocity blur:\n"; - opstream << velocityblur; - opstream << "\nVolume:\n"; - opstream << volume; - opstream << "\nForward key:\n"; - opstream << KeyToChar(forwardkey); - opstream << "\nBack key:\n"; - opstream << KeyToChar(backkey); - opstream << "\nLeft key:\n"; - opstream << KeyToChar(leftkey); - opstream << "\nRight key:\n"; - opstream << KeyToChar(rightkey); - opstream << "\nJump key:\n"; - opstream << KeyToChar(jumpkey); - opstream << "\nCrouch key:\n"; - opstream << KeyToChar(crouchkey); - opstream << "\nDraw key:\n"; - opstream << KeyToChar(drawkey); - opstream << "\nThrow key:\n"; - opstream << KeyToChar(throwkey); - opstream << "\nAttack key:\n"; - opstream << KeyToChar(attackkey); - opstream << "\nChat key:\n"; - opstream << KeyToChar(chatkey); - opstream << "\nStereoMode:\n"; - opstream << stereomode; - opstream << "\nStereoSeparation:\n"; - opstream << stereoseparation; - opstream << "\nStereoReverse:\n"; - opstream << stereoreverse; - opstream.close(); + SaveSettings(*this); } if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==13||mainmenu==10||mainmenu==11||mainmenu==100){ float gLoc[3]={0,0,0}; @@ -3166,6 +3098,17 @@ void Game::Tick() mainmenu=4; keyselect=-1; } + if(Button() && !oldbutton && selected == 12) { + flashr=1; + flashg=0; + flashb=0; + flashamount=1; + flashdelay=1; + + newstereomode = stereomode; + mainmenu=18; + keyselect = -1; + } if(Button()&&!oldbutton&&selected==8){ float gLoc[3]={0,0,0}; float vel[3]={0,0,0}; @@ -3188,88 +3131,7 @@ void Game::Tick() if(newscreenheight<0)newscreenheight=screenheight; - ofstream opstream(ConvertFileName(":Data:config.txt", "w")); - opstream << "Screenwidth:\n"; - opstream << newscreenwidth; - opstream << "\nScreenheight:\n"; - opstream << newscreenheight; - opstream << "\nMouse sensitivity:\n"; - opstream << usermousesensitivity; - opstream << "\nBlur(0,1):\n"; - opstream << ismotionblur; - opstream << "\nOverall Detail(0,1,2) higher=better:\n"; - opstream << newdetail; - opstream << "\nFloating jump:\n"; - opstream << floatjump; - opstream << "\nMouse jump:\n"; - opstream << mousejump; - opstream << "\nAmbient sound:\n"; - opstream << ambientsound; - opstream << "\nBlood (0,1,2):\n"; - opstream << bloodtoggle; - opstream << "\nAuto slomo:\n"; - opstream << autoslomo; - opstream << "\nFoliage:\n"; - opstream << foliage; - opstream << "\nMusic:\n"; - opstream << musictoggle; - opstream << "\nTrilinear:\n"; - opstream << trilinear; - opstream << "\nDecals(shadows,blood puddles,etc):\n"; - opstream << decals; - opstream << "\nInvert mouse:\n"; - opstream << invertmouse; - opstream << "\nGamespeed:\n"; - if(oldgamespeed==0)oldgamespeed=1; - opstream << oldgamespeed; - opstream << "\nDifficulty(0,1,2) higher=harder:\n"; - opstream << difficulty; - opstream << "\nDamage effects(blackout, doublevision):\n"; - opstream << damageeffects; - opstream << "\nText:\n"; - opstream << texttoggle; - opstream << "\nDebug:\n"; - opstream << debugmode; - opstream << "\nVBL Sync:\n"; - opstream << vblsync; - opstream << "\nShow Points:\n"; - opstream << showpoints; - opstream << "\nAlways Blur:\n"; - opstream << alwaysblur; - opstream << "\nImmediate mode (turn on on G5):\n"; - opstream << immediate; - opstream << "\nVelocity blur:\n"; - opstream << velocityblur; - opstream << "\nVolume:\n"; - opstream << volume; - opstream << "\nForward key:\n"; - opstream << KeyToChar(forwardkey); - opstream << "\nBack key:\n"; - opstream << KeyToChar(backkey); - opstream << "\nLeft key:\n"; - opstream << KeyToChar(leftkey); - opstream << "\nRight key:\n"; - opstream << KeyToChar(rightkey); - opstream << "\nJump key:\n"; - opstream << KeyToChar(jumpkey); - opstream << "\nCrouch key:\n"; - opstream << KeyToChar(crouchkey); - opstream << "\nDraw key:\n"; - opstream << KeyToChar(drawkey); - opstream << "\nThrow key:\n"; - opstream << KeyToChar(throwkey); - opstream << "\nAttack key:\n"; - opstream << KeyToChar(attackkey); - opstream << "\nChat key:\n"; - opstream << KeyToChar(chatkey); - opstream << "\nStereoMode:\n"; - opstream << stereomode; - opstream << "\nStereoSeparation:\n"; - opstream << stereoseparation; - opstream << "\nStereoReverse:\n"; - opstream << stereoreverse; - opstream.close(); - + SaveSettings(*this); if(mainmenu==3&&gameon)mainmenu=2; if(mainmenu==3&&!gameon)mainmenu=1; } @@ -3809,9 +3671,52 @@ void Game::Tick() if(Button())oldbutton=1; else oldbutton=0; } + if (mainmenu==18) { + if(Button()&&!oldbutton) { + printf("Button %i pressed\n", selected); + } + + if(Button()&&!oldbutton&&selected==0) { + newstereomode = (StereoMode)(newstereomode + 1); + while(!CanInitStereo(newstereomode)) { + printf("Failed to initialize mode %s (%i)\n", StereoModeName(newstereomode), newstereomode); + newstereomode = (StereoMode)(newstereomode + 1); + if ( newstereomode >= stereoCount ) { + newstereomode = stereoNone; + } + } + } + + if(buttons[0]&&!oldbutton&&selected==1) { + stereoseparation+=0.001; + } + if(buttons[1]&&!oldbutton&&selected==1) { + stereoseparation-=0.001; + } + + if(Button()&&!oldbutton&&selected==2) { + stereoreverse =! stereoreverse; + } + + if(Button()&&!oldbutton&&selected==3) { + flashr=1; + flashg=0; + flashb=0; + flashamount=1; + flashdelay=1; + + stereomode = newstereomode; + InitStereo(stereomode); + + mainmenu=3; + } + + if(Button() || buttons[1])oldbutton=1; + else oldbutton=0; + } - if(Button())oldbutton=1; + if(Button()||buttons[1])oldbutton=1; else oldbutton=0; if(IsKeyDown(theKeyMap, MAC_Q_KEY)&&IsKeyDown(theKeyMap, MAC_COMMAND_KEY)){ @@ -3822,87 +3727,7 @@ void Game::Tick() if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; - ofstream opstream(ConvertFileName(":Data:config.txt", "w")); - opstream << "Screenwidth:\n"; - opstream << newscreenwidth; - opstream << "\nScreenheight:\n"; - opstream << newscreenheight; - opstream << "\nMouse sensitivity:\n"; - opstream << usermousesensitivity; - opstream << "\nBlur(0,1):\n"; - opstream << ismotionblur; - opstream << "\nOverall Detail(0,1,2) higher=better:\n"; - opstream << newdetail; - opstream << "\nFloating jump:\n"; - opstream << floatjump; - opstream << "\nMouse jump:\n"; - opstream << mousejump; - opstream << "\nAmbient sound:\n"; - opstream << ambientsound; - opstream << "\nBlood (0,1,2):\n"; - opstream << bloodtoggle; - opstream << "\nAuto slomo:\n"; - opstream << autoslomo; - opstream << "\nFoliage:\n"; - opstream << foliage; - opstream << "\nMusic:\n"; - opstream << musictoggle; - opstream << "\nTrilinear:\n"; - opstream << trilinear; - opstream << "\nDecals(shadows,blood puddles,etc):\n"; - opstream << decals; - opstream << "\nInvert mouse:\n"; - opstream << invertmouse; - opstream << "\nGamespeed:\n"; - if(oldgamespeed==0)oldgamespeed=1; - opstream << oldgamespeed; - opstream << "\nDifficulty(0,1,2) higher=harder:\n"; - opstream << difficulty; - opstream << "\nDamage effects(blackout, doublevision):\n"; - opstream << damageeffects; - opstream << "\nText:\n"; - opstream << texttoggle; - opstream << "\nDebug:\n"; - opstream << debugmode; - opstream << "\nVBL Sync:\n"; - opstream << vblsync; - opstream << "\nShow Points:\n"; - opstream << showpoints; - opstream << "\nAlways Blur:\n"; - opstream << alwaysblur; - opstream << "\nImmediate mode (turn on on G5):\n"; - opstream << immediate; - opstream << "\nVelocity blur:\n"; - opstream << velocityblur; - opstream << "\nVolume:\n"; - opstream << volume; - opstream << "\nForward key:\n"; - opstream << KeyToChar(forwardkey); - opstream << "\nBack key:\n"; - opstream << KeyToChar(backkey); - opstream << "\nLeft key:\n"; - opstream << KeyToChar(leftkey); - opstream << "\nRight key:\n"; - opstream << KeyToChar(rightkey); - opstream << "\nJump key:\n"; - opstream << KeyToChar(jumpkey); - opstream << "\nCrouch key:\n"; - opstream << KeyToChar(crouchkey); - opstream << "\nDraw key:\n"; - opstream << KeyToChar(drawkey); - opstream << "\nThrow key:\n"; - opstream << KeyToChar(throwkey); - opstream << "\nAttack key:\n"; - opstream << KeyToChar(attackkey); - opstream << "\nChat key:\n"; - opstream << KeyToChar(chatkey); - opstream << "\nStereoMode:\n"; - opstream << stereomode; - opstream << "\nStereoSeparation:\n"; - opstream << stereoseparation; - opstream << "\nStereoReverse:\n"; - opstream << stereoreverse; - opstream.close(); + SaveSettings(*this); } } @@ -4263,87 +4088,7 @@ void Game::Tick() if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; - ofstream opstream(ConvertFileName(":Data:config.txt", "w")); - opstream << "Screenwidth:\n"; - opstream << newscreenwidth; - opstream << "\nScreenheight:\n"; - opstream << newscreenheight; - opstream << "\nMouse sensitivity:\n"; - opstream << usermousesensitivity; - opstream << "\nBlur(0,1):\n"; - opstream << ismotionblur; - opstream << "\nOverall Detail(0,1,2) higher=better:\n"; - opstream << newdetail; - opstream << "\nFloating jump:\n"; - opstream << floatjump; - opstream << "\nMouse jump:\n"; - opstream << mousejump; - opstream << "\nAmbient sound:\n"; - opstream << ambientsound; - opstream << "\nBlood (0,1,2):\n"; - opstream << bloodtoggle; - opstream << "\nAuto slomo:\n"; - opstream << autoslomo; - opstream << "\nFoliage:\n"; - opstream << foliage; - opstream << "\nMusic:\n"; - opstream << musictoggle; - opstream << "\nTrilinear:\n"; - opstream << trilinear; - opstream << "\nDecals(shadows,blood puddles,etc):\n"; - opstream << decals; - opstream << "\nInvert mouse:\n"; - opstream << invertmouse; - opstream << "\nGamespeed:\n"; - if(oldgamespeed==0)oldgamespeed=1; - opstream << oldgamespeed; - opstream << "\nDifficulty(0,1,2) higher=harder:\n"; - opstream << difficulty; - opstream << "\nDamage effects(blackout, doublevision):\n"; - opstream << damageeffects; - opstream << "\nText:\n"; - opstream << texttoggle; - opstream << "\nDebug:\n"; - opstream << debugmode; - opstream << "\nVBL Sync:\n"; - opstream << vblsync; - opstream << "\nShow Points:\n"; - opstream << showpoints; - opstream << "\nAlways Blur:\n"; - opstream << alwaysblur; - opstream << "\nImmediate mode (turn on on G5):\n"; - opstream << immediate; - opstream << "\nVelocity blur:\n"; - opstream << velocityblur; - opstream << "\nVolume:\n"; - opstream << volume; - opstream << "\nForward key:\n"; - opstream << KeyToChar(forwardkey); - opstream << "\nBack key:\n"; - opstream << KeyToChar(backkey); - opstream << "\nLeft key:\n"; - opstream << KeyToChar(leftkey); - opstream << "\nRight key:\n"; - opstream << KeyToChar(rightkey); - opstream << "\nJump key:\n"; - opstream << KeyToChar(jumpkey); - opstream << "\nCrouch key:\n"; - opstream << KeyToChar(crouchkey); - opstream << "\nDraw key:\n"; - opstream << KeyToChar(drawkey); - opstream << "\nThrow key:\n"; - opstream << KeyToChar(throwkey); - opstream << "\nAttack key:\n"; - opstream << KeyToChar(attackkey); - opstream << "\nChat key:\n"; - opstream << KeyToChar(chatkey); - opstream << "\nStereoMode:\n"; - opstream << stereomode; - opstream << "\nStereoSeparation:\n"; - opstream << stereoseparation; - opstream << "\nStereoReverse:\n"; - opstream << stereoreverse; - opstream.close(); + SaveSettings(*this); } }