]> git.jsancho.org Git - lugaru.git/commitdiff
Cleanning up Sprite class. More can be done, but it's already prettier.
authorCôme BERNIGAUD <come.bernigaud@gmail.com>
Sat, 5 Jun 2010 18:06:55 +0000 (20:06 +0200)
committerCôme BERNIGAUD <come.bernigaud@gmail.com>
Sat, 5 Jun 2010 18:06:55 +0000 (20:06 +0200)
I also corrected a little warning in openal_wrapper.h

19 files changed:
CMakeLists.txt
Source/Game.h
Source/GameDraw.cpp
Source/GameInitDispose.cpp
Source/GameTick.cpp
Source/Globals.cpp
Source/MacCompatibility.h
Source/Objects.cpp
Source/Objects.h
Source/Person.cpp
Source/Person.h
Source/Skeleton.cpp
Source/Skeleton.h
Source/TGALoader.cpp
Source/Weapons.cpp
Source/Weapons.h
Source/WinDefs.cpp
Source/WinDefs.h
Source/openal_wrapper.cpp

index e09a14908b9dd0ac429f56d4ceefe8bbf6b0c528..f0df14425c951166e2924075ed3dfc57bb953fc7 100644 (file)
@@ -69,7 +69,7 @@ set(LUGARU_SRCS
        ${SRCDIR}/Random.c
        ${SRCDIR}/Skeleton.cpp
        ${SRCDIR}/Skybox.cpp
-       ${SRCDIR}/Sprites.cpp
+       ${SRCDIR}/Sprite.cpp
        ${SRCDIR}/Terrain.cpp
        ${SRCDIR}/Text.cpp
        ${SRCDIR}/TGALoader.cpp
@@ -99,7 +99,7 @@ set(LUGARU_H
        ${SRCDIR}/Random.h
        ${SRCDIR}/Skeleton.h
        ${SRCDIR}/Skybox.h
-       ${SRCDIR}/Sprites.h
+       ${SRCDIR}/Sprite.h
        ${SRCDIR}/TGALoader.h
        ${SRCDIR}/Terrain.h
        ${SRCDIR}/Text.h
index 905b303a35ea0c0ff49d5a30b06cbe8bf43f540f..edf867a1d40a05082bc8a10dc646c281c56badc0 100644 (file)
@@ -47,7 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Lights.h"
 #include "Person.h"
 #include "Constants.h"
-#include "Sprites.h"
+#include "Sprite.h"
 //#include <agl.h>
 #include "Text.h"
 #include "Objects.h"
index 372529299a4dca2f27887cfe224248524ba19084..fd2337d5f759d0027d8b2d74e9dba833756b2163 100644 (file)
@@ -30,7 +30,7 @@ extern int environment;
 extern float texscale;
 extern Light light;
 extern Terrain terrain;
-extern Sprites sprites;
+//extern Sprites sprites;
 extern float multiplier;
 extern float sps;
 extern float viewdistance;
@@ -171,7 +171,7 @@ void Game::flash() { // shouldn't be that way, these should be attributes and Pe
        flashdelay=1;
 }
 /*********************> DrawGLScene() <*****/
-long long Game::MD5_string (char *string){
+long long Game::MD5_string (charstring){
        char temp[256]="";
        char temp2[256]="";
        long long num=90814;
@@ -598,7 +598,7 @@ int Game::DrawGLScene(StereoSide side)
 
                glDepthMask(0);
 
-               sprites.Draw();
+               Sprite::Draw();
 
                if(editorenabled){
                        glEnable(GL_BLEND);
@@ -1667,27 +1667,9 @@ int Game::DrawGLScene(StereoSide side)
                                        glTexCoord2f(0,1);
                                        glVertex3f(-1,  1, 0.0f);
                                        glEnd();
-                                       /*glBegin(GL_TRIANGLES);
-                                       glTexCoord2f(0,0);
-                                       glVertex3f(-1,          -1,      0.0f);
-                                       glTexCoord2f(1,0);
-                                       glVertex3f(1,   -1,      0.0f);
-                                       glTexCoord2f(1,1);
-                                       glVertex3f(0,   1, 0.0f);
-                                       glEnd();*/
                                        glPopMatrix();
                                }
                        }
-                       /*glBegin(GL_QUADS);
-                       glTexCoord2f(0,0);
-                       glVertex3f(-1,          -1,      0.0f);
-                       glTexCoord2f(1,0);
-                       glVertex3f(1,   -1,      0.0f);
-                       glTexCoord2f(1,1);
-                       glVertex3f(1,   1, 0.0f);
-                       glTexCoord2f(0,1);
-                       glVertex3f(-1,  1, 0.0f);
-                       glEnd();*/
                        glPopMatrix();
                        glDisable(GL_TEXTURE_2D);
                        glMatrixMode(GL_PROJECTION);                                            // Select The Projection Matrix
@@ -1700,12 +1682,6 @@ int Game::DrawGLScene(StereoSide side)
                        glDepthMask(1);
                }
 
-               /*if(loading){
-               loading=2;
-               drawmode=normalmode;
-               }*/
-
-
                if(loading&&!stealthloading&&(!campaign||player[0].dead)){
                        glDisable(GL_DEPTH_TEST);                                                       // Disables Depth Testing
                        glDisable(GL_CULL_FACE);
@@ -1794,47 +1770,6 @@ int Game::DrawGLScene(StereoSide side)
                        glColor3f (1.0, 1.0, 1.0); // no coloring
 
                        glEnable(GL_TEXTURE_2D);
-                       /*glBindTexture( GL_TEXTURE_2D, logotexture);
-                       glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-                       glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
-                       glDisable(GL_DEPTH_TEST);                                                       // Disables Depth Testing
-                       glDisable(GL_CULL_FACE);
-                       glDisable(GL_LIGHTING);
-                       glDepthMask(0);
-                       glMatrixMode(GL_PROJECTION);                                            // Select The Projection Matrix
-                       glPushMatrix();                                                                         // Store The Projection Matrix
-                       glLoadIdentity();                                                                       // Reset The Projection Matrix
-                       glOrtho(0,screenwidth,0,screenheight,-100,100);                                         // Set Up An Ortho Screen
-                       glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
-                       glPushMatrix();                                                                         // Store The Modelview Matrix
-                       glLoadIdentity();                                                               // Reset The Modelview Matrix
-                       glScalef((float)screenwidth/2,(float)screenwidth/2,1);
-                       glTranslatef(1.8,1.25,0);
-                       glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-                       glEnable(GL_BLEND);
-                       glColor4f(1,1,1,1);
-                       glPushMatrix();
-                       glScalef(.25,.25,.25);
-                       glBegin(GL_QUADS);
-                       glTexCoord2f(0,0);
-                       glVertex3f(-1,          -1,      0.0f);
-                       glTexCoord2f(1,0);
-                       glVertex3f(1,   -1,      0.0f);
-                       glTexCoord2f(1,1);
-                       glVertex3f(1,   1, 0.0f);
-                       glTexCoord2f(0,1);
-                       glVertex3f(-1,  1, 0.0f);
-                       glEnd();
-                       glPopMatrix();
-                       glDisable(GL_TEXTURE_2D);
-                       glMatrixMode(GL_PROJECTION);                                            // Select The Projection Matrix
-                       glPopMatrix();                                                                          // Restore The Old Projection Matrix
-                       glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
-                       glPopMatrix();                                                                          // Restore The Old Projection Matrix
-                       glEnable(GL_DEPTH_TEST);                                                        // Enables Depth Testing
-                       glEnable(GL_CULL_FACE);
-                       glDisable(GL_BLEND);
-                       glDepthMask(1);*/
 
                        //Awards
                        int numawards;
@@ -1847,76 +1782,73 @@ int Game::DrawGLScene(StereoSide side)
                        }
                        bool alldead;
                        alldead=1;
-                       if(numplayers>1)
-                               for(i=1;i<numplayers;i++){              
-                                       if(player[i].dead!=2)alldead=0;
-                               }
-                               if(alldead){
-                                       awards[numawards]=awardalldead;
-                                       numawards++;
-                               }
-                               alldead=1;
-                               if(numplayers>1)
-                                       for(i=1;i<numplayers;i++){              
-                                               if(player[i].dead!=1)alldead=0;
-                                       }
-                                       if(alldead){
-                                               awards[numawards]=awardnodead;
-                                               numawards++;
-                                       }
-                                       if(numresponded==0&&!numthrowkill){
-                                               awards[numawards]=awardstealth;
-                                               numawards++;
-                                       }
-                                       if(numattacks==numstaffattack&&numattacks>0){
-                                               awards[numawards]=awardbojutsu;
-                                               numawards++;
-                                       }
-                                       if(numattacks==numswordattack&&numattacks>0){
-                                               awards[numawards]=awardswordsman;
-                                               numawards++;
-                                       }
-                                       if(numattacks==numknifeattack&&numattacks>0){
-                                               awards[numawards]=awardknifefighter;
-                                               numawards++;
-                                       }
-                                       if(numattacks==numunarmedattack&&numthrowkill==0&&weapons.numweapons>0){
-                                               awards[numawards]=awardkungfu;
-                                               numawards++;
-                                       }
-                                       if(numescaped>0){
-                                               awards[numawards]=awardevasion;
-                                               numawards++;
-                                       }
-                                       if(numflipfail==0&&numflipped+numwallflipped*2>20){
-                                               awards[numawards]=awardacrobat;
-                                               numawards++;
-                                       }
-                                       if(numthrowkill==numplayers-1){
-                                               awards[numawards]=awardlongrange;
-                                               numawards++;
-                                       }
-                                       alldead=1;
-                                       if(numplayers>1)
-                                               for(i=1;i<numplayers;i++){              
-                                                       if(player[i].dead!=2)alldead=0;
-                                               }
-                                               if(numafterkill>0&&alldead){
-                                                       awards[numawards]=awardbrutal;
-                                                       numawards++;
-                                               }
-                                               if(numreversals>((float)numattacks)*.8&&numreversals>3){
-                                                       awards[numawards]=awardaikido;
-                                                       numawards++;
-                                               }
-                                               if(maxalarmed==1&&numplayers>2){
-                                                       awards[numawards]=awardstrategy;
-                                                       numawards++;
-                                               }
-                                               if(numflipfail>3){
-                                                       awards[numawards]=awardklutz;
-                                                       numawards++;
-                                               }
+                       for(i=1;i<numplayers;i++){              
+                               if(player[i].dead!=2)alldead=0;
+                       }
+                       if(alldead){
+                               awards[numawards]=awardalldead;
+                               numawards++;
+                       }
+                       alldead=1;
+                       for(i=1;i<numplayers;i++){              
+                               if(player[i].dead!=1)alldead=0;
+                       }
+                       if(alldead){
+                               awards[numawards]=awardnodead;
+                               numawards++;
+                       }
+                       if(numresponded==0&&!numthrowkill){
+                               awards[numawards]=awardstealth;
+                               numawards++;
+                       }
+                       if(numattacks==numstaffattack&&numattacks>0){
+                               awards[numawards]=awardbojutsu;
+                               numawards++;
+                       }
+                       if(numattacks==numswordattack&&numattacks>0){
+                               awards[numawards]=awardswordsman;
+                               numawards++;
+                       }
+                       if(numattacks==numknifeattack&&numattacks>0){
+                               awards[numawards]=awardknifefighter;
+                               numawards++;
+                       }
+                       if(numattacks==numunarmedattack&&numthrowkill==0&&weapons.numweapons>0){
+                               awards[numawards]=awardkungfu;
+                               numawards++;
+                       }
+                       if(numescaped>0){
+                               awards[numawards]=awardevasion;
+                               numawards++;
+                       }
+                       if(numflipfail==0&&numflipped+numwallflipped*2>20){
+                               awards[numawards]=awardacrobat;
+                               numawards++;
+                       }
+                       if(numthrowkill==numplayers-1){
+                               awards[numawards]=awardlongrange;
+                               numawards++;
+                       }
+                       alldead=1;
+                       for(i=1;i<numplayers;i++){              
+                               if(player[i].dead!=2)alldead=0;
+                       }
+                       if(numafterkill>0&&alldead){
+                               awards[numawards]=awardbrutal;
+                               numawards++;
+                       }
+                       if(numreversals>((float)numattacks)*.8&&numreversals>3){
+                               awards[numawards]=awardaikido;
+                               numawards++;
+                       }
+                       if(maxalarmed==1&&numplayers>2){
+                               awards[numawards]=awardstrategy;
+                               numawards++;
+                       }
+                       if(numflipfail>3){
+                               awards[numawards]=awardklutz;
+                               numawards++;
+                       }
 
 
                                                //Win Screen Won Victory
@@ -2270,22 +2202,10 @@ int Game::DrawGLScene(StereoSide side)
                        if(mainmenu==1){
                                LoadTexture(":Data:Textures:Newgame.png",&Mainmenuitems[1],0,0);
                                LoadTexture(":Data:Textures:Quit.png",&Mainmenuitems[3],0,0);
-                               /*if(oldmainmenu==1||oldmainmenu==0){
-                               LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0);
-                               LoadTexture(":Data:Textures:Options.png",&Mainmenuitems[2],0,0);
-                               LoadTexture(":Data:Textures:Lugaru.png",&Mainmenuitems[0],0,0);
-                               loaddistrib=0;
-                               }*/
                        }
                        if(mainmenu==2){
                                LoadTexture(":Data:Textures:Resume.png",&Mainmenuitems[1],0,0);
                                LoadTexture(":Data:Textures:Endgame.png",&Mainmenuitems[3],0,0);
-                               /*if(oldmainmenu==2||oldmainmenu==0){
-                               LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0);
-                               LoadTexture(":Data:Textures:Options.png",&Mainmenuitems[2],0,0);
-                               LoadTexture(":Data:Textures:Lugaru.png",&Mainmenuitems[0],0,0);
-                               loaddistrib=0;
-                               }*/
                        }
                }
                if(lastcheck>.5||oldmainmenu!=mainmenu){
index ea0d7366be409a3f4631fce30776b438c60a394f..6426698120276c413de43a5a234ab6af73734f1e 100644 (file)
@@ -37,7 +37,7 @@ extern int numsounds;
 extern OPENAL_SAMPLE   *samp[100];
 extern int channels[100];
 extern Terrain terrain;
-extern Sprites sprites;
+//extern Sprites sprites;
 extern int kTextureSize;
 extern float texdetail;
 extern float realtexdetail;
@@ -393,7 +393,8 @@ void Game::LoadTexture(const char *fileName, GLuint *textureid,int mipmap, bool
 
                glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
 
-               if(!*textureid)glGenTextures( 1, textureid );
+               if(!*textureid)
+                       glGenTextures( 1, textureid );
                glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
 
                glBindTexture( GL_TEXTURE_2D, *textureid);
@@ -401,20 +402,9 @@ void Game::LoadTexture(const char *fileName, GLuint *textureid,int mipmap, bool
                if(trilinear)if(mipmap)glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
                if(!trilinear)if(mipmap)glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
                if(!mipmap)glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-
-               //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture.sizeX, texture.sizeY, 0,
-               //          GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, texture.data);
-
-               //gluBuild2DMipmaps( GL_TEXTURE_2D, type, texture.sizeX, texture.sizeY, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, texture.data );
-
+               
                gluBuild2DMipmaps( GL_TEXTURE_2D, type, texture.sizeX, texture.sizeY, type, GL_UNSIGNED_BYTE, texture.data );
-
-//             textures.insert(std::make_pair(fname, *textureid));
        }
-//     else
-//     {
-//             *textureid = it->second;
-//     }
 }
 
 void Game::LoadTextureSave(const char *fileName, GLuint *textureid,int mipmap,GLubyte *array, int *skinsize)
@@ -1338,19 +1328,19 @@ void Game::LoadStuff()
 
        LoadTexture(":Data:Textures:bodyprint.png",&terrain.bodyprinttexture,0,1);
 
-       /*LoadTexture(":Data:Textures:cloud.png",&sprites.cloudtexture,1);
+       /*LoadTexture(":Data:Textures:cloud.png",&Sprite::cloudtexture,1);
 
-       LoadTexture(":Data:Textures:cloudimpact.png",&sprites.cloudimpacttexture,1);
+       LoadTexture(":Data:Textures:cloudimpact.png",&Sprite::cloudimpacttexture,1);
 
-       LoadTexture(":Data:Textures:bloodparticle.png",&sprites.bloodtexture,1);
+       LoadTexture(":Data:Textures:bloodparticle.png",&Sprite::bloodtexture,1);
 
-       LoadTexture(":Data:Textures:snowflake.png",&sprites.snowflaketexture,1);
+       LoadTexture(":Data:Textures:snowflake.png",&Sprite::snowflaketexture,1);
 
-       LoadTexture(":Data:Textures:flame.png",&sprites.flametexture,1);
+       LoadTexture(":Data:Textures:flame.png",&Sprite::flametexture,1);
 
-       LoadTexture(":Data:Textures:smoke.png",&sprites.smoketexture,1);
+       LoadTexture(":Data:Textures:smoke.png",&Sprite::smoketexture,1);
        //texdetail=temptexdetail;
-       LoadTexture(":Data:Textures:shine.png",&sprites.shinetexture,1);*/
+       LoadTexture(":Data:Textures:shine.png",&Sprite::shinetexture,1);*/
 
 
 
@@ -1362,17 +1352,17 @@ void Game::LoadStuff()
        //LoadTexture(":Data:Textures:box.jpg",&objects.boxtextureptr,1,0);
 
 
-       LoadTexture(":Data:Textures:cloud.png",&sprites.cloudtexture,1,1);
-       LoadTexture(":Data:Textures:cloudimpact.png",&sprites.cloudimpacttexture,1,1);
-       LoadTexture(":Data:Textures:bloodparticle.png",&sprites.bloodtexture,1,1);
-       LoadTexture(":Data:Textures:snowflake.png",&sprites.snowflaketexture,1,1);
-       LoadTexture(":Data:Textures:flame.png",&sprites.flametexture,1,1);
-       LoadTexture(":Data:Textures:bloodflame.png",&sprites.bloodflametexture,1,1);
-       LoadTexture(":Data:Textures:smoke.png",&sprites.smoketexture,1,1);
-       LoadTexture(":Data:Textures:shine.png",&sprites.shinetexture,1,0);
-       LoadTexture(":Data:Textures:splinter.png",&sprites.splintertexture,1,1);
-       LoadTexture(":Data:Textures:leaf.png",&sprites.leaftexture,1,1);
-       LoadTexture(":Data:Textures:tooth.png",&sprites.toothtexture,1,1);
+       LoadTexture(":Data:Textures:cloud.png",&Sprite::cloudtexture,1,1);
+       LoadTexture(":Data:Textures:cloudimpact.png",&Sprite::cloudimpacttexture,1,1);
+       LoadTexture(":Data:Textures:bloodparticle.png",&Sprite::bloodtexture,1,1);
+       LoadTexture(":Data:Textures:snowflake.png",&Sprite::snowflaketexture,1,1);
+       LoadTexture(":Data:Textures:flame.png",&Sprite::flametexture,1,1);
+       LoadTexture(":Data:Textures:bloodflame.png",&Sprite::bloodflametexture,1,1);
+       LoadTexture(":Data:Textures:smoke.png",&Sprite::smoketexture,1,1);
+       LoadTexture(":Data:Textures:shine.png",&Sprite::shinetexture,1,0);
+       LoadTexture(":Data:Textures:splinter.png",&Sprite::splintertexture,1,1);
+       LoadTexture(":Data:Textures:leaf.png",&Sprite::leaftexture,1,1);
+       LoadTexture(":Data:Textures:tooth.png",&Sprite::toothtexture,1,1);
 
        rotation=0;
        rotation2=0;
index b3114ede00ef316177d82a46fc01e3b8a03aea50..62ecfc2491ea16bbbe35e54971af5264e1ba18cb 100644 (file)
@@ -49,7 +49,7 @@ extern float texscale;
 extern Terrain terrain;
 extern OPENAL_SAMPLE *samp[100];
 extern int channels[100];
-extern Sprites sprites;
+//extern Sprites sprites;
 extern int kTextureSize;
 extern float screenwidth,screenheight;
 extern float gravity;
@@ -1720,7 +1720,7 @@ void      Game::Loadlevel(char *name){
                if(!stealthloading)
                {
                        terrain.numdecals=0;
-                       sprites.numsprites=0;
+                       Sprite::deleteSprites();
                        for(i=0;i<objects.numobjects;i++)
                        {
                                objects.model[i].numdecals=0;
@@ -3293,7 +3293,7 @@ void      Game::Tick()
                                                                hotspotsprite=DoRotation(hotspotsprite,0,0,Random()%360);
                                                                hotspotsprite=DoRotation(hotspotsprite,0,Random()%360,0);
                                                                hotspotsprite+=hotspot[i];
-                                                               sprites.MakeSprite(breathsprite, hotspotsprite, hotspotsprite*0, 1,0.5,0, 7, 0.4);
+                                                               Sprite::MakeSprite(breathsprite, hotspotsprite, hotspotsprite*0, 1,0.5,0, 7, 0.4);
                                                                hotspotvisual[i]+=0.1/hotspotsize[i]/hotspotsize[i]/hotspotsize[i];
                                                        }
                                                }
@@ -3373,7 +3373,7 @@ void      Game::Tick()
                                                                        if(player[1].skeleton.free)temp2=player[1].skeleton.joints[i].velocity*player[1].scale/2;
                                                                        if(!player[1].skeleton.free)temp=DoRotation(DoRotation(DoRotation(player[1].skeleton.joints[i].position,0,0,player[1].tilt),player[1].tilt2,0,0),0,player[1].rotation,0)*player[1].scale+player[1].coords;
                                                                        if(player[1].skeleton.free)temp=player[1].skeleton.joints[i].position*player[1].scale+player[1].coords;
-                                                                       sprites.MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
+                                                                       Sprite::MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
                                                                }
                                                        }
 
@@ -3625,7 +3625,7 @@ void      Game::Tick()
                                                                        if(player[1].skeleton.free)temp2=player[1].skeleton.joints[i].velocity*player[1].scale/2;
                                                                        if(!player[1].skeleton.free)temp=DoRotation(DoRotation(DoRotation(player[1].skeleton.joints[i].position,0,0,player[1].tilt),player[1].tilt2,0,0),0,player[1].rotation,0)*player[1].scale+player[1].coords;
                                                                        if(player[1].skeleton.free)temp=player[1].skeleton.joints[i].position*player[1].scale+player[1].coords;
-                                                                       sprites.MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
+                                                                       Sprite::MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
                                                                }
                                                        }
 
