AIMNAS with its ~50K elements in Attachment[] suffered of performance drop when MOLLE stuff is in the visible inventory. To resolve it the following is done:
* Introduce gMAXATTACHMENTS_READ with actual number of elements in Attachment[]; according refactoring.
* Introduce gMAXLAUNCHABLES_READ with actual number of elements in Launchable[]; according refactoring.
* Introduce std::multimap AttachmentBackmap for quick access to attachments using itemId as a key.
* Sort Attachment[] by attachmentIndex right after loading from XML. According order in XML is not needed anymore.
* Introduce FindAttachmentRange() for quick access to attachments using attachmentId as a key (binary search in Attachment[]).
In a few words, GetHelpTextForItemInLaptop(), ValidAttachment(), SetAttachmentSlotsFlag() were heavily optimized.
* More unused stuff removal
delete:
- giant 'metaheaders' (JA2 All.h, Laptop All.h, etc), preferring to add #includes directly where needed
- unused ExceptionHandling and DbMan translation units
- unused WizShare.h, Bitmap.h, trle.h, video_private.h headers
* remove mentions from vc proj files too
* remove preprocessor conditionals for unused definitions
find . -iname '*.h' -o -iname '*.cpp' -exec unifdef.exe -m -UPRECOMPILED_HEADERS -UJA2_PRECOMPILED_HEADERS -UWIZ8_PRECOMPILED_HEADERS -UPRECOMPILEDHEADERS {} ';'
then manually fixed a couple files the tool errored out on
* yes, the comments too
as title
- unified the highlight behavior with currently held item in cursor to only ever highlight compatible items for that item (was the case in tactical, not in map screen)
- enabled the body silhouette in map screen to be lit up when hovering/holding consumable item just as it happens in tactical mode
- few small fixes correcting code I sent previously
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8999 3b4a5df2-a311-0410-b5c6-a8a6f20db521
Significant improvement for the inventory panel item highlighting code on map screen. There is also a fix for wrong items highlighted when changing currently selected merc (by Shadooow).
Old code was constantly running update for highlights several times a second. Now it only happens when the mouse position first finds or loses an item in inventory.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8998 3b4a5df2-a311-0410-b5c6-a8a6f20db521
Fix: GUI issue where the body silhouette wasn't lit up with some of the new consumable items such as energy drinks, etc. Also, empty canteen will no longer lit up the body silhouette anymore (by Shadooow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8994 3b4a5df2-a311-0410-b5c6-a8a6f20db521
Help AI associate noise with enemy presence:
- melee attack noise type changed to NOISE_BULLET_IMPACT
- HTH attack noise type changed to NOISE_BULLET_IMPACT
- grenade pin noise type changed to NOISE_GRENADE_IMPACT
- launcher attack noise type changed to NOISE_GUNFIRE
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8728 3b4a5df2-a311-0410-b5c6-a8a6f20db521
CalcPreRecoilOffset(), CalcRecoilOffset(): fix counterforce calculation for weapon resting feature.
SOLDIERTYPE::GetAPBonus(): use THROUGH_STRATEGIC_MOVE instead of soldier's facing direction to determine sector type.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8719 3b4a5df2-a311-0410-b5c6-a8a6f20db521
- fixed infinite loop in function "RandomGridFromRadius" when min and max radius were 1
- fixed incorrect exit condition in function "RandomGridFromRadius" when min radius was 0
- fixed incorrect CtH calculation for mortar
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8598 3b4a5df2-a311-0410-b5c6-a8a6f20db521
- Fixed index out of bounds in get items assignment check
- Fixed attachment popup not allowing more than one of the same attachment
- Improved timer control sanity check code
- Added timer adjustment for variable CPU frequency
- Added shortcut: ctrl+left-click on attachment to remove and drop it in sector inventory
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8400 3b4a5df2-a311-0410-b5c6-a8a6f20db521
- Fixed random freeze on win8/10
- Fixed crash on mercs entering sector
- Fixed crash when using cover display (del/end)
- Fixed attachment popup showing incompatible attachments (crash/freeze/confusion on clicking the option)
- Fixed attachment popup positioning
- Fixed LBE contents corruption/deletion
- Fixed access violation (out of array bounds) in interrupt code
- Fixed a bunch of random old stuff
- Got the project to build on VS2015
- Improved popup class handling of grayed out options
- Improved performance of get item assignment check (added by Flugente)
- Added Ctrl+Space bind for testing/fixing broken LBE contents
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8399 3b4a5df2-a311-0410-b5c6-a8a6f20db521
- use transformation menu to change explosion mode
- only Normal/Stun/Flashbang type grenades can be delayed
- AI soldiers will avoid staying close to armed grenades\explosives
- use option DELAYED_GRENADE_EXPLOSION to make all hand\GL grenades work as delayed
- new value AP_GRENADE_MODE = 4 in APBPConstants.ini
- new item flag DELAYED_GRENADE_EXPLOSION
Other changes:
- fixed call to sqrt in DrawExplosionWarning() that prevented compiling in VS2010
- correctly update interface after transformations
- PATHAI: AI soldiers will skip gassed tiles if not in gas already
- InGas check: AI soldiers will avoid mustard gas even when wearing gas mask
- Yellow AI: added check to avoid gas/water/bomb using FindNearestUngassedLand
- gas/flare grenades will always explode instantly even when in bad state
- LegalNPCDestination: locations near armed bombs are not legal
- FindBestNearbyCover: avoid locations near armed bombs
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8324 3b4a5df2-a311-0410-b5c6-a8a6f20db521