]> git.jsancho.org Git - lugaru.git/commitdiff
Removed most of the commented out code
authorCôme Chilliet <come@chilliet.eu>
Wed, 23 Nov 2016 17:12:27 +0000 (01:12 +0800)
committerCôme Chilliet <come@chilliet.eu>
Wed, 23 Nov 2016 17:12:27 +0000 (01:12 +0800)
13 files changed:
Source/GameDraw.cpp
Source/GameInitDispose.cpp
Source/GameTick.cpp
Source/Lights.cpp
Source/Models.cpp
Source/Objects.cpp
Source/OpenGL_Windows.cpp
Source/Person.cpp
Source/Skeleton.cpp
Source/Sprite.cpp
Source/TGALoader.cpp
Source/Terrain.cpp
Source/Text.cpp

index af0eb18561371085d221b4b53572ad92529dfe73..213d894243d88d8d036a758fe1382a938ee87a3f 100644 (file)
@@ -262,7 +262,6 @@ int Game::DrawGLScene(StereoSide side)
         glDrawBuffer(GL_BACK);
         glReadBuffer(GL_BACK);
 
-        //glFinish();
         static XYZ terrainlight;
         static float distance;
         if (drawmode == normalmode)
@@ -416,9 +415,6 @@ int Game::DrawGLScene(StereoSide side)
         terrain.draw(0);
         terraintexture2.bind();
         terrain.draw(1);
-        //glBindTexture( GL_TEXTURE_2D, terraintexture3);
-        //glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-        //terrain.draw(2);
 
         terrain.drawdecals();
 
@@ -1680,7 +1676,6 @@ int Game::DrawGLScene(StereoSide side)
                 text->glPrint(1024 / 2 - 90, 768 / 2, string, 1, 2, 1024, 768);
             }
             loading = 2;
-            //if(ismotionblur)drawmode=motionblurmode;
             drawmode = normalmode;
         }
 
@@ -1767,7 +1762,6 @@ int Game::DrawGLScene(StereoSide side)
                     glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
                     GLfloat subtractColor[4] = { 0.5, 0.5, 0.5, 0.0 };
                     glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, subtractColor);
-                    //glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_SUBTRACT);
                     glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE);
                     glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT);
                     glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2.0f);
@@ -1795,7 +1789,6 @@ int Game::DrawGLScene(StereoSide side)
                     glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, kTextureSize, kTextureSize, 0);
                 }
             }
-            //glFlush();
         }
 
         glClear(GL_DEPTH_BUFFER_BIT);
@@ -1832,7 +1825,6 @@ int Game::DrawGLScene(StereoSide side)
             if (drawmode == motionblurmode) {
                 if (motionbluramount < .2)
                     motionbluramount = .2;
-                //glColor4f(1,1,1,fast_sqrt(multiplier)*2.9*motionbluramount);
                 glColor4f(1, 1, 1, motionbluramount);
                 glPushMatrix();
                 glBegin(GL_QUADS);
@@ -1981,7 +1973,6 @@ int Game::DrawGLScene(StereoSide side)
             }
             if (drawmode == radialzoommode) {
                 for (int i = 0; i < 3; i++) {
-                    //glRotatef((float)i*.1,0,0,1);
                     glColor4f(1, 1, 1, 1 / ((float)i + 1));
                     glPushMatrix();
                     glScalef(1 + (float)i * .01, 1 + (float)i * .01, 1);
@@ -2043,17 +2034,14 @@ int Game::DrawGLScene(StereoSide side)
         multiplier = 0;
     }
 
-    //glFlush();
     if ( side == stereoRight || side == stereoCenter ) {
         if (drawmode != motionblurmode || mainmenu) {
             swap_gl_buffers();
         }
     }
 
-    //myassert(glGetError() == GL_NO_ERROR);
     glDrawBuffer(GL_BACK);
     glReadBuffer(GL_BACK);
-    //glFlush();
 
     weapons.DoStuff();
 
@@ -2175,7 +2163,6 @@ void DrawMenu()
         glColor4f(1, 1, 1, 1);
         Game::cursortexture.bind();
         glPushMatrix();
-        //glScalef(.25,.25,.25);
         glBegin(GL_QUADS);
         glTexCoord2f(0, 0);
         glVertex3f(-1, -1, 0.0f);
index c19db0293240a3ce7532126b02b6b4d51848bdac..b60f34da8fdf9dd301767e5301e0023df893bb2a 100644 (file)
@@ -214,7 +214,6 @@ GLvoid Game::ReSizeGLScene(float fov, float pnear)
 void Game::LoadingScreen()
 {
     static float loadprogress;
-    //~ static AbsoluteTime time = {0, 0};
     static AbsoluteTime frametime = {0, 0};
     AbsoluteTime currTime = UpTime ();
     double deltaTime = (float) AbsoluteDeltaToDuration (currTime, frametime);
@@ -244,8 +243,6 @@ void Game::LoadingScreen()
         if (loadprogress > 100)
             loadprogress = 100;
 
-        //loadprogress=abs(Random()%100);
-
         //Background
 
         glEnable(GL_TEXTURE_2D);
@@ -269,7 +266,6 @@ void Game::LoadingScreen()
         glDisable(GL_BLEND);
         glColor4f(loadprogress / 100, loadprogress / 100, loadprogress / 100, 1);
         glPushMatrix();
-        //glScalef(.25,.25,.25);
         glBegin(GL_QUADS);
         glTexCoord2f(.1 - loadprogress / 100, 0 + loadprogress / 100 + .3);
         glVertex3f(-1, -1, 0.0f);
@@ -283,7 +279,6 @@ void Game::LoadingScreen()
         glPopMatrix();
         glEnable(GL_BLEND);
         glPushMatrix();
-        //glScalef(.25,.25,.25);
         glBegin(GL_QUADS);
         glTexCoord2f(.4 + loadprogress / 100, 0 + loadprogress / 100);
         glVertex3f(-1, -1, 0.0f);
@@ -322,10 +317,8 @@ void Game::LoadingScreen()
         glScalef((float)screenwidth / 2 * (1.5 - (loadprogress) / 200), (float)screenheight / 2 * (1.5 - (loadprogress) / 200), 1);
         glBlendFunc(GL_SRC_ALPHA, GL_ONE);
         glEnable(GL_BLEND);
-        //glColor4f(loadprogress/100,loadprogress/100,loadprogress/100,1);
         glColor4f(loadprogress / 100, loadprogress / 100, loadprogress / 100, 1);
         glPushMatrix();
-        //glScalef(.25,.25,.25);
         glBegin(GL_QUADS);
         glTexCoord2f(0 + .5, 0 + .5);
         glVertex3f(-1, -1, 0.0f);
@@ -366,7 +359,6 @@ void Game::LoadingScreen()
         glEnable(GL_BLEND);
         glColor4f(loadprogress / 100, loadprogress / 100, loadprogress / 100, .4);
         glPushMatrix();
-        //glScalef(.25,.25,.25);
         glBegin(GL_QUADS);
         glTexCoord2f(0 + .2, 0 + .8);
         glVertex3f(-1, -1, 0.0f);
@@ -443,13 +435,9 @@ void FadeLoadingScreen(float howmuch)
 
     loadprogress = howmuch;
 
-    //loadprogress=abs(Random()%100);
-
     //Background
 
-    //glEnable(GL_TEXTURE_2D);
     glDisable(GL_TEXTURE_2D);
-    //glBindTexture( GL_TEXTURE_2D, loadscreentexture);
     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);
@@ -469,7 +457,6 @@ void FadeLoadingScreen(float howmuch)
     glDisable(GL_BLEND);
     glColor4f(loadprogress / 100, 0, 0, 1);
     glPushMatrix();
-    //glScalef(.25,.25,.25);
     glBegin(GL_QUADS);
     glTexCoord2f(0, 0);
     glVertex3f(-1, -1, 0.0f);
index 8a7a54eae021af5b1f6d4a7191fe6fa6bc9f0c30..beb1733dac1cf4320a4721f0d2544be1abf21af6 100644 (file)
@@ -1428,8 +1428,6 @@ int Game::checkcollide(XYZ startpoint, XYZ endpoint)
         }
     }
 
