mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Cleaned up IMP creation code
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8350 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1102,6 +1102,8 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
}
|
||||
#endif
|
||||
|
||||
LoadIMPPortraitsTEMP( );
|
||||
|
||||
// Flugente: soldier profiles
|
||||
if (!is_networked)
|
||||
{
|
||||
@@ -1159,9 +1161,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
num_found_soldier_profiles[5] = num_found_profiles;
|
||||
}
|
||||
}
|
||||
|
||||
LoadIMPPortraitsTEMP();
|
||||
|
||||
|
||||
//Sound profile by jazz
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, SOUNDPROFILE);
|
||||
|
||||
@@ -171,39 +171,20 @@ BOOLEAN RenderFigure();
|
||||
//
|
||||
//*******************************************************************
|
||||
|
||||
|
||||
|
||||
void EnterIMPColorChoice( void )
|
||||
{
|
||||
// UINT32 uiCnt;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
bBigBody = FALSE;
|
||||
bBadAss = FALSE;
|
||||
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
if ( gIMPMaleValues[ iPortraitNumber ].uiIndex == iPortraitNumber && gIMPMaleValues[ iPortraitNumber ].bSex == 0 )
|
||||
{
|
||||
iCurrentSkin = gIMPMaleValues[ iPortraitNumber ].iCurrentSkin;
|
||||
iCurrentHair = gIMPMaleValues[ iPortraitNumber ].iCurrentHair;
|
||||
iCurrentShirt = gIMPMaleValues[ iPortraitNumber ].iCurrentShirt;
|
||||
iCurrentPants = gIMPMaleValues[ iPortraitNumber ].iCurrentPants;
|
||||
bBigBody = gIMPMaleValues[ iPortraitNumber ].bBigBody;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ( gIMPFemaleValues[ iPortraitNumber ].uiIndex == iPortraitNumber && gIMPFemaleValues[ iPortraitNumber ].bSex == 1 )
|
||||
{
|
||||
iCurrentSkin = gIMPFemaleValues[ iPortraitNumber ].iCurrentSkin;
|
||||
iCurrentHair = gIMPFemaleValues[ iPortraitNumber ].iCurrentHair;
|
||||
iCurrentShirt = gIMPFemaleValues[ iPortraitNumber ].iCurrentShirt;
|
||||
iCurrentPants = gIMPFemaleValues[ iPortraitNumber ].iCurrentPants;
|
||||
bBigBody = gIMPFemaleValues[ iPortraitNumber ].bBigBody;
|
||||
}
|
||||
|
||||
}
|
||||
if ( gIMPValues[iPortraitNumber].uiIndex == iPortraitNumber )
|
||||
{
|
||||
iCurrentSkin = gIMPValues[iPortraitNumber].iCurrentSkin;
|
||||
iCurrentHair = gIMPValues[iPortraitNumber].iCurrentHair;
|
||||
iCurrentShirt = gIMPValues[iPortraitNumber].iCurrentShirt;
|
||||
iCurrentPants = gIMPValues[iPortraitNumber].iCurrentPants;
|
||||
bBigBody = gIMPValues[iPortraitNumber].bBigBody;
|
||||
}
|
||||
|
||||
// Based on the portrait chosen, set the default colors, when colors
|
||||
/* switch( iPortraitNumber )
|
||||
@@ -320,9 +301,7 @@ void EnterIMPColorChoice( void )
|
||||
Assert( 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
giIMPColorChoiceFinsihButtonImage = LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 );
|
||||
giIMPColorChoiceFinsihButton = CreateIconAndTextButton( giIMPColorChoiceFinsihButtonImage, pImpButtonText[ 24 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
@@ -330,11 +309,8 @@ void EnterIMPColorChoice( void )
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 350 ), LAPTOP_SCREEN_WEB_UL_Y + ( 340 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPColorChoiceFinishCallback );
|
||||
|
||||
|
||||
|
||||
|
||||
SetButtonCursor( giIMPColorChoiceFinsihButton, CURSOR_WWW);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -588,37 +588,15 @@ UINT32 cnt;
|
||||
// grab face filename
|
||||
// strcpy( gMercProfiles[ LaptopSaveInfo.iIMPIndex ].ubUnusedFaceFileName , pPlayerSelectedFaceFileNames[ iPortraitNumber ]);
|
||||
|
||||
gMercProfiles[LaptopSaveInfo.iIMPIndex].ubFaceIndex = (UINT8)iPortraitNumber;
|
||||
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
//gMercProfiles[ LaptopSaveInfo.iIMPIndex ].ubFaceIndex = 200 + ( UINT8 )iPortraitNumber;
|
||||
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].ubFaceIndex = ( UINT8 )iPortraitNumber;
|
||||
// eyes
|
||||
gMercProfiles[LaptopSaveInfo.iIMPIndex].usEyesX = sFacePositions[gIMPValues[iPortraitNumber].uiEyeXPositions][0];
|
||||
gMercProfiles[LaptopSaveInfo.iIMPIndex].usEyesY = sFacePositions[gIMPValues[iPortraitNumber].uiEyeYPositions][1];
|
||||
|
||||
// eyes
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usEyesX = sFacePositions[ gIMPMaleValues[iPortraitNumber].uiEyeXPositions ][ 0 ];
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usEyesY = sFacePositions[ gIMPMaleValues[iPortraitNumber].uiEyeYPositions ][ 1 ];
|
||||
|
||||
// mouth
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usMouthX = sFacePositions[ gIMPMaleValues[iPortraitNumber].uiMouthXPositions ][ 2 ];
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usMouthY = sFacePositions[ gIMPMaleValues[iPortraitNumber].uiMouthYPositions ][ 3 ];
|
||||
}
|
||||
else
|
||||
{
|
||||
//gMercProfiles[ LaptopSaveInfo.iIMPIndex ].ubFaceIndex = 200 + ( UINT8 )iPortraitNumber;
|
||||
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].ubFaceIndex = ( UINT8 )iPortraitNumber;
|
||||
|
||||
// eyes
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usEyesX = sFacePositions[ gIMPFemaleValues[iPortraitNumber].uiEyeXPositions ][ 0 ];
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usEyesY = sFacePositions[ gIMPFemaleValues[iPortraitNumber].uiEyeYPositions ][ 1 ];
|
||||
|
||||
// mouth
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usMouthX = sFacePositions[ gIMPFemaleValues[iPortraitNumber].uiMouthXPositions ][ 2 ];
|
||||
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usMouthY = sFacePositions[ gIMPFemaleValues[iPortraitNumber].uiMouthYPositions ][ 3 ];
|
||||
|
||||
|
||||
}
|
||||
// mouth
|
||||
gMercProfiles[LaptopSaveInfo.iIMPIndex].usMouthX = sFacePositions[gIMPValues[iPortraitNumber].uiMouthXPositions][2];
|
||||
gMercProfiles[LaptopSaveInfo.iIMPIndex].usMouthY = sFacePositions[gIMPValues[iPortraitNumber].uiMouthYPositions][3];
|
||||
|
||||
// now the offsets
|
||||
/*
|
||||
@@ -634,7 +612,6 @@ UINT32 cnt;
|
||||
*/
|
||||
// set merc skins and hair color
|
||||
SetMercSkinAndHairColors( );
|
||||
return;
|
||||
}
|
||||
|
||||
void SetMercSkinAndHairColors( void )
|
||||
|
||||
+11
-71
@@ -69,10 +69,7 @@ UINT32 giIMPConfirmButton[ 2 ];
|
||||
UINT32 giIMPConfirmButtonImage[ 2 ];
|
||||
BOOLEAN fNoAlreadySelected = FALSE;
|
||||
|
||||
IMP_FACE_VALUES gIMPFaceValues[NUM_PROFILES];
|
||||
|
||||
IMP_FEMALE_VALUES gIMPFemaleValues[NUM_PROFILES];
|
||||
IMP_MALE_VALUES gIMPMaleValues[NUM_PROFILES];
|
||||
IMP_VALUES gIMPValues[NUM_PROFILES];
|
||||
|
||||
/*
|
||||
UINT16 uiEyeXPositions[ ]={
|
||||
@@ -253,10 +250,8 @@ void DestroyConfirmButtons( void )
|
||||
|
||||
BOOLEAN AddCharacterToPlayersTeam( void )
|
||||
{
|
||||
|
||||
MERC_HIRE_STRUCT HireMercStruct;
|
||||
|
||||
|
||||
// last minute chage to make sure merc with right facehas not only the right body but body specific skills...
|
||||
// ie..small mercs have martial arts..but big guys and women don't don't
|
||||
|
||||
@@ -272,7 +267,6 @@ BOOLEAN AddCharacterToPlayersTeam( void )
|
||||
GiveItemsToPC( HireMercStruct.ubProfileID );
|
||||
}
|
||||
|
||||
|
||||
HireMercStruct.sSectorX = gsMercArriveSectorX;
|
||||
HireMercStruct.sSectorY = gsMercArriveSectorY;
|
||||
HireMercStruct.fUseLandingZoneForArrival = TRUE;
|
||||
@@ -285,38 +279,23 @@ BOOLEAN AddCharacterToPlayersTeam( void )
|
||||
HireMercStruct.ubInsertionCode = INSERTION_CODE_ARRIVING_GAME;
|
||||
HireMercStruct.uiTimeTillMercArrives = GetMercArrivalTimeOfDay( );
|
||||
|
||||
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
if ( gIMPMaleValues[ iPortraitNumber ].PortraitId !=0 )
|
||||
{
|
||||
SetProfileFaceData( HireMercStruct.ubProfileID , (UINT8)(gIMPMaleValues[ iPortraitNumber ].PortraitId), gIMPMaleValues[ iPortraitNumber ].uiEyeXPositions, gIMPMaleValues[ iPortraitNumber ].uiEyeYPositions, gIMPMaleValues[ iPortraitNumber ].uiMouthXPositions, gIMPMaleValues[ iPortraitNumber ].uiMouthYPositions );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( gIMPFemaleValues[ iPortraitNumber ].PortraitId !=0 )
|
||||
{
|
||||
SetProfileFaceData( HireMercStruct.ubProfileID , (UINT8)(gIMPFemaleValues[ iPortraitNumber ].PortraitId), gIMPFemaleValues[ iPortraitNumber ].uiEyeXPositions, gIMPFemaleValues[ iPortraitNumber ].uiEyeYPositions, gIMPFemaleValues[ iPortraitNumber ].uiMouthXPositions, gIMPFemaleValues[ iPortraitNumber ].uiMouthYPositions );
|
||||
}
|
||||
}
|
||||
|
||||
if ( gIMPValues[iPortraitNumber].PortraitId != 0 )
|
||||
{
|
||||
SetProfileFaceData( HireMercStruct.ubProfileID, (UINT8)(gIMPValues[iPortraitNumber].PortraitId), gIMPValues[iPortraitNumber].uiEyeXPositions, gIMPValues[iPortraitNumber].uiEyeYPositions, gIMPValues[iPortraitNumber].uiMouthXPositions, gIMPValues[iPortraitNumber].uiMouthYPositions );
|
||||
}
|
||||
|
||||
//if we succesfully hired the merc
|
||||
if( !HireMerc( &HireMercStruct ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( TRUE );
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
void BtnIMPConfirmYes(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
|
||||
// btn callback for IMP Homepage About US button
|
||||
if (!(btn->uiFlags & BUTTON_ENABLED))
|
||||
return;
|
||||
@@ -392,7 +371,6 @@ void BtnIMPConfirmYes(GUI_BUTTON *btn,INT32 reason)
|
||||
LaptopSaveInfo.sLastHiredMerc.iIdOfMerc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// fixed? by CJC Nov 28 2002
|
||||
@@ -1626,50 +1604,12 @@ void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID )
|
||||
return;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usEyesY = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeYPositions;
|
||||
|
||||
gMercProfiles[ ubMercProfileID ].usMouthX = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthYPositions;
|
||||
*/
|
||||
|
||||
/*
|
||||
if( gMercProfiles[ ubMercProfileID ].bSex == 0 )
|
||||
{
|
||||
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usEyesY = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeYPositions;
|
||||
|
||||
gMercProfiles[ ubMercProfileID ].usMouthX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthYPositions;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usEyesY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeYPositions;
|
||||
|
||||
gMercProfiles[ ubMercProfileID ].usMouthX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthYPositions;
|
||||
}
|
||||
*/
|
||||
|
||||
if( gMercProfiles[ ubMercProfileID ].bSex == 0 )
|
||||
{
|
||||
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usEyesY = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeYPositions;
|
||||
|
||||
gMercProfiles[ ubMercProfileID ].usMouthX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthYPositions;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usEyesY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeYPositions;
|
||||
|
||||
gMercProfiles[ ubMercProfileID ].usMouthX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthXPositions;
|
||||
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthYPositions;
|
||||
}
|
||||
gMercProfiles[ubMercProfileID].usEyesX = gIMPValues[gMercProfiles[ubMercProfileID].ubFaceIndex].uiEyeXPositions;
|
||||
gMercProfiles[ubMercProfileID].usEyesY = gIMPValues[gMercProfiles[ubMercProfileID].ubFaceIndex].uiEyeYPositions;
|
||||
|
||||
gMercProfiles[ubMercProfileID].usMouthX = gIMPValues[gMercProfiles[ubMercProfileID].ubFaceIndex].uiMouthXPositions;
|
||||
gMercProfiles[ubMercProfileID].usMouthY = gIMPValues[gMercProfiles[ubMercProfileID].ubFaceIndex].uiMouthYPositions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-29
@@ -26,15 +26,10 @@ typedef struct
|
||||
INT32 iCurrentPants;
|
||||
BOOLEAN bBigBody;
|
||||
BOOLEAN bBadAss;
|
||||
|
||||
} IMP_FACE_VALUES;
|
||||
|
||||
extern IMP_FACE_VALUES gIMPFaceValues[NUM_PROFILES];
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 uiIndexIMP;
|
||||
BOOLEAN Enabled;
|
||||
|
||||
UINT16 uiEyeXPositions;
|
||||
@@ -52,31 +47,9 @@ typedef struct
|
||||
BOOLEAN bBigBody;
|
||||
BOOLEAN bBadAss;
|
||||
|
||||
} IMP_MALE_VALUES;
|
||||
} IMP_VALUES;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 uiIndexIMP;
|
||||
BOOLEAN Enabled;
|
||||
|
||||
UINT16 uiEyeXPositions;
|
||||
UINT16 uiEyeYPositions;
|
||||
UINT16 uiMouthXPositions;
|
||||
UINT16 uiMouthYPositions;
|
||||
UINT16 uiIndex;
|
||||
UINT16 FaceIndex;
|
||||
UINT16 PortraitId;
|
||||
BOOLEAN bSex;
|
||||
INT32 iCurrentSkin;
|
||||
INT32 iCurrentHair;
|
||||
INT32 iCurrentShirt;
|
||||
INT32 iCurrentPants;
|
||||
BOOLEAN bBigBody;
|
||||
BOOLEAN bBadAss;
|
||||
} IMP_FEMALE_VALUES;
|
||||
|
||||
extern IMP_FEMALE_VALUES gIMPFemaleValues[NUM_PROFILES];
|
||||
extern IMP_MALE_VALUES gIMPMaleValues[NUM_PROFILES];
|
||||
extern IMP_VALUES gIMPValues[NUM_PROFILES];
|
||||
|
||||
BOOLEAN AddCharacterToPlayersTeam( void );
|
||||
BOOLEAN LoadImpCharacter( STR fileName );
|
||||
|
||||
+5
-22
@@ -660,25 +660,11 @@ BOOLEAN LoadCharacterPortrait( void )
|
||||
// load it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
if ( gIMPMaleValues[ iPortraitNumber ].Enabled == 1 )
|
||||
{
|
||||
//sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( gIMPFemaleValues[ iPortraitNumber ].Enabled == 1 )
|
||||
{
|
||||
//sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
|
||||
}
|
||||
}
|
||||
|
||||
//FilenameForBPP( pPlayerSelectedFaceFileNames[ iPortraitNumber ] , VObjectDesc.ImageFile);
|
||||
if ( gIMPValues[iPortraitNumber].Enabled == 1 )
|
||||
{
|
||||
//sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPValues[iPortraitNumber].PortraitId );
|
||||
}
|
||||
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiCHARACTERPORTRAIT));
|
||||
|
||||
@@ -690,9 +676,6 @@ void DestroyCharacterPortrait( void )
|
||||
{
|
||||
// remove the portrait that was loaded by loadcharacterportrait
|
||||
DeleteVideoObjectFromIndex( guiCHARACTERPORTRAIT );
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-18
@@ -1118,27 +1118,14 @@ BOOLEAN LoadCharacterPortraitForMainPage( void )
|
||||
// load it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
if( fCharacterIsMale )
|
||||
if ( gIMPValues[iPortraitNumber].Enabled == 1 )
|
||||
{
|
||||
if ( gIMPMaleValues[ iPortraitNumber ].Enabled == 1 )
|
||||
{
|
||||
// sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
|
||||
}
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPValues[iPortraitNumber].PortraitId );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( gIMPFemaleValues[ iPortraitNumber ].Enabled == 1 )
|
||||
{
|
||||
//sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
|
||||
}
|
||||
}
|
||||
//FilenameForBPP( pPlayerSelectedFaceFileNames[ iPortraitNumber ] , VObjectDesc.ImageFile);
|
||||
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiCHARACTERPORTRAITFORMAINPAGE));
|
||||
|
||||
|
||||
|
||||
// now specify
|
||||
SpecifyButtonIcon( giIMPMainPageButton[4], guiCHARACTERPORTRAITFORMAINPAGE, 0,
|
||||
33, 23, FALSE );
|
||||
@@ -1147,8 +1134,6 @@ BOOLEAN LoadCharacterPortraitForMainPage( void )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOLEAN IMP_CanWeDisplayPortrait( )
|
||||
{
|
||||
if( iCurrentProfileMode == IMP__VOICE ||
|
||||
|
||||
+51
-169
@@ -52,27 +52,28 @@ void BtnIMPPortraitDoneCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
|
||||
void EnterIMPPortraits( void )
|
||||
{
|
||||
|
||||
iCurrentPortrait = 0;
|
||||
// create buttons
|
||||
|
||||
// Flugente: for safety, make sure we have a pic of the fitting gender
|
||||
// this will lead to a loop if there is no data for a gender - then again, this was always the case
|
||||
if ( gIMPValues[iCurrentPortrait].bSex == fCharacterIsMale )
|
||||
{
|
||||
IncrementPictureIndex( );
|
||||
}
|
||||
|
||||
// create buttons
|
||||
CreateIMPPortraitButtons( );
|
||||
|
||||
// render background
|
||||
RenderIMPPortraits( );
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void RenderIMPPortraits( void )
|
||||
{
|
||||
|
||||
|
||||
// render background
|
||||
RenderProfileBackGround( );
|
||||
|
||||
// the Voices frame
|
||||
// the Voices frame
|
||||
RenderPortraitFrame( 191, 167 );
|
||||
|
||||
// render the current portrait
|
||||
@@ -83,34 +84,26 @@ void RenderIMPPortraits( void )
|
||||
|
||||
// text
|
||||
PrintImpText( );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void ExitIMPPortraits( void )
|
||||
{
|
||||
// destroy buttons for IMP portrait page
|
||||
DestroyIMPPortraitButtons( );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void HandleIMPPortraits( void )
|
||||
{
|
||||
|
||||
// do we need to re write screen
|
||||
if ( fReDrawPortraitScreenFlag == TRUE )
|
||||
{
|
||||
RenderIMPPortraits( );
|
||||
RenderIMPPortraits( );
|
||||
|
||||
// reset redraw flag
|
||||
fReDrawPortraitScreenFlag = FALSE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN RenderPortrait( INT16 sX, INT16 sY )
|
||||
{
|
||||
// render the portrait of the current picture
|
||||
@@ -118,161 +111,74 @@ BOOLEAN RenderPortrait( INT16 sX, INT16 sY )
|
||||
HVOBJECT hHandle;
|
||||
UINT32 uiGraphicHandle;
|
||||
|
||||
if( fCharacterIsMale )
|
||||
// load it
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
if ( gIMPValues[iCurrentPortrait].Enabled == 1 )
|
||||
{
|
||||
///sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPMaleValues[ iCurrentPortrait ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\BigFaces\\%02d.sti", gIMPValues[iCurrentPortrait].PortraitId );
|
||||
}
|
||||
|
||||
// load it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
|
||||
if ( gIMPMaleValues[ iCurrentPortrait ].Enabled == 1 )
|
||||
{
|
||||
///sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPMaleValues[ iCurrentPortrait ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\BigFaces\\%02d.sti", gIMPMaleValues[ iCurrentPortrait ].PortraitId );
|
||||
}
|
||||
|
||||
|
||||
//FilenameForBPP( pPlayerSelectedBigFaceFileNames[ iCurrentPortrait ] , VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiGraphicHandle));
|
||||
CHECKF( AddVideoObject( &VObjectDesc, &uiGraphicHandle ) );
|
||||
|
||||
// show it
|
||||
GetVideoObject(&hHandle, uiGraphicHandle);
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + sX, LAPTOP_SCREEN_WEB_UL_Y + sY , VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
|
||||
GetVideoObject( &hHandle, uiGraphicHandle );
|
||||
BltVideoObject( FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + sX, LAPTOP_SCREEN_WEB_UL_Y + sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
// and kick it's sorry ..umm never mind, outta here
|
||||
DeleteVideoObjectFromIndex( uiGraphicHandle );
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// load it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
//FilenameForBPP( pPlayerSelectedBigFaceFileNames[ iCurrentPortrait + 8 ] , VObjectDesc.ImageFile);
|
||||
|
||||
if ( gIMPFemaleValues[ iCurrentPortrait ].Enabled == 1 )
|
||||
{
|
||||
// sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPFemaleValues[ iCurrentPortrait ].PortraitId );
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\BigFaces\\%02d.sti", gIMPFemaleValues[ iCurrentPortrait ].PortraitId );
|
||||
}
|
||||
|
||||
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiGraphicHandle));
|
||||
|
||||
// show it
|
||||
GetVideoObject(&hHandle, uiGraphicHandle);
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + sX, LAPTOP_SCREEN_WEB_UL_Y + sY , VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
|
||||
// and kick it's sorry ..umm never mind, outta here
|
||||
DeleteVideoObjectFromIndex( uiGraphicHandle );
|
||||
|
||||
}
|
||||
|
||||
return ( TRUE );
|
||||
}
|
||||
|
||||
void IncrementPictureIndex( void )
|
||||
{
|
||||
|
||||
iCurrentPortrait++;
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
if( gIMPMaleValues[iCurrentPortrait].uiIndex == iCurrentPortrait && gIMPMaleValues[iCurrentPortrait].PortraitId !=0 )
|
||||
++iCurrentPortrait;
|
||||
|
||||
if ( gIMPValues[iCurrentPortrait].uiIndex == iCurrentPortrait && gIMPValues[iCurrentPortrait].PortraitId != 0 )
|
||||
{
|
||||
iCurrentPortrait = gIMPMaleValues[iCurrentPortrait].uiIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentPortrait = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( gIMPFemaleValues[iCurrentPortrait].uiIndex == iCurrentPortrait && gIMPFemaleValues[iCurrentPortrait].PortraitId !=0 )
|
||||
{
|
||||
iCurrentPortrait = gIMPFemaleValues[iCurrentPortrait].uiIndex;
|
||||
iCurrentPortrait = gIMPValues[iCurrentPortrait].uiIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentPortrait = 0;
|
||||
}
|
||||
|
||||
}
|
||||
// cycle to next picture
|
||||
/*
|
||||
iCurrentPortrait++;
|
||||
|
||||
// gone too far?
|
||||
if( iCurrentPortrait > iLastPicture )
|
||||
// if gender of face is wrong, repeat process
|
||||
if ( gIMPValues[iCurrentPortrait].bSex == fCharacterIsMale )
|
||||
{
|
||||
iCurrentPortrait = 0;
|
||||
IncrementPictureIndex( );
|
||||
}
|
||||
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
void DecrementPicture( void )
|
||||
{
|
||||
UINT32 cnt;
|
||||
UINT32 idPort = 0;
|
||||
--iCurrentPortrait;
|
||||
|
||||
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
for ( cnt = 0; cnt < MAX_NEW_IMP_PORTRAITS; cnt++ )
|
||||
{
|
||||
if ( gIMPMaleValues[cnt].uiIndex == cnt && gIMPMaleValues[cnt].PortraitId !=0 )
|
||||
{
|
||||
iLastPictureM = gIMPMaleValues[cnt].uiIndex;
|
||||
}
|
||||
}
|
||||
|
||||
iLastPicture = iLastPictureM;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( cnt = 0; cnt < MAX_NEW_IMP_PORTRAITS; cnt++ )
|
||||
if ( iCurrentPortrait < 0 )
|
||||
{
|
||||
for ( UINT32 cnt = 0; cnt < MAX_NEW_IMP_PORTRAITS; cnt++ )
|
||||
{
|
||||
if ( gIMPFemaleValues[cnt].uiIndex == cnt && gIMPFemaleValues[cnt].PortraitId !=0 )
|
||||
{
|
||||
iLastPictureF = gIMPFemaleValues[cnt].uiIndex;
|
||||
}
|
||||
if ( gIMPValues[cnt].uiIndex == cnt && gIMPValues[cnt].PortraitId != 0 )
|
||||
{
|
||||
iLastPictureM = gIMPValues[cnt].uiIndex;
|
||||
}
|
||||
}
|
||||
|
||||
iLastPicture = iLastPictureF;
|
||||
}
|
||||
|
||||
iCurrentPortrait--;
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
if( iCurrentPortrait < 0 )
|
||||
{
|
||||
iCurrentPortrait = iLastPicture;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentPortrait < 0 )
|
||||
{
|
||||
iLastPicture = iLastPictureM;
|
||||
|
||||
iCurrentPortrait = iLastPicture;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
// gone too far?
|
||||
if( iCurrentPortrait < 0 )
|
||||
// if gender of face is wrong, repeat process
|
||||
if ( gIMPValues[iCurrentPortrait].bSex == fCharacterIsMale )
|
||||
{
|
||||
iCurrentPortrait = iLastPicture;
|
||||
DecrementPicture();
|
||||
}
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void CreateIMPPortraitButtons( void )
|
||||
{
|
||||
// will create buttons need for the IMP portrait screen
|
||||
@@ -317,19 +223,14 @@ void CreateIMPPortraitButtons( void )
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 187 ), LAPTOP_SCREEN_WEB_UL_Y + ( 330 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPPortraitDoneCallback);
|
||||
|
||||
|
||||
|
||||
|
||||
SetButtonCursor(giIMPPortraitButton[0], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPPortraitButton[1], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPPortraitButton[2], CURSOR_WWW);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DestroyIMPPortraitButtons( void )
|
||||
{
|
||||
|
||||
// will destroy buttons created for IMP Portrait screen
|
||||
|
||||
// the next button
|
||||
@@ -343,14 +244,10 @@ void DestroyIMPPortraitButtons( void )
|
||||
// the done button
|
||||
RemoveButton(giIMPPortraitButton[ 2 ] );
|
||||
UnloadButtonImage(giIMPPortraitButtonImage[ 2 ] );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void BtnIMPPortraitNextCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
|
||||
// btn callback for IMP attrbite begin button
|
||||
if (!(btn->uiFlags & BUTTON_ENABLED))
|
||||
return;
|
||||
@@ -363,7 +260,7 @@ void BtnIMPPortraitNextCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
// next picture!!
|
||||
IncrementPictureIndex( );
|
||||
@@ -375,7 +272,6 @@ void BtnIMPPortraitNextCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
void BtnIMPPortraitPreviousCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
|
||||
// btn callback for IMP attrbite begin button
|
||||
if (!(btn->uiFlags & BUTTON_ENABLED))
|
||||
return;
|
||||
@@ -388,7 +284,7 @@ void BtnIMPPortraitPreviousCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
// previous picture, please!!!
|
||||
DecrementPicture( );
|
||||
@@ -400,7 +296,6 @@ void BtnIMPPortraitPreviousCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
void BtnIMPPortraitDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
|
||||
// btn callback for IMP attrbite begin button
|
||||
if (!(btn->uiFlags & BUTTON_ENABLED))
|
||||
return;
|
||||
@@ -413,12 +308,11 @@ void BtnIMPPortraitDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
|
||||
// Changed to go to voice selection after portrait selection - SANDRO
|
||||
iCurrentImpPage = IMP_VOICE;
|
||||
// Following part has been cut out
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
// Changed to go to voice selection after portrait selection - SANDRO
|
||||
iCurrentImpPage = IMP_VOICE;
|
||||
// Following part has been cut out
|
||||
|
||||
// go to main page
|
||||
//iCurrentImpPage = IMP_MAIN_PAGE;
|
||||
@@ -449,25 +343,13 @@ void BtnIMPPortraitDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
// grab picture number
|
||||
|
||||
iPortraitNumber = gIMPValues[iCurrentPortrait].uiIndex; //iCurrentPortrait
|
||||
|
||||
|
||||
if( fCharacterIsMale )
|
||||
{
|
||||
// male
|
||||
iPortraitNumber = gIMPMaleValues[ iCurrentPortrait ].uiIndex; //iCurrentPortrait
|
||||
}
|
||||
else
|
||||
{
|
||||
// female
|
||||
iPortraitNumber = gIMPFemaleValues[ iCurrentPortrait ].uiIndex; //iCurrentPortrait ;//+ ( 8 );
|
||||
}
|
||||
|
||||
fButtonPendingFlag = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN CameBackToPortraitsPageButNotFinished()
|
||||
{
|
||||
//if we are in a page that comes after this one
|
||||
|
||||
+36
-88
@@ -28,6 +28,8 @@ typedef impPortraitsParseData;
|
||||
|
||||
BOOLEAN IMPPortraits_TextOnly;
|
||||
|
||||
IMP_FACE_VALUES gIMPFaceValues[NUM_PROFILES];
|
||||
|
||||
static void XMLCALL
|
||||
impPortraitsStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
@@ -70,7 +72,6 @@ impPortraitsStartElementHandle(void *userData, const XML_Char *name, const XML_C
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
@@ -79,13 +80,12 @@ impPortraitsCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
impPortraitsParseData * pData = (impPortraitsParseData *)userData;
|
||||
|
||||
if( (pData->currentDepth <= pData->maxReadDepth) &&
|
||||
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
|
||||
){
|
||||
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH) )
|
||||
{
|
||||
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void XMLCALL
|
||||
impPortraitsEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
@@ -101,37 +101,17 @@ impPortraitsEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
if (!IMPPortraits_TextOnly)
|
||||
{
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiEyeXPositions = pData->curIMPPortraits.uiEyeXPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiEyeYPositions = pData->curIMPPortraits.uiEyeYPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiMouthXPositions = pData->curIMPPortraits.uiMouthXPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiMouthYPositions = pData->curIMPPortraits.uiMouthYPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].PortraitId = pData->curIMPPortraits.PortraitId;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].bSex = pData->curIMPPortraits.bSex;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentSkin = pData->curIMPPortraits.iCurrentSkin;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentShirt = pData->curIMPPortraits.iCurrentShirt;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentHair = pData->curIMPPortraits.iCurrentHair;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentPants = pData->curIMPPortraits.iCurrentPants;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].bBigBody = pData->curIMPPortraits.bBigBody;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiEyeXPositions = pData->curIMPPortraits.uiEyeXPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiEyeYPositions = pData->curIMPPortraits.uiEyeYPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiMouthXPositions = pData->curIMPPortraits.uiMouthXPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiMouthYPositions = pData->curIMPPortraits.uiMouthYPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].PortraitId = pData->curIMPPortraits.PortraitId;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].bSex = pData->curIMPPortraits.bSex;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentSkin = pData->curIMPPortraits.iCurrentSkin;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentShirt = pData->curIMPPortraits.iCurrentShirt;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentHair = pData->curIMPPortraits.iCurrentHair;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentPants = pData->curIMPPortraits.iCurrentPants;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].bBigBody = pData->curIMPPortraits.bBigBody;
|
||||
|
||||
}
|
||||
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiEyeXPositions = pData->curIMPPortraits.uiEyeXPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiEyeYPositions = pData->curIMPPortraits.uiEyeYPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiMouthXPositions = pData->curIMPPortraits.uiMouthXPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].uiMouthYPositions = pData->curIMPPortraits.uiMouthYPositions;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].PortraitId = pData->curIMPPortraits.PortraitId;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].bSex = pData->curIMPPortraits.bSex;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentSkin = pData->curIMPPortraits.iCurrentSkin;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentShirt = pData->curIMPPortraits.iCurrentShirt;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentHair = pData->curIMPPortraits.iCurrentHair;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].iCurrentPants = pData->curIMPPortraits.iCurrentPants;
|
||||
gIMPFaceValues[pData->curIMPPortraits.uiIndex].bBigBody = pData->curIMPPortraits.bBigBody;
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
@@ -231,16 +211,13 @@ BOOLEAN ReadInIMPPortraits(STR fileName, BOOLEAN localizedVersion)
|
||||
lpcBuffer[uiFSize] = 0; //add a null terminator
|
||||
|
||||
FileClose( hFile );
|
||||
|
||||
|
||||
|
||||
XML_SetElementHandler(parser, impPortraitsStartElementHandle, impPortraitsEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, impPortraitsCharacterDataHandle);
|
||||
|
||||
|
||||
|
||||
memset(&pData,0,sizeof(pData));
|
||||
XML_SetUserData(parser, &pData);
|
||||
|
||||
|
||||
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||
{
|
||||
CHAR8 errorBuf[511];
|
||||
@@ -254,62 +231,33 @@ BOOLEAN ReadInIMPPortraits(STR fileName, BOOLEAN localizedVersion)
|
||||
|
||||
MemFree(lpcBuffer);
|
||||
|
||||
|
||||
XML_ParserFree(parser);
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
void LoadIMPPortraitsTEMP()
|
||||
{
|
||||
UINT32 cnt;
|
||||
UINT32 cnt2 = 0;
|
||||
UINT32 cnt3 = 0;
|
||||
UINT32 cnt2 = 0;
|
||||
|
||||
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||
for ( UINT32 cnt = 0; cnt < NUM_PROFILES; ++cnt )
|
||||
{
|
||||
if ( gIMPFaceValues[cnt].PortraitId !=0)
|
||||
{
|
||||
if (gIMPFaceValues[cnt].bSex == 1 && gIMPFaceValues[cnt].PortraitId !=0)
|
||||
{
|
||||
gIMPFemaleValues[cnt2].uiIndex = cnt2;
|
||||
|
||||
gIMPFemaleValues[cnt2].Enabled = 1;
|
||||
|
||||
gIMPFemaleValues[cnt2].uiEyeXPositions = gIMPFaceValues[cnt].uiEyeXPositions;
|
||||
gIMPFemaleValues[cnt2].uiEyeYPositions = gIMPFaceValues[cnt].uiEyeYPositions;
|
||||
gIMPFemaleValues[cnt2].uiMouthXPositions = gIMPFaceValues[cnt].uiMouthXPositions;
|
||||
gIMPFemaleValues[cnt2].uiMouthYPositions = gIMPFaceValues[cnt].uiMouthYPositions;
|
||||
gIMPFemaleValues[cnt2].PortraitId = gIMPFaceValues[cnt].PortraitId;
|
||||
gIMPFemaleValues[cnt2].bSex = gIMPFaceValues[cnt].bSex;
|
||||
gIMPFemaleValues[cnt2].iCurrentSkin = gIMPFaceValues[cnt].iCurrentSkin;
|
||||
gIMPFemaleValues[cnt2].iCurrentShirt = gIMPFaceValues[cnt].iCurrentShirt;
|
||||
gIMPFemaleValues[cnt2].iCurrentHair = gIMPFaceValues[cnt].iCurrentHair;
|
||||
gIMPFemaleValues[cnt2].iCurrentPants = gIMPFaceValues[cnt].iCurrentPants;
|
||||
gIMPFemaleValues[cnt2].bBigBody = gIMPFaceValues[cnt].bBigBody;
|
||||
cnt2++;
|
||||
}
|
||||
}
|
||||
|
||||
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||
{
|
||||
if (gIMPFaceValues[cnt].bSex == 0 && gIMPFaceValues[cnt].PortraitId !=0)
|
||||
{
|
||||
gIMPMaleValues[cnt3].uiIndex = cnt3;
|
||||
gIMPMaleValues[cnt3].Enabled = 1;
|
||||
gIMPMaleValues[cnt3].uiEyeXPositions = gIMPFaceValues[cnt].uiEyeXPositions;
|
||||
gIMPMaleValues[cnt3].uiEyeYPositions = gIMPFaceValues[cnt].uiEyeYPositions;
|
||||
gIMPMaleValues[cnt3].uiMouthXPositions = gIMPFaceValues[cnt].uiMouthXPositions;
|
||||
gIMPMaleValues[cnt3].uiMouthYPositions = gIMPFaceValues[cnt].uiMouthYPositions;
|
||||
gIMPMaleValues[cnt3].PortraitId = gIMPFaceValues[cnt].PortraitId;
|
||||
gIMPMaleValues[cnt3].bSex = gIMPFaceValues[cnt].bSex;
|
||||
gIMPMaleValues[cnt3].iCurrentSkin = gIMPFaceValues[cnt].iCurrentSkin;
|
||||
gIMPMaleValues[cnt3].iCurrentShirt = gIMPFaceValues[cnt].iCurrentShirt;
|
||||
gIMPMaleValues[cnt3].iCurrentHair = gIMPFaceValues[cnt].iCurrentHair;
|
||||
gIMPMaleValues[cnt3].iCurrentPants = gIMPFaceValues[cnt].iCurrentPants;
|
||||
gIMPMaleValues[cnt3].bBigBody = gIMPFaceValues[cnt].bBigBody;
|
||||
cnt3++;
|
||||
}
|
||||
gIMPValues[cnt2].uiIndex = cnt2;
|
||||
gIMPValues[cnt2].Enabled = 1;
|
||||
gIMPValues[cnt2].uiEyeXPositions = gIMPFaceValues[cnt].uiEyeXPositions;
|
||||
gIMPValues[cnt2].uiEyeYPositions = gIMPFaceValues[cnt].uiEyeYPositions;
|
||||
gIMPValues[cnt2].uiMouthXPositions = gIMPFaceValues[cnt].uiMouthXPositions;
|
||||
gIMPValues[cnt2].uiMouthYPositions = gIMPFaceValues[cnt].uiMouthYPositions;
|
||||
gIMPValues[cnt2].PortraitId = gIMPFaceValues[cnt].PortraitId;
|
||||
gIMPValues[cnt2].bSex = gIMPFaceValues[cnt].bSex;
|
||||
gIMPValues[cnt2].iCurrentSkin = gIMPFaceValues[cnt].iCurrentSkin;
|
||||
gIMPValues[cnt2].iCurrentShirt = gIMPFaceValues[cnt].iCurrentShirt;
|
||||
gIMPValues[cnt2].iCurrentHair = gIMPFaceValues[cnt].iCurrentHair;
|
||||
gIMPValues[cnt2].iCurrentPants = gIMPFaceValues[cnt].iCurrentPants;
|
||||
gIMPValues[cnt2].bBigBody = gIMPFaceValues[cnt].bBigBody;
|
||||
++cnt2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user