@@ -3813,7 +3813,7 @@ void      Game::Tick()
                                                                footpoint.y+=((float)abs(Random()%1200))/100-6;
                                                                footpoint.x+=((float)abs(Random()%1200))/100-6;
                                                                footpoint.z+=((float)abs(Random()%1200))/100-6;
-                                                               sprites.MakeSprite(snowsprite, footpoint,footvel, 1,1,1, .1, 1);
+                                                               Sprite::MakeSprite(snowsprite, footpoint,footvel, 1,1,1, .1, 1);
                                                        }
                                                }
                                                for(k=0;k<numplayers;k++){
@@ -4822,11 +4822,11 @@ void    Game::Tick()
                                                                                flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
                                                                                headspurtdirection=player[closest].skeleton.joints[player[closest].skeleton.jointlabels[head]].position-player[closest].skeleton.joints[player[closest].skeleton.jointlabels[neck]].position;
                                                                                Normalise(&headspurtdirection);
-                                                                               sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, .6, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, .6, 1);
                                                                                flatvelocity2+=headspurtdirection*8;
-                                                                               sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2/2, 1,1,1, .16, 1);
+                                                                               Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2/2, 1,1,1, .16, 1);
                                                                        }
-                                                                       sprites.MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
+                                                                       Sprite::MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
 
                                                                        float gLoc[3];
                                                                        float vel[3];
