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
+7 -80
View File
@@ -1029,17 +1029,15 @@ BOOLEAN AddFacesToAutoBandageBox( void )
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; ++iCounter )
{
// find a free slot
if( iDoctorList[ iCounter ] != -1 )
{
if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
if ((iDoctorList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ))
if ((iDoctorList[ iCounter ] != -1) && gMercProfiles[( Menptr[iDoctorList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
@@ -1047,56 +1045,20 @@ BOOLEAN AddFacesToAutoBandageBox( void )
else
{
// grab filename of face
if ((iDoctorList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ))
if ((iDoctorList[ iCounter ] != -1) && gMercProfiles[( Menptr[iDoctorList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
/*
if ( ( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if ( ( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else
{
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
*/
// load the face
// AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] ) )
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
}
iNumberOfDoctors++;
++iNumberOfDoctors;
}
}
@@ -1105,11 +1067,10 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// find a free slot
if( iPatientList[ iCounter ] != -1 )
{
if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
if ((iPatientList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ))
if ((iPatientList[ iCounter ] != -1) && gMercProfiles[( Menptr[iPatientList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
@@ -1117,56 +1078,22 @@ BOOLEAN AddFacesToAutoBandageBox( void )
else
{
// grab filename of face
if ((iPatientList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ))
if ( (iPatientList[ iCounter ] != -1) && gMercProfiles[( Menptr[iPatientList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
/*
if ( ( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if ( ( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ) )
{
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else if(( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
else
{
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
*/
// load the face
// AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] ) )
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
}
}
}
// grab panels
// grab panels
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
sprintf( VObjectDesc.ImageFile, "Interface\\panels.sti" );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giMercPanelImage ) )