]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Wean off #define
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 29 Dec 2017 04:49:57 +0000 (15:49 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 29 Dec 2017 04:49:57 +0000 (15:49 +1100)
82 files changed:
contrib/bobtoolz/DBobView.cpp
contrib/bobtoolz/DBobView.h
contrib/bobtoolz/DBrush.h
contrib/bobtoolz/DPatch.h
contrib/bobtoolz/DShape.h
contrib/bobtoolz/DTreePlanter.h
contrib/bobtoolz/DWinding.cpp
contrib/bobtoolz/DWinding.h
contrib/bobtoolz/ScriptParser.cpp
contrib/bobtoolz/ScriptParser.h
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/bsploader.cpp
contrib/bobtoolz/bsploader.h
contrib/bobtoolz/cportals.cpp
contrib/bobtoolz/dialogs/AboutDialog.cpp
contrib/bobtoolz/dialogs/AutoCaulkDialog.cpp
contrib/bobtoolz/dialogs/AutoCaulkStartDialog.cpp
contrib/bobtoolz/dialogs/AutoCaulkStartDialog.h
contrib/bobtoolz/dialogs/DoorDialog.cpp
contrib/bobtoolz/dialogs/IntersectDialog.cpp
contrib/bobtoolz/dialogs/IntersectDialog.h
contrib/bobtoolz/dialogs/IntersectInfoDialog.cpp
contrib/bobtoolz/dialogs/PolygonDialog.cpp
contrib/bobtoolz/dialogs/StairDialog.cpp
contrib/bobtoolz/dialogs/TextureResetDialog.cpp
contrib/bobtoolz/dialogs/brushcheckdialog.cpp
contrib/bobtoolz/dialogs/pathplotterdialog.cpp
contrib/bobtoolz/funchandlers.h
contrib/bobtoolz/misc.h
contrib/brushexport/export.cpp
contrib/prtview/portals.cpp
contrib/prtview/portals.h
contrib/prtview/prtview.cpp
contrib/prtview/prtview.h
contrib/ufoaiplug/ufoai_filters.h
contrib/ufoaiplug/ufoai_gtk.cpp
libs/ddslib/ddslib.c
libs/l_net/l_net.c
libs/l_net/l_net.h
libs/l_net/l_net_berkley.c
libs/l_net/l_net_wins.c
libs/l_net/l_net_wins.h
libs/mathlib/bbox.c
libs/mathlib/m4x4.c
libs/mathlib/mathlib.c
libs/mathlib/ray.c
libs/picomodel/lwo/lwio.c
libs/picomodel/picointernal.c
libs/picomodel/picomodel.c
libs/picomodel/picomodules.c
libs/picomodel/pm_3ds.c
libs/picomodel/pm_ase.c
libs/picomodel/pm_fm.c
libs/picomodel/pm_lwo.c
libs/picomodel/pm_md2.c
libs/picomodel/pm_md3.c
libs/picomodel/pm_mdc.c
libs/picomodel/pm_ms3d.c
libs/picomodel/pm_obj.c
libs/picomodel/pm_terrain.c
libs/splines/q_parse.cpp
libs/splines/splines.cpp
plugins/image/jpeg.cpp
plugins/image/ktx.cpp
plugins/imagehl/sprite.cpp
plugins/imageq2/wal.cpp
plugins/iqmmodel/iqm.cpp
plugins/mapq3/plugin.cpp
plugins/mapxml/xmlparse.cpp
plugins/md3model/md2.cpp
plugins/md3model/md3.cpp
plugins/md3model/mdc.cpp
plugins/vfspk3/vfs.cpp
radiant/build.cpp
radiant/camwindow.cpp
radiant/eclass_fgd.cpp
radiant/mru.cpp
radiant/patch.cpp
radiant/preferences.cpp
radiant/server.cpp
radiant/sockets.cpp
radiant/watchbsp.cpp

index 55dd8e4dd58d083435c2e79be5fd901c77fbbcaa..decfe7790664dbd3dd4654d2907177aac1323205 100644 (file)
@@ -143,7 +143,7 @@ void DBobView::SetPath( vec3_t *pPath ){
        path = pPath;
 }
 
-#define LOCAL_GRAVITY -800.0f
+const float LOCAL_GRAVITY = -800.0f;
 
 bool DBobView::CalculateTrajectory( vec3_t start, vec3_t apex, float multiplier, int points, float varGravity ){
        if ( apex[2] <= start[2] ) {
@@ -264,4 +264,4 @@ void DBobView_setEntity( Entity& entity, float multiplier, int points, float var
                globalErrorStream() << "bobToolz PathPlotter: Entity must have a targetname.\n";
        }
        return;
-}
\ No newline at end of file
+}
index 05c8ad29a90fe4386ba6551fe61d120403299da0..fe3d8dc3b85c0da41e26915c9fddb978b56c0ede 100644 (file)
@@ -32,8 +32,8 @@
 class DListener;
 class Shader;
 
-#define BOUNDS_ALL  0
-#define BOUNDS_APEX 1
+const int BOUNDS_ALL  = 0;
+const int BOUNDS_APEX = 1;
 
 #if _MSC_VER > 1000
 #pragma once
index b5e343eb822a9945df1cd299860dc60d4724b759..7b3e8d6035ca47b69e0f1eb1b5b36452e4cf2989 100644 (file)
@@ -44,9 +44,9 @@ class Node;
 class Instance;
 }
 
-#define POINT_IN_BRUSH  0
-#define POINT_ON_BRUSH  1
-#define POINT_OUT_BRUSH 2
+const int POINT_IN_BRUSH  = 0;
+const int POINT_ON_BRUSH  = 1;
+const int POINT_OUT_BRUSH = 2;
 
 class DBrush
 {
index 8808daeb695768a30cd8e6decfc6b1447f1908fa..4d0c26c5718acdad9708811fe1ca654e4dce3a34 100644 (file)
@@ -47,10 +47,10 @@ class Node;
 class Instance;
 }
 