@@ -4903,9 +4903,9 @@ void      Game::Tick()
                                                                                flatvelocity2.x+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.y+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
-                                                                               sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
-                                                                               sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .3, 1);
-                                                                               sprites.MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
+                                                                               Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
                                                                        }
 
                                                                        for(i=0;i<player[closest].skeleton.num_joints; i++){
@@ -4916,8 +4916,8 @@ void      Game::Tick()
                                                                                flatvelocity2.x+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.y+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
-                                                                               sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
-                                                                               sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .4, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .4, 1);
                                                                        }
 
                                                                        for(i=0;i<player[closest].skeleton.num_joints; i++){
@@ -4928,8 +4928,8 @@ void      Game::Tick()
                                                                                flatvelocity2.x+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.y+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
-                                                                               sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2*2, 1,1,1, 3, 1);
-                                                                               sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2*2, 1,1,1, .4, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2*2, 1,1,1, 3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2*2, 1,1,1, .4, 1);
                                                                        }
 
                                                                        for(i=0;i<player[closest].skeleton.num_joints; i++){
@@ -4940,8 +4940,8 @@ void      Game::Tick()
                                                                                flatvelocity2.x+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.y+=(float)(abs(Random()%100)-50)/10;
                                                                                flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
-                                                                               sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2*2, 1,1,1, 3, 1);
-                                                                               sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2*2, 1,1,1, .4, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2*2, 1,1,1, 3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2*2, 1,1,1, .4, 1);
                                                                        }
 
                                                                        XYZ temppos;
@@ -7231,7 +7231,7 @@ void      Game::Tick()
                                                                                                                                                                footpoint=weapons.position[k];
                                                                                                                                                                if(player[i].victim->weaponstuck!=-1){
                                                                                                                                                                        if(player[i].victim->weaponids[player[i].victim->weaponstuck]==k){
-                                                                                                                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
+                                                                                                                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
                                                                                                                                                                                weapons.bloody[k]=2;
                                                                                                                                                                                weapons.blooddrip[k]=5;
                                                                                                                                                                                player[i].victim->weaponstuck=-1;
@@ -7829,7 +7829,7 @@ void      Game::Tick()
                                                                                                                        if(player[1].skeleton.free)temp2=player[1].skeleton.joints[i].velocity*player[1].scale/2;
                                                                                                                        if(!player[1].skeleton.free)temp=DoRotation(DoRotation(DoRotation(player[1].skeleton.joints[i].position,0,0,player[1].tilt),player[1].tilt2,0,0),0,player[1].rotation,0)*player[1].scale+player[1].coords;
                                                                                                                        if(player[1].skeleton.free)temp=player[1].skeleton.joints[i].position*player[1].scale+player[1].coords;
-                                                                                                                       sprites.MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
+                                                                                                                       Sprite::MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
                                                                                                                }
                                                                                                        }
 
