From edb972c60dbd5f7fb0f69ef8283fb1b46b8bc3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Mon, 16 May 2005 16:11:51 +0200 Subject: Reduced flickering on VDR >= 1.3.7 --- HISTORY | 1 + TODO | 3 +-- game.c | 10 +++++++++- 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); -- cgit v1.2.3