diff options
124 files changed, 761 insertions, 722 deletions
diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index 2d714c20c80..4e44c4fd480 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.70 2002/10/16 17:57:03 brianp Exp $ +# $Id: Makefile.X11,v 1.71 2002/10/24 23:57:19 brianp Exp $ # Mesa 3-D graphics library # Version: 4.1 @@ -55,7 +55,6 @@ CORE_SOURCES = \ light.c \ lines.c \ matrix.c \ - mem.c \ mmath.c \ pixel.c \ points.c \ diff --git a/src/mesa/array_cache/ac_context.c b/src/mesa/array_cache/ac_context.c index 4ecd643b4ca..a23fc128a7b 100644 --- a/src/mesa/array_cache/ac_context.c +++ b/src/mesa/array_cache/ac_context.c @@ -1,4 +1,4 @@ -/* $Id: ac_context.c,v 1.7 2002/04/21 19:39:48 brianp Exp $ */ +/* $Id: ac_context.c,v 1.8 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,7 +29,7 @@ #include "glheader.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c index 47afdd9d12b..b04e2cd2191 100644 --- a/src/mesa/array_cache/ac_import.c +++ b/src/mesa/array_cache/ac_import.c @@ -1,4 +1,4 @@ -/* $Id: ac_import.c,v 1.19 2002/04/21 21:03:02 brianp Exp $ */ +/* $Id: ac_import.c,v 1.20 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,7 +29,7 @@ #include "glheader.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index 0728c342733..14621617813 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -329,7 +329,6 @@ AMesaContext AMesaCreateContext(AMesaVisual visual, {
AMesaContext context;
GLboolean direct = GL_FALSE;
- __GLimports imports; context = (AMesaContext)calloc(1, sizeof(struct amesa_context));
if (!context)
@@ -339,10 +338,9 @@ AMesaContext AMesaCreateContext(AMesaVisual visual, context->Buffer = NULL;
context->ClearColor = 0;
context->CurrentColor = 0;
- _mesa_init_default_imports( &imports, (void *) context); context->GLContext = _mesa_create_context(visual->GLVisual,
share ? share->GLContext : NULL,
- &imports );
+ (void *) context, GL_FALSE );
if (!context->GLContext)
{
free(context);
diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 65c82da19a9..474d1336e3d 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -31,9 +31,6 @@ */
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "context.h"
#include "GL/dmesa.h"
@@ -54,7 +51,6 @@ #include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
-#endif
#include "video.h"
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 73f6f95b669..c7be61f0700 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -457,7 +457,6 @@ ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis) int err; ggi_color pal[256]; int i; - __GLimports imports; GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n"); @@ -468,10 +467,9 @@ ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis) ctx->ggi_visual = vis; ctx->color = 0; - _mesa_init_default_imports( &imports, (void *) ctx); ctx->gl_ctx = _mesa_create_context(&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual), - NULL, &imports); + NULL, (void *) ctx, GL_FALSE); if (!ctx->gl_ctx) goto free_context; diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index eb87837c9b6..a1fdf1dc871 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -1,4 +1,4 @@ -/* $Id: fxapi.c,v 1.34 2002/10/14 17:08:25 brianp Exp $ */ +/* $Id: fxapi.c,v 1.35 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -283,7 +283,6 @@ fxMesaCreateContext(GLuint win, char *errorstr; GLboolean useBGR; char *system = NULL; - __GLimports imports; if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: fxMesaCreateContext() Start\n"); @@ -509,10 +508,9 @@ fxMesaCreateContext(GLuint win, goto errorhandler; } - _mesa_init_default_imports( &imports, (void *) fxMesa); ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx, - &imports); + (void *) fxMesa, GL_TRUE); if (!ctx) { errorstr = "_mesa_create_context"; goto errorhandler; diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 27e4f146b9c..d6d3be5b709 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -1,4 +1,4 @@ -/* $Id: fxdrv.h,v 1.53 2002/06/13 04:28:30 brianp Exp $ */ +/* $Id: fxdrv.h,v 1.54 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -52,7 +52,6 @@ #include "imports.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mtypes.h" #include "GL/fxmesa.h" diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index dbe9d3d5c8b..bca894c8ec2 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -1,4 +1,4 @@ -/* $Id: fxtris.c,v 1.19 2002/08/21 02:56:58 brianp Exp $ */ +/* $Id: fxtris.c,v 1.20 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,16 +28,10 @@ * Keith Whitwell <keithw@valinux.com> */ -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif +#include "glheader.h" #ifdef FX -#include <stdio.h> -#include <math.h> - -#include "glheader.h" #include "mtypes.h" #include "macros.h" #include "colormac.h" diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index 24e01af0960..00203f17fba 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -1,4 +1,4 @@ -/* $Id: fxvb.c,v 1.14 2002/06/15 03:03:10 brianp Exp $ */ +/* $Id: fxvb.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -37,7 +37,7 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" #include "mmath.h" diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index 11df0933663..ab6b1a1fe85 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -1,4 +1,4 @@ -/* $Id: fxwgl.c,v 1.15 2002/09/04 14:14:36 brianp Exp $ */ +/* $Id: fxwgl.c,v 1.16 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -42,9 +42,9 @@ extern "C" { #endif -#include "fxdrv.h" #include <windows.h> -#include "GL/gl.h" +#include "glheader.h" +#include "fxdrv.h" #include "glapi.h" #ifdef __cplusplus diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index cc2081129df..5efb52391b6 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.92 2002/10/17 15:26:38 brianp Exp $ */ +/* $Id: osmesa.c,v 1.93 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -45,7 +45,6 @@ #include "imports.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" #include "texformat.h" @@ -139,7 +138,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, const GLuint i4 = 1; const GLubyte *i1 = (GLubyte *) &i4; const GLint little_endian = *i1; - __GLimports imports; rind = gind = bind = aind = 0; if (format==OSMESA_COLOR_INDEX) { @@ -292,12 +290,12 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, return NULL; } - _mesa_init_default_imports( &imports, (void *) osmesa ); if (!_mesa_initialize_context(&osmesa->gl_ctx, osmesa->gl_visual, sharelist ? &sharelist->gl_ctx : (GLcontext *) NULL, - &imports)) { + (void *) osmesa, + GL_FALSE)) { _mesa_destroy_visual( osmesa->gl_visual ); FREE(osmesa); return NULL; diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index 4581517678b..9f5e75199fe 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa.c,v 1.21 2002/10/14 17:08:27 brianp Exp $ */ +/* $Id: svgamesa.c,v 1.22 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,9 +34,6 @@ #ifdef SVGA -#ifdef PC_HEADER -#include "all.h" -#else #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -48,8 +45,6 @@ #include "matrix.h" #include "mtypes.h" #include "swrast/swrast.h" -#endif - #include "svgapix.h" #include "svgamesa8.h" #include "svgamesa15.h" @@ -355,7 +350,6 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) GLfloat redscale, greenscale, bluescale, alphascale; GLint index_bits; GLint redbits, greenbits, bluebits, alphabits; - __GLimports imports; /* determine if we're in RGB or color index mode */ if ((SVGABuffer.Depth==32) || (SVGABuffer.Depth==24)) { @@ -405,10 +399,9 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) 1 /* samples */ ); - _mesa_init_default_imports( &imports, (void *) ctx); ctx->gl_ctx = _mesa_create_context( ctx->gl_vis, NULL, /* share list context */ - &imports ); + (void *) ctx, GL_FALSE ); _mesa_enable_sw_extensions(ctx->gl_ctx); _mesa_enable_1_3_extensions(ctx->gl_ctx); diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index b18fe548ba7..3df9ae1aece 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $Id: wmesa.c,v 1.40 2002/10/14 17:08:28 brianp Exp $ */ +/* $Id: wmesa.c,v 1.41 2002/10/24 23:57:23 brianp Exp $ */ /* * Windows (Win32) device driver for Mesa 3.4 @@ -39,7 +39,6 @@ #include "imports.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" #include "texformat.h" @@ -1255,7 +1254,6 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, RECT CR; WMesaContext c; GLboolean true_color_flag; - __GLimports imports; c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); if (!c) @@ -1343,10 +1341,8 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, return NULL; } - _mesa_init_default_imports( &imports, (void *) c ); - /* allocate a new Mesa context */ - c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, &imports ); + c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, (void *) c, GL_FALSE ); if (!c->gl_ctx) { _mesa_destroy_visual( c->gl_visual ); diff --git a/src/mesa/drivers/windows/wmesa_stereo.c b/src/mesa/drivers/windows/wmesa_stereo.c index 1781b0e4397..adae152f761 100644 --- a/src/mesa/drivers/windows/wmesa_stereo.c +++ b/src/mesa/drivers/windows/wmesa_stereo.c @@ -1115,7 +1115,6 @@ WMesaContext /*APIENTRY*/ WMesaCreateContext( HWND hWnd, HPALETTE Pal, //HDC DC;
RECT CR;
WMesaContext c;
- __GLimports imports;
c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context));
if (!c)
@@ -1202,8 +1201,7 @@ WMesaContext /*APIENTRY*/ WMesaCreateContext( HWND hWnd, HPALETTE Pal, }
/* allocate a new Mesa context */
- _mesa_init_default_imports( &imports, (void *) c );
- c->gl_ctx = _mesa_create_context( c->gl_visual, &imports );
+ c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, (void *) g, GL_FALSE );
if (!c->gl_ctx) {
_mesa_destroy_visual( c->gl_visual );
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index e58fd268d93..99361b4d1a0 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.69 2002/10/05 18:27:41 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.70 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -48,7 +48,7 @@ #include "context.h" #include "config.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "xfonts.h" @@ -1823,7 +1823,7 @@ Fake_glXChooseFBConfig( Display *dpy, int screen, { XMesaVisual xmvis = choose_visual(dpy, screen, attribList); if (xmvis) { - GLXFBConfig *config = malloc(sizeof(XMesaVisual)); + GLXFBConfig *config = _mesa_malloc(sizeof(XMesaVisual)); if (!config) { *nitems = 0; return NULL; @@ -1866,7 +1866,7 @@ Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements ) visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements); if (*nelements > 0) { XMesaVisual *results; - results = malloc(*nelements * sizeof(XMesaVisual)); + results = _mesa_malloc(*nelements * sizeof(XMesaVisual)); if (!results) { *nelements = 0; return NULL; diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index 3aa17fec849..0f2dbbe1833 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -1,4 +1,4 @@ -/* $Id: xfonts.c,v 1.14 2001/04/26 19:28:02 brianp Exp $ */ +/* $Id: xfonts.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,19 +33,9 @@ #include <GL/vms_x_fix.h> #endif -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include "GL/gl.h" -#include "GL/glx.h" +#include "glxheader.h" #include "context.h" -#include "mem.h" +#include "imports.h" #include "xfonts.h" diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index c4463af6901..9ea50fb8bc7 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1,4 +1,4 @@ -/* $Id: xm_api.c,v 1.45 2002/10/14 17:08:34 brianp Exp $ */ +/* $Id: xm_api.c,v 1.46 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -71,12 +71,8 @@ #include "glthread.h" #include "imports.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif #include "macros.h" #include "texformat.h" #include "texstore.h" @@ -1619,7 +1615,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) static GLboolean firstTime = GL_TRUE; XMesaContext c; GLcontext *ctx; - __GLimports imports; + GLboolean direct = GL_TRUE; /* not really */ if (firstTime) { _glthread_INIT_MUTEX(_xmesa_lock); @@ -1631,10 +1627,9 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) return NULL; } - _mesa_init_default_imports( &imports, (void *) c ); ctx = c->gl_ctx = _mesa_create_context( &v->mesa_visual, share_list ? share_list->gl_ctx : (GLcontext *) NULL, - &imports ); + (void *) c, direct); if (!c->gl_ctx) { FREE(c); return NULL; diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index e0bc2be1d4c..67c7c441531 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1,4 +1,4 @@ -/* $Id: xm_dd.c,v 1.39 2002/10/14 17:08:38 brianp Exp $ */ +/* $Id: xm_dd.c,v 1.40 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "drawpix.h" #include "extensions.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "state.h" #include "texstore.h" diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index ec51de0d2e3..f891fa84032 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -1,4 +1,4 @@ -/* $Id: xm_span.c,v 1.16 2002/10/04 19:10:12 brianp Exp $ */ +/* $Id: xm_span.c,v 1.17 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "drawpix.h" #include "extensions.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "state.h" #include "xmesaP.h" diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 9184f0c0857..b83b7502790 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1,4 +1,4 @@ -/* $Id: xm_tri.c,v 1.27 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: xm_tri.c,v 1.28 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,7 +35,7 @@ #include "glxheader.h" #include "depth.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "xmesaP.h" diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 778fa4873c8..dce8a8a837e 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -1,10 +1,10 @@ -/* $Id: glthread.c,v 1.9 2001/11/12 23:50:12 brianp Exp $ */ +/* $Id: glthread.c,v 1.10 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -31,12 +31,8 @@ */ -#ifdef PC_ALL -#include "all.h" -#else #include "glheader.h" #include "glthread.h" -#endif /* diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11 index 2d714c20c80..4e44c4fd480 100644 --- a/src/mesa/main/Makefile.X11 +++ b/src/mesa/main/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.70 2002/10/16 17:57:03 brianp Exp $ +# $Id: Makefile.X11,v 1.71 2002/10/24 23:57:19 brianp Exp $ # Mesa 3-D graphics library # Version: 4.1 @@ -55,7 +55,6 @@ CORE_SOURCES = \ light.c \ lines.c \ matrix.c \ - mem.c \ mmath.c \ pixel.c \ points.c \ diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index d190508a615..7f0145d0be1 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -1,10 +1,10 @@ -/* $Id: accum.c,v 1.38 2001/09/14 21:36:43 brianp Exp $ */ +/* $Id: accum.c,v 1.39 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,20 +24,13 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "accum.h" #include "context.h" +#include "imports.h" #include "macros.h" -#include "mem.h" #include "state.h" #include "mtypes.h" -#endif - - void diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 0a39ecdefb9..5d8609b9104 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1,4 +1,4 @@ -/* $Id: api_arrayelt.c,v 1.9 2002/06/15 02:38:15 brianp Exp $ */ +/* $Id: api_arrayelt.c,v 1.10 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "api_arrayelt.h" #include "context.h" #include "glapi.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "mtypes.h" diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index c3aba1ad8b7..33e3ea140fa 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -1,4 +1,4 @@ -/* $Id: api_validate.c,v 1.6 2002/04/21 21:04:46 brianp Exp $ */ +/* $Id: api_validate.c,v 1.7 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,7 @@ #include "glheader.h" #include "api_validate.h" #include "context.h" +#include "imports.h" #include "mtypes.h" #include "state.h" diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 32a87f33ce3..aabea8c066a 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.74 2002/10/17 22:26:06 kschultz Exp $ */ +/* $Id: attrib.c,v 1.75 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,11 +24,8 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "accum.h" #include "attrib.h" #include "blend.h" @@ -43,7 +40,6 @@ #include "light.h" #include "lines.h" #include "matrix.h" -#include "mem.h" #include "points.h" #include "polygon.h" #include "simple_list.h" @@ -52,9 +48,6 @@ #include "texstate.h" #include "mtypes.h" #include "math/m_xform.h" -#endif - - /* diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 98385e0a70a..0b1f86e3e69 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,4 @@ -/* $Id: blend.c,v 1.37 2002/10/04 19:10:07 brianp Exp $ */ +/* $Id: blend.c,v 1.38 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "blend.h" #include "colormac.h" @@ -35,7 +32,6 @@ #include "enums.h" #include "macros.h" #include "mtypes.h" -#endif void diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index efb35531680..14994c61f73 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -1,4 +1,4 @@ -/* $Id: buffers.c,v 1.41 2002/10/11 17:41:03 brianp Exp $ */ +/* $Id: buffers.c,v 1.42 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,10 +25,8 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "accum.h" #include "buffers.h" #include "colormac.h" @@ -36,11 +34,9 @@ #include "depth.h" #include "enums.h" #include "macros.h" -#include "mem.h" #include "stencil.h" #include "state.h" #include "mtypes.h" -#endif diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 168ae350b27..79565a0fb31 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -1,4 +1,4 @@ -/* $Id: clip.c,v 1.25 2002/03/29 17:29:12 brianp Exp $ */ +/* $Id: clip.c,v 1.26 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "clip.h" #include "context.h" @@ -37,7 +34,6 @@ #include "math/m_xform.h" #include "math/m_matrix.h" -#endif diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 88963dccc68..fb5c94259dd 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -1,4 +1,4 @@ -/* $Id: colortab.c,v 1.45 2002/07/09 01:22:50 brianp Exp $ */ +/* $Id: colortab.c,v 1.46 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,19 +25,14 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "colortab.h" #include "context.h" #include "image.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "state.h" -#endif - /* diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 4bd36bbcded..fef403671ec 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,4 +1,4 @@ -/* $Id: context.c,v 1.185 2002/10/16 17:57:51 brianp Exp $ */ +/* $Id: context.c,v 1.186 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,10 +25,8 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "buffers.h" #include "clip.h" #include "colortab.h" @@ -43,7 +41,6 @@ #include "hash.h" #include "light.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "simple_list.h" #include "state.h" @@ -58,7 +55,7 @@ #include "math/m_matrix.h" #include "math/m_xform.h" #include "math/mathmod.h" -#endif + #if defined(MESA_TRACE) #include "Trace/tr_context.h" @@ -94,7 +91,7 @@ _mesa_destroyContext(__GLcontext *gc) { if (gc) { _mesa_free_context_data(gc); - (*gc->imports.free)(gc, gc); + _mesa_free(gc); } return GL_TRUE; } @@ -240,9 +237,8 @@ __glCoreCreateContext(__GLimports *imports, __GLcontextModes *modes) return NULL; } + _mesa_initialize_context(ctx, modes, NULL, imports, GL_FALSE); ctx->imports = *imports; - _mesa_init_default_exports(&(ctx->exports)); - _mesa_initialize_context(ctx, modes, NULL, imports); return ctx; } @@ -561,7 +557,7 @@ one_time_init( GLcontext *ctx ) #ifdef USE_SPARC_ASM _mesa_init_sparc_glapi_relocs(); #endif - if ((*ctx->imports.getenv)(ctx, "MESA_DEBUG")) { + if (_mesa_getenv("MESA_DEBUG")) { _glapi_noop_enable_warnings(GL_TRUE); #ifndef GLX_DIRECT_RENDERING /* libGL from before 2002/06/28 don't have this function. Someday, @@ -1477,13 +1473,13 @@ init_attrib_groups( GLcontext *ctx ) ctx->_Facing = 0; /* For debug/development only */ - ctx->NoRaster = (*ctx->imports.getenv)(ctx, "MESA_NO_RASTER") ? GL_TRUE : GL_FALSE; + ctx->NoRaster = _mesa_getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE; ctx->FirstTimeCurrent = GL_TRUE; /* Dither disable */ - ctx->NoDither = (*ctx->imports.getenv)(ctx, "MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; + ctx->NoDither = _mesa_getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; if (ctx->NoDither) { - if ((*ctx->imports.getenv)(ctx, "MESA_DEBUG")) { + if (_mesa_getenv("MESA_DEBUG")) { _mesa_debug(ctx, "MESA_NO_DITHER set - dithering disabled\n"); } ctx->Color.DitherFlag = GL_FALSE; @@ -1592,36 +1588,36 @@ alloc_proxy_textures( GLcontext *ctx ) static void add_debug_flags( const char *debug ) { #ifdef MESA_DEBUG - if (strstr(debug, "varray")) + if (_mesa_strstr(debug, "varray")) MESA_VERBOSE |= VERBOSE_VARRAY; - if (strstr(debug, "tex")) + if (_mesa_strstr(debug, "tex")) MESA_VERBOSE |= VERBOSE_TEXTURE; - if (strstr(debug, "imm")) + if (_mesa_strstr(debug, "imm")) MESA_VERBOSE |= VERBOSE_IMMEDIATE; - if (strstr(debug, "pipe")) + if (_mesa_strstr(debug, "pipe")) MESA_VERBOSE |= VERBOSE_PIPELINE; - if (strstr(debug, "driver")) + if (_mesa_strstr(debug, "driver")) MESA_VERBOSE |= VERBOSE_DRIVER; - if (strstr(debug, "state")) + if (_mesa_strstr(debug, "state")) MESA_VERBOSE |= VERBOSE_STATE; - if (strstr(debug, "api")) + if (_mesa_strstr(debug, "api")) MESA_VERBOSE |= VERBOSE_API; - if (strstr(debug, "list")) + if (_mesa_strstr(debug, "list")) MESA_VERBOSE |= VERBOSE_DISPLAY_LIST; - if (strstr(debug, "lighting")) + if (_mesa_strstr(debug, "lighting")) MESA_VERBOSE |= VERBOSE_LIGHTING; /* Debug flag: */ - if (strstr(debug, "flush")) + if (_mesa_strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; #endif } @@ -1635,16 +1631,18 @@ GLboolean _mesa_initialize_context( GLcontext *ctx, const GLvisual *visual, GLcontext *share_list, - const __GLimports *imports ) + void *driver_ctx, + GLboolean direct ) { GLuint dispatchSize; const char *c; - ASSERT(imports); - ASSERT(imports->other); /* other points to the device driver's context */ + ASSERT(driver_ctx); - /* assing imports */ - ctx->imports = *imports; + /* If the driver wants core Mesa to use special imports, it'll have to + * override these defaults. + */ + _mesa_init_default_imports( &(ctx->imports), driver_ctx ); /* initialize the exports (Mesa functions called by the window system) */ _mesa_init_default_exports( &(ctx->exports) ); @@ -1652,17 +1650,7 @@ _mesa_initialize_context( GLcontext *ctx, /* misc one-time initializations */ one_time_init(ctx); -#if 0 - /** - ** OpenGL SI stuff - **/ - if (!ctx->imports.malloc) { - _mesa_init_default_imports(&ctx->imports, driver_ctx); - } - /* exports are setup by the device driver */ -#endif - - ctx->DriverCtx = imports->other; + ctx->DriverCtx = driver_ctx; ctx->Visual = *visual; ctx->DrawBuffer = NULL; ctx->ReadBuffer = NULL; @@ -1860,11 +1848,11 @@ _mesa_initialize_context( GLcontext *ctx, } ctx->MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */ - c = (*ctx->imports.getenv)(ctx, "MESA_DEBUG"); + c = _mesa_getenv("MESA_DEBUG"); if (c) add_debug_flags(c); - c = (*ctx->imports.getenv)(ctx, "MESA_VERBOSE"); + c = _mesa_getenv("MESA_VERBOSE"); if (c) add_debug_flags(c); @@ -1877,29 +1865,31 @@ _mesa_initialize_context( GLcontext *ctx, * Allocate and initialize a GLcontext structure. * Input: visual - a GLvisual pointer (we copy the struct contents) * sharelist - another context to share display lists with or NULL - * imports - points to a fully-initialized __GLimports object. + * driver_ctx - pointer to device driver's context state struct + * direct - direct rendering? * Return: pointer to a new __GLcontextRec or NULL if error. */ GLcontext * _mesa_create_context( const GLvisual *visual, GLcontext *share_list, - const __GLimports *imports ) + void *driver_ctx, + GLboolean direct ) + { GLcontext *ctx; ASSERT(visual); - ASSERT(imports); - ASSERT(imports->calloc); + ASSERT(driver_ctx); - ctx = (GLcontext *) (*imports->calloc)(NULL, 1, sizeof(GLcontext)); + ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext)); if (!ctx) return NULL; - if (_mesa_initialize_context(ctx, visual, share_list, imports)) { + if (_mesa_initialize_context(ctx, visual, share_list, driver_ctx, direct)) { return ctx; } else { - (*imports->free)(NULL, ctx); + _mesa_free(ctx); return NULL; } } @@ -2281,7 +2271,7 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, * information. */ if (newCtx->FirstTimeCurrent) { - if ((*newCtx->imports.getenv)(newCtx, "MESA_INFO")) { + if (_mesa_getenv("MESA_INFO")) { print_info(); } newCtx->FirstTimeCurrent = GL_FALSE; diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 937b9c59a3d..8b1de0a53aa 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -1,4 +1,4 @@ -/* $Id: context.h,v 1.34 2002/10/14 17:08:21 brianp Exp $ */ +/* $Id: context.h,v 1.35 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,6 @@ #include "glapi.h" #include "mtypes.h" -#include "imports.h" /* @@ -128,13 +127,15 @@ _mesa_destroy_framebuffer( GLframebuffer *buffer ); extern GLcontext * _mesa_create_context( const GLvisual *visual, GLcontext *share_list, - const __GLimports *imports ); + void *driver_ctx, + GLboolean direct ); extern GLboolean _mesa_initialize_context( GLcontext *ctx, const GLvisual *visual, GLcontext *share_list, - const __GLimports *imports ); + void *driver_ctx, + GLboolean direct ); extern void _mesa_free_context_data( GLcontext *ctx ); diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index ce01a121871..a5e71b8cbdc 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -1,8 +1,8 @@ -/* $Id: convolve.c,v 1.27 2002/07/09 01:22:50 brianp Exp $ */ +/* $Id: convolve.c,v 1.28 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0.2 + * Version: 4.1 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * @@ -33,9 +33,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "convolve.h" @@ -43,7 +40,6 @@ #include "image.h" #include "mtypes.h" #include "state.h" -#endif /* diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 039f7a01a7b..2be25feb5a0 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -1,4 +1,4 @@ -/* $Id: debug.c,v 1.13 2002/06/29 19:48:15 brianp Exp $ */ +/* $Id: debug.c,v 1.14 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -26,9 +26,12 @@ #include "mtypes.h" #include "context.h" +#include "imports.h" #include "debug.h" -void _mesa_print_state( const char *msg, GLuint state ) + +void +_mesa_print_state( const char *msg, GLuint state ) { _mesa_debug(NULL, "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", @@ -62,7 +65,8 @@ void _mesa_print_state( const char *msg, GLuint state ) -void _mesa_print_tri_caps( const char *name, GLuint flags ) +void +_mesa_print_tri_caps( const char *name, GLuint flags ) { _mesa_debug(NULL, "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index 1ae912529bb..8383bcc6085 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -1,4 +1,4 @@ -/* $Id: depth.c,v 1.30 2002/06/15 02:38:15 brianp Exp $ */ +/* $Id: depth.c,v 1.31 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,18 +25,13 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "context.h" #include "enums.h" #include "depth.h" #include "macros.h" -#include "mem.h" #include "mtypes.h" -#endif - /**********************************************************************/ diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index 463bdb70d04..91155bc2c60 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -1,4 +1,4 @@ -/* $Id: dispatch.c,v 1.27 2002/06/29 19:48:15 brianp Exp $ */ +/* $Id: dispatch.c,v 1.28 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -36,14 +36,11 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "glapi.h" #include "glapitable.h" #include "glthread.h" -#endif + #if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index f8c21d97db8..5df4f6e2c89 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,4 +1,4 @@ -/* $Id: dlist.c,v 1.98 2002/10/16 17:57:51 brianp Exp $ */ +/* $Id: dlist.c,v 1.99 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,11 +24,8 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "api_loopback.h" #include "attrib.h" #include "blend.h" @@ -55,7 +52,6 @@ #include "dlist.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "pixel.h" #include "points.h" #include "polygon.h" @@ -72,8 +68,6 @@ #include "math/m_matrix.h" #include "math/m_xform.h" -#endif - /* @@ -4880,8 +4874,8 @@ execute_list( GLcontext *ctx, GLuint list ) default: { char msg[1000]; - _mesa_sprintf( ctx, msg, "Error in execute_list: opcode=%d", (int) opcode); - _mesa_problem( ctx, msg ); + _mesa_sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode); + _mesa_problem(ctx, msg); } done = GL_TRUE; } @@ -6275,13 +6269,13 @@ static void print_list( GLcontext *ctx, GLuint list ) GLboolean done; if (!glIsList(list)) { - _mesa_printf(ctx, "%u is not a display list ID\n", list); + _mesa_printf("%u is not a display list ID\n", list); return; } n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list); - _mesa_printf(ctx, "START-LIST %u, address %p\n", list, (void*)n ); + _mesa_printf("START-LIST %u, address %p\n", list, (void*)n ); done = n ? GL_FALSE : GL_TRUE; while (!done) { @@ -6295,136 +6289,136 @@ static void print_list( GLcontext *ctx, GLuint list ) else { switch (opcode) { case OPCODE_ACCUM: - _mesa_printf(ctx, "accum %s %g\n", enum_string(n[1].e), n[2].f ); + _mesa_printf("accum %s %g\n", enum_string(n[1].e), n[2].f ); break; case OPCODE_BITMAP: - _mesa_printf(ctx, "Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, + _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data ); break; case OPCODE_CALL_LIST: - _mesa_printf(ctx, "CallList %d\n", (int) n[1].ui ); + _mesa_printf("CallList %d\n", (int) n[1].ui ); break; case OPCODE_CALL_LIST_OFFSET: - _mesa_printf(ctx, "CallList %d + offset %u = %u\n", (int) n[1].ui, + _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui, ctx->List.ListBase, ctx->List.ListBase + n[1].ui ); break; case OPCODE_COLOR_TABLE_PARAMETER_FV: - _mesa_printf(ctx, "ColorTableParameterfv %s %s %f %f %f %f\n", + _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n", enum_string(n[1].e), enum_string(n[2].e), n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_COLOR_TABLE_PARAMETER_IV: - _mesa_printf(ctx, "ColorTableParameteriv %s %s %d %d %d %d\n", + _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n", enum_string(n[1].e), enum_string(n[2].e), n[3].i, n[4].i, n[5].i, n[6].i); break; case OPCODE_DISABLE: - _mesa_printf(ctx, "Disable %s\n", enum_string(n[1].e)); + _mesa_printf("Disable %s\n", enum_string(n[1].e)); break; case OPCODE_ENABLE: - _mesa_printf(ctx, "Enable %s\n", enum_string(n[1].e)); + _mesa_printf("Enable %s\n", enum_string(n[1].e)); break; case OPCODE_FRUSTUM: - _mesa_printf(ctx, "Frustum %g %g %g %g %g %g\n", + _mesa_printf("Frustum %g %g %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); break; case OPCODE_LINE_STIPPLE: - _mesa_printf(ctx, "LineStipple %d %x\n", n[1].i, (int) n[2].us ); + _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us ); break; case OPCODE_LOAD_IDENTITY: - _mesa_printf(ctx, "LoadIdentity\n"); + _mesa_printf("LoadIdentity\n"); break; case OPCODE_LOAD_MATRIX: - _mesa_printf(ctx, "LoadMatrix\n"); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf("LoadMatrix\n"); + _mesa_printf(" %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf(" %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf(" %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf(" %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); break; case OPCODE_MULT_MATRIX: - _mesa_printf(ctx, "MultMatrix (or Rotate)\n"); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf("MultMatrix (or Rotate)\n"); + _mesa_printf(" %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf(" %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf(" %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(ctx, " %8f %8f %8f %8f\n", + _mesa_printf(" %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); break; case OPCODE_ORTHO: - _mesa_printf(ctx, "Ortho %g %g %g %g %g %g\n", + _mesa_printf("Ortho %g %g %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); break; case OPCODE_POP_ATTRIB: - _mesa_printf(ctx, "PopAttrib\n"); + _mesa_printf("PopAttrib\n"); break; case OPCODE_POP_MATRIX: - _mesa_printf(ctx, "PopMatrix\n"); + _mesa_printf("PopMatrix\n"); break; case OPCODE_POP_NAME: - _mesa_printf(ctx, "PopName\n"); + _mesa_printf("PopName\n"); break; case OPCODE_PUSH_ATTRIB: - _mesa_printf(ctx, "PushAttrib %x\n", n[1].bf ); + _mesa_printf("PushAttrib %x\n", n[1].bf ); break; case OPCODE_PUSH_MATRIX: - _mesa_printf(ctx, "PushMatrix\n"); + _mesa_printf("PushMatrix\n"); break; case OPCODE_PUSH_NAME: - _mesa_printf(ctx, "PushName %d\n", (int) n[1].ui ); + _mesa_printf("PushName %d\n", (int) n[1].ui ); break; case OPCODE_RASTER_POS: - _mesa_printf(ctx, "RasterPos %g %g %g %g\n", + _mesa_printf("RasterPos %g %g %g %g\n", n[1].f, n[2].f,n[3].f,n[4].f); break; case OPCODE_ROTATE: - _mesa_printf(ctx, "Rotate %g %g %g %g\n", + _mesa_printf("Rotate %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_SCALE: - _mesa_printf(ctx, "Scale %g %g %g\n", n[1].f, n[2].f, n[3].f ); + _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f ); break; case OPCODE_TRANSLATE: - _mesa_printf(ctx, "Translate %g %g %g\n", n[1].f, n[2].f, n[3].f ); + _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f ); break; case OPCODE_BIND_TEXTURE: - _mesa_printf(ctx, "BindTexture %s %d\n", + _mesa_printf("BindTexture %s %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui); break; case OPCODE_SHADE_MODEL: - _mesa_printf(ctx, "ShadeModel %s\n", + _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); break; case OPCODE_MAP1: - _mesa_printf(ctx, "Map1 %s %.3f %.3f %d %d\n", + _mesa_printf("Map1 %s %.3f %.3f %d %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].f, n[3].f, n[4].i, n[5].i); break; case OPCODE_MAP2: - _mesa_printf(ctx, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", + _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].f, n[3].f, n[4].f, n[5].f, n[6].i, n[7].i, n[8].i, n[9].i); break; case OPCODE_MAPGRID1: - _mesa_printf(ctx, "MapGrid1 %d %.3f %.3f\n", + _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_MAPGRID2: - _mesa_printf(ctx, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", + _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f); break; case OPCODE_EVALMESH1: - _mesa_printf(ctx, "EvalMesh1 %d %d\n", n[1].i, n[2].i); + _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i); break; case OPCODE_EVALMESH2: - _mesa_printf(ctx, "EvalMesh2 %d %d %d %d\n", + _mesa_printf("EvalMesh2 %d %d %d %d\n", n[1].i, n[2].i, n[3].i, n[4].i); break; @@ -6432,27 +6426,25 @@ static void print_list( GLcontext *ctx, GLuint list ) * meta opcodes/commands */ case OPCODE_ERROR: - _mesa_printf(ctx, "Error: %s %s\n", + _mesa_printf("Error: %s %s\n", enum_string(n[1].e), (const char *)n[2].data ); break; case OPCODE_CONTINUE: - _mesa_printf(ctx, "DISPLAY-LIST-CONTINUE\n"); + _mesa_printf("DISPLAY-LIST-CONTINUE\n"); n = (Node *) n[1].next; break; case OPCODE_END_OF_LIST: - _mesa_printf(ctx, "END-LIST %u\n", list); + _mesa_printf("END-LIST %u\n", list); done = GL_TRUE; break; default: if (opcode < 0 || opcode > OPCODE_END_OF_LIST) { - _mesa_printf(ctx, - "ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", - opcode, (void*) n); + _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", + opcode, (void*) n); return; } else { - _mesa_printf(ctx, "command %d, %u operands\n", - opcode, InstSize[opcode]); + _mesa_printf("command %d, %u operands\n", opcode, InstSize[opcode]); } } /* increment n to point to next compiled command */ diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 663bef47e28..1dbeefa23b2 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -1,4 +1,4 @@ -/* $Id: drawpix.c,v 1.62 2002/08/21 16:39:39 brianp Exp $ */ +/* $Id: drawpix.c,v 1.63 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,22 +24,16 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "colormac.h" #include "context.h" #include "drawpix.h" #include "feedback.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "state.h" #include "mtypes.h" -#endif - /* diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 8f45a6706a7..744668fd293 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,4 +1,4 @@ -/* $Id: enable.c,v 1.70 2002/10/16 17:57:51 brianp Exp $ */ +/* $Id: enable.c,v 1.71 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "enable.h" @@ -39,7 +36,7 @@ #include "enums.h" #include "math/m_matrix.h" #include "math/m_xform.h" -#endif + #define CHECK_EXTENSION(EXTNAME, CAP) \ diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 93abf2ab5f8..f7a3e439ab8 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,4 +1,4 @@ -/* $Id: enums.c,v 1.21 2002/06/29 19:48:15 brianp Exp $ */ +/* $Id: enums.c,v 1.22 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,14 +28,9 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "enums.h" #include "imports.h" -#include "mem.h" -#endif typedef struct { @@ -929,7 +924,7 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } else { /* this isn't re-entrant safe, no big deal here */ - _mesa_sprintf(NULL, token_tmp, "0x%x", nr); + _mesa_sprintf(token_tmp, "0x%x", nr); return token_tmp; } } diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 2b02f9118b8..30767a6277e 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -1,4 +1,4 @@ -/* $Id: eval.c,v 1.23 2002/01/05 21:58:42 brianp Exp $ */ +/* $Id: eval.c,v 1.24 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -38,18 +38,14 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "colormac.h" #include "context.h" #include "eval.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" -#endif /* diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f37c07d33dc..88868b9633f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.83 2002/10/21 15:52:34 brianp Exp $ */ +/* $Id: extensions.c,v 1.84 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,17 +24,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "context.h" #include "extensions.h" -#include "mem.h" #include "simple_list.h" #include "mtypes.h" -#endif #define MAX_EXT_NAMELEN 80 diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index aead5bc65c5..330fd7d2be2 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -1,4 +1,4 @@ -/* $Id: feedback.c,v 1.26 2002/06/15 02:54:01 brianp Exp $ */ +/* $Id: feedback.c,v 1.27 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" @@ -36,7 +33,6 @@ #include "macros.h" #include "mmath.h" #include "mtypes.h" -#endif diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index dbb8269bd51..632a8ed32bb 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -1,4 +1,4 @@ -/* $Id: fog.c,v 1.35 2001/05/30 14:43:17 brianp Exp $ */ +/* $Id: fog.c,v 1.36 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,15 +25,11 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" #include "fog.h" #include "mtypes.h" -#endif diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 196740cb2e1..0d3db871dac 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.96 2002/10/16 17:57:52 brianp Exp $ */ +/* $Id: get.c,v 1.97 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" @@ -40,7 +37,6 @@ #include "mtypes.h" #include "texcompress.h" #include "math/m_matrix.h" -#endif diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 831c39f8ca2..71df0cbf5bf 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -1,4 +1,4 @@ -/* $Id: hash.c,v 1.13 2002/09/16 17:55:36 brianp Exp $ */ +/* $Id: hash.c,v 1.14 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,16 +24,11 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "glthread.h" #include "hash.h" #include "context.h" -#include "mem.h" -#endif /** diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index 57d7eae1fd7..7ccb7be5557 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -1,4 +1,4 @@ -/* $Id: hint.c,v 1.13 2002/06/15 02:54:02 brianp Exp $ */ +/* $Id: hint.c,v 1.14 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,15 +25,11 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "enums.h" #include "context.h" #include "hint.h" -#include "state.h" -#endif +#include "imports.h" diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index f115519dc63..134463956e2 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -1,4 +1,4 @@ -/* $Id: histogram.c,v 1.10 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: histogram.c,v 1.11 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,16 +25,12 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" #include "image.h" #include "histogram.h" #include "mmath.h" -#endif /* diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index 6432d91cf50..3cff4d0db5e 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -1,10 +1,10 @@ -/* $Id: histogram.h,v 1.3 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: histogram.h,v 1.4 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -28,14 +28,8 @@ #ifndef HISTOGRAM_H #define HISTOGRAM_H - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "mtypes.h" -#endif - extern void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index e881b79ca48..3830b0318ee 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.68 2002/09/21 17:34:56 brianp Exp $ */ +/* $Id: image.c,v 1.69 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,22 +24,16 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" #include "image.h" +#include "imports.h" #include "histogram.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "pixel.h" #include "mtypes.h" -#endif - /* diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 290df64cf1e..3b88009edd5 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1,4 +1,4 @@ -/* $Id: imports.c,v 1.20 2002/10/15 15:36:26 brianp Exp $ */ +/* $Id: imports.c,v 1.21 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,12 +32,17 @@ * etc. * * Some drivers will want to override/replace this file with something - * specialized, but most Mesa drivers will be able to call - *_mesa_init_default_imports() and go with what's here. + * specialized, but that'll be rare. * - * Eventually, I'd like to move most of the stuff in glheader.h and mem.[ch] - * into imports.[ch]. Then we'll really have one, single place where - * all OS-related dependencies are isolated. + * Eventually, I want to move roll the glheader.h file into this. + * + * The OpenGL SI's __GLimports structure allows per-context specification of + * replacements for the standard C lib functions. In practice that's probably + * never needed; compile-time replacements are far more likely. + * + * The _mesa_foo() functions defined here don't in general take a context + * parameter. I guess we can change that someday, if need be. + * So for now, the __GLimports stuff really isn't used. */ @@ -45,7 +50,7 @@ #include "mtypes.h" #include "context.h" #include "imports.h" -#include "mem.h" + #define MAXSTRING 4000 /* for vsnprintf() */ @@ -53,136 +58,243 @@ #define vsnprintf _vsnprintf #endif -static void * -_mesa_Malloc(__GLcontext *gc, size_t size) + +/**********************************************************************/ +/* Wrappers for standard C library functions */ +/**********************************************************************/ + + +void * +_mesa_malloc(size_t bytes) { - return MALLOC(size); +#ifdef XFree86LOADER + return xf86malloc(bytes); +#else + return malloc(bytes); +#endif } -static void * -_mesa_Calloc(__GLcontext *gc, size_t numElem, size_t elemSize) + +void * +_mesa_calloc(size_t bytes) { - return CALLOC(numElem * elemSize); +#ifdef XFree86LOADER + return xf86calloc(1, bytes); +#else + return calloc(1, bytes); +#endif } -static void * -_mesa_Realloc(__GLcontext *gc, void *oldAddr, size_t newSize) + +void +_mesa_free(void *ptr) { - return realloc(oldAddr, newSize); +#ifdef XFree86LOADER + xf86free(ptr); +#else + free(ptr); +#endif } -static void -_mesa_Free(__GLcontext *gc, void *addr) + +void * +_mesa_align_malloc(size_t bytes, unsigned long alignment) +{ + unsigned long ptr, buf; + + ASSERT( alignment > 0 ); + + ptr = (unsigned long) _mesa_malloc( bytes + alignment ); + + buf = (ptr + alignment) & ~(unsigned long)(alignment - 1); + *(unsigned long *)(buf - sizeof(void *)) = ptr; + +#ifdef DEBUG + /* mark the non-aligned area */ + while ( ptr < buf - sizeof(void *) ) { + *(unsigned long *)ptr = 0xcdcdcdcd; + ptr += sizeof(unsigned long); + } +#endif + + return (void *)buf; +} + + +void * +_mesa_align_calloc(size_t bytes, unsigned long alignment) { - FREE(addr); + unsigned long ptr, buf; + + ASSERT( alignment > 0 ); + + ptr = (unsigned long) _mesa_calloc( bytes + alignment ); + + buf = (ptr + alignment) & ~(unsigned long)(alignment - 1); + *(unsigned long *)(buf - sizeof(void *)) = ptr; + +#ifdef DEBUG + /* mark the non-aligned area */ + while ( ptr < buf - sizeof(void *) ) { + *(unsigned long *)ptr = 0xcdcdcdcd; + ptr += sizeof(unsigned long); + } +#endif + + return (void *)buf; } -/* Must be before '#undef getenv' for inclusion in XFree86. - */ -char * CAPI -_mesa_getenv(__GLcontext *gc, const char *var) +void +_mesa_align_free(void *ptr) +{ +#if 0 + _mesa_free( (void *)(*(unsigned long *)((unsigned long)ptr - sizeof(void *))) ); +#else + /* The actuall address to free is stuffed in the word immediately + * before the address the client sees. + */ + void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); + void *realAddr = *cubbyHole; + _mesa_free(realAddr); +#endif +} + + +void * +_mesa_memcpy(void *dest, const void *src, size_t n) { - (void) gc; #ifdef XFree86LOADER - return xf86getenv(var); + return xf86memcpy(dest, src, n); +#elif defined(SUNOS4) + return memcpy((char *) dest, (char *) src, (int) n); #else - return getenv(var); + return memcpy(dest, src, n); #endif } -static void -warning(__GLcontext *gc, char *str) +void +_mesa_memset( void *dst, int val, size_t n ) { - GLboolean debug; -#ifdef DEBUG - debug = GL_TRUE; +#ifdef XFree86LOADER + xf86memset( dst, val, n ); +#elif defined(SUNOS4) + memset( (char *) dst, (int) val, (int) n ); #else - if (_mesa_getenv(gc , "MESA_DEBUG")) - debug = GL_TRUE; - else - debug = GL_FALSE; + memset(dst, val, n); #endif - if (debug) { - fprintf(stderr, "Mesa warning: %s\n", str); - } } void -_mesa_fatal(__GLcontext *gc, char *str) +_mesa_memset16( unsigned short *dst, unsigned short val, size_t n ) { - (void) gc; - fprintf(stderr, "%s\n", str); - abort(); + while (n-- > 0) + *dst++ = val; } -static int CAPI -_mesa_atoi(__GLcontext *gc, const char *str) +void +_mesa_bzero( void *dst, size_t n ) { - (void) gc; - return atoi(str); +#ifdef XFree86LOADER + xf86memset( dst, 0, n ); +#elif defined(__FreeBSD__) + bzero( dst, n ); +#else + memset( dst, 0, n ); +#endif } -int CAPI -_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) +char * +_mesa_getenv( const char *var ) { - int r; - va_list args; - va_start( args, fmt ); - r = vsprintf( str, fmt, args ); - va_end( args ); - return r; +#ifdef XFree86LOADER + return xf86getenv(var); +#else + return getenv(var); +#endif } -void * CAPI -_mesa_fopen(__GLcontext *gc, const char *path, const char *mode) +char * +_mesa_strstr( const char *haystack, const char *needle ) { - return fopen(path, mode); +#ifdef XFree86LOADER + return xf86strstr(haystack, needle); +#else + return strstr(haystack, needle); +#endif } -int CAPI -_mesa_fclose(__GLcontext *gc, void *stream) +int +_mesa_atoi(const char *s) { - return fclose((FILE *) stream); +#ifdef XFree86LOADER + return xf86atoi(s); +#else + return atoi(s); +#endif } -int CAPI -_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) +int +_mesa_sprintf( char *str, const char *fmt, ... ) { int r; va_list args; va_start( args, fmt ); - r = vfprintf( (FILE *) stream, fmt, args ); va_end( args ); +#ifdef XFree86LOADER + r = xf86vsprintf( str, fmt, args ); +#else + r = vsprintf( str, fmt, args ); +#endif return r; } -/* XXX this really is driver-specific and can't be here */ -static __GLdrawablePrivate * -_mesa_GetDrawablePrivate(__GLcontext *gc) +void +_mesa_printf( const char *fmtString, ... ) { - return NULL; + char s[MAXSTRING]; + va_list args; + va_start( args, fmtString ); + vsnprintf(s, MAXSTRING, fmtString, args); + va_end( args ); +#ifdef XFree86LOADER + xf86printf("%s", s); +#else + printf("%s", s); +#endif } - void -_mesa_warning(__GLcontext *gc, const char *fmtString, ...) +_mesa_warning( GLcontext *ctx, const char *fmtString, ... ) { + GLboolean debug; char str[MAXSTRING]; va_list args; + (void) ctx; va_start( args, fmtString ); (void) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); - warning(gc, str); +#ifdef DEBUG + debug = GL_TRUE; /* always print warning */ +#else + debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE; +#endif + if (debug) { +#ifdef XFree86LOADER + xf86fprintf(stderr, "Mesa warning: %s\n", str); +#else + fprintf(stderr, "Mesa warning: %s\n", str); +#endif + } } @@ -193,23 +305,14 @@ _mesa_warning(__GLcontext *gc, const char *fmtString, ...) void _mesa_problem( const GLcontext *ctx, const char *s ) { - if (ctx) { - ctx->imports.fprintf((GLcontext *) ctx, stderr, "Mesa implementation error: %s\n", s); -#ifdef XF86DRI - ctx->imports.fprintf((GLcontext *) ctx, stderr, "Please report to the DRI bug database at dri.sourceforge.net\n"); -#else - ctx->imports.fprintf((GLcontext *) ctx, stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" ); -#endif - } - else { - /* what can we do if we don't have a context???? */ - fprintf( stderr, "Mesa implementation error: %s\n", s ); -#ifdef XF86DRI - fprintf( stderr, "Please report to the DRI bug database at dri.sourceforge.net\n"); + (void) ctx; +#ifdef XFree86LOADER + xf86fprintf(stderr, "Mesa implementation error: %s\n", s); + xf86fprintf(stderr, "Please report to the DRI project at dri.sourceforge.net\n"); #else - fprintf( stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" ); + fprintf(stderr, "Mesa implementation error: %s\n", s); + fprintf(stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" ); #endif - } } @@ -226,10 +329,10 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) const char *debugEnv; GLboolean debug; - debugEnv = _mesa_getenv(ctx, "MESA_DEBUG"); + debugEnv = _mesa_getenv("MESA_DEBUG"); #ifdef DEBUG - if (debugEnv && strstr(debugEnv, "silent")) + if (debugEnv && _mesa_strstr(debugEnv, "silent")) debug = GL_FALSE; else debug = GL_TRUE; @@ -295,31 +398,122 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) va_list args; va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); - if (ctx) - (void) ctx->imports.fprintf( (__GLcontext *) ctx, stderr, s ); - else - fprintf( stderr, s ); va_end(args); +#ifdef XFree86LOADER + xf86fprintf(stderr, "Mesa: %s", s); +#else + fprintf(stderr, "Mesa: %s", s); +#endif } -/* - * A wrapper for printf. Uses stdout. - */ -void -_mesa_printf( const GLcontext *ctx, const char *fmtString, ... ) + +/**********************************************************************/ +/* Default Imports Wrapper */ +/**********************************************************************/ + +static void * +default_malloc(__GLcontext *gc, size_t size) { - char s[MAXSTRING]; + (void) gc; + return _mesa_malloc(size); +} + +static void * +default_calloc(__GLcontext *gc, size_t numElem, size_t elemSize) +{ + (void) gc; + return _mesa_calloc(numElem * elemSize); +} + +static void * +default_realloc(__GLcontext *gc, void *oldAddr, size_t newSize) +{ + (void) gc; +#ifdef XFree86LOADER + return xf86realloc(oldAddr, newSize); +#else + return realloc(oldAddr, newSize); +#endif +} + +static void +default_free(__GLcontext *gc, void *addr) +{ + (void) gc; + _mesa_free(addr); +} + +static char * CAPI +default_getenv( __GLcontext *gc, const char *var ) +{ + (void) gc; + return _mesa_getenv(var); +} + +static void +default_warning(__GLcontext *gc, char *str) +{ + _mesa_warning(gc, str); +} + +static void +default_fatal(__GLcontext *gc, char *str) +{ + _mesa_problem(gc, str); + abort(); +} + +static int CAPI +default_atoi(__GLcontext *gc, const char *str) +{ + (void) gc; + return atoi(str); +} + +static int CAPI +default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) +{ + int r; va_list args; - va_start( args, fmtString ); - vsnprintf(s, MAXSTRING, fmtString, args); - if (ctx) - (void) ctx->imports.fprintf( (__GLcontext *) ctx, stdout, s ); - else - printf( s ); + va_start( args, fmt ); + r = vsprintf( str, fmt, args ); va_end( args ); + return r; } +static void * CAPI +default_fopen(__GLcontext *gc, const char *path, const char *mode) +{ + return fopen(path, mode); +} + +static int CAPI +default_fclose(__GLcontext *gc, void *stream) +{ + return fclose((FILE *) stream); +} + +static int CAPI +default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) +{ + int r; + va_list args; + va_start( args, fmt ); + r = vfprintf( (FILE *) stream, fmt, args ); + va_end( args ); + return r; +} + +/* XXX this really is driver-specific and can't be here */ +static __GLdrawablePrivate * +default_GetDrawablePrivate(__GLcontext *gc) +{ + return NULL; +} + + + /* * Initialize a __GLimports object to point to the functions in @@ -330,18 +524,18 @@ _mesa_printf( const GLcontext *ctx, const char *fmtString, ... ) void _mesa_init_default_imports(__GLimports *imports, void *driverCtx) { - imports->malloc = _mesa_Malloc; - imports->calloc = _mesa_Calloc; - imports->realloc = _mesa_Realloc; - imports->free = _mesa_Free; - imports->warning = warning; - imports->fatal = _mesa_fatal; - imports->getenv = _mesa_getenv; - imports->atoi = _mesa_atoi; - imports->sprintf = _mesa_sprintf; - imports->fopen = _mesa_fopen; - imports->fclose = _mesa_fclose; - imports->fprintf = _mesa_fprintf; - imports->getDrawablePrivate = _mesa_GetDrawablePrivate; + imports->malloc = default_malloc; + imports->calloc = default_calloc; + imports->realloc = default_realloc; + imports->free = default_free; + imports->warning = default_warning; + imports->fatal = default_fatal; + imports->getenv = default_getenv; /* not used for now */ + imports->atoi = default_atoi; + imports->sprintf = default_sprintf; + imports->fopen = default_fopen; + imports->fclose = default_fclose; + imports->fprintf = default_fprintf; + imports->getDrawablePrivate = default_GetDrawablePrivate; imports->other = driverCtx; } diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 9363c4163e1..4054ed0c941 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -1,4 +1,4 @@ -/* $Id: imports.h,v 1.5 2002/10/15 15:36:26 brianp Exp $ */ +/* $Id: imports.h,v 1.6 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,48 +25,140 @@ */ +/* + * This file provides wrappers for all the standard C library functions + * like malloc, free, printf, getenv, etc. + */ + + #ifndef IMPORTS_H #define IMPORTS_H -#include "glheader.h" +#define MALLOC(BYTES) _mesa_malloc(BYTES) +#define CALLOC(BYTES) _mesa_calloc(BYTES) +#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T)) +#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) +#define FREE(PTR) _mesa_free(PTR) + +#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N) +#define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N) +#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N) +#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N) +#define ALIGN_FREE(PTR) _mesa_align_free(PTR) + +#define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES) +#define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N) +#define BZERO( ADDR, N ) _mesa_bzero(ADDR, N) + + +/* MACs and BeOS don't support static larger than 32kb, so... */ +#if defined(macintosh) && !defined(__MRC__) +/*extern char *AGLAlloc(int size);*/ +/*extern void AGLFree(char* ptr);*/ +# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_alloc(sizeof(TYPE)*(SIZE)) +# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2)) +# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3)) + +# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0) +# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0) +#elif defined(__BEOS__) +# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_malloc(sizeof(TYPE)*(SIZE)) +# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)) +# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3)) +# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0) +# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0) +#else +# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE] +# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2] +# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3] +# define CHECKARRAY(NAME,CMD) do {} while(0) +# define UNDEFARRAY(NAME) +#endif -extern int CAPI -_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...); +#ifdef MESA_EXTERNAL_BUFFERALLOC +/* + * If you want Mesa's depth/stencil/accum/etc buffers to be allocated + * with a specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC + * and implement _ext_mesa_alloc/free_pixelbuffer() in your app. + * Contributed by Gerk Huisma (gerk@five-d.demon.nl). + */ +extern void *_ext_mesa_alloc_pixelbuffer( unsigned int size ); +extern void _ext_mesa_free_pixelbuffer( void *pb ); + +#define MESA_PBUFFER_ALLOC(BYTES) (void *) _ext_mesa_alloc_pixelbuffer(BYTES) +#define MESA_PBUFFER_FREE(PTR) _ext_mesa_free_pixelbuffer(PTR) +#else +/* Default buffer allocation uses the aligned allocation routines: */ +#define MESA_PBUFFER_ALLOC(BYTES) (void *) _mesa_align_malloc(BYTES, 512) +#define MESA_PBUFFER_FREE(PTR) _mesa_align_free(PTR) +#endif + + +extern void * +_mesa_malloc( size_t bytes ); + +extern void * +_mesa_calloc( size_t bytes ); extern void -_mesa_warning(__GLcontext *gc, const char *fmtString, ...); +_mesa_free( void *ptr ); + +extern void * +_mesa_align_malloc( size_t bytes, unsigned long alignment ); + +extern void * +_mesa_align_calloc( size_t bytes, unsigned long alignment ); extern void -_mesa_fatal(__GLcontext *gc, char *str); +_mesa_align_free( void *ptr ); + +extern void * +_mesa_memcpy( void *dest, const void *src, size_t n ); extern void -_mesa_problem( const __GLcontext *ctx, const char *s ); +_mesa_memset( void *dst, int val, size_t n ); extern void -_mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... ); +_mesa_memset16( unsigned short *dst, unsigned short val, size_t n ); extern void -_mesa_debug( const __GLcontext *ctx, const char *fmtString, ... ); +_mesa_bzero( void *dst, size_t n ); + + +extern char * +_mesa_getenv( const char *var ); + +extern char * +_mesa_strstr( const char *haystack, const char *needle ); + +extern int +_mesa_atoi( const char *s ); + +extern int +_mesa_sprintf( char *str, const char *fmt, ... ); + +extern void +_mesa_printf( const char *fmtString, ... ); + extern void -_mesa_printf( const __GLcontext *ctx, const char *fmtString, ... ); +_mesa_warning( __GLcontext *gc, const char *fmtString, ... ); -extern int CAPI -_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...); +extern void +_mesa_problem( const __GLcontext *ctx, const char *s ); -extern void * CAPI -_mesa_fopen(__GLcontext *gc, const char *path, const char *mode); +extern void +_mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... ); -extern int CAPI -_mesa_fclose(__GLcontext *gc, void *stream); +extern void +_mesa_debug( const __GLcontext *ctx, const char *fmtString, ... ); -extern char * CAPI -_mesa_getenv(__GLcontext *gc, const char *var); extern void -_mesa_init_default_imports(__GLimports *imports, void *driverCtx); +_mesa_init_default_imports( __GLimports *imports, void *driverCtx ); -#endif +#endif /* IMPORTS_H */ + diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index ebddab0d282..638be5e8353 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,4 @@ -/* $Id: light.c,v 1.52 2002/09/16 17:56:02 brianp Exp $ */ +/* $Id: light.c,v 1.53 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,23 +25,18 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "colormac.h" #include "context.h" #include "enums.h" #include "light.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "simple_list.h" #include "mtypes.h" - #include "math/m_xform.h" #include "math/m_matrix.h" -#endif /* XXX this is a bit of a hack needed for compilation within XFree86 */ diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 303ab71379c..0a33e1399e8 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -1,4 +1,4 @@ -/* $Id: lines.c,v 1.29 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: lines.c,v 1.30 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "depth.h" @@ -36,8 +33,6 @@ #include "mmath.h" #include "texstate.h" #include "mtypes.h" -#endif - void diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 1ad72f11b6b..0b5f0014024 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,4 +1,4 @@ -/* $Id: matrix.c,v 1.44 2002/08/21 16:39:39 brianp Exp $ */ +/* $Id: matrix.c,v 1.45 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,21 +35,17 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "buffers.h" #include "context.h" #include "enums.h" #include "macros.h" #include "matrix.h" -#include "mem.h" #include "mmath.h" #include "mtypes.h" - #include "math/m_matrix.h" -#endif + void diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index ce1b2c57c2d..7ae50a77165 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,4 +1,4 @@ -/* $Id: pixel.c,v 1.36 2002/09/21 17:34:56 brianp Exp $ */ +/* $Id: pixel.c,v 1.37 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,19 +24,13 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" #include "pixel.h" #include "mtypes.h" -#endif - /**********************************************************************/ diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index cf9922479d5..f162da4b5bf 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -1,4 +1,4 @@ -/* $Id: points.c,v 1.33 2002/05/27 17:04:53 brianp Exp $ */ +/* $Id: points.c,v 1.34 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "macros.h" @@ -35,7 +32,6 @@ #include "points.h" #include "texstate.h" #include "mtypes.h" -#endif diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index 91c3933b543..a347b615df1 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -1,4 +1,4 @@ -/* $Id: polygon.c,v 1.24 2002/10/02 22:05:58 brianp Exp $ */ +/* $Id: polygon.c,v 1.25 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,19 +25,14 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "context.h" #include "image.h" #include "enums.h" #include "macros.h" -#include "mem.h" #include "polygon.h" #include "mtypes.h" -#endif - void diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 945eea9ecce..bb03c456973 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -1,4 +1,4 @@ -/* $Id: rastpos.c,v 1.38 2002/05/27 17:03:08 brianp Exp $ */ +/* $Id: rastpos.c,v 1.39 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "clip.h" #include "colormac.h" @@ -43,7 +40,6 @@ #include "math/m_matrix.h" #include "math/m_xform.h" -#endif /* diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 4df1afbc831..6948c78e7d6 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.95 2002/10/16 17:57:52 brianp Exp $ */ +/* $Id: state.c,v 1.96 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,9 +31,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "accum.h" #include "api_loopback.h" @@ -75,7 +72,6 @@ #include "math/m_matrix.h" #include "math/m_xform.h" -#endif static int diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 99f213c8541..b6afd660e6c 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,4 +1,4 @@ -/* $Id: stencil.c,v 1.28 2002/09/06 02:56:09 brianp Exp $ */ +/* $Id: stencil.c,v 1.29 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,20 +25,14 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" +#include "imports.h" #include "context.h" #include "depth.h" #include "macros.h" -#include "mem.h" #include "stencil.h" #include "mtypes.h" #include "enable.h" -#endif - - void diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 680c0bb0239..8474b4ee87f 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -1,4 +1,4 @@ -/* $Id: texcompress.c,v 1.2 2002/10/18 17:41:45 brianp Exp $ */ +/* $Id: texcompress.c,v 1.3 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -26,9 +26,9 @@ #include "glheader.h" +#include "imports.h" #include "context.h" #include "image.h" -#include "mem.h" #include "texcompress.h" #include "texformat.h" diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 1941c7a7b38..54257732e21 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -1,4 +1,4 @@ -/* $Id: texformat.c,v 1.16 2002/09/27 02:45:38 brianp Exp $ */ +/* $Id: texformat.c,v 1.17 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,20 +27,16 @@ * Gareth Hughes <gareth@valinux.com> */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" #include "image.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "texformat.h" #include "teximage.h" #include "texstate.h" -#endif /* Texel fetch routines for all supported formats: diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 74b526e0f3d..f7f428eb4e4 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,4 +1,4 @@ -/* $Id: teximage.c,v 1.122 2002/10/18 18:03:04 brianp Exp $ */ +/* $Id: teximage.c,v 1.123 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,16 +24,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "convolve.h" #include "image.h" +#include "imports.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "state.h" #include "texcompress.h" @@ -42,7 +38,6 @@ #include "texstate.h" #include "texstore.h" #include "mtypes.h" -#endif /* @@ -65,7 +60,7 @@ static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img) const GLchan *data = (const GLchan *) img->Data; if (!data) { - _mesa_printf(ctx, "No texture data\n"); + _mesa_printf("No texture data\n"); return; } @@ -93,16 +88,16 @@ static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img) for (i = 0; i < img->Height; i++) { for (j = 0; j < img->Width; j++) { if (c==1) - _mesa_printf(ctx, "%02x ", data[0]); + _mesa_printf("%02x ", data[0]); else if (c==2) - _mesa_printf(ctx, "%02x%02x ", data[0], data[1]); + _mesa_printf("%02x%02x ", data[0], data[1]); else if (c==3) - _mesa_printf(ctx, "%02x%02x%02x ", data[0], data[1], data[2]); + _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); else if (c==4) - _mesa_printf(ctx, "%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); + _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); data += (img->RowStride - img->Width) * c; } - _mesa_printf(ctx, "\n"); + _mesa_printf("\n"); } #endif } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index c58df0764c0..93ae40ac745 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.61 2002/10/22 15:15:41 brianp Exp $ */ +/* $Id: texobj.c,v 1.62 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,23 +24,17 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colortab.h" #include "context.h" #include "enums.h" #include "hash.h" +#include "imports.h" #include "macros.h" -#include "mem.h" #include "teximage.h" #include "texstate.h" #include "texobj.h" #include "mtypes.h" -#endif - /* diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 373b464a3c4..6c8dcc06703 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.83 2002/10/23 14:53:27 brianp Exp $ */ +/* $Id: texstate.c,v 1.84 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "colormac.h" #include "context.h" @@ -40,7 +37,6 @@ #include "mtypes.h" #include "math/m_xform.h" #include "math/m_matrix.h" -#endif diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 2be6e476458..046e5289c52 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,4 +1,4 @@ -/* $Id: texstore.c,v 1.44 2002/10/18 18:03:08 brianp Exp $ */ +/* $Id: texstore.c,v 1.45 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -53,13 +53,13 @@ */ - +#include "glheader.h" #include "colormac.h" #include "context.h" #include "convolve.h" #include "image.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "texcompress.h" #include "texformat.h" #include "teximage.h" diff --git a/src/mesa/main/texutil.c b/src/mesa/main/texutil.c index 28a715a7237..94c052facae 100644 --- a/src/mesa/main/texutil.c +++ b/src/mesa/main/texutil.c @@ -1,4 +1,4 @@ -/* $Id: texutil.c,v 1.32 2002/09/27 02:45:38 brianp Exp $ */ +/* $Id: texutil.c,v 1.33 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,19 +35,16 @@ */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "enums.h" #include "image.h" +#include "imports.h" #include "macros.h" -#include "mem.h" #include "mtypes.h" #include "texformat.h" #include "texutil.h" -#endif + #define DEBUG_TEXUTIL 0 diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 3fd318e7d4c..1b540eff447 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1,4 +1,4 @@ -/* $Id: varray.c,v 1.46 2002/06/30 15:47:01 brianp Exp $ */ +/* $Id: varray.c,v 1.47 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -24,9 +24,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "context.h" #include "enable.h" @@ -40,7 +37,6 @@ #include "mtypes.h" #include "varray.h" #include "math/m_translate.h" -#endif diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 44e387f92c5..54eef4a6028 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -1,4 +1,4 @@ -/* $Id: vtxfmt.c,v 1.12 2002/06/29 19:48:16 brianp Exp $ */ +/* $Id: vtxfmt.c,v 1.13 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,6 +31,7 @@ #include "glheader.h" #include "api_loopback.h" #include "context.h" +#include "imports.h" #include "mtypes.h" #include "state.h" #include "vtxfmt.h" diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index 40230605b4c..b6d4a0cd4a6 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -1,4 +1,4 @@ -/* $Id: m_debug_clip.c,v 1.2 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: m_debug_clip.c,v 1.3 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index ec56244e984..7487300d49a 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -1,4 +1,4 @@ -/* $Id: m_debug_norm.c,v 1.9 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: m_debug_norm.c,v 1.10 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "m_matrix.h" diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index fb79a313d8e..f556a4a3331 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -1,4 +1,4 @@ -/* $Id: m_debug_xform.c,v 1.9 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: m_debug_xform.c,v 1.10 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 95b6ebed569..4b346860d61 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1,4 +1,4 @@ -/* $Id: m_matrix.c,v 1.13 2002/09/12 16:26:04 brianp Exp $ */ +/* $Id: m_matrix.c,v 1.14 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,12 +34,10 @@ * 3. Transformation of a point p by a matrix M is: p' = M * p */ -#include <math.h> - #include "glheader.h" #include "imports.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "m_matrix.h" diff --git a/src/mesa/math/m_norm_tmp.h b/src/mesa/math/m_norm_tmp.h index 7c8ec180c27..55861e8ca3a 100644 --- a/src/mesa/math/m_norm_tmp.h +++ b/src/mesa/math/m_norm_tmp.h @@ -1,4 +1,4 @@ -/* $Id: m_norm_tmp.h,v 1.11 2002/04/09 14:58:04 keithw Exp $ */ +/* $Id: m_norm_tmp.h,v 1.12 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,9 +32,6 @@ * the transformation matrix, rescaling and normalization. */ -#include <math.h> - - /* * mat - the 4x4 transformation matrix * scale - uniform scale factor of the transformation matrix (not always used) diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c index 349c2286ea5..ffd4d6a017f 100644 --- a/src/mesa/math/m_translate.c +++ b/src/mesa/math/m_translate.c @@ -1,10 +1,10 @@ -/* $Id: m_translate.c,v 1.9 2001/09/18 23:06:14 kschultz Exp $ */ +/* $Id: m_translate.c,v 1.10 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -32,7 +32,6 @@ #include "glheader.h" #include "mtypes.h" /* GLchan hack */ #include "colormac.h" -#include "mem.h" #include "mmath.h" #include "m_translate.h" diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index b94afdd126b..186aa0b8241 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -1,4 +1,4 @@ -/* $Id: m_vector.c,v 1.7 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: m_vector.c,v 1.8 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "glheader.h" #include "imports.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "m_vector.h" diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index 4c5053b1c37..beda08c589c 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -1,4 +1,4 @@ -/* $Id: m_xform.c,v 1.17 2002/07/10 01:25:50 brianp Exp $ */ +/* $Id: m_xform.c,v 1.18 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,8 +35,6 @@ * 3. Transformation of a point p by a matrix M is: p' = M * p */ -#include <math.h> - #include "glheader.h" #include "macros.h" #include "mmath.h" diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index ddcef4cd57d..6c304fd90f4 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -1,4 +1,4 @@ -/* $Id: s_aatriangle.c,v 1.25 2002/10/18 17:02:01 kschultz Exp $ */ +/* $Id: s_aatriangle.c,v 1.26 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,8 +30,9 @@ */ +#include "glheader.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "s_aatriangle.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 0159304c172..18f82eb0152 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -1,4 +1,4 @@ -/* $Id: s_accum.c,v 1.18 2002/07/09 01:22:52 brianp Exp $ */ +/* $Id: s_accum.c,v 1.19 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,7 +29,7 @@ #include "context.h" #include "macros.h" #include "mmath.h" -#include "mem.h" +#include "imports.h" #include "s_accum.h" #include "s_alphabuf.h" diff --git a/src/mesa/swrast/s_alphabuf.c b/src/mesa/swrast/s_alphabuf.c index d68e6bf82b2..b5a2e315132 100644 --- a/src/mesa/swrast/s_alphabuf.c +++ b/src/mesa/swrast/s_alphabuf.c @@ -1,4 +1,4 @@ -/* $Id: s_alphabuf.c,v 1.14 2002/10/18 17:02:01 kschultz Exp $ */ +/* $Id: s_alphabuf.c,v 1.15 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,7 +33,7 @@ #include "glheader.h" #include "context.h" -#include "mem.h" +#include "imports.h" #include "s_context.h" #include "s_alphabuf.h" diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 102d53ac7fa..81f8cd1029b 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -1,4 +1,4 @@ -/* $Id: s_buffers.c,v 1.14 2002/10/11 17:41:06 brianp Exp $ */ +/* $Id: s_buffers.c,v 1.15 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,7 @@ #include "glheader.h" #include "colormac.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "s_accum.h" #include "s_alphabuf.h" diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 5299bf85497..ea34a9c28b2 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -1,4 +1,4 @@ -/* $Id: s_context.c,v 1.40 2002/10/11 17:50:59 brianp Exp $ */ +/* $Id: s_context.c,v 1.41 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "glheader.h" #include "context.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "swrast.h" #include "s_blend.h" diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 58ef3a49cc8..fcab45fe186 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -1,4 +1,4 @@ -/* $Id: s_copypix.c,v 1.40 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: s_copypix.c,v 1.41 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,7 @@ #include "convolve.h" #include "feedback.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "pixel.h" diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index e7517b1e9ed..4d36d1c6ea7 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1,4 +1,4 @@ -/* $Id: s_depth.c,v 1.23 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: s_depth.c,v 1.24 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "s_depth.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 1a681f85610..32ac9ed48c4 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -1,4 +1,4 @@ -/* $Id: s_drawpix.c,v 1.37 2002/10/08 23:59:34 brianp Exp $ */ +/* $Id: s_drawpix.c,v 1.38 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,7 @@ #include "convolve.h" #include "image.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "pixel.h" diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index 083c3c4402e..277ace6fa60 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -1,4 +1,4 @@ -/* $Id: s_logic.c,v 1.11 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: s_logic.c,v 1.12 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,7 @@ #include "glheader.h" #include "context.h" +#include "imports.h" #include "macros.h" #include "s_alphabuf.h" diff --git a/src/mesa/swrast/s_pixeltex.c b/src/mesa/swrast/s_pixeltex.c index 687dfe307ac..1ddfae14b77 100644 --- a/src/mesa/swrast/s_pixeltex.c +++ b/src/mesa/swrast/s_pixeltex.c @@ -1,4 +1,4 @@ -/* $Id: s_pixeltex.c,v 1.10 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: s_pixeltex.c,v 1.11 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,7 +35,7 @@ #include "glheader.h" #include "colormac.h" -#include "mem.h" +#include "imports.h" #include "s_context.h" #include "s_pixeltex.h" diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 562d8718463..5375cb922d9 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -1,4 +1,4 @@ -/* $Id: s_readpix.c,v 1.16 2002/09/21 17:34:56 brianp Exp $ */ +/* $Id: s_readpix.c,v 1.17 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "feedback.h" #include "image.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "pixel.h" #include "s_alphabuf.h" diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 2628a7af3e0..a1e26efdbc6 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1,4 +1,4 @@ -/* $Id: s_span.c,v 1.49 2002/10/11 17:41:06 brianp Exp $ */ +/* $Id: s_span.c,v 1.50 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -37,7 +37,7 @@ #include "context.h" #include "macros.h" #include "mmath.h" -#include "mem.h" +#include "imports.h" #include "s_alpha.h" #include "s_alphabuf.h" diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 90ff06c951d..94ebe873975 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1,4 +1,4 @@ -/* $Id: s_stencil.c,v 1.27 2002/10/02 23:24:04 brianp Exp $ */ +/* $Id: s_stencil.c,v 1.28 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index 92912209361..ed8c3f9d32d 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -1,4 +1,4 @@ -/* $Id: s_texstore.c,v 1.8 2002/09/27 02:45:39 brianp Exp $ */ +/* $Id: s_texstore.c,v 1.9 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -42,8 +42,8 @@ #include "context.h" #include "convolve.h" #include "image.h" +#include "imports.h" #include "macros.h" -#include "mem.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 6929a3cf3ab..06ca19d0a23 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.72 2002/10/21 15:52:35 brianp Exp $ */ +/* $Id: s_texture.c,v 1.73 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "colormac.h" #include "macros.h" #include "mmath.h" -#include "mem.h" +#include "imports.h" #include "texformat.h" #include "teximage.h" diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index a26f7319c5d..8c340c0b0dd 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1,4 +1,4 @@ -/* $Id: s_triangle.c,v 1.62 2002/09/23 16:37:15 brianp Exp $ */ +/* $Id: s_triangle.c,v 1.63 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,8 +34,8 @@ #include "glheader.h" #include "context.h" #include "colormac.h" +#include "imports.h" #include "macros.h" -#include "mem.h" #include "mmath.h" #include "texformat.h" #include "teximage.h" diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index f96a3f5c297..75ea75bd081 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -1,4 +1,4 @@ -/* $Id: s_zoom.c,v 1.17 2002/08/07 00:45:07 brianp Exp $ */ +/* $Id: s_zoom.c,v 1.18 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -26,7 +26,7 @@ #include "glheader.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "colormac.h" #include "s_context.h" diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 254c5af66c4..51fcee429c2 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -1,4 +1,4 @@ -/* $Id: ss_context.c,v 1.18 2002/10/04 17:37:47 brianp Exp $ */ +/* $Id: ss_context.c,v 1.19 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,7 @@ */ #include "glheader.h" -#include "mem.h" +#include "imports.h" #include "ss_context.h" #include "ss_triangle.h" #include "ss_vb.h" diff --git a/src/mesa/swrast_setup/ss_vb.c b/src/mesa/swrast_setup/ss_vb.c index 69fa10b3eb2..4201a4eb514 100644 --- a/src/mesa/swrast_setup/ss_vb.c +++ b/src/mesa/swrast_setup/ss_vb.c @@ -1,4 +1,4 @@ -/* $Id: ss_vb.c,v 1.20 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: ss_vb.c,v 1.21 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "swrast/swrast.h" #include "tnl/t_context.h" diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index e2b37ccfb46..b61d29d6625 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -1,4 +1,4 @@ -/* $Id: t_array_api.c,v 1.27 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: t_array_api.c,v 1.28 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,11 +33,11 @@ #include "glheader.h" #include "api_validate.h" #include "context.h" +#include "imports.h" #include "macros.h" #include "mmath.h" -#include "mem.h" -#include "state.h" #include "mtypes.h" +#include "state.h" #include "array_cache/acache.h" diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index b949bc639a7..50649cddd88 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -1,4 +1,4 @@ -/* $Id: t_array_import.c,v 1.25 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: t_array_import.c,v 1.26 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "state.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 2aa72c7aeea..e98f454030f 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -1,4 +1,4 @@ -/* $Id: t_context.c,v 1.28 2002/08/21 13:05:37 brianp Exp $ */ +/* $Id: t_context.c,v 1.29 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,9 +29,9 @@ #include "glheader.h" +#include "imports.h" #include "macros.h" #include "mtypes.h" -#include "mem.h" #include "dlist.h" #include "light.h" #include "vtxfmt.h" diff --git a/src/mesa/tnl/t_eval_api.c b/src/mesa/tnl/t_eval_api.c index 91592c98235..feddf2619a1 100644 --- a/src/mesa/tnl/t_eval_api.c +++ b/src/mesa/tnl/t_eval_api.c @@ -1,4 +1,4 @@ -/* $Id: t_eval_api.c,v 1.11 2002/06/23 02:36:27 brianp Exp $ */ +/* $Id: t_eval_api.c,v 1.12 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,7 +33,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "math/m_eval.h" diff --git a/src/mesa/tnl/t_imm_alloc.c b/src/mesa/tnl/t_imm_alloc.c index 76bfd165128..78c46307f1b 100644 --- a/src/mesa/tnl/t_imm_alloc.c +++ b/src/mesa/tnl/t_imm_alloc.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_alloc.c,v 1.15 2002/04/19 12:32:14 brianp Exp $ */ +/* $Id: t_imm_alloc.c,v 1.16 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,7 @@ */ #include "glheader.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "t_imm_alloc.h" diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c index 9f9d4ab5d11..563c8631104 100644 --- a/src/mesa/tnl/t_imm_api.c +++ b/src/mesa/tnl/t_imm_api.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_api.c,v 1.33 2002/10/09 19:38:32 brianp Exp $ */ +/* $Id: t_imm_api.c,v 1.34 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,7 +34,7 @@ #include "dlist.h" #include "enums.h" #include "light.h" -#include "mem.h" +#include "imports.h" #include "state.h" #include "colormac.h" #include "macros.h" diff --git a/src/mesa/tnl/t_imm_debug.c b/src/mesa/tnl/t_imm_debug.c index 5def0d73a7b..14b4f7e4d7e 100644 --- a/src/mesa/tnl/t_imm_debug.c +++ b/src/mesa/tnl/t_imm_debug.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_debug.c,v 1.8 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: t_imm_debug.c,v 1.9 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -26,9 +26,11 @@ #include "mtypes.h" #include "context.h" +#include "imports.h" #include "t_context.h" #include "t_imm_debug.h" + void _tnl_print_vert_flags( const char *name, GLuint flags ) { _mesa_debug(NULL, diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c index 66285b4d19a..34da0ea448a 100644 --- a/src/mesa/tnl/t_imm_dlist.c +++ b/src/mesa/tnl/t_imm_dlist.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_dlist.c,v 1.42 2002/06/15 02:38:18 brianp Exp $ */ +/* $Id: t_imm_dlist.c,v 1.43 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,7 +33,7 @@ #include "dlist.h" #include "debug.h" #include "mmath.h" -#include "mem.h" +#include "imports.h" #include "state.h" #include "t_context.h" diff --git a/src/mesa/tnl/t_imm_elt.c b/src/mesa/tnl/t_imm_elt.c index f0c470de921..f435dc9db03 100644 --- a/src/mesa/tnl/t_imm_elt.c +++ b/src/mesa/tnl/t_imm_elt.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_elt.c,v 1.18 2002/06/15 02:38:18 brianp Exp $ */ +/* $Id: t_imm_elt.c,v 1.19 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "glheader.h" #include "colormac.h" #include "context.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c index e7ffdaaeae3..2fe88b10d97 100644 --- a/src/mesa/tnl/t_imm_eval.c +++ b/src/mesa/tnl/t_imm_eval.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_eval.c,v 1.25 2002/06/25 02:56:45 brianp Exp $ */ +/* $Id: t_imm_eval.c,v 1.26 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,7 +33,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "math/m_eval.h" diff --git a/src/mesa/tnl/t_imm_exec.c b/src/mesa/tnl/t_imm_exec.c index 137c7ec5148..fb149a123de 100644 --- a/src/mesa/tnl/t_imm_exec.c +++ b/src/mesa/tnl/t_imm_exec.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_exec.c,v 1.42 2002/08/08 16:55:17 brianp Exp $ */ +/* $Id: t_imm_exec.c,v 1.43 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -36,7 +36,7 @@ #include "enums.h" #include "dlist.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "light.h" #include "state.h" diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c index 007a2130a5e..9cf911a9325 100644 --- a/src/mesa/tnl/t_imm_fixup.c +++ b/src/mesa/tnl/t_imm_fixup.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_fixup.c,v 1.37 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: t_imm_fixup.c,v 1.38 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -37,7 +37,7 @@ #include "colormac.h" #include "light.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "state.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index d6121d70b6f..cd6cd9d8eaa 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -1,4 +1,4 @@ -/* $Id: t_pipeline.c,v 1.23 2002/10/16 17:57:52 brianp Exp $ */ +/* $Id: t_pipeline.c,v 1.24 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,7 +29,7 @@ #include "glheader.h" #include "context.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "state.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index 01b553a1915..9639d5ace7c 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_fog.c,v 1.17 2002/01/22 14:35:17 brianp Exp $ */ +/* $Id: t_vb_fog.c,v 1.18 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 99f15d8036b..934ddb8d7ba 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_light.c,v 1.18 2002/02/13 00:53:20 keithw Exp $ */ +/* $Id: t_vb_light.c,v 1.19 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,7 @@ #include "colormac.h" #include "light.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "simple_list.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index ac09792138a..31f309a7bc5 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_normals.c,v 1.15 2002/08/08 16:54:43 brianp Exp $ */ +/* $Id: t_vb_normals.c,v 1.16 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index 21832d47e88..ced77995730 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_points.c,v 1.8 2002/01/22 14:35:17 brianp Exp $ */ +/* $Id: t_vb_points.c,v 1.9 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,7 +28,7 @@ */ #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "t_context.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 04167664785..86fe025fe1e 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_program.c,v 1.14 2002/08/08 16:55:56 brianp Exp $ */ +/* $Id: t_vb_program.c,v 1.15 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -85,7 +85,7 @@ #include "hash.h" #include "light.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "simple_list.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index 687f286f986..976d3fc3d75 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_render.c,v 1.31 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: t_vb_render.c,v 1.32 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -44,7 +44,7 @@ #include "context.h" #include "enums.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "mmath.h" diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index 81751508bfb..7014d53244c 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_texgen.c,v 1.13 2002/06/29 19:48:17 brianp Exp $ */ +/* $Id: t_vb_texgen.c,v 1.14 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,7 +34,7 @@ #include "context.h" #include "macros.h" #include "mmath.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c index 135278d740d..f4552f3ee55 100644 --- a/src/mesa/tnl/t_vb_texmat.c +++ b/src/mesa/tnl/t_vb_texmat.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_texmat.c,v 1.8 2002/01/22 14:35:17 brianp Exp $ */ +/* $Id: t_vb_texmat.c,v 1.9 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index e13b8bc0a1e..c41d6f59f9c 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_vertex.c,v 1.14 2002/04/09 16:56:52 keithw Exp $ */ +/* $Id: t_vb_vertex.c,v 1.15 2002/10/24 23:57:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,7 +32,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c index f0e316ce3e1..7e9db789253 100644 --- a/src/mesa/tnl/t_vtx_exec.c +++ b/src/mesa/tnl/t_vtx_exec.c @@ -34,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "api_noop.h" #include "api_arrayelt.h" #include "context.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "enums.h" diff --git a/src/mesa/tnl/t_vtx_sse.c b/src/mesa/tnl/t_vtx_sse.c index 240d6cf8b96..8998c901bcd 100644 --- a/src/mesa/tnl/t_vtx_sse.c +++ b/src/mesa/tnl/t_vtx_sse.c @@ -31,9 +31,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include <stdio.h> -#include <assert.h> -#include "mem.h" +#include "imports.h" #include "simple_list.h" #include "t_vtx_api.h" diff --git a/src/mesa/tnl/t_vtx_x86.c b/src/mesa/tnl/t_vtx_x86.c index 4e4596a4e67..7a55db72df6 100644 --- a/src/mesa/tnl/t_vtx_x86.c +++ b/src/mesa/tnl/t_vtx_x86.c @@ -31,9 +31,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include <stdio.h> -#include <assert.h> -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "simple_list.h" #include "tnl_vtxfmt.h" diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index b97a70528c6..d2428033d55 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -1,10 +1,10 @@ -/* $Id: gen_matypes.c,v 1.8 2002/09/19 16:19:45 brianp Exp $ */ +/* $Id: gen_matypes.c,v 1.9 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -34,13 +34,10 @@ * Mesa, including lighting, clipping, texture image conversion etc. */ -#ifdef PC_HEADER -#include "all.h" -#else #include "glheader.h" #include "mtypes.h" #include "tnl/t_context.h" -#endif + #undef offsetof #define offsetof( type, member ) ((size_t) &((type *)0)->member) |