SOLDIERTYPE::CreateSoldierCommon to SoldierID

This commit is contained in:
Asdow
2024-11-16 00:18:02 +02:00
parent 8ef7fb5ae4
commit 419b0c794d
6 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -20,16 +20,16 @@ void DetermineOptimumAnimationCacheSize( )
guiCacheSize = MIN_CACHE_SIZE;
}
BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
BOOLEAN InitAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache )
{
UINT32 cnt;
// Allocate entries
AnimDebugMsg( String( "*** Initializing anim cache surface for soldier %d", usSoldierID ) );
AnimDebugMsg( String( "*** Initializing anim cache surface for soldier %d", usSoldierID.i ) );
pAnimCache->usCachedSurfaces = (UINT16 *) MemAlloc( sizeof( UINT16 ) * guiCacheSize );
CHECKF( pAnimCache->usCachedSurfaces!= NULL );
AnimDebugMsg( String( "*** Initializing anim cache hit counter for soldier %d", usSoldierID ) );
AnimDebugMsg( String( "*** Initializing anim cache hit counter for soldier %d", usSoldierID.i ) );
pAnimCache->sCacheHits = (INT16 *) MemAlloc( sizeof( UINT16) * guiCacheSize );
CHECKF( pAnimCache->sCacheHits!= NULL );
@@ -41,7 +41,7 @@ BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnim
}
pAnimCache->ubCacheSize = 0;
// Zero surface databse history for this soldeir
// Zero surface database history for this soldier
ClearAnimationSurfacesUsageHistory( usSoldierID );
return( TRUE );
+3 -3
View File
@@ -1,7 +1,7 @@
#ifndef __ANIMATION_CACHE_H
#define __ANIMATION_CACHE_H
#include "types.h"
#include "Overhead Types.h"
#define MAX_CACHE_SIZE 20
//#define MIN_CACHE_SIZE 2
@@ -19,11 +19,11 @@ typedef struct
extern UINT32 guiCacheSize;
BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache, UINT16 usSurfaceIndex, UINT16 usCurrentAnimation );
BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
BOOLEAN InitAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
void DeleteAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
void DetermineOptimumAnimationCacheSize( );
void UnLoadCachedAnimationSurfaces( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
#endif
#endif
+3 -3
View File
@@ -3468,15 +3468,15 @@ void SelectSoldier( UINT16 usSoldierID, BOOLEAN fAcknowledge, BOOLEAN fForceRese
BOOLEAN ResetAllAnimationCache( )
{
UINT32 cnt;
SOLDIERTYPE *pSoldier;
UINT16 cnt;
SOLDIERTYPE *pSoldier;
// Loop through all mercs and make go
for ( pSoldier = Menptr, cnt = 0; cnt < TOTAL_SOLDIERS; pSoldier++, cnt++ )
{
if ( pSoldier != NULL )
{
InitAnimationCache( (UINT16)cnt, &(pSoldier->AnimCache) );
InitAnimationCache( cnt, &(pSoldier->AnimCache) );
}
+1 -1
View File
@@ -2413,7 +2413,7 @@ void SOLDIERTYPE::DoNinjaAttack( void )
}
BOOLEAN SOLDIERTYPE::CreateSoldierCommon( UINT8 ubBodyType, UINT16 usSoldierID, UINT16 usState )
BOOLEAN SOLDIERTYPE::CreateSoldierCommon( UINT8 ubBodyType, SoldierID usSoldierID, UINT16 usState )
{
BOOLEAN fSuccess = FALSE;
INT32 iCounter = 0;
+1 -1
View File
@@ -1656,7 +1656,7 @@ public:
BOOLEAN CreateSoldierLight( void );
BOOLEAN DeleteSoldierLight( void );
BOOLEAN CreateSoldierCommon( UINT8 ubBodyType, UINT16 usSoldierID, UINT16 usState );
BOOLEAN CreateSoldierCommon( UINT8 ubBodyType, SoldierID usSoldierID, UINT16 usState );
// Soldier Management functions, called by Event Pump.c
+1 -1
View File
@@ -1189,7 +1189,7 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT16
// Copy into merc struct
*MercPtrs[ Soldier.ubID ] = Soldier;
// Alrighty then, we are set to create the merc, stuff after here can fail!
CHECKF( MercPtrs[ Soldier.ubID ]->CreateSoldierCommon( Soldier.ubBodyType, Soldier.ubID, STANDING ) != FALSE );
CHECKF( Soldier.ubID->CreateSoldierCommon( Soldier.ubBodyType, Soldier.ubID, STANDING ) != FALSE );
}
}
else