From a8aaba148567961b3e57d0b67fdadb92d72ec131 Mon Sep 17 00:00:00 2001 From: avolkov Date: Tue, 8 Dec 2009 22:59:23 +0000 Subject: [PATCH] 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 --- sc2/src/uqm/intro.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/sc2/src/uqm/intro.c b/sc2/src/uqm/intro.c index 1338ccd85..e44b3c4fe 100644 --- a/sc2/src/uqm/intro.c +++ b/sc2/src/uqm/intro.c @@ -23,6 +23,7 @@ #include "sis.h" #include "setup.h" #include "sounds.h" +#include "colors.h" #include "fmv.h" #include "resinst.h" #include "nameref.h" @@ -686,17 +687,10 @@ DoPresentation (void *pIS) } else if (strcmp (Opcode, "CLS") == 0) { /* clear screen */ - RECT r; - Present_UnbatchGraphics (pPIS, TRUE); LockMutex (GraphicsLock); - GetContextClipRect (&r); - r.corner.x = r.corner.y = 0; - /* paint black rect over screen */ - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x00), 0x00)); - DrawFilledRectangle (&r); + ClearDrawable (); UnlockMutex (GraphicsLock); } else if (strcmp (Opcode, "CALL") == 0) @@ -781,6 +775,7 @@ ShowSlidePresentation (STRING PresStr) OldContext = SetContext (ScreenContext); GetContextClipRect (&OldRect); OldFont = SetContextFont (NULL); + SetContextBackGroundColor (BLACK_COLOR); UnlockMutex (GraphicsLock); SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE); @@ -857,18 +852,16 @@ static void FadeClearScreen (void) { BYTE xform_buf[1]; - RECT r = {{0, 0}, {SCREEN_WIDTH, SCREEN_HEIGHT}}; xform_buf[0] = FadeAllToBlack; SleepThreadUntil (XFormColorMap ( (COLORMAPPTR) xform_buf, ONE_SECOND / 2)); - // paint black rect over screen + // clear the screen with black LockMutex (GraphicsLock); SetContext (ScreenContext); - SetContextForeGroundColor ( - BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x00), 0x00)); - DrawFilledRectangle (&r); + SetContextBackGroundColor (BLACK_COLOR); + ClearDrawable (); UnlockMutex (GraphicsLock); // fade in black rect instantly