@@ -7841,7 +7841,7 @@ void      Game::Tick()
                                                                                                                        if(player[1].skeleton.free)temp2=player[1].skeleton.joints[i].velocity*player[1].scale/2;
                                                                                                                        if(!player[1].skeleton.free)temp=DoRotation(DoRotation(DoRotation(player[1].skeleton.joints[i].position,0,0,player[1].tilt),player[1].tilt2,0,0),0,player[1].rotation,0)*player[1].scale+player[1].coords;
                                                                                                                        if(player[1].skeleton.free)temp=player[1].skeleton.joints[i].position*player[1].scale+player[1].coords;
-                                                                                                                       sprites.MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
+                                                                                                                       Sprite::MakeSprite(breathsprite, temp,temp2, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
                                                                                                                }
                                                                                                        }
                                                                                                }
index d55167b01f9513013310a4cfb43ec456deec6e41..b3b7eee8e2c4463e23dc0deb8555492fb398c227 100644 (file)
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Lights.h"
 #include "Skeleton.h"
 #include "Terrain.h"
-#include "Sprites.h"
+#include "Sprite.h"
 #include "Frustum.h"
 #include "Objects.h"
 #include "Weapons.h"
@@ -75,7 +75,6 @@ Animation animation[animation_count];
 Skeleton testskeleton;
 int numsounds = 0;
 Terrain terrain;
-Sprites sprites;
 float sps = 0;
 
 SDL_Surface *sdlscreen;
index 3a99c52a052925f9dfc90c7036950365f5aca3ee..1b6894001ffedf604aecaec76cd59625c8c68731 100644 (file)
@@ -111,21 +111,7 @@ inline bool isnormal( double x)
 char* ConvertFileName( const char* orgfilename, const char *mode = "rb" );
 
 #define fopen( a, b) fopen(ConvertFileName(a, b), b)
-/*
-inline float abs( float f)
-{
-if (f < 0)
-return -f;
-return f;
-}
 
-inline double abs( double f)
-{
-if (f < 0)
-return -f;
-return f;
-}
-*/
 __forceinline long long longlongabs( long long f)
 {
        if (f < 0)
index d67044eee0923ea543436805384068352c0cf457..3317992d97d8553b00fffbe3f2999a2450bdd048 100644 (file)
@@ -38,7 +38,6 @@ extern float blurness;
 extern float windvar;
 extern float playerdist;
 extern bool skyboxtexture;
-extern Sprites sprites;
 
 //Functions
 
@@ -664,7 +663,7 @@ void Objects::DoStuff()
        XYZ spawnpoint;
        for(int i=0;i<numobjects;i++){
                /*if(type[i]==firetype){
-               sprites.MakeSprite(weaponshinesprite, position[i],position[i]*0, 1,1,1, 5, 1);
+               Sprite::MakeSprite(weaponshinesprite, position[i],position[i]*0, 1,1,1, 5, 1);
                }*/
 
                if(type[i]==firetype)onfire[i]=1;
@@ -680,7 +679,7 @@ void Objects::DoStuff()
                                        spawnpoint.z=0;
                                        spawnpoint=DoRotation(spawnpoint,0,Random()%360,0);
                                        spawnpoint+=position[i];
-                                       sprites.MakeSprite(flamesprite, spawnpoint,spawnpoint*0, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*5*scale[i], 1);
+                                       Sprite::MakeSprite(flamesprite, spawnpoint,spawnpoint*0, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*5*scale[i], 1);
                                }
                                if(type[i]==treeleavestype){
                                        spawnpoint.x=((float)(Random()%100))/80*scale[i];
@@ -688,7 +687,7 @@ void Objects::DoStuff()
                                        spawnpoint.z=0;
                                        spawnpoint=DoRotation(spawnpoint,0,Random()%360,0);
                                        spawnpoint+=position[i];
-                                       sprites.MakeSprite(flamesprite, spawnpoint,spawnpoint*0, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*6, 1);
+                                       Sprite::MakeSprite(flamesprite, spawnpoint,spawnpoint*0, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*6, 1);
                                }
                        }
 
index a3319ef6dd9dead41fd9cf92b9426b97b6b1b8c6..400d6b3064e4f300b744dd134d50fef0de96d26d 100644 (file)
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Lights.h"
 #include "Models.h"
 #include "Terrain.h"
-#include "Sprites.h"
+#include "Sprite.h"
 #include <vector>
 //
 // Model Structures
index d1ac29f591e27a9b884e11945facdcfa0b4cd8c9..cf4a6fbcac35bc34b8fb34b7b10d23166a18c507 100644 (file)
@@ -30,7 +30,6 @@ extern int channels[100];
 extern Terrain terrain;
 extern float gravity;
 extern int environment;
-extern Sprites sprites;
 extern int detail;
 extern FRUSTUM frustum;
 extern XYZ viewer;
@@ -202,7 +201,7 @@ void Person::CatchFire(){
                if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity;
                if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
                if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
-               sprites.MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, 2, 1);
+               Sprite::MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, 2, 1);
        }
 
        onfiredelay=0.5;
@@ -435,36 +434,33 @@ void Person::DoBlood(float howmuch,int which){
                                if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
                                if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
                                if(skeleton.free){
-                                       sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                       sprites.MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
+                                       Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                       Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
                                }
                                if(!skeleton.free){
-                                       sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                       sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
+                                       Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                       Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
                                }
                        }
                        if(Random()%2==0)
                                for(int i=0;i<3;i++){
                                        if(Random()%2!=0){
                                                bloodvel=0;
-                                               if(!skeleton.free){
+                                               if(skeleton.free) {
+                                                       bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0);
+                                                       bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
+                                               } else {
                                                        bloodvel.z=10;
                                                        bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
+                                                       bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
                                                }
-                                               if(skeleton.free){
-                                                       bloodvel-=DoRotation(skeleton.forward*10*scale,((float)(Random()%100))/4,((float)(Random()%100))/4,0);
-                                               }
-                                               if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
-                                               if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
                                                bloodvel*=.2;
                                                if(skeleton.free){
-                                                       sprites.MakeSprite(splintersprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                                       sprites.special[sprites.numsprites-1]=3;
-                                               }
-                                               if(!skeleton.free){
-                                                       sprites.MakeSprite(splintersprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                                       sprites.special[sprites.numsprites-1]=3;
+                                                       Sprite::MakeSprite(splintersprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                               } else {
+                                                       Sprite::MakeSprite(splintersprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
                                                }
+                                               Sprite::setLastSpriteSpecial(3);
                                        }
                                }
                }
@@ -478,16 +474,16 @@ void Person::DoBlood(float howmuch,int which){
                                        bleedxint=abs(Random()%512);
                                        bleedyint=abs(Random()%512);
                                }
-                               if(creature==wolftype)
-                                       while(wolfbloodText[bleedxint*512*3+bleedyint*3+0]>which+4||wolfbloodText[bleedxint*512*3+bleedyint*3+0]<which-4||bleedxint<10||bleedyint<10||bleedxint>500||bleedyint>500){
-                                               bleedxint=abs(Random()%512);
-                                               bleedyint=abs(Random()%512);
-                                       }
-                                       bleedy=bleedxint;
-                                       bleedx=bleedyint;
-                                       bleedy/=realtexdetail;
-                                       bleedx/=realtexdetail;
-                                       direction=abs(Random()%2)*2-1;
+                       if(creature==wolftype)
+                               while(wolfbloodText[bleedxint*512*3+bleedyint*3+0]>which+4||wolfbloodText[bleedxint*512*3+bleedyint*3+0]<which-4||bleedxint<10||bleedyint<10||bleedxint>500||bleedyint>500){
+                                       bleedxint=abs(Random()%512);
+                                       bleedyint=abs(Random()%512);
+                               }
+                       bleedy=bleedxint;
+                       bleedx=bleedyint;
+                       bleedy/=realtexdetail;
+                       bleedx/=realtexdetail;
+                       direction=abs(Random()%2)*2-1;
                }
 
        }
@@ -562,12 +558,12 @@ void Person::DoBloodBig(float howmuch,int which){
                                        if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
                                        if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
                                        if(skeleton.free){
-                                               sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                               sprites.MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
+                                               Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                               Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
                                        }
                                        if(!skeleton.free){
-                                               sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                               sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
+                                               Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                               Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
                                        }
                                }
                        }
@@ -789,12 +785,12 @@ bool Person::DoBloodBigWhere(float howmuch,int which, XYZ where){
                                        if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
                                        if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
                                        if(skeleton.free){
-                                               sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                               sprites.MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
+                                               Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                               Sprite::MakeSprite(bloodflamesprite, skeleton.joints[skeleton.jointlabels[head]].position*scale+coords,bloodvel, 1,1,1, .3, 1);
                                        }
                                        if(!skeleton.free){
-                                               sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
-                                               sprites.MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
+                                               Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                               Sprite::MakeSprite(bloodflamesprite, DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .3, 1);
                                        }
                                }
                        }
