Give fades an own mutex instead of sharing one with colormap xforms; decreases console spam during Slylandro comm
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3560 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -50,6 +50,7 @@ static int fadeAmount = FADE_NORMAL_INTENSITY;
|
|||||||
static int fadeDelta;
|
static int fadeDelta;
|
||||||
static TimeCount fadeStartTime;
|
static TimeCount fadeStartTime;
|
||||||
static sint32 fadeInterval;
|
static sint32 fadeInterval;
|
||||||
|
static Mutex fadeLock;
|
||||||
|
|
||||||
#define SPARE_COLORMAPS 20
|
#define SPARE_COLORMAPS 20
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ static int poolcount;
|
|||||||
|
|
||||||
static TFB_ColorMap * colormaps[MAX_COLORMAPS];
|
static TFB_ColorMap * colormaps[MAX_COLORMAPS];
|
||||||
static int mapcount;
|
static int mapcount;
|
||||||
Mutex maplock;
|
static Mutex maplock;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -76,6 +77,8 @@ InitColorMaps (void)
|
|||||||
XFormControl.Lock = CreateMutex ("Transform Lock", SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO);
|
XFormControl.Lock = CreateMutex ("Transform Lock", SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO);
|
||||||
for (i = 0; i < MAX_XFORMS; ++i)
|
for (i = 0; i < MAX_XFORMS; ++i)
|
||||||
XFormControl.TaskControl[i].CMapIndex = -1;
|
XFormControl.TaskControl[i].CMapIndex = -1;
|
||||||
|
|
||||||
|
fadeLock = CreateMutex ("Fade Lock", SYNC_CLASS_TOPLEVEL | SYNC_CLASS_VIDEO);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -90,6 +93,7 @@ UninitColorMaps (void)
|
|||||||
HFree (poolhead);
|
HFree (poolhead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DestroyMutex (fadeLock);
|
||||||
// uninit xform control
|
// uninit xform control
|
||||||
DestroyMutex (XFormControl.Lock);
|
DestroyMutex (XFormControl.Lock);
|
||||||
|
|
||||||
@@ -317,7 +321,7 @@ GetFadeAmount (void)
|
|||||||
{
|
{
|
||||||
int newAmount;
|
int newAmount;
|
||||||
|
|
||||||
LockMutex (XFormControl.Lock);
|
LockMutex (fadeLock);
|
||||||
|
|
||||||
if (fadeInterval)
|
if (fadeInterval)
|
||||||
{ // have a pending fade
|
{ // have a pending fade
|
||||||
@@ -341,7 +345,7 @@ GetFadeAmount (void)
|
|||||||
newAmount = fadeAmount;
|
newAmount = fadeAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
UnlockMutex (XFormControl.Lock);
|
UnlockMutex (fadeLock);
|
||||||
|
|
||||||
return newAmount;
|
return newAmount;
|
||||||
}
|
}
|
||||||
@@ -359,9 +363,9 @@ finishPendingFade (void)
|
|||||||
static void
|
static void
|
||||||
FlushFadeXForms (void)
|
FlushFadeXForms (void)
|
||||||
{
|
{
|
||||||
LockMutex (XFormControl.Lock);
|
LockMutex (fadeLock);
|
||||||
finishPendingFade ();
|
finishPendingFade ();
|
||||||
UnlockMutex (XFormControl.Lock);
|
UnlockMutex (fadeLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
@@ -392,7 +396,7 @@ FadeScreen (ScreenFadeType fadeType, SIZE TimeInterval)
|
|||||||
if (QuitPosted)
|
if (QuitPosted)
|
||||||
TimeInterval = 0;
|
TimeInterval = 0;
|
||||||
|
|
||||||
LockMutex (XFormControl.Lock);
|
LockMutex (fadeLock);
|
||||||
|
|
||||||
finishPendingFade ();
|
finishPendingFade ();
|
||||||
|
|
||||||
@@ -411,7 +415,7 @@ FadeScreen (ScreenFadeType fadeType, SIZE TimeInterval)
|
|||||||
TimeOut = fadeStartTime + TimeInterval + 1;
|
TimeOut = fadeStartTime + TimeInterval + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
UnlockMutex (XFormControl.Lock);
|
UnlockMutex (fadeLock);
|
||||||
|
|
||||||
return TimeOut;
|
return TimeOut;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user