summaryrefslogtreecommitdiff
path: root/game.c
diff options
context:
space:
mode:
authorThomas Günther <tom@toms-cafe.de>2005-05-16 16:11:51 +0200
committerThomas Günther <tom@toms-cafe.de>2005-05-16 16:11:51 +0200
commitedb972c60dbd5f7fb0f69ef8283fb1b46b8bc3fb (patch)
tree0f9a6f694c607a92b86f0e87a89fafdb66896fe3 /game.c
parent8b7dc89da106ed4584ba8e16e0f9ea9fcf819c28 (diff)
downloadvdr-plugin-spider-edb972c60dbd5f7fb0f69ef8283fb1b46b8bc3fb.tar.gz
vdr-plugin-spider-edb972c60dbd5f7fb0f69ef8283fb1b46b8bc3fb.tar.bz2
Reduced flickering on VDR >= 1.3.7
Diffstat (limited to 'game.c')
-rw-r--r--game.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/game.c b/game.c
index c38495d..c23ef70 100644
--- a/game.c
+++ b/game.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: game.c 2 2005-05-14 22:25:56Z tom $
+ * $Id: game.c 7 2005-05-16 14:11:51Z tom $
*/
#include "game.h"
@@ -30,6 +30,8 @@
a->bpp, true)
#define clrGray50 clrBackground
#define Color GetColor
+ #define savePalette(bitmap) savePalette(2)
+ #define SetPalette(palette, area) Width('X')
#endif
@@ -283,7 +285,13 @@ void SpiderGame::paint()
int x2 = xPos + width - 1;
int y1 = yPos;
int y2 = yPos + height - 1;
+
+ // Save and restore palette to reduce flickering
+ cPalette savePalette(*osd->GetBitmap(0));
osd->DrawRectangle(x1, y1, x2, y2, clrGray50);
+ osd->SetPalette(savePalette, 0);
+
+ // Paint red frame
osd->DrawRectangle(x1, y1, x2, y1 + 1, clrRed);
osd->DrawRectangle(x1, y1, x1 + 1, y2, clrRed);
osd->DrawRectangle(x1, y2 - 1, x2, y2, clrRed);