-    //if(terrain.lineTerrain(startpoint,endpoint,&colpoint)!=-1)return 1000;
-
     return -1;
 }
 
@@ -1729,9 +1727,6 @@ void Loadlevel(const char *name)
 
     int mapvers;
     FILE *tfile;
-    //~ char* buff=getcwd(NULL,0);
-    //~ cout << buff << " " << FixedFN << endl;
-    //~ free(buff);
     tfile = fopen( FixedFN, "rb" );
     if (tfile) {
         pause_sound(stream_firesound);
@@ -3222,10 +3217,7 @@ void doDebugKeys()
         }
 
         if (Input::isKeyPressed(SDL_SCANCODE_N) && !Input::isKeyDown(SDL_SCANCODE_LCTRL)) {
-            //if(!Person::players[0]->skeleton.free)Person::players[0]->damage+=500;
             Person::players[0]->RagDoll(0);
-            //Person::players[0]->spurt=1;
-            //Person::players[0]->DoDamage(1000);
 
             emit_sound_at(whooshsound, Person::players[0]->coords, 128.);
         }
@@ -3276,8 +3268,6 @@ void doDebugKeys()
             }
 
             if (Input::isKeyPressed(SDL_SCANCODE_M) && Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
-                //drawmode++;
-                //if(drawmode>2)drawmode=0;
                 if (objects.numobjects < max_objects - 1) {
                     XYZ boxcoords;
                     boxcoords.x = Person::players[0]->coords.x;
@@ -3712,7 +3702,6 @@ void doAerialAcrobatics()
             Person::players[k]->yaw = stepTowardf(Person::players[k]->yaw, Person::players[k]->targetyaw, multiplier * Person::players[k]->turnspeed * 4);
         }
 
-        /*if(Person::players[k]->aitype!=passivetype||(distsq(&Person::players[k]->coords,&viewer)<viewdistance*viewdistance))*/
         Person::players[k]->DoStuff();
         if (Person::players[k]->immobile && k != 0)
             Person::players[k]->coords = Person::players[k]->realoldcoords;
@@ -6686,7 +6675,6 @@ void Game::Tick()
                         hotspotvisual[i] -= multiplier / 320;
 
                 for (int i = 0; i < numhotspots; i++) {
-                    //if(hotspottype[i]<=10)
                     while (hotspotvisual[i] < 0) {
                         hotspotsprite = 0;
                         hotspotsprite.x = float(abs(Random() % 100000)) / 100000 * hotspotsize[i];
@@ -8398,7 +8386,7 @@ void Game::TickOnceAfter()
             }
             target.y += .1;
         }
-        if (Person::players[0]->skeleton.free != 2/*&&!autocam*/) {
+        if (Person::players[0]->skeleton.free != 2) {
             cameraspeed = 20;
             if (findLengthfast(&Person::players[0]->velocity) > 400) {
                 cameraspeed = 20 + (findLength(&Person::players[0]->velocity) - 20) * .96;
@@ -8446,55 +8434,8 @@ void Game::TickOnceAfter()
                 cameraloc.y = terrain.getHeight(cameraloc.x, cameraloc.z);
             }
         }
-        /*
-        //what did autocam do?
-        if(Person::players[0]->skeleton.free!=2&&autocam){
-            cameraspeed=20;
-            if(findLengthfast(&Person::players[0]->velocity)>400){
-                cameraspeed=20+(findLength(&Person::players[0]->velocity)-20)*.96;
-            }
-            if(Person::players[0]->skeleton.free==0&&Person::players[0]->animTarget!=hanganim&&Person::players[0]->animTarget!=climbanim)target.y+=1.4;
-            cameradist+=multiplier*5;
-            if(cameradist>3.3)cameradist=3.3;
-            coltarget=target-cameraloc;
-            if(findLengthfast(&coltarget)<multiplier*multiplier*400)cameraloc=target;
-            else if(findLengthfast(&coltarget)>1)
-            {
-                Normalise(&coltarget);
-                if(Person::players[0]->animTarget!=hanganim&&Person::players[0]->animTarget!=climbanim&&Person::players[0]->animCurrent!=climbanim&&Person::players[0]->currentoffset.x==0)cameraloc=cameraloc+coltarget*multiplier*cameraspeed;
-                else cameraloc=cameraloc+coltarget*multiplier*8;
-            }
-            if(editorenabled)cameraloc=target;
-            viewer=cameraloc;
-            colviewer=viewer;
-            coltarget=cameraloc;
-            objects.SphereCheckPossible(&colviewer, findDistance(&colviewer,&coltarget));
-            if(terrain.patchobjectnum[Person::players[0]->whichpatchx][Person::players[0]->whichpatchz])
-                for(int j=0;j<terrain.patchobjectnum[Person::players[0]->whichpatchx][Person::players[0]->whichpatchz];j++){
-                    int i=terrain.patchobjects[Person::players[0]->whichpatchx][Person::players[0]->whichpatchz][j];
-                    colviewer=viewer;
-                    coltarget=cameraloc;
-                    if(objects.model[i].LineCheckPossible(&colviewer,&coltarget,&col,&objects.position[i],&objects.yaw[i])!=-1)viewer=col;
-                }
-            if(terrain.patchobjectnum[Person::players[0]->whichpatchx][Person::players[0]->whichpatchz])
-                for(int j=0;j<terrain.patchobjectnum[Person::players[0]->whichpatchx][Person::players[0]->whichpatchz];j++){
-                    int i=terrain.patchobjects[Person::players[0]->whichpatchx][Person::players[0]->whichpatchz][j];
-                    colviewer=viewer;
-                    if(objects.model[i].SphereCheck(&colviewer,.15,&col,&objects.position[i],&objects.yaw[i])!=-1){
-                        viewer=colviewer;
-                    }
-                }
-            cameradist=findDistance(&viewer,&target);
-            viewer.y=max((double)viewer.y,terrain.getHeight(viewer.x,viewer.z)+.6);
-            if(cameraloc.y<terrain.getHeight(cameraloc.x,cameraloc.z)){
-                cameraloc.y=terrain.getHeight(cameraloc.x,cameraloc.z);
-            }
-        }
-        */
         if (camerashake > .8)
             camerashake = .8;
-        //if(woozy>10)woozy=10;
-        //woozy+=multiplier;
         woozy += multiplier;
         if (Person::players[0]->dead)
             camerashake = 0;
@@ -8502,12 +8443,10 @@ void Game::TickOnceAfter()
             woozy = 0;
         camerashake -= multiplier * 2;
         blackout -= multiplier * 2;
-        //if(Person::players[0]->isCrouch())woozy-=multiplier*8;
         if (camerashake < 0)
             camerashake = 0;
         if (blackout < 0)
             blackout = 0;
-        //if(woozy<0)woozy=0;
         if (camerashake) {
             viewer.x += (float)(Random() % 100) * .0005 * camerashake;
             viewer.y += (float)(Random() % 100) * .0005 * camerashake;
index f7e9d753858275a9f60e6310d37e5eb94d5852df..4ff34f2d3a0dceb4f02d8ae41c3c4f65ea952c1f 100644 (file)
@@ -30,7 +30,6 @@ void SetUpLight(Light* whichsource, int whichlight)
         GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f };
         GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 0.0f };
 
-        //glLightfv(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, qattenuation);
         glLightfv(GL_LIGHT0, GL_POSITION, LightPosition);
         glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);
         glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse);
