Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
majcosta authored and Asdow committed Jan 18, 2023
1 parent 8b1c4ef commit d4abc82
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 93 deletions.
16 changes: 0 additions & 16 deletions Editor/Sector Summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1808,11 +1808,6 @@ void SummaryToggleProgressCallback( GUI_BUTTON *btn, INT32 reason )

#include "Tile Surface.h"

void PerformTest()
{
}


BOOLEAN HandleSummaryInput( InputAtom *pEvent )
{
if( !gfSummaryWindowActive )
Expand All @@ -1838,17 +1833,6 @@ BOOLEAN HandleSummaryInput( InputAtom *pEvent )
else if( gfWorldLoaded )
DestroySummaryWindow();
break;
case F6:
PerformTest();
break;
case F7:
for( x = 0; x < 10; x++ )
PerformTest();
break;
case F8:
for( x = 0; x < 100; x++ )
PerformTest();
break;
case 'y':case 'Y':
if( gusNumEntriesWithOutdatedOrNoSummaryInfo && !gfOutdatedDenied )
{
Expand Down
20 changes: 0 additions & 20 deletions Editor/editscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,6 @@ BOOLEAN EditModeShutdown( void )

RemoveLightPositionHandles( );

MapOptimize();

RemoveCursors();

fHelpScreen = FALSE;
Expand Down Expand Up @@ -3341,24 +3339,6 @@ BOOLEAN CheckForSlantRoofs( void )



//----------------------------------------------------------------------------------------------
// MapOptimize
//
// Runs through all map locations, and if it's outside the visible world, then we remove
// EVERYTHING from it since it will never be seen!
//
// If it can be seen, then we remove all extraneous land tiles. We find the tile that has the first
// FULL TILE indicator, and delete anything that may come after it (it'll never be seen anyway)
//
// Doing the above has shown to free up about 1.1 Megs on the default map. Deletion of non-viewable
// land pieces alone gained us about 600 K of memory.
//
void MapOptimize(void)
{
}



//----------------------------------------------------------------------------------------------
// CheckForFences
//
Expand Down
2 changes: 0 additions & 2 deletions Editor/editscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ void HideEditorToolbar( INT32 iOldTaskMode );

void ProcessSelectionArea();

void MapOptimize(void);

extern UINT16 GenericButtonFillColors[40];

//These go together. The taskbar has a specific color scheme.
Expand Down
3 changes: 0 additions & 3 deletions Standard Gaming Platform/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1609,9 +1609,6 @@ BOOLEAN IsCursorRestricted( void )

void SimulateMouseMovement( UINT32 uiNewXPos, UINT32 uiNewYPos )
{
// 0verhaul:
// The above is a bad hack. Especially in windowed mode. We don't want coords relative to the entire screen in that case.
// So instead, get screen coords and then use the setcursorpos call.
POINT newmouse;
newmouse.x = uiNewXPos;
newmouse.y = uiNewYPos;
Expand Down
2 changes: 0 additions & 2 deletions Strategic/Auto Resolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2204,8 +2204,6 @@ void CreateAutoResolveInterface()
ubRegMilitia += bonusRegularMilitia;
ubGreenMilitia += bonusGreenMilitia;

// This block should be unnecessary. If the counts do not line up, there is a bug.

cnt = 0;
// Add the militia in this sector
ARCreateMilitiaSquad( &cnt, ubEliteMilitia, ubRegMilitia, ubGreenMilitia, gpAR->ubSectorX, gpAR->ubSectorY);
Expand Down
1 change: 0 additions & 1 deletion Strategic/Game Event Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
{

BOOLEAN bMercDayOne = FALSE;
// BF : file access is bad, especially if a function is called so often.
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"ExecuteStrategicEvent");

if( gGameExternalOptions.gfEnableEmergencyButton_SkipStrategicEvents && _KeyDown( NUM_LOCK ) )
Expand Down
6 changes: 6 additions & 0 deletions Strategic/Map Screen Interface Map Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6021,6 +6021,9 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO

FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...

#if JA2TESTVERSION
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", guntemperature, newguntemperature);
#endif

(*itemStack)[i]->data.bTemperature = newguntemperature; // ... set new temperature

Expand All @@ -6038,6 +6041,9 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO

(*iter)[i]->data.bTemperature = newtemperature; // ... set new temperature

#if JA2TESTVERSION
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature);
#endif

// we assume that there can exist only 1 underbarrel weapon per gun
break;
Expand Down
1 change: 0 additions & 1 deletion Tactical/Items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12590,7 +12590,6 @@ UINT16 PickARandomLaunchable(UINT16 itemIndex)
UINT16 usRandom = 0;
UINT16 lowestCoolness = LowestLaunchableCoolness(itemIndex);

// Flugente: the above code is highly dubious.. why do we loop over all items 2 times, and why that obscure usRandom--; business? This can cause an underflow!
BOOLEAN isnight = NightTime();
UINT16 maxcoolness = max( HighestPlayerProgressPercentage() / 10, lowestCoolness );

Expand Down
2 changes: 2 additions & 0 deletions Tactical/LOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5296,6 +5296,8 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
dDeltaX = dEndX - dStartX;
dDeltaY = dEndY - dStartY;
dDeltaZ = dEndZ - dStartZ;
/* see previous commit for historically interesting comment on the reason Distance2D instead
of Distance3D is used here */
d2DDistance = Distance2D( dDeltaX, dDeltaY );
iDistance = (INT32) d2DDistance;

Expand Down
1 change: 0 additions & 1 deletion Tactical/PATHAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@ int AStarPathfinder::GetPath(SOLDIERTYPE *s ,
if (gfDisplayCoverValues && gfDrawPathPoints)
{
SetRenderFlags( RENDER_FLAG_FULL );
// The RenderCoverDebugInfo call is now made by RenderWorld. So don't try to call it here
}
#endif

Expand Down
40 changes: 14 additions & 26 deletions Tactical/Soldier Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3919,8 +3919,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart

if ( !this->flags.fDontChargeAPsForStanceChange )
{
// CHRISL
// SANDRO - APBPConstants[AP_CROUCH] changed to GetAPsCrouch()
if ( UsingNewInventorySystem( ) )
{
if ( usNewState == KNEEL_UP || usNewState == BIGMERC_CROUCH_TRANS_OUTOF )
Expand Down Expand Up @@ -3950,32 +3948,25 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// ATE: If we are NOT waiting for prone down...
if ( this->flags.bTurningFromPronePosition < TURNING_FROM_PRONE_START_UP_FROM_MOVE && !this->flags.fDontChargeAPsForStanceChange )
{
// silversurfer: of course we deduct points for stance changes!
// ATE: Don't do this if we are still 'moving'....
// SANDRO - APBPConstants[AP_PRONE] changed to GetAPsProne()
//if ( this->sGridNo == this->pathing.sFinalDestination || this->pathing.usPathIndex == 0 )
//{
// CHRISL
if ( UsingNewInventorySystem( ) )
if ( UsingNewInventorySystem( ) )
{
if ( usNewState == PRONE_UP )
{
if ( usNewState == PRONE_UP )
{
sAPCost = GetAPsProne( this, TRUE * 2 );
sBPCost = APBPConstants[BP_PRONE] + 2;
}
else
{
sAPCost = GetAPsProne( this, TRUE );
sBPCost = APBPConstants[BP_PRONE] + 1;
}
sAPCost = GetAPsProne( this, TRUE * 2 );
sBPCost = APBPConstants[BP_PRONE] + 2;
}
else
{
sAPCost = GetAPsProne( this, FALSE );
sBPCost = APBPConstants[BP_PRONE];
sAPCost = GetAPsProne( this, TRUE );
sBPCost = APBPConstants[BP_PRONE] + 1;
}
DeductPoints( this, sAPCost, sBPCost );
//}
}
else
{
sAPCost = GetAPsProne( this, FALSE );
sBPCost = APBPConstants[BP_PRONE];
}
DeductPoints( this, sAPCost, sBPCost );
}
this->flags.fDontChargeAPsForStanceChange = FALSE;
break;
Expand Down Expand Up @@ -4311,8 +4302,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InitNewSoldierAnim( UINT16 usNewState, UINT16 usStart
// Reset some animation values
this->flags.fForceShade = FALSE;

// CHECK IF WE ARE AT AN IDLE ACTION

// ATE; For some animations that could use some variations, do so....
if ( usNewState == CHARIOTS_OF_FIRE || usNewState == BODYEXPLODING )
{
Expand Down Expand Up @@ -7114,7 +7103,6 @@ BOOLEAN SOLDIERTYPE::EVENT_InternalGetNewSoldierPath( INT32 sDestGridNo, UINT16
return(FALSE);
}

// we can use the soldier's level here because we don't have pathing across levels right now...
{
iDest = FindBestPath( this, sDestGridNo, this->pathing.bLevel, usMovementAnim, COPYROUTE, fFlags );
fContinue = (iDest != 0);
Expand Down
3 changes: 0 additions & 3 deletions Tactical/Soldier Tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,6 @@ INT8 TileIsClear( SOLDIERTYPE *pSoldier, INT8 bDirection, INT32 sGridNo, INT8 b
pSoldier->flags.fBlockedByAnotherMerc = FALSE;
return( MOVE_TILE_STATIONARY_BLOCKED );
}
else
{
}
}

// Unset flag for blocked by soldier...
Expand Down
3 changes: 0 additions & 3 deletions Tactical/opplist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1383,9 +1383,6 @@ INT16 DistanceVisible(SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
// let tanks see and be seen further (at night)
if ( (ARMED_VEHICLE( pSoldier ) && sDistVisible > 0) || (pSubject && ARMED_VEHICLE( pSubject )) )
{
// 0verhaul: This bit of code 1) seems to have no real reason to exist (MaxDistVisible just calls this function anyway),
// and 2) causes infinite recursion because MaxDistVisible just calls this function, which comes right back here. Just
// add 5 to sDistVisible and go on.
sDistVisible = sDistVisible + 5;
}

Expand Down
8 changes: 0 additions & 8 deletions TileEngine/renderworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,14 +1595,6 @@ void RenderTiles(UINT32 uiFlags, INT32 iStartPointX_M, INT32 iStartPointY_M, INT
fRenderTile = TRUE;
}

// If we are on the struct layer, check for if it's hidden!
if (uiRowFlags & (TILES_STATIC_STRUCTURES | TILES_DYNAMIC_STRUCTURES | TILES_STATIC_SHADOWS | TILES_DYNAMIC_SHADOWS))
{
if (fUseTileElem)
{
}
}

if (fRenderTile)
{
// Set flag to set layer as used
Expand Down
5 changes: 0 additions & 5 deletions Utils/Cursors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1978,8 +1978,3 @@ HVOBJECT GetCursorFileVideoObject( UINT32 uiCursorFile )
{
return( CursorFileDatabase[ uiCursorFile ].hVObject );
}


void SyncPairedCursorFrames( UINT32 uiSrcIndex, UINT32 uiDestIndex )
{
}
2 changes: 0 additions & 2 deletions Utils/Cursors.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ void HandleAnimatedCursors( );
void DrawMouseActionPoints( );
void UpdateAnimatedCursorFrames( UINT32 uiCursorIndex );

void SyncPairedCursorFrames( UINT32 uiSrcCursor, UINT32 uiDestCursor );

void SetCursorSpecialFrame( UINT32 uiCursor, UINT8 ubFrame );

void SetCursorFlags( UINT32 uiCursor, UINT8 ubFlags );
Expand Down

0 comments on commit d4abc82

Please sign in to comment.