From 890b844edb8e0125b044206931a3a15a1db9bf2c Mon Sep 17 00:00:00 2001 From: avolkov Date: Sat, 5 Dec 2009 22:38:37 +0000 Subject: [PATCH] Fixed planet blinking when exiting scan; bug #799 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3394 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/uqm/planets/scan.c | 38 ++++++++++++++------------------------ 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 008a7dffb..a0c8a6281 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Fixed planet blinking when exiting scan (bug #799) - Alex - Restore menu sounds after editing a control set name (bug #1066) - Alex - Added 'COLOR' resource type - SvdB - All graphics operations use 24-bits colors at the game level too now, diff --git a/sc2/src/uqm/planets/scan.c b/sc2/src/uqm/planets/scan.c index b852d49ba..29d183e6b 100644 --- a/sc2/src/uqm/planets/scan.c +++ b/sc2/src/uqm/planets/scan.c @@ -76,33 +76,23 @@ RepairBackRect (RECT *pRect) static void EraseCoarseScan (void) { - RECT r, tr; - const int leftScanWidth = 80; - const int rightScanWidth = 80; - const int leftScanOffset = 5; - const int rightScanOffset = 50; - const int nameEraseWidth = SIS_SCREEN_WIDTH - 2; + RECT oldClipRect; + RECT clipRect; LockMutex (GraphicsLock); SetContext (SpaceContext); - - r.corner.x = (SIS_SCREEN_WIDTH >> 1) - (nameEraseWidth >> 1); - r.corner.y = 13 - 10; - r.extent.width = nameEraseWidth; - r.extent.height = 14; - RepairBackRect (&r); - - GetFrameRect (SetAbsFrameIndex (SpaceJunkFrame, 20), &tr); - r = tr; - r.corner.x += leftScanOffset; - r.extent.width = leftScanWidth; - RepairBackRect (&r); - - r = tr; - r.corner.x += (r.extent.width - rightScanOffset); - r.extent.width = rightScanWidth; - RepairBackRect (&r); - + // TODO: Give coarse scan an own context + GetContextClipRect (&oldClipRect); + clipRect = oldClipRect; + clipRect.extent.height = SCAN_SCREEN_HEIGHT; + SetContextClipRect (&clipRect); + + BatchGraphics (); + DrawStarBackGround (); + DrawDefaultPlanetSphere (); + UnbatchGraphics (); + + SetContextClipRect (&oldClipRect); UnlockMutex (GraphicsLock); }