Store the profile type in the profile structure and remove superfluous code

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8620 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-09-24 19:36:28 +00:00
parent 8ae2eacfcd
commit 494dbc6e69
41 changed files with 385 additions and 942 deletions
+2 -33
View File
@@ -71,24 +71,16 @@ STR pbCarPortraitFileNames[ ]={
"INTERFACE\\Jeep.sti",
};
// load int he portraits for the car faces that will be use in mapscreen
BOOLEAN LoadCarPortraitValues( void )
{
VOBJECT_DESC VObjectDesc;
/*
if( giCarPortraits[ 0 ] != -1 )
{
return FALSE;
}
*/
for ( INT32 iCounter = 0; iCounter < NUM_PROFILES; ++iCounter )
{
// silversurfer: fixed to make sure that we only create objects for vehicles that have a face defined
// otherwise CHECKF will fail and return FALSE breaking the for loop and ignoring any further vehicles
if ( gProfilesVehicle[ iCounter ].ProfilId == iCounter && gNewVehicle[ iCounter ].szIconFace[0] != 0 )
if ( gMercProfiles[iCounter].Type == PROFILETYPE_VEHICLE && gNewVehicle[ iCounter ].szIconFace[0] != 0 )
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
strcpy( VObjectDesc.ImageFile, gNewVehicle[ iCounter ].szIconFace );
@@ -96,44 +88,21 @@ BOOLEAN LoadCarPortraitValues( void )
}
}
/*
for( iCounter = 0; iCounter < NUMBER_CAR_PORTRAITS; iCounter++ )
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
sprintf( VObjectDesc.ImageFile, pbCarPortraitFileNames[ iCounter ] );
CHECKF( AddVideoObject( &VObjectDesc, (UINT32 *)&giCarPortraits[ iCounter ] ) );
}*/
return( TRUE );
}
// get rid of the images we loaded for the mapscreen car portraits
void UnLoadCarPortraits( void )
{
// car protraits loaded?
/*
if( giCarPortraits[ 0 ] == -1 )
{
return;
}
for( iCounter = 0; iCounter < NUMBER_CAR_PORTRAITS; iCounter++ )
{
DeleteVideoObjectFromIndex( giCarPortraits[ iCounter ] );
giCarPortraits[ iCounter ] = -1;
}
*/
for ( INT32 iCounter = 0; iCounter < NUM_PROFILES; ++iCounter )
{
if ( gProfilesVehicle[ iCounter ].ProfilId == iCounter )
if ( gMercProfiles[iCounter].Type == PROFILETYPE_VEHICLE )
{
DeleteVideoObjectFromIndex( giCarPortraits[ iCounter ] );
}
}
}
void DrawLifeUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer )
{
FLOAT dStart, dEnd, dPercentage;