Minor code cleanup (by Asdow and sun_alf)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8812 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2020-05-30 13:24:33 +00:00
parent c5022fa1e5
commit 51e2c6b293
3 changed files with 10 additions and 30 deletions
+7 -22
View File
@@ -866,25 +866,19 @@ UINT32 DrawMap( void )
case MAP_DISPLAY_AIRSPACE_COLOURED_SAMS:
{
CHAR16 sString[20];
swprintf( sString, L"%d", ubSAMControlledSectors[cnt2][cnt] );
BOOLEAN a = FALSE;
BOOLEAN b = FALSE;
BOOLEAN c = FALSE;
BOOLEAN d = FALSE;
BOOLEAN samworking = FALSE;
for ( int i = 0; i < NUMBER_OF_SAMS; ++i )
{
for ( int i = 0; i < NUMBER_OF_SAMS; ++i )
if ( DoesSamCoverSector( i, SECTOR( cnt, cnt2 ), &samworking ) && samworking )
{
BOOLEAN samworking = FALSE;
if ( DoesSamCoverSector( i, SECTOR( cnt, cnt2 ), &samworking ) && samworking )
{
if ( i == 0 ) a = TRUE;
if ( i == 1 ) b = TRUE;
if ( i == 2 ) c = TRUE;
if ( i == 3 ) d = TRUE;
}
if ( i == 0 ) a = TRUE;
if ( i == 1 ) b = TRUE;
if ( i == 2 ) c = TRUE;
if ( i == 3 ) d = TRUE;
}
}
@@ -918,15 +912,6 @@ UINT32 DrawMap( void )
ShadeMapElem( cnt, cnt2, MAP_SHADE_MIX_GREEN_BLUE_YELLOW );
else if ( a && b && c && d )
ShadeMapElem( cnt, cnt2, MAP_SHADE_MIX_RED_GREEN_BLUE_YELLOW );
INT16 sXCorner = (INT16)(MAP_VIEW_START_X + (cnt * MAP_GRID_X));
INT16 sYCorner = (INT16)(MAP_VIEW_START_Y + (cnt2 * MAP_GRID_Y));
INT16 usXPos, usYPos;
FindFontCenterCoordinates( sXCorner, sYCorner, MAP_GRID_X, MAP_GRID_Y, sString, FONT14ARIAL, &usXPos, &usYPos );
gprintfdirty( usXPos, usYPos, sString );
mprintf( usXPos, usYPos, sString );
}
break;
+1 -1
View File
@@ -2110,7 +2110,7 @@ FLOAT CalcHourlyVolunteerGain()
for ( UINT8 sX = 1; sX < MAP_WORLD_X - 1; ++sX )
{
for ( UINT8 sY = 1; sY < MAP_WORLD_X - 1; ++sY )
for ( UINT8 sY = 1; sY < MAP_WORLD_Y - 1; ++sY )
{
// not if the enemy controls this sector
if ( StrategicMap[CALCULATE_STRATEGIC_INDEX( sX, sY )].fEnemyControlled )
+2 -7
View File
@@ -2178,14 +2178,9 @@ void RenderTiles(UINT32 uiFlags, INT32 iStartPointX_M, INT32 iStartPointY_M, INT
}
}
// ATE: Check here for a lot of conditions!
else if (((uiLevelNodeFlags & LEVELNODE_PHYSICSOBJECT)) && !(uiFlags&TILES_DIRTY))
else if ( (uiLevelNodeFlags & LEVELNODE_PHYSICSOBJECT) && !(uiFlags&TILES_DIRTY) )
{
bItemOutline = TRUE;
if (uiLevelNodeFlags & LEVELNODE_PHYSICSOBJECT)
{
bItemOutline = FALSE;
}
bItemOutline = FALSE;
bBlitClipVal = BltIsClippedOrOffScreen(hVObject, sXPos, sYPos, usImageIndex, &gClippingRect);