Increased the size of the display queue (disp_q)

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2847 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2007-09-06 08:33:21 +00:00
parent 14dad53337
commit 1209d2cd85
5 changed files with 13 additions and 2 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.7: Changes towards version 0.7:
- Increased the size of display queue (elements were sometimes missing
in e.g. Nemesis vs. Nemesis battles with many marines out) - Alex
- ShowPresentation() no longer clears the screen by force; presentations - ShowPresentation() no longer clears the screen by force; presentations
now do this by request - Michael now do this by request - Michael
- Added match_matchPatternOnce() - SvdB - Added match_matchPatternOnce() - SvdB
+4
View File
@@ -29,6 +29,10 @@ typedef struct battlestate_struct {
} BATTLE_STATE; } BATTLE_STATE;
extern QUEUE disp_q; extern QUEUE disp_q;
// The maximum number of elements is chosen to provide a slight margin.
// Currently, it is maximum *known used* in Melee + 30
#define MAX_DISPLAY_ELEMENTS 150
extern BYTE battle_counter[NUM_SIDES]; extern BYTE battle_counter[NUM_SIDES];
extern BOOLEAN instantVictory; extern BOOLEAN instantVictory;
#ifdef NETPLAY #ifdef NETPLAY
+1 -1
View File
@@ -157,7 +157,7 @@ struct element
HELEMENT hTarget; HELEMENT hTarget;
}; };
#define MAX_DISPLAY_PRIMS 280 #define MAX_DISPLAY_PRIMS 330
extern COUNT DisplayFreeList; extern COUNT DisplayFreeList;
extern PRIMITIVE DisplayArray[MAX_DISPLAY_PRIMS]; extern PRIMITIVE DisplayArray[MAX_DISPLAY_PRIMS];
+5
View File
@@ -80,6 +80,11 @@ AllocElement (void)
LockElement (hElement, &ElementPtr); LockElement (hElement, &ElementPtr);
memset (ElementPtr, 0, sizeof (*ElementPtr)); memset (ElementPtr, 0, sizeof (*ElementPtr));
ElementPtr->PrimIndex = AllocDisplayPrim (); ElementPtr->PrimIndex = AllocDisplayPrim ();
if (ElementPtr->PrimIndex == END_OF_LIST)
{
log_add (log_Error, "AllocElement: Out of display prims!");
explode ();
}
SetPrimType (&DisplayArray[ElementPtr->PrimIndex], NO_PRIM); SetPrimType (&DisplayArray[ElementPtr->PrimIndex], NO_PRIM);
UnlockElement (hElement); UnlockElement (hElement);
} }
+1 -1
View File
@@ -155,7 +155,7 @@ InitContexts (void)
if (OffScreenContext == NULL) if (OffScreenContext == NULL)
return FALSE; return FALSE;
if (!InitQueue (&disp_q, 100, sizeof (ELEMENT))) if (!InitQueue (&disp_q, MAX_DISPLAY_ELEMENTS, sizeof (ELEMENT)))
return FALSE; return FALSE;
return TRUE; return TRUE;