summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaryll <daryll>1999-12-15 18:16:14 +0000
committerdaryll <daryll>1999-12-15 18:16:14 +0000
commitcb6026afbee496a3109c1e6ec3d082722574b72d (patch)
tree59b4f2ee0cdd83b0c4906c0ae9e287e9288c542a
parent5a7c08a8c796a40d4cb04375ae198ea8325a9633 (diff)
Fix black screengrabs. (Wasn't initializing pixel tables)
Correct bitmap drawing. (Make it aware of buffer color order)
-rw-r--r--xc/extras/Mesa/src/FX/fxapi.c8
-rw-r--r--xc/extras/Mesa/src/FX/fxdd.c18
-rw-r--r--xc/extras/Mesa/src/FX/fxdrv.h6
-rw-r--r--xc/extras/Mesa/src/FX/fxsetup.c17
4 files changed, 26 insertions, 23 deletions
diff --git a/xc/extras/Mesa/src/FX/fxapi.c b/xc/extras/Mesa/src/FX/fxapi.c
index 8dec237e0..6ba7f1d94 100644
--- a/xc/extras/Mesa/src/FX/fxapi.c
+++ b/xc/extras/Mesa/src/FX/fxapi.c
@@ -975,7 +975,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
/* Pixel tables are use during pixel read-back */
#if FXMESA_USE_ARGB
- fxInitPixelTables(GL_FALSE); /* Force RGB pixel order */
+ fxInitPixelTables(fxMesa, GL_FALSE); /* Force RGB pixel order */
#else
if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
/* jk991130 - GROSS HACK!!! - Voodoo 3s don't use BGR!!
@@ -985,14 +985,14 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
* Thanks to Joseph Kain for that one
*/
if (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx == 2) {
- fxInitPixelTables(GL_FALSE); /* use RGB pixel order (Voodoo3) */
+ fxInitPixelTables(fxMesa, GL_FALSE); /* use RGB pixel order (Voodoo3) */
}
else {
- fxInitPixelTables(GL_TRUE); /* use BGR pixel order on Voodoo1/2 */
+ fxInitPixelTables(fxMesa, GL_TRUE); /* use BGR pixel order on Voodoo1/2 */
}
}
else {
- fxInitPixelTables(GL_FALSE); /* use RGB pixel order otherwise */
+ fxInitPixelTables(fxMesa, GL_FALSE); /* use RGB pixel order otherwise */
}
#endif
diff --git a/xc/extras/Mesa/src/FX/fxdd.c b/xc/extras/Mesa/src/FX/fxdd.c
index cbe63695f..d1f0f6ca6 100644
--- a/xc/extras/Mesa/src/FX/fxdd.c
+++ b/xc/extras/Mesa/src/FX/fxdd.c
@@ -70,9 +70,11 @@ GLubyte FX_PixelToB[0x10000];
* Initialize the FX_PixelTo{RGB} arrays.
* Input: bgrOrder - if TRUE, pixels are in BGR order, else RGB order.
*/
-void fxInitPixelTables(GLboolean bgrOrder)
+void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder)
{
GLuint pixel;
+
+ fxMesa->bgrOrder=bgrOrder;
for (pixel = 0; pixel <= 0xffff; pixel++) {
GLuint r, g, b;
if (bgrOrder) {
@@ -374,10 +376,16 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
g=(GLint)(ctx->Current.RasterColor[1]*255.0f);
b=(GLint)(ctx->Current.RasterColor[2]*255.0f);
a=(GLint)(ctx->Current.RasterColor[3]*255.0f);
- color=(FxU16)
- ( ((FxU16)0xf8 & b) <<(11-3)) |
- ( ((FxU16)0xfc & g) <<(5-3+1)) |
- ( ((FxU16)0xf8 & r) >> 3);
+ if (fxMesa->bgrOrder)
+ color=(FxU16)
+ ( ((FxU16)0xf8 & b) <<(11-3)) |
+ ( ((FxU16)0xfc & g) <<(5-3+1)) |
+ ( ((FxU16)0xf8 & r) >> 3);
+ else
+ color=(FxU16)
+ ( ((FxU16)0xf8 & r) <<(11-3)) |
+ ( ((FxU16)0xfc & g) <<(5-3+1)) |
+ ( ((FxU16)0xf8 & b) >> 3);
stride=info.strideInBytes>>1;
diff --git a/xc/extras/Mesa/src/FX/fxdrv.h b/xc/extras/Mesa/src/FX/fxdrv.h
index 08bd52043..e26f07ae2 100644
--- a/xc/extras/Mesa/src/FX/fxdrv.h
+++ b/xc/extras/Mesa/src/FX/fxdrv.h
@@ -437,6 +437,7 @@ struct tfxMesaContext {
GrBuffer_t currentFB;
+ GLboolean bgrOrder;
GrColor_t color;
GrColor_t clearC;
GrAlpha_t clearA;
@@ -670,9 +671,6 @@ extern void fxSetScissorValues(GLcontext *ctx);
extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa,
struct gl_texture_object *tObj,
GLint where);
-extern void fxSetupTexture_NoLock(GLcontext *ctx);
-extern void fxSetupTexture(GLcontext *ctx);
-
-extern void fxInitPixelTables(GLboolean bgrOrder);
+extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder);
#endif
diff --git a/xc/extras/Mesa/src/FX/fxsetup.c b/xc/extras/Mesa/src/FX/fxsetup.c
index 29e6533a4..9919deea6 100644
--- a/xc/extras/Mesa/src/FX/fxsetup.c
+++ b/xc/extras/Mesa/src/FX/fxsetup.c
@@ -59,10 +59,11 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
struct gl_texture_object *tObj0,
struct gl_texture_object *tObj1);
static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset);
-static void fxSetupTextureSingleTMU(GLcontext *ctx, GLuint textureset);
static void fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa,
struct gl_texture_object *tObj0,
struct gl_texture_object *tObj1);
+static void fxSetupTexture_NoLock(GLcontext *ctx);
+static void fxSetupTexture(GLcontext *ctx);
static void fxSetupBlend(GLcontext *ctx);
static void fxSetupDepthTest(GLcontext *ctx);
static void fxFogTableGenerate(GLcontext *ctx);
@@ -377,12 +378,6 @@ static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_obje
}
}
-static void fxSetupSingleTMU(fxMesaContext fxMesa, struct gl_texture_object *tObj) {
- BEGIN_BOARD_LOCK();
- fxSetupSingleTMU_NoLock(fxMesa, tObj);
- END_BOARD_LOCK();
-}
-
static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu,
FxBool LODblend)
{
@@ -981,7 +976,9 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
FXFALSE);
break;
}
-
+ default:
+ fprintf(stderr, "Unexpected dual texture mode encountered\n");
+ break;
}
if (MESA_VERBOSE&VERBOSE_DRIVER) {
@@ -1032,7 +1029,7 @@ static void fxSetupTextureNone_NoLock(GLcontext *ctx)
/************************** Texture Mode SetUp **************************/
/************************************************************************/
-void fxSetupTexture_NoLock(GLcontext *ctx)
+static void fxSetupTexture_NoLock(GLcontext *ctx)
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint tex2Denabled;
@@ -1076,7 +1073,7 @@ void fxSetupTexture_NoLock(GLcontext *ctx)
}
}
-void fxSetupTexture(GLcontext *ctx) {
+static void fxSetupTexture(GLcontext *ctx) {
BEGIN_BOARD_LOCK();
fxSetupTexture_NoLock(ctx);
END_BOARD_LOCK();