X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FSprite.h;h=b2250bdf4092669860700ff574896652cf59ef8e;hb=cd043e3f9e26c2b3406b40a354c2840941e9db7f;hp=7f25a8425e386f3623c7ef4c8f3238b447bdfe34;hpb=de7834267e2ff8f28a2cb49647fc91e060686e93;p=lugaru.git diff --git a/Source/Sprite.h b/Source/Sprite.h index 7f25a84..b2250bd 100644 --- a/Source/Sprite.h +++ b/Source/Sprite.h @@ -3,20 +3,18 @@ Copyright (C) 2003, 2010 - Wolfire Games This file is part of Lugaru. -Lugaru 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 2 -of the License, or (at your option) any later version. +Lugaru 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 2 of the License, or +(at your option) any later version. -This program is distributed in the hope that it will be useful, +Lugaru 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. +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 this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +along with Lugaru. If not, see . */ #ifndef _SPRITE_H_ @@ -30,81 +28,83 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Lights.h" #include "Terrain.h" #include "Objects.h" +#include "Texture.h" #include #define max_sprites 20000 enum { - cloudsprite = 0, - bloodsprite, - flamesprite, - smoketype, - weaponflamesprite, - cloudimpactsprite, - snowsprite, - weaponshinesprite, - bloodflamesprite, - breathsprite, - splintersprite, - spritenumber + cloudsprite = 0, + bloodsprite, + flamesprite, + smoketype, + weaponflamesprite, + cloudimpactsprite, + snowsprite, + weaponshinesprite, + bloodflamesprite, + breathsprite, + splintersprite, + spritenumber }; -class Sprite{ - private: - XYZ oldposition; - XYZ position; - XYZ velocity; - float size; - float initialsize; - int type; - int special; - float color[3]; - float opacity; - float rotation; - float alivetime; - float speed; - float rotatespeed; - - static float checkdelay; - - static vector sprites; - - public: - static void DeleteSprite(int which); - static void MakeSprite(int atype, XYZ where, XYZ avelocity, float red, float green, float blue, float asize, float aopacity); - static void Draw(); - static void deleteSprites() { - sprites.clear(); - } - static void setLastSpriteSpecial(int s) { - sprites.back()->special = s; - } - static void setLastSpriteSpeed(int s) { - sprites.back()->speed = s; - } - static void setLastSpriteAlivetime(float al) { - sprites.back()->alivetime = al; - } - static void clearTextures(); - - static GLuint cloudtexture; - static GLuint bloodtexture; - static GLuint flametexture; - static GLuint smoketexture; - - static GLuint cloudimpacttexture; - static GLuint snowflaketexture; - static GLuint shinetexture; - static GLuint bloodflametexture; - - static GLuint splintertexture; - - static GLuint leaftexture; - static GLuint toothtexture; - - Sprite(); - ~Sprite(); +class Sprite +{ +private: + XYZ oldposition; + XYZ position; + XYZ velocity; + float size; + float initialsize; + int type; + int special; + float color[3]; + float opacity; + float rotation; + float alivetime; + float speed; + float rotatespeed; + + static float checkdelay; + + static vector sprites; + +public: + static void DeleteSprite(int which); + static void MakeSprite(int atype, XYZ where, XYZ avelocity, float red, float green, float blue, float asize, float aopacity); + static void Draw(); + static void deleteSprites() { + sprites.clear(); + } + static void setLastSpriteSpecial(int s) { + sprites.back()->special = s; + } + static void setLastSpriteSpeed(int s) { + sprites.back()->speed = s; + } + static void setLastSpriteAlivetime(float al) { + sprites.back()->alivetime = al; + } + static void clearTextures(); + + static Texture cloudtexture; + static Texture bloodtexture; + static Texture flametexture; + static Texture smoketexture; + + static Texture cloudimpacttexture; + static Texture snowflaketexture; + static Texture shinetexture; + static Texture bloodflametexture; + + static Texture splintertexture; + + static Texture leaftexture; + static Texture toothtexture; + + Sprite(); + ~Sprite(); }; #endif