[Gtkradiant] [Bug 679] New: osx.diff for radiant 1.2.11

gtkradiant@zerowing.idsoftware.com gtkradiant@zerowing.idsoftware.com
Mon, 11 Nov 2002 14:59:33 -0600


http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=679

           Summary: osx.diff for radiant 1.2.11
           Product: GtkRadiant
           Version: 1.2
          Platform: All
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: editor
        AssignedTo: ttimo@idsoftware.com
        ReportedBy: tigital@mac.com


the following diff is what I had to change to get GtkRadiant 1.2.11 to compile
on Mac OS X 10.2.1 using the latest Project Builder...I am posting the Project
Builder file to GtkRad-Macos cuz I'm not sure how to add an attachment with
bugzilla...the project Builder file should be placed at the root of the
GtkRadiant cvs checkout...

also, I tried to edit out any conscript/construct diff's, cuz that just isn't
working for me right now...hopefully in doing so, I didn't eliminate anything
else!  Guess we'll find out soon enuff ;-)

osX.diff
------------------------------------
Index: include/gtkr_list.h
===================================================================
RCS file: /cvs/GtkRadiant/include/gtkr_list.h,v
retrieving revision 1.1
diff -u -r1.1 gtkr_list.h
--- include/gtkr_list.h	31 May 2001 09:29:41 -0000	1.1
+++ include/gtkr_list.h	6 Nov 2002 16:42:12 -0000
@@ -31,3 +31,6 @@
 
 #include <list>
 #include "stl_check.h"
+#ifdef __APPLE__		//tigital
+using namespace std;
+#endif
Index: include/gtkr_vector.h
===================================================================
RCS file: /cvs/GtkRadiant/include/gtkr_vector.h,v
retrieving revision 1.2
diff -u -r1.2 gtkr_vector.h
--- include/gtkr_vector.h	3 Jan 2002 11:27:29 -0000	1.2
+++ include/gtkr_vector.h	6 Nov 2002 16:42:12 -0000
@@ -31,3 +31,7 @@
 
 #include <vector>
 #include "stl_check.h"
+
+#ifdef __APPLE__		//tigital
+using namespace std;
+#endif
\ No newline at end of file
Index: include/qerplugin.h
===================================================================
RCS file: /cvs/GtkRadiant/include/qerplugin.h,v
retrieving revision 1.25.2.5
diff -u -r1.25.2.5 qerplugin.h
--- include/qerplugin.h	9 Oct 2002 12:11:45 -0000	1.25.2.5
+++ include/qerplugin.h	6 Nov 2002 16:42:13 -0000
@@ -67,13 +67,22 @@
 #define QER_PLUG_GAME_SURFACEFLAGS  0x0010      // renames surface/content names
 
 // basics
+#ifndef __APPLE__					//tigital
 #define QERPLUG_INIT "QERPlug_Init"
 #define QERPLUG_GETNAME "QERPlug_GetName"
 #define QERPLUG_GETCOMMANDLIST "QERPlug_GetCommandList"
 #define QERPLUG_DISPATCH "QERPlug_Dispatch"
 #define QERPLUG_GETFUNCTABLE "QERPlug_GetFuncTable"
+#else
+#define QERPLUG_INIT "_QERPlug_Init"
+#define QERPLUG_GETNAME "_QERPlug_GetName"
+#define QERPLUG_GETCOMMANDLIST "_QERPlug_GetCommandList"
+#define QERPLUG_DISPATCH "_QERPlug_Dispatch"
+#define QERPLUG_GETFUNCTABLE "_QERPlug_GetFuncTable"
+#endif
 
 // FIXME: not used, probably should remove
+#ifndef __APPLE__					//tigital
 #define QERPLUG_GETSERVICETPE "QERPlug_GetServiceType"
 
 // game stuff
@@ -85,7 +94,19 @@
 #define QERPLUG_DOSURFACEDLG  "QERPlug_DoSurfaceDlg"      // runs the surface
dialog in a plugin
                                                           // this is going to
get icky
 #define QERPLUG_GETSURFACEFLAGS "QERPlug_GetSurfaceFlags" // gets a list of
surface/content flag names from a plugin
+#else
+#define QERPLUG_GETSERVICETPE "_QERPlug_GetServiceType"
 
+// game stuff
+#define QERPLUG_GETTEXTUREINFO "_QERPlug_GetTextureInfo"   // gets a texture
info structure
+#define QERPLUG_LOADTEXTURE    "_QERPlug_LoadTexture"      // loads a texture,
will return an RGBA structure
+                                                          // and any surface
flags/contents for it
+#define QERPLUG_GETTMODELINFO "_QERPlug_GetModelInfo"      // gets a model info
structure
+#define QERPLUG_LOADMODEL     "_QERPlug_LoadModel"         // loads model data
from a plugin
+#define QERPLUG_DOSURFACEDLG  "_QERPlug_DoSurfaceDlg"      // runs the surface
dialog in a plugin
+                                                          // this is going to
get icky
+#define QERPLUG_GETSURFACEFLAGS "_QERPlug_GetSurfaceFlags" // gets a list of
surface/content flag names from a plugin
+#endif
 struct _QERTextureInfo
 {
   char m_TextureExtension[QER_MAX_NAMELEN];   // the extension these textures have
@@ -176,15 +197,27 @@
 // the plugin can register the EClasses he wants to handle
 //++timo TODO: this has got to move into the table, and be requested by
QERPlug_RequestInterface
 //++timo FIXME: the LPVOID parameter must be casted to an IEpair interface
+#ifndef __APPLE__			//tigital
 #define QERPLUG_REGISTERPLUGINENTITIES "QERPlug_RegisterPluginEntities"
+#else
+#define QERPLUG_REGISTERPLUGINENTITIES "_QERPlug_RegisterPluginEntities"
+#endif
 typedef void (WINAPI * PFN_QERPLUG_REGISTERPLUGINENTITIES)( void* );
 // if exists in plugin, gets called between INIT and GETCOMMANDLIST
 // the plugin can Init all it needs for surface properties
+#ifndef __APPLE__	//tigital
 #define QERPLUG_INITSURFACEPROPERTIES "QERPlug_InitSurfaceProperties"
+#else
+#define QERPLUG_INITSURFACEPROPERTIES "_QERPlug_InitSurfaceProperties"
+#endif
 typedef void (WINAPI * PFN_QERPLUG_INITSURFACEPROPERTIES)();
 // if Radiant needs to use a particular set of commands, it can request the
plugin to fill a func table
 // this is similar to PFN_QERAPP_REQUESTINTERFACE
+#ifndef __APPLE__
 #define QERPLUG_REQUESTINTERFACE "QERPlug_RequestInterface"
+#else
+#define QERPLUG_REQUESTINTERFACE "_QERPlug_RequestInterface"
+#endif
 typedef int (WINAPI * PFN_QERPLUG_REQUESTINTERFACE) (REFGUID refGUID, void*
pInterface, const char *version_name);
 // Load an image file
 typedef void (WINAPI* PFN_QERAPP_LOADIMAGE) (const char *name, unsigned char
**pic, int *width, int *height);
@@ -206,7 +239,11 @@
   const char* version_name; 
 } moduleentry_t;
 
+#ifndef __APPLE__	//tigital
 #define QERPLUG_LISTINTERFACES "QERPlug_ListInterfaces"
+#else
+#define QERPLUG_LISTINTERFACES "_QERPlug_ListInterfaces"
+#endif
 #define MAX_QERPLUG_INTERFACES 10
 typedef int (WINAPI* PFN_QERPLUG_LISTINTERFACES) (moduleentry_t
table[MAX_QERPLUG_INTERFACES]);
 
@@ -280,6 +317,7 @@
 //++timo NOTE : the #defines here are never used, but can help finding where
things are done in the editor
 
 // brush manipulation routines
+#ifndef __APPLE__		//tigital
 #define QERAPP_CREATEBRUSH "QERApp_CreateBrush"
 #define QERAPP_CREATEBRUSHHANDLE "QERApp_CreateBrushHandle"
 #define QERAPP_DELETEBRUSHHANDLE "QERApp_DeleteBrushHandle"
@@ -391,6 +429,119 @@
 // v1.80
 #define QERAPP_GETDISPATCHPARAMS "QERApp_GetDispatchParams"
 
