New feature: Voicesets are now independent fom profile slots. Voiceset is set in MercProfiles.xml with <usVoiceIndex>. IMP voices are defined in IMPVoices.xml.

This feature is savegame compatible.

Requires GameDir >= r2357

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8364 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-01-14 20:20:11 +00:00
parent e2c05ce1c6
commit efd9ab4723
30 changed files with 425 additions and 462 deletions
+21
View File
@@ -1626,6 +1626,15 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
}
}
}
// Flugente: voice set
if ( guiCurrentSaveGameVersion >= SEPARATE_VOICESETS )
{
if ( !FileRead( hFile, &this->usVoiceIndex, sizeof(UINT32), &uiNumBytesRead ) )
{
return(FALSE);
}
}
}
if ( this->uiProfileChecksum != this->GetChecksum() )
@@ -1731,6 +1740,12 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile)
{
return(FALSE);
}
// Flugente: voice set used
if ( !FileWrite( hFile, &this->usVoiceIndex, sizeof(UINT32), &uiNumBytesWritten ) )
{
return(FALSE);
}
return TRUE;
}
@@ -6677,6 +6692,12 @@ BOOLEAN LoadSavedMercProfiles( HWFILE hFile )
// if not then overwrite with the previously stored data
if ( gMercProfiles[cnt].bLifeMax <= 0 )
gMercProfiles[cnt] = tempMercProfile;
/// Flugente: until the introduction of a separate varriable for the voiceset, the voice was identical with the slot
if ( guiCurrentSaveGameVersion < SEPARATE_VOICESETS )
{
gMercProfiles[cnt].usVoiceIndex = cnt;
}
}
return( TRUE );