X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=4bcb66c07ae657b55880ff5c8a41cea3d1648df1;hb=44e4a5263469eb8e216bd6abfad3f0b5e2627d69;hp=b6378d134014e9bb515149b5da05c69797f235fd;hpb=54a459691cc0e2d314008b4f3f4ce349417dadc2;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index b6378d1..4bcb66c 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -76,8 +76,6 @@ extern bool mousejump; extern float viewdistance; extern bool freeze; extern bool autoslomo; -extern int newnetmessages; -extern char netmessages[256]; extern bool keyboardfrozen; extern int netdatanew; extern bool loadingstuff; @@ -224,6 +222,31 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; + +static const char *rabbitskin[] = { +":Data:Textures:Fur3.jpg", +":Data:Textures:Fur.jpg", +":Data:Textures:Fur2.jpg", +":Data:Textures:Lynx.jpg", +":Data:Textures:Otter.jpg", +":Data:Textures:Opal.jpg", +":Data:Textures:Sable.jpg", +":Data:Textures:Chocolate.jpg", +":Data:Textures:BW2.jpg", +":Data:Textures:WB2.jpg" +}; + +static const char *wolfskin[] = { +":Data:Textures:Wolf.jpg", +":Data:Textures:Darkwolf.jpg", +":Data:Textures:Snowwolf.jpg" +}; + +#define STATIC_ASSERT(x) extern int s_a_dummy[2 * (!!(x)) - 1]; +STATIC_ASSERT (rabbittype == 0 && wolftype == 1) + +static const char **creatureskin[] = {rabbitskin, wolfskin}; + /********************> Tick() <*****/ extern OPENAL_STREAM * strm[20]; extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused); @@ -658,10 +681,10 @@ void Game::Setenvironment(int which) OPENAL_Sample_Free(samp[footstepsound2]); OPENAL_Sample_Free(samp[footstepsound3]); OPENAL_Sample_Free(samp[footstepsound4]); - samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow2.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepstone1.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepstone2.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow1.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow2.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone1.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone2.ogg"), OPENAL_HW3D, 0, 0); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); @@ -712,10 +735,10 @@ void Game::Setenvironment(int which) OPENAL_Sample_Free(samp[footstepsound2]); OPENAL_Sample_Free(samp[footstepsound3]); OPENAL_Sample_Free(samp[footstepsound4]); - samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow2.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow1.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepsnow2.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow1.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow2.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow1.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepsnow2.ogg"), OPENAL_HW3D, 0, 0); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); @@ -763,10 +786,10 @@ void Game::Setenvironment(int which) OPENAL_Sample_Free(samp[footstepsound2]); OPENAL_Sample_Free(samp[footstepsound3]); OPENAL_Sample_Free(samp[footstepsound4]); - samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepgrass1.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepgrass2.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepstone1.ogg", OPENAL_HW3D, 0, 0); - samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ":Data:Sounds:footstepstone2.ogg", OPENAL_HW3D, 0, 0); + samp[footstepsound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepgrass1.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepgrass2.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone1.ogg"), OPENAL_HW3D, 0, 0); + samp[footstepsound4] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:footstepstone2.ogg"), OPENAL_HW3D, 0, 0); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound], 4.0f, 1000.0f); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound2], 4.0f, 1000.0f); OPENAL_Sample_SetMinMaxDistance(samp[footstepsound3], 4.0f, 1000.0f); @@ -885,9 +908,12 @@ void Game::Loadlevel(char *name){ OPENAL_SetPaused(channels[whooshsound], true); OPENAL_SetPaused(channels[stream_firesound], true); + // Change the map filename into something that is os specific + char *FixedFN = ConvertFileName(name); + int mapvers; FILE *tfile; - tfile=fopen( name, "rb" ); + tfile=fopen( FixedFN, "rb" ); if(tfile) { OPENAL_SetPaused(channels[stream_firesound], true); @@ -1385,52 +1411,7 @@ void Game::Loadlevel(char *name){ //if(!player[i].loaded)player[i].skeleton.skinText = new GLubyte[texsize]; //player[i].skeleton.skinText.resize(texsize); - if(player[i].creature==rabbittype) - { - if(player[i].whichskin==0){ - LoadTextureSave(":Data:Textures:Fur3.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==1){ - LoadTextureSave(":Data:Textures:Fur.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==2){ - LoadTextureSave(":Data:Textures:Fur2.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==3){ - LoadTextureSave(":Data:Textures:Lynx.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==4){ - LoadTextureSave(":Data:Textures:Otter.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==5){ - LoadTextureSave(":Data:Textures:Opal.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==6){ - LoadTextureSave(":Data:Textures:Sable.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==7){ - LoadTextureSave(":Data:Textures:Chocolate.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==8){ - LoadTextureSave(":Data:Textures:BW2.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==9){ - LoadTextureSave(":Data:Textures:WB2.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - } - if(player[i].creature==wolftype) - { - //k=abs(Random()%3); - if(player[i].whichskin==0){ - LoadTextureSave(":Data:Textures:Wolf.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==1){ - LoadTextureSave(":Data:Textures:Darkwolf.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - else if(player[i].whichskin==2){ - LoadTextureSave(":Data:Textures:Snowwolf.jpg",&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); - } - } + LoadTextureSave(creatureskin[player[i].creature][player[i].whichskin],&player[i].skeleton.drawmodel.textureptr,1,&player[i].skeleton.skinText[0],&player[i].skeleton.skinsize); if(player[i].numclothes) { @@ -1691,36 +1672,6 @@ void Game::Tick() float headprop,bodyprop,armprop,legprop; - if(newnetmessages){ - newnetmessages=0; - PlaySoundEx( consolesuccesssound, samp[consolesuccesssound], NULL, true); - OPENAL_SetVolume(channels[consolesuccesssound], 256); - OPENAL_SetPaused(channels[consolesuccesssound], false); - - for(k=14;k>=2;k--){ - for(j=0;j<255;j++){ - consoletext[k][j]=consoletext[k-1][j]; - } - consolechars[k]=consolechars[k-1]; - } - for(k=14;k>=2;k--){ - for(j=0;j<255;j++){ - displaytext[k][j]=displaytext[k-1][j]; - } - displaychars[k]=displaychars[k-1]; - displaytime[k]=displaytime[k-1]; - } - for(j=0;j<255;j++){ - consoletext[1][j]=' '; - displaytext[1][j]=' '; - } - sprintf (consoletext[1], netmessages); - sprintf (displaytext[1], netmessages); - consolechars[1]=255; - displaychars[1]=255; - displaytime[1]=0; - } - for(i=0;i<15;i++){ displaytime[i]+=multiplier; } @@ -1732,6 +1683,43 @@ void Game::Tick() static bool mainmenutogglekeydown; + + if (IsKeyDown(theKeyMap, MAC_F6_KEY) && !freezetogglekeydown) { + if (IsKeyDown(theKeyMap, MAC_SHIFT_KEY)) { + stereoreverse=true; + } else { + stereoreverse=false; + } + + if (stereoreverse) { + printf("Stereo reversed\n"); + } else { + printf("Stereo unreversed\n"); + } + freezetogglekeydown=1; + } + + if (IsKeyDown(theKeyMap, MAC_F7_KEY)) { + if (IsKeyDown(theKeyMap, MAC_SHIFT_KEY)) { + stereoseparation -= 0.001; + } else { + stereoseparation -= 0.010; + } + + printf("Stereo decreased increased to %f\n", stereoseparation); + } + + if (IsKeyDown(theKeyMap, MAC_F8_KEY)) { + if (IsKeyDown(theKeyMap, MAC_SHIFT_KEY)) { + stereoseparation += 0.001; + } else { + stereoseparation += 0.010; + } + + printf("Stereo separation increased to %f\n", stereoseparation); + } + + if(!console){ if(mainmenu&&endgame==1)mainmenu=10; if(IsKeyDown(theKeyMap, MAC_ESCAPE_KEY)&&!mainmenutogglekeydown&&(mainmenu==7&&entername)){ @@ -1743,7 +1731,7 @@ void Game::Tick() entername=0; mainmenutogglekeydown=1; } - if((IsKeyDown(theKeyMap, MAC_ESCAPE_KEY)||(mainmenu==0&&((IsKeyDown(theKeyMap, jumpkey)||IsKeyDown(theKeyMap, MAC_SPACE_KEY)||(campaign)))&&!oldjumpkeydown&&campaign&&winfreeze))&&!mainmenutogglekeydown&&(!mainmenu||gameon||mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||(mainmenu==7&&!entername)||mainmenu==9||mainmenu==11||(mainmenu==12&&!tryquit)||mainmenu==13||mainmenu==14||mainmenu==15||mainmenu==16||mainmenu==17||mainmenu==10)){ + if((IsKeyDown(theKeyMap, MAC_ESCAPE_KEY)||(mainmenu==0&&((IsKeyDown(theKeyMap, jumpkey)||IsKeyDown(theKeyMap, MAC_SPACE_KEY)||(campaign)))&&!oldjumpkeydown&&campaign&&winfreeze))&&!mainmenutogglekeydown&&(!mainmenu||gameon||mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||(mainmenu==7&&!entername)||mainmenu==9||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==10)){ selected=-1; if(mainmenu==1||mainmenu==2||mainmenu==0){ if(mainmenu==0&&!winfreeze)mainmenu=2; @@ -1871,10 +1859,6 @@ void Game::Tick() if(newdetail>2)newdetail=detail; if(newdetail<0)newdetail=detail; -#if !USE_SDL // we'll take anything that works. - if(newscreenwidth>3000)newscreenwidth=screenwidth; - if(newscreenheight>3000)newscreenheight=screenheight; -#endif if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; @@ -1954,7 +1938,7 @@ void Game::Tick() opstream << KeyToChar(chatkey); opstream.close(); } - if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==12||mainmenu==13||mainmenu==14||mainmenu==10||mainmenu==11||mainmenu==100){ + 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}; float vel[3]={0,0,0}; OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); @@ -1979,9 +1963,7 @@ void Game::Tick() if(mainmenu==7)mainmenu=1; if(mainmenu==9)mainmenu=5; if(mainmenu==11)mainmenu=5; - if(mainmenu==12)mainmenu=5; if(mainmenu==13)mainmenu=12; - if(mainmenu==14)mainmenu=13; if(mainmenu==10)mainmenu=5; if(mainmenu==100){ mainmenu=5; @@ -2111,7 +2093,7 @@ void Game::Tick() if(!gameon){ //quit tryquit=1; - if(registered)OPENAL_SetPaused(channels[stream_music3], true); + OPENAL_SetPaused(channels[stream_music3], true); } else{ //end game @@ -2135,7 +2117,7 @@ void Game::Tick() OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); } if(Button()&&!oldbutton&&selected==0){ - #if USE_SDL + extern SDL_Rect **resolutions; bool isCustomResolution = true; bool found = false; @@ -2180,56 +2162,7 @@ void Game::Tick() newscreenheight = (int) resolutions[0]->h; } - #else - int whichres; - whichres=-1; - if(newscreenwidth==640&&newscreenheight==480)whichres=0; - if(newscreenwidth==800&&newscreenheight==600)whichres=1; - if(newscreenwidth==1024&&newscreenheight==768)whichres=2; - if(newscreenwidth==1280&&newscreenheight==1024)whichres=3; - if(newscreenwidth==1600&&newscreenheight==1200)whichres=4; - if(newscreenwidth==840&&newscreenheight==524)whichres=5; - if(newscreenwidth==1024&&newscreenheight==640)whichres=6; - if(newscreenwidth==1344&&newscreenheight==840)whichres=7; - if(newscreenwidth==1920&&newscreenheight==1200)whichres=8; - - if(whichres==-1||whichres==8){ - newscreenwidth=640; - newscreenheight=480; - } - if(whichres==0){ - newscreenwidth=800; - newscreenheight=600; - } - if(whichres==1){ - newscreenwidth=1024; - newscreenheight=768; - } - if(whichres==2){ - newscreenwidth=1280; - newscreenheight=1024; - } - if(whichres==3){ - newscreenwidth=1600; - newscreenheight=1200; - } - if(whichres==4){ - newscreenwidth=840; - newscreenheight=524; - } - if(whichres==5){ - newscreenwidth=1024; - newscreenheight=640; - } - if(whichres==6){ - newscreenwidth=1344; - newscreenheight=840; - } - if(whichres==7){ - newscreenwidth=1920; - newscreenheight=1200; - } - #endif + } if(Button()&&!oldbutton&&selected==1){ newdetail++; @@ -2320,10 +2253,6 @@ void Game::Tick() if(newdetail>2)newdetail=detail; if(newdetail<0)newdetail=detail; -#if !USE_SDL // we'll take anything that works. - if(newscreenwidth>3000)newscreenwidth=screenwidth; - if(newscreenheight>3000)newscreenheight=screenheight; -#endif if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; @@ -2490,33 +2419,6 @@ void Game::Tick() } if(mainmenu==5){ - if(accountcampaignchoicesmade[accountactive]>8&&!registered){ - OPENAL_SetFrequency(OPENAL_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - OPENAL_SetPaused(channels[stream_music3], false); - OPENAL_SetVolume(channels[stream_music3], 256); - - gameon=0; - mainmenu=12; - accountcampaignchoicesmade[accountactive]=0; - accountcampaignscore[accountactive]=0; - accountcampaigntime[accountactive]=0; - - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } if(endgame==2){ accountcampaignchoicesmade[accountactive]=0; @@ -2814,94 +2716,6 @@ void Game::Tick() else oldbutton=0; } - if(mainmenu==15||mainmenu==16){ - if(Button()&&!oldbutton&&selected==1){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - - if(mainmenu==15)mainmenu=5; - else mainmenu=12; - } - if(Button())oldbutton=1; - else oldbutton=0; - } - - if(mainmenu==12){ - endgame=2; - if(Button()&&!oldbutton&&selected==3){ - if(tryquit)quit=1; - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - - mainmenu=5; - } - - if(Button()&&!oldbutton&&selected==4){ - registernow=1; - quit=1; - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } - - - if(Button()&&!oldbutton&&selected==5){ - tryquit=0; - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - - mainmenu=13; - } - if(Button())oldbutton=1; - else oldbutton=0; - } if(mainmenu==6){ if(Button()&&!oldbutton&&selected!=-1){ float gLoc[3]={0,0,0}; @@ -3068,10 +2882,6 @@ void Game::Tick() if(mainmenu==3){ if(newdetail>2)newdetail=detail; if(newdetail<0)newdetail=detail; -#if !USE_SDL // we'll take anything that works. - if(newscreenwidth>3000)newscreenwidth=screenwidth; - if(newscreenheight>3000)newscreenheight=screenheight; -#endif if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; @@ -3164,7 +2974,7 @@ void Game::Tick() } OPENAL_SetFrequency(channels[stream_music3], 22050); - if(entername||mainmenu==13||mainmenu==14){ + if(entername){ for(i=0;i<140;i++){ if(IsKeyDown(theKeyMap, i)){ togglekeydelay[i]+=multiplier; @@ -3250,114 +3060,13 @@ void Game::Tick() displayselected=0; }} - if(i==MAC_RETURN_KEY&&mainmenu==14){ - if(displaychars[0]){ - char serialstring[256]; - char tempstring[256]; - #if defined(__APPLE__) - sprintf (tempstring, "%s", registrationname); - #elif defined(_WIN32) || defined(__linux__) - sprintf (tempstring, "%s-windows", registrationname); - #else - #error Please make sure you have the right registration key stuff here! - #endif - long num1; - long num2; - long num3; - long num4; - long long longnum; - longnum = MD5_string ( tempstring); - //longnum = 1111111111111111; - num1 = longnum/100000000; - num2 = longnum%100000000; - sprintf (tempstring, "%d-%d-%d-%d\0\0\0\0\0", num1/10000, num1%10000, num2/10000, num2%10000); - - int goodcode=3; - int numchars=3; - if(num1/10000>999)numchars+=4; - else if(num1/10000>99)numchars+=3; - else if(num1/10000>9)numchars+=2; - else numchars+=1; - if(num1%10000>999)numchars+=4; - else if(num1%10000>99)numchars+=3; - else if(num1%10000>9)numchars+=2; - else numchars+=1; - if(num2/10000>999)numchars+=4; - else if(num2/10000>99)numchars+=3; - else if(num2/10000>9)numchars+=2; - else numchars+=1; - if(num2%10000>999)numchars+=4; - else if(num2%10000>99)numchars+=3; - else if(num2%10000>9)numchars+=2; - else numchars+=1; - - //numchars=12; - - for(j=0;j0) - { - for(j=0;j2)newdetail=detail; if(newdetail<0)newdetail=detail; -#if !USE_SDL // we'll take anything that works. - if(newscreenwidth>3000)newscreenwidth=screenwidth; - if(newscreenheight>3000)newscreenheight=screenheight; -#endif if(newscreenwidth<0)newscreenwidth=screenwidth; if(newscreenheight<0)newscreenheight=screenheight; @@ -7504,50 +7110,8 @@ void Game::Tick() if(player[closest].whichskin>9)player[closest].whichskin=0; if(player[closest].whichskin>2&&player[closest].creature==wolftype)player[closest].whichskin=0; - if(player[closest].creature==rabbittype){ - if(player[closest].whichskin==0){ - LoadTextureSave(":Data:Textures:Fur3.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==1){ - LoadTextureSave(":Data:Textures:Fur.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==2){ - LoadTextureSave(":Data:Textures:Fur2.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==3){ - LoadTextureSave(":Data:Textures:Lynx.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==4){ - LoadTextureSave(":Data:Textures:Otter.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==5){ - LoadTextureSave(":Data:Textures:Opal.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==6){ - LoadTextureSave(":Data:Textures:Sable.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==7){ - LoadTextureSave(":Data:Textures:Chocolate.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==8){ - LoadTextureSave(":Data:Textures:BW2.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==9){ - LoadTextureSave(":Data:Textures:WB2.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - } - if(player[closest].creature==wolftype){ - k=abs(Random()%3); - if(player[closest].whichskin==0){ - LoadTextureSave(":Data:Textures:Wolf.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==1){ - LoadTextureSave(":Data:Textures:Darkwolf.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - else if(player[closest].whichskin==2){ - LoadTextureSave(":Data:Textures:Snowwolf.jpg",&player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); - } - } + LoadTextureSave(creatureskin[player[closest].creature][player[closest].whichskin], + &player[closest].skeleton.drawmodel.textureptr,1,&player[closest].skeleton.skinText[0],&player[closest].skeleton.skinsize); } if(player[closest].numclothes){ @@ -11000,55 +10564,7 @@ void Game::TickOnce(){ if(rotation2<-70)rotation2=-70; } if(mainmenu)rotation+=multiplier*5; - if(!mainmenu&&!indemo&&!registered){ - OPENAL_SetFrequency(OPENAL_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - OPENAL_SetPaused(channels[stream_music3], false); - OPENAL_SetVolume(channels[stream_music3], 256); - - gameon=0; - mainmenu=12; - - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } - - if(tryquit==1&&!registered&&mainmenu!=12){ - OPENAL_SetFrequency(OPENAL_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - OPENAL_SetPaused(channels[stream_music3], false); - OPENAL_SetVolume(channels[stream_music3], 256); - - gameon=0; - mainmenu=12; - - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } + //} } @@ -11371,32 +10887,7 @@ void Game::TickOnceAfter(){ } if(changedelay<=-999&&whichlevel!=-2&&!loading&&(player[0].dead||(alldead&&maptype==mapkilleveryone)||(winhotspot)||(killhotspot))&&!winfreeze)loading=1; if((player[0].dead||(alldead&&maptype==mapkilleveryone)||(winhotspot)||(windialogue)||(killhotspot))&&changedelay<=0){ - if(accountprogress[accountactive]>3&&!registered){ - OPENAL_SetFrequency(OPENAL_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - OPENAL_SetPaused(channels[stream_music3], false); - OPENAL_SetVolume(channels[stream_music3], 256); - - gameon=0; - mainmenu=12; - accountprogress[accountactive]=3; - - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } - else{ + { if(whichlevel!=-2&&!loading&&!player[0].dead){ winfreeze=1; changedelay=-999;