summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-01-25 20:21:19 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-01-25 20:21:19 +0000
commit04f1248ef9d6bfdac16bea5fe38342c22edbc386 (patch)
treef955329c219a2b99504f97017abb7472b6f78050 /src/mesa/drivers/svga
parent0fed6a1bded5940afba8b94e15b6ad72ebb07245 (diff)
updated RGB2BGR function
Diffstat (limited to 'src/mesa/drivers/svga')
-rw-r--r--src/mesa/drivers/svga/svgamesa24.c10
-rw-r--r--src/mesa/drivers/svga/svgamesa32.c8
2 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/drivers/svga/svgamesa24.c b/src/mesa/drivers/svga/svgamesa24.c
index 152779bf12..6dc01b0258 100644
--- a/src/mesa/drivers/svga/svgamesa24.c
+++ b/src/mesa/drivers/svga/svgamesa24.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa24.c,v 1.4 2000/01/25 00:03:02 brianp Exp $ */
+/* $Id: svgamesa24.c,v 1.5 2000/01/25 20:21:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -34,6 +34,7 @@
#if 0
+/* this doesn't compile with GCC on RedHat 6.1 */
static inline int RGB2BGR24(int c)
{
asm("rorw $8, %0\n"
@@ -44,13 +45,10 @@ static inline int RGB2BGR24(int c)
return c;
}
#else
-static int RGB2BGR24(int c)
+static unsigned long RGB2BGR24(unsigned long color)
{
- /* XXX this isn't right */
- return c;
+ return (color & 0xff00)|(color>>16)|((color & 0xff)<<16);
}
-
-
#endif
static void __svga_drawpixel24(int x, int y, GLubyte r, GLubyte g, GLubyte b)
diff --git a/src/mesa/drivers/svga/svgamesa32.c b/src/mesa/drivers/svga/svgamesa32.c
index ad683ef08f..f588d42952 100644
--- a/src/mesa/drivers/svga/svgamesa32.c
+++ b/src/mesa/drivers/svga/svgamesa32.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa32.c,v 1.4 2000/01/25 00:03:02 brianp Exp $ */
+/* $Id: svgamesa32.c,v 1.5 2000/01/25 20:21:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -33,6 +33,7 @@
#include "svgamesa32.h"
#if 0
+/* this doesn't compile with GCC on RedHat 6.1 */
static inline int RGB2BGR32(int c)
{
asm("rorw $8, %0\n"
@@ -43,10 +44,9 @@ static inline int RGB2BGR32(int c)
return c;
}
#else
-static int RGB2BGR32(int c)
+static unsigned long RGB2BGR32(unsigned long color)
{
- /* XXX this isn't right */
- return c;
+ return (color & 0xff00)|(color>>16)|((color & 0xff)<<16);
}
#endif