Date:2011-01-30 19:23:23 (13 years 1 month ago)
Author:David Kühling
Commit:be5eeea07c9310f55bd936e3b4688bf05e4838de
Message:plplot: fix svgalib driver display bug w/ plenv() resetting current color

Files: plplot/patches/050-linuxvga-320x240x16M.patch (6 diffs)

Change Details

plplot/patches/050-linuxvga-320x240x16M.patch
11Index: plplot-5.9.7/drivers/linuxvga.c
22===================================================================
3+++ plplot-5.9.7/drivers/linuxvga.c 2011-01-09 14:23:05.000000000 +0100
3--- plplot-5.9.7.orig/drivers/linuxvga.c 2011-01-30 19:15:09.000000000 +0100
44@@ -39,8 +39,8 @@
55
66 /* INDENT ON */
...... 
1313
1414 /* A flag to tell us whether we are in text or graphics mode */
1515
16@@ -95,7 +95,7 @@
16@@ -53,6 +53,7 @@
17 static int mode = TEXT_MODE;
18 static int col = 1;
19 static int totcol = 16;
20+static int vgacol = 0;
21
22 #define CLEAN 0
23 #define DIRTY 1
24@@ -95,7 +96,7 @@
1725 /* What kind of VGA mode one wants is set up here.
1826  * It can be easyly made interactive! */
1927
...... 
2230     if ( vga_hasmode( mode ) )
2331         vga_setmode( mode );
2432     else
25@@ -111,7 +111,7 @@
33@@ -111,7 +112,7 @@
2634
2735     totcol = vga_getcolors();
2836
...... 
3139     plP_setphy( 0, vgax, 0, vgay );
3240 }
3341
34@@ -202,24 +202,34 @@
42@@ -163,6 +164,7 @@
43
44     /* vga_setmode(mode); */
45     vga_clear(); /* just clean it */
46+ vga_setcolor(vgacol); /* restore color (reset by vga_clear()) */
47
48     page_state = CLEAN;
49 }
50@@ -202,24 +204,34 @@
3551 void
3652 plD_state_vga( PLStream *pls, PLINT op )
3753 {
...... 
6076+ {
6177+ r = pls->curcolor.r, g = pls->curcolor.g, b = pls->curcolor.b;
6278+ }
63+ vga_setrgbcolor (r, g, b);
79+ vgacol = vga_setrgbcolor (r, g, b);
6480+ break;
6581     case PLSTATE_COLOR1:
6682+ if ( !pls->color )
...... 
7187+ {
7288+ r = pls->curcolor.r, g = pls->curcolor.g, b = pls->curcolor.b;
7389+ }
74+ vga_setrgbcolor( r, g, b );
90+ vgacol = vga_setrgbcolor( r, g, b );
7591         break;
7692     }
7793 }

Archive Download the corresponding diff file



interactive