+#else
+
+#define QERAPP_CREATEBRUSH "_QERApp_CreateBrush"
+#define QERAPP_CREATEBRUSHHANDLE "_QERApp_CreateBrushHandle"
+#define QERAPP_DELETEBRUSHHANDLE "_QERApp_DeleteBrushHandle"
+#define QERAPP_COMMITBRUSHHANDLETOMAP "_QERApp_CommitBrushHandleToMap"
+//++timo not implemented .. remove
+// #define QERAPP_BINDHANDLESTOENTITY "QERApp_BindHandlesToEntity"
+#define QERAPP_ADDFACE "_QERApp_AddFace"
+#define QERAPP_ADDFACEDATA "_QERApp_AddFaceData"
+#define QERAPP_GETFACECOUNT "_QERApp_GetFaceCount"
+#define QERAPP_GETFACEDATA "_QERApp_GetFaceData"
+#define QERAPP_SETFACEDATA "_QERApp_SetFaceData"
+#define QERAPP_DELETEFACE "_QERApp_DeleteFace"
+#define QERAPP_TEXTUREBRUSH "_QERApp_TextureBrush"
+#define QERAPP_BUILDBRUSH "_QERApp_BuildBrush"					// PGM
+#define QERAPP_SELECTEDBRUSHCOUNT "_QERApp_SelectedBrushCount"
+#define QERAPP_ALLOCATESELECTEDBRUSHHANDLES "_QERApp_AllocateSelectedBrushHandles"
+#define QERAPP_RELEASESELECTEDBRUSHHANDLES "_QERApp_ReleaseSelectedBrushHandles"
+#define QERAPP_GETSELECTEDBRUSHHANDLE "_QERApp_GetSelectedBrushHandle"
+#define QERAPP_ACTIVEBRUSHCOUNT "_QERApp_ActiveBrushCount"
+#define QERAPP_ALLOCATEACTIVEBRUSHHANDLES "_QERApp_AllocateActiveBrushHandles"
+#define QERAPP_RELEASEACTIVEBRUSHHANDLES "_QERApp_ReleaseActiveBrushHandles"
+#define QERAPP_GETACTIVEBRUSHHANDLE "_QERApp_GetActiveBrushHandle"
+
+// texture stuff
+#define QERAPP_TEXTURECOUNT "_QERApp_TextureCount"
+#define QERAPP_GETTEXTURE "_QERApp_GetTexture"
+#define QERAPP_GETCURRENTTEXTURE "_QERApp_GetCurrentTexture"
+#define QERAPP_SETCURRENTTEXTURE "_QERApp_SetCurrentTexture"
+
+// selection 
+#define QERAPP_DELETESELECTION "_QERApp_DeleteSelection"
+#define QERAPP_SELECTBRUSH "_QERApp_SelectBrush"					// PGM
+#define QERAPP_DESELECTBRUSH "_QERApp_DeselectBrush"				// PGM
+#define QERAPP_DESELECTALLBRUSHES "_QERApp_DeselectAllBrushes"	// PGM
+
+// data gathering
+#define QERAPP_GETPOINTS "_QERApp_GetPoints"
+#define QERAPP_SELECTBRUSHES "_QERApp_GetBrushes"
+
+// entity class stuff
+// the entity handling is very basic for 1.0
+#define QERAPP_GETECLASSCOUNT "_QERApp_GetEClassCount"
+#define QERAPP_GETECLASS "_QERApp_GetEClass"
+
+// misc
+#define QERAPP_SYSMSG "_QERApp_SysMsg"
+#define QERAPP_INFOMSG "_QERApp_InfoMsg"
+#define QERAPP_HIDEINFOMSG "_QERApp_HideInfoMsg"
+#define QERAPP_RESET_PLUGINS "_QERApp_ResetPlugins"
+
+// texture loading
+#define QERAPP_LOADTEXTURERGBA "_QERApp_LoadTextureRGBA"
+
+// FIXME: the following are not implemented yet
+// hook registrations
+#define QERAPP_REGISTER_MAPLOADFUNC "_QERApp_Register_MapLoadFunc"
+#define QERAPP_REGISTER_MAPSAVEFUNC "_QERApp_Register_MapSaveFunc"
+
+// FIXME: the following are not implemented yet
+#define QERAPP_REGISTER_PROJECTLOADFUNC "_QERApp_Register_ProjectLoadFunc"
+#define QERAPP_REGISTER_MOUSEHANDLER "_QERApp_Register_MouseHandler"
+#define QERAPP_REGISTER_KEYHANDLER "_QERApp_Register_KeyHandler"
+
+// FIXME: new primtives do not work in v1.00
+// primitives are new types of things in the map
+// for instance, the Q3 curves could have been done as 
+// primitives instead of being built in 
+// it will be a plugins responsibility to hook the map load and save funcs to load
+// and/or save any additional data (like new primitives of some type)
+// the editor will call each registered renderer during the rendering process
to repaint
+// any primitives the plugin owns
+// each primitive object has a temporary sibling brush that lives in the map
+// FIXME: go backwards on this a bit.. orient it more towards the temp brush
mode as it will be cleaner
+// basically a plugin will hook the map load and save and will add the
primitives to the map.. this will
+// produce a temporary 'primitive' brush and the appropriate renderer will be
called as well as the 
+// edit handler (for edge drags, sizes, rotates, etc.. ) and the vertex maker
will be called when vertex
+// mode is attemped on the brush.. there will need to be a GetPrimitiveBounds
callback in the edit handler
+// so the brush can resize appropriately as needed.. this might be the plugins
responsibility to set the 
+// sibling brushes size.. it will then be the plugins responsibility to hook
map save to save the primitives
+// as the editor will discard any temp primitive brushes.. (there probably
needs to be some kind of sanity check
+// here as far as keeping the brushes and the plugin in sync.. i suppose the
edit handler can deal with all of that
+// crap but it looks like a nice place for a mess)
+#define QERAPP_REGISTER_PRIMITIVE "_QERApp_Register_Primitive"
+#define QERAPP_REGISTER_RENDERER "_QERApp_Register_Renderer"
+#define QERAPP_REGISTER_EDITHANDLER "_QERApp_Register_EditHandler"
+#define QERAPP_REGISTER_VERTEXMAKER "_QERApp_Register_VertexMaker"
+#define QERAPP_ADDPRIMITIVE "_QERApp_AddPrimitive"
+
+// v1.70
+#define QERAPP_GETENTITYCOUNT "_QERApp_GetEntityCount"
+#define QERAPP_GETENTITYHANDLE "_QERApp_GetEntityHandle"
+//++timo not implemented for the moment
+// #define QERAPP_GETENTITYINFO "QERApp_GetEntityInfo"
+//++timo does the keyval need some more funcs to add/remove ?
+// get the pointer and do the changes yourself
+#define QERAPP_GETENTITYKEYVALLIST "_QERApp_GetKeyValList"
+#define QERAPP_ALLOCATEEPAIR "_QERApp_AllocateEpair"
+// will check current KeyVal list is NULL, otherwise use GetKeyValList
+#define QERAPP_SETENTITYKEYVALLIST "_QERApp_SetKeyValList"
+#define QERAPP_ALLOCATEENTITYBRUSHHANDLES "_QERApp_AllocateEntityBrushHandles"
+#define QERAPP_RELEASEENTITYBRUSHHANDLES "_QERApp_ReleaseEntityBrushHandles"
+#define QERAPP_GETENTITYBRUSHHANDLE "_QERApp_GetEntityBrushHandle"
+#define QERAPP_CREATEENTITYHANDLE "_QERApp_CreateEntityHandle"
+#define QERAPP_COMMITBRUSHHANDLETOENTITY "_QERApp_CommitBrushHandleToEntity"
+#define QERAPP_COMMITENTITYHANDLETOMAP "_QERApp_CommitEntityHandleToMap"
+#define QERAPP_SETSCREENUPDATE "_QERApp_SetScreenUpdate"
+#define QERAPP_BUILDBRUSH2 "_QERApp_BuildBrush2"
+
+// v1.80
+#define QERAPP_GETDISPATCHPARAMS "_QERApp_GetDispatchParams"
+#endif
 struct _QERPointData
 {
   int     m_nCount;
Index: include/stl_check.h
===================================================================
RCS file: /cvs/GtkRadiant/include/stl_check.h,v
retrieving revision 1.4.12.1
diff -u -r1.4.12.1 stl_check.h
--- include/stl_check.h	2 Nov 2002 03:18:00 -0000	1.4.12.1
+++ include/stl_check.h	6 Nov 2002 16:42:13 -0000
@@ -35,7 +35,7 @@
 \todo NOTE linux we may want to use the STL provided with gcc instead of
 an STLPort distrib .. I know of some projects which had bugs on STLPort linux /
gcc 2.95.4
 */
-
+#ifndef __APPLE__
 // check the basics
 #if defined (__linux__) || defined (__APPLE__)
 #define HAVE_GCC_VERSION(MAJOR, MINOR) \
@@ -61,4 +61,6 @@
 #ifdef WIN32
 #pragma warning(disable : 4786)
 #endif
+
+#endif __APPLE__=======
 #endif

Index: libs/mathlib/linear.c
===================================================================
RCS file: /cvs/GtkRadiant/libs/mathlib/linear.c,v
retrieving revision 1.2
diff -u -r1.2 linear.c
--- libs/mathlib/linear.c	3 Dec 2001 14:26:11 -0000	1.2
+++ libs/mathlib/linear.c	6 Nov 2002 16:42:14 -0000
@@ -1,4 +1,8 @@
+#ifndef __APPLE__
 #include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
 #include <limits.h>
 #include <float.h> 

Index: plugins/imagepng/plugin.cpp
===================================================================
RCS file: /cvs/GtkRadiant/plugins/imagepng/Attic/plugin.cpp,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 plugin.cpp
--- plugins/imagepng/plugin.cpp	6 Jul 2002 14:58:48 -0000	1.1.2.2
+++ plugins/imagepng/plugin.cpp	6 Nov 2002 16:42:14 -0000
@@ -25,6 +25,10 @@
 #include "plugin.h"
 #include "png.h"
 
+#ifdef __APPLE__	//tigital
+#include <stdlib.h>
+#endif
+
 _QERFuncTable_1 g_FuncTable; // Radiant function table
 _QERFileSystemTable g_FileSystemTable;
 static const char *PLUGIN_NAME = "Image"; // plugin name 
Index: radiant/glwidget.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/glwidget.cpp,v
retrieving revision 1.12.16.1
diff -u -r1.12.16.1 glwidget.cpp
--- radiant/glwidget.cpp	6 Jul 2002 18:15:09 -0000	1.12.16.1
+++ radiant/glwidget.cpp	6 Nov 2002 16:42:15 -0000
@@ -34,6 +34,12 @@
 // Leonardo Zide (leo@lokigames.com)
 //
 
+#ifdef __APPLE__
+#define _STLP_NO_EXCEPTIONS 1
+#define _STLP_NO_NONAMESPACES 1
+#define _STLP_NO_OWN_IOSTREAMS 1
+#endif
+
 #include "stdafx.h"
 #ifdef WIN32
 extern "C" {
Index: radiant/gtkfilesel-darwin.c
===================================================================
RCS file: /cvs/GtkRadiant/radiant/gtkfilesel-darwin.c,v
retrieving revision 1.2
diff -u -r1.2 gtkfilesel-darwin.c
--- radiant/gtkfilesel-darwin.c	27 May 2001 13:40:55 -0000	1.2
+++ radiant/gtkfilesel-darwin.c	6 Nov 2002 16:42:19 -0000
@@ -519,11 +519,11 @@
 }
 
 static void
-gtk_file_selection_class_init (GtkFileSelectionClass *class)
+gtk_file_selection_class_init (GtkFileSelectionClass *klass)	//tigital
 {
   GtkObjectClass *object_class;
 
-  object_class = (GtkObjectClass*) class;
+  object_class = (GtkObjectClass*) klass;
 
   parent_class = gtk_type_class (GTK_TYPE_WINDOW);
 
Index: radiant/main.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/main.cpp,v
retrieving revision 1.40.2.13
diff -u -r1.40.2.13 main.cpp
--- radiant/main.cpp	28 Oct 2002 23:24:29 -0000	1.40.2.13
+++ radiant/main.cpp	6 Nov 2002 16:42:20 -0000
@@ -520,10 +520,14 @@
   libgl = "opengl32.dll";
 #endif
 
-#if defined (__linux__) || defined (__APPLE__)
+#if defined (__linux__)
   libgl = "libGL.so.1";
 #endif
 
+#ifdef __APPLE__
+  libgl = "/usr/X11R6/lib/libGL.1.dylib";
+#endif
+
   gtk_init(&argc, &argv);
 
   if ((ptr = getenv ("Q3R_LIBGL")) != NULL)
@@ -643,8 +647,13 @@
   realpath (loki_getdatapath(), real);
   if (real[strlen(real)-1] != '/')
     strcat(real, "/");
+#ifndef __APPLE__					//tigital
   g_strAppPath = real;
-#if 0
+#else
+  g_strAppPath = "/Applications/quake3/";
+#endif
+
+#if 1
   printf("g_strAppPath: %s\n", g_strAppPath.GetBuffer());
 #endif
 
@@ -654,7 +663,7 @@
   // (for now I had to create symlinks)
   g_strBitmapsPath = g_strAppPath;
   g_strBitmapsPath += "bitmaps/";
-#if 0
+#if 1
   printf("g_strBitmapsPath: %s\n", g_strBitmapsPath.GetBuffer());
 #endif
   
Index: radiant/mainframe.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/mainframe.cpp,v
retrieving revision 1.77.2.19
diff -u -r1.77.2.19 mainframe.cpp
--- radiant/mainframe.cpp	4 Nov 2002 12:30:05 -0000	1.77.2.19
+++ radiant/mainframe.cpp	6 Nov 2002 16:42:31 -0000
@@ -912,7 +912,11 @@
 
   for (iGame = g_PrefsDlg.mGamesDialog.mGames.begin(); iGame !=
g_PrefsDlg.mGamesDialog.mGames.end(); iGame++)
   {
+#ifndef __APPLE__			//tigital
     FileName = (*iGame)->mGameToolsPath;
+#else
+    FileName = "/Applications/quake3/gametools/";
+#endif
     FileName += "game.xlink";
     process_xlink(FileName, (*iGame)->mGameName,
(*iGame)->mGameToolsPath.GetBuffer(), menu, accel, menu_accel);
   }
Index: radiant/plugin.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/Attic/plugin.cpp,v
retrieving revision 1.17.12.1
diff -u -r1.17.12.1 plugin.cpp
--- radiant/plugin.cpp	9 Oct 2002 12:11:46 -0000	1.17.12.1
+++ radiant/plugin.cpp	6 Nov 2002 16:42:31 -0000
@@ -38,6 +38,9 @@
 }
 #endif
 #endif
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
+#endif
 #include "stdafx.h"
 //#include "qe3.h"
 #include "plugin.h"
@@ -97,6 +100,7 @@
   if (m_hDLL != NULL)
   {
     m_pfnInit = (PFN_QERPLUG_INIT)dlsym(m_hDLL, QERPLUG_INIT);
+    //m_pfnInit = (PFN_QERPLUG_INIT)dlsym(m_hDLL, "_QERPlug_Init");
     if (m_pfnInit != NULL)
     {
 #ifdef WIN32
Index: radiant/pluginmanager.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/pluginmanager.cpp,v
retrieving revision 1.59.2.9
diff -u -r1.59.2.9 pluginmanager.cpp
--- radiant/pluginmanager.cpp	2 Nov 2002 03:18:00 -0000	1.59.2.9
+++ radiant/pluginmanager.cpp	6 Nov 2002 16:42:34 -0000
@@ -294,7 +294,11 @@
       if ((ext == NULL) || (strcmp (ext, ".so") != 0))
         continue;
 #endif
+#ifndef __APPLE__
       strPath.Format("%s/%s", path, dirlist->d_name);
+#else
+      strPath.Format("%s%s", path, dirlist->d_name);
+#endif
       CPlugIn *pPlug = new CPlugIn();
       if (pPlug->Load(strPath))
       {
Index: radiant/preferences.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/preferences.cpp,v
retrieving revision 1.37.2.19
diff -u -r1.37.2.19 preferences.cpp
--- radiant/preferences.cpp	29 Oct 2002 08:31:18 -0000	1.37.2.19
+++ radiant/preferences.cpp	6 Nov 2002 16:42:37 -0000
@@ -396,8 +396,10 @@
     // default
 #ifdef WIN32
     mEngine = "quake3.exe";
-#else
+#elif __linux__
     mEngine = "quake3";
+#elif __APPLE__
+    mEngine = "Quake3";
 #endif
   }
 #if defined (__linux__) || defined (__APPLE__)
@@ -804,7 +806,11 @@
   CString strPath;
   struct dirent *dirlist;
   DIR *dir;
+#ifndef __APPLE__					//tigital
   CString strGamesPath = g_strAppPath.GetBuffer();
+#else
+  CString strGamesPath = "/Applications/quake3/";
+#endif
   strGamesPath += "games";
   const char *path = strGamesPath.GetBuffer();
 
Index: radiant/qgl-mac.c
===================================================================
RCS file: /cvs/GtkRadiant/radiant/qgl-mac.c,v
retrieving revision 1.2
diff -u -r1.2 qgl-mac.c
--- radiant/qgl-mac.c	27 May 2001 13:40:56 -0000	1.2
+++ radiant/qgl-mac.c	6 Nov 2002 16:42:40 -0000
@@ -36,7 +36,7 @@
 #include <float.h>
 #include <string.h>
 #if defined (__linux__) || defined (__APPLE__)
-//#include <dlfcn.h>
+#include <dlfcn.h>
 #endif
 #ifdef _WIN32
 #include <windows.h>
@@ -517,9 +517,9 @@
     FreeLibrary(g_hGLDLL);
 #endif
 
-//#if defined (__linux__) || defined (__APPLE__)
-//    dlclose (g_hGLDLL);
-//#endif
+#if defined (__linux__) || defined (__APPLE__)
+    dlclose (g_hGLDLL);
+#endif
 
     g_hGLDLL = NULL;
   }
@@ -967,23 +967,23 @@
 */
 static int init_error;
 
-//static void* safe_dlsym (void *handle, char *symbol)
-//{
+static void* safe_dlsym (void *handle, char *symbol)
+{
 //#ifdef WIN32
 //  return GetProcAddress (handle, symbol);
 //#endif
 
-//#if defined (__linux__) || defined (__APPLE__)
-//  void* ret = dlsym (handle, symbol);
-//  char *err = dlerror();
-//  if (err)
-//{
-//    init_error = 1;
-//    printf ("Error loading OpenGL libraries: %s %s\n", err, symbol);
-//  }
-//  return ret;
-//#endif
-//}
+#if defined (__linux__) || defined (__APPLE__)
+  void* ret = dlsym (handle, symbol);
+  char *err = dlerror();
+  if (err)
+{
+    init_error = 1;
+    printf ("Error loading OpenGL libraries: %s %s\n", err, symbol);
+  }
+  return ret;
+#endif
+}
 
 #include <math.h>
 #include <stdlib.h>
@@ -1047,8 +1047,11 @@
 {
   int i, j;
   float sx, sy;
-
+#ifndef __APPLE__
   GLubyte* new_image = malloc (destw*desth*4*sizeof(GLubyte));
+#else
+  GLubyte* new_image = (GLubyte *)malloc (destw*desth*4*sizeof(GLubyte));
+#endif
   if (new_image == NULL)
     return NULL;
 
@@ -1230,7 +1233,7 @@
   g_hGLDLL = LoadLibrary(dllname); 
 #endif
 
-#if defined (__linux__)
+#if defined (__linux__) || (__APPLE__)
   char* err;
 
   g_hGLDLL = dlopen(dllname, RTLD_LAZY|RTLD_GLOBAL);
@@ -1240,10 +1243,10 @@
 #endif
   init_error = 0;
 
-#ifndef __APPLE__
+//#ifndef __APPLE__
   if (g_hGLDLL == NULL)
     return 0;
-#endif
+//#endif
 
   Sys_Printf("Loading GL library: %s ...", dllname);
 
@@ -1675,7 +1678,7 @@
   qglXWaitGL                   = glXWaitGL;
   qglXWaitX                    = glXWaitX;
   qglXUseXFont                 = glXUseXFont;
-  qglXGetProcAddressARB        = glXGetProcAddressARB; // Utah-GLX fix
+//  qglXGetProcAddressARB        = glXGetProcAddressARB; // Utah-GLX fix
 #endif
 
   qglPointParameterfEXT = 0;
@@ -1691,8 +1694,8 @@
 
   return 1;
 }
-
-static int GL_ExtensionSupported (const char *extension)
+//static		//tigital
+int GL_ExtensionSupported (const char *extension)
 {
   const GLubyte *extensions = NULL;
   const GLubyte *start;
Index: radiant/qgl.c
===================================================================
RCS file: /cvs/GtkRadiant/radiant/qgl.c,v
retrieving revision 1.14.22.2
diff -u -r1.14.22.2 qgl.c
--- radiant/qgl.c	21 Oct 2002 22:34:16 -0000	1.14.22.2
+++ radiant/qgl.c	6 Nov 2002 16:42:44 -0000
@@ -35,7 +35,7 @@
 #include <stdio.h>
 #include <float.h>
 #include <string.h>
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
 #include <dlfcn.h>
 #endif
 
@@ -86,7 +86,7 @@
 #define WINAPI
 #endif
 
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
 void* g_hGLDLL;
 
 XVisualInfo* (*qglXChooseVisual)(Display *dpy, int screen, int *attribList);
@@ -518,7 +518,7 @@
     FreeLibrary(g_hGLDLL);
 #endif
 
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
     dlclose (g_hGLDLL);
 #endif
 
@@ -929,7 +929,7 @@
   qwglSetDeviceGammaRampEXT    = NULL;
 #endif
 
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
   qglXChooseVisual             = NULL;
   qglXCreateContext            = NULL;
   qglXDestroyContext           = NULL;
@@ -974,11 +974,11 @@
   return GetProcAddress (handle, symbol);
 #endif
 
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
   void* ret = dlsym (handle, symbol);
   char *err = dlerror();
   if (err)
-  {
+{
     init_error = 1;
     printf ("Error loading OpenGL libraries: %s\n", err);
   }
@@ -1048,8 +1048,11 @@
 {
   int i, j;
   float sx, sy;
-
+#ifndef __APPLE__
   GLubyte* new_image = malloc (destw*desth*4*sizeof(GLubyte));
+#else
+  GLubyte* new_image = (GLubyte *)malloc (destw*desth*4*sizeof(GLubyte));
+#endif
   if (new_image == NULL)
     return NULL;
 
@@ -1232,7 +1235,7 @@
   g_hGLDLL = LoadLibrary(dllname); 
 #endif
 
-#ifdef __linux__
+#if defined (__linux__) || (__APPLE__)
   char* err;
 
   Sys_Printf ("Loading GL library: %s ...", dllname);
@@ -1254,7 +1257,7 @@
   qgluBuild2DMipmaps           = &gluBuild2DMipmaps2;
   qgluLookAt                   = &gluLookAt2;
   qgluErrorString              = &gluErrorString;
-
+#ifndef __APPLE__
   qglAccum                     = safe_dlsym (g_hGLDLL, "glAccum" );
   qglAlphaFunc                 = safe_dlsym (g_hGLDLL, "glAlphaFunc" );
   qglAreTexturesResident       = safe_dlsym (g_hGLDLL, "glAreTexturesResident" );
@@ -1591,7 +1594,344 @@
   qglVertex4sv                 = safe_dlsym (g_hGLDLL, "glVertex4sv" );
   qglVertexPointer             = safe_dlsym (g_hGLDLL, "glVertexPointer" );
   qglViewport                  = safe_dlsym (g_hGLDLL, "glViewport" );
-
+#else
+  qglAccum                     = safe_dlsym (g_hGLDLL, "_glAccum" );
+  qglAlphaFunc                 = safe_dlsym (g_hGLDLL, "_glAlphaFunc" );
+  qglAreTexturesResident       = safe_dlsym (g_hGLDLL, "_glAreTexturesResident" );
+  qglArrayElement              = safe_dlsym (g_hGLDLL, "_glArrayElement" );
+  qglBegin                     = safe_dlsym (g_hGLDLL, "_glBegin" );
+  qglBindTexture               = safe_dlsym (g_hGLDLL, "_glBindTexture" );
+  qglBitmap                    = safe_dlsym (g_hGLDLL, "_glBitmap" );
+  qglBlendFunc                 = safe_dlsym (g_hGLDLL, "_glBlendFunc" );
+  qglCallList                  = safe_dlsym (g_hGLDLL, "_glCallList" );
+  qglCallLists                 = safe_dlsym (g_hGLDLL, "_glCallLists" );
+  qglClear                     = safe_dlsym (g_hGLDLL, "_glClear" );
+  qglClearAccum                = safe_dlsym (g_hGLDLL, "_glClearAccum" );
+  qglClearColor                = safe_dlsym (g_hGLDLL, "_glClearColor" );
+  qglClearDepth                = safe_dlsym (g_hGLDLL, "_glClearDepth" );
+  qglClearIndex                = safe_dlsym (g_hGLDLL, "_glClearIndex" );
+  qglClearStencil              = safe_dlsym (g_hGLDLL, "_glClearStencil" );
+  qglClipPlane                 = safe_dlsym (g_hGLDLL, "_glClipPlane" );
+  qglColor3b                   = safe_dlsym (g_hGLDLL, "_glColor3b" );
+  qglColor3bv                  = safe_dlsym (g_hGLDLL, "_glColor3bv" );
+  qglColor3d                   = safe_dlsym (g_hGLDLL, "_glColor3d" );
+  qglColor3dv                  = safe_dlsym (g_hGLDLL, "_glColor3dv" );
+  qglColor3f                   = safe_dlsym (g_hGLDLL, "_glColor3f" );
+  qglColor3fv                  = safe_dlsym (g_hGLDLL, "_glColor3fv" );
+  qglColor3i                   = safe_dlsym (g_hGLDLL, "_glColor3i" );
+  qglColor3iv                  = safe_dlsym (g_hGLDLL, "_glColor3iv" );
+  qglColor3s                   = safe_dlsym (g_hGLDLL, "_glColor3s" );
+  qglColor3sv                  = safe_dlsym (g_hGLDLL, "_glColor3sv" );
+  qglColor3ub                  = safe_dlsym (g_hGLDLL, "_glColor3ub" );
+  qglColor3ubv                 = safe_dlsym (g_hGLDLL, "_glColor3ubv" );
+  qglColor3ui                  = safe_dlsym (g_hGLDLL, "_glColor3ui" );
+  qglColor3uiv                 = safe_dlsym (g_hGLDLL, "_glColor3uiv" );
+  qglColor3us                  = safe_dlsym (g_hGLDLL, "_glColor3us" );
+  qglColor3usv                 = safe_dlsym (g_hGLDLL, "_glColor3usv" );
+  qglColor4b                   = safe_dlsym (g_hGLDLL, "_glColor4b" );
+  qglColor4bv                  = safe_dlsym (g_hGLDLL, "_glColor4bv" );
+  qglColor4d                   = safe_dlsym (g_hGLDLL, "_glColor4d" );
+  qglColor4dv                  = safe_dlsym (g_hGLDLL, "_glColor4dv" );
+  qglColor4f                   = safe_dlsym (g_hGLDLL, "_glColor4f" );
+  qglColor4fv                  = safe_dlsym (g_hGLDLL, "_glColor4fv" );
+  qglColor4i                   = safe_dlsym (g_hGLDLL, "_glColor4i" );
+  qglColor4iv                  = safe_dlsym (g_hGLDLL, "_glColor4iv" );
+  qglColor4s                   = safe_dlsym (g_hGLDLL, "_glColor4s" );
+  qglColor4sv                  = safe_dlsym (g_hGLDLL, "_glColor4sv" );
+  qglColor4ub                  = safe_dlsym (g_hGLDLL, "_glColor4ub" );
+  qglColor4ubv                 = safe_dlsym (g_hGLDLL, "_glColor4ubv" );
+  qglColor4ui                  = safe_dlsym (g_hGLDLL, "_glColor4ui" );
+  qglColor4uiv                 = safe_dlsym (g_hGLDLL, "_glColor4uiv" );
+  qglColor4us                  = safe_dlsym (g_hGLDLL, "_glColor4us" );
+  qglColor4usv                 = safe_dlsym (g_hGLDLL, "_glColor4usv" );
+  qglColorMask                 = safe_dlsym (g_hGLDLL, "_glColorMask" );
+  qglColorMaterial             = safe_dlsym (g_hGLDLL, "_glColorMaterial" );
+  qglColorPointer              = safe_dlsym (g_hGLDLL, "_glColorPointer" );
+  qglCopyPixels                = safe_dlsym (g_hGLDLL, "_glCopyPixels" );
+  qglCopyTexImage1D            = safe_dlsym (g_hGLDLL, "_glCopyTexImage1D" );
+  qglCopyTexImage2D            = safe_dlsym (g_hGLDLL, "_glCopyTexImage2D" );
+  qglCopyTexSubImage1D         = safe_dlsym (g_hGLDLL, "_glCopyTexSubImage1D" );
+  qglCopyTexSubImage2D         = safe_dlsym (g_hGLDLL, "_glCopyTexSubImage2D" );
+  qglCullFace                  = safe_dlsym (g_hGLDLL, "_glCullFace" );
+  qglDeleteLists               = safe_dlsym (g_hGLDLL, "_glDeleteLists" );
+  qglDeleteTextures            = safe_dlsym (g_hGLDLL, "_glDeleteTextures" );
+  qglDepthFunc                 = safe_dlsym (g_hGLDLL, "_glDepthFunc" );
+  qglDepthMask                 = safe_dlsym (g_hGLDLL, "_glDepthMask" );
+  qglDepthRange                = safe_dlsym (g_hGLDLL, "_glDepthRange" );
+  qglDisable                   = safe_dlsym (g_hGLDLL, "_glDisable" );
+  qglDisableClientState        = safe_dlsym (g_hGLDLL, "_glDisableClientState" );
+  qglDrawArrays                = safe_dlsym (g_hGLDLL, "_glDrawArrays" );
+  qglDrawBuffer                = safe_dlsym (g_hGLDLL, "_glDrawBuffer" );
+  qglDrawElements              = safe_dlsym (g_hGLDLL, "_glDrawElements" );
+  qglDrawPixels                = safe_dlsym (g_hGLDLL, "_glDrawPixels" );
+  qglEdgeFlag                  = safe_dlsym (g_hGLDLL, "_glEdgeFlag" );
+  qglEdgeFlagPointer           = safe_dlsym (g_hGLDLL, "_glEdgeFlagPointer" );
+  qglEdgeFlagv                 = safe_dlsym (g_hGLDLL, "_glEdgeFlagv" );
+  qglEnable                    = safe_dlsym (g_hGLDLL, "_glEnable" );
+  qglEnableClientState         = safe_dlsym (g_hGLDLL, "_glEnableClientState" );
+  qglEnd                       = safe_dlsym (g_hGLDLL, "_glEnd" );
+  qglEndList                   = safe_dlsym (g_hGLDLL, "_glEndList" );
+  qglEvalCoord1d	       = safe_dlsym (g_hGLDLL, "_glEvalCoord1d" );
+  qglEvalCoord1dv              = safe_dlsym (g_hGLDLL, "_glEvalCoord1dv" );
+  qglEvalCoord1f               = safe_dlsym (g_hGLDLL, "_glEvalCoord1f" );
+  qglEvalCoord1fv              = safe_dlsym (g_hGLDLL, "_glEvalCoord1fv" );
+  qglEvalCoord2d               = safe_dlsym (g_hGLDLL, "_glEvalCoord2d" );
+  qglEvalCoord2dv              = safe_dlsym (g_hGLDLL, "_glEvalCoord2dv" );
+  qglEvalCoord2f               = safe_dlsym (g_hGLDLL, "_glEvalCoord2f" );
+  qglEvalCoord2fv              = safe_dlsym (g_hGLDLL, "_glEvalCoord2fv" );
+  qglEvalMesh1                 = safe_dlsym (g_hGLDLL, "_glEvalMesh1" );
+  qglEvalMesh2                 = safe_dlsym (g_hGLDLL, "_glEvalMesh2" );
+  qglEvalPoint1                = safe_dlsym (g_hGLDLL, "_glEvalPoint1" );
+  qglEvalPoint2                = safe_dlsym (g_hGLDLL, "_glEvalPoint2" );
+  qglFeedbackBuffer            = safe_dlsym (g_hGLDLL, "_glFeedbackBuffer" );
+  qglFinish                    = safe_dlsym (g_hGLDLL, "_glFinish" );
+  qglFlush                     = safe_dlsym (g_hGLDLL, "_glFlush" );
+  qglFogf                      = safe_dlsym (g_hGLDLL, "_glFogf" );
+  qglFogfv                     = safe_dlsym (g_hGLDLL, "_glFogfv" );
+  qglFogi                      = safe_dlsym (g_hGLDLL, "_glFogi" );
+  qglFogiv                     = safe_dlsym (g_hGLDLL, "_glFogiv" );
+  qglFrontFace                 = safe_dlsym (g_hGLDLL, "_glFrontFace" );
+  qglFrustum                   = safe_dlsym (g_hGLDLL, "_glFrustum" );
+  qglGenLists                  = safe_dlsym (g_hGLDLL, "_glGenLists" );
+  qglGenTextures               = safe_dlsym (g_hGLDLL, "_glGenTextures" );
+  qglGetBooleanv               = safe_dlsym (g_hGLDLL, "_glGetBooleanv" );
+  qglGetClipPlane              = safe_dlsym (g_hGLDLL, "_glGetClipPlane" );
+  qglGetDoublev                = safe_dlsym (g_hGLDLL, "_glGetDoublev" );
+  qglGetError                  = safe_dlsym (g_hGLDLL, "_glGetError" );
+  qglGetFloatv                 = safe_dlsym (g_hGLDLL, "_glGetFloatv" );
+  qglGetIntegerv               = safe_dlsym (g_hGLDLL, "_glGetIntegerv" );
+  qglGetLightfv                = safe_dlsym (g_hGLDLL, "_glGetLightfv" );
+  qglGetLightiv                = safe_dlsym (g_hGLDLL, "_glGetLightiv" );
+  qglGetMapdv                  = safe_dlsym (g_hGLDLL, "_glGetMapdv" );
+  qglGetMapfv                  = safe_dlsym (g_hGLDLL, "_glGetMapfv" );
+  qglGetMapiv                  = safe_dlsym (g_hGLDLL, "_glGetMapiv" );
+  qglGetMaterialfv             = safe_dlsym (g_hGLDLL, "_glGetMaterialfv" );
+  qglGetMaterialiv             = safe_dlsym (g_hGLDLL, "_glGetMaterialiv" );
+  qglGetPixelMapfv             = safe_dlsym (g_hGLDLL, "_glGetPixelMapfv" );
+  qglGetPixelMapuiv            = safe_dlsym (g_hGLDLL, "_glGetPixelMapuiv" );
+  qglGetPixelMapusv            = safe_dlsym (g_hGLDLL, "_glGetPixelMapusv" );
+  qglGetPointerv               = safe_dlsym (g_hGLDLL, "_glGetPointerv" );
+  qglGetPolygonStipple         = safe_dlsym (g_hGLDLL, "_glGetPolygonStipple" );
+  qglGetString                 = safe_dlsym (g_hGLDLL, "_glGetString" );
+  qglGetTexEnvfv               = safe_dlsym (g_hGLDLL, "_glGetTexEnvfv" );
+  qglGetTexEnviv               = safe_dlsym (g_hGLDLL, "_glGetTexEnviv" );
+  qglGetTexGendv               = safe_dlsym (g_hGLDLL, "_glGetTexGendv" );
+  qglGetTexGenfv               = safe_dlsym (g_hGLDLL, "_glGetTexGenfv" );
+  qglGetTexGeniv               = safe_dlsym (g_hGLDLL, "_glGetTexGeniv" );
+  qglGetTexImage               = safe_dlsym (g_hGLDLL, "_glGetTexImage" );
+  qglGetTexLevelParameterfv    = safe_dlsym (g_hGLDLL,
"_glGetTexLevelParameterfv" );
+  qglGetTexLevelParameteriv    = safe_dlsym (g_hGLDLL,
"_glGetTexLevelParameteriv" );
+  qglGetTexParameterfv         = safe_dlsym (g_hGLDLL, "_glGetTexParameterfv" );
+  qglGetTexParameteriv         = safe_dlsym (g_hGLDLL, "_glGetTexParameteriv" );
+  qglHint                      = safe_dlsym (g_hGLDLL, "_glHint" );
+  qglIndexMask                 = safe_dlsym (g_hGLDLL, "_glIndexMask" );
+  qglIndexPointer              = safe_dlsym (g_hGLDLL, "_glIndexPointer" );
+  qglIndexd                    = safe_dlsym (g_hGLDLL, "_glIndexd" );
+  qglIndexdv                   = safe_dlsym (g_hGLDLL, "_glIndexdv" );
+  qglIndexf                    = safe_dlsym (g_hGLDLL, "_glIndexf" );
+  qglIndexfv                   = safe_dlsym (g_hGLDLL, "_glIndexfv" );
+  qglIndexi                    = safe_dlsym (g_hGLDLL, "_glIndexi" );
+  qglIndexiv                   = safe_dlsym (g_hGLDLL, "_glIndexiv" );
+  qglIndexs                    = safe_dlsym (g_hGLDLL, "_glIndexs" );
+  qglIndexsv                   = safe_dlsym (g_hGLDLL, "_glIndexsv" );
+  qglIndexub                   = safe_dlsym (g_hGLDLL, "_glIndexub" );
+  qglIndexubv                  = safe_dlsym (g_hGLDLL, "_glIndexubv" );
+  qglInitNames                 = safe_dlsym (g_hGLDLL, "_glInitNames" );
+  qglInterleavedArrays         = safe_dlsym (g_hGLDLL, "_glInterleavedArrays" );
+  qglIsEnabled                 = safe_dlsym (g_hGLDLL, "_glIsEnabled" );
+  qglIsList                    = safe_dlsym (g_hGLDLL, "_glIsList" );
+  qglIsTexture                 = safe_dlsym (g_hGLDLL, "_glIsTexture" );
+  qglLightModelf               = safe_dlsym (g_hGLDLL, "_glLightModelf" );
+  qglLightModelfv              = safe_dlsym (g_hGLDLL, "_glLightModelfv" );
+  qglLightModeli               = safe_dlsym (g_hGLDLL, "_glLightModeli" );
+  qglLightModeliv              = safe_dlsym (g_hGLDLL, "_glLightModeliv" );
+  qglLightf                    = safe_dlsym (g_hGLDLL, "_glLightf" );
+  qglLightfv                   = safe_dlsym (g_hGLDLL, "_glLightfv" );
+  qglLighti                    = safe_dlsym (g_hGLDLL, "_glLighti" );
+  qglLightiv                   = safe_dlsym (g_hGLDLL, "_glLightiv" );
+  qglLineStipple               = safe_dlsym (g_hGLDLL, "_glLineStipple" );
+  qglLineWidth                 = safe_dlsym (g_hGLDLL, "_glLineWidth" );
+  qglListBase                  = safe_dlsym (g_hGLDLL, "_glListBase" );
+  qglLoadIdentity              = safe_dlsym (g_hGLDLL, "_glLoadIdentity" );
+  qglLoadMatrixd               = safe_dlsym (g_hGLDLL, "_glLoadMatrixd" );
+  qglLoadMatrixf               = safe_dlsym (g_hGLDLL, "_glLoadMatrixf" );
+  qglLoadName                  = safe_dlsym (g_hGLDLL, "_glLoadName" );
+  qglLogicOp                   = safe_dlsym (g_hGLDLL, "_glLogicOp" );
+  qglMap1d                     = safe_dlsym (g_hGLDLL, "_glMap1d" );
+  qglMap1f                     = safe_dlsym (g_hGLDLL, "_glMap1f" );
+  qglMap2d                     = safe_dlsym (g_hGLDLL, "_glMap2d" );
+  qglMap2f                     = safe_dlsym (g_hGLDLL, "_glMap2f" );
+  qglMapGrid1d                 = safe_dlsym (g_hGLDLL, "_glMapGrid1d" );
+  qglMapGrid1f                 = safe_dlsym (g_hGLDLL, "_glMapGrid1f" );
+  qglMapGrid2d                 = safe_dlsym (g_hGLDLL, "_glMapGrid2d" );
+  qglMapGrid2f                 = safe_dlsym (g_hGLDLL, "_glMapGrid2f" );
+  qglMaterialf                 = safe_dlsym (g_hGLDLL, "_glMaterialf" );
+  qglMaterialfv                = safe_dlsym (g_hGLDLL, "_glMaterialfv" );
+  qglMateriali                 = safe_dlsym (g_hGLDLL, "_glMateriali" );
+  qglMaterialiv                = safe_dlsym (g_hGLDLL, "_glMaterialiv" );
+  qglMatrixMode                = safe_dlsym (g_hGLDLL, "_glMatrixMode" );
+  qglMultMatrixd               = safe_dlsym (g_hGLDLL, "_glMultMatrixd" );
+  qglMultMatrixf               = safe_dlsym (g_hGLDLL, "_glMultMatrixf" );
+  qglNewList                   = safe_dlsym (g_hGLDLL, "_glNewList" );
+  qglNormal3b                  = safe_dlsym (g_hGLDLL, "_glNormal3b" );
+  qglNormal3bv                 = safe_dlsym (g_hGLDLL, "_glNormal3bv" );
+  qglNormal3d                  = safe_dlsym (g_hGLDLL, "_glNormal3d" );
+  qglNormal3dv                 = safe_dlsym (g_hGLDLL, "_glNormal3dv" );
+  qglNormal3f                  = safe_dlsym (g_hGLDLL, "_glNormal3f" );
+  qglNormal3fv                 = safe_dlsym (g_hGLDLL, "_glNormal3fv" );
+  qglNormal3i                  = safe_dlsym (g_hGLDLL, "_glNormal3i" );
+  qglNormal3iv                 = safe_dlsym (g_hGLDLL, "_glNormal3iv" );
+  qglNormal3s                  = safe_dlsym (g_hGLDLL, "_glNormal3s" );
+  qglNormal3sv                 = safe_dlsym (g_hGLDLL, "_glNormal3sv" );
+  qglNormalPointer             = safe_dlsym (g_hGLDLL, "_glNormalPointer" );
+  qglOrtho                     = safe_dlsym (g_hGLDLL, "_glOrtho" );
+  qglPassThrough               = safe_dlsym (g_hGLDLL, "_glPassThrough" );
+  qglPixelMapfv                = safe_dlsym (g_hGLDLL, "_glPixelMapfv" );
+  qglPixelMapuiv               = safe_dlsym (g_hGLDLL, "_glPixelMapuiv" );
+  qglPixelMapusv               = safe_dlsym (g_hGLDLL, "_glPixelMapusv" );
+  qglPixelStoref               = safe_dlsym (g_hGLDLL, "_glPixelStoref" );
+  qglPixelStorei               = safe_dlsym (g_hGLDLL, "_glPixelStorei" );
+  qglPixelTransferf            = safe_dlsym (g_hGLDLL, "_glPixelTransferf" );
+  qglPixelTransferi            = safe_dlsym (g_hGLDLL, "_glPixelTransferi" );
+  qglPixelZoom                 = safe_dlsym (g_hGLDLL, "_glPixelZoom" );
+  qglPointSize                 = safe_dlsym (g_hGLDLL, "_glPointSize" );
+  qglPolygonMode               = safe_dlsym (g_hGLDLL, "_glPolygonMode" );
+  qglPolygonOffset             = safe_dlsym (g_hGLDLL, "_glPolygonOffset" );
+  qglPolygonStipple            = safe_dlsym (g_hGLDLL, "_glPolygonStipple" );
+  qglPopAttrib                 = safe_dlsym (g_hGLDLL, "_glPopAttrib" );
+  qglPopClientAttrib           = safe_dlsym (g_hGLDLL, "_glPopClientAttrib" );
+  qglPopMatrix                 = safe_dlsym (g_hGLDLL, "_glPopMatrix" );
+  qglPopName                   = safe_dlsym (g_hGLDLL, "_glPopName" );
+  qglPrioritizeTextures        = safe_dlsym (g_hGLDLL, "_glPrioritizeTextures" );
+  qglPushAttrib                = safe_dlsym (g_hGLDLL, "_glPushAttrib" );
+  qglPushClientAttrib          = safe_dlsym (g_hGLDLL, "_glPushClientAttrib" );
+  qglPushMatrix                = safe_dlsym (g_hGLDLL, "_glPushMatrix" );
+  qglPushName                  = safe_dlsym (g_hGLDLL, "_glPushName" );
+  qglRasterPos2d               = safe_dlsym (g_hGLDLL, "_glRasterPos2d" );
+  qglRasterPos2dv              = safe_dlsym (g_hGLDLL, "_glRasterPos2dv" );
+  qglRasterPos2f               = safe_dlsym (g_hGLDLL, "_glRasterPos2f" );
+  qglRasterPos2fv              = safe_dlsym (g_hGLDLL, "_glRasterPos2fv" );
+  qglRasterPos2i               = safe_dlsym (g_hGLDLL, "_glRasterPos2i" );
+  qglRasterPos2iv              = safe_dlsym (g_hGLDLL, "_glRasterPos2iv" );
+  qglRasterPos2s               = safe_dlsym (g_hGLDLL, "_glRasterPos2s" );
+  qglRasterPos2sv              = safe_dlsym (g_hGLDLL, "_glRasterPos2sv" );
+  qglRasterPos3d               = safe_dlsym (g_hGLDLL, "_glRasterPos3d" );
+  qglRasterPos3dv              = safe_dlsym (g_hGLDLL, "_glRasterPos3dv" );
+  qglRasterPos3f               = safe_dlsym (g_hGLDLL, "_glRasterPos3f" );
+  qglRasterPos3fv              = safe_dlsym (g_hGLDLL, "_glRasterPos3fv" );
+  qglRasterPos3i               = safe_dlsym (g_hGLDLL, "_glRasterPos3i" );
+  qglRasterPos3iv              = safe_dlsym (g_hGLDLL, "_glRasterPos3iv" );
+  qglRasterPos3s               = safe_dlsym (g_hGLDLL, "_glRasterPos3s" );
+  qglRasterPos3sv              = safe_dlsym (g_hGLDLL, "_glRasterPos3sv" );
+  qglRasterPos4d               = safe_dlsym (g_hGLDLL, "_glRasterPos4d" );
+  qglRasterPos4dv              = safe_dlsym (g_hGLDLL, "_glRasterPos4dv" );
+  qglRasterPos4f               = safe_dlsym (g_hGLDLL, "_glRasterPos4f" );
+  qglRasterPos4fv              = safe_dlsym (g_hGLDLL, "_glRasterPos4fv" );
+  qglRasterPos4i               = safe_dlsym (g_hGLDLL, "_glRasterPos4i" );
+  qglRasterPos4iv              = safe_dlsym (g_hGLDLL, "_glRasterPos4iv" );
+  qglRasterPos4s               = safe_dlsym (g_hGLDLL, "_glRasterPos4s" );
+  qglRasterPos4sv              = safe_dlsym (g_hGLDLL, "_glRasterPos4sv" );
+  qglReadBuffer                = safe_dlsym (g_hGLDLL, "_glReadBuffer" );
+  qglReadPixels                = safe_dlsym (g_hGLDLL, "_glReadPixels" );
+  qglRectd                     = safe_dlsym (g_hGLDLL, "_glRectd" );
+  qglRectdv                    = safe_dlsym (g_hGLDLL, "_glRectdv" );
+  qglRectf                     = safe_dlsym (g_hGLDLL, "_glRectf" );
+  qglRectfv                    = safe_dlsym (g_hGLDLL, "_glRectfv" );
+  qglRecti                     = safe_dlsym (g_hGLDLL, "_glRecti" );
+  qglRectiv                    = safe_dlsym (g_hGLDLL, "_glRectiv" );
+  qglRects                     = safe_dlsym (g_hGLDLL, "_glRects" );
+  qglRectsv                    = safe_dlsym (g_hGLDLL, "_glRectsv" );
+  qglRenderMode                = safe_dlsym (g_hGLDLL, "_glRenderMode" );
+  qglRotated                   = safe_dlsym (g_hGLDLL, "_glRotated" );
+  qglRotatef                   = safe_dlsym (g_hGLDLL, "_glRotatef" );
+  qglScaled                    = safe_dlsym (g_hGLDLL, "_glScaled" );
+  qglScalef                    = safe_dlsym (g_hGLDLL, "_glScalef" );
+  qglScissor                   = safe_dlsym (g_hGLDLL, "_glScissor" );
+  qglSelectBuffer              = safe_dlsym (g_hGLDLL, "_glSelectBuffer" );
+  qglShadeModel                = safe_dlsym (g_hGLDLL, "_glShadeModel" );
+  qglStencilFunc               = safe_dlsym (g_hGLDLL, "_glStencilFunc" );
+  qglStencilMask               = safe_dlsym (g_hGLDLL, "_glStencilMask" );
+  qglStencilOp                 = safe_dlsym (g_hGLDLL, "_glStencilOp" );
+  qglTexCoord1d                = safe_dlsym (g_hGLDLL, "_glTexCoord1d" );
+  qglTexCoord1dv               = safe_dlsym (g_hGLDLL, "_glTexCoord1dv" );
+  qglTexCoord1f                = safe_dlsym (g_hGLDLL, "_glTexCoord1f" );
+  qglTexCoord1fv               = safe_dlsym (g_hGLDLL, "_glTexCoord1fv" );
+  qglTexCoord1i                = safe_dlsym (g_hGLDLL, "_glTexCoord1i" );
+  qglTexCoord1iv               = safe_dlsym (g_hGLDLL, "_glTexCoord1iv" );
+  qglTexCoord1s                = safe_dlsym (g_hGLDLL, "_glTexCoord1s" );
+  qglTexCoord1sv               = safe_dlsym (g_hGLDLL, "_glTexCoord1sv" );
+  qglTexCoord2d                = safe_dlsym (g_hGLDLL, "_glTexCoord2d" );
+  qglTexCoord2dv               = safe_dlsym (g_hGLDLL, "_glTexCoord2dv" );
+  qglTexCoord2f                = safe_dlsym (g_hGLDLL, "_glTexCoord2f" );
+  qglTexCoord2fv               = safe_dlsym (g_hGLDLL, "_glTexCoord2fv" );
+  qglTexCoord2i                = safe_dlsym (g_hGLDLL, "_glTexCoord2i" );
+  qglTexCoord2iv               = safe_dlsym (g_hGLDLL, "_glTexCoord2iv" );
+  qglTexCoord2s                = safe_dlsym (g_hGLDLL, "_glTexCoord2s" );
+  qglTexCoord2sv               = safe_dlsym (g_hGLDLL, "_glTexCoord2sv" );
+  qglTexCoord3d                = safe_dlsym (g_hGLDLL, "_glTexCoord3d" );
+  qglTexCoord3dv               = safe_dlsym (g_hGLDLL, "_glTexCoord3dv" );
+  qglTexCoord3f                = safe_dlsym (g_hGLDLL, "_glTexCoord3f" );
+  qglTexCoord3fv               = safe_dlsym (g_hGLDLL, "_glTexCoord3fv" );
+  qglTexCoord3i                = safe_dlsym (g_hGLDLL, "_glTexCoord3i" );
+  qglTexCoord3iv               = safe_dlsym (g_hGLDLL, "_glTexCoord3iv" );
+  qglTexCoord3s                = safe_dlsym (g_hGLDLL, "_glTexCoord3s" );
+  qglTexCoord3sv               = safe_dlsym (g_hGLDLL, "_glTexCoord3sv" );
+  qglTexCoord4d                = safe_dlsym (g_hGLDLL, "_glTexCoord4d" );
+  qglTexCoord4dv               = safe_dlsym (g_hGLDLL, "_glTexCoord4dv" );
+  qglTexCoord4f                = safe_dlsym (g_hGLDLL, "_glTexCoord4f" );
+  qglTexCoord4fv               = safe_dlsym (g_hGLDLL, "_glTexCoord4fv" );
+  qglTexCoord4i                = safe_dlsym (g_hGLDLL, "_glTexCoord4i" );
+  qglTexCoord4iv               = safe_dlsym (g_hGLDLL, "_glTexCoord4iv" );
+  qglTexCoord4s                = safe_dlsym (g_hGLDLL, "_glTexCoord4s" );
+  qglTexCoord4sv               = safe_dlsym (g_hGLDLL, "_glTexCoord4sv" );
+  qglTexCoordPointer           = safe_dlsym (g_hGLDLL, "_glTexCoordPointer" );
+  qglTexEnvf                   = safe_dlsym (g_hGLDLL, "_glTexEnvf" );
+  qglTexEnvfv                  = safe_dlsym (g_hGLDLL, "_glTexEnvfv" );
+  qglTexEnvi                   = safe_dlsym (g_hGLDLL, "_glTexEnvi" );
+  qglTexEnviv                  = safe_dlsym (g_hGLDLL, "_glTexEnviv" );
+  qglTexGend                   = safe_dlsym (g_hGLDLL, "_glTexGend" );
+  qglTexGendv                  = safe_dlsym (g_hGLDLL, "_glTexGendv" );
+  qglTexGenf                   = safe_dlsym (g_hGLDLL, "_glTexGenf" );
+  qglTexGenfv                  = safe_dlsym (g_hGLDLL, "_glTexGenfv" );
+  qglTexGeni                   = safe_dlsym (g_hGLDLL, "_glTexGeni" );
+  qglTexGeniv                  = safe_dlsym (g_hGLDLL, "_glTexGeniv" );
+  qglTexImage1D                = safe_dlsym (g_hGLDLL, "_glTexImage1D" );
+  qglTexImage2D                = safe_dlsym (g_hGLDLL, "_glTexImage2D" );
+  qglTexParameterf             = safe_dlsym (g_hGLDLL, "_glTexParameterf" );
+  qglTexParameterfv            = safe_dlsym (g_hGLDLL, "_glTexParameterfv" );
+  qglTexParameteri             = safe_dlsym (g_hGLDLL, "_glTexParameteri" );
+  qglTexParameteriv            = safe_dlsym (g_hGLDLL, "_glTexParameteriv" );
+  qglTexSubImage1D             = safe_dlsym (g_hGLDLL, "_glTexSubImage1D" );
+  qglTexSubImage2D             = safe_dlsym (g_hGLDLL, "_glTexSubImage2D" );
+  qglTranslated                = safe_dlsym (g_hGLDLL, "_glTranslated" );
+  qglTranslatef                = safe_dlsym (g_hGLDLL, "_glTranslatef" );
+  qglVertex2d                  = safe_dlsym (g_hGLDLL, "_glVertex2d" );
+  qglVertex2dv                 = safe_dlsym (g_hGLDLL, "_glVertex2dv" );
+  qglVertex2f                  = safe_dlsym (g_hGLDLL, "_glVertex2f" );
+  qglVertex2fv                 = safe_dlsym (g_hGLDLL, "_glVertex2fv" );
+  qglVertex2i                  = safe_dlsym (g_hGLDLL, "_glVertex2i" );
+  qglVertex2iv                 = safe_dlsym (g_hGLDLL, "_glVertex2iv" );
+  qglVertex2s                  = safe_dlsym (g_hGLDLL, "_glVertex2s" );
+  qglVertex2sv                 = safe_dlsym (g_hGLDLL, "_glVertex2sv" );
+  qglVertex3d                  = safe_dlsym (g_hGLDLL, "_glVertex3d" );
+  qglVertex3dv                 = safe_dlsym (g_hGLDLL, "_glVertex3dv" );
+  qglVertex3f                  = safe_dlsym (g_hGLDLL, "_glVertex3f" );
+  qglVertex3fv                 = safe_dlsym (g_hGLDLL, "_glVertex3fv" );
+  qglVertex3i                  = safe_dlsym (g_hGLDLL, "_glVertex3i" );
+  qglVertex3iv                 = safe_dlsym (g_hGLDLL, "_glVertex3iv" );
+  qglVertex3s                  = safe_dlsym (g_hGLDLL, "_glVertex3s" );
+  qglVertex3sv                 = safe_dlsym (g_hGLDLL, "_glVertex3sv" );
+  qglVertex4d                  = safe_dlsym (g_hGLDLL, "_glVertex4d" );
+  qglVertex4dv                 = safe_dlsym (g_hGLDLL, "_glVertex4dv" );
+  qglVertex4f                  = safe_dlsym (g_hGLDLL, "_glVertex4f" );
+  qglVertex4fv                 = safe_dlsym (g_hGLDLL, "_glVertex4fv" );
+  qglVertex4i                  = safe_dlsym (g_hGLDLL, "_glVertex4i" );
+  qglVertex4iv                 = safe_dlsym (g_hGLDLL, "_glVertex4iv" );
+  qglVertex4s                  = safe_dlsym (g_hGLDLL, "_glVertex4s" );
+  qglVertex4sv                 = safe_dlsym (g_hGLDLL, "_glVertex4sv" );
+  qglVertexPointer             = safe_dlsym (g_hGLDLL, "_glVertexPointer" );
+  qglViewport                  = safe_dlsym (g_hGLDLL, "_glViewport" );
+#endif
   // must be init with an active context
   qglActiveTextureARB = NULL;
   qglClientActiveTextureARB = NULL;
@@ -1660,7 +2000,7 @@
     qglMTexCoord2fSGIS = 0;
 #endif
 
-#ifdef __linux__
+#if defined (__linux__)
   qglXChooseVisual             = safe_dlsym (g_hGLDLL, "glXChooseVisual");
   qglXCreateContext            = safe_dlsym (g_hGLDLL, "glXCreateContext");
   qglXDestroyContext           = safe_dlsym (g_hGLDLL, "glXDestroyContext");
@@ -1678,7 +2018,27 @@
   qglXWaitGL                   = safe_dlsym (g_hGLDLL, "glXWaitGL");
   qglXWaitX                    = safe_dlsym (g_hGLDLL, "glXWaitX");
   qglXUseXFont                 = safe_dlsym (g_hGLDLL, "glXUseXFont");
-  qglXGetProcAddressARB        = dlsym (g_hGLDLL, "glXGetProcAddressARB"); //
Utah-GLX fix
+//  qglXGetProcAddressARB        = dlsym (g_hGLDLL, "glXGetProcAddressARB"); //
Utah-GLX fix
+#endif
+#if defined (__APPLE__)
+  qglXChooseVisual             = safe_dlsym (g_hGLDLL, "_glXChooseVisual");
+  qglXCreateContext            = safe_dlsym (g_hGLDLL, "_glXCreateContext");
+  qglXDestroyContext           = safe_dlsym (g_hGLDLL, "_glXDestroyContext");
+  qglXMakeCurrent              = safe_dlsym (g_hGLDLL, "_glXMakeCurrent");
+  qglXCopyContext              = safe_dlsym (g_hGLDLL, "_glXCopyContext");
+  qglXSwapBuffers              = safe_dlsym (g_hGLDLL, "_glXSwapBuffers");
+  qglXCreateGLXPixmap          = safe_dlsym (g_hGLDLL, "_glXCreateGLXPixmap");
+  qglXDestroyGLXPixmap         = safe_dlsym (g_hGLDLL, "_glXDestroyGLXPixmap");
+  qglXQueryExtension           = safe_dlsym (g_hGLDLL, "_glXQueryExtension");
+  qglXQueryVersion             = safe_dlsym (g_hGLDLL, "_glXQueryVersion");
+  qglXIsDirect                 = safe_dlsym (g_hGLDLL, "_glXIsDirect");
+  qglXGetConfig                = safe_dlsym (g_hGLDLL, "_glXGetConfig");
+  qglXGetCurrentContext        = safe_dlsym (g_hGLDLL, "_glXGetCurrentContext");
+  qglXGetCurrentDrawable       = safe_dlsym (g_hGLDLL, "_glXGetCurrentDrawable");
+  qglXWaitGL                   = safe_dlsym (g_hGLDLL, "_glXWaitGL");
+  qglXWaitX                    = safe_dlsym (g_hGLDLL, "_glXWaitX");
+  qglXUseXFont                 = safe_dlsym (g_hGLDLL, "_glXUseXFont");
+//  qglXGetProcAddressARB        = dlsym (g_hGLDLL, "_glXGetProcAddressARB");
// Utah-GLX fix
 #endif
 
   qglPointParameterfEXT = 0;
@@ -1733,7 +2093,7 @@
 
 void* Sys_GLGetExtension (const char *symbol)
 {
-#ifdef __linux__
+#if defined (__linux__) || defined (__APPLE__)
   if (qglXGetProcAddressARB == NULL)
     return NULL;
   else
Index: radiant/watchbsp.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/watchbsp.cpp,v
retrieving revision 1.21.2.7
diff -u -r1.21.2.7 watchbsp.cpp
--- radiant/watchbsp.cpp	6 Jul 2002 23:22:44 -0000	1.21.2.7
+++ radiant/watchbsp.cpp	6 Nov 2002 16:42:45 -0000
@@ -517,7 +517,7 @@
                 // MP
 #if defined(WIN32)
                 cmd += "WolfMP.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined (__APPLE__)
                 cmd += "wolfmp";
 #else
 #error "WTF are you compiling on"
@@ -528,7 +528,7 @@
                 // SP
 #if defined(WIN32)
                 cmd += "WolfSP.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
                 cmd += "wolfsp";
 #else
 #error "WTF are you compiling on"
@@ -544,7 +544,7 @@
                 // MP
 #if defined(WIN32)
                 cmd += "jk2MP.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
                 cmd += "jk2mp";
 #else
 #error "WTF are you compiling on"
@@ -555,7 +555,7 @@
                 // SP
 #if defined(WIN32)
                 cmd += "jk2SP.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
                 cmd += "jk2sp";
 #else
 #error "WTF are you compiling on"
@@ -571,7 +571,7 @@
                 // MP
 #if defined(WIN32)
                 cmd += "stvoyHM.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
                 cmd += "stvoyHM";
 #else
 #error "WTF are you compiling on"
@@ -582,7 +582,7 @@
                 // SP
 #if defined(WIN32)
                 cmd += "stvoy.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
                 cmd += "stvoy";
 #else
 #error "WTF are you compiling on"
@@ -598,7 +598,7 @@
                 // MP
 #if defined(WIN32)
                 cmd += "sof2MP.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
                 cmd += "b00gus";
 #else
 #error "WTF are you compiling on"
@@ -609,7 +609,7 @@
                 // SP
 #if defined(WIN32)
                 cmd += "sof2.exe";
-#elif defined(__linux__)
+#elif defined(__linux__) || defined (__APPLE__)
                 cmd += "b00gus";
 #else
 #error "WTF are you compiling on"