diff options
Diffstat (limited to 'src/Sprites.h')
-rw-r--r-- | src/Sprites.h | 124 |
1 files changed, 68 insertions, 56 deletions
diff --git a/src/Sprites.h b/src/Sprites.h index d487c7e..155258b 100644 --- a/src/Sprites.h +++ b/src/Sprites.h @@ -1,23 +1,43 @@ -#ifndef _SPRITE_H_ -#define _SPRITE_H_ +// Model structure +// Copyright (C) 2002 David Rosen +// Copyright (C) 2003 Steven Fuller +// Copyright (C) 2003 Zachary Jack Slater +// Copyright (C) 2021 Nguyễn Gia Phong +// +// This file is part of Black Shades. +// +// Black Shades is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Black Shades is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Black Shades. If not, see <https://www.gnu.org/licenses/>. + +#ifndef BLACKSHADES_SPRITES_H +#define BLACKSHADES_SPRITES_H -#include "Quaternions.h" #include <GL/gl.h> #include <GL/glu.h> + #include "Files.h" #include "Quaternions.h" #include "Camera.h" #include "Models.h" #include "Fog.h" -// -// Model Structures -// #define maxsprites 2000 #define muzzleflashsprite 1 #define smokesprite 2 #define smokespritenoup 3 +#define bullet 4 +#define bulletinstant 5 #define flashsprite 6 #define grenadesprite 7 #define pinsprite 8 @@ -28,61 +48,53 @@ #define snowsprite 13 #define rainsprite 14 -#define bullet 4 -#define bulletinstant 5 - class Sprites{ - public: - GLuint flaretextureptr; - GLuint muzzleflaretextureptr; - GLuint smoketextureptr; - GLuint bullettextureptr; - GLuint bloodtextureptr; - GLuint raintextureptr; - GLuint snowtextureptr; - - int howmanysprites; +public: + GLuint flaretextureptr; + GLuint muzzleflaretextureptr; + GLuint smoketextureptr; + GLuint bullettextureptr; + GLuint bloodtextureptr; + GLuint raintextureptr; + GLuint snowtextureptr; - XYZ location[maxsprites]; - XYZ oldlocation[maxsprites]; - XYZ velocity[maxsprites]; - XYZ initialvelocity[maxsprites]; - float size[maxsprites]; - float initialsize[maxsprites]; - float brightness[maxsprites]; - float initialbrightness[maxsprites]; - float color1[maxsprites]; - float color2[maxsprites]; - float color3[maxsprites]; - float alivetime[maxsprites]; - float rotation[maxsprites]; - int type[maxsprites]; - int owner[maxsprites]; + int howmanysprites; - void draw(); + XYZ location[maxsprites]; + XYZ oldlocation[maxsprites]; + XYZ velocity[maxsprites]; + XYZ initialvelocity[maxsprites]; + float size[maxsprites]; + float initialsize[maxsprites]; + float brightness[maxsprites]; + float initialbrightness[maxsprites]; + float color1[maxsprites]; + float color2[maxsprites]; + float color3[maxsprites]; + float alivetime[maxsprites]; + float rotation[maxsprites]; + int type[maxsprites]; + int owner[maxsprites]; - int DeleteSprite(int which); - int MakeSprite(int atype, float abrightness, float acolor1, float acolor2, float acolor3, XYZ alocation, XYZ avelocity, float asize); - int MakeSprite(int atype, float abrightness, float acolor1, float acolor2, float acolor3, XYZ alocation, XYZ avelocity, float asize, int aowner); + void draw(); - void DoStuff(); - void LoadMuzzleFlareTexture(char *fileName); - void LoadFlareTexture(char *fileName); - void LoadSmokeTexture(char *fileName); - void LoadBulletTexture(char *fileName); - void LoadBloodTexture(char *fileName); - void LoadSnowTexture(char *fileName); - void LoadRainTexture(char *fileName); + int DeleteSprite(int which); + int MakeSprite(int atype, float abrightness, + float acolor1, float acolor2, float acolor3, + XYZ alocation, XYZ avelocity, float asize); + int MakeSprite(int atype, float abrightness, + float acolor1, float acolor2, float acolor3, + XYZ alocation, XYZ avelocity, float asize, int aowner); - ~Sprites() { - glDeleteTextures( 1, (const GLuint *)muzzleflaretextureptr ); - glDeleteTextures( 1, (const GLuint *)flaretextureptr ); - glDeleteTextures( 1, (const GLuint *)bullettextureptr ); - glDeleteTextures( 1, (const GLuint *)smoketextureptr ); - glDeleteTextures( 1, (const GLuint *)bloodtextureptr ); - glDeleteTextures( 1, (const GLuint *)raintextureptr ); - glDeleteTextures( 1, (const GLuint *)snowtextureptr ); - }; + void DoStuff(); + void LoadMuzzleFlareTexture(char *fileName); + void LoadFlareTexture(char *fileName); + void LoadSmokeTexture(char *fileName); + void LoadBulletTexture(char *fileName); + void LoadBloodTexture(char *fileName); + void LoadSnowTexture(char *fileName); + void LoadRainTexture(char *fileName); + ~Sprites(); }; -#endif +#endif // BLACKSHADES_SPRITES_H |