Brief: //dnl ch75

- More map editor fixes and map inventory pool performance improvement for big maps.
Details:
- Fix not showing expected messagebox on exit (ALT+x) which also throw exception and goes to improper mapeditor exit.
- Fix second annoying sticky message which shouldn't popup during map loading and performing RemoveProhibitedAttachments.
- Fix CTD when delete all enemies or civilians or all of them in map.
- Fix some std exception when reporting for missing optional xml file.
- Fix memory and map corruption in old mapeditors if loaded old map has item with invalid attachment and we try to attach something else.
- As years ago pInventoryPoolList had migrated from WORLDITEM* array to std::vector<WORLDITEM> it was time to do that with gWorldItems too, all necessary functions which need to be adopted to gWorldItems std::vector type are also changed.
- Resize code for gWorldItems is changed hoping will lead into less corruption problems as now could occur in mapeditor and game when code automatically doing attachment changes.
- Change code for handling map inventory which now should be fast enough to support AIMNAS project which will probably deal with thousands of items per map.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6554 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-11-03 16:26:30 +00:00
parent 0c82c1845f
commit b91bc7b209
24 changed files with 593 additions and 711 deletions
+41 -2
View File
@@ -7394,8 +7394,29 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
case ')':
SelectAllCharactersInSquad( 19 ); // internal squad #s start at 0
break;
case '\''://dnl ch75 021113
#ifdef _DEBUG
// temporary add soldiers to your list for equipment inspection and general testing
for(UINT32 ubLoop=0; ubLoop<guiNumMercSlots&&gGameExternalOptions.fEnableInventoryPoolQ; ubLoop++)
{
if(MercSlots[ubLoop] != NULL && MercSlots[ubLoop]->bTeam == ENEMY_TEAM && MercSlots[ubLoop]->bActive)
{
for(int i=0; i<CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; i++)
{
if(gCharactersList[i].usSolID == MercSlots[ubLoop]->ubID)
break;
if(gCharactersList[i].usSolID == 0 && gCharactersList[i].fValid == FALSE)
{
gCharactersList[i].usSolID = MercSlots[ubLoop]->ubID;
gCharactersList[i].fValid = TRUE;
break;
}
}
}
}
fTeamPanelDirty = TRUE;
#endif
break;
case 'a':
if( fAlt )
{
@@ -7881,6 +7902,24 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
}
#endif
break;
case 'Q'://dnl ch75 021113
#ifdef _DEBUG
extern UINT8 gInventoryPoolIndex;
if(fShowMapInventoryPool == TRUE && gInventoryPoolIndex == '0')
{
if(gGameExternalOptions.fEnableInventoryPoolQ)
{
gGameExternalOptions.fEnableInventoryPoolQ = FALSE;
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"InventoryPoolQ disabled.");
}
else
{
gGameExternalOptions.fEnableInventoryPoolQ = TRUE;
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"InventoryPoolQ enabled.");
}
}
#endif
break;
case 'r':
if( gfPreBattleInterfaceActive )
{ //activate autoresolve in prebattle interface.