summaryrefslogtreecommitdiff
path: root/src/glut/fbdev/colormap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glut/fbdev/colormap.c')
-rw-r--r--src/glut/fbdev/colormap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c
index 89556ef4a5..3e72a7b051 100644
--- a/src/glut/fbdev/colormap.c
+++ b/src/glut/fbdev/colormap.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
#include <stdlib.h>
#include <linux/fb.h>
@@ -37,7 +38,7 @@
#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1))
#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1)
-static struct fb_cmap ColorMap;
+static struct fb_cmap ColorMap, OriginalColorMap;
unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256];
@@ -91,12 +92,18 @@ static void FillReverseColorMap(void)
void RestoreColorMap(void)
{
+ if(FixedInfo.visual == FB_VISUAL_TRUECOLOR)
+ return;
+
if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0)
sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n");
}
void LoadColorMap(void)
{
+ if(FixedInfo.visual == FB_VISUAL_TRUECOLOR)
+ return;
+
ColorMap.start = 0;
ColorMap.red = RedColorMap;
ColorMap.green = GreenColorMap;