@@ -1385,9 +1381,9 @@ void Person::DoDamage(float howmuch){
                        flatvelocity2.x+=(float)(abs(Random()%100)-50)/10;
                        flatvelocity2.y+=(float)(abs(Random()%100)-50)/10;
                        flatvelocity2.z+=(float)(abs(Random()%100)-50)/10;
-                       sprites.MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
-                       sprites.MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .4, 1);
-                       sprites.MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
+                       Sprite::MakeSprite(bloodflamesprite, flatfacing2,flatvelocity2, 1,1,1, 3, 1);
+                       Sprite::MakeSprite(bloodsprite, flatfacing2,flatvelocity2, 1,1,1, .4, 1);
+                       Sprite::MakeSprite(cloudsprite, flatfacing2,flatvelocity2*0, .6,0,0, 1, .5);
                }
 
                float gLoc[3];
@@ -1707,7 +1703,7 @@ void Person::FootLand(int which, float opacity){
                        if(which==0)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)*scale+coords;
                        if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
                        //footpoint.y=coords.y;
-                       if(findDistancefast(&footpoint,&viewer))sprites.MakeSprite(cloudsprite, footpoint,footvel, 1,1,1, .5, .2*opacity);
+                       if(findDistancefast(&footpoint,&viewer))Sprite::MakeSprite(cloudsprite, footpoint,footvel, 1,1,1, .5, .2*opacity);
                }
                else if(environment==snowyenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){
                        footvel=velocity/5;
@@ -1716,7 +1712,7 @@ void Person::FootLand(int which, float opacity){
                        if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
                        footpoint.y=terrain.getHeight(footpoint.x,footpoint.z);
                        terrainlight=terrain.getLighting(footpoint.x,footpoint.z);
-                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x,terrainlight.y,terrainlight.z, .5, .7*opacity);
+                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x,terrainlight.y,terrainlight.z, .5, .7*opacity);
                        if(opacity>=1||detail==2)if(detail==2)if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)terrain.MakeDecal(footprintdecal,footpoint,.2,1*opacity,rotation);
                }
                else if(environment==grassyenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){
@@ -1726,7 +1722,7 @@ void Person::FootLand(int which, float opacity){
                        if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
                        footpoint.y=terrain.getHeight(footpoint.x,footpoint.z);
                        terrainlight=terrain.getLighting(footpoint.x,footpoint.z);
-                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5*opacity);
+                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5*opacity);
                }
                else if(environment==desertenvironment&&onterrain&&terrain.getOpacity(coords.x,coords.z)<.2){
                        footvel=velocity/5;
@@ -1735,7 +1731,7 @@ void Person::FootLand(int which, float opacity){
                        if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
                        footpoint.y=terrain.getHeight(footpoint.x,footpoint.z);
                        terrainlight=terrain.getLighting(footpoint.x,footpoint.z);
-                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7*opacity);
+                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7*opacity);
                        if(opacity>=1||detail==2)if(detail==2)if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)terrain.MakeDecal(footprintdecal,footpoint,.2,.25*opacity,rotation);
                }
                else if(isLanding()||targetanimation==jumpupanim||isLandhard())
@@ -1745,7 +1741,7 @@ void Person::FootLand(int which, float opacity){
                        if(which==0)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[leftfoot]].position,0,rotation,0)*scale+coords;
                        if(which==1)footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[rightfoot]].position,0,rotation,0)*scale+coords;
                        //footpoint.y=coords.y;
-                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, footpoint,footvel*.6, 1,1,1, .5, .2*opacity);
+                       if(findDistancefast(&footpoint,&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, footpoint,footvel*.6, 1,1,1, .5, .2*opacity);
                }
 }
 
@@ -1754,7 +1750,7 @@ void Person::Puff(int whichlabel){
 
        footvel=0;
        footpoint=DoRotation(skeleton.joints[skeleton.jointlabels[whichlabel]].position,0,rotation,0)*scale+coords;
-       sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .9, .3);
+       Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .9, .3);
 }
 
 
@@ -2306,7 +2302,7 @@ void      Person::DoAnimations(){
                                                                                                                footpoint=weapons.position[i];
                                                                                                                if(victim->weaponstuck!=-1){
                                                                                                                        if(victim->weaponids[victim->weaponstuck]==i){
-                                                                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
+                                                                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
                                                                                                                                weapons.bloody[i]=2;
                                                                                                                                weapons.blooddrip[i]=5;
                                                                                                                                victim->weaponstuck=-1;
@@ -3043,7 +3039,7 @@ void      Person::DoAnimations(){
                                                                                                relative.y=10;
                                                                                                Normalise(&relative);
                                                                                                //victim->Puff(abdomen);
-                                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
+                                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
 
                                                                                                if(victim->bloodloss<victim->damagetolerance){
                                                                                                        victim->bloodloss+=1000;
@@ -3320,16 +3316,16 @@ void    Person::DoAnimations(){
                                                                                                footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords;
                                                                                        }
                                                                                        if(tutoriallevel!=1){
-                                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3);
+                                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .6, .3);
                                                                                                footvel=DoRotation(facing,0,90,0)*.8;
                                                                                                //footvel.y-=.3;
-                                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
-                                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
+                                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
+                                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
                                                                                        }
                                                                                        if(tutoriallevel==1){
-                                                                                               sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .6, .3);
+                                                                                               Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .6, .3);
                                                                                        }
                                                                                        victim->DoDamage(damagemult*0);
                                                                                }
@@ -3390,13 +3386,13 @@ void    Person::DoAnimations(){
                                                                                                if(!skeleton.free){
                                                                                                        footpoint=DoRotation((victim->skeleton.joints[victim->skeleton.jointlabels[abdomen]].position+victim->skeleton.joints[victim->skeleton.jointlabels[neck]].position)/2,0,victim->rotation,0)*victim->scale+victim->coords;
                                                                                                }
-                                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+                                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
                                                                                                footvel=DoRotation(facing,0,90,0)*.8;
                                                                                                footvel.y-=.3;
-                                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
-                                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+                                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+                                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
                                                                                        }
                                                                                }
                                                                                else {
@@ -4153,17 +4149,17 @@ void    Person::DoAnimations(){
                                                                                        bloodvel.z=20;
                                                                                        bloodvel.y=5;
                                                                                        bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
-                                                                                       sprites.MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+                                                                                       Sprite::MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
                                                                                        */
                                                                                        XYZ footvel,footpoint;
                                                                                        footvel=0;
                                                                                        footpoint=weapons.tippoint[weaponids[0]];
-                                                                                       if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+                                                                                       if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
                                                                                        footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]]);
-                                                                                       sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                       sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                       sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
-                                                                                       sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+                                                                                       Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                       Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                       Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+                                                                                       Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
                                                                                        victim->DoBloodBig(200,195);
                                                                                        if(id==0){
                                                                                                bonus=tracheotomy;
@@ -4182,12 +4178,12 @@ void    Person::DoAnimations(){
                                                                                        XYZ footvel,footpoint;
                                                                                        footvel=0;
                                                                                        footpoint=weapons.tippoint[weaponids[0]];
-                                                                                       if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+                                                                                       if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
                                                                                        footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]])*-1;
-                                                                                       sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                       sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                                       sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
-                                                                                       sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
+                                                                                       Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                       Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                                       Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .2, 1);
+                                                                                       Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .2, 1);
 
                                                                                }
                                                                                victim->bloodloss+=10000;
@@ -4240,12 +4236,12 @@ void    Person::DoAnimations(){
                                                                                XYZ footvel,footpoint;
                                                                                footvel=0;
                                                                                footpoint=weapons.tippoint[weaponids[0]];
-                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
                                                                                footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]])*-1;
-                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
-                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
                                                                        }
                                                                }
 
@@ -4262,12 +4258,12 @@ void    Person::DoAnimations(){
                                                                                XYZ footvel,footpoint;
                                                                                footvel=0;
                                                                                footpoint=(weapons.tippoint[weaponids[0]]+weapons.position[weaponids[0]])/2;
-                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
                                                                                footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]]);
-                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*5,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
-                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*5,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .3, 1);
                                                                                victim->DoBloodBig(200,180);
                                                                                victim->DoBloodBig(200,215);
                                                                                victim->bloodloss+=10000;
@@ -4314,12 +4310,12 @@ void    Person::DoAnimations(){
                                                                                XYZ footvel,footpoint;
                                                                                footvel=0;
                                                                                footpoint=weapons.tippoint[weaponids[0]];
-                                                                               if(bloodtoggle)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
+                                                                               if(bloodtoggle)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .9, .3);
                                                                                footvel=(weapons.tippoint[weaponids[0]]-weapons.position[weaponids[0]])*-1;
