From cbb0795bd35bd73eef629bbaaed0483bc738aacf Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Sat, 26 May 2007 20:15:42 +0000 Subject: [PATCH] Remove misc dead code and make some functions static git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1711 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/bucket3d.c | 2 -- src/display3d.c | 9 ----- src/lighting.c | 90 +++++-------------------------------------------- 3 files changed, 8 insertions(+), 93 deletions(-) diff --git a/src/bucket3d.c b/src/bucket3d.c index bde8d85c2..ad7d959b0 100644 --- a/src/bucket3d.c +++ b/src/bucket3d.c @@ -312,8 +312,6 @@ extern BOOL bucketRenderCurrentList(void) //reset the tag array resourceCounter = 0; -// iV_NumberOut(worldMax,100,100,255); - // iV_NumberOut(worldMin,100,200,255); zMax = SDWORD_MIN; zMin = SDWORD_MAX; worldMax = SDWORD_MIN; diff --git a/src/display3d.c b/src/display3d.c index b0fa54543..b776f2a89 100644 --- a/src/display3d.c +++ b/src/display3d.c @@ -696,7 +696,6 @@ static void drawTiles(iView *camera, iView *player) pie_TRANSLATE(-rx, -player->p.y, rz); angle += 0.01f; - // RODZ uncomment the following line to see an OpenGL lighting demo if (getDrawShadows()) { const Vector3f light = {225.0f, -600.0f, 450.0f}; // this also detemines the length of the shadows @@ -1820,7 +1819,6 @@ void renderProximityMsg(PROXIMITY_DISPLAY *psProxDisp) VIEW_PROXIMITY *pViewProximity = NULL; SDWORD x, y, r; iIMDShape *proxImd = NULL; -// SDWORD centreX,centreZ; UDWORD brightness, specular; //store the frame number for when deciding what has been clicked on @@ -1858,8 +1856,6 @@ void renderProximityMsg(PROXIMITY_DISPLAY *psProxDisp) { ASSERT( FALSE,"Buggered proximity message type" ); } -// centreX = ( player.p.x + ((visibleXTiles/2)<roll ) ); } - // set up lighting -// centreX = ( player.p.x + ((visibleXTiles/2)<x,getCentreZ()-psDroid->y, &specular); pie_Draw3DShape( psShadowIMD, 0, 0, brightness, specular, pie_TRANSLUCENT, 128); diff --git a/src/lighting.c b/src/lighting.c index 116664b90..c2497b602 100644 --- a/src/lighting.c +++ b/src/lighting.c @@ -54,88 +54,21 @@ Vector3i theSun; UDWORD fogStatus = 0; /* Module function Prototypes */ -UDWORD lightDoFogAndIllumination(UBYTE brightness, SDWORD dx, SDWORD dz, UDWORD* pSpecular); -void doBuildingLights( void ); -void processLight(LIGHT *psLight); -UDWORD calcDistToTile(UDWORD tileX, UDWORD tileY, Vector3i *pos); -void colourTile(SDWORD xIndex, SDWORD yIndex, LIGHT_COLOUR colour, UBYTE percent); -void calcTileIllum(UDWORD tileX, UDWORD tileY); -void normalsOnTile(UDWORD tileX, UDWORD tileY, UDWORD quadrant); +static void colourTile(SDWORD xIndex, SDWORD yIndex, LIGHT_COLOUR colour, UBYTE percent); +static void normalsOnTile(UDWORD tileX, UDWORD tileY, UDWORD quadrant); +static UDWORD calcDistToTile(UDWORD tileX, UDWORD tileY, Vector3i *pos); + UDWORD numNormals; // How many normals have we got? Vector3i normals[8]; // Maximum 8 possible normals extern void draw3dLine(Vector3i *src, Vector3i *dest, UBYTE col); - - /*****************************************************************************/ /* * SOURCE */ /*****************************************************************************/ -/*Rewrote the function so it takes parameters and also doesn't loop thru' -the map 4 times!*/ -/*void initLighting( void ) -{ -UDWORD i,j; -MAPTILE *psTile; - - for(i=0; iillumination = 16; - } - } - - //for(i=2; i=mapWidth-1 || j>=mapHeight-1) - { -// mapTile(i,j)->height = 0; - psTile = mapTile(i,j); - if(TERRAIN_TYPE(psTile) == TER_WATER) - { - psTile->texture = 0; - } - } - } - } - - // Cheers to paul for this idea - works on PC too - // Basically darkens down the tiles that are outside the scroll - // limits - thereby emphasising the cannot-go-there-ness of them - for(i=0; i(scrollMaxX-4) || j<(scrollMinY+4) || j>(scrollMaxY-4)) - { - mapTile(i,j)->illumination/=3; - } - } - } -}*/ - //should do the same as above except cuts down on the loop count! //By passing in params - it means that if the scroll limits are changed mid-mission //we can re-do over the area that hasn't been seen @@ -231,24 +164,17 @@ void calcTileIllum(UDWORD tileX, UDWORD tileY) pie_VectorNormalise3iv(&finalVector); pie_VectorNormalise3iv(&theSun); -// iV_NumberOut(theSun.x,100,100,255); -// iV_NumberOut(theSun.y,100,110,255); -// iV_NumberOut(theSun.z,100,120,255); - -// iV_NumberOut(numNormals,100,140,255); - dotProduct = (finalVector.x * theSun.x + finalVector.y * theSun.y + finalVector.z * theSun.z)>>FP12_SHIFT; - /* iV_NumberOut(dotProduct,100,150,255);*/ val = ((abs(dotProduct)) / 16); if (val == 0) val = 1; if(val > 254) val = 254; mapTile(tileX, tileY)->illumination = val; } -void normalsOnTile(UDWORD tileX, UDWORD tileY, UDWORD quadrant) +static void normalsOnTile(UDWORD tileX, UDWORD tileY, UDWORD quadrant) { Vector3i corner1, corner2, corner3; MAPTILE *psTile, *tileRight, *tileDownRight, *tileDown; @@ -505,7 +431,7 @@ UDWORD percent; } -UDWORD calcDistToTile(UDWORD tileX, UDWORD tileY, Vector3i *pos) +static UDWORD calcDistToTile(UDWORD tileX, UDWORD tileY, Vector3i *pos) { UDWORD x1,y1,z1; UDWORD x2,y2,z2; @@ -531,7 +457,7 @@ UDWORD calcDistToTile(UDWORD tileX, UDWORD tileY, Vector3i *pos) } -void colourTile(SDWORD xIndex, SDWORD yIndex, LIGHT_COLOUR colour, UBYTE percent) +static void colourTile(SDWORD xIndex, SDWORD yIndex, LIGHT_COLOUR colour, UBYTE percent) { ASSERT( xIndex