From: Brian Paul Date: Wed, 19 Apr 2000 01:44:01 +0000 (+0000) Subject: minor clean-up X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71dea349d2be623b7819389428b0d6a124e8d184;p=mesa.git minor clean-up --- diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index a402521e314..5b231875651 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.32 2000/04/10 21:13:19 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.33 2000/04/19 01:44:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -48,7 +48,9 @@ #include "context.h" #include "config.h" #include "macros.h" +#include "mmath.h" #include "types.h" +#include "xfonts.h" #include "xmesaP.h" @@ -453,21 +455,6 @@ static int transparent_pixel( XMesaVisual glxvis ) -/* - * Return number of bits set in n. - */ -static int bitcount( unsigned long n ) -{ - int bits; - for (bits=0; n>0; n=n>>1) { - if (n&1) { - bits++; - } - } - return bits; -} - - /* * Try to get an X visual which matches the given arguments. */ @@ -501,9 +488,9 @@ static XVisualInfo *get_visual( Display *dpy, int scr, * 10 bits per color channel. Mesa's limited to a max of 8 bits/channel. */ if (vis && depth > 24 && (xclass==TrueColor || xclass==DirectColor)) { - if (bitcount(vis->red_mask) <= 8 - && bitcount(vis->green_mask) <= 8 - && bitcount(vis->blue_mask) <= 8) { + if (_mesa_bitcount((GLuint) vis->red_mask ) <= 8 && + _mesa_bitcount((GLuint) vis->green_mask) <= 8 && + _mesa_bitcount((GLuint) vis->blue_mask ) <= 8) { return vis; } else { @@ -1837,9 +1824,6 @@ Fake_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) -extern void Fake_glXUseXFont( Font font, int first, int count, int listbase ); - - extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void); struct _glxapi_table *_mesa_GetGLXDispatchTable(void) { @@ -1895,6 +1879,7 @@ struct _glxapi_table *_mesa_GetGLXDispatchTable(void) glx.DestroyWindow = Fake_glXDestroyWindow; /*glx.GetCurrentReadDrawable = Fake_glXGetCurrentReadDrawable;*/ glx.GetFBConfigAttrib = Fake_glXGetFBConfigAttrib; + glx.GetFBConfigs = Fake_glXGetFBConfigs; glx.GetSelectedEvent = Fake_glXGetSelectedEvent; glx.GetVisualFromFBConfig = Fake_glXGetVisualFromFBConfig; glx.MakeContextCurrent = Fake_glXMakeContextCurrent; diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index e69f71224f9..0daaa9443f8 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -1,10 +1,10 @@ -/* $Id: xfonts.c,v 1.5 1999/12/12 17:04:50 brianp Exp $ */ +/* $Id: xfonts.c,v 1.6 2000/04/19 01:44:02 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2000 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"), @@ -44,8 +44,10 @@ #include "GL/xmesa.h" #include "context.h" #include "mem.h" +#include "xfonts.h" #include "xmesaP.h" + /* Some debugging info. */ #ifdef DEBUG @@ -373,7 +375,7 @@ bm_height); glEndList (); } - free (bm); + FREE(bm); XFreeFontInfo( NULL, fs, 0 ); XFreeGC (dpy, gc); @@ -386,6 +388,8 @@ bm_height); glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); } + +extern void xmesa_xfonts_dummy( void ); void xmesa_xfonts_dummy( void ) { /* silence unused var warnings */ diff --git a/src/mesa/drivers/x11/xfonts.h b/src/mesa/drivers/x11/xfonts.h new file mode 100644 index 00000000000..9cbe11f7bb2 --- /dev/null +++ b/src/mesa/drivers/x11/xfonts.h @@ -0,0 +1,39 @@ +/* $Id: xfonts.h,v 1.1 2000/04/19 01:44:02 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * + * Copyright (C) 1999-2000 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef XFONTS_H +#define XFONTS_H + + +#include + + +extern void Fake_glXUseXFont( Font font, int first, int count, int listbase ); + + +#endif +