Cleaner use of background/foreground colors in presentations
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3409 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+6
-13
@@ -23,6 +23,7 @@
|
|||||||
#include "sis.h"
|
#include "sis.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "sounds.h"
|
#include "sounds.h"
|
||||||
|
#include "colors.h"
|
||||||
#include "fmv.h"
|
#include "fmv.h"
|
||||||
#include "resinst.h"
|
#include "resinst.h"
|
||||||
#include "nameref.h"
|
#include "nameref.h"
|
||||||
@@ -686,17 +687,10 @@ DoPresentation (void *pIS)
|
|||||||
}
|
}
|
||||||
else if (strcmp (Opcode, "CLS") == 0)
|
else if (strcmp (Opcode, "CLS") == 0)
|
||||||
{ /* clear screen */
|
{ /* clear screen */
|
||||||
RECT r;
|
|
||||||
|
|
||||||
Present_UnbatchGraphics (pPIS, TRUE);
|
Present_UnbatchGraphics (pPIS, TRUE);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
GetContextClipRect (&r);
|
ClearDrawable ();
|
||||||
r.corner.x = r.corner.y = 0;
|
|
||||||
/* paint black rect over screen */
|
|
||||||
SetContextForeGroundColor (
|
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x00), 0x00));
|
|
||||||
DrawFilledRectangle (&r);
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
}
|
}
|
||||||
else if (strcmp (Opcode, "CALL") == 0)
|
else if (strcmp (Opcode, "CALL") == 0)
|
||||||
@@ -781,6 +775,7 @@ ShowSlidePresentation (STRING PresStr)
|
|||||||
OldContext = SetContext (ScreenContext);
|
OldContext = SetContext (ScreenContext);
|
||||||
GetContextClipRect (&OldRect);
|
GetContextClipRect (&OldRect);
|
||||||
OldFont = SetContextFont (NULL);
|
OldFont = SetContextFont (NULL);
|
||||||
|
SetContextBackGroundColor (BLACK_COLOR);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
@@ -857,18 +852,16 @@ static void
|
|||||||
FadeClearScreen (void)
|
FadeClearScreen (void)
|
||||||
{
|
{
|
||||||
BYTE xform_buf[1];
|
BYTE xform_buf[1];
|
||||||
RECT r = {{0, 0}, {SCREEN_WIDTH, SCREEN_HEIGHT}};
|
|
||||||
|
|
||||||
xform_buf[0] = FadeAllToBlack;
|
xform_buf[0] = FadeAllToBlack;
|
||||||
SleepThreadUntil (XFormColorMap (
|
SleepThreadUntil (XFormColorMap (
|
||||||
(COLORMAPPTR) xform_buf, ONE_SECOND / 2));
|
(COLORMAPPTR) xform_buf, ONE_SECOND / 2));
|
||||||
|
|
||||||
// paint black rect over screen
|
// clear the screen with black
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
SetContext (ScreenContext);
|
SetContext (ScreenContext);
|
||||||
SetContextForeGroundColor (
|
SetContextBackGroundColor (BLACK_COLOR);
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x00), 0x00));
|
ClearDrawable ();
|
||||||
DrawFilledRectangle (&r);
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
// fade in black rect instantly
|
// fade in black rect instantly
|
||||||
|
|||||||
Reference in New Issue
Block a user