summaryrefslogtreecommitdiff
path: root/src/glut/dos/color.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glut/dos/color.c')
-rw-r--r--src/glut/dos/color.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c
index f1f529521d..2e8ed3f95b 100644
--- a/src/glut/dos/color.c
+++ b/src/glut/dos/color.c
@@ -27,9 +27,8 @@
*/
-#include "GL/glut.h"
+#include "glutint.h"
#include "GL/dmesa.h"
-#include "internal.h"
@@ -40,7 +39,9 @@
void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue)
{
if (g_display_mode & GLUT_INDEX) {
- DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue));
+ if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) {
+ DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue));
+ }
}
}