From 0570fcfd93a29dcd9d41bc709edd78a7c1b4e1e7 Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Tue, 21 Nov 2006 09:35:49 +0000 Subject: Added correct include files to files, No longer modify cmap if the device is truecolor (messes up dual monitors with vt switching) --- src/glut/fbdev/callback.c | 2 ++ src/glut/fbdev/colormap.c | 3 ++- src/glut/fbdev/cursor.c | 2 ++ src/glut/fbdev/ext.c | 2 ++ src/glut/fbdev/fbdev.c | 4 +++- src/glut/fbdev/gamemode.c | 1 + src/glut/fbdev/input.c | 6 +++--- src/glut/fbdev/internal.h | 7 +++---- src/glut/fbdev/menu.c | 2 ++ src/glut/fbdev/state.c | 1 + 10 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/glut/fbdev/callback.c b/src/glut/fbdev/callback.c index 37373672d36..946c8d8c133 100644 --- a/src/glut/fbdev/callback.c +++ b/src/glut/fbdev/callback.c @@ -24,6 +24,8 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include + #include #include "internal.h" diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c index 89556ef4a5c..3a81f93657d 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 #include #include @@ -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]; diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c index 88386956a44..6cd087e93c8 100644 --- a/src/glut/fbdev/cursor.c +++ b/src/glut/fbdev/cursor.c @@ -28,8 +28,10 @@ to render the cursor, this is faster, it would be good to use a hardware cursor if it exists instead */ +#include #include #include +#include #include diff --git a/src/glut/fbdev/ext.c b/src/glut/fbdev/ext.c index 4a3c185a16d..65953e705b9 100644 --- a/src/glut/fbdev/ext.c +++ b/src/glut/fbdev/ext.c @@ -24,6 +24,8 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include + #include #include diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c index ce6419816dd..7b46d545920 100644 --- a/src/glut/fbdev/fbdev.c +++ b/src/glut/fbdev/fbdev.c @@ -571,7 +571,8 @@ void SetVideoMode(void) } /* initialize colormap */ - LoadColorMap(); + if(FixedInfo.visual != FB_VISUAL_TRUECOLOR) + LoadColorMap(); } void CreateBuffer() @@ -786,6 +787,7 @@ void glutDestroyWindow(int win) glFBDevDestroyContext(Context); glFBDevDestroyBuffer(Buffer); glFBDevDestroyVisual(Visual); + Visual = NULL; } diff --git a/src/glut/fbdev/gamemode.c b/src/glut/fbdev/gamemode.c index 9f32d9d7e82..30be36af7af 100644 --- a/src/glut/fbdev/gamemode.c +++ b/src/glut/fbdev/gamemode.c @@ -24,6 +24,7 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include #include #include diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c index 2528a74a105..d09de22ed7e 100644 --- a/src/glut/fbdev/input.c +++ b/src/glut/fbdev/input.c @@ -53,7 +53,7 @@ int GpmMouse; #endif -int CurrentVT; +int CurrentVT = 0; int ConsoleFD = -1; int KeyboardModifiers; @@ -529,14 +529,14 @@ static void VTSwitchHandler(int sig) /* this is a hack to turn the cursor off */ ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo); - RestoreColorMap(); + if(FixedInfo.visual != FB_VISUAL_TRUECOLOR) + RestoreColorMap(); Active = 1; Visible = 1; VisibleSwitch = 1; Redisplay = 1; - break; } } diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h index 082cd4f6f3a..8801cc9f6c3 100644 --- a/src/glut/fbdev/internal.h +++ b/src/glut/fbdev/internal.h @@ -72,14 +72,13 @@ extern GLFBDevVisualPtr Visual; #define REVERSECMAPSIZE (1< +#include +#include #include diff --git a/src/glut/fbdev/state.c b/src/glut/fbdev/state.c index bca675c52c4..212a04aa028 100644 --- a/src/glut/fbdev/state.c +++ b/src/glut/fbdev/state.c @@ -24,6 +24,7 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include #include #include -- cgit v1.2.3