-#define MAX_PATCH_WIDTH 32
-#define MAX_PATCH_HEIGHT 32
-#define MIN_PATCH_WIDTH 3
-#define MIN_PATCH_HEIGHT 3
+const int MAX_PATCH_WIDTH = 32;
+const int MAX_PATCH_HEIGHT = 32;
+const int MIN_PATCH_WIDTH = 3;
+const int MIN_PATCH_HEIGHT = 3;
 
 class DPatch
 {
index 1f6c91fcaece093f3afb36c4e2c4aacb3126988a..31c66e13034dbe2292fa2451bbdd4a37d929914c 100644 (file)
@@ -35,7 +35,7 @@ class DBrush;
 class DEntity;
 
 // defines for polygon stuff
-#define MAX_POLYGON_FACES   128
+const int MAX_POLYGON_FACES = 128;
 
 extern bool bFacesAll[];
 
index 1d198ae63dddfed5b3f27278a01609c70ba526eb..b7bc42003f5d4a79695894bb8bfc81dfb4db94a9 100644 (file)
 #include "mathlib.h"
 #include "misc.h"
 
-#define MAX_QPATH 64
+const int MAX_QPATH = 64;
 
 typedef struct treeModel_s {
        char name[MAX_QPATH];
 } treeModel_t;
 
-#define MAX_TP_MODELS 256
+const int MAX_TP_MODELS = 256;
 
 class DTreePlanter {
 MouseEventHandlerId m_mouseDown;
index c3d811802fd4c83629c2c20e98cb103237c571da..e4dc026dddf867a42a14ff66870dbd759b4ea0de 100644 (file)
@@ -47,7 +47,7 @@ DWinding::~DWinding(){
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-#define BOGUS_RANGE 4096
+const int BOGUS_RANGE = 4096;
 
 void DWinding::AllocWinding( int points ){
        numpoints = points;
index 94a28096f457ee09ae2a5feb9620865bb4536ab1..cb8ddda759197504eb5eeef5dd2970aae9b87172 100644 (file)
@@ -63,8 +63,8 @@ vec3_t* p;
 vec3_t clr;
 };
 
-#define MAX_POINTS_ON_WINDING   64
+const int MAX_POINTS_ON_WINDING = 64;
 
-#define ON_EPSILON  0.01
+const double ON_EPSILON = 0.01;
 
 #endif // !defined(AFX_DWINDING_H__35B2C524_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
index d53c7fe8dc4801994e6b092e5a0e7c8729471c63..3c801b26719f80f22ae255c9cfa320d7a6310c3e 100644 (file)
@@ -65,7 +65,7 @@ const char* CScriptParser::MakeToken( const char* pToken ) {
        return m_pToken;
 }
 
-#define MAX_TOKEN_STRING 1024
+const int MAX_TOKEN_STRING = 1024;
 // Should NEVER return NULL
 const char* CScriptParser::GetToken( bool bAllowLinebreaks ) {
        int c = 0, len;
index b9ec823d3a9977899ed4a4543eb0a83a6276e520..2729dcaeb873ce3cbce996126677d17ed2567fff 100644 (file)
@@ -23,7 +23,7 @@
 
 //#include "interfaces/IScriptParser.h"
 
-#define SP_MAX_BREAKCHARS 16
+const int SP_MAX_BREAKCHARS = 16;
 
 class CScriptParser //: public IScriptParser
 {
index 28939546d6bc4b6826112b79cb2a99c2730037ae..0632f2b1ad131fef0a8e87b78091a8a7f1401fc5 100644 (file)
@@ -155,7 +155,7 @@ const char* QERPlug_GetCommandTitleList(){
 }
 
 
-#define NUM_TOOLBARBUTTONS 14
+const int NUM_TOOLBARBUTTONS = 14;
 
 std::size_t ToolbarButtonCount( void ) {
        return NUM_TOOLBARBUTTONS;
index 6c8b09e90f185431e78c748a932e51eaf6e23527..0fb93c575e1672125b2f9ee60b2d09287ff0a9fd 100644 (file)
@@ -24,9 +24,9 @@ dbrush_t          *dbrushes =             NULL;
 dbrushside_t    *dbrushsides =      NULL;
 int                 *dleafbrushes =     NULL;
 
-#define BSP_IDENT   ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'B' << 8 ) + 'I' )
-#define Q3_BSP_VERSION          46
-#define WOLF_BSP_VERSION            47
+const int BSP_IDENT = ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'B' << 8 ) + 'I' );
+const int Q3_BSP_VERSION = 46;
+const int WOLF_BSP_VERSION = 47;
 
 /*
    ================
index 7bee8fd02ce801e5bbc551de4e660f2f6a56f5c1..47e9f5a32b17bbf860f3d4aa9cdaab7263f26cc9 100644 (file)
@@ -1,24 +1,24 @@
 
 #include "mathlib.h"
 
-#define LUMP_ENTITIES       0
-#define LUMP_SHADERS        1
-#define LUMP_PLANES         2
-#define LUMP_NODES          3
-#define LUMP_LEAFS          4
-#define LUMP_LEAFSURFACES   5
-#define LUMP_LEAFBRUSHES    6
-#define LUMP_MODELS         7
-#define LUMP_BRUSHES        8
-#define LUMP_BRUSHSIDES     9
-#define LUMP_DRAWVERTS      10
-#define LUMP_DRAWINDEXES    11
-#define LUMP_FOGS           12
-#define LUMP_SURFACES       13
-#define LUMP_LIGHTMAPS      14
-#define LUMP_LIGHTGRID      15
-#define LUMP_VISIBILITY     16
-#define HEADER_LUMPS        17
+const int LUMP_ENTITIES       = 0;
+const int LUMP_SHADERS        = 1;
+const int LUMP_PLANES         = 2;
+const int LUMP_NODES          = 3;
+const int LUMP_LEAFS          = 4;
+const int LUMP_LEAFSURFACES   = 5;
+const int LUMP_LEAFBRUSHES    = 6;
+const int LUMP_MODELS         = 7;
+const int LUMP_BRUSHES        = 8;
+const int LUMP_BRUSHSIDES     = 9;
+const int LUMP_DRAWVERTS      = 10;
+const int LUMP_DRAWINDEXES    = 11;
+const int LUMP_FOGS           = 12;
+const int LUMP_SURFACES       = 13;
+const int LUMP_LIGHTMAPS      = 14;
+const int LUMP_LIGHTGRID      = 15;
+const int LUMP_VISIBILITY     = 16;
+const int HEADER_LUMPS        = 17;
 
 typedef struct {
        int fileofs, filelen;
@@ -106,10 +106,10 @@ typedef enum {
        MST_FLARE
 } mapSurfaceType_t;
 
-#define MAX_MAP_VISIBILITY  0x200000
-#define MAX_MAP_NODES       0x20000
-#define MAX_MAP_PLANES      0x20000
-#define MAX_MAP_LEAFS       0x20000
+const int MAX_MAP_VISIBILITY  = 0x200000;
+const int MAX_MAP_NODES       = 0x20000;
+const int MAX_MAP_PLANES      = 0x20000;
+const int MAX_MAP_LEAFS       = 0x20000;
 
 extern int numVisBytes;
 extern int numleafs;
index 073c979de5b69e1be5462958b1808acdf4974cdb..d8ec2a6086b8cb073d23ea557aef23608f3af35c 100644 (file)
@@ -24,8 +24,8 @@
 
 #include "misc.h"
 
-#define LINE_BUF 1000
-#define MSG_PREFIX "bobToolz plugin: "
+const int LINE_BUF = 1000;
+const char *MSG_PREFIX = "bobToolz plugin: ";
 
 // these classes are far less of a mess than my code was,
 // thanq to G.DeWan 4 the prtview source on which it was based
@@ -118,7 +118,7 @@ void CPortals::Load(){
 
        Purge();
 
-       globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n";
+       globalOutputStream() << MSG_PREFIX << "Loading portal file " << fn << ".\n";
 
        FILE *in;
 
index 6ba6df1426a3b0d87fe2ba896b27a48ad33f01b8..0f5ef44fd190bc7ff7630d61410fc540d6e9fbee 100644 (file)
 #include "../StdAfx.h"
 #include "AboutDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CAboutDialog dialog
 
index bcbb495717eea89adbeed543ce6b27090ee36b86..a04c604c5eff7c75ba8e5b584258823d3dd38056 100644 (file)
 #include "../bobtoolz.h"
 #include "AutoCaulkDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CAutoCaulkDialog dialog
 
index f59dfd338291dbdc9a07279ecc8849238a97f19a..f112f02b0cb1891ddd659e30d7ff39274797245e 100644 (file)
 #include "../bobtoolz.h"
 #include "AutoCaulkStartDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CAutoCaulkStartDialog dialog
 
index 5c2f4297840e2e57a30b72fccddd8bcaa03b8930..73e265f44d8f45068d432039f4d7258056d7d0cb 100644 (file)
@@ -26,9 +26,9 @@
 // AutoCaulkStartDialog.h : header file
 //
 
-#define MODE_AC_NORMAL          0
-#define MODE_AC_BUILD_MINI_PRT  1
-#define MODE_AC_SUPER           2
+const int MODE_AC_NORMAL          = 0;
+const int MODE_AC_BUILD_MINI_PRT  = 1;
+const int MODE_AC_SUPER           = 2;
 
 /////////////////////////////////////////////////////////////////////////////
 // CAutoCaulkStartDialog dialog
index ce0d621325c32e1b693618d3c7ace0db0eb965dd..50e7ef7644572bb89cc5d09f5aec46d1eaebaff8 100644 (file)
 #include "../StdAfx.h"
 #include "DoorDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CDoorDialog dialog
 
index 4bcc8373fb769b22b840e70a28dd8de5057b15fd..8b2a0c7249fe467316bafe429f81c0d1319162fb 100644 (file)
 #include "../StdAfx.h"
 #include "IntersectDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CIntersectDialog dialog
 
index d8d64c3e088748236d685126d6230986ff4e6f87..b9c342b4ef42160f4b8c6193e3fd88fdbcb421dc 100644 (file)
@@ -26,8 +26,8 @@
 // IntersectDialog.h : header file
 //
 
-#define BRUSH_OPT_WHOLE_MAP 0
-#define BRUSH_OPT_SELECTED  1
+const int BRUSH_OPT_WHOLE_MAP = 0;
+const int BRUSH_OPT_SELECTED  = 1;
 
 /////////////////////////////////////////////////////////////////////////////
 // CIntersectDialog dialog
index c74a635e942812520d7da6f4310931a8192f0751..6d61f6ce991a92e37dbc714b03009a34439e9ded 100644 (file)
 #include "../bobtoolz.h"
 #include "IntersectInfoDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CIntersectInfoDialog dialog
 
index 652d9cb07875e3c865148dec6a868d7a2f60c528..ec7ee2cd57696aaa76b42cc196b3f21106634b98 100644 (file)
 #include "PolygonDialog.h"
 #include "../shapes.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CPolygonDialog dialog
 
index 8b94092f68fddc6bb9b268cb1c41187bbbcea429..e0cd2f142db15dcd542760ba54ecd6b7abc80bcb 100644 (file)
 #include "../StdAfx.h"
 #include "StairDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CStairDialog dialog
 
index 0913f51bb7a3c710fba32846e275cc4ba8e994c6..4b9991a082bc3cffc0c49bd4571d94f8a9eeb2d8 100644 (file)
 #include "../bobtoolz.h"
 #include "TextureResetDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CTextureResetDialog dialog
 
index 3b3ac60716d13857a96e545fac493527938d05fb..0b36f21f4a74ab6671ef1abd411ee17d3cd225c3 100644 (file)
 #include "../bobtoolz.h"
 #include "BrushCheckDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CBrushCheckDialog dialog
 
index ea64f26e64b595a4a60de60925864aa591ffae56..65e4f5061252ca7377135faf45e6a34176362df0 100644 (file)
 #include "../bobtoolz.h"
 #include "PathPlotterDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CPathPlotterDialog dialog
 
index b25cc6d8a75cf52770d3f450484e0c4aa97b2299..6062ea6e453328557984b6b154b5aa96770246b6 100644 (file)
@@ -28,22 +28,22 @@ extern DTrainDrawer* g_TrainView;
 extern DTreePlanter* g_TreePlanter;
 
 // intersect stuff
-#define BRUSH_OPT_WHOLE_MAP 0
-#define BRUSH_OPT_SELECTED  1
+const int BRUSH_OPT_WHOLE_MAP = 0;
+const int BRUSH_OPT_SELECTED  = 1;
 
 // defines for stairs
-#define MOVE_NORTH  0
-#define MOVE_SOUTH  1
-#define MOVE_EAST   2
-#define MOVE_WEST   3
+const int MOVE_NORTH  = 0;
+const int MOVE_SOUTH  = 1;
+const int MOVE_EAST   = 2;
+const int MOVE_WEST   = 3;
 
-#define STYLE_ORIGINAL  0
-#define STYLE_BOB       1
-#define STYLE_CORNER    2
+const int STYLE_ORIGINAL  = 0;
+const int STYLE_BOB       = 1;
+const int STYLE_CORNER    = 2;
 
 // defines for doors
-#define DIRECTION_NS    0
-#define DIRECTION_EW    1
+const int DIRECTION_NS    = 0;
+const int DIRECTION_EW    = 1;
 
 // help
 void LoadLists();
index 02ca174b19b7699b4e161fa24b6054fb1b57a0ba..4383935630ce910e15ab51943f5639e1d9435a0e 100644 (file)
@@ -25,7 +25,7 @@
 #include "str.h"
 #include "iscenegraph.h"
 
-#define MAX_ROUND_ERROR 0.05
+const double MAX_ROUND_ERROR = 0.05;
 
 vec_t Min( vec_t a, vec_t b );
 
index 4a1e2d4c2d2566796aeebc2033c5b9eefd511c89..09720d8d6fe72b578d8706f5a52dfe8303ab4ece 100644 (file)
@@ -12,7 +12,7 @@
 #include "../../radiant/brush.h"
 
 // for limNames
-#define MAX_MATERIAL_NAME 20
+const int MAX_MATERIAL_NAME = 20;
 
 /*
     Abstract baseclass for modelexporters
index 0522fe40e3e3b0c873517472bb7f4a3ac75d0566..efc8d5050ade2d88466591378ef8969293f2242d 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "prtview.h"
 
-#define LINE_BUF 1000
+const int LINE_BUF = 1000;
 
 CPortals portals;
 CPortalsRender render;
index 1fd2f0375fc04c2f9b8a740bfc96c40b8238ec79..4865108855fd835a0cdef9322c8c409ef98d093f 100644 (file)
@@ -53,9 +53,9 @@ bool Build( char *def );
 };
 
 #ifdef PATH_MAX
-#define PRTVIEW_PATH_MAX PATH_MAX
+const int PRTVIEW_PATH_MAX = PATH_MAX;
 #else
-#define PRTVIEW_PATH_MAX 260
+const int PRTVIEW_PATH_MAX = 260;
 #endif
 typedef guint32 PackedColour;
 #define RGB( r, g, b ) ( (guint32)( ( (guint8) ( r ) | ( (guint16) ( g ) << 8 ) ) | ( ( (guint32) (guint8) ( b ) ) << 16 ) ) )
index ffb813ea73cb5b520e8b0655617ab52011ec5fe5..080af13a3c8ba35a8b1e087a4cc7a7865c95b3a5 100644 (file)
@@ -48,23 +48,23 @@ CopiedString INIfn;
 /////////////////////////////////////////////////////////////////////////////
 // CPrtViewApp construction
 
-#define RENDER_2D "Render2D"
-#define WIDTH_2D "Width2D"
-#define AA_2D "AntiAlias2D"
-#define COLOR_2D "Color2D"
-
-#define RENDER_3D "Render3D"
-#define WIDTH_3D "Width3D"
-#define AA_3D "AntiAlias3D"
-#define COLOR_3D "Color3D"
-#define COLOR_FOG "ColorFog"
-#define FOG "Fog"
-#define ZBUFFER "ZBuffer"
-#define POLYGON "Polygons"
-#define LINE "Lines"
-#define TRANS_3D "Transparency"
-#define CLIP_RANGE "ClipRange"
-#define CLIP "Clip"
+const char *RENDER_2D = "Render2D";
+const char *WIDTH_2D = "Width2D";
+const char *AA_2D = "AntiAlias2D";
+const char *COLOR_2D = "Color2D";
+
+const char *RENDER_3D = "Render3D";
+const char *WIDTH_3D = "Width3D";
+const char *AA_3D = "AntiAlias3D";
+const char *COLOR_3D = "Color3D";
+const char *COLOR_FOG = "ColorFog";
+const char *FOG = "Fog";
+const char *ZBUFFER = "ZBuffer";
+const char *POLYGON = "Polygons";
+const char *LINE = "Lines";
+const char *TRANS_3D = "Transparency";
+const char *CLIP_RANGE = "ClipRange";
+const char *CLIP = "Clip";
 
 
 void PrtView_construct(){
@@ -160,7 +160,7 @@ void SaveConfig(){
 }
 
 
-#define CONFIG_SECTION "Configuration"
+const char *CONFIG_SECTION = "Configuration";
 
 int INIGetInt( const char *key, int def ){
        char value[1024];
index df84d6a24cf6eaf242bd62e00eee958b1a486fca..6b0487826aff3b6b7834b80e9c5488c3e3c21d23 100644 (file)
@@ -28,8 +28,8 @@ void SaveConfig();
 int INIGetInt( const char *key, int def );
 void INISetInt( const char *key, int val, const char *comment = 0 );
 
-#define IDOK                1
-#define IDCANCEL            2
+const int IDOK                = 1;
+const int IDCANCEL            = 2;
 
 
 #endif
index 840c45bc0dd2d328c6af70cc9c43ac1f39490120..99289922a3c29069d31ae17944ad485062515107 100644 (file)
@@ -25,18 +25,18 @@ void filter_actorclip( void );
 void filter_weaponclip( void );
 void filter_nodraw( void );
 
-#define SURF_NODRAW 0x80
-
-#define CONTENTS_LEVEL8 0x8000
-#define CONTENTS_LEVEL7 0x4000
-#define CONTENTS_LEVEL6 0x2000
-#define CONTENTS_LEVEL5 0x1000
-#define CONTENTS_LEVEL4 0x0800
-#define CONTENTS_LEVEL3 0x0400
-#define CONTENTS_LEVEL2 0x0200
-#define CONTENTS_LEVEL1 0x0100
-#define CONTENTS_ACTORCLIP 0x10000
-#define CONTENTS_WEAPONCLIP 0x2000000
-#define CONTENTS_STEPON 0x40000000
+const int SURF_NODRAW = 0x80;
+
+const int CONTENTS_LEVEL8 = 0x8000;
+const int CONTENTS_LEVEL7 = 0x4000;
+const int CONTENTS_LEVEL6 = 0x2000;
+const int CONTENTS_LEVEL5 = 0x1000;
+const int CONTENTS_LEVEL4 = 0x0800;
+const int CONTENTS_LEVEL3 = 0x0400;
+const int CONTENTS_LEVEL2 = 0x0200;
+const int CONTENTS_LEVEL1 = 0x0100;
+const int CONTENTS_ACTORCLIP = 0x10000;
+const int CONTENTS_WEAPONCLIP = 0x2000000;
+const int CONTENTS_STEPON = 0x40000000;
 
 #endif
index 072b8c7e4ea0009f7bd7a15296d065ebab7a5baf..fa683feb41e432d3d1ab7d80275f610e958bb40d 100644 (file)
@@ -52,7 +52,7 @@ static void close_window( GtkWidget *widget, gpointer data ){
 
 /* =============================== */
 
-#define NUM_TOOLBARBUTTONS 12
+const int NUM_TOOLBARBUTTONS = 12;
 
 /**
  * @brief
index b60e506bed180d56b25c3e37df43d56455af3bd2..26ccf2e9f6a648b173c10d57de2c9e3b5a02bd77 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define DDSLIB_C
-
-
-
 /* dependencies */
 #include "ddslib.h"
 
index 7f50d054b94a1f0d10c8b6e14ea5881c011f6700..fa7b31f486a7c571c12f994bdfebc4bb4528a622 100644 (file)
 #include "l_net.h"
 #include "l_net_wins.h"
 
-#define GetMemory malloc
-#define FreeMemory free
-
-#define qtrue   1
-#define qfalse  0
-
 #ifdef _DEBUG
 void WinPrint( const char *str, ... ){
        va_list argptr;
@@ -183,7 +177,7 @@ int Net_Receive( socket_t *sock, netmessage_t *msg ){
 socket_t *Net_AllocSocket( void ){
        socket_t *sock;
 
-       sock = (socket_t *) GetMemory( sizeof( socket_t ) );
+       sock = (socket_t *) malloc( sizeof( socket_t ) );
        memset( sock, 0, sizeof( socket_t ) );
        return sock;
 } //end of the function Net_AllocSocket
@@ -194,7 +188,7 @@ socket_t *Net_AllocSocket( void ){
 // Changes Globals:            -
 //===========================================================================
 void Net_FreeSocket( socket_t *sock ){
-       FreeMemory( sock );
+       free( sock );
 } //end of the function Net_FreeSocket
 //===========================================================================
 //
index 120201b3629fa620ab988b519340d621e3cbf1ac..c807091880170f16f0d5374f746945c617e23932 100644 (file)
 extern "C" {
 #endif
 
-#ifndef __BYTEBOOL__
-#define __BYTEBOOL__
-typedef enum { qfalse, qtrue } qboolean;
-typedef unsigned char byte;
-#endif
+#include "bytebool.h"
 
 typedef struct address_s
 {
index ac618dd684002a966923c18f3780fc01ab3333ef..f53f37e82bcd30c05c2c17ea31abb5f361c0dbc6 100644 (file)
 #include <unistd.h>
 #include <stdarg.h>
 #include <stdio.h>
-#define SOCKET_ERROR -1
-#define INVALID_SOCKET -1
+const int SOCKET_ERROR = -1;
+const int INVALID_SOCKET = -1;
 
 #define WinError WinPrint
 
-#define qtrue   1
-#define qfalse  0
-
 #define ioctlsocket ioctl
 #define closesocket close
 
@@ -80,9 +77,9 @@ typedef struct tag_error_struct
 
 static char my_tcpip_address[NET_NAMELEN];
 
-#define DEFAULTnet_hostport 26000
+const int DEFAULTnet_hostport = 26000;
 
-#define MAXHOSTNAMELEN      256
+const int MAXHOSTNAMELEN = 256;
 
 static int net_acceptsocket = -1;       // socket for fielding new connections
 static int net_controlsocket;
index 30ef9ac035d23cc39deb7cd5b8a547a8feafe3a0..937e7abb9cb52dc772a3f15a3f7ec4d93a160302 100644 (file)
 
 #define WinError WinPrint
 
-#define qtrue   1
-#define qfalse  0
-
 typedef struct tag_error_struct
 {
        int errnum;
        LPSTR errstr;
 } ERROR_STRUCT;
 
-#define NET_NAMELEN         64
+const int NET_NAMELEN = 64;
 
 char my_tcpip_address[NET_NAMELEN];
 
-#define DEFAULTnet_hostport 26000
+const int DEFAULTnet_hostport = 26000;
 
-#define MAXHOSTNAMELEN      256
+const int MAXHOSTNAMELEN = 256;
 
 static int net_acceptsocket = -1;       // socket for fielding new connections
 static int net_controlsocket;
index ebe754723dc463f8fb1c4ff7e6696213b318967f..4ee5803ea04af60b9372e4674bd85d46e660684c 100644 (file)
@@ -29,6 +29,8 @@
 // Notes:
 //===========================================================================
 
+#include "bytebool.h"
+
 int  WINS_Init( void );
 void WINS_Shutdown( void );
 char *WINS_MyAddress( void );
index fc9c1e33a9d22ad20c64a89a1ac10a0062f4f77f..fe5646d9327e683c2285d0e9f2541a6b436b68dc 100644 (file)
@@ -166,10 +166,10 @@ int aabb_test_plane( const aabb_t *aabb, const float *plane ){
    from "Graphics Gems", Academic Press, 1990
  */
 
-#define NUMDIM  3
-#define RIGHT   0
-#define LEFT    1
-#define MIDDLE  2
+const int NUMDIM  = 3;
+const int RIGHT   = 0;
+const int LEFT    = 1;
+const int MIDDLE  = 2;
 
 int aabb_intersect_ray( const aabb_t *aabb, const ray_t *ray, vec3_t intersection ){
        int inside = 1;
index cb1ad87eb6f4d85367aaaba091b50a91d4f5726e..45e421f4d60eb5cc8748fc956f0cb4620eb8739b 100644 (file)
@@ -1737,9 +1737,8 @@ void m4x4_solve_ge( m4x4_t matrix, vec4_t x ){
 }
 #endif
 
-#define N 3
-
 int matrix_solve_ge( vec_t* matrix, vec_t* aug, vec3_t x ){
+       const int N = 3;
        int indx[N];
        int c,r;
        int i;
index ce6cfdc2d87fcf87e4920af33657deded791b020..da26a92072ec95c865506ec30ab3e5bfea404f70 100644 (file)
@@ -325,7 +325,7 @@ void _Vector53Copy( vec5_t in, vec3_t out ){
 }
 
 // NOTE: added these from Ritual's Q3Radiant
-#define INVALID_BOUNDS 99999
+const int INVALID_BOUNDS = 99999;
 void ClearBounds( vec3_t mins, vec3_t maxs ){
        mins[0] = mins[1] = mins[2] = +INVALID_BOUNDS;
        maxs[0] = maxs[1] = maxs[2] = -INVALID_BOUNDS;
index f08a884284901e53eb788c6ffc8c972d60e1e367..36a26168d8ee61f1e380d8f5d19b8e5a345ed676 100644 (file)
@@ -58,7 +58,7 @@ vec_t ray_intersect_point( const ray_t *ray, const vec3_t point, vec_t epsilon,
 
 // Tomas Moller and Ben Trumbore. Fast, minimum storage ray-triangle intersection. Journal of graphics tools, 2(1):21-28, 1997
 
-#define EPSILON 0.000001
+const double EPSILON = 0.000001;
 
 vec_t ray_intersect_triangle( const ray_t *ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ){
        float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
index cf3d5963148792523cfc10b49ea1545d32ea44de..824a693fd8df2803247a66956f343374aa1a3119 100644 (file)
@@ -23,7 +23,7 @@
    read requests until flen is reset.
    ====================================================================== */
 
-#define FLEN_ERROR INT_MIN
+const int FLEN_ERROR = INT_MIN;
 
 static int flen;
 
index e1bf9d1bb98e02aed6e0d040220e62b8c60c9010..e5e9238bf152b033bd3002ed155a1feb19c05421 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PICOINTERNAL_C
-
-
-
 /* todo:
  * - fix p->curLine for parser routines. increased twice
  */
index 4526745c290b6a0d83acaeb8885b82599d988f83..311f6de760c7791bb9e94f717d481a192c46dfdc 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PICOMODEL_C
-
-
-
 /* dependencies */
 #include "picointernal.h"
 
@@ -1426,7 +1419,7 @@ int PicoGetSurfaceSpecial( picoSurface_t *surface, int num ){
 
 /* hashtable code for faster vertex lookups */
 //#define HASHTABLE_SIZE 32768 // 2048                 /* power of 2, use & */
-#define HASHTABLE_SIZE 7919 // 32749 // 2039    /* prime, use % */
+const int HASHTABLE_SIZE = 7919; // 32749 // 2039    /* prime, use % */
 
 int PicoGetHashTableSize( void ){
        return HASHTABLE_SIZE;
index 9a973724e20457a3accd3f3176c1dfdfde2fbb56..77bb4918b22af6a9385cc71af558c912dc347d56 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PICOMODULES_C
-
-
-
 /* dependencies */
 #include "picointernal.h"
 
index 83a1446e0961fa2b474f8511279fa4d063d8354e..1a8e88f1985a2fe04e122fecc35ada208879340b 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PM_3DS_C
-
 /* dependencies */
 #include "picointernal.h"
 
index 001cca4f35d09897e12934d251ae8efcde2cef64..d73187c6ec706c2131b8282f89ec28a5f1f35eca 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-/* marker */
-#define PM_ASE_C
-
 /* uncomment when debugging this module */
 //#define DEBUG_PM_ASE
 //#define DEBUG_PM_ASE_EX
index eefee2e7d64f38377d3b714fbe7afbfc2809c8d4..c4086184c317cf15547c4f42637dff9f9d32b85b 100644 (file)
@@ -36,9 +36,6 @@
    Nurail: Used pm_md3.c (Randy Reddig) as a template.
  */
 
-/* marker */
-#define PM_FM_C
-
 /* dependencies */
 #include "pm_fm.h"
 
index 812496ae40fe8c43382367c090771f986cc665dc..6cbf0f4c162d50916f4fec5674d42ef87011e423 100644 (file)
@@ -32,9 +32,6 @@
 
    ----------------------------------------------------------------------------- */
 
-/* marker */
-#define PM_LWO_C
-
 /* dependencies */
 #include "picointernal.h"
 #include "lwo/lwo2.h"
index 28cf384e965c918366e0e749fe0f25d3e97cad66..37b5466c56f712e3c36c39dd6d72aaf4dc10d667 100644 (file)
    Nurail: Used pm_md3.c (Randy Reddig) as a template.
  */
 
-
-/* marker */
-#define PM_MD2_C
-
 /* dependencies */
 #include "picointernal.h"
-
+#include "bytebool.h"
 
 /* md2 model format */
-#define MD2_MAGIC               "IDP2"
-#define MD2_VERSION             8
-
-#define MD2_NUMVERTEXNORMALS    162
-#define MD2_MAX_SKINNAME        64
-#define MD2_MAX_TRIANGLES       4096
-#define MD2_MAX_VERTS           2048
-#define MD2_MAX_FRAMES          512
-#define MD2_MAX_MD2SKINS        32
-#define MD2_MAX_SKINNAME        64
-
-#ifndef byte
-       #define byte unsigned char
-#endif
+const char *MD2_MAGIC             = "IDP2";
+const int MD2_VERSION             = 8;
+
+#define MD2_NUMVERTEXNORMALS 162
+
+const int MD2_MAX_TRIANGLES       = 4096;
+const int MD2_MAX_VERTS           = 2048;
+const int MD2_MAX_FRAMES          = 512;
+const int MD2_MAX_MD2SKINS        = 32;
+const int MD2_MAX_SKINNAME        = 64;
 
 typedef struct index_LUT_s
 {
index f014c4370857e002604e2f1b47fbf681558c5f1c..d31806b7e85fb6c67e09af1c11feeb75b0db2bba 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PM_MD3_C
-
-
-
 /* dependencies */
 #include "picointernal.h"
 
 
 
 /* md3 model format */
-#define MD3_MAGIC           "IDP3"
-#define MD3_VERSION         15
+const char *MD3_MAGIC = "IDP3";
+const int MD3_VERSION = 15;
 
 /* md3 vertex scale */
-#define MD3_SCALE         ( 1.0f / 64.0f )
+const float MD3_SCALE = ( 1.0f / 64.0f );
 
 /* md3 model frame information */
 typedef struct md3Frame_s
index 7e898ff1e3887f2c6d980831959c1d3c313268e1..235dcecf9467c0ca90d1508e0fef403e1adf285e 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PM_MDC_C
-
-
-
 /* dependencies */
 #include "picointernal.h"
 
 /* mdc model format */
-#define MDC_MAGIC           "IDPC"
-#define MDC_VERSION         2
+const char *MDC_MAGIC = "IDPC";
+const int MDC_VERSION = 2;
 
 /* mdc vertex scale */
-#define MDC_SCALE           ( 1.0f / 64.0f )
-#define MDC_MAX_OFS         127.0f
-#define MDC_DIST_SCALE      0.05f
+const float MDC_SCALE           = ( 1.0f / 64.0f );
+const float MDC_MAX_OFS         = 127.0f;
+const float MDC_DIST_SCALE      = 0.05f;
 
 /* mdc decoding normal table */
 double mdcNormals[ 256 ][ 3 ] =
index 535b7e22ceba57adac95157e8c6d9ff82a422825..c0c3987f52b18a47ba9ef9401680feec9e9b9e0d 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PM_MS3D_C
-
 /* dependencies */
 #include "picointernal.h"
 
 static picoColor_t white = { 255,255,255,255 };
 
 /* ms3d limits */
-#define MS3D_MAX_VERTS      8192
-#define MS3D_MAX_TRIS       16384
-#define MS3D_MAX_GROUPS     128
-#define MS3D_MAX_MATERIALS  128
-#define MS3D_MAX_JOINTS     128
-#define MS3D_MAX_KEYFRAMES  216
+const int MS3D_MAX_VERTS      = 8192;
+const int MS3D_MAX_TRIS       = 16384;
+const int MS3D_MAX_GROUPS     = 128;
+const int MS3D_MAX_MATERIALS  = 128;
+const int MS3D_MAX_JOINTS     = 128;
+const int MS3D_MAX_KEYFRAMES  = 216;
 
 /* ms3d flags */
-#define MS3D_SELECTED       1
-#define MS3D_HIDDEN         2
-#define MS3D_SELECTED2      4
-#define MS3D_DIRTY          8
+const int MS3D_SELECTED       = 1;
+const int MS3D_HIDDEN         = 2;
+const int MS3D_SELECTED2      = 4;
+const int MS3D_DIRTY          = 8;
 
 /* this freaky loader needs byte alignment */
 #pragma pack(push, 1)
index 49d0fe84ed264e253f01b41abfcc961163c3fc22..a97cf5264e4c298d4987f844044ea32ee57be20c 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PM_OBJ_C
-
 /* dependencies */
 #include "picointernal.h"
 
@@ -135,7 +130,7 @@ static int _obj_canload( PM_PARAMS_CANLOAD ){
  *   allocates - and reallocates as soon as required -
  *   my vertex data array in even steps.
  */
-#define SIZE_OBJ_STEP  4096
+const int SIZE_OBJ_STEP = 4096;
 
 static TObjVertexData *SizeObjVertexData(
        TObjVertexData *vertexData, int reqEntries,
index 93b79840f7b0722ae17705e74871b92b0baf86d9..ef0371e3f2506aff12f4c0e9a4804bccab02fff6 100644 (file)
 
    ----------------------------------------------------------------------------- */
 
-
-
-/* marker */
-#define PM_TERRAIN_C
-
-
-
 /* dependencies */
 #include "picointernal.h"
 
index 528b1f773c70602002a04e123850828258beb0b4..b856d59e3116902c10dbe8a6fc4a1ab793244c0a 100644 (file)
@@ -45,7 +45,7 @@ typedef struct {
        char parseFile[MAX_QPATH];
 } parseInfo_t;
 
-#define MAX_PARSE_INFO  16
+const int MAX_PARSE_INFO = 16;
 static parseInfo_t parseInfo[MAX_PARSE_INFO];
 static int parseInfoNum;
 static parseInfo_t  *pi = &parseInfo[0];
index 901b4f2c819f6d9373f57de94fe18e5f728e3b50..e35d82b7e8b80d3b1ad4665203a93999a7645497 100644 (file)
@@ -43,7 +43,7 @@ float Q_fabs( float f ) {
 //             Certainly better ways to do this, but this lets
 //             me get underway quickly with ents that need spline
 //             targets.
-#define MAX_CAMERAS 64
+const int MAX_CAMERAS = 64;
 
 idCameraDef camera[MAX_CAMERAS];
 
@@ -638,8 +638,8 @@ bool idCameraDef::waitEvent( int index ) {
 }
 
 
-#define NUM_CCELERATION_SEGS 10
-#define CELL_AMT 5
+const int NUM_CCELERATION_SEGS = 10;
+const int CELL_AMT = 5;
 
 void idCameraDef::buildCamera() {
        int i;
index d36bd57a7727fd69489ecdb50b3ccfaf40b9ac5a..91fdf18e39cc54641170c71d9e8b7090b90555ef 100644 (file)
@@ -66,7 +66,7 @@ typedef struct {
 
 typedef my_source_mgr * my_src_ptr;
 
-#define INPUT_BUF_SIZE  4096    /* choose an efficiently fread'able size */
+const int INPUT_BUF_SIZE = 4096;    /* choose an efficiently fread'able size */
 
 
 /*
index 480ca9e8c65e15a4ce870670dae576b78eb686dc..696ede55dfcaba4b9d5a27cdf6795adfe91f6acf 100644 (file)
 #include "imagelib.h"
 
 
-#define KTX_TYPE_UNSIGNED_BYTE                         0x1401
-#define KTX_TYPE_UNSIGNED_SHORT_4_4_4_4                0x8033
-#define KTX_TYPE_UNSIGNED_SHORT_5_5_5_1                0x8034
-#define KTX_TYPE_UNSIGNED_SHORT_5_6_5          0x8363
-
-#define KTX_FORMAT_ALPHA                                       0x1906
-#define KTX_FORMAT_RGB                                         0x1907
-#define KTX_FORMAT_RGBA                                                0x1908
-#define KTX_FORMAT_LUMINANCE                           0x1909
-#define KTX_FORMAT_LUMINANCE_ALPHA                     0x190A
-#define KTX_FORMAT_BGR                                         0x80E0
-#define KTX_FORMAT_BGRA                                                0x80E1
-
-#define KTX_FORMAT_ETC1_RGB8                           0x8D64
+const int KTX_TYPE_UNSIGNED_BYTE                       = 0x1401;
+const int KTX_TYPE_UNSIGNED_SHORT_4_4_4_4      = 0x8033;
+const int KTX_TYPE_UNSIGNED_SHORT_5_5_5_1      = 0x8034;
+const int KTX_TYPE_UNSIGNED_SHORT_5_6_5                = 0x8363;
+
+const int KTX_FORMAT_ALPHA                                     = 0x1906;
+const int KTX_FORMAT_RGB                                       = 0x1907;
+const int KTX_FORMAT_RGBA                                      = 0x1908;
+const int KTX_FORMAT_LUMINANCE                         = 0x1909;
+const int KTX_FORMAT_LUMINANCE_ALPHA           = 0x190A;
+const int KTX_FORMAT_BGR                                       = 0x80E0;
+const int KTX_FORMAT_BGRA                                      = 0x80E1;
+
+const int KTX_FORMAT_ETC1_RGB8                         = 0x8D64;
 
 class KTX_Decoder
 {
index 6e469562789fb33d62512d417b957431259c6494..195d952832793552ea8afc27c37e04aba792daf5 100644 (file)
@@ -91,7 +91,7 @@ typedef struct {
    } dpalette_t;
  */
 
-#define IDSPRITEHEADER  ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'D' << 8 ) + 'I' )
+const int IDSPRITEHEADER = ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'D' << 8 ) + 'I' );
 // little-endian "IDSP"
 
 /*
index 6160887b7dc27546ee3ca37fa500891aa9f07f1d..5994e5088c6663334c78680ffb8e4fef431676d8 100644 (file)
@@ -28,8 +28,8 @@
 #include "bytestreamutils.h"
 #include "imagelib.h"
 
-#define QUAKE2_WAL   0
-#define HERETIC2_M8  1
+const int QUAKE2_WAL   = 0;
+const int HERETIC2_M8  = 1;
 
 typedef unsigned char byte;
 
index d7c4bf4b582fe50bc97e9d3f11729c233bf92f92..7dca789795977012a29d2c535cdf7439db0867f3 100644 (file)
@@ -75,27 +75,27 @@ void istream_read_iqmPos(PointerInputStream& inputStream, iqmPos_t& iqmPos)
   iqmPos.v[2] = istream_read_float32_le(inputStream);
 }
 
-#define IQM_POSITION       0
-#define IQM_TEXCOORD        1
-#define IQM_NORMAL          2
-#define IQM_TANGENT         3
-#define IQM_BLENDINDEXES    4
-#define IQM_BLENDWEIGHTS    5
-#define IQM_COLOR              6
-#define IQM_CUSTOM          0x10
-
-#define IQM_BYTE    0
-#define IQM_UBYTE   1
-#define IQM_SHORT   2
-#define IQM_USHORT  3
-#define IQM_INT            4
-#define IQM_UINT    5
-#define IQM_HALF    6
-#define IQM_FLOAT   7
-#define IQM_DOUBLE  8
+const int IQM_POSITION     = 0;
+const int IQM_TEXCOORD        = 1;
+const int IQM_NORMAL          = 2;
+const int IQM_TANGENT         = 3;
+const int IQM_BLENDINDEXES    = 4;
+const int IQM_BLENDWEIGHTS    = 5;
+const int IQM_COLOR            = 6;
+const int IQM_CUSTOM          = 0x10;
+
+const int IQM_BYTE    = 0;
+const int IQM_UBYTE   = 1;
+const int IQM_SHORT   = 2;
+const int IQM_USHORT  = 3;
+const int IQM_INT          = 4;
+const int IQM_UINT    = 5;
+const int IQM_HALF    = 6;
+const int IQM_FLOAT   = 7;
+const int IQM_DOUBLE  = 8;
 
 // animflags
-#define IQM_LOOP 1
+const int IQM_LOOP = 1;
 
 typedef struct iqmHeader_s
 {
index 766a7ebaa6da23265253118145aa7636ca036ad5..e07312818dccc2479cda674fad44b78f171a777b 100644 (file)
@@ -426,7 +426,7 @@ MapQ2Module g_MapQ2Module;
 
 
 
-#define PARSE_ERROR "error parsing VMF"
+const char *PARSE_ERROR = "error parsing VMF";
 
 inline void parseToken( Tokeniser& tokeniser, const char* token ){
        ASSERT_MESSAGE( Tokeniser_parseToken( tokeniser, token ), "error parsing vmf: token not found: " << makeQuoted( token ) );
index 044adb66ead780b0ea7a3d6e921c969cbf7dabf2..ab2eb1bf7c21ec3c263ca13be9b7f3c3c638845f 100644 (file)
@@ -39,7 +39,7 @@
 #include "generic/object.h"
 
 
-#define PARSE_ERROR "XML PARSE ERROR"
+const char *PARSE_ERROR = "XML PARSE ERROR";
 
 
 inline XMLImporter* Node_getXMLImporter( scene::Node& node ){
index 56a18ddc254e5e435221805a89adfd1563882c9b..e18ef2f6ca68016edf5dccd31f2fda6eb57caaef 100644 (file)
@@ -40,17 +40,16 @@ typedef unsigned char byte;
 
    ========================================================================
  */
-#define MD2_NUMVERTEXNORMALS 162
-#define MD2_MAX_SKINNAME    64
+const int MD2_NUMVERTEXNORMALS = 162;
 
 const unsigned char MD2_IDENT[4] = { 'I', 'D', 'P', '2', };
-#define MD2_VERSION 8
+const int MD2_VERSION = 8;
 
-#define MD2_MAX_TRIANGLES   4096
-#define MD2_MAX_VERTS       2048
-#define MD2_MAX_FRAMES      512
-#define MD2_MAX_MD2SKINS    32
-#define MD2_MAX_SKINNAME    64
+const int MD2_MAX_TRIANGLES   = 4096;
+const int MD2_MAX_VERTS       = 2048;
+const int MD2_MAX_FRAMES      = 512;
+const int MD2_MAX_MD2SKINS    = 32;
+const int MD2_MAX_SKINNAME    = 64;
 
 typedef struct
 {
@@ -89,11 +88,11 @@ void istream_read_md2XyzNormal( PointerInputStream& inputStream, md2XyzNormal_t&
        inputStream.read( &xyz.lightnormalindex, 1 );
 }
 
-#define MD2_XYZNORMAL_V0   0
-#define MD2_XYZNORMAL_V1   1
-#define MD2_XYZNORMAL_V2   2
-#define MD2_XYZNORMAL_LNI  3
-#define MD2_XYZNORMAL_SIZE 4
+const int MD2_XYZNORMAL_V0   = 0;
+const int MD2_XYZNORMAL_V1   = 1;
+const int MD2_XYZNORMAL_V2   = 2;
+const int MD2_XYZNORMAL_LNI  = 3;
+const int MD2_XYZNORMAL_SIZE = 4;
 
 typedef struct
 {
index e3db3ae7575ee58b96ec555a170b03fe60cc6143..0b459827144b16da77cb380eba25c97a43426d71 100644 (file)
@@ -32,7 +32,7 @@
 #include "md3normals.h"
 
 // the maximum size of game reletive pathnames
-#define MAX_QPATH       64
+const int MAX_QPATH = 64;
 
 /*
    ========================================================================
  */
 
 const unsigned char MD3_IDENT[4] = { 'I', 'D', 'P', '3', };
-#define MD3_VERSION         15
+const int MD3_VERSION = 15;
 
 // limits
-#define MD3_MAX_LODS        4
-#define MD3_MAX_TRIANGLES   8192    // per surface
-#define MD3_MAX_VERTS       4096    // per surface
-#define MD3_MAX_SHADERS     256     // per surface
-#define MD3_MAX_FRAMES      1024    // per model
-#define MD3_MAX_SURFACES    32      // per model
-#define MD3_MAX_TAGS        16      // per frame
+const int MD3_MAX_LODS        = 4;
+const int MD3_MAX_TRIANGLES   = 8192;    // per surface
+const int MD3_MAX_VERTS       = 4096;    // per surface
+const int MD3_MAX_SHADERS     = 256;     // per surface
+const int MD3_MAX_FRAMES      = 1024;    // per model
+const int MD3_MAX_SURFACES    = 32;      // per model
+const int MD3_MAX_TAGS        = 16;      // per frame
 
 // vertex scales
-#define MD3_XYZ_SCALE       ( 1.f / 64 )
+const float MD3_XYZ_SCALE = ( 1.f / 64 );
 
 typedef float float3[3];
 
index 2f39483902f31af86508e3ac78735f780442d348..db333189d32da66c07d859ef0a01932d4ec0920e 100644 (file)
@@ -34,7 +34,7 @@
 
 const unsigned char MDC_IDENT[4] = { 'I', 'D', 'P', 'C', };
 const float MDC_XYZ_SCALE = 0.015625f;
-#define MAX_QPATH           64      // max length of a quake game pathname
+const int MAX_QPATH = 64;      // max length of a quake game pathname
 
 typedef float float3[3];
 
index b98a19ce352281d4d071b9c37c5173754351be94..8776ad3b02147a21c5cd27058b13001e2d331a16 100644 (file)
@@ -62,7 +62,7 @@ ArchiveModules& FileSystemQ3API_getArchiveModules();
 #include "dpkdeps.h"
 
 
-#define VFS_MAXDIRS 64
+const int VFS_MAXDIRS = 64;
 
 #if defined( WIN32 )
 #define PATH_MAX 260
@@ -666,8 +666,8 @@ void Shutdown(){
        g_loaded_dpk_paks.clear();
 }
 
-#define VFS_SEARCH_PAK 0x1
-#define VFS_SEARCH_DIR 0x2
+const int VFS_SEARCH_PAK = 0x1;
+const int VFS_SEARCH_DIR = 0x2;
 
 int GetFileCount( const char *filename, int flag ){
        int count = 0;
index b5a57f5eb1d8ca2bfa423960effd41fde66ae923..941ea33a3bdb720263b64c516e6121d953a643b2 100644 (file)
@@ -296,7 +296,7 @@ void popElement( const char* name ){
 };
 
 typedef std::pair<CopiedString, Build> BuildPair;
-#define SEPARATOR_STRING "-"
+const char *SEPARATOR_STRING = "-";
 static bool is_separator( const BuildPair &p ){
        if ( !string_equal( p.first.c_str(), SEPARATOR_STRING ) ) {
                return false;
index 005ab9b8893ce4607cceba0682a3df9de344b067..d4dcd43b32168213236b32ef3f7432a725bb7136 100644 (file)
@@ -527,11 +527,11 @@ typedef ReferenceCaller<camera_t, &Camera_MoveDown_KeyDown> FreeMoveCameraMoveDo
 typedef ReferenceCaller<camera_t, &Camera_MoveDown_KeyUp> FreeMoveCameraMoveDownKeyUpCaller;
 
 
-#define SPEED_MOVE 32
-#define SPEED_TURN 22.5
-#define MIN_CAM_SPEED 10
-#define MAX_CAM_SPEED 610
-#define CAM_SPEED_STEP 50
+const float SPEED_MOVE = 32;
+const float SPEED_TURN = 22.5;
+const float MIN_CAM_SPEED = 10;
+const float MAX_CAM_SPEED = 610;
+const float CAM_SPEED_STEP = 50;
 
 void Camera_MoveForward_Discrete( camera_t& camera ){
        Camera_Move_updateAxes( camera );
index ef1e6dcedc1958f0077379204c9f22aec4b3b8d5..b92afbfc6f1980a9676bfcf37edd338a5e517e71 100644 (file)
@@ -92,7 +92,7 @@ inline bool EntityClassFGD_parseToken( Tokeniser& tokeniser, const char* token )
        return string_equal( tokeniser.getToken(), token );
 }
 
-#define PARSE_ERROR "error parsing entity class definition"
+const char *PARSE_ERROR = "error parsing entity class definition";
 
 void EntityClassFGD_parseSplitString( Tokeniser& tokeniser, CopiedString& string ){
        StringOutputStream buffer( 256 );
index 3a01d142ef7297069db4e5870d595693672081ee..9aef5dcb1019b32abb8b6704fad49f0bcf6bf2e2 100644 (file)
@@ -34,7 +34,7 @@
 #include "map.h"
 #include "qe3.h"
 
-#define MRU_MAX 4
+const int MRU_MAX = 4;
 namespace {
 GtkMenuItem *MRU_items[MRU_MAX];
 std::size_t MRU_used;
index dca55b79b2176b13bf33f80df1151fda5e82dad3..0d80278d70f2ac62ec2a5c1e86b4d20a8359fa45 100644 (file)
@@ -1545,14 +1545,14 @@ void RenderablePatchSolid::RenderNormals() const {
        glEnd();
 }
 
-#define DEGEN_0a  0x01
-#define DEGEN_1a  0x02
-#define DEGEN_2a  0x04
-#define DEGEN_0b  0x08
-#define DEGEN_1b  0x10
-#define DEGEN_2b  0x20
-#define SPLIT     0x40
-#define AVERAGE   0x80
+const int DEGEN_0a  = 0x01;
+const int DEGEN_1a  = 0x02;
+const int DEGEN_2a  = 0x04;
+const int DEGEN_0b  = 0x08;
+const int DEGEN_1b  = 0x10;
+const int DEGEN_2b  = 0x20;
+const int SPLIT     = 0x40;
+const int AVERAGE   = 0x80;
 
 
 unsigned int subarray_get_degen( PatchControlIter subarray, std::size_t strideU, std::size_t strideV ){
index 6c5562388217c62177efaa2627a769b65ca03098..523408ebbe17de6a11b3b9479085097049c541a2 100644 (file)
@@ -509,7 +509,7 @@ static void OnButtonClean( ui::Widget widget, gpointer data ){
    ========
  */
 
-#define PREFS_LOCAL_FILENAME "local.pref"
+const char *PREFS_LOCAL_FILENAME = "local.pref";
 
 void PrefsDlg::Init(){
        // m_global_rc_path has been set above
index 4e93bce58493067ee0690e0eec2d340ee873ad9f..21d95c20f65c54de7daf8cbd1ded886eb2856890 100644 (file)
@@ -93,7 +93,7 @@ void foreachModule( const char* type, int version, const Visitor& visitor ){
 
 #include <windows.h>
 
-#define FORMAT_BUFSIZE 2048
+const int FORMAT_BUFSIZE = 2048;
 const char* FormatGetLastError(){
        static char buf[FORMAT_BUFSIZE];
        FormatMessage(
index 79a7de95326101db7f621cc350bba3b9c7244b92..d95663d130eef36c25af1df2ca03074ff23bcd7b 100644 (file)
@@ -5,7 +5,7 @@
 #include <winsock2.h>
 #elif defined ( POSIX )
 #include <sys/time.h>
-#define SOCKET_ERROR -1
+const int SOCKET_ERROR = -1;
 #else
 #error "unsupported platform"
 #endif
index 4824d23e645021fa064d6950c227bfc65b42f0e1..cddc0a5c00cc9e52ab8c00ed2cc5bc17252e962c 100644 (file)
@@ -546,14 +546,14 @@ void CWatchBSP::DoEBeginStep(){
 
 
 #if defined( WIN32 )
-#define ENGINE_ATTRIBUTE "engine_win32"
-#define MP_ENGINE_ATTRIBUTE "mp_engine_win32"
+const char *ENGINE_ATTRIBUTE = "engine_win32";
+const char *MP_ENGINE_ATTRIBUTE = "mp_engine_win32";
 #elif defined( __linux__ ) || defined ( __FreeBSD__ )
-#define ENGINE_ATTRIBUTE "engine_linux"
-#define MP_ENGINE_ATTRIBUTE "mp_engine_linux"
+const char *ENGINE_ATTRIBUTE = "engine_linux";
+const char *MP_ENGINE_ATTRIBUTE = "mp_engine_linux";
 #elif defined( __APPLE__ )
-#define ENGINE_ATTRIBUTE "engine_macos"
-#define MP_ENGINE_ATTRIBUTE "mp_engine_macos"
+const char *ENGINE_ATTRIBUTE = "engine_macos";
+const char *MP_ENGINE_ATTRIBUTE = "mp_engine_macos";
 #else
 #error "unsupported platform"
 #endif