]> git.jsancho.org Git - lugaru.git/commitdiff
Remove terraindetail (== 1 anyway)
authorAlexander Monakov <amonakov@gmail.com>
Fri, 7 Jan 2011 20:05:20 +0000 (23:05 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 7 Jan 2011 20:05:20 +0000 (23:05 +0300)
Source/GameInitDispose.cpp
Source/GameTick.cpp
Source/Globals.cpp
Source/Objects.cpp
Source/OpenGL_Windows.cpp
Source/Person.cpp
Source/Skeleton.cpp
Source/Sprite.cpp
Source/Terrain.cpp
Source/Weapons.cpp

index e4f2e394035b428aa6e0714e6a75069e580120db..db565c2faf9d995705484362096a8a4b6f8a359a 100644 (file)
@@ -39,7 +39,6 @@ extern Terrain terrain;
 extern int kTextureSize;
 extern float texdetail;
 extern float realtexdetail;
-extern float terraindetail;
 extern float volume;
 extern Objects objects;
 extern int detail;
@@ -814,16 +813,12 @@ void Game::InitGame()
 
        if(detail==2){
                texdetail=1;
-               terraindetail=1;
        }
        if(detail==1){
                texdetail=2;
-               terraindetail=1;
        }
        if(detail==0){
                texdetail=4;
-               terraindetail=1;
-               //terraindetail=2;
        }
 
        LOG("Initializing sound system...");
@@ -954,16 +949,12 @@ void Game::LoadStuff()
 
        if(detail==2){
                texdetail=1;
-               terraindetail=1;
        }
        if(detail==1){
                texdetail=2;
-               terraindetail=1;
        }
        if(detail==0){
                texdetail=4;
-               terraindetail=1;
-               //terraindetail=2;
        }
 
        realtexdetail=texdetail;
@@ -1111,7 +1102,7 @@ void Game::LoadStuff()
        gravity=-10;
 
        texscale=.2/megascale/viewdistdetail;
-       terrain.scale=3*megascale*terraindetail*viewdistdetail;
+       terrain.scale=3*megascale*viewdistdetail;
 
        viewer.x=terrain.size/2*terrain.scale;
        viewer.z=terrain.size/2*terrain.scale;
index 2b0f4c469689bc21231dcf049d525fe0661ec57d..7e231e0a03f508604dec7a56b2936c002da850e2 100644 (file)
@@ -63,7 +63,6 @@ extern Light light;
 extern float texdetail;
 extern GLubyte bloodText[512*512*3];
 extern GLubyte wolfbloodText[512*512*3];
-extern float terraindetail;
 extern float camerashake;
 extern float woozy;
 extern float blackout;
@@ -7188,8 +7187,8 @@ void      Game::Tick()
 
                                                        for(k=0;k<numplayers;k++){
                                                                player[k].DoAnimations();
-                                                               player[k].whichpatchx=player[k].coords.x/(terrain.size/subdivision*terrain.scale*terraindetail);
-                                                               player[k].whichpatchz=player[k].coords.z/(terrain.size/subdivision*terrain.scale*terraindetail);
+                                                               player[k].whichpatchx=player[k].coords.x/(terrain.size/subdivision*terrain.scale);
+                                                               player[k].whichpatchz=player[k].coords.z/(terrain.size/subdivision*terrain.scale);
                                                        }
 
                                                        objects.DoStuff();
index 5ec388e15dcd7f3a4dbd13766c76cbda41411454..db533ec567e555804d512b9a1d45ef6cf8b87d64 100644 (file)
@@ -81,7 +81,6 @@ int detail = 0;
 FRUSTUM frustum;
 float texdetail = 0;
 float realtexdetail = 0;
-float terraindetail = 0;
 float playerdist = 0;
 Objects objects;
 int slomo = 0;
index 3317992d97d8553b00fffbe3f2999a2450bdd048..a01fc1193598d379c0cc390c5fc7d7d53372ffec 100644 (file)
@@ -31,7 +31,6 @@ extern float multiplier;
 extern float gravity;
 extern FRUSTUM frustum;
 extern Terrain terrain;
-extern float terraindetail;
 extern bool foliage;
 extern int detail;
 extern float blurness;
@@ -67,8 +66,8 @@ void Objects::SphereCheckPossible(XYZ *p1,float radius)
        static int whichpatchx;
        static int whichpatchz;
 
-       whichpatchx=p1->x/(terrain.size/subdivision*terrain.scale*terraindetail);
-       whichpatchz=p1->z/(terrain.size/subdivision*terrain.scale*terraindetail);
+       whichpatchx=p1->x/(terrain.size/subdivision*terrain.scale);
+       whichpatchz=p1->z/(terrain.size/subdivision*terrain.scale);
 
        if(whichpatchx>=0&&whichpatchz>=0&&whichpatchx<subdivision&&whichpatchz<subdivision)
                if(terrain.patchobjectnum[whichpatchx][whichpatchz]>0&&terrain.patchobjectnum[whichpatchx][whichpatchz]<500)
@@ -713,8 +712,8 @@ void Objects::DoShadows()
                                        terrainpoint=position[i]+DoRotation(model[i].vertex[j]+model[i].normals[j]*.1,0,rotation[i],0);
                                        //terrainpoint.y+=model[i].boundingsphereradius;
                                        shadowed[i]=0;
-                                       patchx=terrainpoint.x/(terrain.size/subdivision*terrain.scale*terraindetail);
-                                       patchz=terrainpoint.z/(terrain.size/subdivision*terrain.scale*terraindetail);
+                                       patchx=terrainpoint.x/(terrain.size/subdivision*terrain.scale);
+                                       patchz=terrainpoint.z/(terrain.size/subdivision*terrain.scale);
                                        if(patchx>=0&&patchz>=0&&patchx<subdivision&&patchz<subdivision)
                                                if(terrain.patchobjectnum[patchx][patchz])
                                                        for(k=0;k<terrain.patchobjectnum[patchx][patchz];k++){
index 8b82e3e4ae2561fc9df057c6c7859a2359060a7f..5b3d92671336f5bd2ce16b9d7639f802e4e07740 100644 (file)
@@ -66,7 +66,6 @@ extern float sps;
 extern float realmultiplier;
 extern int slomo;
 extern bool cellophane;
-extern float terraindetail;
 extern float texdetail;
 
 extern bool osx;
@@ -231,7 +230,6 @@ Boolean SetUp (Game & game)
        osx = 0;
        cellophane=0;
        texdetail=4;
-       terraindetail=2;
        slomospeed=0.25;
        slomofreq=8012;
        numplayers=1;
index 6e527fb1e9d0eccc0fb78b2204aead82d6ae5274..47212bd59ac3eee01265620103cc9898e86e4f63 100644 (file)
@@ -48,7 +48,6 @@ extern bool osx;
 extern bool autoslomo;
 extern float camerashake;
 extern float woozy;
-extern float terraindetail;
 extern float viewdistance;
 extern float blackout;
 extern int difficulty;
@@ -1324,8 +1323,8 @@ void Person::RagDoll(bool checkcollision){
                                skeleton.joints[j].position-=average;
                        }
 
-                       whichpatchx=coords.x/(terrain.size/subdivision*terrain.scale*terraindetail);
-                       whichpatchz=coords.z/(terrain.size/subdivision*terrain.scale*terraindetail);
+                       whichpatchx=coords.x/(terrain.size/subdivision*terrain.scale);
+                       whichpatchz=coords.z/(terrain.size/subdivision*terrain.scale);
                        if(terrain.patchobjectnum[whichpatchx][whichpatchz])
                                for(l=0;l<terrain.patchobjectnum[whichpatchx][whichpatchz];l++){
                                        i=terrain.patchobjects[whichpatchx][whichpatchz][l];
index 8d4247bae71b5d9341aaab96dce3da4e7a25ff93..5b28f738f4ac8cfcea8429e8fb0d8d5366e27271 100644 (file)
@@ -31,7 +31,6 @@ extern Skeleton testskeleton;
 extern Terrain terrain;
 extern Objects objects;
 extern int environment;
-extern float terraindetail;
 extern float camerashake;
 extern bool freeze;
 extern int detail;
@@ -194,8 +193,8 @@ float Skeleton::DoConstraints(XYZ *coords,float *scale)
        if(free){
                freetime+=multiplier;
 
-               whichpatchx=coords->x/(terrain.size/subdivision*terrain.scale*terraindetail);
-               whichpatchz=coords->z/(terrain.size/subdivision*terrain.scale*terraindetail);
+               whichpatchx=coords->x/(terrain.size/subdivision*terrain.scale);
+               whichpatchz=coords->z/(terrain.size/subdivision*terrain.scale);
 
                terrainlight=*coords;
                objects.SphereCheckPossible(&terrainlight, 1);
index 02eb22071056271026d62437816c22ac16d27a29..0998e093bfc65eb35f85c1f6740cc9d334e9ac31 100644 (file)
@@ -34,7 +34,6 @@ extern Terrain terrain;
 extern Objects objects;
 extern int detail;
 extern XYZ viewerfacing;
-extern float terraindetail;
 extern int bloodtoggle;
 extern XYZ windvector;
 
@@ -329,8 +328,8 @@ void Sprite::Draw()
                                        }
                                }
 
-                               whichpatchx=sprites[i]->position.x/(terrain.size/subdivision*terrain.scale*terraindetail);
-                               whichpatchz=sprites[i]->position.z/(terrain.size/subdivision*terrain.scale*terraindetail);
+                               whichpatchx=sprites[i]->position.x/(terrain.size/subdivision*terrain.scale);
+                               whichpatchz=sprites[i]->position.z/(terrain.size/subdivision*terrain.scale);
                                if(whichpatchx>0&&whichpatchz>0&&whichpatchx<subdivision&&whichpatchz<subdivision)
                                        if(terrain.patchobjectnum[whichpatchx][whichpatchz]){
                                                if(!spritehit)
index 1683dfc88c0426cd7d2ab8b79bfd903e565a2d0e..649d3f390fc1cb2b0ea51a2851d17b5a9942e0b5 100644 (file)
@@ -31,7 +31,7 @@ extern float texscale;
 extern Light light;
 extern float multiplier;
 extern FRUSTUM frustum;
-extern float texdetail,terraindetail;
+extern float texdetail;
 extern int detail;
 extern bool decals;
 extern float blurness;
@@ -378,7 +378,6 @@ bool Terrain::load(const char *fileName)
        static float patch_size;
 
        float temptexdetail=texdetail;
-       texdetail=terraindetail;
        //LoadTGA( fileName );
 
        // Fixing filename so that it works with its own os
@@ -429,7 +428,7 @@ bool Terrain::load(const char *fileName)
 
                for(i=0;i<size;i++){
                        for(j=0;j<size;j++){
-                               heightmap[size-1-i][j]=(float)((texture.data[(i+(j*size))*texture.bpp/8]))/5/terraindetail;
+                               heightmap[size-1-i][j]=(float)((texture.data[(i+(j*size))*texture.bpp/8]))/5;
                        }
                }
 
@@ -1154,10 +1153,10 @@ void Terrain::AddObject(XYZ where, float radius, int id)
                                        points[3].x=(size/subdivision)*i;
                                        points[3].z=(size/subdivision)*(j+1);
                                        points[3].y=heightmap[(int)points[3].x][(int)points[3].z];
-                                       points[0]*=scale*terraindetail;
-                                       points[1]*=scale*terraindetail;
-                                       points[2]*=scale*terraindetail;
-                                       points[3]*=scale*terraindetail;
+                                       points[0]*=scale;
+                                       points[1]*=scale;
+                                       points[2]*=scale;
+                                       points[3]*=scale;
                                        if(!done&&where.x+radius>points[0].x&&where.x-radius<points[2].x&&where.z+radius>points[0].z&&where.z-radius<points[2].z){
                                                patchobjects[i][j][patchobjectnum[i][j]]=id;
                                                patchobjectnum[i][j]++;
index 0edca797df5ab4415985668e044efdeb9e15a4ab..d250f1ee84676c50d008dbc35e4724ce22db42ac 100644 (file)
@@ -46,7 +46,6 @@ extern bool osx;
 extern bool autoslomo;
 extern float camerashake;
 extern float woozy;
-extern float terraindetail;
 extern float viewdistance;
 extern float blackout;
 extern int difficulty;
@@ -118,8 +117,8 @@ void        Weapons::DoStuff(){
                if(owner[i]==-1&&(velocity[i].x||velocity[i].y||velocity[i].z)&&!physics[i]){
                        position[i]+=velocity[i]*multiplier;
                        tippoint[i]+=velocity[i]*multiplier;
-                       whichpatchx=position[i].x/(terrain.size/subdivision*terrain.scale*terraindetail);
-                       whichpatchz=position[i].z/(terrain.size/subdivision*terrain.scale*terraindetail);
+                       whichpatchx=position[i].x/(terrain.size/subdivision*terrain.scale);
+                       whichpatchz=position[i].z/(terrain.size/subdivision*terrain.scale);
                        if(whichpatchx>0&&whichpatchz>0&&whichpatchx<subdivision&&whichpatchz<subdivision)
                                if(terrain.patchobjectnum[whichpatchx][whichpatchz]){
                                        for(j=0;j<terrain.patchobjectnum[whichpatchx][whichpatchz];j++){
@@ -355,8 +354,8 @@ void        Weapons::DoStuff(){
 
 
                                //Object collisions
-                               whichpatchx=(position[i].x)/(terrain.size/subdivision*terrain.scale*terraindetail);
-                               whichpatchz=(position[i].z)/(terrain.size/subdivision*terrain.scale*terraindetail);
+                               whichpatchx=(position[i].x)/(terrain.size/subdivision*terrain.scale);
+                               whichpatchz=(position[i].z)/(terrain.size/subdivision*terrain.scale);
                                if(whichpatchx>0&&whichpatchz>0&&whichpatchx<subdivision&&whichpatchz<subdivision)
                                        if(terrain.patchobjectnum[whichpatchx][whichpatchz]){
                                                for(j=0;j<terrain.patchobjectnum[whichpatchx][whichpatchz];j++){