Reduces render calls when mouse over compatible item in stash and soldier inventory (highlighting) (by Moa)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6456 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-09-29 19:46:59 +00:00
parent 3c01b5364e
commit 7b1124a596
3 changed files with 85 additions and 11 deletions
+20
View File
@@ -3123,6 +3123,26 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest
OBJECTTYPE *pObject;
BOOLEAN fFoundAttachment = FALSE;
//Moa 09/26/2013: this is a hack to avoid frequent recalc and rerender of screen when mouse is over an item, its less work and less error prone then rewriting several functions (various mousecallbacks, >4 renderfunctions and probalby some others too)
static OBJECTTYPE* previousObject = NULL;
//dont recalc when same item then before
if (pTestObject == previousObject && fOn)
{
return FALSE;//nothing to rerender
}
else if ( fOn )
{
previousObject = pTestObject;
//make something dirty?
fInterfacePanelDirty = DIRTYLEVEL2;
fTeamPanelDirty = TRUE;
}
else
{
previousObject = NULL;
}
//end hack
// ATE: If pTest object is NULL, test only for existence of syringes, etc...
if ( pTestObject == NULL )
{