- 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!=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]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+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/*-((((float)i)/70)*strlen(menustring[j]))*3*/,starty[j]/*-i*1/2*/+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
- /*else{
- if(displayblink){
- sprintf (string, "_");
- text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4+(float)(displayselected)*10*(1+((float)i)/70),starty[j]+offsety[j]*((float)i)/4,string,0,1+((float)i)/70,640,480);
- }
- k=0;
- for(l=0;l<displaychars[k];l++){
- if(l<displaychars[k]){
- sprintf (string, "%c",displaytext[k][l]);
- text.glPrint(startx[j]-((float)k)+offsetx[j]*((float)k)/4+l*10*(1+((float)i)/70),starty[j]+offsety[j]*((float)i)/4,string,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);
-
- 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);
- startsize=.5;
- endsize=.5;
- }
- if(j>=6+accountactive->getCampaignChoicesMade()){
- glColor4f(1,0,0,1);
- endsize=1;
- startsize=.5;
- }
-
- linestart+=fac*4*startsize;
- lineend-=fac*4*endsize;
-
- 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)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))
- {
- 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)
- {
- 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