memset(campaignchoosenext, 0, sizeof(campaignchoosenext));
memset(campaignnumnext, 0, sizeof(campaignnumnext));
memset(campaignnextlevel, 0, sizeof(campaignnextlevel));
- int campaignchoicesmade;
- memset(campaignchoices, 0, sizeof(campaignchoices));
memset(campaignlocationx, 0, sizeof(campaignlocationx));
memset(campaignlocationy, 0, sizeof(campaignlocationy));
memset(campaignlocationy, 0, sizeof(campaignlocationy));
int campaignchoosenext[50];
int campaignnumnext[50];
int campaignnextlevel[50][10];
- int campaignchoicesmade;
- int campaignchoices[5000];
int campaignlocationx[50];
int campaignlocationy[50];
int campaignchoicenum;
void LoadScreenTexture();
void LoadStuff();
void LoadingScreen();
+ void LoadCampaign();
void FadeLoadingScreen(float howmuch);
void Dispose();
int DrawGLScene(StereoSide side);
return 0;
}
+void Game::LoadCampaign() {
+ ifstream ipstream(ConvertFileName(":Data:Campaigns:main.txt"));
+ ipstream.ignore(256,':');
+ ipstream >> campaignnumlevels;
+ for(int i=0;i<campaignnumlevels;i++){
+ ipstream.ignore(256,':');
+ ipstream.ignore(256,':');
+ ipstream.ignore(256,' ');
+ ipstream >> campaignmapname[i];
+ ipstream.ignore(256,':');
+ ipstream >> campaigndescription[i];
+ for(int j=0;j<256;j++){
+ if(campaigndescription[i][j]=='_')campaigndescription[i][j]=' ';
+ }
+ ipstream.ignore(256,':');
+ ipstream >> campaignchoosenext[i];
+ ipstream.ignore(256,':');
+ ipstream >> campaignnumnext[i];
+ for(int j=0;j<campaignnumnext[i];j++){
+ ipstream.ignore(256,':');
+ ipstream >> campaignnextlevel[i][j];
+ campaignnextlevel[i][j]-=1;
+ }
+ ipstream.ignore(256,':');
+ ipstream >> campaignlocationx[i];
+ ipstream.ignore(256,':');
+ ipstream >> campaignlocationy[i];
+ }
+ ipstream.close();
+
+ for(int i=0;i<campaignnumlevels;i++){
+ levelvisible[i]=0;
+ levelhighlight[i]=0;
+ }
+
+ levelorder[0]=0;
+ levelvisible[0]=1;
+ for(int i=0;i<accountactive->getCampaignChoicesMade();i++){
+ levelorder[i+1]=campaignnextlevel[levelorder[i]][accountactive->getCampaignChoice(i)];
+ levelvisible[levelorder[i+1]]=1;
+ }
+ int whichlevelstart = (accountactive?accountactive->getCampaignChoicesMade():0)-1;
+ if(whichlevelstart<0){
+ if(accountactive) {
+ accountactive->setCampaignScore(0);
+ accountactive->resetFasttime();
+ }
+ campaignchoicenum=1;
+ campaignchoicewhich[0]=0;
+ }
+ else
+ {
+ campaignchoicenum=campaignnumnext[levelorder[whichlevelstart]];
+ for(int i=0;i<campaignchoicenum;i++){
+ campaignchoicewhich[i]=campaignnextlevel[levelorder[whichlevelstart]][i];
+ levelvisible[campaignnextlevel[levelorder[whichlevelstart]][i]]=1;
+ levelhighlight[campaignnextlevel[levelorder[whichlevelstart]][i]]=1;
+ }
+ }
+}
+
void Game::DrawMenu()
{
int i,j;
}
if(lastcheck>.5||oldmainmenu!=mainmenu){
if(mainmenu==5){
- ifstream ipstream(ConvertFileName(":Data:Campaigns:main.txt"));
- ipstream.ignore(256,':');
- ipstream >> campaignnumlevels;
- for(i=0;i<campaignnumlevels;i++){
- ipstream.ignore(256,':');
- ipstream.ignore(256,':');
- ipstream.ignore(256,' ');
- ipstream >> campaignmapname[i];
- ipstream.ignore(256,':');
- ipstream >> campaigndescription[i];
- for(j=0;j<256;j++){
- if(campaigndescription[i][j]=='_')campaigndescription[i][j]=' ';
- }
- ipstream.ignore(256,':');
- ipstream >> campaignchoosenext[i];
- ipstream.ignore(256,':');
- ipstream >> campaignnumnext[i];
- for(j=0;j<campaignnumnext[i];j++){
- ipstream.ignore(256,':');
- ipstream >> campaignnextlevel[i][j];
- campaignnextlevel[i][j]-=1;
- }
- ipstream.ignore(256,':');
- ipstream >> campaignlocationx[i];
- ipstream.ignore(256,':');
- ipstream >> campaignlocationy[i];
- }
- ipstream.close();
-
- for(i=0;i<campaignnumlevels;i++){
- levelvisible[i]=0;
- levelhighlight[i]=0;
- }
-
- levelorder[0]=0;
- levelvisible[0]=1;
- for(i=0;i<(accountactive?accountactive->getCampaignChoicesMade():0);i++){
- levelorder[i+1]=campaignnextlevel[levelorder[i]][accountactive->getCampaignChoice(i)];
- levelvisible[levelorder[i+1]]=1;
- }
- int whichlevelstart = (accountactive?accountactive->getCampaignChoicesMade():0)-1;
- if(whichlevelstart<0){
- accountactive->setCampaignScore(0);
- accountactive->resetFasttime();
- campaignchoicenum=1;
- campaignchoicewhich[0]=0;
- }
- else
- {
- campaignchoicenum=campaignnumnext[levelorder[whichlevelstart]];
- for(i=0;i<campaignchoicenum;i++){
- campaignchoicewhich[i]=campaignnextlevel[levelorder[whichlevelstart]][i];
- levelvisible[campaignnextlevel[levelorder[whichlevelstart]][i]]=1;
- levelhighlight[campaignnextlevel[levelorder[whichlevelstart]][i]]=1;
- }
- }
+ LoadCampaign();
}
}
if(mainmenu==5){
if(difficulty>2) difficulty=0;
break;
case 4:
- ismotionblur = 1-ismotionblur;
+ ismotionblur = !ismotionblur;
break;
case 5:
- decals = 1-decals;
+ decals = !decals;
break;
case 6:
- musictoggle = 1-musictoggle;
+ musictoggle = !musictoggle;
- if(musictoggle)
+ if(musictoggle) {
emit_stream_np(stream_menutheme);
- else {
+ } else {
pause_sound(leveltheme);
pause_sound(stream_fighttheme);
pause_sound(stream_menutheme);
mainmenu=gameon?2:1;
break;
case 9:
- invertmouse = 1-invertmouse;
+ invertmouse = !invertmouse;
break;
case 10:
usermousesensitivity+=.2;
if(targetlevel>numchallengelevels-1)targetlevel=0;
}
- if(changedelay>0&&!player[0].dead&&!won){
+ if(changedelay>0&&!player[0].dead&&!won) {
//high scores, awards, win
- if(campaign){
+ if(campaign) {
accountactive->winCampaignLevel(whichchoice, bonustotal, leveltime);
scoreadded=1;
- }else{
+ } else {
accountactive->winLevel(whichlevel,bonustotal-startbonustotal,leveltime);
}
won=1;
startbonustotal=0;
- ifstream ipstream(ConvertFileName(":Data:Campaigns:main.txt"));
- ipstream.ignore(256,':');
- ipstream >> campaignnumlevels;
- for(int i=0;i<campaignnumlevels;i++){
- ipstream.ignore(256,':');
- ipstream.ignore(256,':');
- ipstream.ignore(256,' ');
- ipstream >> campaignmapname[i];
- ipstream.ignore(256,':');
- ipstream >> campaigndescription[i];
- for(int j=0;j<256;j++){
- if(campaigndescription[i][j]=='_')campaigndescription[i][j]=' ';
- }
- ipstream.ignore(256,':');
- ipstream >> campaignchoosenext[i];
- ipstream.ignore(256,':');
- ipstream >> campaignnumnext[i];
- for(int j=0;j<campaignnumnext[i];j++){
- ipstream.ignore(256,':');
- ipstream >> campaignnextlevel[i][j];
- campaignnextlevel[i][j]-=1;
- }
- ipstream.ignore(256,':');
- ipstream >> campaignlocationx[i];
- ipstream.ignore(256,':');
- ipstream >> campaignlocationy[i];
- }
- ipstream.close();
-
- for(int i=0;i<campaignnumlevels;i++){
- levelvisible[i]=0;
- levelhighlight[i]=0;
- }
-
-
- for(int i=0;i<campaignnumlevels;i++){
- levelvisible[i]=0;
- levelhighlight[i]=0;
- }
-
- levelorder[0]=0;
- levelvisible[0]=1;
- for(int i=0;i<accountactive->getCampaignChoicesMade();i++){
- levelorder[i+1]=campaignnextlevel[levelorder[i]][accountactive->getCampaignChoice(i)];
- levelvisible[levelorder[i+1]]=1;
- }
- int whichlevelstart;
- whichlevelstart=accountactive->getCampaignChoicesMade()-1;
- if(whichlevelstart<0){
- campaignchoicenum=1;
- campaignchoicewhich[0]=0;
- }
- else
- {
- campaignchoicenum=campaignnumnext[levelorder[whichlevelstart]];
- for(int i=0;i<campaignchoicenum;i++){
- campaignchoicewhich[i]=campaignnextlevel[levelorder[whichlevelstart]][i];
- levelvisible[campaignnextlevel[levelorder[whichlevelstart]][i]]=1;
- levelhighlight[campaignnextlevel[levelorder[whichlevelstart]][i]]=1;
- }
- }
+ LoadCampaign();
loading=2;
loadtime=0;
bool visibleloading = 0;
float volume = 0;
-bool ismotionblur = 0;
+bool ismotionblur = false;
float usermousesensitivity = 0;
-bool floatjump = 0;
-bool cellophane = 0;
-bool autoslomo = 0;
-bool decals = 0;
-bool invertmouse = 0;
-bool texttoggle = 0;
+bool floatjump = false;
+bool cellophane = false;
+bool autoslomo = false;
+bool decals = false;
+bool invertmouse = false;
+bool texttoggle = false;
float blurness = 0;
float targetblurness = 0;
float windvar = 0;
GLubyte wolfbloodText[512*512*3] = {0};
float colors[3] = {0};
int bloodtoggle = 0;
-bool osx = 0;
+bool osx = false;
float camerashake = 0;
float woozy = 0;
float blackout = 0;
-bool foliage = 0;
-bool musictoggle = 0;
+bool foliage = false;
+bool musictoggle = false;
bool trilinear;
Weapons weapons;
-bool damageeffects = 0;
+bool damageeffects = false;
int numplayers = 0;
-bool ambientsound = 0;
-bool mousejump = 0;
-bool freeze = 0;
-bool winfreeze = 0;
+bool ambientsound = false;
+bool mousejump = false;
+bool freeze = false;
+bool winfreeze = false;
float flashamount = 0,flashr = 0,flashg = 0,flashb = 0;
int flashdelay = 0;
-bool vblsync = 0;
+bool vblsync = false;
float motionbluramount = 0;
-bool keyboardfrozen = 0;
-bool loadingstuff = 0;
-bool stillloading = 0;
-bool showpoints = 0;
-bool showdamagebar = 0;
-bool alwaysblur = 0;
-bool immediate = 0;
-bool velocityblur = 0;
+bool keyboardfrozen = false;
+bool loadingstuff = false;
+bool stillloading = false;
+bool showpoints = false;
+bool showdamagebar = false;
+bool alwaysblur = false;
+bool immediate = false;
+bool velocityblur = false;
int test = 0;
XYZ windvector;
short vRefNum = 0;
float tutorialmaxtime = 0;
float tutorialsuccess = 0;
-bool againbonus = 0;
+bool againbonus = false;
float damagedealt = 0;
int editoractive = 0;
int editorpathtype = 0;
-bool reversaltrain = 0;
-bool cananger = 0;
-bool canattack = 0;
+bool reversaltrain = false;
+bool cananger = false;
+bool canattack = false;
-bool skyboxtexture = 0;
+bool skyboxtexture = false;
float skyboxr = 0;
float skyboxg = 0;
float skyboxb = 0;
int numenvsounds;
-bool tilt2weird = 0;
-bool tiltweird = 0;
-bool midweird = 0;
-bool proportionweird = 0;
+bool tilt2weird = false;
+bool tiltweird = false;
+bool midweird = false;
+bool proportionweird = false;
bool vertexweird[6] = {0};
TGAImageRec texture;
-bool debugmode = 0;
+bool debugmode = false;
-bool won = 0;
+bool won = false;
-bool campaign = 0;
+bool campaign = false;
-bool gamestarted = 0;
+bool gamestarted = false;
//TextureList textures;