From be5eeea07c9310f55bd936e3b4688bf05e4838de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=BChling?= Date: Sun, 30 Jan 2011 19:23:23 +0100 Subject: [PATCH] plplot: fix svgalib driver display bug w/ plenv() resetting current color --- plplot/patches/050-linuxvga-320x240x16M.patch | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/plplot/patches/050-linuxvga-320x240x16M.patch b/plplot/patches/050-linuxvga-320x240x16M.patch index 82b906d..65a8ba2 100644 --- a/plplot/patches/050-linuxvga-320x240x16M.patch +++ b/plplot/patches/050-linuxvga-320x240x16M.patch @@ -1,7 +1,7 @@ Index: plplot-5.9.7/drivers/linuxvga.c =================================================================== ---- plplot-5.9.7.orig/drivers/linuxvga.c 2011-01-08 12:20:09.000000000 +0100 -+++ plplot-5.9.7/drivers/linuxvga.c 2011-01-09 14:23:05.000000000 +0100 +--- plplot-5.9.7.orig/drivers/linuxvga.c 2011-01-30 19:15:09.000000000 +0100 ++++ plplot-5.9.7/drivers/linuxvga.c 2011-01-30 19:17:08.000000000 +0100 @@ -39,8 +39,8 @@ /* INDENT ON */ @@ -13,7 +13,15 @@ Index: plplot-5.9.7/drivers/linuxvga.c /* A flag to tell us whether we are in text or graphics mode */ -@@ -95,7 +95,7 @@ +@@ -53,6 +53,7 @@ + static int mode = TEXT_MODE; + static int col = 1; + static int totcol = 16; ++static int vgacol = 0; + + #define CLEAN 0 + #define DIRTY 1 +@@ -95,7 +96,7 @@ /* What kind of VGA mode one wants is set up here. * It can be easyly made interactive! */ @@ -22,7 +30,7 @@ Index: plplot-5.9.7/drivers/linuxvga.c if ( vga_hasmode( mode ) ) vga_setmode( mode ); else -@@ -111,7 +111,7 @@ +@@ -111,7 +112,7 @@ totcol = vga_getcolors(); @@ -31,7 +39,15 @@ Index: plplot-5.9.7/drivers/linuxvga.c plP_setphy( 0, vgax, 0, vgay ); } -@@ -202,24 +202,34 @@ +@@ -163,6 +164,7 @@ + + /* vga_setmode(mode); */ + vga_clear(); /* just clean it */ ++ vga_setcolor(vgacol); /* restore color (reset by vga_clear()) */ + + page_state = CLEAN; + } +@@ -202,24 +204,34 @@ void plD_state_vga( PLStream *pls, PLINT op ) { @@ -60,7 +76,7 @@ Index: plplot-5.9.7/drivers/linuxvga.c + { + r = pls->curcolor.r, g = pls->curcolor.g, b = pls->curcolor.b; + } -+ vga_setrgbcolor (r, g, b); ++ vgacol = vga_setrgbcolor (r, g, b); + break; case PLSTATE_COLOR1: + if ( !pls->color ) @@ -71,7 +87,7 @@ Index: plplot-5.9.7/drivers/linuxvga.c + { + r = pls->curcolor.r, g = pls->curcolor.g, b = pls->curcolor.b; + } -+ vga_setrgbcolor( r, g, b ); ++ vgacol = vga_setrgbcolor( r, g, b ); break; } }