1 /* 2 * Decals.h 3 * Copyright (C) 2007 by Bryan Duff <duff0097@gmail.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 * USA 19 */ 20 #ifndef _DECALS_H_ 21 #define _DECALS_H_ 22 23 #include "Quaternions.h" 24 ///ZWARNING 25 ///#include <GL/glut.h> 26 ///GLUT REMOVED. 27 #include "Files.h" 28 #include "TGALoader.h" 29 #include "Quaternions.h" 30 #include "Camera.h" 31 #include "Models.h" 32 #include "Fog.h" 33 // 34 // Model Structures 35 // 36 37 #define maxdecals 120 38 39 class Decals { 40 public: 41 GLuint bulletholetextureptr; 42 GLuint cratertextureptr; 43 GLuint bloodtextureptr[11]; 44 45 int howmanydecals; 46 47 int type[maxdecals]; 48 49 XYZ points[8 * maxdecals]; 50 int numpoints[maxdecals]; 51 float texcoordsx[8 * maxdecals]; 52 float texcoordsy[8 * maxdecals]; 53 float alivetime[maxdecals]; 54 55 void draw(); 56 57 int DeleteDecal(int which); 58 int MakeDecal(int atype, XYZ location, float size, XYZ normal, int poly, 59 Model * model, XYZ move, float rotation); 60 61 void DoStuff(); 62 void LoadBulletHoleTexture(char *fileName); 63 void LoadCraterTexture(char *fileName); 64 void LoadBloodTexture(char *fileName, int which); 65 ~Decals()66 ~Decals() { 67 glDeleteTextures(1, (const GLuint *)&bulletholetextureptr); 68 glDeleteTextures(1, (const GLuint *)&cratertextureptr); 69 glDeleteTextures(11, (const GLuint *)&bloodtextureptr); 70 }; 71 }; 72 73 #endif 74