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
master
Per Inge Mathisen 2007-05-26 20:15:42 +00:00
parent 2ec98482ba
commit cbb0795bd3
3 changed files with 8 additions and 93 deletions

View File

@ -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;

View File

@ -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)<<TILE_SHIFT) );
// centreZ = ( player.p.z + ((visibleYTiles/2)<<TILE_SHIFT) );
brightness = lightDoFogAndIllumination(pie_MAX_BRIGHT_LEVEL,getCentreX()-msgX,getCentreZ()-msgY, &specular);
dv.x = (msgX - player.p.x) - terrainMidX*TILE_UNITS;
@ -1914,7 +1910,6 @@ void renderProximityMsg(PROXIMITY_DISPLAY *psProxDisp)
}
}
// iV_MatrixRotateY(DEG(gameTime/10));
iV_MatrixRotateY(-player.r.y);
iV_MatrixRotateX(-player.r.x);
@ -2727,10 +2722,6 @@ void renderShadow( DROID *psDroid, iIMDShape *psShadowIMD )
pie_MatRotZ( DEG( psDroid->roll ) );
}
// set up lighting
// centreX = ( player.p.x + ((visibleXTiles/2)<<TILE_SHIFT) );
// centreZ = ( player.p.z + ((visibleYTiles/2)<<TILE_SHIFT) );
brightness = (UDWORD)lightDoFogAndIllumination(pie_MAX_BRIGHT_LEVEL,getCentreX()-psDroid->x,getCentreZ()-psDroid->y, &specular);
pie_Draw3DShape( psShadowIMD, 0, 0, brightness, specular, pie_TRANSLUCENT, 128);

View File

@ -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; i<mapWidth; i++)
{
for(j=0; j<mapHeight; j++)
{
mapTile(i,j)->illumination = 16;
}
}
//for(i=2; i<mapHeight-2; i++)
//{
// for(j=2; j<mapWidth-2; j++)
// {
// calcTileIllum(j,i);
// }
//}
for(i=1; i<mapHeight-1; i++)
{
for(j=1; j<mapWidth-1; j++)
{
calcTileIllum(j,i);
}
}
for(i=0; i<mapWidth; i++)
{
for(j=0; j<mapHeight; j++)
{
if(i==0 || j==0 || 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<mapWidth; i++)
{
for(j=0; j<mapHeight; j++)
{
if(i<(scrollMinX+4) || 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<LAND_XGRD,"X Colour Value out of range (above) for lighting" );