//------------------------------------------------------------------------------
// Head-Up Display (HUD) : Affichage d'une Crosshair
//------------------------------------------------------------------------------
void draw_crosshair()
{
glAlphaFunc(GL_GREATER,0.1f); // Permet de choisir présicemment un alpha sur les TGA
Blend_ON;
glBindTexture(GL_TEXTURE_2D, Name[1]); // Texture du ShotGun
glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex3f(300,220,0);
glTexCoord2f(1,0); glVertex3f(340,220,0);
glTexCoord2f(1,1); glVertex3f(340,260,0);
glTexCoord2f(0,1); glVertex3f(300,260,0);
glEnd();
glAlphaFunc(GL_GREATER,0.2f); // Permet de choisir présicemment un alpha sur les TGA
if (!g_blend) Blend_OFF;
}
//------------------------------------------------------------------------------
// Head-Up Display (HUD) : Affichage d'une Console
//------------------------------------------------------------------------------
void draw_console()
{
if ((cg_console_size>=240) || (cg_console_size<=480))
{
glBindTexture(GL_TEXTURE_2D, Name[6]);
glBegin(GL_QUADS);
glTexCoord2f(0-3*cos(3*roll),0-3*sin(3*roll));glVertex3f(0,cg_console_size,0);
glTexCoord2f(1-3*cos(3*roll),0-3*sin(3*roll));glVertex3f(640,cg_console_size,0);
glTexCoord2f(1-3*cos(3*roll),1-3*sin(3*roll));glVertex3f(640,480+cg_console_size,0);
glTexCoord2f(0-3*cos(3*roll),1-3*sin(3*roll));glVertex3f(0,480+cg_console_size,0);
glEnd();
Blend_ON
glBindTexture(GL_TEXTURE_2D, Name[11]);
glBegin(GL_QUADS);
glTexCoord2f(0,0.25);glVertex3f(0,cg_console_size,0);
glTexCoord2f(1,0.25);glVertex3f(640,cg_console_size,0);
glTexCoord2f(1,1.25);glVertex3f(640,480+cg_console_size,0);
glTexCoord2f(0,1.25);glVertex3f(0,480+cg_console_size,0);
glEnd();
if (!g_blend) Blend_OFF;
if ( temps.base > 3000 ) // On attend un peu avant de remonter la console en début de partie
{
if ((cg_console_size<480) && (cg_console==0)) cg_console_size+=temps.ecart*350; // on remonte
if ((cg_console_size>240) && (cg_console==1)) cg_console_size-=temps.ecart*350; // on redescends
}
}
}
//------------------------------------------------------------------------------
// Head-Up Display (HUD) : Affichage de l'arme
//------------------------------------------------------------------------------
void draw_weapon()
{
glBindTexture(GL_TEXTURE_2D, Name[5]); // Texture du ShotGun
glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex3f(320,-10+10*cos(move_hb/10),0);
glTexCoord2f(1,0); glVertex3f(576,-10+10*cos(move_hb/10),0);
glTexCoord2f(1,1); glVertex3f(576,246+10*cos(move_hb/10),0);
glTexCoord2f(0,1); glVertex3f(320,246+10*cos(move_hb/10),0);
glEnd();
}
//------------------------------------------------------------------------------
// Head-Up Display (HUD) : Affichage de la fumée
//------------------------------------------------------------------------------
void draw_fumee()
{
static float ecoul=0.0f;
if (fire)
{
if ( ecoul == 0 )
{
if (roll1==(int)(roll1)) roll2+=0.25;
if (roll2==(int)(roll2)) fire=!fire;
else roll1+=0.25;
}
ecoul += temps.ecart;
if ( ecoul*1000 > 60 ) ecoul=0;
Blend_ON;
glBindTexture(GL_TEXTURE_2D, Name[4]);// Texture de fumée, on fait une symétrie
glBegin(GL_QUADS);
glTexCoord2f(roll1,1.25-roll2); /*11*/ glVertex3f(448,102+10*cos(move_hb/10),0); // 00
glTexCoord2f(roll1-0.25,1.25-roll2); /*01*/ glVertex3f(192,102+10*cos(move_hb/10),0); // 10
glTexCoord2f(roll1-0.25,1-roll2); /*00*/ glVertex3f(192,358+10*cos(move_hb/10),0); // 11
glTexCoord2f(roll1,1-roll2); /*10*/ glVertex3f(448,358+10*cos(move_hb/10),0); // 01
glEnd();
Blend_OFF;
}
}
//------------------------------------------------------------------------------
// Head-Up Display (HUD) : Affichage des textes à l'écran
//------------------------------------------------------------------------------
void draw_texte()
{
// haut droit
glPrint(500,448, "white", 1, nbfps);
glPrint(480,432, "white", 1, "Echap : Menu");
// bas droit, de haut en bas
glPrint(535,48, "yellow", 2, "Cube");
glPrint(520,32, "white", 1, "Version 2.0");
glPrint(530,16, "red", 1, "By BeLZeL");
// haut gauche, de haut en bas
// glPrint(10,448, "red", 1, "Rouge");
// glPrint(10,432, "green", 1, "Vert");
// glPrint(10,416, "blue", 1, "Bleu");
// glPrint(10,400, "cyan", 1, "Cyan");
// glPrint(10,384, "purple", 1, "Violet");
// glPrint(10,368, "yellow", 1, "Jaune");
// glPrint(10,352, "white", 1, "Blanc");
// bas gauche, de haut en bas
// glPrint(10,112, "white", 1, "Fire %4.2f %4.2f", roll1, roll2);
glPrint(10,80, "white", 1, "Position : %d - %d", (int)(move_rl/scal+1), (int)(run/scal+1));
glPrint(10,64, "white", 1, "Sensitivity : %d", sensitivity);
glPrint(10,48, "white", 1, "Echelle : %d", scal);
glPrint(10,32, "white", 1, "FOV : %d", (int)(cg_fov-cg_zoom));
glPrint(10,16, "white", 1, "Map : %s", map_name);
}
//------------------------------------------------------------------------------
// Fin Du Fichier
//------------------------------------------------------------------------------