diff -r bd0544c73707 Source/Game.h --- a/Source/Game.h Fri May 14 01:20:37 2010 +0400 +++ b/Source/Game.h Fri May 14 02:58:15 2010 +0400 @@ -106,7 +106,6 @@ int loaddistrib; int keyselect; int indemo; - int registered; bool won; diff -r bd0544c73707 Source/GameDraw.cpp --- a/Source/GameDraw.cpp Fri May 14 01:20:37 2010 +0400 +++ b/Source/GameDraw.cpp Fri May 14 02:58:15 2010 +0400 @@ -230,7 +230,6 @@ lastcheck+=multiplier; glColorMask( 1.0, 1.0, 1.0, 1.0 ); - if(!registered)debugmode=0; if(freeze||winfreeze||(mainmenu&&gameon)||(!gameon&&gamestarted)){ @@ -2357,7 +2356,7 @@ /*if(mainmenu!=0)*/oldmainmenu=mainmenu; - if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==12||mainmenu==13||mainmenu==14||mainmenu==15||mainmenu==16||mainmenu==17){ + if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==13||mainmenu==17){ glClear(GL_DEPTH_BUFFER_BIT); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.001f); @@ -2505,7 +2504,7 @@ movex[10]=0; movey[10]=0; - sprintf (menustring[11], "Volume: %d%", (int)(volume*100)); + sprintf (menustring[11], "Volume: %d", (int)(volume*100)); startx[11]=10+60; starty[11]=155; endx[11]=startx[11]+strlen(menustring[11])*10; @@ -3057,128 +3056,6 @@ } } - if(mainmenu==12){ - menupulse+=multiplier*2; - - nummenuitems=6; - char temp[255]; - - sprintf (menustring[0], "Register now for only $19.95!"); - startx[0]=160; - starty[0]=270; - endx[0]=startx[0]+strlen(menustring[0])*10; - endy[0]=starty[0]+20; - movex[0]=0; - movey[0]=0; - - sprintf (menustring[1], "Confront raiders, wolves, and more!"); - startx[1]=130; - starty[1]=240; - endx[1]=startx[1]+strlen(menustring[1])*10; - endy[1]=starty[1]+20; - movex[1]=0; - movey[1]=0; - - sprintf (menustring[2], "Fight using swords, staves and armor!"); - startx[2]=125; - starty[2]=210; - endx[2]=startx[2]+strlen(menustring[2])*10; - endy[2]=starty[2]+20; - movex[2]=0; - movey[2]=0; - - if(!tryquit)sprintf (menustring[3], "Back"); - else sprintf (menustring[3], "Quit"); - startx[3]=10; - endx[3]=startx[3]+strlen(menustring[3])*10; - starty[3]=10; - endy[3]=starty[3]+20; - movex[3]=0; - movey[3]=0; - - sprintf (menustring[4], "Register now!"); - startx[4]=250; - endx[4]=startx[4]+strlen(menustring[4])*10; - starty[4]=140; - endy[4]=starty[4]+20; - movex[4]=0; - movey[4]=0; - - sprintf (menustring[5], "Enter registration code!"); - startx[5]=190; - endx[5]=startx[5]+strlen(menustring[5])*10; - starty[5]=120; - endy[5]=starty[5]+20; - movex[5]=0; - movey[5]=0; - } - - if(mainmenu==15){ - nummenuitems=2; - char temp[255]; - - sprintf (menustring[0], "Thank you for supporting Wolfire Software!"); - startx[0]=100; - starty[0]=270; - endx[0]=startx[0]+strlen(menustring[0])*10; - endy[0]=starty[0]+20; - movex[0]=0; - movey[0]=0; - - sprintf (menustring[1], "Back"); - startx[1]=10; - endx[1]=startx[1]+strlen(menustring[1])*10; - starty[1]=10; - endy[1]=starty[1]+20; - movex[1]=0; - movey[1]=0; - } - - if(mainmenu==16){ - nummenuitems=5; - char temp[255]; - - sprintf (menustring[0], "Sorry, that name/serial number combination is incorrect."); - startx[0]=40; - starty[0]=270; - endx[0]=startx[0]+strlen(menustring[0])*10; - endy[0]=starty[0]+20; - movex[0]=0; - movey[0]=0; - - sprintf (menustring[1], "Back"); - startx[1]=10; - endx[1]=startx[1]+strlen(menustring[1])*10; - starty[1]=10; - endy[1]=starty[1]+20; - movex[1]=0; - movey[1]=0; - - sprintf (menustring[2], "Please make sure you are copying your name and serial"); - startx[2]=50; - starty[2]=240; - endx[2]=startx[2]+strlen(menustring[2])*10; - endy[2]=starty[2]+20; - movex[2]=0; - movey[2]=0; - - sprintf (menustring[3], "number exactly as they appear in your email."); - startx[3]=90; - starty[3]=210; - endx[3]=startx[3]+strlen(menustring[3])*10; - endy[3]=starty[3]+20; - movex[3]=0; - movey[3]=0; - - sprintf (menustring[4], "Capitalization and punctuation matter!"); - startx[4]=120; - starty[4]=180; - endx[4]=startx[4]+strlen(menustring[4])*10; - endy[4]=starty[4]+20; - movex[4]=0; - movey[4]=0; - } - if(mainmenu==13){ nummenuitems=2; char temp[255]; @@ -3199,49 +3076,6 @@ movex[1]=0; movey[1]=0; } - - if(mainmenu==14){ - nummenuitems=2; - char temp[255]; - - sprintf (menustring[0], "Please enter your number:"); - startx[0]=30; - starty[0]=250; - endx[0]=startx[0]+strlen(menustring[0])*10; - endy[0]=starty[0]+20; - movex[0]=0; - movey[0]=0; - - sprintf (menustring[1], "Please enter your name:"); - startx[1]=290; - starty[1]=250; - endx[1]=startx[1]+strlen(menustring[1])*10; - endy[1]=starty[1]+20; - movex[1]=0; - movey[1]=0; - /* - char tempstring[256]; - sprintf (tempstring, "%s", registrationname); - 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", num1/10000, num1%10000, num2/10000, num2%10000); - - sprintf (menustring[2], "%s", tempstring); - startx[2]=290; - starty[2]=230; - endx[2]=startx[2]+strlen(menustring[2])*10; - endy[2]=starty[2]+20; - movex[2]=0; - movey[2]=0; */ - } - if(mainmenu==1||mainmenu==2){ nummenuitems=7; startx[0]=150; @@ -3409,7 +3243,7 @@ } } - if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==12||mainmenu==13||mainmenu==14||mainmenu==15||mainmenu==16||mainmenu==17) + if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17) for(i=0;istartx[i]&&(mousecoordh/screenwidth*640)starty[i]&&480-(mousecoordv/screenheight*480)accountprogress[accountactive]&&jaccountprogress[accountactive]&&j0){ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glPushMatrix(); - if((mainmenu!=7||j!=0||!entername)&&(mainmenu!=13||j!=1)&&(mainmenu!=14||j!=1))text.glPrint(startx[j],starty[j],menustring[j],0,1,640,480); + if(mainmenu!=7||j!=0||!entername)text.glPrint(startx[j],starty[j],menustring[j],0,1,640,480); else { if(displayblink){ @@ -3643,7 +3476,6 @@ if(1-((float)i)/15-(1-selectedlong[j])>0) { glColor4f(1,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25); - if(mainmenu==12&&j==4)glColor4f(1,(sin(menupulse)+1)/2,(sin(menupulse)+1)/2,(1-((float)i)/10-(1-selectedlong[j]))*.25); if(mainmenu==9&&j>accountprogress[accountactive]&&jaccountprogress[accountactive]&&j0) - { - for(j=0;j2)registered=1; - else registered=0; - } - } - fclose(tfile); - } - else registered=0; accountactive=-1; @@ -1911,7 +1864,6 @@ loaddistrib = 0; keyselect = 0; indemo = 0; - registered = 0; won = 0; diff -r bd0544c73707 Source/GameTick.cpp --- a/Source/GameTick.cpp Fri May 14 01:20:37 2010 +0400 +++ b/Source/GameTick.cpp Fri May 14 02:58:15 2010 +0400 @@ -1742,7 +1742,7 @@ 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; @@ -1953,7 +1953,7 @@ 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}; FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); @@ -1978,9 +1978,7 @@ 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; @@ -2110,7 +2108,7 @@ if(!gameon){ //quit tryquit=1; - if(registered)FSOUND_SetPaused(channels[stream_music3], true); + FSOUND_SetPaused(channels[stream_music3], true); } else{ //end game @@ -2489,34 +2487,6 @@ } if(mainmenu==5){ - if(accountcampaignchoicesmade[accountactive]>8&&!registered){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_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}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - } - if(endgame==2){ accountcampaignchoicesmade[accountactive]=0; accountcampaignscore[accountactive]=0; @@ -2813,94 +2783,6 @@ 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}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_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}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_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}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_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}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_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}; @@ -3163,7 +3045,7 @@ } FSOUND_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; @@ -3249,85 +3131,14 @@ displayselected=0; }} - if(i==MAC_RETURN_KEY&&mainmenu==14){ + + if(i==MAC_RETURN_KEY&&mainmenu==13){ 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;j3&&!registered){ - FSOUND_SetFrequency(FSOUND_ALL, 0.001); - PlayStreamEx( stream_music3, strm[stream_music3], NULL, true); - FSOUND_SetPaused(channels[stream_music3], false); - FSOUND_SetVolume(channels[stream_music3], 256); - - gameon=0; - mainmenu=12; - accountprogress[accountactive]=3; - - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - FSOUND_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - FSOUND_3D_SetAttributes(channels[fireendsound], gLoc, vel); - FSOUND_SetVolume(channels[fireendsound], 256); - FSOUND_SetPaused(channels[fireendsound], false); - FSOUND_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; diff -r bd0544c73707 Source/OpenGL_Windows.cpp --- a/Source/OpenGL_Windows.cpp Fri May 14 01:20:37 2010 +0400 +++ b/Source/OpenGL_Windows.cpp Fri May 14 02:58:15 2010 +0400 @@ -1390,7 +1390,7 @@ if (!SetUp (game)) return 42; - while (!gDone&&!game.quit&&(!game.tryquit||!game.registered)) + while (!gDone&&!game.quit&&(!game.tryquit)) { if (IsFocused()) {