#include "Game.h"
#include "openal_wrapper.h"
#include "Input.h"
+#include "Awards.h"
using namespace std;
extern float usermousesensitivity;
extern bool osx;
extern float camerashake;
-extern Weapons weapons;
-extern Person player[maxplayers];
extern int slomo;
extern float slomodelay;
extern bool ismotionblur;
extern float blackout;
extern bool damageeffects;
extern float volume;
-extern int numplayers;
extern bool texttoggle;
extern float blurness;
extern float targetblurness;
//extern int texdetail;
extern float texdetail;
extern bool musictoggle;
-extern int bonus;
-extern float bonusvalue;
-extern float bonustotal;
-extern float bonustime;
-extern int oldbonus;
-extern float startbonustotal;
-extern float bonusnum[100];
extern int tutoriallevel;
extern float smoketex;
extern float tutorialstagetime;
extern int tutorialstage;
extern bool againbonus;
extern float damagedealt;
-extern float damagetaken;
extern bool invertmouse;
extern int numhotspots;
extern char hotspottext[40][256];
extern int currenthotspot;;
-extern int numfalls;
-extern int numflipfail;
-extern int numseen;
-extern int numstaffattack;
-extern int numswordattack;
-extern int numknifeattack;
-extern int numunarmedattack;
-extern int numescaped;
-extern int numflipped;
-extern int numwallflipped;
-extern int numthrowkill;
-extern int numafterkill;
-extern int numreversals;
-extern int numattacks;
-extern int maxalarmed;
-extern int numresponded;
-
extern bool campaign;
extern bool winfreeze;
extern bool gamestart;
-extern int numdialogues;
-extern int numdialogueboxes[max_dialogues];
-extern int dialoguetype[max_dialogues];
-extern int dialogueboxlocation[max_dialogues][max_dialoguelength];
-extern float dialogueboxcolor[max_dialogues][max_dialoguelength][3];
-extern int dialogueboxsound[max_dialogues][max_dialoguelength];
-extern char dialoguetext[max_dialogues][max_dialoguelength][128];
-extern char dialoguename[max_dialogues][max_dialoguelength][64];
-extern XYZ dialoguecamera[max_dialogues][max_dialoguelength];
-extern XYZ participantlocation[max_dialogues][10];
-extern int participantfocus[max_dialogues][max_dialoguelength];
-extern int participantaction[max_dialogues][max_dialoguelength];
-extern float participantrotation[max_dialogues][10];
-extern XYZ participantfacing[max_dialogues][max_dialoguelength][10];
-extern float dialoguecamerarotation[max_dialogues][max_dialoguelength];
-extern float dialoguecamerarotation2[max_dialogues][max_dialoguelength];
-extern int indialogue;
-extern int whichdialogue;
-extern int directing;
-extern float dialoguetime;
-extern int dialoguegonethrough[20];
-
extern bool gamestarted;
extern bool showdamagebar;
-extern OPENAL_SAMPLE *samp[100];
-extern int channels[100];
-extern "C" void PlaySoundEx(int channel, OPENAL_SAMPLE *sptr, OPENAL_DSPUNIT *dsp, signed char startpaused);
+enum drawmodes {
+ normalmode, motionblurmode, radialzoommode,
+ realmotionblurmode, doublevisionmode, glowmode,
+};
void Game::flash() { // shouldn't be that way, these should be attributes and Person class should not change rendering.
flashr=1;
if(!tutoriallevel)
if(bonus>0&&bonustime<1&&!winfreeze&&indialogue==-1/*bonustime<4*/){
- if(bonus==tracheotomy)sprintf (string, "Tracheotomy!");
- else if(bonus==backstab)sprintf (string, "Backstabber!");
- else if(bonus==spinecrusher)sprintf (string, "Spinecrusher!");
- else if(bonus==ninja)sprintf (string, "Ninja Bonus!");
- else if(bonus==style)sprintf (string, "Style Bonus!");
- else if(bonus==cannon)sprintf (string, "Leg Cannon!");
- else if(bonus==aimbonus)sprintf (string, "Nice Aim!");
- else if(bonus==deepimpact)sprintf (string, "Heavy Impact!");
- else if(bonus==touchofdeath)sprintf (string, "Touch of Death!");
- else if(bonus==swordreversebonus)sprintf (string, "Sword Disarm!");
- else if(bonus==staffreversebonus)sprintf (string, "Staff Disarm!");
- else if(bonus==reverseko)sprintf (string, "Reversal KO!");
- else if(bonus==solidhit)sprintf (string, "Solid Hit!");
- else if(bonus==twoxcombo)sprintf (string, "2X Combo!");
- else if(bonus==threexcombo)sprintf (string, "3X Combo!");
- else if(bonus==fourxcombo)sprintf (string, "4X COMBO!");
- else if(bonus==megacombo)sprintf (string, "MEGA COMBO!");
- else if(bonus==Reversal)sprintf (string, "Reversal!");
- else if(bonus==Stabbonus)sprintf (string, "Punctured!");
- else if(bonus==Slicebonus)sprintf (string, "Sliced!");
- else if(bonus==Bullseyebonus)sprintf (string, "Bullseye!");
- else if(bonus==Slashbonus)sprintf (string, "Slashed!");
- else if(bonus==Wolfbonus)sprintf (string, "WOLF SLAYER!");
- else if(bonus==FinishedBonus)sprintf (string, "SLAIN!");
- else if(bonus==TackleBonus)sprintf (string, "Tackle!");
- else if(bonus==AboveBonus)sprintf (string, "Death from Above!");
- else sprintf (string, "Excellent!");
+ const char *bonus_name;
+ if (bonus < bonus_count)
+ bonus_name = bonus_names[bonus];
+ else
+ bonus_name = "Excellent!"; // When does this happen?
glColor4f(0,0,0,1-bonustime);
- text.glPrintOutline(1024/2-10*strlen(string)-4,768/16-4+768*4/5,string,1,2.5,1024,768);
+ text.glPrintOutline(1024/2-10*strlen(bonus_name)-4,768/16-4+768*4/5,bonus_name,1,2.5,1024,768);
glColor4f(1,0,0,1-bonustime);
- text.glPrint(1024/2-10*strlen(string),768/16+768*4/5,string,1,2,1024,768);
+ text.glPrint(1024/2-10*strlen(bonus_name),768/16+768*4/5,bonus_name,1,2,1024,768);
sprintf (string, "%d",(int)bonusvalue);
glColor4f(0,0,0,1-bonustime);
indialogue=0;
dialoguegonethrough[whichdialogue]++;
if(dialogueboxsound[whichdialogue][indialogue]!=0){
- static float gLoc[3];
- static float vel[3];
- gLoc[0]=player[participantfocus[whichdialogue][indialogue]].coords.x;
- gLoc[1]=player[participantfocus[whichdialogue][indialogue]].coords.y;
- gLoc[2]=player[participantfocus[whichdialogue][indialogue]].coords.z;
- vel[0]=0;
- vel[1]=0;
- vel[2]=0;
int whichsoundplay;
if(dialogueboxsound[whichdialogue][indialogue]==1)whichsoundplay=rabbitchitter;
if(dialogueboxsound[whichdialogue][indialogue]==2)whichsoundplay=rabbitchitter2;
if(dialogueboxsound[whichdialogue][indialogue]==-2)whichsoundplay=firestartsound;
if(dialogueboxsound[whichdialogue][indialogue]==-3)whichsoundplay=consolesuccesssound;
if(dialogueboxsound[whichdialogue][indialogue]==-4)whichsoundplay=consolefailsound;
- PlaySoundEx( whichsoundplay, samp[whichsoundplay], NULL, true);
- OPENAL_3D_SetAttributes(channels[whichsoundplay], gLoc, vel);
- OPENAL_SetVolume(channels[whichsoundplay], 256);
- OPENAL_SetPaused(channels[whichsoundplay], false);
+ emit_sound_at(whichsoundplay, player[participantfocus[whichdialogue][indialogue]].coords);
}
}
}
glEnable(GL_TEXTURE_2D);
- //Awards
- int numawards = 0;
- int awards[30];
-
- if(damagetaken==0&&player[0].bloodloss==0){
- awards[numawards]=awardflawless;
- numawards++;
- }
- bool alldead = true;
- for(i=1;i<numplayers;i++){
- if(player[i].dead!=2)alldead=0;
- }
- if(alldead){
- awards[numawards]=awardalldead;
- numawards++;
- }
- alldead=1;
- for(i=1;i<numplayers;i++){
- if(player[i].dead!=1)alldead=0;
- }
- if(alldead){
- awards[numawards]=awardnodead;
- numawards++;
- }
- if(numresponded==0&&!numthrowkill){
- awards[numawards]=awardstealth;
- numawards++;
- }
- if(numattacks==numstaffattack&&numattacks>0){
- awards[numawards]=awardbojutsu;
- numawards++;
- }
- if(numattacks==numswordattack&&numattacks>0){
- awards[numawards]=awardswordsman;
- numawards++;
- }
- if(numattacks==numknifeattack&&numattacks>0){
- awards[numawards]=awardknifefighter;
- numawards++;
- }
- if(numattacks==numunarmedattack&&numthrowkill==0&&weapons.numweapons>0){
- awards[numawards]=awardkungfu;
- numawards++;
- }
- if(numescaped>0){
- awards[numawards]=awardevasion;
- numawards++;
- }
- if(numflipfail==0&&numflipped+numwallflipped*2>20){
- awards[numawards]=awardacrobat;
- numawards++;
- }
- if(numthrowkill==numplayers-1){
- awards[numawards]=awardlongrange;
- numawards++;
- }
- alldead=1;
- for(i=1;i<numplayers;i++){
- if(player[i].dead!=2)alldead=0;
- }
- if(numafterkill>0&&alldead){
- awards[numawards]=awardbrutal;
- numawards++;
- }
- if(numreversals>((float)numattacks)*.8&&numreversals>3){
- awards[numawards]=awardaikido;
- numawards++;
- }
- if(maxalarmed==1&&numplayers>2){
- awards[numawards]=awardstrategy;
- numawards++;
- }
- if(numflipfail>3){
- awards[numawards]=awardklutz;
- numawards++;
- }
-
//Win Screen Won Victory
glEnable(GL_TEXTURE_2D);
strcat(string,temp);
text.glPrintOutlined(1024/30,768*6/8-40,string,1,2,1024,768);
- for(i=0;i<numawards;i++){
- if(i<6){
- if(awards[i]==awardklutz)sprintf (string, "Suicidal");
- if(awards[i]==awardflawless)sprintf (string, "Flawless!");
- if(awards[i]==awardalldead)sprintf (string, "Take no prisoners");
- if(awards[i]==awardnodead)sprintf (string, "Merciful");
- if(awards[i]==awardstealth)sprintf (string, "One with the shadows!");
- if(awards[i]==awardswordsman)sprintf (string, "Swordsman");
- if(awards[i]==awardkungfu)sprintf (string, "Unarmed!");
- if(awards[i]==awardknifefighter)sprintf (string, "Knife fighter");
- if(awards[i]==awardcoward)sprintf (string, "Coward");
- if(awards[i]==awardevasion)sprintf (string, "Escape artist");
- if(awards[i]==awardacrobat)sprintf (string, "Gymnast");
- if(awards[i]==awardlongrange)sprintf (string, "Blade slinger");
- if(awards[i]==awardbrutal)sprintf (string, "Brutal");
- if(awards[i]==awardhyper)sprintf (string, "Hyper");
- if(awards[i]==awardaikido)sprintf (string, "Aikido master!");
- if(awards[i]==awardrambo)sprintf (string, "Rambo");
- if(awards[i]==awardfast)sprintf (string, "Fast");
- if(awards[i]==awardrealfast)sprintf (string, "Real fast");
- if(awards[i]==awarddamnfast)sprintf (string, "Damn fast");
- if(awards[i]==awardstrategy)sprintf (string, "Divide and conquer");
- if(awards[i]==awardbojutsu)sprintf (string, "Bojutsu");
- text.glPrintOutlined(1024/30,768*6/8-90-40*i,string,1,2,1024,768);
- }
- }
+ //Awards
+ int awards[award_count];
+ int numawards = award_awards(awards);
+
+ for (i = 0; i < numawards && i < 6; i++)
+ text.glPrintOutlined(1024/30,768*6/8-90-40*i,award_names[awards[i]],1,2,1024,768);
}
if(drawmode!=normalmode){
levelorder[0]=0;
levelvisible[0]=1;
- for(i=0;i<accountactive->getCampaignChoicesMade();i++){
+ 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->getCampaignChoicesMade()-1;
+ int whichlevelstart = (accountactive?accountactive->getCampaignChoicesMade():0)-1;
if(whichlevelstart<0){
accountactive->setCampaignScore(0);
accountactive->resetFasttime();
oldmainmenu=mainmenu;
- if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==13||mainmenu==17||mainmenu==18){
+ if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==18){
glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.001f);
movey[9]=0;
}
if(mainmenu==5){
- nummenuitems=7+accountactive->getCampaignChoicesMade()+campaignchoicenum;
+ nummenuitems=7+(accountactive?accountactive->getCampaignChoicesMade():0)+campaignchoicenum;
sprintf (menustring[0], "%s",accountactive->getName());
startx[0]=5;
movex[6]=0;
movey[6]=0;
- if(accountactive->getCampaignChoicesMade())
- for(i=0;i<accountactive->getCampaignChoicesMade();i++){
+ if((accountactive?accountactive->getCampaignChoicesMade():0)) {
+ for(i=0;i<(accountactive?accountactive->getCampaignChoicesMade():0);i++) {
sprintf (menustring[7+i], "%s", campaigndescription[levelorder[i]]);
startx[7+i]=30+120+campaignlocationx[levelorder[i]]*400/512;
starty[7+i]=30+30+(512-campaignlocationy[levelorder[i]])*400/512;
movex[7+i]=0;
movey[7+i]=0;
}
+ }
- if(campaignchoicenum>0)
- for(i=accountactive->getCampaignChoicesMade();i<accountactive->getCampaignChoicesMade()+campaignchoicenum;i++){
- sprintf (menustring[7+i], "%s", campaigndescription[levelorder[i]]);
- startx[7+i]=30+120+campaignlocationx[campaignchoicewhich[i-(accountactive->getCampaignChoicesMade())]]*400/512;
- starty[7+i]=30+30+(512-campaignlocationy[campaignchoicewhich[i-(accountactive->getCampaignChoicesMade())]])*400/512;
- endx[7+i]=startx[7+i]+10;
- endy[7+i]=starty[7+i]+10;
- movex[7+i]=0;
- movey[7+i]=0;
- }
+ if(campaignchoicenum>0)
+ for(i=(accountactive?accountactive->getCampaignChoicesMade():0);i<(accountactive?accountactive->getCampaignChoicesMade():0)+campaignchoicenum;i++){
+ sprintf (menustring[7+i], "%s", campaigndescription[levelorder[i]]);
+ startx[7+i]=30+120+campaignlocationx[campaignchoicewhich[i-((accountactive?accountactive->getCampaignChoicesMade():0))]]*400/512;
+ starty[7+i]=30+30+(512-campaignlocationy[campaignchoicewhich[i-((accountactive?accountactive->getCampaignChoicesMade():0))]])*400/512;
+ endx[7+i]=startx[7+i]+10;
+ endy[7+i]=starty[7+i]+10;
+ movex[7+i]=0;
+ movey[7+i]=0;
+ }
+
+ /*sprintf (menustring[7], "Dot");
+ startx[7]=120+260*400/512;
+ starty[7]=30+(512-184)*400/512;
+ endx[7]=startx[7]+10;
+ endy[7]=starty[7]+10;
+ movex[7]=0;
+ movey[7]=0;
+
+ sprintf (menustring[8], "Dot");
+ startx[8]=120+129*400/512;
+ starty[8]=30+(512-284)*400/512;
+ endx[8]=startx[8]+10;
+ endy[8]=starty[8]+10;
+ movex[8]=0;
+ movey[8]=0;
- /*sprintf (menustring[7], "Dot");
- startx[7]=120+260*400/512;
- starty[7]=30+(512-184)*400/512;
- endx[7]=startx[7]+10;
- endy[7]=starty[7]+10;
- movex[7]=0;
- movey[7]=0;
-
- sprintf (menustring[8], "Dot");
- startx[8]=120+129*400/512;
- starty[8]=30+(512-284)*400/512;
- endx[8]=startx[8]+10;
- endy[8]=starty[8]+10;
- movex[8]=0;
- movey[8]=0;
-
- sprintf (menustring[9], "Dot");
- startx[9]=120+358*400/512;
- starty[9]=30+(512-235)*400/512;
- endx[9]=startx[9]+10;
- endy[9]=starty[9]+10;
- movex[9]=0;
- movey[9]=0;
-
- sprintf (menustring[10], "Dot");
- startx[10]=120+359*400/512;
- starty[10]=30+(512-308)*400/512;
- endx[10]=startx[10]+10;
- endy[10]=starty[10]+10;
- movex[10]=0;
- movey[10]=0;
-
- sprintf (menustring[11], "Dot");
- startx[11]=120+288*400/512;
- starty[11]=30+(512-277)*400/512;
- endx[11]=startx[11]+10;
- endy[11]=starty[11]+10;
- movex[11]=0;
- movey[11]=0;*/
+ sprintf (menustring[9], "Dot");
+ startx[9]=120+358*400/512;
+ starty[9]=30+(512-235)*400/512;
+ endx[9]=startx[9]+10;
+ endy[9]=starty[9]+10;
+ movex[9]=0;
+ movey[9]=0;
+
+ sprintf (menustring[10], "Dot");
+ startx[10]=120+359*400/512;
+ starty[10]=30+(512-308)*400/512;
+ endx[10]=startx[10]+10;
+ endy[10]=starty[10]+10;
+ movex[10]=0;
+ movey[10]=0;
+
+ sprintf (menustring[11], "Dot");
+ startx[11]=120+288*400/512;
+ starty[11]=30+(512-277)*400/512;
+ endx[11]=startx[11]+10;
+ endy[11]=starty[11]+10;
+ movex[11]=0;
+ movey[11]=0;*/
}
if(mainmenu==6){
//numchallengelevels=tempncl;
- }
- if(mainmenu==11){
- nummenuitems=2+numchallengelevels;
- char temp[255];
-
- for(j=0;j<numchallengelevels;j++){
- for(i=0;i<255;i++)menustring[j][i]='\0';
- sprintf (temp, "Level %d",j+1);
- strcpy(menustring[j],temp);
- for(i=0;i<17;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
- menustring[j][17]='\0';
- sprintf (temp, "%d",(int)accountactive->getHighScore(j));
- strcat(menustring[j],temp);
- for(i=18;i<32;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
- menustring[j][32]='\0';
- sprintf (temp, "%d:",(int)(((int)accountactive->getFastTime(j)-(int)(accountactive->getFastTime(j))%60)/60));
- strcat(menustring[j],temp);
- if((int)(accountactive->getFastTime(j))%60<10)strcat(menustring[j],"0");
- sprintf (temp, "%d",(int)(accountactive->getFastTime(j))%60);
- strcat(menustring[j],temp);
-
- startx[j]=10;
- starty[j]=360-j*40;
- endx[j]=startx[j]+strlen(menustring[j])*10;
- endy[j]=starty[j]+20;
- movex[j]=0;
- movey[j]=0;
- }
-
- sprintf (menustring[numchallengelevels], "Back");
- startx[numchallengelevels]=10;
- endx[numchallengelevels]=startx[numchallengelevels]+strlen(menustring[numchallengelevels])*10;
- starty[numchallengelevels]=10;
- endy[numchallengelevels]=starty[numchallengelevels]+20;
- movex[numchallengelevels]=0;
- movey[numchallengelevels]=0;
-
- sprintf (menustring[numchallengelevels+1], " High Score Best Time");
- startx[numchallengelevels+1]=10;
- starty[numchallengelevels+1]=400;
- endx[numchallengelevels+1]=startx[numchallengelevels+1]+strlen(menustring[numchallengelevels+1])*10;
- endy[numchallengelevels+1]=starty[numchallengelevels+1]+20;
- movex[numchallengelevels+1]=0;
- movey[numchallengelevels+1]=0;
-
}
if(mainmenu==10){
nummenuitems=6;
}
}
- if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==18)
+ if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==18)
for(i=0;i<nummenuitems;i++){
if((mousecoordh/screenwidth*640)>startx[i]&&(mousecoordh/screenwidth*640)<endx[i]&&480-(mousecoordv/screenheight*480)>starty[i]&&480-(mousecoordv/screenheight*480)<endy[i]){
if(mainmenu!=5)selected=i;
if(mainmenu==5&&(i!=0&&i!=6))selected=i;
- if(mainmenu==9&&(i!=numchallengelevels+1))selected=i;
- if(mainmenu==11&&(i!=numchallengelevels+1))selected=i;
+ if(mainmenu==9&&(i!=numchallengelevels+1))selected=i; // seem useless, if mainmenu==9 then mainmenu!=5, so selected==i.
}
}
glEnable(GL_TEXTURE_2D);
for(j=0;j<nummenuitems;j++)
{
- if(j<=3||(mainmenu!=1&&mainmenu!=2))
+ if(j>3 && (mainmenu==1||mainmenu==2))
+ continue;
+ //glDisable(GL_BLEND);
+ glEnable(GL_ALPHA_TEST);
+ glEnable(GL_BLEND);
+ //glDisable(GL_ALPHA_TEST);
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ if(mainmenu==1||mainmenu==2)
{
- //glDisable(GL_BLEND);
- glEnable(GL_ALPHA_TEST);
+ glColor4f(1,1,1,1);
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE);
+ glBindTexture( GL_TEXTURE_2D, Mainmenuitems[j]);
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+ glPushMatrix();
+ glBegin(GL_QUADS);
+ glTexCoord2f(0,0);
+ glVertex3f(startx[j]+movex[j]*transition, starty[j]+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,0);
+ glVertex3f(endx[j]+movex[j]*transition, starty[j]+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,1);
+ glVertex3f(endx[j]+movex[j]*transition, endy[j]+movey[j]*transition, 0.0f);
+ glTexCoord2f(0,1);
+ glVertex3f(startx[j]+movex[j]*transition, endy[j]+movey[j]*transition, 0.0f);
+ glEnd();
+ glPopMatrix();
glEnable(GL_BLEND);
//glDisable(GL_ALPHA_TEST);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- if(mainmenu==1||mainmenu==2)
+ if(j<4)glBlendFunc(GL_SRC_ALPHA,GL_ONE);
+ for(i=0;i<10;i++)
{
- glColor4f(1,1,1,1);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- glBindTexture( GL_TEXTURE_2D, Mainmenuitems[j]);
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ if(1-((float)i)/10-(1-selectedlong[j])>0)
+ {
+ glColor4f(1,1,1,(1-((float)i)/10-(1-selectedlong[j]))*.25);
+ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+ glPushMatrix();
+ glBegin(GL_QUADS);
+ glTexCoord2f(0,0);
+ glVertex3f(startx[j]-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, starty[j]-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,0);
+ glVertex3f(endx[j]+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, starty[j]-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,1);
+ glVertex3f(endx[j]+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, endy[j]+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glTexCoord2f(0,1);
+ glVertex3f(startx[j]-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, endy[j]+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glEnd();
+ glPopMatrix();
+ }
+ }
+ }
+ if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==18)
+ {
+ if(mainmenu!=5||j<6)
+ {
+ glColor4f(1,0,0,1);
+ if( (mainmenu==9) && j>accountactive->getProgress() && (j<numchallengelevels) )
+ glColor4f(0.5,0,0,1);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glPushMatrix();
- glBegin(GL_QUADS);
- glTexCoord2f(0,0);
- glVertex3f(startx[j]+movex[j]*transition, starty[j]+movey[j]*transition, 0.0f);
- glTexCoord2f(1,0);
- glVertex3f(endx[j]+movex[j]*transition, starty[j]+movey[j]*transition, 0.0f);
- glTexCoord2f(1,1);
- glVertex3f(endx[j]+movex[j]*transition, endy[j]+movey[j]*transition, 0.0f);
- glTexCoord2f(0,1);
- glVertex3f(startx[j]+movex[j]*transition, endy[j]+movey[j]*transition, 0.0f);
- glEnd();
+ if(mainmenu!=7||j!=0||!entername)
+ text.glPrint(startx[j],starty[j],menustring[j],0,1,640,480);
+ else
+ {
+ if(displayblink) {
+ sprintf (string, "_");
+ text.glPrint(startx[j]+(float)(displayselected)*10,starty[j],string,0,1,640,480);
+ }
+ for(l=0;l<displaychars[0];l++) {
+ sprintf (string, "%c",displaytext[0][l]);
+ text.glPrint(startx[j]+l*10,starty[j],string,0,1,640,480);
+ }
+ }
glPopMatrix();
glEnable(GL_BLEND);
- //glDisable(GL_ALPHA_TEST);
- if(j<4)glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- for(i=0;i<10;i++)
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE);
+ for(i=0;i<15;i++)
{
- if(1-((float)i)/10-(1-selectedlong[j])>0)
+ if(1-((float)i)/15-(1-selectedlong[j])>0)
{
- glColor4f(1,1,1,(1-((float)i)/10-(1-selectedlong[j]))*.25);
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- glPushMatrix();
- glBegin(GL_QUADS);
- glTexCoord2f(0,0);
- glVertex3f(startx[j]-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, starty[j]-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glTexCoord2f(1,0);
- glVertex3f(endx[j]+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, starty[j]-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glTexCoord2f(1,1);
- glVertex3f(endx[j]+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, endy[j]+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glTexCoord2f(0,1);
- glVertex3f(startx[j]-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, endy[j]+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glEnd();
- glPopMatrix();
+ glColor4f(1,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
+ if(mainmenu==9&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
+ if(mainmenu==11&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
+ if(mainmenu==3)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4-((/*1*/+((float)i)/70)*strlen(menustring[j]))*3,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==4)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==5)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==6)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==7&&(j!=0||!entername)) text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==8)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==9)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==10)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
+ if(mainmenu==18)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
}
}
}
- if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==18)
+ else
{
- if(mainmenu!=5||j<6)
- {
- glColor4f(1,0,0,1);
- if(mainmenu==9&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,1);
- if(mainmenu==11&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,1);
- //if(1-((float)i)/10-(1-selectedlong[j])>0){
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- glPushMatrix();
- if(mainmenu!=7||j!=0||!entername)
- text.glPrint(startx[j],starty[j],menustring[j],0,1,640,480);
- else
- {
- if(displayblink){
- sprintf (string, "_");
- text.glPrint(startx[j]+(float)(displayselected)*10,starty[j],string,0,1,640,480);
- }
- for(l=0;l<displaychars[0];l++){
- sprintf (string, "%c",displaytext[0][l]);
- text.glPrint(startx[j]+l*10,starty[j],string,0,1,640,480);
- }
- }
- glPopMatrix();
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- for(i=0;i<15;i++)
- {
- if(1-((float)i)/15-(1-selectedlong[j])>0)
- {
- glColor4f(1,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
- if(mainmenu==9&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
- if(mainmenu==11&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
- if(mainmenu==3)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4-((/*1*/+((float)i)/70)*strlen(menustring[j]))*3,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==4)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==5)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==6)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==7&&(j!=0||!entername)) text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==8)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==9)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==11)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==10)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==17)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==13&&j!=1)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- if(mainmenu==18)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- }
- }
- }
- else
- {
- glClear(GL_DEPTH_BUFFER_BIT);
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, 0.001f);
- glEnable(GL_TEXTURE_2D);
- glDisable(GL_DEPTH_TEST); // Disables Depth Testing
- glDisable(GL_CULL_FACE);
- glDisable(GL_LIGHTING);
- if(j==6)glColor4f(1,1,1,1);
- else glColor4f(1,0,0,1);
-
- glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
- glPushMatrix(); // Store The Projection Matrix
- glLoadIdentity(); // Reset The Projection Matrix
- glOrtho(0,640,0,480,-100,100); // Set Up An Ortho Screen
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- glPushMatrix(); // Store The Modelview Matrix
- glLoadIdentity(); // Reset The Modelview Matrix
- glPushMatrix();
-
- //Draw world, draw map
- glTranslatef(2,-5,0);
+ glClear(GL_DEPTH_BUFFER_BIT);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, 0.001f);
+ glEnable(GL_TEXTURE_2D);
+ glDisable(GL_DEPTH_TEST); // Disables Depth Testing
+ glDisable(GL_CULL_FACE);
+ glDisable(GL_LIGHTING);
+ if(j==6)glColor4f(1,1,1,1);
+ else glColor4f(1,0,0,1);
- if(j>6&&j<nummenuitems-1)
- {
- XYZ linestart,lineend,offset;
- XYZ fac;
- float startsize;
- float endsize;
- linestart=0;
- lineend=0;
- offset=0;
- //float linestartx,lineendx,linestarty,lineendy,offsetx,offsety;
- linestart.x=(startx[j]+endx[j])/2;
- linestart.y=(starty[j]+endy[j])/2;
- if(j>=6+accountactive->getCampaignChoicesMade()){
- linestart.x=(startx[6+accountactive->getCampaignChoicesMade()]+endx[6+accountactive->getCampaignChoicesMade()])/2;
- linestart.y=(starty[6+accountactive->getCampaignChoicesMade()]+endy[6+accountactive->getCampaignChoicesMade()])/2;
- }
- lineend.x=(startx[j+1]+endx[j+1])/2;
- lineend.y=(starty[j+1]+endy[j+1])/2;
- offset=lineend-linestart;
- fac=offset;
- Normalise(&fac);
- offset=DoRotation(offset,0,0,90);
- Normalise(&offset);
- glDisable(GL_TEXTURE_2D);
-
- if(j<6+accountactive->getCampaignChoicesMade()){
- glColor4f(0.5,0,0,1);
- endsize=.5;
- } else {
- glColor4f(1,0,0,1);
- endsize=1;
- }
- startsize=.5;
+ glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
+ glPushMatrix(); // Store The Projection Matrix
+ glLoadIdentity(); // Reset The Projection Matrix
+ glOrtho(0,640,0,480,-100,100); // Set Up An Ortho Screen
+ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+ glPushMatrix(); // Store The Modelview Matrix
+ glLoadIdentity(); // Reset The Modelview Matrix
+ glPushMatrix();
- linestart+=fac*4*startsize;
- lineend-=fac*4*endsize;
+ //Draw world, draw map
+ glTranslatef(2,-5,0);
- if(!(j>7+accountactive->getCampaignChoicesMade()+campaignchoicenum)){
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- glPushMatrix();
- glBegin(GL_QUADS);
- glTexCoord2f(0,0);
- glVertex3f(linestart.x-offset.x*startsize, linestart.y-offset.y*startsize, 0.0f);
- glTexCoord2f(1,0);
- glVertex3f(linestart.x+offset.x*startsize, linestart.y+offset.y*startsize, 0.0f);
- glTexCoord2f(1,1);
- glVertex3f(lineend.x+offset.x*endsize, lineend.y+offset.y*endsize, 0.0f);
- glTexCoord2f(0,1);
- glVertex3f(lineend.x-offset.x*endsize, lineend.y-offset.y*endsize, 0.0f);
- glEnd();
- glPopMatrix();
- }
- glEnable(GL_TEXTURE_2D);
+ if(j>6&&j<nummenuitems-1)
+ {
+ XYZ linestart,lineend,offset;
+ XYZ fac;
+ float startsize;
+ float endsize;
+ linestart=0;
+ lineend=0;
+ offset=0;
+ //float linestartx,lineendx,linestarty,lineendy,offsetx,offsety;
+ linestart.x=(startx[j]+endx[j])/2;
+ linestart.y=(starty[j]+endy[j])/2;
+ if(j>=6+(accountactive?accountactive->getCampaignChoicesMade():0)){
+ linestart.x=(startx[6+(accountactive?accountactive->getCampaignChoicesMade():0)]+endx[6+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
+ linestart.y=(starty[6+(accountactive?accountactive->getCampaignChoicesMade():0)]+endy[6+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
}
+ lineend.x=(startx[j+1]+endx[j+1])/2;
+ lineend.y=(starty[j+1]+endy[j+1])/2;
+ offset=lineend-linestart;
+ fac=offset;
+ Normalise(&fac);
+ offset=DoRotation(offset,0,0,90);
+ Normalise(&offset);
+ glDisable(GL_TEXTURE_2D);
+
+ if(j<6+(accountactive?accountactive->getCampaignChoicesMade():0)){
+ glColor4f(0.5,0,0,1);
+ endsize=.5;
+ } else {
+ glColor4f(1,0,0,1);
+ endsize=1;
+ }
+ startsize=.5;
+ linestart+=fac*4*startsize;
+ lineend-=fac*4*endsize;
- if(j==6)glBindTexture( GL_TEXTURE_2D, Mainmenuitems[7]);
- else glBindTexture( GL_TEXTURE_2D, Mapcircletexture);
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
- if(j-7<accountactive->getCampaignChoicesMade())glColor4f(0.5,0,0,1);
- if(j-7>=accountactive->getCampaignChoicesMade())glColor4f(1,0,0,1);
- if(j==6)glColor4f(1,1,1,1);
- XYZ midpoint;
- float itemsize;
- itemsize=abs(startx[j]-endx[j])/2;
- midpoint=0;
- midpoint.x=(startx[j]+endx[j])/2;
- midpoint.y=(starty[j]+endy[j])/2;
- if(j>6&&(j-7<accountactive->getCampaignChoicesMade()))itemsize*=.5;
- if(!(j-7>accountactive->getCampaignChoicesMade()+campaignchoicenum))
- {
+ if(!(j>7+(accountactive?accountactive->getCampaignChoicesMade():0)+campaignchoicenum)){
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glPushMatrix();
glBegin(GL_QUADS);
glTexCoord2f(0,0);
- glVertex3f(midpoint.x-itemsize+movex[j]*transition, midpoint.y-itemsize+movey[j]*transition, 0.0f);
+ glVertex3f(linestart.x-offset.x*startsize, linestart.y-offset.y*startsize, 0.0f);
glTexCoord2f(1,0);
- glVertex3f(midpoint.x+itemsize+movex[j]*transition, midpoint.y-itemsize+movey[j]*transition, 0.0f);
+ glVertex3f(linestart.x+offset.x*startsize, linestart.y+offset.y*startsize, 0.0f);
glTexCoord2f(1,1);
- glVertex3f(midpoint.x+itemsize+movex[j]*transition, midpoint.y+itemsize+movey[j]*transition, 0.0f);
+ glVertex3f(lineend.x+offset.x*endsize, lineend.y+offset.y*endsize, 0.0f);
glTexCoord2f(0,1);
- glVertex3f(midpoint.x-itemsize+movex[j]*transition, midpoint.y+itemsize+movey[j]*transition, 0.0f);
+ glVertex3f(lineend.x-offset.x*endsize, lineend.y-offset.y*endsize, 0.0f);
glEnd();
glPopMatrix();
- glEnable(GL_BLEND);
- //glDisable(GL_ALPHA_TEST);
- if(j<4)glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- for(i=0;i<10;i++)
+ }
+ glEnable(GL_TEXTURE_2D);
+ }
+
+
+ if(j==6)glBindTexture( GL_TEXTURE_2D, Mainmenuitems[7]);
+ else glBindTexture( GL_TEXTURE_2D, Mapcircletexture);
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ if(j-7<(accountactive?accountactive->getCampaignChoicesMade():0))glColor4f(0.5,0,0,1);
+ if(j-7>=(accountactive?accountactive->getCampaignChoicesMade():0))glColor4f(1,0,0,1);
+ if(j==6)glColor4f(1,1,1,1);
+ XYZ midpoint;
+ float itemsize;
+ itemsize=abs(startx[j]-endx[j])/2;
+ midpoint=0;
+ midpoint.x=(startx[j]+endx[j])/2;
+ midpoint.y=(starty[j]+endy[j])/2;
+ if(j>6&&(j-7<(accountactive?accountactive->getCampaignChoicesMade():0)))itemsize*=.5;
+ if(!(j-7>(accountactive?accountactive->getCampaignChoicesMade():0)+campaignchoicenum))
+ {
+ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+ glPushMatrix();
+ glBegin(GL_QUADS);
+ glTexCoord2f(0,0);
+ glVertex3f(midpoint.x-itemsize+movex[j]*transition, midpoint.y-itemsize+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,0);
+ glVertex3f(midpoint.x+itemsize+movex[j]*transition, midpoint.y-itemsize+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,1);
+ glVertex3f(midpoint.x+itemsize+movex[j]*transition, midpoint.y+itemsize+movey[j]*transition, 0.0f);
+ glTexCoord2f(0,1);
+ glVertex3f(midpoint.x-itemsize+movex[j]*transition, midpoint.y+itemsize+movey[j]*transition, 0.0f);
+ glEnd();
+ glPopMatrix();
+ glEnable(GL_BLEND);
+ //glDisable(GL_ALPHA_TEST);
+ if(j<4)glBlendFunc(GL_SRC_ALPHA,GL_ONE);
+ for(i=0;i<10;i++)
+ {
+ if(1-((float)i)/10-(1-selectedlong[j])>0)
{
- if(1-((float)i)/10-(1-selectedlong[j])>0)
- {
- glColor4f(1,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- glPushMatrix();
- glBegin(GL_QUADS);
- glTexCoord2f(0,0);
- glVertex3f(midpoint.x-itemsize-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y-itemsize-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glTexCoord2f(1,0);
- glVertex3f(midpoint.x+itemsize+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y-itemsize-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glTexCoord2f(1,1);
- glVertex3f(midpoint.x+itemsize+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y+itemsize+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glTexCoord2f(0,1);
- glVertex3f(midpoint.x-itemsize-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y+itemsize+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
- glEnd();
- glPopMatrix();
- }
+ glColor4f(1,0,0,(1-((float)i)/10-(1-selectedlong[j]))*.25);
+ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+ glPushMatrix();
+ glBegin(GL_QUADS);
+ glTexCoord2f(0,0);
+ glVertex3f(midpoint.x-itemsize-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y-itemsize-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,0);
+ glVertex3f(midpoint.x+itemsize+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y-itemsize-((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glTexCoord2f(1,1);
+ glVertex3f(midpoint.x+itemsize+((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y+itemsize+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glTexCoord2f(0,1);
+ glVertex3f(midpoint.x-itemsize-((float)i)*1/2+offsetx[j]*((float)i)/2+movex[j]*transition, midpoint.y+itemsize+((float)i)*1/2+offsety[j]*((float)i)/2+movey[j]*transition, 0.0f);
+ glEnd();
+ glPopMatrix();
}
}
- glPopMatrix();
+ }
glPopMatrix();
- glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glPopMatrix();
- glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+ glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
- if(j-7>=accountactive->getCampaignChoicesMade()){
- text.glPrintOutlined(0.9,0,0,startx[j]+10,starty[j]-4,menustring[j],0,0.6,640,480);
- glDisable(GL_DEPTH_TEST);
- }
+ if(j-7>=(accountactive?accountactive->getCampaignChoicesMade():0)){
+ text.glPrintOutlined(0.9,0,0,startx[j]+10,starty[j]-4,menustring[j],0,0.6,640,480);
+ glDisable(GL_DEPTH_TEST);
}
}
}