index 0b8105396bd4f00204e73440c319a0783707d65f..0203689a260ffd5b51cbf0bbef51db5b26106cf3 100644 (file)
@@ -180,12 +180,6 @@ int Model::SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate)
                     intersecting = sphere_line_intersection(&vertex[Triangles[j].vertex[0]], &vertex[Triangles[j].vertex[2]], p1, &radius);
                 if (intersecting) {
                     *p1 += facenormals[j] * (distance - radius);
-                    /*start=*p1;
-                    end=*p1;
-                    end.y-=radius;
-                    if(LineFacetd(&start,&end,&vertex[Triangles[j].vertex[0]],&vertex[Triangles[j].vertex[1]],&vertex[Triangles[j].vertex[2]],&facenormals[j],&point)){
-                    p1->y=point.y+radius;
-                    }*/
                 }
             }
             if ((distance < olddistance || firstintersecting == -1) && intersecting) {
@@ -243,7 +237,6 @@ int Model::SphereCheckPossible(XYZ *p1, float radius, XYZ *move, float *rotate)
             if (!intersecting)
                 intersecting = sphere_line_intersection(&vertex[Triangles[j].vertex[0]], &vertex[Triangles[j].vertex[2]], p1, &radius);
             if (intersecting) {
-                //if(j>=0&&j<TriangleNum)
                 possible[numpossible] = j;
                 numpossible++;
             }
@@ -566,10 +559,6 @@ bool Model::loaddecal(const char *filename, bool texture )
 
     LOG(std::string("Loading decal...") + FixedFN);
 
-    //~ int oldvertexNum, oldTriangleNum;
-    //~ oldvertexNum = vertexNum;
-    //~ oldTriangleNum = TriangleNum;
-
     type = decalstype;
     numdecals = 0;
     color = 0;
@@ -642,7 +631,6 @@ bool Model::loaddecal(const char *filename, bool texture )
                 decaltexcoords[i][j] = (float*)malloc(sizeof(float) * 2);
             }
         }
-        //if(decalvertex)free(decalvertex);
         decalvertex = (XYZ**)malloc(sizeof(XYZ*)*max_model_decals);
         for (i = 0; i < max_model_decals; i++) {
             decalvertex[i] = (XYZ*)malloc(sizeof(XYZ) * 3);
@@ -889,11 +877,6 @@ void Model::drawimmediate()
     textureptr.bind();
     glBegin(GL_TRIANGLES);
     for (int i = 0; i < TriangleNum; i++) {
-        /*if(Triangles[i].vertex[0]<vertexNum&&Triangles[i].vertex[1]<vertexNum&&Triangles[i].vertex[2]<vertexNum&&Triangles[i].vertex[0]>=0&&Triangles[i].vertex[1]>=0&&Triangles[i].vertex[2]>=0){
-        if(isnormal(vertex[Triangles[i].vertex[0]].x)&&isnormal(vertex[Triangles[i].vertex[0]].y)&&isnormal(vertex[Triangles[i].vertex[0]].z)
-        &&isnormal(vertex[Triangles[i].vertex[1]].x)&&isnormal(vertex[Triangles[i].vertex[1]].y)&&isnormal(vertex[Triangles[i].vertex[1]].z)
-        &&isnormal(vertex[Triangles[i].vertex[2]].x)&&isnormal(vertex[Triangles[i].vertex[2]].y)&&isnormal(vertex[Triangles[i].vertex[2]].z)){
-        */
         glTexCoord2f(Triangles[i].gx[0], Triangles[i].gy[0]);
         if (color)
             glColor3f(normals[Triangles[i].vertex[0]].x, normals[Triangles[i].vertex[0]].y, normals[Triangles[i].vertex[0]].z);
@@ -920,8 +903,6 @@ void Model::drawimmediate()
         if (!color && flat)
             glNormal3f(facenormals[i].x, facenormals[i].y, facenormals[i].y);
         glVertex3f(vertex[Triangles[i].vertex[2]].x, vertex[Triangles[i].vertex[2]].y, vertex[Triangles[i].vertex[2]].z);
-        //}
-        //}
     }
     glEnd();
 }
