mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
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:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user