From ef563d011b5a11dc5f7a0da6445e68f14cc33062 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Tue, 18 Nov 2003 12:18:13 +0000 Subject: doc updates; GLUT timer additions; fixed compilation warnings --- src/mesa/drivers/glide/fxdd.c | 30 +++++++++++++----------------- src/mesa/drivers/glide/fxddtex.c | 35 +++++++++++------------------------ src/mesa/drivers/glide/fxwgl.c | 13 +++++++++++-- 3 files changed, 35 insertions(+), 43 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index e4f7637431..f4090122f5 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1220,26 +1220,22 @@ fxDDGetString(GLcontext * ctx, GLenum name) return (GLubyte *)fxMesa->rendererString; #if 0 /* hack to advertise vanilla extension names */ case GL_EXTENSIONS: - { - static const GLubyte *ext = NULL; - if (ext == NULL) { - GLubyte *x = _mesa_make_extension_string(ctx); - if (x != NULL) { - ext = _mesa_malloc(strlen((char *)x) + 1024); - if (ext != NULL) { - strcpy((char *)ext, (char *)x); + if (ctx->Extensions.String == NULL) { + GLubyte *ext = _mesa_make_extension_string(ctx); + if (ext != NULL) { + ctx->Extensions.String = _mesa_malloc(strlen((char *)ext) + 256); + if (ctx->Extensions.String != NULL) { + strcpy((char *)ctx->Extensions.String, (char *)ext); #if 0 /* put any additional extension names here */ - strcat((char *)ext, " 3DFX_set_global_palette"); + strcat((char *)ctx->Extensions.String, " 3DFX_set_global_palette"); #endif - _mesa_free(x); - } else { - ext = x; - } - ctx->Extensions.String = ext; - } - } - return ext; + _mesa_free(ext); + } else { + ctx->Extensions.String = ext; + } + } } + return ctx->Extensions.String; #endif default: return NULL; diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 9dc47ec8e4..b84f8d4a9d 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -539,6 +539,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, l = MAX2(logw, logh); aspectratio = logw - logh; + ws = hs = 1; /* hardware only allows a maximum aspect ratio of 8x1, so handle * |aspectratio| > 3 by scaling the image and using an 8x1 aspect @@ -548,44 +549,30 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, case 0: s = 256.0f; t = 256.0f; - ws = 1; - hs = 1; break; case 1: s = 256.0f; t = 128.0f; - ws = 1; - hs = 1; break; case 2: s = 256.0f; t = 64.0f; - ws = 1; - hs = 1; break; case 3: s = 256.0f; t = 32.0f; - ws = 1; - hs = 1; break; case -1: s = 128.0f; t = 256.0f; - ws = 1; - hs = 1; break; case -2: s = 64.0f; t = 256.0f; - ws = 1; - hs = 1; break; case -3: s = 32.0f; t = 256.0f; - ws = 1; - hs = 1; break; default: if (aspectratio > 3) { @@ -1129,30 +1116,30 @@ fxFetchFunction(GLint mesaFormat) { switch (mesaFormat) { case MESA_FORMAT_I8: - return fetch_intensity8; + return &fetch_intensity8; case MESA_FORMAT_A8: - return fetch_alpha8; + return &fetch_alpha8; case MESA_FORMAT_L8: - return fetch_luminance8; + return &fetch_luminance8; case MESA_FORMAT_CI8: - return fetch_index8; + return &fetch_index8; case MESA_FORMAT_AL88: - return fetch_luminance8_alpha8; + return &fetch_luminance8_alpha8; case MESA_FORMAT_RGB565: - return fetch_r5g6b5; + return &fetch_r5g6b5; case MESA_FORMAT_ARGB4444: - return fetch_r4g4b4a4; + return &fetch_r4g4b4a4; case MESA_FORMAT_ARGB1555: - return fetch_r5g5b5a1; + return &fetch_r5g5b5a1; case MESA_FORMAT_ARGB8888: - return fetch_a8r8g8b8; + return &fetch_a8r8g8b8; case MESA_FORMAT_RGB_FXT1: case MESA_FORMAT_RGBA_FXT1: case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_RGBA_DXT1: case MESA_FORMAT_RGBA_DXT3: case MESA_FORMAT_RGBA_DXT5: - return fetch_r4g4b4a4; + return &fetch_r4g4b4a4; default: _mesa_problem(NULL, "Unexpected format in fxFetchFunction"); return NULL; diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index 308cb9ba76..4609880f8d 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -57,6 +57,11 @@ extern "C" #define MAX_MESA_ATTRS 20 +#if (_MSC_VER >= 1200) +#pragma warning( push ) +#pragma warning( disable : 4273 ) +#endif + struct __extensions__ { PROC proc; @@ -69,7 +74,7 @@ struct __pixelformat__ GLint mesaAttr[MAX_MESA_ATTRS]; }; -//WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *); +WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *); struct __pixelformat__ pix[] = { /* 16bit RGB565 single buffer with depth */ @@ -866,7 +871,7 @@ wglDescribeLayerPlane(HDC hdc, int iPixelFormat, int iLayerPlane, GLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc, int iLayerPlane, int iStart, - int cEntries, CONST COLORREF *pcr) + int cEntries, COLORREF *pcr) { SetLastError(0); return (FALSE); @@ -887,4 +892,8 @@ wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, int iStart, return(FALSE); } +#if (_MSC_VER >= 1200) +#pragma warning( pop ) +#endif + #endif /* FX */ -- cgit v1.2.3