@@ -1030,12 +1011,9 @@ void Model::drawdecals(Texture shadowtexture, Texture bloodtexture, Texture bloo
         if (type != decalstype)
             return;
         static int i;
-        //~ static float distancemult;
         static int lasttype;
-        //~ static float viewdistsquared;
         static bool blend;
 
-        //~ viewdistsquared = viewdistance * viewdistance;
         blend = 1;
 
         lasttype = -1;
@@ -1154,7 +1132,6 @@ void Model::MakeDecal(int atype, XYZ *where, float *size, float *opacity, float
 
         static float placex, placez;
         static XYZ rot;
-        //static XYZ point,point1,point2;
         static float distance;
         static int i, j;
 
@@ -1233,7 +1210,6 @@ void Model::MakeDecal(int atype, XYZ where, float size, float opacity, float rot
 
         static float placex, placez;
         static XYZ rot;
-        //static XYZ point,point1,point2;
         static float distance;
         static int i, j;
 
index 2a8474b238edd41fe7cb25e64ad6fca1a594861a..d7825697d28cfea805c8a0748e0660679448aac0 100644 (file)
@@ -104,10 +104,6 @@ void Objects::Draw()
                         distance = 1;
                     if (distance > 0) {
 
-                        /*if(checkcollide(viewer,DoRotation(model[i].vertex[model[i].vertexNum],0,yaw[i],0)*scale[i]+position[i],i)){
-                        occluded[i]+=1;
-                        }
-                        else occluded[i]=0;*/
                         if (occluded[i] < 6) {
                             glMatrixMode(GL_MODELVIEW);
                             glPushMatrix();
@@ -631,10 +627,6 @@ void Objects::MakeObject(int atype, XYZ where, float ayaw, float apitch, float a
         position[numobjects] = where;
         if (atype == bushtype)
             position[numobjects].y = terrain.getHeight(position[numobjects].x, position[numobjects].z) - .3;
-        /*if(atype==firetype){
-        if(position[numobjects].y<terrain.getHeight(position[numobjects].x,position[numobjects].z)-.3)
-        position[numobjects].y=terrain.getHeight(position[numobjects].x,position[numobjects].z)-.3;
-        }*/
         yaw[numobjects] = ayaw;
         pitch[numobjects] = apitch;
 
@@ -716,10 +708,6 @@ void Objects::DoStuff()
 {
     XYZ spawnpoint;
     for (int i = 0; i < numobjects; i++) {
-        /*if(type[i]==firetype){
-        Sprite::MakeSprite(weaponshinesprite, position[i],position[i]*0, 1,1,1, 5, 1);
-        }*/
-
         if (type[i] == firetype)
             onfire[i] = 1;
         if (onfire[i]) {
index 8af915cb5a23810f1fec342d6e4f0a93dab019ec..4f4abc603a4099d7be00d797c6574dae6357f6f9 100644 (file)
@@ -175,7 +175,6 @@ void initGL()
     glDisable( GL_ALPHA_TEST);
     glDisable( GL_BLEND);
     glDisable( GL_DEPTH_TEST);
-    //glDisable( GL_DITHER);
     glDisable( GL_FOG);
     glDisable( GL_LIGHTING);
     glDisable( GL_LOGIC_OP);
@@ -196,13 +195,11 @@ void initGL()
     glClearDepth( 1.0f);
     glDepthFunc( GL_LEQUAL);
     glDepthMask( GL_TRUE);
-    //glDepthRange( FRONT_CLIP, BACK_CLIP);
     glEnable( GL_DEPTH_TEST);
     glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
     glCullFace( GL_FRONT);
     glEnable( GL_CULL_FACE);
     glEnable( GL_LIGHTING);
-    //glEnable( GL_LIGHT_MODEL_AMBIENT);
     glEnable( GL_DITHER);
     glEnable( GL_COLOR_MATERIAL);
     glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
index 55b58c2a0b2d6288d80435cd18efad9de7d6ce8c..95e06b9b554d333a3562673063f8c752cc63ceb0 100644 (file)
@@ -310,7 +310,6 @@ void Person::DoBlood(float howmuch, int which)
     // FIXME: should abstract out inputs
     static int bleedxint, bleedyint;
     static XYZ bloodvel;
-    //if(howmuch&&id==0)blooddimamount=1;
     if (bloodtoggle && tutoriallevel != 1) {
         if (bleeding <= 0 && spurt) {
             spurt = 0;
@@ -425,7 +424,6 @@ void Person::DoBloodBig(float howmuch, int which)
                 envsoundvol[numenvsounds] = 16;
                 envsoundlife[numenvsounds] = .4;
                 numenvsounds++;
-                //if(i==2)whichsound=rabbitpain2sound;
             }
 
             if (whichsound != -1)
@@ -721,15 +719,6 @@ bool Person::DoBloodBigWhere(float howmuch, int which, XYZ where)
             // texture manipulation follows
 
             int offsetx = 0, offsety = 0;
-            /*if(which==225){
-            offsety=Random()%40;
-            offsetx=abs(Random()%120);
-            }
-            if(which==220||which==215){
-            offsety=Random()%20;
-            offsetx=abs(Random()%80);
-            }*/
-            //which=220;
             offsetx = (1 + coordsy) * 512 - 291;
             offsety = coordsx * 512 - 437;
 
@@ -1271,10 +1260,6 @@ void Person::DoDamage(float howmuch)
         skeleton.free = 2;
         DoDamage(10000);
         RagDoll(0);
-        /*if(autoslomo){
-        slomo=1;
-        slomodelay=.2;
-        }*/
         if (!dead && creature == wolftype) {
             award_bonus(0, Wolfbonus);
         }
@@ -1308,7 +1293,6 @@ void Person::DoDamage(float howmuch)
                 envsoundvol[numenvsounds] = 16;
                 envsoundlife[numenvsounds] = .4;
                 numenvsounds++;
-                //if(i==2)whichsound=rabbitpain2sound;
             }
 
             if (whichsound != -1) {
@@ -1316,9 +1300,6 @@ void Person::DoDamage(float howmuch)
             }
         }
     speechdelay = .3;
-
-    //if(permanentdamage>=damagetolerance&&howmuch<50)permanentdamage=damagetolerance-1;
-    //if(damage>=damagetolerance&&howmuch<30&&!dead)damage=damagetolerance-1;
 }
 
 /* EFFECT
@@ -1755,7 +1736,6 @@ void Person::DoAnimations()
             }
 
             if (animTarget == rabbittacklinganim && frameTarget == 1) {
-                //if(victim->aitype==attacktypecutoff&&Random()%2==0&&victim->stunned<=0&&animation[victim->animTarget].attack==neutral&&victim->id!=0)Reverse();
                 if (victim->aitype == attacktypecutoff && victim->stunned <= 0 && victim->surprised <= 0 && victim->id != 0)
                     Reverse();
                 if (animTarget == rabbittacklinganim && frameTarget == 1 && !victim->isCrouch() && victim->animTarget != backhandspringanim) {
@@ -1889,10 +1869,7 @@ void Person::DoAnimations()
                                     }
                                     speechdelay = .3;
                                 }
-                                //if(animation[animTarget].attack==neutral)whichsound=movewhooshsound;
                             }
-                            //else if(animation[animTarget].label[frameTarget]==4)whichsound=knifeswishsound;
-                            //if(animation[animTarget].label[frameTarget]==8)whichsound=landsound2;
 
                             if (whichsound != -1) {
                                 emit_sound_at(whichsound, coords);
@@ -2113,7 +2090,6 @@ void Person::DoAnimations()
             if (hasvictim) {
                 damagemult /= victim->damagetolerance / 200;
             }
-            //if(onfire)damagemult=3;
             if ((animation[animTarget].attack == normalattack || animTarget == walljumprightkickanim || animTarget == walljumpleftkickanim) && (!feint) && (victim->skeleton.free != 2 || animTarget == killanim || animTarget == dropkickanim || animTarget == crouchstabanim || animTarget == swordgroundstabanim || animTarget == staffgroundsmashanim)) {
                 if (animTarget == spinkickanim && animation[animTarget].label[frameCurrent] == 5) {
                     if (distsq(&coords, &victim->coords) < (scale * 5) * (scale * 5) * 3 && 3 && animation[victim->animTarget].height != lowheight) {
@@ -2384,7 +2360,6 @@ void Person::DoAnimations()
                 }
 
                 if ((animTarget == crouchstabanim || animTarget == swordgroundstabanim) && animation[animTarget].label[frameCurrent] == 5) {
-                    //if(id==0)camerashake+=.4;
 
                     if (hasvictim)
                         if (!victim->skeleton.free)
@@ -2694,9 +2669,6 @@ void Person::DoAnimations()
                         weapons[weaponids[0]].owner = -1;
                         aim = victim->coords + DoRotation(victim->jointPos(abdomen), 0, victim->yaw, 0) * victim->scale + victim->velocity * findDistance(&victim->coords, &coords) / 50 - (coords + DoRotation(jointPos(righthand), 0, yaw, 0) * scale);
                         Normalise(&aim);
-                        /*if(victim->animTarget==jumpupanim||victim->animTarget==jumpdownanim){
-                        aim=DoRotation(aim,(float)abs(Random()%15)-7,(float)abs(Random()%15)-7,0);
-                        }*/
                         weapons[weaponids[0]].velocity = aim * 50;
                         weapons[weaponids[0]].tipvelocity = aim * 50;
                         weapons[weaponids[0]].missed = 0;
@@ -3153,7 +3125,6 @@ void Person::DoAnimations()
                             victim->num_weapons--;
                             if (victim->num_weapons > 0) {
                                 victim->weaponids[victim->weaponactive] = victim->weaponids[victim->num_weapons];
-                                //if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0;
                             }
                             victim->weaponactive = -1;
                         }
@@ -3174,12 +3145,10 @@ void Person::DoAnimations()
                     relative = victim->coords - oldcoords;
                     relative.y = 0;
                     Normalise(&relative);
-                    //relative=DoRotation(relative,0,-90,0);
                     for (int i = 0; i < victim->skeleton.num_joints; i++) {
                         victim->skeleton.joints[i].velocity += relative * damagemult * 30;
                     }
                     victim->jointVel(abdomen) += relative * damagemult * 200;
-                    //FootLand(1,2);
                     victim->Puff(head);
                     victim->DoDamage(damagemult * 70 / victim->protectionhigh);
                 }
@@ -3205,12 +3174,10 @@ void Person::DoAnimations()
                     relative = victim->coords - oldcoords;
                     relative.y = 0;
                     Normalise(&relative);
-                    //relative=DoRotation(relative,0,-90,0);
                     for (int i = 0; i < victim->skeleton.num_joints; i++) {
                         victim->skeleton.joints[i].velocity += relative * damagemult * 30;
                     }
                     victim->jointVel(abdomen) += relative * damagemult * 200;
-                    //FootLand(1,2);
                     victim->Puff(head);
                     victim->DoDamage(damagemult * 70 / victim->protectionhigh);
                 }
@@ -3222,7 +3189,6 @@ void Person::DoAnimations()
                     relative = facing;
                     relative.y = 0;
                     Normalise(&relative);
-                    //relative*=-1;
                     relative.y -= .1;
                     for (int i = 0; i < victim->skeleton.num_joints; i++) {
                         victim->skeleton.joints[i].velocity += relative * damagemult * 70;
@@ -3274,7 +3240,6 @@ void Person::DoAnimations()
                     relative = facing;
                     relative.y = 0;
                     Normalise(&relative);
-                    //relative*=-1;
                     relative.y -= .1;
                     for (int i = 0; i < victim->skeleton.num_joints; i++) {
                         victim->skeleton.joints[i].velocity += relative * damagemult * 70;
@@ -3312,7 +3277,6 @@ void Person::DoAnimations()
                         victim->skeleton.joints[i].velocity += relative * damagemult * 40;
                     }
                     victim->jointVel(abdomen) += relative * damagemult * 200;
-                    //FootLand(1,2);
                     victim->Puff(abdomen);
                     victim->DoDamage(damagemult * 30 / victim->protectionhigh);
 
@@ -3332,7 +3296,6 @@ void Person::DoAnimations()
                     for (int i = 0; i < victim->skeleton.num_joints; i++) {
                         victim->skeleton.joints[i].velocity += relative * damagemult * 40;
                     }
-                    //victim->DoDamage(1000);
                     victim->damage = victim->damagetolerance;
                     victim->permanentdamage = victim->damagetolerance - 1;
                     bool doslice;
@@ -3366,14 +3329,6 @@ void Person::DoAnimations()
                         if (animTarget == knifefollowanim)
                             victim->DoBloodBig(200, 210);
                         if (animTarget == knifesneakattackanim) {
-                            /*victim->DoBloodBig(200,195);
-                            XYZ bloodvel;
-                            bloodvel=0;
-                            bloodvel.z=20;
-                            bloodvel.y=5;
-                            bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,yaw+((float)(Random()%100))/4,0)*scale;
-                            Sprite::MakeSprite(bloodsprite, DoRotation(jointPos(neck),0,yaw,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
-                            */
                             XYZ footvel, footpoint;
                             footvel = 0;
                             footpoint = weapons[weaponids[0]].tippoint;
@@ -3533,7 +3488,6 @@ void Person::DoAnimations()
                     victim->Puff(neck);
 
                     XYZ relative;
-                    //relative=victim->coords-oldcoords;
                     relative = facing * -1;
                     relative.y = 0;
                     Normalise(&relative);
@@ -3554,7 +3508,6 @@ void Person::DoAnimations()
                     escapednum = 0;
                     victim->RagDoll(0);
                     XYZ relative;
-                    //relative=victim->coords-oldcoords;
                     relative = facing * -1;
                     relative.y = 0;
                     Normalise(&relative);
@@ -4112,7 +4065,6 @@ void Person::DoAnimations()
             transspeed = 15;
         }
     }
-    //skeleton.DoConstraints();
 }
 
 /* EFFECT
@@ -4203,8 +4155,6 @@ void Person::DoStuff()
 
     if (onfire) {
         burnt += multiplier;
-        /*if(aitype!=playercontrolled)*///deathbleeding=5;
-        /*if(aitype!=playercontrolled)*/
         deathbleeding = 1;
         if (burnt > .6)
             burnt = .6;
@@ -4314,7 +4264,6 @@ void Person::DoStuff()
         }
         bloodloss += deathbleeding * multiplier * 80;
         deathbleeding -= multiplier * 1.6;
-        //if(id==0)deathbleeding-=multiplier*.2;
         if (deathbleeding < 0)
             deathbleeding = 0;
         if (bloodloss > damagetolerance && animation[animTarget].attack == neutral) {
@@ -4776,16 +4725,13 @@ void Person::DoStuff()
         damage += 20;
     }
 
-    //if(dead)damage-=multiplier/4;
     if (!dead)
         damage -= multiplier * 13;
-    //if(!dead&&deathbleeding<=0&&id==0)bloodloss-=multiplier*4;
     if (!dead)
         permanentdamage -= multiplier * 4;
     if (isIdle() || isCrouch()) {
         if (!dead)
             permanentdamage -= multiplier * 4;
-        //if(!dead&&deathbleeding<=0&&id==0)bloodloss-=multiplier*4;
     }
     if (damage < 0)
         damage = 0;
@@ -5001,7 +4947,6 @@ void Person::DoStuff()
                 yaw = targetyaw;
 
                 frameTarget = 0;
-                // frameTarget=2;
                 animTarget = flipanim;
                 crouchtogglekeydown = 1;
                 target = 0;
@@ -5011,9 +4956,6 @@ void Person::DoStuff()
                 animCurrent = tempanim;
                 frameCurrent = 0;
                 target = 0;
-                //tilt2=targettilt2;
-
-                //if(middle.y>0)targetoffset.y=middle.y+1;
 
                 for (int i = 0; i < skeleton.num_joints; i++) {
                     tempanimation.position[i][0] = skeleton.joints[i].position;
@@ -5557,7 +5499,6 @@ void Person::DoStuff()
         }
 
         //Running velocity
-        //if(!creature==wolftype||animTarget==rabbitkickanim)
         if (animTarget == rabbittackleanim) {
             velocity += facing * multiplier * speed * 700 * scale;
             velspeed = findLength(&velocity);
@@ -5624,21 +5565,6 @@ void Person::DoStuff()
             velocity = flatfacing * velspeed;
         }
 
-
-        /*if(animCurrent==rollanim&&(isCrouch()||isIdle())){
-        velocity+=facing*multiplier*speed*700*scale;
-        velspeed=findLength(&velocity);
-        if(velspeed>speed*25*scale){
-        velocity/=velspeed;
-        velspeed=speed*25*scale;
-        velocity*=velspeed;
-        }
-        velocity.y+=gravity*multiplier*20;
-        ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z));
-        velspeed=findLength(&velocity);
-        velocity=flatfacing*velspeed;
-        }*/
-
         if (animTarget == sneakanim || animTarget == walkanim) {
             velocity += facing * multiplier * speed * 700 * scale;
             velspeed = findLength(&velocity);
@@ -6099,12 +6025,9 @@ int Person::DrawSkeleton()
                                              (v0.y * (1 - morphness) + v1.y * morphness) * proportionhead.y,
                                              (v0.z * (1 - morphness) + v1.z * morphness) * proportionhead.z);
                             glGetFloatv(GL_MODELVIEW_MATRIX, M);
-                            //if(!isnormal(M[12])||!isnormal(M[13])||!isnormal(M[14]))test=0;
-                            //if(!isnormal(scale))test=1;
                             skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].x = M[12] * scale;
                             skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].y = M[13] * scale;
                             skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].z = M[14] * scale;
