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] ) {
globalErrorStream() << "bobToolz PathPlotter: Entity must have a targetname.\n";
}
return;
-}
\ No newline at end of file
+}
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
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
{
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
{
class DEntity;
// defines for polygon stuff
-#define MAX_POLYGON_FACES 128
+const int MAX_POLYGON_FACES = 128;
extern bool bFacesAll[];
#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;
// Implementation
//////////////////////////////////////////////////////////////////////
-#define BOGUS_RANGE 4096
+const int BOGUS_RANGE = 4096;
void DWinding::AllocWinding( int points ){
numpoints = points;
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_)
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;
//#include "interfaces/IScriptParser.h"
-#define SP_MAX_BREAKCHARS 16
+const int SP_MAX_BREAKCHARS = 16;
class CScriptParser //: public IScriptParser
{
}
-#define NUM_TOOLBARBUTTONS 14
+const int NUM_TOOLBARBUTTONS = 14;
std::size_t ToolbarButtonCount( void ) {
return NUM_TOOLBARBUTTONS;
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;
/*
================
#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;
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;
#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
Purge();
- globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n";
+ globalOutputStream() << MSG_PREFIX << "Loading portal file " << fn << ".\n";
FILE *in;
#include "../StdAfx.h"
#include "AboutDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CAboutDialog dialog
#include "../bobtoolz.h"
#include "AutoCaulkDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CAutoCaulkDialog dialog
#include "../bobtoolz.h"
#include "AutoCaulkStartDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CAutoCaulkStartDialog dialog
// 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
#include "../StdAfx.h"
#include "DoorDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CDoorDialog dialog
#include "../StdAfx.h"
#include "IntersectDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CIntersectDialog dialog
// 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
#include "../bobtoolz.h"
#include "IntersectInfoDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CIntersectInfoDialog dialog
#include "PolygonDialog.h"
#include "../shapes.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CPolygonDialog dialog
#include "../StdAfx.h"
#include "StairDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CStairDialog dialog
#include "../bobtoolz.h"
#include "TextureResetDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CTextureResetDialog dialog
#include "../bobtoolz.h"
#include "BrushCheckDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CBrushCheckDialog dialog
#include "../bobtoolz.h"
#include "PathPlotterDialog.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
/////////////////////////////////////////////////////////////////////////////
// CPathPlotterDialog dialog
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();
#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 );
#include "../../radiant/brush.h"
// for limNames
-#define MAX_MATERIAL_NAME 20
+const int MAX_MATERIAL_NAME = 20;
/*
Abstract baseclass for modelexporters
#include "prtview.h"
-#define LINE_BUF 1000
+const int LINE_BUF = 1000;
CPortals portals;
CPortalsRender render;
};
#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 ) ) )
/////////////////////////////////////////////////////////////////////////////
// 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(){
}
-#define CONFIG_SECTION "Configuration"
+const char *CONFIG_SECTION = "Configuration";
int INIGetInt( const char *key, int def ){
char value[1024];
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
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
/* =============================== */
-#define NUM_TOOLBARBUTTONS 12
+const int NUM_TOOLBARBUTTONS = 12;
/**
* @brief
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define DDSLIB_C
-
-
-
/* dependencies */
#include "ddslib.h"
#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;
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
// Changes Globals: -
//===========================================================================
void Net_FreeSocket( socket_t *sock ){
- FreeMemory( sock );
+ free( sock );
} //end of the function Net_FreeSocket
//===========================================================================
//
extern "C" {
#endif
-#ifndef __BYTEBOOL__
-#define __BYTEBOOL__
-typedef enum { qfalse, qtrue } qboolean;
-typedef unsigned char byte;
-#endif
+#include "bytebool.h"
typedef struct address_s
{
#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
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;
#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;
// Notes:
//===========================================================================
+#include "bytebool.h"
+
int WINS_Init( void );
void WINS_Shutdown( void );
char *WINS_MyAddress( void );
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;
}
#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;
}
// 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;
// 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];
read requests until flen is reset.
====================================================================== */
-#define FLEN_ERROR INT_MIN
+const int FLEN_ERROR = INT_MIN;
static int flen;
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PICOINTERNAL_C
-
-
-
/* todo:
* - fix p->curLine for parser routines. increased twice
*/
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PICOMODEL_C
-
-
-
/* dependencies */
#include "picointernal.h"
/* 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;
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PICOMODULES_C
-
-
-
/* dependencies */
#include "picointernal.h"
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PM_3DS_C
-
/* dependencies */
#include "picointernal.h"
----------------------------------------------------------------------------- */
-
-/* marker */
-#define PM_ASE_C
-
/* uncomment when debugging this module */
//#define DEBUG_PM_ASE
//#define DEBUG_PM_ASE_EX
Nurail: Used pm_md3.c (Randy Reddig) as a template.
*/
-/* marker */
-#define PM_FM_C
-
/* dependencies */
#include "pm_fm.h"
----------------------------------------------------------------------------- */
-/* marker */
-#define PM_LWO_C
-
/* dependencies */
#include "picointernal.h"
#include "lwo/lwo2.h"
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
{
----------------------------------------------------------------------------- */
-
-
-/* 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
----------------------------------------------------------------------------- */
-
-
-/* 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 ] =
----------------------------------------------------------------------------- */
-
-
-/* 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)
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PM_OBJ_C
-
/* dependencies */
#include "picointernal.h"
* 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,
----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PM_TERRAIN_C
-
-
-
/* dependencies */
#include "picointernal.h"
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];
// 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];
}
-#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;
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 */
/*
#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
{
} dpalette_t;
*/
-#define IDSPRITEHEADER ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'D' << 8 ) + 'I' )
+const int IDSPRITEHEADER = ( ( 'P' << 24 ) + ( 'S' << 16 ) + ( 'D' << 8 ) + 'I' );
// little-endian "IDSP"
/*
#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;
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
{
-#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 ) );
#include "generic/object.h"
-#define PARSE_ERROR "XML PARSE ERROR"
+const char *PARSE_ERROR = "XML PARSE ERROR";
inline XMLImporter* Node_getXMLImporter( scene::Node& node ){
========================================================================
*/
-#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
{
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
{
#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];
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];
#include "dpkdeps.h"
-#define VFS_MAXDIRS 64
+const int VFS_MAXDIRS = 64;
#if defined( WIN32 )
#define PATH_MAX 260
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;
};
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;
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 );
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 );
#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;
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 ){
========
*/
-#define PREFS_LOCAL_FILENAME "local.pref"
+const char *PREFS_LOCAL_FILENAME = "local.pref";
void PrefsDlg::Init(){
// m_global_rc_path has been set above
#include <windows.h>
-#define FORMAT_BUFSIZE 2048
+const int FORMAT_BUFSIZE = 2048;
const char* FormatGetLastError(){
static char buf[FORMAT_BUFSIZE];
FormatMessage(
#include <winsock2.h>
#elif defined ( POSIX )
#include <sys/time.h>
-#define SOCKET_ERROR -1
+const int SOCKET_ERROR = -1;
#else
#error "unsupported platform"
#endif
#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