summaryrefslogtreecommitdiff
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
parent8b7dc89da106ed4584ba8e16e0f9ea9fcf819c28 (diff)
downloadvdr-plugin-spider-edb972c60dbd5f7fb0f69ef8283fb1b46b8bc3fb.tar.gz
vdr-plugin-spider-edb972c60dbd5f7fb0f69ef8283fb1b46b8bc3fb.tar.bz2
Reduced flickering on VDR >= 1.3.7
-rw-r--r--HISTORY1
-rw-r--r--TODO3
-rw-r--r--game.c10
3 files changed, 11 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 47fa7bb..8f149c5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9,3 +9,4 @@ XXXX-XX-XX: Version 0.1.1
- Fixed compilation with woody
- Improved cover.xpm
+- Reduced flickering on VDR >= 1.3.7
diff --git a/TODO b/TODO
index ab6a3d4..85484b9 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,6 @@
To-do list for the spider plugin
================================
-- reduce flickering
-- user-defined variantions
+- user-defined variations
- hiding pack and final heaps
- varying card distance in piles
- resume a game
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);