1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
|
C3DModel PersoFaibleRouge,PersoMoyenRouge,PersoFortRouge,PersoFaibleBleu,PersoMoyenBleu,PersoFortBleu,TourNeutre,TourRouge,TourBleue,Rocher;
GLuint listePersoFaibleRouge,listePersoMoyenRouge,listePersoFortRouge,listePersoFaibleBleu,listePersoMoyenBleu,listePersoFortBleu,listeTourNeutre,listeTourRouge,listeTourBleue,listeRocher;
void chargerModele(){
//persos faibles
CLoad3DS load_PersoFaibleRouge;
if (load_PersoFaibleRouge.Import3DS(&PersoFaibleRouge, MODELE_ROUGE_FAIBLE) == false )
{
exit(0);
}
CLoad3DS load_PersoFaibleBleu;
if (load_PersoFaibleBleu.Import3DS(&PersoFaibleBleu, MODELE_BLEU_FAIBLE) == false )
{
exit(0);
}
//persos moyens
CLoad3DS load_PersoMoyenRouge;
if (load_PersoMoyenRouge.Import3DS(&PersoMoyenRouge, MODELE_ROUGE_MOYEN) == false )
{
exit(0);
}
CLoad3DS load_PersoMoyenBleu;
if (load_PersoMoyenBleu.Import3DS(&PersoMoyenBleu, MODELE_BLEU_MOYEN) == false )
{
exit(0);
}
//persos forts
CLoad3DS load_PersoFortRouge;
if (load_PersoFortRouge.Import3DS(&PersoFortRouge, MODELE_ROUGE_FORT) == false )
{
exit(0);
}
CLoad3DS load_PersoFortBleu;
if (load_PersoFortBleu.Import3DS(&PersoFortBleu, MODELE_BLEU_FORT) == false )
{
exit(0);
}
//tour grise
CLoad3DS load_TourNeutre;
if (load_TourNeutre.Import3DS(&TourNeutre, MODELE_TOUR_NEUTRE) == false )
{
exit(0);
}
//tour rouge
CLoad3DS load_TourRouge;
if (load_TourRouge.Import3DS(&TourRouge, MODELE_TOUR_ROUGE) == false )
{
exit(0);
}
//tour bleue
CLoad3DS load_TourBleue;
if (load_TourBleue.Import3DS(&TourBleue, MODELE_TOUR_BLEUE) == false )
{
exit(0);
}
//Décor rocher
CLoad3DS load_Rocher;
if (load_Rocher.Import3DS(&Rocher, MODELE_ROCHER) == false )
{
exit(0);
}
//CREATION DES LISTES D'AFFICHAGE POUR TOUS LES MODELES 3ds
// POUR LE JOUEUR ROUGE
//liste pour le perso faible
listePersoFaibleRouge=glGenLists(1);
glListBase(listePersoFaibleRouge);
glNewList(listePersoFaibleRouge,GL_COMPILE);
PersoFaibleRouge.LoadTextures();
PersoFaibleRouge.Draw();
glEndList();
//liste pour le perso moyen
listePersoMoyenRouge=glGenLists(1);
glListBase(listePersoMoyenRouge);
glNewList(listePersoMoyenRouge,GL_COMPILE);
PersoMoyenRouge.LoadTextures();
PersoMoyenRouge.Draw();
glEndList();
//liste pour le perso fort
listePersoFortRouge=glGenLists(1);
glListBase(listePersoFortRouge);
glNewList(listePersoFortRouge,GL_COMPILE);
PersoFortRouge.LoadTextures();
PersoFortRouge.Draw();
glEndList();
//****************************************************
// POUR LE JOUEUR BLEU
//liste pour le perso faible
listePersoFaibleBleu=glGenLists(1);
glListBase(listePersoFaibleBleu);
glNewList(listePersoFaibleBleu,GL_COMPILE);
PersoFaibleBleu.LoadTextures();
PersoFaibleBleu.Draw();
glEndList();
//liste pour le perso moyen
listePersoMoyenBleu=glGenLists(1);
glListBase(listePersoMoyenBleu);
glNewList(listePersoMoyenBleu,GL_COMPILE);
PersoMoyenBleu.LoadTextures();
PersoMoyenBleu.Draw();
glEndList();
//liste pour le perso fort
listePersoFortBleu=glGenLists(1);
glListBase(listePersoFortBleu);
glNewList(listePersoFortBleu,GL_COMPILE);
PersoFortBleu.LoadTextures();
PersoFortBleu.Draw();
glEndList();
//****************************************************
// POUR LES TOURS
//liste pour tour neutre
listeTourNeutre=glGenLists(1);
glListBase(listeTourNeutre);
glNewList(listeTourNeutre,GL_COMPILE);
TourNeutre.LoadTextures();
TourNeutre.Draw();
glEndList();
//liste pour tour rouge
listeTourRouge=glGenLists(1);
glListBase(listeTourRouge);
glNewList(listeTourRouge,GL_COMPILE);
TourRouge.LoadTextures();
TourRouge.Draw();
glEndList();
//liste pour tour bleue
listeTourBleue=glGenLists(1);
glListBase(listeTourBleue);
glNewList(listeTourBleue,GL_COMPILE);
TourBleue.LoadTextures();
TourBleue.Draw();
glEndList();
// POUR LE DECOR
//liste pour le rocher
listeRocher=glGenLists(1);
glListBase(listeRocher);
glNewList(listeRocher,GL_COMPILE);
Rocher.LoadTextures();
Rocher.Draw();
glEndList();
}
void afficherModele(int i){
switch(i){
case 6: glCallList(listePersoFaibleBleu);
break;
case 5: glCallList(listePersoMoyenBleu);
break;
case 4: glCallList(listePersoFortBleu);
break;
case 3: glCallList(listePersoFaibleRouge);
break;
case 2: glCallList(listePersoMoyenRouge);
break;
case 1: glCallList(listePersoFortRouge);
break;
}
}
void afficherTour(int i){
switch(i){
case 2: glCallList(listeTourNeutre);
break;
case 1: glCallList(listeTourBleue);
break;
case 0: glCallList(listeTourRouge);
break;
}
}
void afficherDecor(void){
glCallList(listeRocher);
} |
Partager