From 0b7253f3d99e4382008aff8b8e221e88ff40d3e9 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Fri, 7 Jan 2011 23:05:20 +0300 Subject: [PATCH] Remove terraindetail (== 1 anyway) --- Source/GameInitDispose.cpp | 11 +---------- Source/GameTick.cpp | 5 ++--- Source/Globals.cpp | 1 - Source/Objects.cpp | 9 ++++----- Source/OpenGL_Windows.cpp | 2 -- Source/Person.cpp | 5 ++--- Source/Skeleton.cpp | 5 ++--- Source/Sprite.cpp | 5 ++--- Source/Terrain.cpp | 13 ++++++------- Source/Weapons.cpp | 9 ++++----- 10 files changed, 23 insertions(+), 42 deletions(-) diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index e4f2e39..db565c2 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -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; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 2b0f4c4..7e231e0 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -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;kx/(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&&whichpatchx0&&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&&patchxx/(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); diff --git a/Source/Sprite.cpp b/Source/Sprite.cpp index 02eb220..0998e09 100644 --- a/Source/Sprite.cpp +++ b/Source/Sprite.cpp @@ -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&&whichpatchxpoints[0].x&&where.x-radiuspoints[0].z&&where.z-radius0&&whichpatchz>0&&whichpatchx0&&whichpatchz>0&&whichpatchx