-                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                               sprites.MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
-                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
-                                                                               sprites.MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*7,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                               Sprite::MakeSprite(bloodsprite,footpoint,DoRotation(footvel*3,(float)(Random()%20),(float)(Random()%20),0), 1,1,1, .05, .9);
+                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*5, 1,1,1, .3, 1);
+                                                                               Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*2, 1,1,1, .3, 1);
                                                                        }
                                                                }
 
@@ -5098,7 +5094,7 @@ void      Person::DoStuff(){
                if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2;
                if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
                if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
-               sprites.MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
+               Sprite::MakeSprite(flamesprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, 1);
        }
 
        while(flamedelay<0&&!onfire&&tutoriallevel==1&&id!=0){
@@ -5108,7 +5104,7 @@ void      Person::DoStuff(){
                if(skeleton.free)flatvelocity=skeleton.joints[howmany].velocity*scale/2;
                if(!skeleton.free)flatfacing=DoRotation(DoRotation(DoRotation(skeleton.joints[howmany].position,0,0,tilt),tilt2,0,0),0,rotation,0)*scale+coords;
                if(skeleton.free)flatfacing=skeleton.joints[howmany].position*scale+coords;
-               sprites.MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3);
+               Sprite::MakeSprite(breathsprite, flatfacing,flatvelocity, 1,1,1, .6+(float)abs(Random()%100)/200-.25, .3);
        }
 
        if(bleeding>0){
@@ -5135,8 +5131,8 @@ void      Person::DoStuff(){
                        }
                        if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[head]].velocity,((float)(Random()%100))/40,rotation+((float)(Random()%100))/40,0)*scale;
                        if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/40,((float)(Random()%100))/40,0)*scale;
-                       if(skeleton.free)sprites.MakeSprite(bloodsprite, (skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5)*scale+coords,bloodvel, 1,1,1, .05, .9);
-                       if(!skeleton.free)sprites.MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, .9);
+                       if(skeleton.free)Sprite::MakeSprite(bloodsprite, (skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5)*scale+coords,bloodvel, 1,1,1, .05, .9);
+                       if(!skeleton.free)Sprite::MakeSprite(bloodsprite, DoRotation(skeleton.joints[skeleton.jointlabels[neck]].position+(skeleton.joints[skeleton.jointlabels[neck]].position-skeleton.joints[skeleton.jointlabels[head]].position)/5,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, .9);
                        neckspurtparticledelay=.05;
                }
                if(neckspurtdelay<0){
@@ -5154,8 +5150,8 @@ void      Person::DoStuff(){
                                bloodvel=0;
                                if(skeleton.free)bloodvel+=DoRotation(skeleton.joints[skeleton.jointlabels[abdomen]].velocity,((float)(Random()%100))/4,rotation+((float)(Random()%100))/4,0)*scale;
                                if(!skeleton.free)bloodvel+=DoRotation(velocity,((float)(Random()%100))/4,((float)(Random()%100))/4,0)*scale;
-                               if(skeleton.free)sprites.MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
-                               if(!skeleton.free)sprites.MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
+                               if(skeleton.free)Sprite::MakeSprite(bloodsprite, skeleton.joints[skeleton.jointlabels[abdomen]].position*scale+coords,bloodvel, 1,1,1, .05, 1);
+                               if(!skeleton.free)Sprite::MakeSprite(bloodsprite, DoRotation((skeleton.joints[skeleton.jointlabels[abdomen]].position+skeleton.joints[skeleton.jointlabels[abdomen]].position)/2,0,rotation,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
                        }
                }
                /*if(id==0){
@@ -5381,7 +5377,7 @@ void      Person::DoStuff(){
                                if(!skeleton.free)footpoint=DoRotation((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2,0,rotation,0)*scale+coords;
                                if(skeleton.free)footpoint=((skeleton.joints[skeleton.jointlabels[head]].position+skeleton.joints[skeleton.jointlabels[neck]].position)/2)*scale+coords;
                                if(targetanimation==sleepanim)footvel=DoRotation(footvel,0,90,0);
-                               sprites.MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3);
+                               Sprite::MakeSprite(breathsprite, footpoint+footvel*.2,footvel*.4, 1,1,1, .4, .3);
                        }
                }
 
@@ -6133,8 +6129,8 @@ void      Person::DoStuff(){
                                                                                        pos.x+=float(abs(Random()%100)-50)/200;
                                                                                        pos.y+=float(abs(Random()%100)-50)/200;
                                                                                        pos.z+=float(abs(Random()%100)-50)/200;
-                                                                                       sprites.MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
-                                                                                       sprites.special[sprites.numsprites-1]=1;
+                                                                                       Sprite::MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
+                                                                                       Sprite::setLastSpriteSpecial(1);
                                                                                }
                                                                                howmany=findLength(&velocity)*4;
                                                                                if(detail==2)
@@ -6148,8 +6144,8 @@ void      Person::DoStuff(){
                                                                                                        pos.x+=float(abs(Random()%100)-50)/200;
                                                                                                        pos.y+=float(abs(Random()%100)-50)/200;
                                                                                                        pos.z+=float(abs(Random()%100)-50)/200;
-                                                                                                       sprites.MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
-                                                                                                       sprites.special[sprites.numsprites-1]=2;
+                                                                                                       Sprite::MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
+                                                                                                       Sprite::setLastSpriteSpecial(2);
                                                                                                }
                                                        }
                                                        objects.rotx[i]+=velocity.x*multiplier*6;
@@ -6205,8 +6201,8 @@ void      Person::DoStuff(){
                                                                                                pos.x+=float(abs(Random()%100)-50)/150;
                                                                                                pos.y+=float(abs(Random()%100)-50)/150;
                                                                                                pos.z+=float(abs(Random()%100)-50)/150;
-                                                                                               sprites.MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
-                                                                                               sprites.special[sprites.numsprites-1]=1;
+                                                                                               Sprite::MakeSprite(splintersprite, pos,tempvel*.5+velocity*float(abs(Random()%100))/100, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
+                                                                                               Sprite::setLastSpriteSpecial(1);
                                                                                        }
                                                                                        howmany=findLength(&velocity)*4;
                                                                                        if(detail==2)
@@ -6221,8 +6217,8 @@ void      Person::DoStuff(){
                                                                                                                pos.x+=float(abs(Random()%100)-50)/150;
                                                                                                                pos.y+=float(abs(Random()%100)-50)/150;
                                                                                                                pos.z+=float(abs(Random()%100)-50)/150;
-                                                                                                               sprites.MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
-                                                                                                               sprites.special[sprites.numsprites-1]=2;
+                                                                                                               Sprite::MakeSprite(splintersprite, pos,tempvel*.3+velocity*float(abs(Random()%100))/100/2, 1,1,1, .1, 1);
+                                                                                                               Sprite::setLastSpriteSpecial(2);
                                                                                                        }
                                                                }
                                                                objects.messedwith[i]=.5;
@@ -7299,12 +7295,12 @@ int Person::DrawSkeleton(){
                        }
                        if(playerdetail){
                                if(!showpoints){
-                                       if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(sprites.cloudimpacttexture);
+                                       if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture);
                                        else skeleton.drawmodel.draw();
                                }
                        }
                        if(!playerdetail){
-                               if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(sprites.cloudimpacttexture);
+                               if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture);
                                else skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr);
                        }
 
@@ -7328,12 +7324,12 @@ int Person::DrawSkeleton(){
                                                glTranslatef(smoketex*.6,0,0);
                                                if(playerdetail){
                                                        if(!showpoints){
-                                                               if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(sprites.cloudimpacttexture);
+                                                               if((tutoriallevel&&id!=0))skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture);
                                                                else skeleton.drawmodel.draw();
                                                        }
                                                }
                                                if(!playerdetail){
-                                                       if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(sprites.cloudimpacttexture);
+                                                       if((tutoriallevel&&id!=0))skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture);
                                                        else skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr);
                                                }
                                }
index cde2f8f7a93b2b16d6e76b346f1296fbb844b597..517ca0d5057a544358f8ac9b69ad70cd50b1d8f4 100644 (file)
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Models.h"
 #include "Constants.h"
 #include "Terrain.h"
-#include "Sprites.h"
+#include "Sprite.h"
 #include <cmath>
 #include "Weapons.h"
 
index 9bdd4cea0dcf6ac3bbbb0643395c0d4a272d83a1..878bcbe13511cc6ec54d317c146abe447246c94a 100644 (file)
@@ -31,7 +31,6 @@ extern Terrain terrain;
 extern OPENAL_SAMPLE   *samp[100];
 extern int channels[100];
 extern Objects objects;
-extern Sprites sprites;
 extern int environment;
 extern float terraindetail;
 extern float camerashake;
@@ -329,7 +328,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
                        }
                        if(findLengthfast(&bounceness)>4000&&breaking){
                        objects.model[k].MakeDecal(breakdecal,DoRotation(temp-objects.position[k],0,-objects.rotation[k],0),.4,.5,Random()%360);
-                       sprites.MakeSprite(cloudsprite, headpos*(*scale)+*coords,joints[jointlabels[head]].velocity*.06, 1,1,1, 4, .2);
+                       Sprite::MakeSprite(cloudsprite, headpos*(*scale)+*coords,joints[jointlabels[head]].velocity*.06, 1,1,1, 4, .2);
                        breaking=0;
                        camerashake+=.6;
 
@@ -375,7 +374,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
                        joints[jointlabels[head]].locked=1;
                        //joints[jointlabels[head]].velocity*=3;
                        }
-                       if(findLengthfast(&bounceness)>500)sprites.MakeSprite(cloudsprite, headpos*(*scale)+*coords,joints[jointlabels[head]].velocity*.06, 1,1,1, .5, .2);
+                       if(findLengthfast(&bounceness)>500)Sprite::MakeSprite(cloudsprite, headpos*(*scale)+*coords,joints[jointlabels[head]].velocity*.06, 1,1,1, .5, .2);
                        joints[jointlabels[head]].position=(temp-*coords)/(*scale)+(startheadpos-headpos)+terrainnormal*.005;
                        if(longdead>100)broken=1;
                        }
@@ -466,8 +465,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
                                                if(tutoriallevel!=1||id==0)
                                                        if(findLengthfast(&bounceness)>8000&&breaking){
                                                                objects.model[k].MakeDecal(breakdecal,DoRotation(temp-objects.position[k],0,-objects.rotation[k],0),.4,.5,Random()%360);
-                                                               sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, 4, .2);
-                                                               //sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, 1, .2);
+                                                               Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, 4, .2);
+                                                               //Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, 1, .2);
                                                                breaking=0;
                                                                camerashake+=.6;
 
@@ -508,19 +507,19 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
 
                                                        if(environment==snowyenvironment&&findLengthfast(&bounceness)>500&&terrain.getOpacity(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z)<.2){
                                                                terrainlight=terrain.getLighting(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z);
-                                                               sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
+                                                               Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
                                                                if(detail==2)terrain.MakeDecal(bodyprintdecal, joints[i].position*(*scale)+*coords,.4,.4,0);
                                                        }
                                                        else if(environment==desertenvironment&&findLengthfast(&bounceness)>500&&terrain.getOpacity(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z)<.2){
                                                                terrainlight=terrain.getLighting(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z);
-                                                               sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
+                                                               Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
                                                        }
 
                                                        else if(environment==grassyenvironment&&findLengthfast(&bounceness)>500&&terrain.getOpacity(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z)<.2){
                                                                terrainlight=terrain.getLighting(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z);
-                                                               sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
+                                                               Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
                                                        }
-                                                       else if(findLengthfast(&bounceness)>500)sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x,terrainlight.y,terrainlight.z, .5, .2);
+                                                       else if(findLengthfast(&bounceness)>500)Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, terrainlight.x,terrainlight.y,terrainlight.z, .5, .2);
 
 
                                                        joints[i].position.y=(terrain.getHeight(joints[i].position.x*(*scale)+coords->x,joints[i].position.z*(*scale)+coords->z)+groundlevel-coords->y)/(*scale);
@@ -585,7 +584,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
                                                                                if(tutoriallevel!=1||id==0)
                                                                                        if(findLengthfast(&bounceness)>4000&&breaking){
                                                                                                objects.model[k].MakeDecal(breakdecal,DoRotation(temp-objects.position[k],0,-objects.rotation[k],0),.4,.5,Random()%360);
-                                                                                               sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, 4, .2);
+                                                                                               Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, 4, .2);
                                                                                                breaking=0;
                                                                                                camerashake+=.6;
 
@@ -624,8 +623,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
                                                                                                pos.x+=float(abs(Random()%100)-50)/100*objects.scale[k]*5;
                                                                                                pos.y+=float(abs(Random()%100)-50)/100*objects.scale[k]*15;
                                                                                                pos.z+=float(abs(Random()%100)-50)/100*objects.scale[k]*5;
-                                                                                               sprites.MakeSprite(splintersprite, pos,tempvel*.5, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
-                                                                                               sprites.special[sprites.numsprites-1]=1;
+                                                                                               Sprite::MakeSprite(splintersprite, pos,tempvel*.5, 165/255+float(abs(Random()%100)-50)/400,0,0, .2+float(abs(Random()%100)-50)/1300, 1);
+                                                                                               Sprite::special[Sprite::numsprites-1]=1;
                                                                                                }*/
                                                                                                objects.rotx[k]+=joints[i].velocity.x*multiplier*.4;
                                                                                                objects.roty[k]+=joints[i].velocity.z*multiplier*.4;
@@ -650,7 +649,7 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
                                                                                                        joints[i].locked=1;
                                                                                                        //joints[i].velocity*=3;
                                                                                                }
-                                                                                               if(findLengthfast(&bounceness)>500)sprites.MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, .5, .2);
+                                                                                               if(findLengthfast(&bounceness)>500)Sprite::MakeSprite(cloudsprite, joints[i].position*(*scale)+*coords,joints[i].velocity*.06, 1,1,1, .5, .2);
                                                                                                joints[i].position=(temp-*coords)/(*scale)+terrainnormal*.005;
                                                                                                if(longdead>100)broken=1;
                                                                        }
