typedef enum biherror_e
{
BIHERROR_OK, // no error, be happy
- BIHERROR_OUT_OF_NODES, // could not produce complete hierarchy, maxnodes too low (should be roughly half of numleafs)
+ BIHERROR_OUT_OF_NODES // could not produce complete hierarchy, maxnodes too low (should be roughly half of numleafs)
}
biherror_t;
{
BIH_SPLITX = 0,
BIH_SPLITY = 1,
- BIH_SPLITZ = 2,
+ BIH_SPLITZ = 2
}
bih_nodetype_t;
{
BIH_BRUSH = 3,
BIH_COLLISIONTRIANGLE = 4,
- BIH_RENDERTRIANGLE = 5,
+ BIH_RENDERTRIANGLE = 5
}
bih_leaftype_t;
OC_PF_420, /**< Chroma subsampling by 2 in each direction (4:2:0) */
OC_PF_RSVD, /**< Reserved value */
OC_PF_422, /**< Horizonatal chroma subsampling by 2 (4:2:2) */
- OC_PF_444, /**< No chroma subsampling at all (4:4:4) */
+ OC_PF_444 /**< No chroma subsampling at all (4:4:4) */
} theora_pixelformat;
/**
* Theora bitstream info.
#include "libcurl.h"
#include "utf8lib.h"
-char *svc_strings[128] =
+const char *svc_strings[128] =
{
"svc_bad",
"svc_nop",
"svc_pointparticles1", // 62 // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
};
-char *qw_svc_strings[128] =
+const char *qw_svc_strings[128] =
{
"qw_svc_bad", // 0
"qw_svc_nop", // 1
int i;
protocolversion_t protocol;
unsigned char cmdlog[32];
- char *cmdlogname[32], *temp;
+ const char *cmdlogname[32], *temp;
int cmdindex, cmdcount = 0;
qboolean qwplayerupdatereceived;
qboolean strip_pqc;
double r_timereport_temp = 0, r_timereport_current = 0, r_timereport_start = 0;
int r_speeds_longestitem = 0;
-void R_TimeReport(char *desc)
+void R_TimeReport(const char *desc)
{
char tempbuf[256];
int length;
struct envmapinfo_s
{
float angles[3];
- char *name;
+ const char *name;
qboolean flipx, flipy, flipdiagonaly;
}
envmapinfo[12] =
static qboolean OpenStream( clvideo_t * video )
{
- char *errorstring;
+ const char *errorstring;
video->stream = dpvsimpledecode_open( video->filename, &errorstring);
if (!video->stream )
{
typedef enum capturevideoformat_e
{
CAPTUREVIDEOFORMAT_AVI_I420,
- CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA,
+ CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
}
capturevideoformat_t;
static char varval[MAX_INPUTLINE];
const char *varstr;
char *varfunc;
+static char asis[] = "asis"; // just to suppress const char warnings
if(varlen >= MAX_INPUTLINE)
varlen = MAX_INPUTLINE - 1;
varstr = Cmd_GetDirectCvarValue(varname, alias, &is_multiple);
if(is_multiple)
if(!varfunc)
- varfunc = "asis";
+ varfunc = asis;
}
if(!varstr)
// attention, it has been eradicated from here, its only (former) use in
// all of darkplaces.
-static char *hexchar = "0123456789ABCDEF";
+static const char *hexchar = "0123456789ABCDEF";
void Com_HexDumpToConsole(const unsigned char *data, int size)
{
int i, j, n;
size_t keylength;
if (!key)
key = "";
- if (!value)
- value = "";
keylength = strlen(key);
if (valuelength < 1 || !value)
{
PROTOCOL_QUAKEWORLD, ///< quakeworld protocol
PROTOCOL_NEHAHRABJP, ///< same as QUAKEDP but with 16bit modelindex
PROTOCOL_NEHAHRABJP2, ///< same as NEHAHRABJP but with 16bit soundindex
- PROTOCOL_NEHAHRABJP3, ///< same as NEHAHRABJP2 but with some changes
+ PROTOCOL_NEHAHRABJP3 ///< same as NEHAHRABJP2 but with some changes
}
protocolversion_t;
}
//[515]: these are required funcs
-static char *cl_required_func[] =
+static const char *cl_required_func[] =
{
"CSQC_Init",
"CSQC_InputEvent",
#include "quakedef.h"
-char *cvar_dummy_description = "custom cvar";
+const char *cvar_dummy_description = "custom cvar";
cvar_t *cvar_vars = NULL;
cvar_t *cvar_hashtable[CVAR_HASHSIZE];
-char *cvar_null_string = "";
+const char *cvar_null_string = "";
/*
============
valuelen = strlen(value);
if (!var->string || strlen(var->string) != valuelen)
{
- Z_Free (var->string); // free the old value string
+ Z_Free ((char *)var->string); // free the old value string
var->string = (char *)Z_Malloc (valuelen + 1);
}
- memcpy (var->string, value, valuelen + 1);
+ memcpy ((char *)var->string, value, valuelen + 1);
var->value = atof (var->string);
var->integer = (int) var->value;
if ((var->flags & CVAR_NOTIFY) && changed && sv.active)
// get rid of old allocated cvar
// (but not cvar->string and cvar->defstring, because we kept those)
- Z_Free(cvar->name);
+ Z_Free((char *)cvar->name);
Z_Free(cvar);
}
else
}
// copy the value off, because future sets will Z_Free it
- oldstr = variable->string;
+ oldstr = (char *)variable->string;
alloclen = strlen(variable->string) + 1;
variable->string = (char *)Z_Malloc (alloclen);
- memcpy (variable->string, oldstr, alloclen);
+ memcpy ((char *)variable->string, oldstr, alloclen);
variable->defstring = (char *)Z_Malloc (alloclen);
- memcpy (variable->defstring, oldstr, alloclen);
+ memcpy ((char *)variable->defstring, oldstr, alloclen);
variable->value = atof (variable->string);
variable->integer = (int) variable->value;
if(newdescription && (cvar->flags & CVAR_ALLOCATED))
{
if(cvar->description != cvar_dummy_description)
- Z_Free(cvar->description);
+ Z_Free((char *)cvar->description);
if(*newdescription)
{
alloclen = strlen(newdescription) + 1;
cvar->description = (char *)Z_Malloc(alloclen);
- memcpy(cvar->description, newdescription, alloclen);
+ memcpy((char *)cvar->description, newdescription, alloclen);
}
else
cvar->description = cvar_dummy_description;
cvar->flags = flags | CVAR_ALLOCATED;
alloclen = strlen(name) + 1;
cvar->name = (char *)Z_Malloc(alloclen);
- memcpy(cvar->name, name, alloclen);
+ memcpy((char *)cvar->name, name, alloclen);
alloclen = strlen(value) + 1;
cvar->string = (char *)Z_Malloc(alloclen);
- memcpy(cvar->string, value, alloclen);
+ memcpy((char *)cvar->string, value, alloclen);
cvar->defstring = (char *)Z_Malloc(alloclen);
- memcpy(cvar->defstring, value, alloclen);
+ memcpy((char *)cvar->defstring, value, alloclen);
cvar->value = atof (cvar->string);
cvar->integer = (int) cvar->value;
{
alloclen = strlen(newdescription) + 1;
cvar->description = (char *)Z_Malloc(alloclen);
- memcpy(cvar->description, newdescription, alloclen);
+ memcpy((char *)cvar->description, newdescription, alloclen);
}
else
cvar->description = cvar_dummy_description; // actually checked by VM_cvar_type
//Con_Printf("locking cvar %s (%s -> %s)\n", var->name, var->string, var->defstring);
var->flags |= CVAR_DEFAULTSET;
- Z_Free(var->defstring);
+ Z_Free((char *)var->defstring);
alloclen = strlen(var->string) + 1;
var->defstring = (char *)Z_Malloc(alloclen);
- memcpy(var->defstring, var->string, alloclen);
+ memcpy((char *)var->defstring, var->string, alloclen);
}
}
}
*link = cvar->nextonhashchain;
if(cvar->description != cvar_dummy_description)
- Z_Free(cvar->description);
+ Z_Free((char *)cvar->description);
- Z_Free(cvar->name);
- Z_Free(cvar->string);
- Z_Free(cvar->defstring);
+ Z_Free((char *)cvar->name);
+ Z_Free((char *)cvar->string);
+ Z_Free((char *)cvar->defstring);
Z_Free(cvar);
}
}
{
int flags;
- char *name;
+ const char *name;
- char *string;
- char *description;
+ const char *string;
+ const char *description;
int integer;
float value;
float vector[3];
- char *defstring;
+ const char *defstring;
unsigned int globaldefindex_progid[3];
int globaldefindex[3];
/// or merely sets its value if it already exists.
cvar_t *Cvar_Get (const char *name, const char *value, int flags, const char *newdescription);
-extern char *cvar_dummy_description; // ALWAYS the same pointer
+extern const char *cvar_dummy_description; // ALWAYS the same pointer
extern cvar_t *cvar_vars; // used to list all cvars
void Cvar_UpdateAllAutoCvars(void); // updates ALL autocvars of the active prog to the cvar values (savegame loading)
// opening and closing streams
// opens a stream
-void *dpvsimpledecode_open(char *filename, char **errorstring)
+void *dpvsimpledecode_open(char *filename, const char **errorstring)
{
dpvsimpledecodestream_t *s;
char t[8], *wavename;
// number to DPVSIMPLEDECODEERROR_NONE
// if the supplied string pointer variable is not NULL, it will be set to the
// error message
-int dpvsimpledecode_error(void *stream, char **errorstring)
+int dpvsimpledecode_error(void *stream, const char **errorstring)
{
dpvsimpledecodestream_t *s = (dpvsimpledecodestream_t *)stream;
int e;
// opening and closing streams
// opens a stream
-void *dpvsimpledecode_open(char *filename, char **errorstring);
+void *dpvsimpledecode_open(char *filename, const char **errorstring);
// closes a stream
void dpvsimpledecode_close(void *stream);
// number to DPVDECODEERROR_NONE
// if the supplied string pointer variable is not NULL, it will be set to the
// error message
-int dpvsimpledecode_error(void *stream, char **errorstring);
+int dpvsimpledecode_error(void *stream, const char **errorstring);
// returns the width of the image data
unsigned int dpvsimpledecode_getwidth(void *stream);
CACHEPICFLAG_NOTPERSISTENT = 1,
CACHEPICFLAG_QUIET = 2,
CACHEPICFLAG_NOCOMPRESSION = 4,
- CACHEPICFLAG_NOCLAMP = 8,
+ CACHEPICFLAG_NOCLAMP = 8
}
cachepicflags_t;
+#ifdef WIN32
+#include <windows.h>
+#else
+#include <dirent.h>
+#endif
+
#include "quakedef.h"
// LordHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such...
}
}
#ifdef WIN32
-#include <windows.h>
void listdirectory(stringlist_t *list, const char *basepath, const char *path)
{
int i;
*c += 'a' - 'A';
}
#else
-#include <dirent.h>
void listdirectory(stringlist_t *list, const char *basepath, const char *path)
{
char fullpath[MAX_OSPATH];
#ifdef DEBUGGL
int errornumber = 0;
-void GL_PrintError(int errornumber, char *filename, int linenumber)
+void GL_PrintError(int errornumber, const char *filename, int linenumber)
{
switch(errornumber)
{
typedef struct glmode_s
{
- char *name;
+ const char *name;
int minification, magnification;
}
glmode_t;
#ifdef SUPPORTD3D
typedef struct d3dmode_s
{
- char *name;
+ const char *name;
int m1, m2;
}
d3dmode_t;
Host_Error("R_UpdateTexture: no texture supplied");
if (!glt->texnum && !glt->d3dtexture)
{
- Con_Printf("R_UpdateTexture: texture %p \"%s\" in pool %p has not been uploaded yet", glt, glt->identifier, glt->pool);
+ Con_Printf("R_UpdateTexture: texture %p \"%s\" in pool %p has not been uploaded yet", (void *)glt, glt->identifier, (void *)glt->pool);
return;
}
// update part of the texture
#ifdef DEBUGGL
#define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = qglGetError();if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
extern int errornumber;
-void GL_PrintError(int errornumber, char *filename, int linenumber);
+void GL_PrintError(int errornumber, const char *filename, int linenumber);
#else
#define CHECKGLERROR
#endif
*/
void Host_Kick_f (void)
{
- char *who;
+ const char *who;
const char *message = NULL;
client_t *save;
int i;
// NOTE: this relies on jmp_buf being the first thing in the png structure
// created by libpng! (this is correct for libpng 1.2.x)
#ifdef __cplusplus
-#if defined(MACOSX) || defined(WIN32)
+#ifdef WIN64
+ if (setjmp((_JBTYPE *)png))
+#elif defined(MACOSX) || defined(WIN32)
if (setjmp((int *)png))
#else
if (setjmp((__jmp_buf_tag *)png))
// NOTE: this relies on jmp_buf being the first thing in the png structure
// created by libpng! (this is correct for libpng 1.2.x)
#ifdef __cplusplus
-#if defined(MACOSX) || defined(WIN32)
+#ifdef WIN64
+ if (setjmp((_JBTYPE *)png))
+#elif defined(MACOSX) || defined(WIN32)
if (setjmp((int *)png))
#else
if (setjmp((__jmp_buf_tag *)png))
{
if (lastfd < s->inetsocket)
lastfd = s->inetsocket;
+#ifdef WIN32
+ FD_SET((int)s->inetsocket, &fdreadset);
+#else
FD_SET((unsigned int)s->inetsocket, &fdreadset);
+#endif
}
}
tv.tv_sec = microseconds / 1000000;
LHNETADDRESSTYPE_NONE,
LHNETADDRESSTYPE_LOOP,
LHNETADDRESSTYPE_INET4,
- LHNETADDRESSTYPE_INET6,
+ LHNETADDRESSTYPE_INET6
}
lhnetaddresstype_t;
CINIT(LOW_SPEED_LIMIT, LONG , 19),
CINIT(LOW_SPEED_TIME, LONG, 20),
CINIT(PROTOCOLS, LONG, 181),
- CINIT(REDIR_PROTOCOLS, LONG, 182),
+ CINIT(REDIR_PROTOCOLS, LONG, 182)
}
CURLoption;
#define CURLPROTO_HTTP (1<<0)
CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
- CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
+ CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27
}
CURLINFO;
static qboolean m_entersound; ///< play after drawing a frame, so caching won't disrupt the sound
-void M_Update_Return_Reason(char *s)
+void M_Update_Return_Reason(const char *s)
{
strlcpy(m_return_reason, s, sizeof(m_return_reason));
if (s)
#define NumberOfNehahraDemos 34
typedef struct nehahrademonames_s
{
- char *name;
- char *desc;
+ const char *name;
+ const char *desc;
} nehahrademonames_t;
static nehahrademonames_t NehahraDemos[NumberOfNehahraDemos] =
static void M_Background(int width, int height)
{
- menu_width = bound(1, width, vid_conwidth.integer);
- menu_height = bound(1, height, vid_conheight.integer);
+ menu_width = bound(1.0f, (float)width, vid_conwidth.value);
+ menu_height = bound(1.0f, (float)height, vid_conheight.value);
menu_x = (vid_conwidth.integer - menu_width) * 0.5;
menu_y = (vid_conheight.integer - menu_height) * 0.5;
//DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
typedef struct ratetable_s
{
int rate;
- char *name;
+ const char *name;
}
ratetable_t;
//=============================================================================
/* KEYS MENU */
-static char *quakebindnames[][2] =
+static const char *quakebindnames[][2] =
{
{"+attack", "attack"},
{"impulse 10", "next weapon"},
{"+movedown", "swim down"}
};
-static char *transfusionbindnames[][2] =
+static const char *transfusionbindnames[][2] =
{
{"", "Movement"}, // Movement commands
{"+forward", "walk forward"},
{"impulse 79", "taunt 9"}
};
-static char *goodvsbad2bindnames[][2] =
+static const char *goodvsbad2bindnames[][2] =
{
{"impulse 69", "Power 1"},
{"impulse 70", "Power 2"},
};
static int numcommands;
-static char *(*bindnames)[2];
+static const char *(*bindnames)[2];
/*
typedef struct binditem_s
#define NUMKEYS 5
-static void M_UnbindCommand (char *command)
+static void M_UnbindCommand (const char *command)
{
int j;
- char *b;
+ const char *b;
for (j = 0; j < (int)sizeof (keybindings[0]) / (int)sizeof (keybindings[0][0]); j++)
{
//=============================================================================
/* QUIT MENU */
-static char *m_quit_message[9];
+static const char *m_quit_message[9];
static int m_quit_prevstate;
static qboolean wasInMenus;
-static int M_QuitMessage(char *line1, char *line2, char *line3, char *line4, char *line5, char *line6, char *line7, char *line8)
+static int M_QuitMessage(const char *line1, const char *line2, const char *line3, const char *line4, const char *line5, const char *line6, const char *line7, const char *line8)
{
m_quit_message[0] = line1;
m_quit_message[1] = line2;
{
cachepic_t *p;
int basex;
- char *startJoin;
- char *protocol;
+ const char *startJoin;
+ const char *protocol;
M_Background(320, 200);
typedef struct level_s
{
- char *name;
- char *description;
+ const char *name;
+ const char *description;
} level_t;
typedef struct episode_s
{
- char *description;
+ const char *description;
int firstLevel;
int levels;
} episode_t;
typedef struct gamelevels_s
{
- char *gamename;
+ const char *gamename;
level_t *levels;
episode_t *episodes;
int numepisodes;
M_Print(0, 72, " Teamplay");
if (gamemode == GAME_ROGUE)
{
- char *msg;
+ const char *msg;
switch((int)teamplay.integer)
{
}
else
{
- char *msg;
+ const char *msg;
switch (teamplay.integer)
{
//============================================================================
// Menu prog handling
-static char *m_required_func[] = {
+static const char *m_required_func[] = {
"m_init",
"m_keydown",
"m_draw",
extern enum m_state_e m_state;
extern char m_return_reason[32];
-void M_Update_Return_Reason(char *s);
+void M_Update_Return_Reason(const char *s);
/*
// hard-coded menus
// parse the OBJ text now
for(;;)
{
+ static char emptyarg[1] = "";
if (!*text)
break;
linenumber++;
line[linelen] = text[linelen];
line[linelen] = 0;
for (argc = 0;argc < 4;argc++)
- argv[argc] = "";
+ argv[argc] = emptyarg;
argc = 0;
s = line;
while (*s == ' ' || *s == '\t')
TEXTURELAYERTYPE_INVALID,
TEXTURELAYERTYPE_LITTEXTURE,
TEXTURELAYERTYPE_TEXTURE,
- TEXTURELAYERTYPE_FOG,
+ TEXTURELAYERTYPE_FOG
}
texturelayertype_t;
//============================================================================
// Menu
-char *vm_m_extensions =
+const char *vm_m_extensions =
"BX_WAL_SUPPORT "
"DP_CINEMATIC_DPV "
"DP_CSQC_BINDMAPS "
qboolean allowworldwrites;
// name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
- char *name; // [INIT]
+ const char *name; // [INIT]
// flag - used to store general flags like PRVM_GE_SELF, etc.
int flag;
- char *extensionstring; // [INIT]
+ const char *extensionstring; // [INIT]
qboolean loadintoworld; // [INIT]
extern const int vm_cl_numbuiltins;
extern const int vm_m_numbuiltins;
-extern char * vm_sv_extensions; // client also uses this
-extern char * vm_m_extensions;
+extern const char * vm_sv_extensions; // client also uses this
+extern const char * vm_m_extensions;
void VM_SV_Cmd_Init(void);
void VM_SV_Cmd_Reset(void);
void PRVM_ED_LoadFromFile (const char *data);
-unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, char *filename, int fileline);
+unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, const char *filename, int fileline);
#define PRVM_EDICT(n) (((unsigned)(n) < (unsigned int)prog->max_edicts) ? (unsigned int)(n) : PRVM_EDICT_NUM_ERROR((unsigned int)(n), __FILE__, __LINE__))
#define PRVM_EDICT_NUM(n) (prog->edicts + PRVM_EDICT(n))
*/
void PRVM_InitProg(int prognr);
// LoadProgs expects to be called right after InitProg
-void PRVM_LoadProgs (const char *filename, int numrequiredfunc, char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global);
+void PRVM_LoadProgs (const char *filename, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global);
void PRVM_ResetProg(void);
qboolean PRVM_ProgLoaded(int prognr);
static qboolean checkextension(const char *name)
{
int len;
- char *e, *start;
+ const char *e, *start;
len = (int)strlen(name);
for (e = prog->extensionstring;*e;e++)
PRVM_LoadProgs
===============
*/
-void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global)
+void PRVM_LoadProgs (const char * filename, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global)
{
int i;
dstatement_t *st;
}
// LordHavoc: turned PRVM_EDICT_NUM into a #define for speed reasons
-unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, char *filename, int fileline)
+unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, const char *filename, int fileline)
{
PRVM_ERROR ("PRVM_EDICT_NUM: %s: bad number %i (called at %s:%i)", PRVM_NAME, n, filename, fileline);
return 0;
#include "quakedef.h"
#include "progsvm.h"
-char *prvm_opnames[] =
+const char *prvm_opnames[] =
{
"^5DONE",
typedef struct rendermodule_s
{
int active; // set by start, cleared by shutdown
- char *name;
+ const char *name;
void(*start)(void);
void(*shutdown)(void);
void(*newmap)(void);
Cmd_AddCommand("r_restart", R_Modules_Restart, "restarts renderer");
}
-void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
+void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
{
int i;
for (i = 0;i < MAXRENDERMODULES;i++)
#define R_MODULES_H
void R_Modules_Init(void);
-void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void));
+void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void));
void R_Modules_Start(void);
void R_Modules_Shutdown(void);
void R_Modules_NewMap(void);
R_SHADOW_RENDERMODE_VISIBLELIGHTING,
R_SHADOW_RENDERMODE_SHADOWMAP2D,
R_SHADOW_RENDERMODE_SHADOWMAPRECTANGLE,
- R_SHADOW_RENDERMODE_SHADOWMAPCUBESIDE,
+ R_SHADOW_RENDERMODE_SHADOWMAPCUBESIDE
}
r_shadow_rendermode_t;
// 4x4 block compressed 15bit color plus 8bit alpha (8 bits per pixel)
TEXTYPE_DXT5,
// this represents the same format as the framebuffer, for fast copies
- TEXTYPE_COLORBUFFER,
+ TEXTYPE_COLORBUFFER
}
textype_t;
extern unsigned int r_numqueries;
extern unsigned int r_maxqueries;
-void R_TimeReport(char *name);
+void R_TimeReport(const char *name);
// r_stain
void R_Stain(const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2);
RSURFPASS_BASE,
RSURFPASS_BACKGROUND,
RSURFPASS_RTLIGHT,
- RSURFPASS_DEFERREDGEOMETRY,
+ RSURFPASS_DEFERREDGEOMETRY
}
rsurfacepass_t;
static int (*qov_clear) (OggVorbis_File *vf);
static vorbis_info* (*qov_info) (OggVorbis_File *vf,int link);
static vorbis_comment* (*qov_comment) (OggVorbis_File *vf,int link);
-static char * (*qvorbis_comment_query) (vorbis_comment *vc, char *tag, int count);
+static char * (*qvorbis_comment_query) (vorbis_comment *vc, const char *tag, int count);
static int (*qov_open_callbacks) (void *datasource, OggVorbis_File *vf,
char *initial, long ibytes,
ov_callbacks callbacks);
return val;
}
-static void FindNextChunk(char *name)
+static void FindNextChunk(const char *name)
{
while (1)
{
}
}
-static void FindChunk(char *name)
+static void FindChunk(const char *name)
{
last_chunk = iff_data;
FindNextChunk (name);
{
client_t *client;
int i;
- float spawn_parms[NUM_SPAWN_PARMS];
client = svs.clients + clientnum;
// set up the client_t
if (sv.loadgame)
- memcpy (spawn_parms, client->spawn_parms, sizeof(spawn_parms));
- memset (client, 0, sizeof(*client));
+ {
+ float backupparms[NUM_SPAWN_PARMS];
+ memcpy(backupparms, client->spawn_parms, sizeof(backupparms));
+ memset(client, 0, sizeof(*client));
+ memcpy(client->spawn_parms, backupparms, sizeof(backupparms));
+ }
+ else
+ memset(client, 0, sizeof(*client));
client->active = true;
client->netconnection = netconnection;
client->rate = 1000000000;
client->connecttime = realtime;
- if (sv.loadgame)
- memcpy (client->spawn_parms, spawn_parms, sizeof(spawn_parms));
- else
+ if (!sv.loadgame)
{
// call the progs to get default spawn parms for the new client
// set self to world to intentionally cause errors with broken SetNewParms code in some mods
-char *vm_sv_extensions =
+const char *vm_sv_extensions =
"BX_WAL_SUPPORT "
"DP_BUTTONCHAT "
"DP_BUTTONUSE "
-#include "quakedef.h"
#ifdef WIN32
#include <windows.h>
#include <signal.h>
+#include "quakedef.h"
// =======================================================================
// General routines
#ifdef WIN32
# ifdef _WIN64
-# define _WIN32_WINNT 0x0502
+# ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0502
+# endif
// for SetDllDirectory
# endif
# include <windows.h>
RENDERPATH_CGGL,
RENDERPATH_D3D9,
RENDERPATH_D3D10,
- RENDERPATH_D3D11,
+ RENDERPATH_D3D11
}
renderpath_t;
mainwindow = CreateWindowEx (ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL);
if (!mainwindow)
{
- Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), NULL, NULL, global_hInstance, NULL);
+ Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), (void *)NULL, (void *)NULL, (void *)global_hInstance, (void *)NULL);
VID_Shutdown();
return false;
}
if (!pixelformat)
{
VID_Shutdown();
- Con_Printf("ChoosePixelFormat(%p, %p) failed\n", baseDC, &pfd);
+ Con_Printf("ChoosePixelFormat(%p, %p) failed\n", (void *)baseDC, (void *)&pfd);
return false;
}
if (SetPixelFormat(baseDC, pixelformat, &pfd) == false)
{
VID_Shutdown();
- Con_Printf("SetPixelFormat(%p, %d, %p) failed\n", baseDC, pixelformat, &pfd);
+ Con_Printf("SetPixelFormat(%p, %d, %p) failed\n", (void *)baseDC, pixelformat, (void *)&pfd);
return false;
}
if (!qwglMakeCurrent(baseDC, baseRC))
{
VID_Shutdown();
- Con_Printf("wglMakeCurrent(%p, %p) failed\n", baseDC, baseRC);
+ Con_Printf("wglMakeCurrent(%p, %p) failed\n", (void *)baseDC, (void *)baseRC);
return false;
}
mainwindow = CreateWindowEx (ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL);
if (!mainwindow)
{
- Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), NULL, NULL, global_hInstance, NULL);
+ Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %p, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), (void *)NULL, (void *)NULL, global_hInstance, (void *)NULL);
VID_Shutdown();
return false;
}
Con_Printf("D3D9 adapter info:\n");
Con_Printf("Description: %s\n", d3d9adapteridentifier.Description);
- Con_Printf("DeviceId: %x\n", d3d9adapteridentifier.DeviceId);
- Con_Printf("DeviceName: %x\n", d3d9adapteridentifier.DeviceName);
+ Con_Printf("DeviceId: %x\n", (unsigned int)d3d9adapteridentifier.DeviceId);
+ Con_Printf("DeviceName: %p\n", d3d9adapteridentifier.DeviceName);
Con_Printf("Driver: %s\n", d3d9adapteridentifier.Driver);
- Con_Printf("DriverVersion: %x\n", d3d9adapteridentifier.DriverVersion);
+ Con_Printf("DriverVersion: %08x%08x\n", (unsigned int)d3d9adapteridentifier.DriverVersion.u.HighPart, (unsigned int)d3d9adapteridentifier.DriverVersion.u.LowPart);
Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
/* Look at the element to see what happened */
- switch (od.dwOfs)
+ if ((int)od.dwOfs == DIMOFS_X)
+ in_mouse_x += (LONG) od.dwData;
+ if ((int)od.dwOfs == DIMOFS_Y)
+ in_mouse_y += (LONG) od.dwData;
+ if ((int)od.dwOfs == DIMOFS_Z)
{
- case DIMOFS_X:
- in_mouse_x += (LONG) od.dwData;
- break;
-
- case DIMOFS_Y:
- in_mouse_y += (LONG) od.dwData;
- break;
-
- case DIMOFS_Z:
- if((LONG) od.dwData < 0)
- {
- Key_Event (K_MWHEELDOWN, 0, true);
- Key_Event (K_MWHEELDOWN, 0, false);
- }
- else if((LONG) od.dwData > 0)
- {
- Key_Event (K_MWHEELUP, 0, true);
- Key_Event (K_MWHEELUP, 0, false);
- }
- break;
-
- case DIMOFS_BUTTON0:
- if (od.dwData & 0x80)
- mstate_di |= 1;
- else
- mstate_di &= ~1;
- break;
-
- case DIMOFS_BUTTON1:
- if (od.dwData & 0x80)
- mstate_di |= (1<<1);
- else
- mstate_di &= ~(1<<1);
- break;
-
- case DIMOFS_BUTTON2:
- if (od.dwData & 0x80)
- mstate_di |= (1<<2);
- else
- mstate_di &= ~(1<<2);
- break;
-
- case DIMOFS_BUTTON3:
- if (od.dwData & 0x80)
- mstate_di |= (1<<3);
- else
- mstate_di &= ~(1<<3);
- break;
+ if((LONG)od.dwData < 0)
+ {
+ Key_Event(K_MWHEELDOWN, 0, true);
+ Key_Event(K_MWHEELDOWN, 0, false);
+ }
+ else if((LONG)od.dwData > 0)
+ {
+ Key_Event(K_MWHEELUP, 0, true);
+ Key_Event(K_MWHEELUP, 0, false);
+ }
}
+ if ((int)od.dwOfs == DIMOFS_BUTTON0)
+ mstate_di = (mstate_di & ~1) | ((od.dwData & 0x80) >> 7);
+ if ((int)od.dwOfs == DIMOFS_BUTTON1)
+ mstate_di = (mstate_di & ~2) | ((od.dwData & 0x80) >> 6);
+ if ((int)od.dwOfs == DIMOFS_BUTTON2)
+ mstate_di = (mstate_di & ~4) | ((od.dwData & 0x80) >> 5);
+ if ((int)od.dwOfs == DIMOFS_BUTTON3)
+ mstate_di = (mstate_di & ~8) | ((od.dwData & 0x80) >> 4);
}
// perform button actions