-                            //test=2;
                             glPopMatrix();
                         }
                     }
@@ -6284,7 +6207,6 @@ int Person::DrawSkeleton()
                 glEnable(GL_BLEND);
             }
             if (tutoriallevel && id != 0) {
-                //glDisable(GL_TEXTURE_2D);
                 glColor4f(.7, .7, .7, 0.6);
                 glDepthMask(0);
                 glEnable(GL_LIGHTING);
@@ -6595,7 +6517,6 @@ int Person::DrawSkeleton()
         calcrot = 1;
     if (animCurrent != animTarget)
         calcrot = 1;
-    //if(id==0)calcrot=1;
     if (skeleton.free == 2)
         calcrot = 0;
 
index fe99c32f75d977b6abfdc2ac551588461d51e9a2..562ec8ed5e71d05a97e2dfa9f0422d96707d7a3e 100644 (file)
@@ -714,23 +714,6 @@ void Animation::Load(const char *filename, int aheight, int aattack)
     if (tfile) {
         // read numframes, joints to know how much memory to allocate
         funpackf(tfile, "Bi Bi", &numframes, &joints);
-        /*
-        for(i = 0; i < joints; i++){
-        if(position[i])dealloc2(position[i]);
-        if(twist[i])dealloc2(twist[i]);
-        if(twist2[i])dealloc2(twist2[i]);
-        if(onground[i])dealloc2(onground[i]);
-        }*/
-        /*
-        if(position)dealloc2(position);
-        if(twist)dealloc2(twist);
-        if(twist2)dealloc2(twist2);
-        if(speed)dealloc2(speed);
-        if(onground)dealloc2(onground);
-        if(forward)dealloc2(forward);
-        if(weapontarget)dealloc2(weapontarget);
-        if(label)dealloc2(label);*/
-
 
         // allocate memory for everything
 
@@ -756,15 +739,6 @@ void Animation::Load(const char *filename, int aheight, int aattack)
         weapontarget = (XYZ*)malloc(sizeof(XYZ) * numframes);
         label = (int*)malloc(sizeof(int) * numframes);
 
-        /*position = new XYZ[joints][numframes];
-        twist = new float[joints][numframes];
-        twist2 = new float[joints][numframes];
-        speed = new float[numframes];
-        onground = new bool[joints][numframes];
-        forward = new XYZ[numframes];
-        label = new int[numframes];*/
-
-
         // read binary data as animation
 
         // for each frame...
@@ -914,10 +888,9 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
         funpackf(tfile, "Bi", &num_joints);
 
         // allocate memory
-        //joints.resize(num_joints);
         if (joints)
             delete [] joints; //dealloc2(joints);
-        joints = (Joint*)new Joint[num_joints]; //malloc(sizeof(Joint)*num_joints);
+        joints = (Joint*)new Joint[num_joints];
 
         // read info for each joint
         for (i = 0; i < num_joints; i++) {
@@ -938,7 +911,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
         funpackf(tfile, "Bi", &num_muscles);
 
         // allocate memory
-        //muscles.clear();
         if (muscles)
             delete [] muscles; //dealloc2(muscles);
         muscles = (Muscle*)new Muscle[num_muscles]; //malloc(sizeof(Muscle)*num_muscles);
@@ -949,9 +921,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
             funpackf(tfile, "Bf Bf Bf Bf Bf Bi Bi", &muscles[i].length, &muscles[i].targetlength, &muscles[i].minlength, &muscles[i].maxlength, &muscles[i].strength, &muscles[i].type, &muscles[i].numvertices);
 
             // allocate memory for vertices
-            //muscles[i].vertices.clear();
-            //muscles[i].vertices.resize(muscles[i].numvertices);
-            //if(muscles[i].vertices)dealloc2(muscles[i].vertices);
             muscles[i].vertices = (int*)malloc(sizeof(int) * muscles[i].numvertices);
 
             // read vertices
@@ -1029,8 +998,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
 
         lSize = sizeof(num_joints);
         fseek(tfile, lSize, SEEK_CUR);
-        //joints = new Joint[num_joints];
-        //jointlabels = new int[num_joints];
         for (i = 0; i < num_joints; i++) {
             // skip joint info
             lSize = sizeof(XYZ)
@@ -1055,7 +1022,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
 
         // read num_muscles
         funpackf(tfile, "Bi", &num_muscles);
-        //muscles = new Muscle[num_muscles];
 
         for (i = 0; i < num_muscles; i++) {
             // skip muscle info
@@ -1072,9 +1038,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
 
             if (muscles[i].numverticeslow) {
                 // allocate memory
-                //muscles[i].verticeslow.clear();
-                //muscles[i].verticeslow.resize(muscles[i].numverticeslow);
-                //if(muscles[i].verticeslow)dealloc2(muscles[i].verticeslow);
                 muscles[i].verticeslow = (int*)malloc(sizeof(int) * muscles[i].numverticeslow);
 
                 // read verticeslow
@@ -1103,14 +1066,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
             }
         }
 
-        /*FindForwards();
-        for(i=0;i<num_joints;i++){
-        joints[i].startpos=joints[i].position;
-        }
-        for(i=0;i<num_muscles;i++){
-        FindRotationMuscle(i,-1);
-        }*/
-
         // use opengl for its matrix math
         for (i = 0; i < modellow.vertexNum; i++) {
             modellow.vertex[i] = modellow.vertex[i] - (muscles[modellow.owner[i]].parent1->position + muscles[modellow.owner[i]].parent2->position) / 2;
@@ -1139,8 +1094,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
         // skip num_joints
         lSize = sizeof(num_joints);
         fseek ( tfile, lSize, SEEK_CUR);
-        //joints = new Joint[num_joints];
-        //jointlabels = new int[num_joints];
 
         for (i = 0; i < num_joints; i++) {
             // skip joint info
@@ -1166,7 +1119,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
 
         // read num_muscles
         funpackf(tfile, "Bi", &num_muscles);
-        //muscles = new Muscle[num_muscles];
 
         for (i = 0; i < num_muscles; i++) {
             // skip muscle info
@@ -1183,9 +1135,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
 
             // read verticesclothes
             if (muscles[i].numverticesclothes) {
-                //muscles[i].verticesclothes.clear();
-                //muscles[i].verticesclothes.resize(muscles[i].numverticesclothes);
-                //if(muscles[i].verticesclothes)dealloc2(muscles[i].verticesclothes);
                 muscles[i].verticesclothes = (int*)malloc(sizeof(int) * muscles[i].numverticesclothes);
                 edit = 0;
                 for (j = 0; j < muscles[i].numverticesclothes - edit; j++) {
@@ -1214,14 +1163,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
             }
         }
 
-        /*FindForwards();
-        for(i=0;i<num_joints;i++){
-        joints[i].startpos=joints[i].position;
-        }
-        for(i=0;i<num_muscles;i++){
-        FindRotationMuscle(i,-1);
-        }*/
-
         // use opengl for its matrix math
         for (i = 0; i < modelclothes.vertexNum; i++) {
             modelclothes.vertex[i] = modelclothes.vertex[i] - (muscles[modelclothes.owner[i]].parent1->position + muscles[modelclothes.owner[i]].parent2->position) / 2;
@@ -1592,14 +1533,6 @@ void Skeleton::Draw(int muscleview)
             glVertex3f(joints[i].parent->position.x, joints[i].parent->position.y, joints[i].parent->position.z);
         }
     }
-    /*for(int i=0; i<num_joints; i++){
-    if(joints[i].hasparent){
-    glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],1);
-    glVertex3f(joints[i].position.x,joints[i].position.y,joints[i].position.z);
-    glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],1);
-    glVertex3f(joints[i].position.x+forward.x,joints[i].position.y+forward.y,joints[i].position.z+forward.z);
-    }
-    }*/
     for (int i = 0; i < num_muscles; i++) {
         if (muscles[i].type == boneconnect) {
             glColor4f(jointcolor[0], jointcolor[1], jointcolor[2], jointcolor[3] / muscles[i].parent1->blurred);
@@ -1656,13 +1589,7 @@ void Skeleton::AddJoint(float x, float y, float z, int which)
         joints[num_joints].mass = 1;
         joints[num_joints].locked = 0;
 
-        /*if(which>=num_joints||which<0)*/
         joints[num_joints].hasparent = 0;
-        /*if(which<num_joints&&which>=0){
-        joints[num_joints].parent=&joints[which];
-        joints[num_joints].hasparent=1;
-        joints[num_joints].length=findDistance(joints[num_joints].position,joints[num_joints].parent->position);
-        }*/
         num_joints++;
         if (which < num_joints && which >= 0)
             AddMuscle(num_joints - 1, which, 0, 10, boneconnect);
index 3d9a50c2730a7e7245a2963fdf8c0a849e56d8e4..ebc73d950d67f80e7001bdfd1c4cd59057de60ad 100644 (file)
@@ -364,7 +364,7 @@ void Sprite::Draw()
                                 if (!spritehit)
                                     if (objects.model[k].LineCheck(&start, &end, &colpoint, &objects.position[k], &objects.yaw[k]) != -1) {
                                         if (detail == 2 || (detail == 1 && abs(Random() % 4) == 0) || (detail == 0 && abs(Random() % 8) == 0))
-                                            objects.model[k].MakeDecal(blooddecalfast, DoRotation(colpoint - objects.position[k], 0, -objects.yaw[k], 0), sprites[i]->size * 1.6/*+abs((float)(Random()%100))/2400*/, .5, Random() % 360);
+                                            objects.model[k].MakeDecal(blooddecalfast, DoRotation(colpoint - objects.position[k], 0, -objects.yaw[k], 0), sprites[i]->size * 1.6, .5, Random() % 360);
                                         DeleteSprite(i);
                                         spritehit = 1;
                                     }
@@ -372,7 +372,7 @@ void Sprite::Draw()
                     }
                 if (!spritehit)
                     if (sprites[i]->position.y < terrain.getHeight(sprites[i]->position.x, sprites[i]->position.z)) {
-                        terrain.MakeDecal(blooddecalfast, sprites[i]->position, sprites[i]->size * 1.6/*+abs((float)(Random()%100))/2400*/, .6, Random() % 360);
+                        terrain.MakeDecal(blooddecalfast, sprites[i]->position, sprites[i]->size * 1.6, .6, Random() % 360);
                         DeleteSprite(i);
                     }
             }
index a7a1178ae4b53eaee72cfa3de96ca50aba974872..748e8e3a6a43e84eb519ad7508ccbee972382c6c 100644 (file)
@@ -39,17 +39,6 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
     // for Windows, just use TGA loader for now
     char fileName[256];
     CopyPascalStringToC( filePath, fileName);
-    /*
-        // change extension to .TGA
-        int len = strlen( fileName);
-        if (len > 3)
-        {
-            fileName[ len - 3] = 't';
-            fileName[ len - 2] = 'g';
-            fileName[ len - 1] = 'a';
-        }
-    */
-//return (LoadTGA( fileName) != NULL);
     return (LoadImage(fileName, texture));
 
 #else
@@ -57,21 +46,9 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
     OSStatus err;
     ComponentResult cr;
 
-    /*FSRef fsref;
-    Boolean isdir;
-    err = FSPathMakeRef((const UInt8*)filePath, &fsref, &isdir);
-    if(err)return;
-
-    FSSpec fsspec;
-    err = FSGetCatalogInfo(&fsref, kFSCatInfoNone, NULL, NULL, &fsspec, NULL);
-    if(err)return;
-    */
-
     //Boolean isdir;
     FSSpec fsspec;
-    //err = FSMakeFSSpec (0, 0, (const unsigned char*)filePath, &fsspec);
     err = FSMakeFSSpec (0, 0, filePath, &fsspec);
-    //err=FSPathMakeFSSpec((const UInt8*)filePath,&fsspec,&isdir);*/
     if (err)
         return;
 
@@ -83,13 +60,9 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
     Rect natbounds;
     cr = GraphicsImportGetNaturalBounds(gi, &natbounds);
 
-    //~ size_t buffersize = 4 * natbounds.bottom * natbounds.right;
-    //void* buf = malloc(buffersize);
     texture.sizeX = natbounds.right;
     texture.sizeY = natbounds.bottom;
-    /*if(hasalpha)*/
     texture.bpp = 32;
-    //if(!hasalpha)texture.bpp = 24;
 
     GWorldPtr gw;
     err = QTNewGWorldFromPtr(&gw, k32ARGBPixelFormat, &natbounds, NULL, NULL,
@@ -110,11 +83,6 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
     if (err)
         return;
 
-    /*glTexImage2D(textureTarget, 0, GL_RGBA, natbounds.right, natbounds.top, 0,
-    GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buf);
-    */
-
-    //free(buf);
     DisposeGWorld(gw);
 
     // Loop Through The Image Data
@@ -123,7 +91,6 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
     GLuint bytesPerPixel; // Temporary Variable
     bytesPerPixel = texture.bpp / 8;
     imageSize = texture.sizeX * texture.sizeY * bytesPerPixel;
-    //~ int alltrans=10;
 
     for ( GLuint i = 0; i < int( imageSize ); i += 4 ) {
         // Swaps The 1st And 3rd Bytes ('R'ed and 'B'lue)
@@ -134,15 +101,9 @@ bool upload_image(const unsigned char* filePath, bool hasalpha)
         texture.data[i + 3] = temp;
     }
 
-    //~ int tempplace;
-    //~ tempplace=0;
     if (!hasalpha) {
         for ( GLuint i = 0; i < int( imageSize ); i += 4 ) {
             texture.data[i + 3] = 255;
-            /*texture.data[tempplace] = texture.data[i]; // Set The 1st Byte To The Value Of The 3rd Byte
-            texture.data[tempplace + 1] = texture.data[i + 1]; // Set The 3rd Byte To The Value In 'temp' (1st Byte Value)
-            texture.data[tempplace + 2] = texture.data[i + 2];
-            tempplace+=3;*/
         }
     }
 
index b0aff61581df56406c7c174de27d4fa09bf620cb..38bf0ae611c9643d38faa9d196129b697dd2dc43 100644 (file)
@@ -516,28 +516,6 @@ bool Terrain::load(const char *fileName)
     if (visibleloading)
         Game::LoadingScreen();
 
-    /*float total;
-    int todivide;
-    //Smooth opacityother
-    for(i=0;i<size;i++){
-    for(j=0;j<size;j++){
-    total=0;
-    todivide=0;
-    if(i!=0){total+=opacityother[j][i-1]; todivide++;}
-    if(i!=size-1){total+=opacityother[j][i+1]; todivide++;}
-    if(j!=0){total+=opacityother[j-1][i]; todivide++;}
-    if(j!=size-1){total+=opacityother[j+1][i]; todivide++;}
-    if(i!=0&&j!=0){total+=opacityother[j-1][i-1]; todivide++;}
-    if(i!=size-1&&j!=0){total+=opacityother[j-1][i+1]; todivide++;}
-    if(j!=size-1&&i!=size-1){total+=opacityother[j+1][i+1]; todivide++;}
-    if(j!=size-1&&i!=0){total+=opacityother[j+1][i-1]; todivide++;}
-    total+=opacityother[j][i]; todivide++;
-
-    opacityother[j][i]=total/(float)todivide;
-    }
-    }*/
-
-
     for (i = 0; i < size; i++) {
         for (j = 0; j < size; j++) {
             if (opacityother[i][j] < .1)
@@ -667,13 +645,6 @@ bool Terrain::load(const char *fileName)
     patch_size = size / subdivision;
     patch_elements = (patch_size) * (patch_size) * 54;
     CalculateNormals();
-    /*DoShadows();
-
-    for(i=0;i<subdivision;i++){
-    for(j=0;j<subdivision;j++){
-    UpdateVertexArray(i,j);
-    }
-    }*/
 
     return 1;
 }
@@ -882,11 +853,6 @@ float Terrain::getHeight(float pointx, float pointz)
         LineFacetd(&startpoint, &endpoint, &triangle[0], &triangle[1], &triangle[2], &intersect);
     }
     return intersect.y * scale + getOpacity(pointx * scale, pointz * scale) / 8;
-
-    //height1=heightmap[tilex][tiley]*(1-(pointx-tilex))+heightmap[tilex+1][tiley]*(pointx-tilex);
-    //height2=heightmap[tilex][tiley+1]*(1-(pointx-tilex))+heightmap[tilex+1][tiley+1]*(pointx-tilex);
-
-    //return height1*(1-(pointz-tiley))*scale+height2*(pointz-tiley)*scale;
 }
 
 float Terrain::getOpacity(float pointx, float pointz)
@@ -1237,11 +1203,6 @@ void Terrain::MakeDecal(int type, XYZ where, float size, float opacity, float ro
             patchy[2] = (where.z + size) / scale;
             patchy[3] = (where.z + size) / scale;
 
-            /*if(patchx[1]<subdivision-1&&patchy[1]<subdivision-1&&patchx[1]>0&&patchy[1]>0)
-            if(patchx[2]<subdivision-1&&patchy[2]<subdivision-1&&patchx[2]>0&&patchy[2]>0)
-            if(patchx[3]<subdivision-1&&patchy[3]<subdivision-1&&patchx[3]>0&&patchy[3]>0)
-            if(patchx[0]<subdivision-1&&patchy[0]<subdivision-1&&patchx[0]>0&&patchy[0]>0){
-            */
             if ((patchx[0] != patchx[1] || patchy[0] != patchy[1]) && (patchx[0] != patchx[2] || patchy[0] != patchy[2]) && (patchx[0] != patchx[3] || patchy[0] != patchy[3])) {
                 MakeDecalLock(type, where, patchx[0], patchy[0], size, opacity, rotation);
             }
index 09a23e1cadee95374d3b1ef3e03a4a67e99d0de6..8d0dc609ce03ed42f6966abeb3326889289b6676 100644 (file)
@@ -29,34 +29,6 @@ void Text::LoadFontTexture(const char *fileName)
     LOG(std::string("Loading font texture...") + fileName);
 
     FontTexture.load(fileName, false, false);
-    /*
-        //Load Image
-        //LoadTGA( fileName );
-        unsigned char fileNamep[256];
-        CopyCStringToPascal(fileName,fileNamep);
-        //Load Image
-        upload_image( fileNamep ,1);
-
-        //Is it valid?
-        if(1==1){
-            //Alpha channel?
-            if ( texture.bpp == 24 )
-                type = GL_RGB;
-            else
-                type = GL_RGBA;
-
-            glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
-
-            if(!FontTexture)glGenTextures( 1, &FontTexture );
-            glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
-
-            glBindTexture( GL_TEXTURE_2D, FontTexture);
-            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-
-            gluBuild2DMipmaps( GL_TEXTURE_2D, type, texture.sizeX, texture.sizeY, type, GL_UNSIGNED_BYTE, texture.data );
-        }
-    */
     if (base) {
         glDeleteLists(base, 512);
         base = 0;
@@ -74,11 +46,8 @@ void Text::BuildFont() // Build Our Font Display List
     if (base) {
         glDeleteLists(base, 512);
         base = 0;
-        //LOG("Font already created...");
-        //return;
     }
 
-//base=glGenLists(256); // Creating 256 Display Lists
     base = glGenLists(512); // Creating 256 Display Lists
     FontTexture.bind();
     for (loop = 0; loop < 512; loop++) { // Loop Through All 256 Lists