index 2e5085e6905a0d7c4d11775f8ebf9780d738f6fd..48592a8bceac141684a2e51571b4d5a740215ccb 100644 (file)
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "gamegl.h"
 #include "Quaternions.h"
 #include "Objects.h"
-#include "Sprites.h"
+#include "Sprite.h"
 #include "binio.h"
 
 #define neutral 0
index 89d28be7c7d4d1fd0d194bb6c8288dd30885844e..e09b68038c3e3dec951cd92aafe99274870c0036 100644 (file)
@@ -35,7 +35,7 @@ extern bool LoadImage(const char * fname, TGAImageRec & tex);
 /********************> LoadTGA() <*****/
 bool upload_image(const unsigned char* filePath, bool hasalpha)
 {
-       if(visibleloading){
+       if(visibleloading) {
                loadscreencolor=1;
                pgame->LoadingScreen();
        }
index 496e0fee431acf410cf0770bfc8e4d10386cd1b7..6d6d2649e537ce2ecca1163e0009d40afdaf7263 100644 (file)
@@ -30,7 +30,6 @@ extern int channels[100];
 extern Terrain terrain;
 extern float gravity;
 extern int environment;
-extern Sprites sprites;
 extern int detail;
 extern FRUSTUM frustum;
 extern XYZ viewer;
@@ -111,7 +110,7 @@ void        Weapons::DoStuff(){
                                tempvel.y=float(abs(Random()%100)-50)/20;
                                tempvel.z=float(abs(Random()%100)-50)/20;
                                tempvel+=speed;
-                               sprites.MakeSprite(splintersprite, position[i]+(tippoint[i]-position[i])*((float)j-8)/32,tempvel*.5, 115/255,73/255,12/255, .1, 1);
+                               Sprite::MakeSprite(splintersprite, position[i]+(tippoint[i]-position[i])*((float)j-8)/32,tempvel*.5, 115/255,73/255,12/255, .1, 1);
                        }
                        int tempowner;
                        tempowner=owner[i];
@@ -189,7 +188,7 @@ void        Weapons::DoStuff(){
 
                                                                bloody[i]=0;
 
-                                                               sprites.MakeSprite(cloudimpactsprite, position[i],velocity[i], 1,1,1, .8, .3);
+                                                               Sprite::MakeSprite(cloudimpactsprite, position[i],velocity[i], 1,1,1, .8, .3);
                                                        }
                                                        else {
                                                                physics[i]=1;
@@ -250,11 +249,11 @@ void      Weapons::DoStuff(){
                                                                        player[j].skeleton.joints[player[j].skeleton.jointlabels[rightshoulder]].velocity+=velocity[i]*2;
                                                                        player[j].skeleton.joints[player[j].skeleton.jointlabels[leftshoulder]].velocity+=velocity[i]*2;
                                                                        //player[j].Puff(abdomen);
-                                                                       if(bloodtoggle&&tutoriallevel!=1)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
-                                                                       if(tutoriallevel==1)sprites.MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .8, .3);
+                                                                       if(bloodtoggle&&tutoriallevel!=1)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,0,0, .8, .3);
+                                                                       if(tutoriallevel==1)Sprite::MakeSprite(cloudimpactsprite, footpoint,footvel, 1,1,1, .8, .3);
                                                                        footvel=tippoint[i]-position[i];
                                                                        Normalise(&footvel);
-                                                                       if(bloodtoggle&&tutoriallevel!=1)sprites.MakeSprite(bloodflamesprite, footpoint,footvel*-1, 1,0,0, .6, 1);
+                                                                       if(bloodtoggle&&tutoriallevel!=1)Sprite::MakeSprite(bloodflamesprite, footpoint,footvel*-1, 1,0,0, .6, 1);
 
                                                                        if(tutoriallevel!=1){
                                                                                if(player[j].weaponstuckwhere==0)player[j].DoBloodBig(2,205);
@@ -352,13 +351,13 @@ void      Weapons::DoStuff(){
                                                        XYZ terrainlight;
                                                        terrainlight=terrain.getLighting(position[i].x,position[i].z);
                                                        if(environment==snowyenvironment){
-                                                               if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
+                                                               if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
                                                        }
                                                        else if(environment==grassyenvironment){
-                                                               if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
+                                                               if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
                                                        }
                                                        else if(environment==desertenvironment){
-                                                               if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
+                                                               if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
                                                        }
 
                                                        bloody[i]=0;
@@ -711,13 +710,13 @@ void      Weapons::DoStuff(){
                                                                XYZ terrainlight;
                                                                terrainlight=terrain.getLighting(position[i].x,position[i].z);
                                                                if(environment==snowyenvironment){
-                                                                       if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
+                                                                       if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
                                                                }
                                                                else if(environment==grassyenvironment){
-                                                                       if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
+                                                                       if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
                                                                }
                                                                else if(environment==desertenvironment){
-                                                                       if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
+                                                                       if(findDistancefast(&position[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, position[i],velocity[i], terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
                                                                }
                                                        }
                                                }
@@ -765,13 +764,13 @@ void      Weapons::DoStuff(){
                                                                XYZ terrainlight;
                                                                terrainlight=terrain.getLighting(tippoint[i].x,tippoint[i].z);
                                                                if(environment==snowyenvironment){
-                                                                       if(findDistancefast(&tippoint[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, tippoint[i],tipvelocity[i], terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
+                                                                       if(findDistancefast(&tippoint[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, tippoint[i],tipvelocity[i], terrainlight.x,terrainlight.y,terrainlight.z, .5, .7);
                                                                }
                                                                else if(environment==grassyenvironment){
-                                                                       if(findDistancefast(&tippoint[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, tippoint[i],tipvelocity[i], terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
+                                                                       if(findDistancefast(&tippoint[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, tippoint[i],tipvelocity[i], terrainlight.x*90/255,terrainlight.y*70/255,terrainlight.z*8/255, .5, .5);
                                                                }
                                                                else if(environment==desertenvironment){
-                                                                       if(findDistancefast(&tippoint[i],&viewer)<viewdistance*viewdistance/4)sprites.MakeSprite(cloudsprite, tippoint[i],tipvelocity[i], terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
+                                                                       if(findDistancefast(&tippoint[i],&viewer)<viewdistance*viewdistance/4)Sprite::MakeSprite(cloudsprite, tippoint[i],tipvelocity[i], terrainlight.x*190/255,terrainlight.y*170/255,terrainlight.z*108/255, .5, .7);
                                                                }
                                                        }
                                                }
@@ -1076,7 +1075,7 @@ void      Weapons::DoStuff(){
                                bloodloc.y-=.05;
                                if(bloodtoggle){
                                        bloodvel=0;
-                                       sprites.MakeSprite(bloodsprite, bloodloc,bloodvel, 1,1,1, .03, 1);
+                                       Sprite::MakeSprite(bloodsprite, bloodloc,bloodvel, 1,1,1, .03, 1);
                                }
                        }
                }
@@ -1095,9 +1094,9 @@ void      Weapons::DoStuff(){
                                                normalrot.y=1;
                                        }
                                }
-                               sprites.MakeSprite(weaponflamesprite, position[i]+tippoint[i]*(((float)abs(Random()%100))/600+.05),normalrot, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*1/3, 1);
-                               sprites.speed[sprites.numsprites-1]=4;
-                               sprites.alivetime[sprites.numsprites-1]=.3;
+                               Sprite::MakeSprite(weaponflamesprite, position[i]+tippoint[i]*(((float)abs(Random()%100))/600+.05),normalrot, 1,1,1, (.6+(float)abs(Random()%100)/200-.25)*1/3, 1);
+                               Sprite::setLastSpriteSpeed(4);
+                               Sprite::setLastSpriteAlivetime(.3);
                        }
                }
 
@@ -1110,9 +1109,9 @@ void      Weapons::DoStuff(){
                                if(Random()%50==0&&findDistancefast(&position[i],&viewer)>80){
                                        XYZ shinepoint;
                                        shinepoint=position[i]+(tippoint[i]-position[i])*(((float)abs(Random()%100))/100);
-                                       sprites.MakeSprite(weaponshinesprite, shinepoint,normalrot, 1,1,1, (.1+(float)abs(Random()%100)/200-.25)*1/3*fast_sqrt(findDistance(&shinepoint,&viewer)), 1);
-                                       sprites.speed[sprites.numsprites-1]=4;
-                                       sprites.alivetime[sprites.numsprites-1]=.3;
+                                       Sprite::MakeSprite(weaponshinesprite, shinepoint,normalrot, 1,1,1, (.1+(float)abs(Random()%100)/200-.25)*1/3*fast_sqrt(findDistance(&shinepoint,&viewer)), 1);
+                                       Sprite::setLastSpriteSpeed(4);
+                                       Sprite::setLastSpriteAlivetime(.3);
                                }
                        }
                }
@@ -1271,13 +1270,13 @@ int Weapons::Draw()
                        XYZ nothingpoint;
                        nothingpoint=0;
                        shinepoint=position[i];
-                       sprites.MakeSprite(weaponshinesprite, shinepoint,nothingpoint, 1,1,1,multiplier*2, 1);
-                       sprites.speed[sprites.numsprites-1]=4;
-                       sprites.alivetime[sprites.numsprites-1]=.3;
+                       Sprite::MakeSprite(weaponshinesprite, shinepoint,nothingpoint, 1,1,1,multiplier*2, 1);
+                       Sprite::speed[Sprite::numsprites-1]=4;
+                       Sprite::alivetime[Sprite::numsprites-1]=.3;
                        shinepoint=tippoint[i];
-                       sprites.MakeSprite(weaponshinesprite, shinepoint,nothingpoint, 1,1,1,multiplier*2, 1);
-                       sprites.speed[sprites.numsprites-1]=4;
-                       sprites.alivetime[sprites.numsprites-1]=.3;*/
+                       Sprite::MakeSprite(weaponshinesprite, shinepoint,nothingpoint, 1,1,1,multiplier*2, 1);
+                       Sprite::speed[Sprite::numsprites-1]=4;
+                       Sprite::alivetime[Sprite::numsprites-1]=.3;*/
                }
        }
        return 0;
index e11a424c7649e319c5cf87200afc0e0cc4598473..d9fa2f67208bc2f4bd2496f4b50b985d50282f39 100644 (file)
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Models.h"
 #include "Constants.h"
 #include "Terrain.h"
-#include "Sprites.h"
+#include "Sprite.h"
 #include "Person.h"
 #include <cmath>
 
index 55a71900291a25e023f2347b47f5771d06ee88ce..36bdf4a0c0cee6d840986a0db8c31a10a7b7686b 100644 (file)
@@ -47,16 +47,16 @@ static AppTime g_appTime;
 void CopyCStringToPascal( const char* src, unsigned char dst[256])
 {
        int len = strlen( src);
-       dst[ 0] = len;
+       dst[0] = len;
        memcpy( dst + 1, src, len);
 }
 
 
 void CopyPascalStringToC( const unsigned char* src, char* dst)
 {
-       int len = src[ 0];
+       int len = src[0];
        memcpy( dst, src + 1, len);
-       dst[ len] = 0;
+       dst[len] = 0;
 }
 
 
index e598863b4151e066ab4b8fd9753b339e27fd05e4..4cf515e6270abca56c6fe9eb871c083022bc6096 100644 (file)
@@ -42,7 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 typedef bool Boolean;
 
-
 struct Point
 {
        short v;
@@ -99,16 +98,16 @@ char* ConvertFileName( const char* orgfilename);
 char* ConvertFileName( const char* orgfilename, const char* junk);
 
 
-#define fopen( a, b) fopen( ConvertFileName( a), b);
+#define fopen(a, b) fopen(ConvertFileName(a), b);
 
-inline float abs( float f)
+inline float abs(float f)
 {
        if (f < 0)
                return -f;
        return f;
 }
 
-inline double abs( double f)
+inline double abs(double f)
 {
        if (f < 0)
                return -f;
index 1e31312af8f87ebabfa45e2ad8ae2fb077f76108..1c3f2acd4d39351a57d63a000b9c1c88908a9cc1 100644 (file)
@@ -374,7 +374,7 @@ static void *decode_to_pcm(const char *_fname, ALenum &format, ALsizei &size, AL
     char *fname = (char *) alloca(strlen(_fname) + 16);
     strcpy(fname, _fname);
     char *ptr = strchr(fname, '.');
-    if (ptr) *ptr = NULL;
+    if (ptr) *ptr = '\0';
     strcat(fname, ".ogg");
 
     // just in case...