1
0
Fork 0
forked from fte/fteqw

Fix various warnings.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4353 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2013-05-11 05:03:07 +00:00
parent 2c084c6042
commit 873f0a8134
77 changed files with 393 additions and 468 deletions

View file

@ -6,11 +6,15 @@ STRIPFLAGS=--strip-unneeded --remove-section=.comment
CPUOPTIMIZATIONS= CPUOPTIMIZATIONS=
BASE_DIR=$(realpath .) #canonicalize the source path. except emscripten warns about that like crazy. *sigh*
BASE_DIR:=$(realpath .)
ifeq ($(FTE_TARGET),web)
BASE_DIR:=.
endif
SVNREVISION:=-DSVNREVISION=$(shell test -d .svn && svnversion || echo -) SVNREVISION:=-DSVNREVISION=$(shell test -d .svn && svnversion || echo -)
WHOAMI=$(shell whoami) WHOAMI:=$(shell whoami)
#only limited forms of cross-making is supported #only limited forms of cross-making is supported
#only the following 3 are supported #only the following 3 are supported
@ -84,8 +88,8 @@ ifeq ($(FTE_TARGET),droid)
TOOLCHAIN:=$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi- TOOLCHAIN:=$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-
endif endif
ANDROID_SCRIPT=android.bat ANDROID_SCRIPT=android.bat
#make can't cope with absolute paths in dependancy files #make can't cope with absolute win32 paths in dependancy files
NODEPS = 1 DEPCC=
endif endif
DROID_API_LEVEL=4 DROID_API_LEVEL=4
@ -820,7 +824,7 @@ ifeq ($(FTE_TARGET),vc)
DO_CC=@$(CC) /nologo $(ALL_CFLAGS) -Fo$@ -c $< DO_CC=@$(CC) /nologo $(ALL_CFLAGS) -Fo$@ -c $<
DO_LD=$(DO_ECHO) "$(MSVCPATH)link" /nologo /out:"$@" /nodefaultlib:libc.lib /LARGEADDRESSAWARE /nodefaultlib:MSVCRT $(MSVCLIB) /manifest:no /OPT:REF wsock32.lib user32.lib advapi32.lib winmm.lib libs/zlib$(BITS).lib shell32.lib DO_LD=$(DO_ECHO) "$(MSVCPATH)link" /nologo /out:"$@" /nodefaultlib:libc.lib /LARGEADDRESSAWARE /nodefaultlib:MSVCRT $(MSVCLIB) /manifest:no /OPT:REF wsock32.lib user32.lib advapi32.lib winmm.lib libs/zlib$(BITS).lib shell32.lib
PRECOMPHEADERS = PRECOMPHEADERS =
NODEPS = 1 DEPCC=
LIBS_DIR=./libs/ LIBS_DIR=./libs/
@ -1094,9 +1098,11 @@ endif
ifeq ($(FTE_TARGET),web) ifeq ($(FTE_TARGET),web)
WEB_PREJS ?= --pre-js web/prejs.js WEB_PREJS ?= --pre-js web/prejs.js
WEB_MEMORY?=402653184 WEB_MEMORY?=402653184
RELEASE_CFLAGS=-O1 -DOMIT_QCC -DGL_STATIC -DFTE_TARGET_WEB $(WEB_PREJS) RELEASE_CFLAGS=-DOMIT_QCC -DGL_STATIC -DFTE_TARGET_WEB
DEBUG_CFLAGS=-O0 -g --jcache -DOMIT_QCC -DGL_STATIC -DFTE_TARGET_WEB $(WEB_PREJS) DEBUG_CFLAGS=-g --jcache -DOMIT_QCC -DGL_STATIC -DFTE_TARGET_WEB
CC=emcc -s TOTAL_MEMORY=$(WEB_MEMORY) RELEASE_LDFLAGS=-O1 $(WEB_PREJS) -s TOTAL_MEMORY=$(WEB_MEMORY)
DEBUG_LDLAGS=-O0 $(WEB_PREJS) -s TOTAL_MEMORY=$(WEB_MEMORY)
CC=emcc
#-s ASM_JS=1 #-s ASM_JS=1
#BASELDFLAGS= #BASELDFLAGS=
@ -1126,10 +1132,12 @@ ifeq ($(FTE_TARGET),web)
OGGVORBISLDFLAGS= OGGVORBISLDFLAGS=
BOTLIB_CFLAGS= BOTLIB_CFLAGS=
NODEPS = 1 #generate deps properly
#DEPCC=
endif endif
SV_DIR?=sv_sdl SV_DIR?=sv_sdl
DEPCC?=$(CC)
-include Makefile_private -include Makefile_private
@ -1192,9 +1200,9 @@ $(OUT_DIR)/npplug.o : ftequake/npplug.rc
# rm -f $@.$$$$ # rm -f $@.$$$$
$(OUT_DIR)/%.o $(OUT_DIR)/%.d : %.c $(OUT_DIR)/%.o $(OUT_DIR)/%.d : %.c
ifeq ($(NODEPS),) ifneq ($(DEPCC),)
@set -e; rm -f $@.d; \ @set -e; rm -f $@.d; \
$(CC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \ $(DEPCC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \
sed 's,\($*\)\.o[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \ sed 's,\($*\)\.o[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \
sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \ sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \
rm -f $@.d.$$$$ rm -f $@.d.$$$$
@ -1202,9 +1210,9 @@ endif
$(DO_CC) -I$(OUT_DIR) $(DO_CC) -I$(OUT_DIR)
$(OUT_DIR)/%.o $(OUT_DIR)/%.d : %.cpp $(OUT_DIR)/%.o $(OUT_DIR)/%.d : %.cpp
ifeq ($(NODEPS),) ifneq ($(DEPCC),)
@set -e; rm -f $@.d; \ @set -e; rm -f $@.d; \
$(CC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \ $(DEPCC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \
sed 's,\($*\)\.o[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \ sed 's,\($*\)\.o[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \
sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \ sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \
rm -f $@.d.$$$$ rm -f $@.d.$$$$
@ -1212,9 +1220,9 @@ endif
$(DO_CC) -I$(OUT_DIR) $(DO_CC) -I$(OUT_DIR)
$(OUT_DIR)/%.oo $(OUT_DIR)/%.d : %.c $(OUT_DIR)/%.oo $(OUT_DIR)/%.d : %.c
ifeq ($(NODEPS),) ifneq ($(DEPCC),)
@set -e; rm -f $@.d; \ @set -e; rm -f $@.d; \
$(CC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \ $(DEPCC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \
sed 's,\($*\)\.oo[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \ sed 's,\($*\)\.oo[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \
sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \ sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \
rm -f $@.d.$$$$ rm -f $@.d.$$$$
@ -1223,7 +1231,7 @@ endif
$(OUT_DIR)/%.mo $(OUT_DIR)/%.d : %.m $(OUT_DIR)/%.mo $(OUT_DIR)/%.d : %.m
@set -e; rm -f $@.d; \ @set -e; rm -f $@.d; \
$(CC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \ $(DEPCC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \
sed 's,\($*\)\.mo[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \ sed 's,\($*\)\.mo[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \
sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \ sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \
rm -f $@.d.$$$$ rm -f $@.d.$$$$
@ -1231,7 +1239,7 @@ $(OUT_DIR)/%.mo $(OUT_DIR)/%.d : %.m
#enables use of precompiled headers in gcc 3.4 onwards. #enables use of precompiled headers in gcc 3.4 onwards.
$(OUT_DIR)/quakedef.h.gch : quakedef.h $(OUT_DIR)/quakedef.h.gch : quakedef.h
$(CC) -x c $(BASE_CFLAGS) $(WCFLAGS) -o $@ -c $< $(CFLAGS) $(CC) -x c $(ALL_CFLAGS) -o $@ -c $<
PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch
#addprefix is to add the ./release/server/ part of the object name #addprefix is to add the ./release/server/ part of the object name

View file

@ -1469,7 +1469,7 @@ void CL_PlayDemo_f (void)
void CL_PlayDemo(char *demoname) void CL_PlayDemo(char *demoname)
{ {
char name[256]; char name[256];
int ft, neg; int ft, neg = false;
int len; int len;
char type; char type;
char chr; char chr;
@ -1564,8 +1564,6 @@ void CL_PlayDemo(char *demoname)
} }
else else
{ {
cls.protocol = CP_QUAKEWORLD;
ft = 0; //work out if the first line is a int for the track number. ft = 0; //work out if the first line is a int for the track number.
while ((VFS_READ(cls.demoinfile, &chr, 1)==1) && (chr != '\n')) while ((VFS_READ(cls.demoinfile, &chr, 1)==1) && (chr != '\n'))
{ {
@ -1576,6 +1574,8 @@ void CL_PlayDemo(char *demoname)
else else
ft = ft * 10 + ((int)chr - '0'); ft = ft * 10 + ((int)chr - '0');
} }
if (neg)
ft *= -1;
if (chr == '\n') if (chr == '\n')
{ {
#ifndef NQPROT #ifndef NQPROT
@ -1583,13 +1583,18 @@ void CL_PlayDemo(char *demoname)
CL_StopPlayback(); CL_StopPlayback();
return; return;
#else #else
//fixme: play that cdtrack.
cls.protocol = CP_NETQUAKE; cls.protocol = CP_NETQUAKE;
cls.demoplayback = DPB_NETQUAKE; //nq demos. :o) cls.demoplayback = DPB_NETQUAKE; //nq demos. :o)
#endif #endif
} }
else else
{
cls.protocol = CP_QUAKEWORLD;
VFS_SEEK(cls.demoinfile, start); //quakeworld demo, so go back to start. VFS_SEEK(cls.demoinfile, start); //quakeworld demo, so go back to start.
} }
}
TP_ExecTrigger ("f_demostart"); TP_ExecTrigger ("f_demostart");
} }

View file

@ -1288,7 +1288,7 @@ void CLDP_ParseDarkPlaces5Entities(void) //the things I do.. :o(
static packet_entities_t newpack; static packet_entities_t newpack;
entity_state_t *to, *from; entity_state_t *to, *from;
unsigned short read; unsigned int read;
int oldi, newi, lowesti, lowestv, newremaining; int oldi, newi, lowesti, lowestv, newremaining;
qboolean remove; qboolean remove;
@ -1306,12 +1306,15 @@ void CLDP_ParseDarkPlaces5Entities(void) //the things I do.. :o(
oldi = 0; oldi = 0;
newpack.num_entities = 0; newpack.num_entities = 0;
for (read = MSG_ReadShort(); read!=0x8000; read = MSG_ReadShort()) for (;;)
{ {
read = MSG_ReadShort();
if (msg_badread) if (msg_badread)
Host_EndGame("Corrupt entitiy message packet\n"); Host_EndGame("Corrupt entitiy message packet\n");
remove = !!(read&0x8000); remove = !!(read&0x8000);
read&=~0x8000; read&=0x7fff;
if (remove && !read)
break; //remove world signals end of packet.
if (read >= MAX_EDICTS) if (read >= MAX_EDICTS)
Host_EndGame("Too many entities.\n"); Host_EndGame("Too many entities.\n");
@ -1417,7 +1420,6 @@ void CLNQ_ParseEntity(unsigned int bits)
int num; int num;
entity_state_t *state;//, *from; entity_state_t *state;//, *from;
entity_state_t *base; entity_state_t *base;
static float lasttime;
packet_entities_t *pack; packet_entities_t *pack;
if (cls.signon == 4 - 1) if (cls.signon == 4 - 1)
@ -1461,7 +1463,6 @@ void CLNQ_ParseEntity(unsigned int bits)
pack->entities = BZ_Realloc(pack->entities, sizeof(entity_state_t)*pack->max_entities); pack->entities = BZ_Realloc(pack->entities, sizeof(entity_state_t)*pack->max_entities);
memset(pack->entities + pack->num_entities, 0, sizeof(entity_state_t)); memset(pack->entities + pack->num_entities, 0, sizeof(entity_state_t));
} }
lasttime = realtime;
state = &pack->entities[pack->num_entities++]; state = &pack->entities[pack->num_entities++];
} }
@ -3615,21 +3616,6 @@ int lastplayerinfo;
void CL_ParseClientdata (void); void CL_ParseClientdata (void);
void CL_MVDUpdateSpectator(void) void CL_MVDUpdateSpectator(void)
{ {
player_state_t *self, *oldself;
int s;
for (s = 0; s < cl.splitclients; s++)
{
self = &cl.inframes[cl.parsecount & UPDATE_MASK].playerstate[cl.playernum[s]];
oldself = &cl.inframes[(cls.netchan.outgoing_sequence - 1) & UPDATE_MASK].playerstate[cl.playernum[s]];
// cl.frames[cl.parsecount & UPDATE_MASK].senttime = cl.frames[(cls.netchan.outgoing_sequence - 1) & UPDATE_MASK].senttime;
// self->messagenum = cl.parsecount;
// VectorCopy(oldself->origin, self->origin);
// VectorCopy(oldself->velocity, self->velocity);
// VectorCopy(oldself->viewangles, self->viewangles);
}
CL_ParseClientdata(); CL_ParseClientdata();
} }
@ -4121,7 +4107,6 @@ void CL_LinkPlayers (void)
entity_t *ent; entity_t *ent;
int msec; int msec;
inframe_t *frame; inframe_t *frame;
inframe_t *fromf;
int oldphysent; int oldphysent;
vec3_t angles; vec3_t angles;
qboolean predictplayers; qboolean predictplayers;
@ -4139,7 +4124,6 @@ void CL_LinkPlayers (void)
playertime = realtime; playertime = realtime;
frame = &cl.inframes[cl.validsequence&UPDATE_MASK]; frame = &cl.inframes[cl.validsequence&UPDATE_MASK];
fromf = &cl.inframes[cl.oldvalidsequence&UPDATE_MASK];
predictplayers = cl_predict_players.ival; predictplayers = cl_predict_players.ival;
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV) if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)

View file

@ -1818,6 +1818,9 @@ void CL_SendCmd (double frametime, qboolean mainloop)
} }
#ifdef VOICECHAT #ifdef VOICECHAT
if (cls.protocol == CP_QUAKE2)
S_Voip_Transmit(clcq2_voicechat, &buf);
else
S_Voip_Transmit(clc_voicechat, &buf); S_Voip_Transmit(clc_voicechat, &buf);
#endif #endif

View file

@ -2842,7 +2842,7 @@ void CL_ReadPackets (void)
qboolean CL_AllowArbitaryDownload(char *localfile) qboolean CL_AllowArbitaryDownload(char *localfile)
{ {
qboolean allow; int allow;
//never allow certain (native code) arbitary downloads. //never allow certain (native code) arbitary downloads.
if (!strnicmp(localfile, "game", 4) || !stricmp(localfile, "progs.dat") || !stricmp(localfile, "menu.dat") || !stricmp(localfile, "csprogs.dat") || !stricmp(localfile, "qwprogs.dat") || strstr(localfile, "..") || strstr(localfile, ":") || strstr(localfile, "//") || strstr(localfile, ".qvm") || strstr(localfile, ".dll") || strstr(localfile, ".so")) if (!strnicmp(localfile, "game", 4) || !stricmp(localfile, "progs.dat") || !stricmp(localfile, "menu.dat") || !stricmp(localfile, "csprogs.dat") || !stricmp(localfile, "qwprogs.dat") || strstr(localfile, "..") || strstr(localfile, ":") || strstr(localfile, "//") || strstr(localfile, ".qvm") || strstr(localfile, ".dll") || strstr(localfile, ".so"))
{ //yes, I know the user can use a different progs from the one that is specified. If you leave it blank there will be no problem. (server isn't allowed to stuff progs cvar) { //yes, I know the user can use a different progs from the one that is specified. If you leave it blank there will be no problem. (server isn't allowed to stuff progs cvar)
@ -2953,7 +2953,6 @@ void CL_DownloadSize_f(void)
} }
else if (!strcmp(size, "r")) else if (!strcmp(size, "r"))
{ //'download this file instead' { //'download this file instead'
int allow = cl_download_redirection.ival;
redirection = Cmd_Argv(3); redirection = Cmd_Argv(3);
if (!CL_AllowArbitaryDownload(redirection)) if (!CL_AllowArbitaryDownload(redirection))
@ -3546,7 +3545,7 @@ double Host_Frame (double time)
static double time3 = 0; static double time3 = 0;
int pass1, pass2, pass3; int pass1, pass2, pass3;
// float fps; // float fps;
double realframetime, newrealtime; double newrealtime;
static double spare; static double spare;
float maxfps; float maxfps;
qboolean maxfpsignoreserver; qboolean maxfpsignoreserver;
@ -3561,15 +3560,12 @@ double Host_Frame (double time)
newrealtime = Media_TweekCaptureFrameTime(realtime, time); newrealtime = Media_TweekCaptureFrameTime(realtime, time);
realframetime = time = newrealtime - realtime; time = newrealtime - realtime;
realtime = newrealtime; realtime = newrealtime;
if (oldrealtime > realtime) if (oldrealtime > realtime)
oldrealtime = 0; oldrealtime = 0;
// if (cls.demoplayback && cl_demospeed.value>0)
// realframetime *= cl_demospeed.value; // this probably screws up other timings
if (cl.gamespeed<0.1) if (cl.gamespeed<0.1)
cl.gamespeed = 1; cl.gamespeed = 1;
time *= cl.gamespeed; time *= cl.gamespeed;
@ -3835,7 +3831,6 @@ void CL_ReadCDKey(void)
buffer = COM_LoadTempFile("q3key"); buffer = COM_LoadTempFile("q3key");
if (buffer) //a cdkey is meant to be 16 chars if (buffer) //a cdkey is meant to be 16 chars
{ {
cvar_t *var;
char *chr; char *chr;
for (chr = buffer; *chr; chr++) for (chr = buffer; *chr; chr++)
{ {
@ -3845,7 +3840,7 @@ void CL_ReadCDKey(void)
break; break;
} }
} }
var = Cvar_Get("cl_cdkey", buffer, CVAR_LATCH|CVAR_NOUNSAFEEXPAND, "Q3 compatability"); Cvar_Get("cl_cdkey", buffer, CVAR_LATCH|CVAR_NOUNSAFEEXPAND, "Q3 compatability");
} }
} }
#endif #endif

View file

@ -391,7 +391,7 @@ qboolean CL_EnqueDownload(char *filename, char *localname, unsigned int flags)
return false; return false;
} }
ext = COM_FileExtension(localname); ext = COM_FileExtension(localname);
if (!stricmp(localname, "dll") || !stricmp(localname, "so") || strchr(localname, '\\') || strchr(localname, ':') || strstr(localname, "..")) if (!stricmp(ext, "dll") || !stricmp(ext, "so") || strchr(localname, '\\') || strchr(localname, ':') || strstr(localname, ".."))
{ {
Con_Printf("Denying download of \"%s\"\n", filename); Con_Printf("Denying download of \"%s\"\n", filename);
return false; return false;
@ -1890,6 +1890,7 @@ void CL_ParseDownload (void)
char *localname; char *localname;
Q_strncpyz(name, MSG_ReadString(), sizeof(name)); Q_strncpyz(name, MSG_ReadString(), sizeof(name));
localname = MSG_ReadString(); localname = MSG_ReadString();
Con_DPrintf("Download for %s redirected to %s\n", localname, name);
/*quakeforge http download redirection*/ /*quakeforge http download redirection*/
if (cls.downloadqw) if (cls.downloadqw)
{ {
@ -3838,11 +3839,11 @@ void CLQ2_ParseStartSoundPacket(void)
*skin = '\0'; *skin = '\0';
if (*model) if (*model)
{ {
S_StartSound (ent, channel, S_PrecacheSound(va("players/%s/%s", model, cl.sound_precache[sound_num]->name+1)), pos, volume, attenuation, 0, 0); S_StartSound (ent, channel, S_PrecacheSound(va("players/%s/%s", model, cl.sound_precache[sound_num]->name+1)), pos, volume, attenuation, ofs, 0);
return; return;
} }
} }
S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume, attenuation, 0, 0); S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume, attenuation, ofs, 0);
} }
#endif #endif

View file

@ -1823,7 +1823,6 @@ void CLQ2_CalcViewValues (void)
extern cvar_t v_gunkick_q2; extern cvar_t v_gunkick_q2;
int i; int i;
float lerp, backlerp; float lerp, backlerp;
q2centity_t *ent;
q2frame_t *oldframe; q2frame_t *oldframe;
q2player_state_t *ps, *ops; q2player_state_t *ps, *ops;
extern cvar_t gl_cshiftenabled; extern cvar_t gl_cshiftenabled;
@ -1846,7 +1845,6 @@ void CLQ2_CalcViewValues (void)
|| abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*8) || abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*8)
ops = ps; // don't interpolate ops = ps; // don't interpolate
ent = &cl_entities[cl.playernum[0]+1];
lerp = cl.lerpfrac; lerp = cl.lerpfrac;
// calculate the origin // calculate the origin

View file

@ -475,7 +475,9 @@ qboolean CLQ3_SystemInfoChanged(char *str)
while(rn) while(rn)
{ {
char crc[64];
vfsfile_t *f; vfsfile_t *f;
rc = COM_ParseOut(rc, crc, sizeof(crc));
rn = COM_Parse(rn); rn = COM_Parse(rn);
if (!*com_token) if (!*com_token)
break; break;
@ -483,23 +485,32 @@ qboolean CLQ3_SystemInfoChanged(char *str)
if (!strchr(com_token, '/')) //don't let some muppet tell us to download quake3.exe if (!strchr(com_token, '/')) //don't let some muppet tell us to download quake3.exe
break; break;
//as much as I'd like to use COM_FCheckExists, this stuf is relative to root, not the gamedir.
f = FS_OpenVFS(va("%s.pk3", com_token), "rb", FS_ROOT); f = FS_OpenVFS(va("%s.pk3", com_token), "rb", FS_ROOT);
if (f) if (f)
VFS_CLOSE(f);
else
{ {
VFS_CLOSE(f);
continue;
}
FS_GenCachedPakName(va("%s.pk3", com_token), crc, cls.downloadlocalname, sizeof(cls.downloadlocalname));
f = FS_OpenVFS(cls.downloadlocalname, "rb", FS_ROOT);
if (f)
{
VFS_CLOSE(f);
continue;
}
//fixme: request to download it //fixme: request to download it
Con_Printf("Sending request to download %s\n", com_token); Con_Printf("Sending request to download %s\n", com_token);
CLQ3_SendClientCommand("download %s.pk3", com_token); CLQ3_SendClientCommand("download %s.pk3", com_token);
ccs.downloadchunknum = 0; ccs.downloadchunknum = 0;
snprintf(cls.downloadlocalname, sizeof(cls.downloadlocalname), "%s.pk3", com_token); //q3's downloads are relative to root, but they do at least force a pk3 extension.
FS_GenCachedPakName(va("%s.tmp", com_token), crc, cls.downloadtempname, sizeof(cls.downloadtempname));
snprintf(cls.downloadremotename, sizeof(cls.downloadremotename), "%s.pk3", com_token); snprintf(cls.downloadremotename, sizeof(cls.downloadremotename), "%s.pk3", com_token);
snprintf(cls.downloadtempname, sizeof(cls.downloadtempname), "%s.tmp", com_token);
cls.downloadmethod = DL_Q3; cls.downloadmethod = DL_Q3;
cls.downloadpercent = 0; cls.downloadpercent = 0;
return false; return false;
} }
}
pc = Info_ValueForKey(str, "sv_paks"); //the ones that we are allowed to use (in order!) pc = Info_ValueForKey(str, "sv_paks"); //the ones that we are allowed to use (in order!)
pn = Info_ValueForKey(str, "sv_pakNames"); pn = Info_ValueForKey(str, "sv_pakNames");

View file

@ -367,7 +367,7 @@ void Key_ClearTyping (void)
void Con_History_Load(void) void Con_History_Load(void)
{ {
char line[8192]; char line[8192];
unsigned char *cr; char *cr;
vfsfile_t *file = FS_OpenVFS("conhistory.txt", "rb", FS_ROOT); vfsfile_t *file = FS_OpenVFS("conhistory.txt", "rb", FS_ROOT);
for (edit_line=0 ; edit_line<=CON_EDIT_LINES_MASK ; edit_line++) for (edit_line=0 ; edit_line<=CON_EDIT_LINES_MASK ; edit_line++)

View file

@ -45,7 +45,7 @@ typedef struct { //cm = colourmap
char *ReadGreyTargaFile (qbyte *data, int flen, tgaheader_t *tgahead, int asgrey) //preswapped header char *ReadGreyTargaFile (qbyte *data, int flen, tgaheader_t *tgahead, int asgrey) //preswapped header
{ {
int columns, rows, numPixels; int columns, rows;
int row, column; int row, column;
qbyte *pixbuf, *pal; qbyte *pixbuf, *pal;
qboolean flipped; qboolean flipped;
@ -70,7 +70,6 @@ char *ReadGreyTargaFile (qbyte *data, int flen, tgaheader_t *tgahead, int asgrey
columns = tgahead->width; columns = tgahead->width;
rows = tgahead->height; rows = tgahead->height;
numPixels = columns * rows;
flipped = !((tgahead->attribs & 0x20) >> 5); flipped = !((tgahead->attribs & 0x20) >> 5);
#ifndef NPFTE #ifndef NPFTE
@ -1700,11 +1699,11 @@ qbyte *ReadPCXData(qbyte *buf, int length, int width, int height, qbyte *result)
{ {
pcx_t *pcx; pcx_t *pcx;
// pcx_t pcxbuf; // pcx_t pcxbuf;
qbyte *palette; // qbyte *palette;
qbyte *pix; qbyte *pix;
int x, y; int x, y;
int dataByte, runLength; int dataByte, runLength;
int count; // int count;
qbyte *data; qbyte *data;
unsigned short xmin, ymin, swidth, sheight; unsigned short xmin, ymin, swidth, sheight;
@ -1735,13 +1734,8 @@ qbyte *ReadPCXData(qbyte *buf, int length, int width, int height, qbyte *result)
return NULL; //we can't feed the requester with enough info return NULL; //we can't feed the requester with enough info
} }
palette = buf + length-768;
data = (char *)(pcx+1); data = (char *)(pcx+1);
count = (swidth) * (sheight);
for (y=0 ; y<height ; y++) for (y=0 ; y<height ; y++)
{ {
pix = result + y*swidth; pix = result + y*swidth;

View file

@ -871,7 +871,6 @@ qboolean FS_LoadPackageFromFile(vfsfile_t *vfs, char *pname, char *localname, in
void FS_GenCachedPakName(char *pname, char *crc, char *local, int llen); void FS_GenCachedPakName(char *pname, char *crc, char *local, int llen);
static void CL_BootDownload_Complete(struct dl_download *dl) static void CL_BootDownload_Complete(struct dl_download *dl)
{ {
void *zip;
char *q = strchr(dl->url, '?'); char *q = strchr(dl->url, '?');
char *ext; char *ext;
if (dl->file && dl->status == DL_FINISHED) if (dl->file && dl->status == DL_FINISHED)
@ -882,6 +881,7 @@ static void CL_BootDownload_Complete(struct dl_download *dl)
if (!stricmp(ext, "zip")) if (!stricmp(ext, "zip"))
{ {
#ifdef AVAIL_ZLIB #ifdef AVAIL_ZLIB
void *zip;
if (dl->status == DL_FINISHED) if (dl->status == DL_FINISHED)
zip = zipfilefuncs.OpenNew(dl->file, dl->url); zip = zipfilefuncs.OpenNew(dl->file, dl->url);
else else

View file

@ -567,7 +567,6 @@ static void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu
{ {
int x = xpos+option->common.posx; int x = xpos+option->common.posx;
int y = ypos+option->common.posy; int y = ypos+option->common.posy;
int l;
int keys[2]; int keys[2];
char *keyname; char *keyname;
@ -578,7 +577,6 @@ static void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu
x += strlen(option->bind.caption)*8+28; x += strlen(option->bind.caption)*8+28;
{ {
extern cvar_t cl_forcesplitclient; extern cvar_t cl_forcesplitclient;
l = strlen (option->bind.command);
M_FindKeysForCommand (cl_forcesplitclient.ival, option->bind.command, keys); M_FindKeysForCommand (cl_forcesplitclient.ival, option->bind.command, keys);

View file

@ -595,7 +595,7 @@ void M_Media_Key (int key)
} }
else if (selectedoption>=0) else if (selectedoption>=0)
{ {
mediatrack_t *prevtrack, *tr; mediatrack_t *tr;
int num=0; int num=0;
tr=tracks; tr=tracks;
while(tr) while(tr)
@ -603,7 +603,6 @@ void M_Media_Key (int key)
if (num == selectedoption) if (num == selectedoption)
break; break;
prevtrack = tr;
tr=tr->next; tr=tr->next;
num++; num++;
} }

View file

@ -239,7 +239,9 @@ void M_Menu_Audio_f (void)
menu_t *menu; menu_t *menu;
extern cvar_t nosound, snd_leftisright, snd_khz, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices; extern cvar_t nosound, snd_leftisright, snd_khz, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices;
// extern cvar_t snd_noextraupdate, snd_eax, precache; // extern cvar_t snd_noextraupdate, snd_eax, precache;
#ifdef VOICECHAT
extern cvar_t cl_voip_play, cl_voip_send; extern cvar_t cl_voip_play, cl_voip_send;
#endif
static const char *soundqualityoptions[] = { static const char *soundqualityoptions[] = {
"11025 Hz", "11025 Hz",

View file

@ -189,9 +189,10 @@ typedef struct texid_s texid_tf;
//small context for easy vbo creation. //small context for easy vbo creation.
typedef struct typedef struct
{ {
unsigned int maxsize; size_t maxsize;
unsigned int pos; size_t pos;
int vboid[2]; int vboid[2];
void *fallback;
} vbobctx_t; } vbobctx_t;
typedef struct vboarray_s typedef struct vboarray_s

View file

@ -2125,17 +2125,7 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
for (i = 0; i < adrlen; i++) for (i = 0; i < adrlen; i++)
((qbyte *)&info->adr.address)[i] = MSG_ReadByte(); ((qbyte *)&info->adr.address)[i] = MSG_ReadByte();
break; break;
default:
// warning: enumeration value 'NA_*' not handled in switch
case NA_WEBSOCKET:
case NA_INVALID:
case NA_LOOPBACK:
case NA_BROADCAST_IP:
case NA_BROADCAST_IP6:
case NA_BROADCAST_IPX:
case NA_TCP:
case NA_TCPV6:
case NA_IRC:
break; break;
} }

View file

@ -333,7 +333,6 @@ static void PClassic_DrawParticles(void)
float time2, time3, time1, dvel, frametime, grav; float time2, time3, time1, dvel, frametime, grav;
vec3_t up, right; vec3_t up, right;
float dist, scale, r_partscale=0; float dist, scale, r_partscale=0;
unsigned int *palette;
#ifdef POLYS #ifdef POLYS
scenetris_t *scenetri; scenetris_t *scenetri;
#else #else
@ -342,13 +341,6 @@ static void PClassic_DrawParticles(void)
static float oldtime; static float oldtime;
RSpeedMark(); RSpeedMark();
/*#ifdef D3DQUAKE
if (qrenderer == QR_DIRECT3D)
palette = d_8to24bgrtable;
else
#endif*/
palette = d_8to24rgbtable;
//make sure all ents are pushed through first //make sure all ents are pushed through first
RQ_RenderBatchClear(); RQ_RenderBatchClear();

View file

@ -1883,7 +1883,6 @@ static void P_ImportEffectInfo_f(void)
part_type_t *ptype = NULL; part_type_t *ptype = NULL;
int parenttype; int parenttype;
char *file, *line; char *file, *line;
char *cmd;
char arg[8][1024]; char arg[8][1024];
int args = 0; int args = 0;
char *config = "effectinfo"; char *config = "effectinfo";
@ -1917,7 +1916,6 @@ static void P_ImportEffectInfo_f(void)
if (args <= 0) if (args <= 0)
continue; continue;
cmd = arg[0];
if (!strcmp(arg[0], "effect")) if (!strcmp(arg[0], "effect"))
{ {
char newname[64]; char newname[64];

View file

@ -571,8 +571,8 @@ void QCBUILTIN PF_cl_GetBindMap (pubprogfuncs_t *prinst, struct globalvars_s *pr
} }
void QCBUILTIN PF_cl_SetBindMap (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_cl_SetBindMap (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int primary = G_FLOAT(OFS_PARM0+0); // int primary = G_FLOAT(OFS_PARM0+0);
int secondary = G_FLOAT(OFS_PARM0+1); // int secondary = G_FLOAT(OFS_PARM0+1);
// if (IN_SetBindMap(primary, secondary)) // if (IN_SetBindMap(primary, secondary))
// G_FLOAT(OFS_RETURN) = 1; // G_FLOAT(OFS_RETURN) = 1;
G_FLOAT(OFS_RETURN) = 0; G_FLOAT(OFS_RETURN) = 0;

View file

@ -1550,7 +1550,7 @@ static void QCBUILTIN PF_cs_SetSize(pubprogfuncs_t *prinst, struct globalvars_s
World_LinkEdict(&csqc_world, (wedict_t*)ent, false); World_LinkEdict(&csqc_world, (wedict_t*)ent, false);
} }
static void cs_settracevars(trace_t *tr) static void cs_settracevars(trace_t *tr, struct globalvars_s *pr_globals)
{ {
*csqcg.trace_allsolid = tr->allsolid; *csqcg.trace_allsolid = tr->allsolid;
*csqcg.trace_startsolid = tr->startsolid; *csqcg.trace_startsolid = tr->startsolid;
@ -1599,7 +1599,7 @@ static void QCBUILTIN PF_cs_traceline(pubprogfuncs_t *prinst, struct globalvars_
trace = World_Move (&csqc_world, v1, mins, maxs, v2, nomonsters, (wedict_t*)ent); trace = World_Move (&csqc_world, v1, mins, maxs, v2, nomonsters, (wedict_t*)ent);
ent->xv->hull = savedhull; ent->xv->hull = savedhull;
cs_settracevars(&trace); cs_settracevars(&trace, pr_globals);
} }
static void QCBUILTIN PF_cs_tracebox(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_cs_tracebox(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
@ -1621,7 +1621,7 @@ static void QCBUILTIN PF_cs_tracebox(pubprogfuncs_t *prinst, struct globalvars_s
trace = World_Move (&csqc_world, v1, mins, maxs, v2, nomonsters, (wedict_t*)ent); trace = World_Move (&csqc_world, v1, mins, maxs, v2, nomonsters, (wedict_t*)ent);
ent->xv->hull = savedhull; ent->xv->hull = savedhull;
cs_settracevars(&trace); cs_settracevars(&trace, pr_globals);
} }
static trace_t CS_Trace_Toss (csqcedict_t *tossent, csqcedict_t *ignore) static trace_t CS_Trace_Toss (csqcedict_t *tossent, csqcedict_t *ignore)
@ -1679,7 +1679,7 @@ static void QCBUILTIN PF_cs_tracetoss (pubprogfuncs_t *prinst, struct globalvars
trace = CS_Trace_Toss (ent, ignore); trace = CS_Trace_Toss (ent, ignore);
cs_settracevars(&trace); cs_settracevars(&trace, pr_globals);
} }
static void QCBUILTIN PF_cs_pointcontents(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_cs_pointcontents(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -3335,7 +3335,7 @@ static void QCBUILTIN PF_rotatevectorsbytag (pubprogfuncs_t *prinst, struct glob
//fixme merge with ssqc
static void QCBUILTIN PF_cs_checkbottom (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_cs_checkbottom (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
csqcedict_t *ent; csqcedict_t *ent;
@ -3353,6 +3353,7 @@ static void QCBUILTIN PF_cs_break (pubprogfuncs_t *prinst, struct globalvars_s *
#endif #endif
} }
//fixme merge with ssqc
static void QCBUILTIN PF_cs_walkmove (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_cs_walkmove (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
csqcedict_t *ent; csqcedict_t *ent;
@ -3385,12 +3386,13 @@ static void QCBUILTIN PF_cs_walkmove (pubprogfuncs_t *prinst, struct globalvars_
// save program state, because CS_movestep may call other progs // save program state, because CS_movestep may call other progs
oldself = *csqcg.self; oldself = *csqcg.self;
G_FLOAT(OFS_RETURN) = World_movestep(&csqc_world, (wedict_t*)ent, move, true, false, NULL, pr_globals); G_FLOAT(OFS_RETURN) = World_movestep(&csqc_world, (wedict_t*)ent, move, true, false, settrace?cs_settracevars:NULL, pr_globals);
// restore program state // restore program state
*csqcg.self = oldself; *csqcg.self = oldself;
} }
//fixme merge with ssqc
static void QCBUILTIN PF_cs_movetogoal (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_cs_movetogoal (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
wedict_t *ent; wedict_t *ent;

View file

@ -10,6 +10,25 @@
#if defined(MENU_DAT) || defined(CSQC_DAT) #if defined(MENU_DAT) || defined(CSQC_DAT)
#include "cl_master.h" #include "cl_master.h"
extern int r2d_be_flags;
#define DRAWFLAG_NORMAL 0
#define DRAWFLAG_ADD 1
#define DRAWFLAG_MODULATE 2
#define DRAWFLAG_MODULATE2 3
static unsigned int PF_SelectDPDrawFlag(int flag)
{
//flags:
//0 = blend
//1 = add
//2 = modulate
//3 = modulate*2
flag &= 3;
if (flag == DRAWFLAG_ADD)
return BEF_FORCEADDITIVE;
else
return 0;
}
//float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457; //float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
void QCBUILTIN PF_CL_drawfill (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_drawfill (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
@ -266,6 +285,7 @@ void QCBUILTIN PF_CL_drawcolouredstring (pubprogfuncs_t *prinst, struct globalva
COM_ParseFunString(CON_WHITEMASK, text, buffer, sizeof(buffer), false); COM_ParseFunString(CON_WHITEMASK, text, buffer, sizeof(buffer), false);
str = buffer; str = buffer;
r2d_be_flags = PF_SelectDPDrawFlag(flag);
PR_CL_BeginString(prinst, pos[0], pos[1], size[0], size[1], &px, &py); PR_CL_BeginString(prinst, pos[0], pos[1], size[0], size[1], &px, &py);
ipx = px; ipx = px;
Font_ForceColour(r, g, b, alpha); Font_ForceColour(r, g, b, alpha);
@ -281,6 +301,7 @@ void QCBUILTIN PF_CL_drawcolouredstring (pubprogfuncs_t *prinst, struct globalva
} }
Font_InvalidateColour(); Font_InvalidateColour();
Font_EndString(NULL); Font_EndString(NULL);
r2d_be_flags = 0;
} }
void QCBUILTIN PF_CL_stringwidth(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_stringwidth(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -300,25 +321,6 @@ void QCBUILTIN PF_CL_stringwidth(pubprogfuncs_t *prinst, struct globalvars_s *pr
G_FLOAT(OFS_RETURN) = (px * vid.width) / vid.rotpixelwidth; G_FLOAT(OFS_RETURN) = (px * vid.width) / vid.rotpixelwidth;
} }
#define DRAWFLAG_NORMAL 0
#define DRAWFLAG_ADD 1
#define DRAWFLAG_MODULATE 2
#define DRAWFLAG_MODULATE2 3
extern unsigned int r2d_be_flags;
static unsigned int PF_SelectDPDrawFlag(int flag)
{
//flags:
//0 = blend
//1 = add
//2 = modulate
//3 = modulate*2
if (flag == 1)
return BEF_FORCEADDITIVE;
else
return 0;
}
//float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456; //float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
void QCBUILTIN PF_CL_drawpic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_drawpic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
@ -378,13 +380,8 @@ void QCBUILTIN PF_CL_drawsubpic (pubprogfuncs_t *prinst, struct globalvars_s *pr
void QCBUILTIN PF_CL_is_cached_pic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_is_cached_pic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
char *str; char *str;
str = PR_GetStringOfs(prinst, OFS_PARM0); str = PR_GetStringOfs(prinst, OFS_PARM0);
G_FLOAT(OFS_RETURN) = !!R_RegisterCustom(str, NULL, NULL);
// if (Draw_IsCached)
// G_FLOAT(OFS_RETURN) = !!Draw_IsCached(str);
// else
G_FLOAT(OFS_RETURN) = 1;
} }
void QCBUILTIN PF_CL_precache_pic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_precache_pic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
@ -421,11 +418,12 @@ void QCBUILTIN PF_CL_precache_pic (pubprogfuncs_t *prinst, struct globalvars_s *
void QCBUILTIN PF_CL_free_pic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_free_pic (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
//we don't support this, as the shader could be used elsewhere also, and we have pointers to things.
/*
char *str; char *str;
str = PR_GetStringOfs(prinst, OFS_PARM0); str = PR_GetStringOfs(prinst, OFS_PARM0);
R_UnloadShader(R_RegisterCustom(str, NULL, NULL));
//we don't support this. */
} }
//float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454; //float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;

View file

@ -627,7 +627,6 @@ static doll_t *rag_loaddoll(model_t *mod, char *fname, int numbones)
{ {
doll_t *d; doll_t *d;
void *fptr = NULL; void *fptr = NULL;
int fsize;
for (d = dolllist; d; d = d->next) for (d = dolllist; d; d = d->next)
{ {
@ -636,7 +635,7 @@ static doll_t *rag_loaddoll(model_t *mod, char *fname, int numbones)
return d; return d;
} }
fsize = FS_LoadFile(fname, &fptr); FS_LoadFile(fname, &fptr);
if (!fptr) if (!fptr)
{ {
#ifndef SERVERONLY #ifndef SERVERONLY

View file

@ -422,13 +422,11 @@ void R2D_SubPic(int x, int y, int width, int height, mpic_t *pic, int srcx, int
/* this is an ugly special case drawing func that's only used for the player color selection menu */ /* this is an ugly special case drawing func that's only used for the player color selection menu */
void R2D_TransPicTranslate (int x, int y, int width, int height, qbyte *pic, qbyte *translation) void R2D_TransPicTranslate (int x, int y, int width, int height, qbyte *pic, qbyte *translation)
{ {
int v, u, c; int v, u;
unsigned trans[64*64], *dest; unsigned trans[64*64], *dest;
qbyte *src; qbyte *src;
int p; int p;
c = width * height;
dest = trans; dest = trans;
for (v=0 ; v<64 ; v++, dest += 64) for (v=0 ; v<64 ; v++, dest += 64)
{ {

View file

@ -277,7 +277,7 @@ qboolean Mod_LoadMap_Proc(model_t *model, char *data)
} }
else if (!strcmp(token, "interAreaPortals")) else if (!strcmp(token, "interAreaPortals"))
{ {
int numareas; //int numareas;
int pno, v; int pno, v;
portal_t *p; portal_t *p;
@ -286,7 +286,7 @@ qboolean Mod_LoadMap_Proc(model_t *model, char *data)
return false; return false;
data = COM_ParseOut(data, token, sizeof(token)); data = COM_ParseOut(data, token, sizeof(token));
numareas = atoi(token); //numareas = atoi(token);
data = COM_ParseOut(data, token, sizeof(token)); data = COM_ParseOut(data, token, sizeof(token));
model->numportals = atoi(token); model->numportals = atoi(token);

View file

@ -68,15 +68,13 @@ unsigned long ret;
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static int roq_parse_file(vfsfile_t *fp, roq_info *ri) static int roq_parse_file(vfsfile_t *fp, roq_info *ri)
{ {
unsigned int head1, head3, chunk_id, chunk_arg; unsigned int head1, head3, chunk_id;//, chunk_arg;
long head2, chunk_size; long head2, chunk_size;
long fpos; long fpos;
#ifndef FAST #ifndef FAST
int max_frame; int max_frame;
#endif #endif
#define rfeof(f) (VFS_TELL(f)>= ri->maxpos)
#ifndef FAST #ifndef FAST
ri->num_audio_bytes = ri->num_frames = max_frame = 0; ri->num_audio_bytes = ri->num_frames = max_frame = 0;
ri->audio_channels = 0; ri->audio_channels = 0;
@ -91,22 +89,22 @@ int max_frame;
return 1; return 1;
} }
ri->roq_start = VFS_TELL(fp); ri->roq_start = fpos = VFS_TELL(fp);
while(!rfeof(fp)) while(fpos+8 <= ri->maxpos)
{ {
#if DBUG > 20 #if DBUG > 20
Con_Printf("---------------------------------------------------------------------------\n"); Con_Printf("---------------------------------------------------------------------------\n");
#endif #endif
fpos = VFS_TELL(fp); VFS_SEEK(fp, fpos);
chunk_id = get_word(fp); chunk_id = get_word(fp);
chunk_size = get_long(fp); chunk_size = get_long(fp);
chunk_arg = get_word(fp); /*chunk_arg =*/ get_word(fp);
if (chunk_size == -1) //FIXME: THIS SHOULD NOT HAPPEN fpos += 8 + chunk_size;
if (chunk_size == 0xffffffff || fpos > ri->maxpos) //FIXME: THIS SHOULD NOT HAPPEN
break; break;
if(chunk_size > ri->buf_size) if (chunk_size > ri->buf_size)
ri->buf_size = chunk_size; ri->buf_size = chunk_size;
if(rfeof(fp))
break;
#if DBUG > 20 #if DBUG > 20
Con_Printf("%03d 0x%06lx: chunk: 0x%02x size: %ld cells: 2x2=%d,4x4=%d\n", i, Con_Printf("%03d 0x%06lx: chunk: 0x%02x size: %ld cells: 2x2=%d,4x4=%d\n", i,
fpos, chunk_id, chunk_size, v1>>8,v1&0xff); fpos, chunk_id, chunk_size, v1>>8,v1&0xff);
@ -122,10 +120,8 @@ int max_frame;
return 0; //we have all the data we need now. We always find a sound chunk first, or none at all. return 0; //we have all the data we need now. We always find a sound chunk first, or none at all.
#endif #endif
} }
else
{
#ifndef FAST #ifndef FAST
if(chunk_id == RoQ_QUAD_VQ) else if(chunk_id == RoQ_QUAD_VQ)
{ {
ri->num_frames++; ri->num_frames++;
if(ri->num_frames > max_frame) if(ri->num_frames > max_frame)
@ -136,8 +132,9 @@ int max_frame;
} }
ri->frame_offset[ri->num_frames] = fpos; ri->frame_offset[ri->num_frames] = fpos;
} }
}
#endif #endif
if(chunk_id == RoQ_SOUND_MONO || chunk_id == RoQ_SOUND_STEREO) else if(chunk_id == RoQ_SOUND_MONO || chunk_id == RoQ_SOUND_STEREO)
{ {
if(chunk_id == RoQ_SOUND_MONO) if(chunk_id == RoQ_SOUND_MONO)
ri->audio_channels = 1; ri->audio_channels = 1;
@ -147,8 +144,6 @@ int max_frame;
ri->num_audio_bytes += chunk_size; ri->num_audio_bytes += chunk_size;
#endif #endif
} }
VFS_SEEK(fp, VFS_TELL(fp) + chunk_size);
}
} }
return 0; return 0;
@ -403,18 +398,18 @@ unsigned char *tp, *buf;
int frame_stats[2][4] = {{0},{0}}; int frame_stats[2][4] = {{0},{0}};
roq_qcell *qcell; roq_qcell *qcell;
VFS_SEEK(fp, ri->vid_pos); long fpos = ri->vid_pos;
while(!rfeof(fp)) VFS_SEEK(fp, fpos);
while(fpos+8 < ri->maxpos)
{ {
chunk_id = get_word(fp); chunk_id = get_word(fp);
chunk_size = get_long(fp); chunk_size = get_long(fp);
chunk_arg = get_word(fp); chunk_arg = get_word(fp);
if (chunk_size == 0xffffffff) fpos += 8+chunk_size;
if (chunk_size == 0xffffffff || fpos > ri->maxpos)
return -1; return -1;
if(rfeof(fp)) if (chunk_id == RoQ_QUAD_VQ)
break;
if(chunk_id == RoQ_QUAD_VQ)
break; break;
if(chunk_id == RoQ_QUAD_CODEBOOK) if(chunk_id == RoQ_QUAD_CODEBOOK)
{ {
@ -427,12 +422,12 @@ roq_qcell *qcell;
for(j = 0; j < 4; j++) ri->qcells[i].idx[j] = VFS_GETC(fp); for(j = 0; j < 4; j++) ri->qcells[i].idx[j] = VFS_GETC(fp);
} }
else else
VFS_SEEK(fp, VFS_TELL(fp)+chunk_size); VFS_SEEK(fp, fpos);
} }
if(chunk_id != RoQ_QUAD_VQ) if(chunk_id != RoQ_QUAD_VQ)
{ {
ri->vid_pos = VFS_TELL(fp); ri->vid_pos = fpos;
return 0; return 0;
} }
@ -539,7 +534,7 @@ roq_qcell *qcell;
Con_Printf("for 04x04 CCC = %d, FCC = %d, MOT = %d, SLD = %d, PAT = 0\n", frame_stats[1][3], frame_stats[1][1], frame_stats[1][0], frame_stats[1][2]); Con_Printf("for 04x04 CCC = %d, FCC = %d, MOT = %d, SLD = %d, PAT = 0\n", frame_stats[1][3], frame_stats[1][1], frame_stats[1][0], frame_stats[1][2]);
#endif #endif
ri->vid_pos = VFS_TELL(fp); ri->vid_pos = fpos;
if(ri->frame_num == 1) if(ri->frame_num == 1)
{ {
@ -574,23 +569,25 @@ unsigned int chunk_id = 0, chunk_arg = 0;
unsigned long chunk_size = 0; unsigned long chunk_size = 0;
int i, snd_left, snd_right; int i, snd_left, snd_right;
VFS_SEEK(fp, ri->aud_pos); long fpos;
fpos = ri->aud_pos;
ri->audio_size = 0; ri->audio_size = 0;
for(;;) for(;;)
{ {
if(rfeof(fp)) VFS_SEEK(fp, fpos);
if(fpos >= ri->maxpos)
return -1; return -1;
chunk_id = get_word(fp); chunk_id = get_word(fp);
chunk_size = get_long(fp); chunk_size = get_long(fp);
chunk_arg = get_word(fp); chunk_arg = get_word(fp);
if (chunk_size == 0xffffffff) fpos += 8+chunk_size;
return -1; if (chunk_size == 0xffffffff || fpos > ri->maxpos)
if(rfeof(fp))
return -1; return -1;
if (chunk_id == RoQ_SOUND_MONO || chunk_id == RoQ_SOUND_STEREO) if (chunk_id == RoQ_SOUND_MONO || chunk_id == RoQ_SOUND_STEREO)
break; break;
VFS_SEEK(fp, VFS_TELL(fp)+chunk_size);
} }
if(ri->audio_buf_size < chunk_size*2) if(ri->audio_buf_size < chunk_size*2)
@ -614,7 +611,7 @@ int i, snd_left, snd_right;
snd_left += (int)ri->snd_sqr_arr[(unsigned)VFS_GETC(fp)]; snd_left += (int)ri->snd_sqr_arr[(unsigned)VFS_GETC(fp)];
*(short *)&ri->audio[i * 2] = snd_left; *(short *)&ri->audio[i * 2] = snd_left;
} }
ri->aud_pos = VFS_TELL(fp); ri->aud_pos = fpos;
return chunk_size; return chunk_size;
} }
@ -630,13 +627,12 @@ int i, snd_left, snd_right;
*(short *)&ri->audio[i * 2] = snd_left; *(short *)&ri->audio[i * 2] = snd_left;
*(short *)&ri->audio[i * 2 + 2] = snd_right; *(short *)&ri->audio[i * 2 + 2] = snd_right;
} }
ri->aud_pos = VFS_TELL(fp); ri->aud_pos = fpos;
return chunk_size; return chunk_size;
} }
ri->aud_pos = VFS_TELL(fp); ri->aud_pos = fpos;
return 0; return 0;
} }
#undef rfeof
#endif #endif

View file

@ -2782,7 +2782,7 @@ enum
void Sbar_DeathmatchOverlay (int start) void Sbar_DeathmatchOverlay (int start)
{ {
mpic_t *pic; mpic_t *pic;
int i, k, l; int i, k;
int x, y, f; int x, y, f;
char num[12]; char num[12];
player_info_t *s; player_info_t *s;
@ -2831,8 +2831,6 @@ void Sbar_DeathmatchOverlay (int start)
Sbar_SortFrags(true, true); Sbar_SortFrags(true, true);
// draw the text // draw the text
l = scoreboardlines;
if (start) if (start)
y = start; y = start;
else else

View file

@ -282,11 +282,13 @@ static int ALSA_InitCard (soundcardinfo_t *sc, int cardnum)
cvar_t *devname; cvar_t *devname;
int err; int err;
int bps, stereo;
unsigned int rate;
snd_pcm_hw_params_t *hw; snd_pcm_hw_params_t *hw;
snd_pcm_sw_params_t *sw; snd_pcm_sw_params_t *sw;
#if 0
int bps, stereo;
unsigned int rate;
snd_pcm_uframes_t frag_size; snd_pcm_uframes_t frag_size;
#endif
qboolean mmap = false; qboolean mmap = false;
if (!Alsa_InitAlsa()) if (!Alsa_InitAlsa())

View file

@ -1443,7 +1443,6 @@ void SND_Spatialize(soundcardinfo_t *sc, channel_t *ch)
vec_t dist; vec_t dist;
vec_t scale; vec_t scale;
vec3_t world_vec; vec3_t world_vec;
sfx_t *snd;
int i; int i;
// anything coming from the view entity will always be full volume // anything coming from the view entity will always be full volume
@ -1457,7 +1456,6 @@ void SND_Spatialize(soundcardinfo_t *sc, channel_t *ch)
} }
// calculate stereo seperation and distance attenuation // calculate stereo seperation and distance attenuation
snd = ch->sfx;
VectorSubtract(ch->origin, listener_origin, world_vec); VectorSubtract(ch->origin, listener_origin, world_vec);
dist = VectorNormalize(world_vec) * ch->dist_mult; dist = VectorNormalize(world_vec) * ch->dist_mult;
@ -2325,7 +2323,6 @@ void S_RawAudio(int sourceid, qbyte *data, int speed, int samples, int channels,
soundcardinfo_t *si; soundcardinfo_t *si;
int i; int i;
int prepadl; int prepadl;
int oldlength;
int spare; int spare;
int outsamples; int outsamples;
double speedfactor; double speedfactor;
@ -2396,8 +2393,6 @@ void S_RawAudio(int sourceid, qbyte *data, int speed, int samples, int channels,
speedfactor = (double)speed/snd_speed; speedfactor = (double)speed/snd_speed;
outsamples = samples/speedfactor; outsamples = samples/speedfactor;
oldlength = s->length;
prepadl = 0x7fffffff; prepadl = 0x7fffffff;
for (si = sndcardinfo; si; si=si->next) //make sure all cards are playing, and that we still get a prepad if just one is. for (si = sndcardinfo; si; si=si->next) //make sure all cards are playing, and that we still get a prepad if just one is.
{ {

View file

@ -80,14 +80,11 @@ qboolean OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuf
qboolean S_LoadOVSound (sfx_t *s, qbyte *data, int datalen, int sndspeed) qboolean S_LoadOVSound (sfx_t *s, qbyte *data, int datalen, int sndspeed)
{ {
char *name;
ovdecoderbuffer_t *buffer; ovdecoderbuffer_t *buffer;
if (datalen < 4 || strncmp(data, "OggS", 4)) if (datalen < 4 || strncmp(data, "OggS", 4))
return false; return false;
name = s->name;
buffer = Z_Malloc(sizeof(ovdecoderbuffer_t)); buffer = Z_Malloc(sizeof(ovdecoderbuffer_t));
buffer->decodedbytestart = 0; buffer->decodedbytestart = 0;

View file

@ -65,6 +65,7 @@ int sys_parentwidth;
int sys_parentheight; int sys_parentheight;
long sys_parentwindow; long sys_parentwindow;
qboolean X11_GetDesktopParameters(int *width, int *height, int *bpp, int *refreshrate);
char *basedir = "."; char *basedir = ".";
@ -511,11 +512,10 @@ void *Sys_GetGameAPI(void *parms)
char *searchpath; char *searchpath;
const char *agamename = "gamei386.so"; const char *agamename = "gamei386.so";
const char *ggamename = "game.so"; const char *ggamename = "game.so";
char *result;
void *ret; void *ret;
result = getcwd(curpath, sizeof(curpath)); // do something with result? getcwd(curpath, sizeof(curpath)); // do something with result?
#ifdef warningmsg #ifdef warningmsg
#pragma warningmsg("Search for both gamei386.so and game.so") #pragma warningmsg("Search for both gamei386.so and game.so")

View file

@ -15,6 +15,10 @@
#include <direct.h> #include <direct.h>
#endif #endif
#ifdef FTE_TARGET_WEB
#include <emscripten/emscripten.h>
#endif
#ifndef isDedicated #ifndef isDedicated
qboolean isDedicated; qboolean isDedicated;
#endif #endif
@ -363,15 +367,13 @@ void *Sys_GetGameAPI (void *parms)
Con_DPrintf("Searching for %s\n", gamename); Con_DPrintf("Searching for %s\n", gamename);
getcwd(curpath, sizeof(curpath));
searchpath = 0; searchpath = 0;
while((searchpath = COM_NextPath(searchpath))) while((searchpath = COM_NextPath(searchpath)))
{ {
if (searchpath[0] == '/') if (searchpath[0] == '/')
snprintf(name, sizeof(name), "%s/%s", searchpath, gamename); snprintf(name, sizeof(name), "%s/%s", searchpath, gamename);
else else
snprintf(name, sizeof(name), "%s/%s/%s", curpath, searchpath, gamename); snprintf(name, sizeof(name), "./%s/%s", searchpath, gamename);
q2gamedll = Sys_LoadLibrary(name, funcs); q2gamedll = Sys_LoadLibrary(name, funcs);
if (q2gamedll && gamename) if (q2gamedll && gamename)

View file

@ -1427,14 +1427,10 @@ void V_RenderPlayerViews(int plnum)
} }
if (e) if (e)
{ {
float s;
memcpy(r_refdef.viewangles, e->angles, sizeof(vec3_t)); memcpy(r_refdef.viewangles, e->angles, sizeof(vec3_t));
memcpy(r_refdef.vieworg, e->origin, sizeof(vec3_t)); memcpy(r_refdef.vieworg, e->origin, sizeof(vec3_t));
// cl.viewentity = cl.viewentity2; // cl.viewentity = cl.viewentity2;
// s = (realtime - e->lerptime)*10;
// if (s > 1) s=1;
s=0;
r_refdef.vieworg[0]=r_refdef.vieworg[0];//*s+(1-s)*e->lerporigin[0]; r_refdef.vieworg[0]=r_refdef.vieworg[0];//*s+(1-s)*e->lerporigin[0];
r_refdef.vieworg[1]=r_refdef.vieworg[1];//*s+(1-s)*e->lerporigin[1]; r_refdef.vieworg[1]=r_refdef.vieworg[1];//*s+(1-s)*e->lerporigin[1];
r_refdef.vieworg[2]=r_refdef.vieworg[2];//*s+(1-s)*e->lerporigin[2]; r_refdef.vieworg[2]=r_refdef.vieworg[2];//*s+(1-s)*e->lerporigin[2];

View file

@ -1103,7 +1103,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
char *fixup = NULL, fixval=0; char *fixup = NULL, fixval=0;
cvar_t *var; cvar_t *var;
static char temp[12]; static char temp[12];
size_t result; unsigned int result;
namestart = cvarname; namestart = cvarname;
if (*cvarname == '{') if (*cvarname == '{')
@ -1121,11 +1121,10 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
fixval = *fixup; fixval = *fixup;
} }
result = strtol(cvarname, &end, 10); // do something with result result = strtoul(cvarname, &end, 10);
if (fixval && *end == 0) //only expand $0 if its actually ${0} - this avoids conflicting with the $0 macro
if (fixval && *end == '\0') //only expand $0 if its actually ${0} - this avoids conflicting with the $0 macro
{ //purely numerical { //purely numerical
ret = Cmd_Argv(atoi(cvarname)); ret = Cmd_Argv(result);
} }
else if (!strcmp(cvarname, "*") || !stricmp(cvarname, "cmd_args")) else if (!strcmp(cvarname, "*") || !stricmp(cvarname, "cmd_args"))
{ {

View file

@ -791,7 +791,6 @@ int Alias_GetBoneRelations(galiasinfo_t *inf, framestate_t *fstate, float *resul
#ifdef SKELETALMODELS #ifdef SKELETALMODELS
if (inf->numbones) if (inf->numbones)
{ {
galiasbone_t *bone;
galiasgroup_t *g1, *g2; galiasgroup_t *g1, *g2;
float *matrix; //the matrix for a single bone in a single pose. float *matrix; //the matrix for a single bone in a single pose.
@ -858,7 +857,6 @@ int Alias_GetBoneRelations(galiasinfo_t *inf, framestate_t *fstate, float *resul
} }
} }
bone = (galiasbone_t*)((char*)inf + inf->ofsbones);
//the higher level merges old/new anims, but we still need to blend between automated frame-groups. //the higher level merges old/new anims, but we still need to blend between automated frame-groups.
g1 = (galiasgroup_t*)((char *)inf + inf->groupofs + sizeof(galiasgroup_t)*frame1); g1 = (galiasgroup_t*)((char *)inf + inf->groupofs + sizeof(galiasgroup_t)*frame1);
g2 = (galiasgroup_t*)((char *)inf + inf->groupofs + sizeof(galiasgroup_t)*frame2); g2 = (galiasgroup_t*)((char *)inf + inf->groupofs + sizeof(galiasgroup_t)*frame2);
@ -1288,12 +1286,11 @@ static void R_LerpFrames(mesh_t *mesh, galiaspose_t *p1, galiaspose_t *p2, float
p1t = (vec3_t *)((char *)p1 + p1->ofstvector); p1t = (vec3_t *)((char *)p1 + p1->ofstvector);
p2t = (vec3_t *)((char *)p2 + p2->ofstvector); p2t = (vec3_t *)((char *)p2 + p2->ofstvector);
mesh->normals_array = p1n; mesh->snormals_array = blerp>0.5?p2s:p1s; //never lerp
mesh->snormals_array = p1s; mesh->tnormals_array = blerp>0.5?p2t:p1t; //never lerp
mesh->tnormals_array = p1t; mesh->colors4f_array = NULL; //not generated
mesh->colors4f_array = NULL;
if (p1v == p2v || r_nolerp.value) if (p1v == p2v || r_nolerp.value || !blerp)
{ {
mesh->normals_array = p1n; mesh->normals_array = p1n;
mesh->snormals_array = p1s; mesh->snormals_array = p1s;
@ -1463,7 +1460,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
int frame2; int frame2;
float lerp; float lerp;
float fg1time; float fg1time;
float fg2time; // float fg2time;
if (!inf->groups) if (!inf->groups)
{ {
@ -1618,7 +1615,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
frame2 = e->framestate.g[FS_REG].frame[1]; frame2 = e->framestate.g[FS_REG].frame[1];
lerp = e->framestate.g[FS_REG].lerpfrac; lerp = e->framestate.g[FS_REG].lerpfrac;
fg1time = e->framestate.g[FS_REG].frametime[0]; fg1time = e->framestate.g[FS_REG].frametime[0];
fg2time = e->framestate.g[FS_REG].frametime[1]; //fg2time = e->framestate.g[FS_REG].frametime[1];
if (frame1 < 0) if (frame1 < 0)
{ {
@ -3714,13 +3711,13 @@ qboolean Mod_GetTag(model_t *model, int tagnum, framestate_t *fstate, float *res
md3tag_t *t1, *t2; md3tag_t *t1, *t2;
int frame1, frame2; int frame1, frame2;
float f1time, f2time; //float f1time, f2time; //tags/md3s don't support framegroups.
float f2ness; float f2ness;
frame1 = fstate->g[FS_REG].frame[0]; frame1 = fstate->g[FS_REG].frame[0];
frame2 = fstate->g[FS_REG].frame[1]; frame2 = fstate->g[FS_REG].frame[1];
f1time = fstate->g[FS_REG].frametime[0]; //f1time = fstate->g[FS_REG].frametime[0];
f2time = fstate->g[FS_REG].frametime[1]; //f2time = fstate->g[FS_REG].frametime[1];
f2ness = fstate->g[FS_REG].lerpfrac; f2ness = fstate->g[FS_REG].lerpfrac;
if (tagnum <= 0 || tagnum > inf->numtags) if (tagnum <= 0 || tagnum > inf->numtags)

View file

@ -1678,7 +1678,6 @@ static qboolean GenerateCollisionMesh(world_t *world, model_t *mod, wedict_t *ed
mesh_t *mesh; mesh_t *mesh;
unsigned int numverts; unsigned int numverts;
unsigned int numindexes,i; unsigned int numindexes,i;
unsigned int ni;
numverts = 0; numverts = 0;
numindexes = 0; numindexes = 0;
@ -1708,8 +1707,6 @@ static qboolean GenerateCollisionMesh(world_t *world, model_t *mod, wedict_t *ed
ed->ode.ode_element3i = BZ_Malloc(numindexes*sizeof(*ed->ode.ode_element3i)); ed->ode.ode_element3i = BZ_Malloc(numindexes*sizeof(*ed->ode.ode_element3i));
ed->ode.ode_vertex3f = BZ_Malloc(numverts*sizeof(vec3_t)); ed->ode.ode_vertex3f = BZ_Malloc(numverts*sizeof(vec3_t));
ni = numindexes;
numverts = 0; numverts = 0;
numindexes = 0; numindexes = 0;
for (sno = 0; sno < mod->nummodelsurfaces; sno++) for (sno = 0; sno < mod->nummodelsurfaces; sno++)

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
#include <wctype.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>

View file

@ -355,6 +355,7 @@ char *FS_WhichPackForLocation(flocation_t *loc);
qboolean FS_GetPackageDownloadable(const char *package); qboolean FS_GetPackageDownloadable(const char *package);
char *FS_GetPackHashes(char *buffer, int buffersize, qboolean referencedonly); char *FS_GetPackHashes(char *buffer, int buffersize, qboolean referencedonly);
char *FS_GetPackNames(char *buffer, int buffersize, int referencedonly, qboolean ext); char *FS_GetPackNames(char *buffer, int buffersize, int referencedonly, qboolean ext);
void FS_GenCachedPakName(char *pname, char *crc, char *local, int llen);
void FS_ReferenceControl(unsigned int refflag, unsigned int resetflags); void FS_ReferenceControl(unsigned int refflag, unsigned int resetflags);
FTE_DEPRECATED int COM_FOpenFile (const char *filename, FILE **file); FTE_DEPRECATED int COM_FOpenFile (const char *filename, FILE **file);

View file

@ -1382,7 +1382,7 @@ typedef struct {
const char *puredesc; const char *puredesc;
} wildpaks_t; } wildpaks_t;
static int QDECL FS_AddWildDataFiles (const char *descriptor, int size, void *vparam, struct searchpath_s *path) static int QDECL FS_AddWildDataFiles (const char *descriptor, int size, void *vparam, void *path)
{ {
wildpaks_t *param = vparam; wildpaks_t *param = vparam;
vfsfile_t *vfs; vfsfile_t *vfs;
@ -1611,7 +1611,7 @@ char *COM_NextPath (char *prevpath)
return NULL; return NULL;
} }
#ifndef CLIENTONLY #if 0//ndef CLIENTONLY
char *COM_GetPathInfo (int i, int *crc) char *COM_GetPathInfo (int i, int *crc)
{ {
//#ifdef WEBSERVER //#ifdef WEBSERVER
@ -1703,7 +1703,6 @@ void COM_Gamedir (const char *dir)
{ {
char thispath[64]; char thispath[64];
searchpath_t *next; searchpath_t *next;
int dlen;
qboolean isbase; qboolean isbase;
if (!*dir || !strcmp(dir, ".") || strstr(dir, "..") || strstr(dir, "/") if (!*dir || !strcmp(dir, ".") || strstr(dir, "..") || strstr(dir, "/")
@ -1714,7 +1713,6 @@ void COM_Gamedir (const char *dir)
} }
isbase = false; isbase = false;
dlen = strlen(dir);
for (next = com_searchpaths; next; next = next->next) for (next = com_searchpaths; next; next = next->next)
{ {
if (next == com_base_searchpaths) if (next == com_base_searchpaths)
@ -1992,7 +1990,6 @@ void FS_ImpurePacks(const char *names, const char *crcs)
{ {
char local[MAX_OSPATH]; char local[MAX_OSPATH];
vfsfile_t *vfs; vfsfile_t *vfs;
char *ext = COM_FileExtension(pname);
FS_GenCachedPakName(pname, va("%i", crc), local, sizeof(local)); FS_GenCachedPakName(pname, va("%i", crc), local, sizeof(local));
vfs = FS_OpenVFS(local, "rb", FS_ROOT); vfs = FS_OpenVFS(local, "rb", FS_ROOT);

View file

@ -90,7 +90,7 @@ void QDECL FSPAK_BuildHash(void *handle, int depth, void (QDECL *AddFileHash)(in
qboolean QDECL FSPAK_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult) qboolean QDECL FSPAK_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult)
{ {
mpackfile_t *pf = hashedresult; mpackfile_t *pf = hashedresult;
int i, len; int i;
pack_t *pak = handle; pack_t *pak = handle;
// look through all the pak file elements // look through all the pak file elements
@ -114,7 +114,6 @@ qboolean QDECL FSPAK_FLocate(void *handle, flocation_t *loc, const char *filenam
if (pf) if (pf)
{ {
len = pf->filelen;
if (loc) if (loc)
{ {
loc->index = pf - pak->files; loc->index = pf - pak->files;
@ -199,8 +198,8 @@ void *QDECL FSPAK_LoadPackFile (vfsfile_t *file, const char *desc)
if (packhandle == NULL) if (packhandle == NULL)
return NULL; return NULL;
VFS_READ(packhandle, &header, sizeof(header)); read = VFS_READ(packhandle, &header, sizeof(header));
if (header.id[0] != 'P' || header.id[1] != 'A' if (read < sizeof(header) || header.id[0] != 'P' || header.id[1] != 'A'
|| header.id[2] != 'C' || header.id[3] != 'K') || header.id[2] != 'C' || header.id[3] != 'K')
{ {
Con_Printf("%s is not a pak - %c%c%c%c\n", desc, header.id[0], header.id[1], header.id[2], header.id[3]); Con_Printf("%s is not a pak - %c%c%c%c\n", desc, header.id[0], header.id[1], header.id[2], header.id[3]);
@ -234,6 +233,12 @@ void *QDECL FSPAK_LoadPackFile (vfsfile_t *file, const char *desc)
{ {
*info.name = '\0'; *info.name = '\0';
read = VFS_READ(packhandle, &info, sizeof(info)); read = VFS_READ(packhandle, &info, sizeof(info));
if (read != sizeof(info))
{
Con_Printf("PAK file table truncated, only found %i files out of %i\n", i, numpackfiles);
numpackfiles = i;
break;
}
/* /*
for (j=0 ; j<sizeof(info) ; j++) for (j=0 ; j<sizeof(info) ; j++)
CRC_ProcessByte(&crc, ((qbyte *)&info)[j]); CRC_ProcessByte(&crc, ((qbyte *)&info)[j]);

View file

@ -273,7 +273,7 @@ static void QDECL FSZIP_BuildHash(void *handle, int depth, void (QDECL *AddFileH
static qboolean QDECL FSZIP_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult) static qboolean QDECL FSZIP_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult)
{ {
zpackfile_t *pf = hashedresult; zpackfile_t *pf = hashedresult;
int i, len; int i;
zipfile_t *zip = handle; zipfile_t *zip = handle;
// look through all the pak file elements // look through all the pak file elements
@ -297,7 +297,6 @@ static qboolean QDECL FSZIP_FLocate(void *handle, flocation_t *loc, const char *
if (pf) if (pf)
{ {
len = pf->filelen;
if (loc) if (loc)
{ {
loc->index = pf - zip->files; loc->index = pf - zip->files;

View file

@ -635,7 +635,7 @@ static void SnapPlane( vec3_t normal, vec_t *dist )
*/ */
static int CM_CreateFacetFromPoints(q2cbrush_t *facet, vec3_t *verts, int numverts, q2mapsurface_t *shaderref, mplane_t *brushplanes ) static int CM_CreateFacetFromPoints(q2cbrush_t *facet, vec3_t *verts, int numverts, q2mapsurface_t *shaderref, mplane_t *brushplanes )
{ {
int i, j, k; int i, j;
int axis, dir; int axis, dir;
vec3_t normal, mins, maxs; vec3_t normal, mins, maxs;
float d, dist; float d, dist;
@ -721,7 +721,7 @@ static int CM_CreateFacetFromPoints(q2cbrush_t *facet, vec3_t *verts, int numver
for( i = 0; i < numverts; i++ ) for( i = 0; i < numverts; i++ )
{ {
j = ( i + 1 ) % numverts; j = ( i + 1 ) % numverts;
k = ( i + 2 ) % numverts; // k = ( i + 2 ) % numverts;
VectorSubtract( verts[i], verts[j], vec ); VectorSubtract( verts[i], verts[j], vec );
if( VectorNormalize( vec ) < 0.5 ) if( VectorNormalize( vec ) < 0.5 )

View file

@ -26,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef HUFFNETWORK #ifdef HUFFNETWORK
#define ID_INLINE #define ID_INLINE
#define VALUE(a) (*(int *)&(a)) #define VALUE(a) (*(size_t *)&(a))
#define NODE(a) ((void*)(a)) #define NODE(a) ((void*)((size_t)a))
#define NODE_START NODE( 1) #define NODE_START NODE( 1)
#define NODE_NONE NODE(256) #define NODE_NONE NODE(256)

View file

@ -439,7 +439,7 @@ nqprot_t NQNetChan_Process(netchan_t *chan)
drop = sequence - chan->incoming_unreliable - 1; drop = sequence - chan->incoming_unreliable - 1;
if (drop > 0) if (drop > 0)
{ {
Con_DPrintf("Dropped %i datagrams (%i - %i)\n", chan->incoming_unreliable+1, sequence-1); Con_DPrintf("Dropped %i datagrams (%i - %i)\n", drop, chan->incoming_unreliable+1, sequence-1);
chan->drop_count += drop; chan->drop_count += drop;
} }
chan->incoming_unreliable = sequence; chan->incoming_unreliable = sequence;
@ -778,9 +778,6 @@ qboolean Netchan_Process (netchan_t *chan)
unsigned sequence, sequence_ack; unsigned sequence, sequence_ack;
unsigned reliable_ack, reliable_message; unsigned reliable_ack, reliable_message;
char adr[MAX_ADR_SIZE]; char adr[MAX_ADR_SIZE];
#ifndef CLIENTONLY
int qport;
#endif
int offset; int offset;
if ( if (
@ -797,10 +794,10 @@ qboolean Netchan_Process (netchan_t *chan)
sequence = MSG_ReadLong (); sequence = MSG_ReadLong ();
sequence_ack = MSG_ReadLong (); sequence_ack = MSG_ReadLong ();
// read the qport if we are a server // skip over the qport if we are a server (its handled elsewhere)
#ifndef CLIENTONLY #ifndef CLIENTONLY
if (chan->sock == NS_SERVER) if (chan->sock == NS_SERVER)
qport = MSG_ReadShort (); MSG_ReadShort ();
#endif #endif
if (chan->fragmentsize) if (chan->fragmentsize)

View file

@ -763,7 +763,11 @@ qboolean NET_StringToSockaddr (const char *s, int defaultport, struct sockaddr_q
else else
#endif #endif
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
#ifdef pgetaddrinfo
if (1)
#else
if (pgetaddrinfo) if (pgetaddrinfo)
#endif
{ {
struct addrinfo *addrinfo = NULL; struct addrinfo *addrinfo = NULL;
struct addrinfo *pos; struct addrinfo *pos;
@ -1120,6 +1124,7 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
case NA_LOOPBACK: case NA_LOOPBACK:
break; break;
// warning: enumeration value âNA_*â not handled in switch // warning: enumeration value âNA_*â not handled in switch
case NA_NATPMP:
case NA_WEBSOCKET: case NA_WEBSOCKET:
case NA_TCP: case NA_TCP:
case NA_TCPV6: case NA_TCPV6:
@ -1649,8 +1654,12 @@ static ftenet_generic_connection_t *FTENET_UDP4_EstablishConnection(qboolean iss
static ftenet_generic_connection_t *FTENET_UDP6_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_UDP6_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_TCP4Connect_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_TCP4Connect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_TCP6Connect_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_TCP6Connect_EstablishConnection(qboolean isserver, const char *address);
#ifdef USEIPX
static ftenet_generic_connection_t *FTENET_IPX_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_IPX_EstablishConnection(qboolean isserver, const char *address);
#endif
#ifdef HAVE_WEBSOCKCL
static ftenet_generic_connection_t *FTENET_WebSocket_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_WebSocket_EstablishConnection(qboolean isserver, const char *address);
#endif
static ftenet_generic_connection_t *FTENET_IRCConnect_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_IRCConnect_EstablishConnection(qboolean isserver, const char *address);
static ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver, const char *address); static ftenet_generic_connection_t *FTENET_NATPMP_EstablishConnection(qboolean isserver, const char *address);
@ -2017,8 +2026,10 @@ int FTENET_Generic_GetLocalAddress(ftenet_generic_connection_t *con, netadr_t *o
struct sockaddr_qstorage from; struct sockaddr_qstorage from;
int fromsize = sizeof(from); int fromsize = sizeof(from);
netadr_t adr; netadr_t adr;
#ifdef USE_GETHOSTNAME_LOCALLISTING
char adrs[MAX_ADR_SIZE]; char adrs[MAX_ADR_SIZE];
int b; int b;
#endif
int idx = 0; int idx = 0;
if (getsockname (con->thesocket, (struct sockaddr*)&from, &fromsize) != -1) if (getsockname (con->thesocket, (struct sockaddr*)&from, &fromsize) != -1)
@ -2370,9 +2381,9 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i
{ {
if (0 == setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&_false, sizeof(_false))) if (0 == setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&_false, sizeof(_false)))
{ {
int ip = ((struct sockaddr_in*)&qs)->sin_addr.s_addr; // int ip = ((struct sockaddr_in*)&qs)->sin_addr.s_addr;
int port = ((struct sockaddr_in*)&qs)->sin_port; int port = ((struct sockaddr_in*)&qs)->sin_port;
ip = ((struct sockaddr_in*)&qs)->sin_addr.s_addr; // ip = ((struct sockaddr_in*)&qs)->sin_addr.s_addr;
memset(&qs, 0, sizeof(struct sockaddr_in6)); memset(&qs, 0, sizeof(struct sockaddr_in6));
((struct sockaddr_in6*)&qs)->sin6_family = AF_INET6; ((struct sockaddr_in6*)&qs)->sin6_family = AF_INET6;
/* /*
@ -2783,7 +2794,7 @@ closesvstream:
{ {
if (atoi(arg[WCATTR_WSVER]) != 13) if (atoi(arg[WCATTR_WSVER]) != 13)
{ {
Con_Printf("Outdated websocket request from %s. got version %i, expected version 13\n", arg[WCATTR_URL], NET_AdrToString (adr, sizeof(adr), &st->remoteaddr), arg[WCATTR_WSVER]); Con_Printf("Outdated websocket request for \"%s\" from \"%s\". got version %i, expected version 13\n", arg[WCATTR_URL], NET_AdrToString (adr, sizeof(adr), &st->remoteaddr), atoi(arg[WCATTR_WSVER]));
memmove(st->inbuffer, st->inbuffer+i, st->inlen - (i)); memmove(st->inbuffer, st->inbuffer+i, st->inlen - (i));
st->inlen -= i; st->inlen -= i;
@ -5138,7 +5149,6 @@ void SVNET_RegisterCvars(void)
p = COM_CheckParm ("-svport"); p = COM_CheckParm ("-svport");
if (p && p < com_argc) if (p && p < com_argc)
{ {
extern cvar_t sv_port_ipv4, sv_port_ipv6, sv_port_ipx;
int port = atoi(com_argv[p+1]); int port = atoi(com_argv[p+1]);
if (!port) if (!port)
port = PORT_QWSERVER; port = PORT_QWSERVER;
@ -5167,16 +5177,13 @@ void NET_CloseServer(void)
void NET_InitServer(void) void NET_InitServer(void)
{ {
char *port;
port = STRINGIFY(PORT_QWSERVER);
if (sv_listen_nq.value || sv_listen_dp.value || sv_listen_qw.value || sv_listen_q3.value) if (sv_listen_nq.value || sv_listen_dp.value || sv_listen_qw.value || sv_listen_q3.value)
{ {
if (!svs.sockets) if (!svs.sockets)
{ {
svs.sockets = FTENET_CreateCollection(true); svs.sockets = FTENET_CreateCollection(true);
#ifndef SERVERONLY #ifndef SERVERONLY
FTENET_AddToCollection(svs.sockets, "SVLoopback", port, NA_LOOPBACK, true); FTENET_AddToCollection(svs.sockets, "SVLoopback", STRINGIFY(PORT_QWSERVER), NA_LOOPBACK, true);
#endif #endif
} }
@ -5207,7 +5214,7 @@ void NET_InitServer(void)
#ifndef SERVERONLY #ifndef SERVERONLY
svs.sockets = FTENET_CreateCollection(true); svs.sockets = FTENET_CreateCollection(true);
FTENET_AddToCollection(svs.sockets, "SVLoopback", port, NA_LOOPBACK, true); FTENET_AddToCollection(svs.sockets, "SVLoopback", STRINGIFY(PORT_QWSERVER), NA_LOOPBACK, true);
#endif #endif
} }
@ -5285,7 +5292,7 @@ int QDECL VFSTCP_ReadBytes (struct vfsfile_s *file, void *buffer, int bytestorea
switch(e) switch(e)
{ {
case ECONNABORTED: case ECONNABORTED:
Sys_Printf("conenction aborted\n", e); Sys_Printf("conenction aborted\n");
break; break;
default: default:
Sys_Printf("socket error %i\n", e); Sys_Printf("socket error %i\n", e);

View file

@ -348,7 +348,7 @@ plugin_t *Plug_Load(char *file)
return newplug; return newplug;
} }
static int QDECL Plug_Emumerated (const char *name, int size, void *param, struct searchpath_s *spath) static int QDECL Plug_Emumerated (const char *name, int size, void *param, void *spath)
{ {
char vmname[MAX_QPATH]; char vmname[MAX_QPATH];
Q_strncpyz(vmname, name, sizeof(vmname)); Q_strncpyz(vmname, name, sizeof(vmname));
@ -358,7 +358,7 @@ static int QDECL Plug_Emumerated (const char *name, int size, void *param, struc
return true; return true;
} }
static int QDECL Plug_EnumeratedRoot (const char *name, int size, void *param, struct searchpath_s *spath) static int QDECL Plug_EnumeratedRoot (const char *name, int size, void *param, void *spath)
{ {
char vmname[MAX_QPATH]; char vmname[MAX_QPATH];
int len; int len;
@ -560,7 +560,7 @@ static qintptr_t VARGS Plug_Cvar_Register(void *offset, quintptr_t mask, const q
static qintptr_t VARGS Plug_Cvar_Update(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_Update(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
int handle; int handle;
int modcount; // int modcount;
char *stringv; //255 bytes long. char *stringv; //255 bytes long.
float *floatv; float *floatv;
cvar_t *var; cvar_t *var;
@ -573,16 +573,17 @@ static qintptr_t VARGS Plug_Cvar_Update(void *offset, quintptr_t mask, const qin
if (VM_OOB(arg[2], 256) || VM_OOB(arg[3], 4)) //Oi, plugin - you screwed up if (VM_OOB(arg[2], 256) || VM_OOB(arg[3], 4)) //Oi, plugin - you screwed up
return 0; return 0;
modcount = VM_LONG(arg[1]); //modcount = VM_LONG(arg[1]); //for future optimisation
stringv = VM_POINTER(arg[2]); stringv = VM_POINTER(arg[2]);
floatv = VM_POINTER(arg[3]); floatv = VM_POINTER(arg[3]);
var = plugincvararray[handle].var; var = plugincvararray[handle].var;
//if (var->modified != modcount) //for future optimisation
{
strcpy(stringv, var->string); strcpy(stringv, var->string);
*floatv = var->value; *floatv = var->value;
}
return var->modified; return var->modified;
} }

View file

@ -260,14 +260,13 @@ void QCBUILTIN PF_getsurfacepoint(pubprogfuncs_t *prinst, struct globalvars_s *p
// #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE) // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE)
void QCBUILTIN PF_getsurfacenormal(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_getsurfacenormal(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
unsigned int surfnum, pointnum; unsigned int surfnum;
model_t *model; model_t *model;
wedict_t *ent; wedict_t *ent;
world_t *w = prinst->parms->user; world_t *w = prinst->parms->user;
ent = G_WEDICT(prinst, OFS_PARM0); ent = G_WEDICT(prinst, OFS_PARM0);
surfnum = G_FLOAT(OFS_PARM1); surfnum = G_FLOAT(OFS_PARM1);
pointnum = G_FLOAT(OFS_PARM2);
model = w->Get_CModel(w, ent->v->modelindex); model = w->Get_CModel(w, ent->v->modelindex);
@ -1111,7 +1110,6 @@ static void PF_hash_destroytab_enum(void *ctx, void *ent)
void QCBUILTIN PF_hash_destroytab (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_hash_destroytab (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int tab = G_FLOAT(OFS_PARM0) - FIRST_QC_HASHTABLE_INDEX; int tab = G_FLOAT(OFS_PARM0) - FIRST_QC_HASHTABLE_INDEX;
pf_hashentry_t *ent = NULL;
if (tab >= 0 && tab < MAX_QC_HASHTABLES && pf_hashtab[tab].prinst) if (tab >= 0 && tab < MAX_QC_HASHTABLES && pf_hashtab[tab].prinst)
{ {
pf_hashtab[tab].prinst = NULL; pf_hashtab[tab].prinst = NULL;
@ -1588,7 +1586,7 @@ void search_close_progs(pubprogfuncs_t *prinst, qboolean complain)
prvm_nextsearchhandle = 0; //might as well. prvm_nextsearchhandle = 0; //might as well.
} }
int QDECL search_enumerate(const char *name, int fsize, void *parm, struct searchpath_s *spath) int QDECL search_enumerate(const char *name, int fsize, void *parm, void *spath)
{ {
prvmsearch_t *s = parm; prvmsearch_t *s = parm;
@ -3534,10 +3532,10 @@ void QCBUILTIN PF_Abort(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
//used for entity function variables - not actually needed anymore //used for entity function variables - not actually needed anymore
void QCBUILTIN PF_externrefcall (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_externrefcall (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int progsnum; // int progsnum;
func_t f; func_t f;
int i; int i;
progsnum = G_PROG(OFS_PARM0); // progsnum = G_PROG(OFS_PARM0);
f = G_INT(OFS_PARM1); f = G_INT(OFS_PARM1);
for (i = OFS_PARM0; i < OFS_PARM5; i+=3) for (i = OFS_PARM0; i < OFS_PARM5; i+=3)

View file

@ -345,7 +345,10 @@ enum clcq2_ops_e
clcq2_nop, clcq2_nop,
clcq2_move, // [[usercmd_t] clcq2_move, // [[usercmd_t]
clcq2_userinfo, // [[userinfo string] clcq2_userinfo, // [[userinfo string]
clcq2_stringcmd // [string] message clcq2_stringcmd, // [string] message
//fte-extended
clcq2_voicechat
}; };

View file

@ -414,13 +414,14 @@ MSG_WriteHuffBits
*/ */
static void MSG_WriteHuffBits( sizebuf_t *msg, int value, int bits ) static void MSG_WriteHuffBits( sizebuf_t *msg, int value, int bits )
{ {
int startbits; #ifdef MSG_PROFILING
int startbits = msg->currentbit;
#endif
int remaining; int remaining;
int i; int i;
value &= 0xFFFFFFFFU >> (32 - bits); value &= 0xFFFFFFFFU >> (32 - bits);
remaining = bits & 7; remaining = bits & 7;
startbits = msg->currentbit;
for( i=0; i<remaining ; i++ ) for( i=0; i<remaining ; i++ )
{ {

View file

@ -629,7 +629,7 @@ int QVM_ExecVM(register qvm_t *qvm, int command, int arg0, int arg1, int arg2, i
break; break;
default: default:
case OP_BREAK: // break to debugger case OP_BREAK: // break to debugger
*(int*)NULL=-1; Sys_Error("VM hit an OP_BREAK opcode");
break; break;
// subroutines // subroutines

View file

@ -1217,9 +1217,6 @@ static int hunk_size;
static int hunk_low_used; static int hunk_low_used;
static int hunk_high_used; static int hunk_high_used;
static qboolean hunk_tempactive;
static int hunk_tempmark;
void R_FreeTextures (void); void R_FreeTextures (void);
/* /*
@ -1324,9 +1321,9 @@ void Hunk_Print (qboolean all)
for (i = 0; i < HUNKDEBUG; i++) for (i = 0; i < HUNKDEBUG; i++)
{ {
if (present[i] != sentinalkey) if (present[i] != sentinalkey)
*(int*)0 = -3; Sys_Error ("Hunk_Check: corrupt sentinal");
if (postsent[i] != sentinalkey) if (postsent[i] != sentinalkey)
*(int*)0 = -3; Sys_Error ("Hunk_Check: corrupt sentinal");
} }
} }
#endif #endif
@ -1530,7 +1527,7 @@ void Hunk_TempFree(void)
for (i = 0; i < TEMPDEBUG; i++) for (i = 0; i < TEMPDEBUG; i++)
{ {
if (buf[i] != sentinalkey) if (buf[i] != sentinalkey)
*(int*)0 = -3; //force a crash... this'll get our attention. Sys_Error ("Hunk_Check: corrupt sentinal");
} }
buf+=TEMPDEBUG; buf+=TEMPDEBUG;
//app data //app data
@ -1538,7 +1535,7 @@ void Hunk_TempFree(void)
for (i = 0; i < TEMPDEBUG; i++) for (i = 0; i < TEMPDEBUG; i++)
{ {
if (buf[i] != sentinalkey) if (buf[i] != sentinalkey)
*(int*)0 = -3; //force a crash... this'll get our attention. Sys_Error ("Hunk_Check: corrupt sentinal");
} }
#endif #endif
@ -1754,14 +1751,10 @@ void Cache_Report (void)
void Hunk_Print_f (void) void Hunk_Print_f (void)
{ {
cache_system_t *cs; cache_system_t *cs;
int zoneblocks;
int cacheused; int cacheused;
int zoneused;
Hunk_Print(true); Hunk_Print(true);
cacheused = 0; cacheused = 0;
zoneused = 0;
zoneblocks = 0;
for (cs = cache_head; cs; cs = cs->next) for (cs = cache_head; cs; cs = cs->next)
{ {
cacheused += cs->size; cacheused += cs->size;
@ -1776,6 +1769,8 @@ void Hunk_Print_f (void)
#if 0 #if 0
{ {
zone_t *zone; zone_t *zone;
int zoneused = 0;
int zoneblocks = 0;
for(zone = zone_head; zone; zone=zone->next) for(zone = zone_head; zone; zone=zone->next)
{ {

View file

@ -951,14 +951,14 @@ void R_GAlias_DrawBatch(batch_t *batch)
static mesh_t mesh; static mesh_t mesh;
static mesh_t *meshl = &mesh; static mesh_t *meshl = &mesh;
qboolean needrecolour; // qboolean needrecolour;
qboolean nolightdir; // qboolean nolightdir;
e = batch->ent; e = batch->ent;
clmodel = e->model; clmodel = e->model;
currententity = e; currententity = e;
nolightdir = R_CalcModelLighting(e, clmodel); /*nolightdir =*/ R_CalcModelLighting(e, clmodel);
inf = RMod_Extradata (clmodel); inf = RMod_Extradata (clmodel);
if (inf) if (inf)
@ -968,7 +968,7 @@ void R_GAlias_DrawBatch(batch_t *batch)
{ {
if (batch->surf_first == surfnum) if (batch->surf_first == surfnum)
{ {
needrecolour = Alias_GAliasBuildMesh(&mesh, &batch->vbo, inf, surfnum, e, batch->shader->prog && batch->shader->prog->permu[PERMUTATION_SKELETAL].handle.glsl); /*needrecolour =*/ Alias_GAliasBuildMesh(&mesh, &batch->vbo, inf, surfnum, e, batch->shader->prog && batch->shader->prog->permu[PERMUTATION_SKELETAL].handle.glsl);
batch->mesh = &meshl; batch->mesh = &meshl;
return; return;
} }

View file

@ -26,6 +26,7 @@ void Font_EndString(struct font_s *font);
int Font_LineBreaks(conchar_t *start, conchar_t *end, int maxpixelwidth, int maxlines, conchar_t **starts, conchar_t **ends); int Font_LineBreaks(conchar_t *start, conchar_t *end, int maxpixelwidth, int maxlines, conchar_t **starts, conchar_t **ends);
struct font_s *font_conchar; struct font_s *font_conchar;
struct font_s *font_tiny; struct font_s *font_tiny;
extern int r2d_be_flags;
#ifdef AVAIL_FREETYPE #ifdef AVAIL_FREETYPE
#include <ft2build.h> #include <ft2build.h>
@ -312,10 +313,10 @@ static void Font_Flush(void)
font_backmesh.numvertexes = font_foremesh.numvertexes; font_backmesh.numvertexes = font_foremesh.numvertexes;
font_backmesh.istrifan = font_foremesh.istrifan; font_backmesh.istrifan = font_foremesh.istrifan;
BE_DrawMesh_Single(fontplanes.backshader, &font_backmesh, NULL, &fontplanes.backshader->defaulttextures, 0); BE_DrawMesh_Single(fontplanes.backshader, &font_backmesh, NULL, &fontplanes.backshader->defaulttextures, r2d_be_flags);
} }
TEXASSIGN(fontplanes.shader->defaulttextures.base, font_texture); TEXASSIGN(fontplanes.shader->defaulttextures.base, font_texture);
BE_DrawMesh_Single(fontplanes.shader, &font_foremesh, NULL, &fontplanes.shader->defaulttextures, 0); BE_DrawMesh_Single(fontplanes.shader, &font_foremesh, NULL, &fontplanes.shader->defaulttextures, r2d_be_flags);
font_foremesh.numindexes = 0; font_foremesh.numindexes = 0;
font_foremesh.numvertexes = 0; font_foremesh.numvertexes = 0;
} }

View file

@ -175,7 +175,9 @@ typedef struct heightmap_s
} heightmap_t; } heightmap_t;
#ifndef SERVERONLY
static void ted_dorelight(heightmap_t *hm); static void ted_dorelight(heightmap_t *hm);
#endif
static qboolean Terr_Collect(heightmap_t *hm); static qboolean Terr_Collect(heightmap_t *hm);
@ -342,7 +344,7 @@ static qboolean Terr_IsSectionFName(heightmap_t *hm, char *fname, int *sx, int *
return false; return false;
return true; return true;
} }
static hmsection_t *Terr_ReadSection(heightmap_t *hm, hmsection_t *s, int sx, int sy, dsection_t *ds, unsigned int dslen) static hmsection_t *Terr_ReadSection(heightmap_t *hm, hmsection_t *s, int sx, int sy, void *filebase, unsigned int filelen)
{ {
int i, j; int i, j;
#ifndef SERVERONLY #ifndef SERVERONLY
@ -350,10 +352,12 @@ static hmsection_t *Terr_ReadSection(heightmap_t *hm, hmsection_t *s, int sx, in
unsigned char *lm; unsigned char *lm;
float *colours; float *colours;
#endif #endif
void *ptr; void *ptr = filebase;
dsection_t *ds = NULL;
if (ds) if (ptr)
{ {
ds = ptr;
if (ds->magic != SECTION_MAGIC) if (ds->magic != SECTION_MAGIC)
return NULL; return NULL;
if (ds->ver != SECTION_VER) if (ds->ver != SECTION_VER)
@ -362,6 +366,8 @@ static hmsection_t *Terr_ReadSection(heightmap_t *hm, hmsection_t *s, int sx, in
ds = NULL; ds = NULL;
} }
} }
else
filelen = 0;
if (!s) if (!s)
{ {
@ -391,8 +397,9 @@ static hmsection_t *Terr_ReadSection(heightmap_t *hm, hmsection_t *s, int sx, in
Terr_InitLightmap(s); Terr_InitLightmap(s);
#endif #endif
if (ds) if (ptr)
{ {
ds = ptr;
s->flags = ds->flags | TSF_DIRTY; s->flags = ds->flags | TSF_DIRTY;
/*load the heights*/ /*load the heights*/
@ -889,7 +896,6 @@ qboolean Terrain_LocateSection(char *name, flocation_t *loc)
heightmap_t *hm; heightmap_t *hm;
hmsection_t *s; hmsection_t *s;
int x, y; int x, y;
int nlen = strlen(name);
//reject if its not in maps //reject if its not in maps
if (strncmp(name, "maps/", 5)) if (strncmp(name, "maps/", 5))
@ -3291,8 +3297,6 @@ qboolean Terr_LoadTerrainModel (model_t *mod, void *buffer)
{ {
heightmap_t *hm; heightmap_t *hm;
float skyrotate;
vec3_t skyaxis;
char shadername[MAX_QPATH]; char shadername[MAX_QPATH];
char skyname[MAX_QPATH]; char skyname[MAX_QPATH];
int sectsize = 0; int sectsize = 0;
@ -3301,11 +3305,6 @@ qboolean Terr_LoadTerrainModel (model_t *mod, void *buffer)
strcpy(shadername, "terrainshader"); strcpy(shadername, "terrainshader");
strcpy(skyname, "night"); strcpy(skyname, "night");
skyrotate = 0;
skyaxis[0] = 0;
skyaxis[1] = 0;
skyaxis[2] = 0;
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);
if (strcmp(com_token, "terrain")) if (strcmp(com_token, "terrain"))
{ {
@ -3402,7 +3401,8 @@ void Mod_Terrain_Create_f(void)
mdata = va( mdata = va(
"terrain\n" "terrain\n"
"{\n" "{\n"
"classname worldspawn\n" "classname \"worldspawn\"\n"
"message \"%s\"\n"
"_segmentsize 1024\n" "_segmentsize 1024\n"
"_minxsegment -2048\n" "_minxsegment -2048\n"
"_minysegment -2048\n" "_minysegment -2048\n"
@ -3415,7 +3415,7 @@ void Mod_Terrain_Create_f(void)
"classname info_player_start\n" "classname info_player_start\n"
"origin \"0 0 1024\"\n" "origin \"0 0 1024\"\n"
"}\n" "}\n"
, mname); , Cmd_Argv(2));
COM_WriteFile(mname, mdata, strlen(mdata)); COM_WriteFile(mname, mdata, strlen(mdata));
} }
void Mod_Terrain_Reload_f(void) void Mod_Terrain_Reload_f(void)

View file

@ -4483,7 +4483,7 @@ qboolean RMod_LoadSpriteModel (model_t *mod, void *buffer)
int numframes; int numframes;
int size; int size;
dspriteframetype_t *pframetype; dspriteframetype_t *pframetype;
int rendertype=0; // int rendertype=0;
unsigned char pal[256*4]; unsigned char pal[256*4];
int sptype; int sptype;
int hunkstart; int hunkstart;
@ -4506,7 +4506,7 @@ qboolean RMod_LoadSpriteModel (model_t *mod, void *buffer)
if (LittleLong(pin->version) == SPRITEHL_VERSION) if (LittleLong(pin->version) == SPRITEHL_VERSION)
{ {
pin = (dsprite_t*)((char*)pin + 4); pin = (dsprite_t*)((char*)pin + 4);
rendertype = LittleLong (pin->type); /*rendertype =*/ LittleLong (pin->type); //not sure what the values mean.
} }
numframes = LittleLong (pin->numframes); numframes = LittleLong (pin->numframes);

View file

@ -460,7 +460,7 @@ void R_ImportRTLights(char *entlump)
typedef enum lighttype_e {LIGHTTYPE_MINUSX, LIGHTTYPE_RECIPX, LIGHTTYPE_RECIPXX, LIGHTTYPE_NONE, LIGHTTYPE_SUN, LIGHTTYPE_MINUSXX} lighttype_t; typedef enum lighttype_e {LIGHTTYPE_MINUSX, LIGHTTYPE_RECIPX, LIGHTTYPE_RECIPXX, LIGHTTYPE_NONE, LIGHTTYPE_SUN, LIGHTTYPE_MINUSXX} lighttype_t;
/*I'm using the DP code so I know I'll get the DP results*/ /*I'm using the DP code so I know I'll get the DP results*/
int entnum, style, islight, skin, pflags, effects, n; int entnum, style, islight, skin, pflags, n;
lighttype_t type; lighttype_t type;
float origin[3], angles[3], radius, color[3], light[4], fadescale, lightscale, originhack[3], overridecolor[3], vec[4]; float origin[3], angles[3], radius, color[3], light[4], fadescale, lightscale, originhack[3], overridecolor[3], vec[4];
char key[256], value[8192]; char key[256], value[8192];
@ -491,7 +491,7 @@ void R_ImportRTLights(char *entlump)
style = 0; style = 0;
skin = 0; skin = 0;
pflags = 0; pflags = 0;
effects = 0; //effects = 0;
islight = false; islight = false;
nest = 1; nest = 1;
while (1) while (1)
@ -633,8 +633,8 @@ void R_ImportRTLights(char *entlump)
skin = (int)atof(value); skin = (int)atof(value);
else if (!strcmp("pflags", key)) else if (!strcmp("pflags", key))
pflags = (int)atof(value); pflags = (int)atof(value);
else if (!strcmp("effects", key)) //else if (!strcmp("effects", key))
effects = (int)atof(value); //effects = (int)atof(value);
else if (!strcmp("scale", key)) else if (!strcmp("scale", key))
lightscale = atof(value); lightscale = atof(value);
@ -703,8 +703,8 @@ void R_ImportRTLights(char *entlump)
dl->lightcolourscales[0] = r_editlights_import_ambient.value; dl->lightcolourscales[0] = r_editlights_import_ambient.value;
dl->lightcolourscales[1] = r_editlights_import_diffuse.value; dl->lightcolourscales[1] = r_editlights_import_diffuse.value;
dl->lightcolourscales[2] = r_editlights_import_specular.value; dl->lightcolourscales[2] = r_editlights_import_specular.value;
if (skin >= 16)
//FIXME: cubemaps if skin >= 16 snprintf(dl->cubemapname, sizeof(dl->cubemapname), "cubemaps/%i", skin);
} }
} }
} }

View file

@ -367,7 +367,6 @@ R_SetupGL
*/ */
void R_SetupGL (float stereooffset) void R_SetupGL (float stereooffset)
{ {
float screenaspect;
int x, x2, y2, y, w, h; int x, x2, y2, y, w, h;
vec3_t newa; vec3_t newa;
@ -424,7 +423,6 @@ void R_SetupGL (float stereooffset)
fov_y *= 1 + (((sin(cl.time * 3.0) + 1) * 0.015) * r_waterwarp.value); fov_y *= 1 + (((sin(cl.time * 3.0) + 1) * 0.015) * r_waterwarp.value);
} }
screenaspect = (float)r_refdef.vrect.width/r_refdef.vrect.height;
if (r_refdef.useperspective) if (r_refdef.useperspective)
{ {
int stencilshadows = 0; int stencilshadows = 0;

View file

@ -176,7 +176,7 @@ static float Shader_FloatArgument(shader_t *shader, char *arg)
//grab an argument instead, otherwise 0 //grab an argument instead, otherwise 0
var = shader->name; var = shader->name;
while(var = strchr(var, '#')) while((var = strchr(var, '#')))
{ {
if (!strnicmp(var, arg, arglen)) if (!strnicmp(var, arg, arglen))
{ {

View file

@ -1943,7 +1943,7 @@ void GL_EndRenderBuffer_DepthOnly(texid_t depthtexture, int texsize)
static void Sh_GenShadowFace(dlight_t *l, shadowmesh_t *smesh, int face, int smsize, float proj[16]) static void Sh_GenShadowFace(dlight_t *l, shadowmesh_t *smesh, int face, int smsize, float proj[16])
{ {
qboolean oxv; qboolean oxv;
vec3_t t1,t2, t3; vec3_t t1,t2;
texture_t *tex; texture_t *tex;
int tno; int tno;
@ -1972,8 +1972,8 @@ static void Sh_GenShadowFace(dlight_t *l, shadowmesh_t *smesh, int face, int sms
case 3: case 3:
//-x - back //-x - back
VectorNegate(l->axis[0], t1); VectorNegate(l->axis[0], t1);
VectorNegate(l->axis[1], t2); // VectorNegate(l->axis[1], t2);
VectorNegate(l->axis[2], t3); // VectorNegate(l->axis[2], t3);
Matrix4x4_CM_ModelViewMatrixFromAxis(r_refdef.m_view, t1, l->axis[1], l->axis[2], l->origin); Matrix4x4_CM_ModelViewMatrixFromAxis(r_refdef.m_view, t1, l->axis[1], l->axis[2], l->origin);
r_refdef.flipcull = true; r_refdef.flipcull = true;
break; break;
@ -2182,7 +2182,6 @@ void Sh_GenShadowMap (dlight_t *l, qbyte *lvis)
static void Sh_DrawShadowMapLight(dlight_t *l, vec3_t colour, qbyte *vvis) static void Sh_DrawShadowMapLight(dlight_t *l, vec3_t colour, qbyte *vvis)
{ {
int ve;
vec3_t mins, maxs; vec3_t mins, maxs;
qbyte *lvis; qbyte *lvis;
qbyte lvisb[MAX_MAP_LEAFS/8]; qbyte lvisb[MAX_MAP_LEAFS/8];
@ -2244,8 +2243,6 @@ static void Sh_DrawShadowMapLight(dlight_t *l, vec3_t colour, qbyte *vvis)
//may as well use scissors //may as well use scissors
Sh_Scissor(rect); Sh_Scissor(rect);
ve = 0;
BE_SelectEntity(&r_worldentity); BE_SelectEntity(&r_worldentity);
GLBE_SelectDLight(l, colour); GLBE_SelectDLight(l, colour);

View file

@ -459,7 +459,7 @@ For each texture aligned grid point, back project onto the plane
to get the world xyz value of the sample point to get the world xyz value of the sample point
================= =================
*/ */
int c_bad; static int c_bad;
static void LightCalcPoints (llightinfo_t *l) static void LightCalcPoints (llightinfo_t *l)
{ {
int i; int i;
@ -754,15 +754,16 @@ void LightFace (int surfnum)
int i,j,c,ch; int i,j,c,ch;
vec_t total, mean; vec_t total, mean;
int size; int size;
int lightmapwidth, lightmapsize; int lightmapwidth;
#ifdef UTILITY #ifdef UTILITY
int lightmapsize;
byte *out; byte *out;
#endif #endif
byte *rgbout; byte *rgbout;
byte *dulout; byte *dulout;
vec3_t *light, *norm; vec3_t *light, *norm;
vec3_t wnorm, temp, svector, tvector; vec3_t wnorm, temp, svector, tvector;
int w, h; int w;
f = dfaces + surfnum; f = dfaces + surfnum;
@ -852,12 +853,12 @@ void LightFace (int surfnum)
for (i=0 ; i <MAXLIGHTMAPS ; i++) for (i=0 ; i <MAXLIGHTMAPS ; i++)
f->styles[i] = l.lightstyles[i]; f->styles[i] = l.lightstyles[i];
lightmapsize = size*l.numlightstyles;
#ifdef UTILITY #ifdef UTILITY
lightmapsize = size*l.numlightstyles;
if (runningrgblightdatabase) if (runningrgblightdatabase)
{ {
out = GetFakeFileSpace(&f->lightofs, size); out = GetFakeFileSpace(&f->lightofs, lightmapsize);
rgbout = runningrgblightdatabase + f->lightofs*3; rgbout = runningrgblightdatabase + f->lightofs*3;
dulout = runninglightnormbase + f->lightofs*3; dulout = runninglightnormbase + f->lightofs*3;
} }
@ -886,7 +887,7 @@ void LightFace (int surfnum)
// extra filtering // extra filtering
h = (l.texsize[1]+1)*2; // h = (l.texsize[1]+1)*2;
w = (l.texsize[0]+1)*2; w = (l.texsize[0]+1)*2;
for (i=0 ; i< l.numlightstyles ; i++) for (i=0 ; i< l.numlightstyles ; i++)

View file

@ -134,7 +134,7 @@ void FTP_ServerShutdown(void)
} }
//we ought to filter this to remove duplicates. //we ought to filter this to remove duplicates.
static int QDECL SendFileNameTo(const char *rawname, int size, void *param, struct searchpath_s *spath) static int QDECL SendFileNameTo(const char *rawname, int size, void *param, void *spath)
{ {
int socket = *(int*)param; int socket = *(int*)param;
// int i; // int i;

View file

@ -308,7 +308,7 @@ static void PDECL PR_memfree (pubprogfuncs_t *ppf, void *memptr)
printf("PF_memfree: unable to free the non-null empty string constant at %x\n", ptr); printf("PF_memfree: unable to free the non-null empty string constant at %x\n", ptr);
} }
else else
printf("PF_memfree: pointer invalid - out of range (%x >= %x)\n", ptr, prinst.addressableused); printf("PF_memfree: pointer invalid - out of range (%x >= %x)\n", ptr, (unsigned int)prinst.addressableused);
PR_StackTrace(&progfuncs->funcs); PR_StackTrace(&progfuncs->funcs);
return; return;
} }

View file

@ -375,8 +375,6 @@ void PDECL QC_AddSharedFieldVar(pubprogfuncs_t *ppf, int num, char *stringtable)
// int pnum; // int pnum;
unsigned int i, o; unsigned int i, o;
char *s;
//look for an existing match not needed, cos we look a little later too. //look for an existing match not needed, cos we look a little later too.
/* /*
for (i = 0; i < numfields; i++) for (i = 0; i < numfields; i++)
@ -407,8 +405,6 @@ void PDECL QC_AddSharedFieldVar(pubprogfuncs_t *ppf, int num, char *stringtable)
} }
} }
s = pr_globaldefs16[num].s_name+stringtable;
for (i = 0; i < prinst.numfields; i++) for (i = 0; i < prinst.numfields; i++)
{ {
o = prinst.field[i].progsofs; o = prinst.field[i].progsofs;
@ -436,8 +432,6 @@ void PDECL QC_AddSharedFieldVar(pubprogfuncs_t *ppf, int num, char *stringtable)
} }
} }
s = pr_globaldefs32[num].s_name+stringtable;
for (i = 0; i < prinst.numfields; i++) for (i = 0; i < prinst.numfields; i++)
{ {
o = prinst.field[i].progsofs; o = prinst.field[i].progsofs;

View file

@ -566,6 +566,7 @@ pbool QCC_PR_CheckName (char *string);
void QCC_PR_Expect (char *string); void QCC_PR_Expect (char *string);
pbool QCC_PR_CheckKeyword(int keywordenabled, char *string); pbool QCC_PR_CheckKeyword(int keywordenabled, char *string);
#endif #endif
pbool QCC_PR_CheckTokenComment(char *string, char **comment);
void VARGS QCC_PR_ParseError (int errortype, char *error, ...); void VARGS QCC_PR_ParseError (int errortype, char *error, ...);
pbool VARGS QCC_PR_ParseWarning (int warningtype, char *error, ...); pbool VARGS QCC_PR_ParseWarning (int warningtype, char *error, ...);
pbool VARGS QCC_PR_Warning (int type, char *file, int line, char *error, ...); pbool VARGS QCC_PR_Warning (int type, char *file, int line, char *error, ...);

View file

@ -2971,8 +2971,7 @@ QCC_def_t *QCC_PR_GenerateFunctionCall (QCC_def_t *func, QCC_def_t *arglist[], i
QCC_def_t *d, *oldret, *oself; QCC_def_t *d, *oldret, *oself;
int i; int i;
QCC_type_t *t; QCC_type_t *t;
int extraparms=false; // int np;
int np;
int laststatement = numstatements; int laststatement = numstatements;
int callconvention; int callconvention;
@ -2998,8 +2997,7 @@ QCC_def_t *QCC_PR_GenerateFunctionCall (QCC_def_t *func, QCC_def_t *arglist[], i
QCC_PR_ParseErrorPrintDef (ERR_NOTAFUNCTION, func, "not a function"); QCC_PR_ParseErrorPrintDef (ERR_NOTAFUNCTION, func, "not a function");
} }
// copy the arguments to the global parameter variables /* if (t->type == ev_variant)
if (t->type == ev_variant)
{ {
extraparms = true; extraparms = true;
np = 0; np = 0;
@ -3011,9 +3009,10 @@ QCC_def_t *QCC_PR_GenerateFunctionCall (QCC_def_t *func, QCC_def_t *arglist[], i
} }
else else
np = t->num_parms; np = t->num_parms;
*/
if (strchr(func->name, ':') && laststatement && statements[laststatement-1].op == OP_LOAD_FNC && statements[laststatement-1].c == func->ofs) if (strchr(func->name, ':') && laststatement && statements[laststatement-1].op == OP_LOAD_FNC && statements[laststatement-1].c == func->ofs)
{ //we're entering OO code with a different self. { //we're entering OO code with a different self. make sure self is preserved.
//eg: other.touch(self) //eg: other.touch(self)
//FIXME: problems could occur with hexen2 calling conventions when parm0/1 is 'self' //FIXME: problems could occur with hexen2 calling conventions when parm0/1 is 'self'
@ -3198,17 +3197,10 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could
int extraparms=false; int extraparms=false;
int np; int np;
int callconvention;
QCC_def_t *param[MAX_PARMS+MAX_EXTRA_PARMS]; QCC_def_t *param[MAX_PARMS+MAX_EXTRA_PARMS];
func->timescalled++; func->timescalled++;
if (QCC_OPCodeValid(&pr_opcodes[OP_CALL1H]))
callconvention = OP_CALL1H; //FTE extended
else
callconvention = OP_CALL1; //standard
t = func->type; t = func->type;
if (t->type == ev_variant) if (t->type == ev_variant)
@ -5391,7 +5383,9 @@ QCC_def_t *QCC_PR_Expression (int priority, int exprflags)
int opnum; int opnum;
QCC_def_t *e, *e2; QCC_def_t *e, *e2;
etype_t type_a, type_b, type_c; etype_t type_a;
//etype_t type_b;
etype_t type_c;
if (priority == 0) if (priority == 0)
return QCC_PR_Term (exprflags); return QCC_PR_Term (exprflags);
@ -5525,10 +5519,7 @@ QCC_def_t *QCC_PR_Expression (int priority, int exprflags)
// type check // type check
type_a = e->type->type; type_a = e->type->type;
type_b = e2->type->type; // type_b = e2->type->type;
// if (type_a == ev_pointer && type_b == ev_pointer)
// QCC_PR_ParseWarning(0, "Debug: pointer op pointer");
if (op->name[0] == '.')// field access gets type from field if (op->name[0] == '.')// field access gets type from field
{ {
@ -6831,9 +6822,7 @@ void QCC_PR_ParseState (void)
{ {
char *name; char *name;
QCC_def_t *s1, *def, *sc = pr_scope; QCC_def_t *s1, *def, *sc = pr_scope;
char f;
f = *pr_token;
if (QCC_PR_CheckToken("++") || QCC_PR_CheckToken("--")) if (QCC_PR_CheckToken("++") || QCC_PR_CheckToken("--"))
{ {
s1 = QCC_PR_ParseImmediate (); s1 = QCC_PR_ParseImmediate ();

View file

@ -743,7 +743,7 @@ pbool QCC_WriteData (int crc)
if (compressoutput) progs.blockscompressed |=64; //line numbers if (compressoutput) progs.blockscompressed |=64; //line numbers
if (compressoutput) progs.blockscompressed |=128; //types if (compressoutput) progs.blockscompressed |=128; //types
//include a type block? //include a type block?
types = debugtarget; //types = debugtarget;
if (types && sizeof(char *) != sizeof(string_t)) if (types && sizeof(char *) != sizeof(string_t))
{ {
//qcc_typeinfo_t has a char* inside it, which changes size //qcc_typeinfo_t has a char* inside it, which changes size
@ -1331,6 +1331,7 @@ strofs = (strofs+3)&~3;
else else
SafeWrite (h, qcc_pr_globals, numpr_globals*4); SafeWrite (h, qcc_pr_globals, numpr_globals*4);
/*
if (types) if (types)
for (i=0 ; i<numtypeinfos ; i++) for (i=0 ; i<numtypeinfos ; i++)
{ {
@ -1340,7 +1341,7 @@ strofs = (strofs+3)&~3;
qcc_typeinfo[i].next = (QCC_type_t*)(qcc_typeinfo[i].next - qcc_typeinfo); qcc_typeinfo[i].next = (QCC_type_t*)(qcc_typeinfo[i].next - qcc_typeinfo);
qcc_typeinfo[i].name = (char*)QCC_CopyDupBackString(qcc_typeinfo[i].name); qcc_typeinfo[i].name = (char*)QCC_CopyDupBackString(qcc_typeinfo[i].name);
} }
*/
progs.ofsfiles = 0; progs.ofsfiles = 0;
progs.ofslinenums = 0; progs.ofslinenums = 0;
progs.secondaryversion = 0; progs.secondaryversion = 0;
@ -1984,7 +1985,6 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
QCC_def_t *d; QCC_def_t *d;
int f; int f;
unsigned short crc; unsigned short crc;
QCC_def_t *ld;
// int c; // int c;
file[0] = '\0'; file[0] = '\0';
@ -2019,7 +2019,6 @@ unsigned short QCC_PR_WriteProgdefs (char *filename)
ADD3(qcva("\tint\tpad[%i];\n", RESERVED_OFS)); ADD3(qcva("\tint\tpad[%i];\n", RESERVED_OFS));
for (d=pr.def_head.next ; d ; d=d->next) for (d=pr.def_head.next ; d ; d=d->next)
{ {
ld = d;
if (!strcmp (d->name, "end_sys_globals")) if (!strcmp (d->name, "end_sys_globals"))
break; break;
if (d->ofs<RESERVED_OFS) if (d->ofs<RESERVED_OFS)

View file

@ -420,8 +420,6 @@ void WriteAsmStatements(progfuncs_t *progfuncs, progstate_t *progs, int num, int
ddef16_t *def; ddef16_t *def;
int ofs,i; int ofs,i;
int fileofs;
if (!functionname && stn<0) if (!functionname && stn<0)
{ {
//we wrote this one... //we wrote this one...
@ -560,11 +558,9 @@ void WriteAsmStatements(progfuncs_t *progfuncs, progstate_t *progs, int num, int
return; return;
} }
fileofs = SafeSeek(f, 0, SEEK_CUR);
if (setjmp(decompilestatementfailure)) if (setjmp(decompilestatementfailure))
{ {
writes(f, "*/\r\n"); writes(f, "*/\r\n");
// SafeSeek(f, fileofs, SEEK_SET);
writes(f, " = asm {\r\n"); writes(f, " = asm {\r\n");
stn = progs->functions[num].first_statement; stn = progs->functions[num].first_statement;

View file

@ -1329,7 +1329,6 @@ void Q_InitProgs(void)
globalvars_t *pr_globals; globalvars_t *pr_globals;
static char addons[2048]; static char addons[2048];
char *as, *a; char *as, *a;
int num = 0;
progsnum_t prnum, oldprnum=-1; progsnum_t prnum, oldprnum=-1;
int d1, d2; int d1, d2;
@ -1343,7 +1342,6 @@ void Q_InitProgs(void)
PR_RegisterFields(); PR_RegisterFields();
num = svs.numprogs;
svs.numprogs=0; svs.numprogs=0;
d1 = COM_FDepthFile("progs.dat", true); d1 = COM_FDepthFile("progs.dat", true);
@ -2893,6 +2891,8 @@ static void QCBUILTIN PF_particle4 (pubprogfuncs_t *prinst, globalvars_t *pr_glo
static void QCBUILTIN PF_h2particleexplosion(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_h2particleexplosion(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
Con_Printf("H2FIXME: PF_h2particleexplosion not implemented\n");
/*
float *org; float *org;
int color,radius,counter; int color,radius,counter;
@ -2900,7 +2900,6 @@ static void QCBUILTIN PF_h2particleexplosion(pubprogfuncs_t *prinst, struct glob
color = G_FLOAT(OFS_PARM1); color = G_FLOAT(OFS_PARM1);
radius = G_FLOAT(OFS_PARM2); radius = G_FLOAT(OFS_PARM2);
counter = G_FLOAT(OFS_PARM3); counter = G_FLOAT(OFS_PARM3);
/*
MSG_WriteByte(&sv.datagram, svc_particle_explosion); MSG_WriteByte(&sv.datagram, svc_particle_explosion);
MSG_WriteCoord(&sv.datagram, org[0]); MSG_WriteCoord(&sv.datagram, org[0]);
MSG_WriteCoord(&sv.datagram, org[1]); MSG_WriteCoord(&sv.datagram, org[1]);
@ -4247,11 +4246,10 @@ static void QCBUILTIN PF_aim (pubprogfuncs_t *prinst, struct globalvars_s *pr_gl
int i, j; int i, j;
trace_t tr; trace_t tr;
float dist, bestdist; float dist, bestdist;
float speed;
char *noaim; char *noaim;
ent = G_EDICT(prinst, OFS_PARM0); ent = G_EDICT(prinst, OFS_PARM0);
speed = G_FLOAT(OFS_PARM1); // speed = G_FLOAT(OFS_PARM1);
VectorCopy (ent->v->origin, start); VectorCopy (ent->v->origin, start);
start[2] += 20; start[2] += 20;
@ -5777,7 +5775,6 @@ void QCBUILTIN PF_sqlreadfloat (pubprogfuncs_t *prinst, struct globalvars_s *pr_
void QCBUILTIN PF_sqlerror (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_sqlerror (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
sqlserver_t *server; sqlserver_t *server;
int serverref = G_FLOAT(OFS_PARM0);
if (SQL_Available()) if (SQL_Available())
{ {
@ -7228,7 +7225,8 @@ void SV_RegisterH2CustomTents(void)
} }
static void QCBUILTIN PF_h2starteffect(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_h2starteffect(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
float *min, *max, *angle, *size; float *min, *max, *size;
// float *angle;
float colour; float colour;
// float wait, radius, frame, framelength, duration; // float wait, radius, frame, framelength, duration;
// int flags, skin; // int flags, skin;
@ -7272,7 +7270,7 @@ static void QCBUILTIN PF_h2starteffect(pubprogfuncs_t *prinst, struct globalvars
case ce_fountain: case ce_fountain:
/*this effect is meant to be persistant (endeffect is never used)*/ /*this effect is meant to be persistant (endeffect is never used)*/
org = G_VECTOR(OFS_PARM1); org = G_VECTOR(OFS_PARM1);
angle = G_VECTOR(OFS_PARM2); // angle = G_VECTOR(OFS_PARM2);
dir = G_VECTOR(OFS_PARM3); dir = G_VECTOR(OFS_PARM3);
colour = G_FLOAT(OFS_PARM4); colour = G_FLOAT(OFS_PARM4);
count = G_FLOAT(OFS_PARM5); count = G_FLOAT(OFS_PARM5);

View file

@ -518,8 +518,6 @@ qboolean SV_LoadLevelCache(char *savename, char *level, char *startspot, qboolea
int current_skill; int current_skill;
int clnum;
int pt; int pt;
int modelpos; int modelpos;
@ -692,7 +690,7 @@ qboolean SV_LoadLevelCache(char *savename, char *level, char *startspot, qboolea
filelen -= filepos; filelen -= filepos;
file = BZ_Malloc(filelen+1); file = BZ_Malloc(filelen+1);
memset(file, 0, filelen+1); memset(file, 0, filelen+1);
clnum=VFS_READ(f, file, filelen); VFS_READ(f, file, filelen);
file[filelen]='\0'; file[filelen]='\0';
sv.world.edict_size=svprogfuncs->load_ents(svprogfuncs, file, 0); sv.world.edict_size=svprogfuncs->load_ents(svprogfuncs, file, 0);
BZ_Free(file); BZ_Free(file);

View file

@ -374,7 +374,7 @@ void SV_Give_f (void)
} }
} }
int QDECL ShowMapList (const char *name, int flags, void *parm, struct searchpath_s *spath) int QDECL ShowMapList (const char *name, int flags, void *parm, void *spath)
{ {
if (name[5] == 'b' && name[6] == '_') //skip box models if (name[5] == 'b' && name[6] == '_') //skip box models
return true; return true;

View file

@ -1623,7 +1623,6 @@ void SVDP_EmitEntityDelta(entity_state_t *from, entity_state_t *to, sizebuf_t *m
void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t *msg) void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t *msg)
{ {
edict_t *ent;
client_frame_t *fromframe; client_frame_t *fromframe;
packet_entities_t *from; packet_entities_t *from;
int oldindex, newindex; int oldindex, newindex;
@ -1666,7 +1665,6 @@ void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t
if (newnum < oldnum) if (newnum < oldnum)
{ // this is a new entity, send it from the baseline... as far as dp understands it... { // this is a new entity, send it from the baseline... as far as dp understands it...
ent = EDICT_NUM(svprogfuncs, newnum);
//Con_Printf ("baseline %i\n", newnum); //Con_Printf ("baseline %i\n", newnum);
SVDP_EmitEntityDelta (&nullentitystate, &to->entities[newindex], msg, true); SVDP_EmitEntityDelta (&nullentitystate, &to->entities[newindex], msg, true);
newindex++; newindex++;
@ -2118,7 +2116,7 @@ void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, edict_t *
if (client->state < cs_spawned) if (client->state < cs_spawned)
{ {
Con_Printf("SV_WritePlayersToClient: not spawned yet\n", client->namebuf); Con_Printf("SV_WritePlayersToClient: not spawned yet\n");
return; return;
} }

View file

@ -683,7 +683,7 @@ typedef struct
#define SORT_NO 0 #define SORT_NO 0
#define SORT_BY_DATE 1 #define SORT_BY_DATE 1
int QDECL Sys_listdirFound(const char *fname, int fsize, void *uptr, struct searchpath_s *spath) int QDECL Sys_listdirFound(const char *fname, int fsize, void *uptr, void *spath)
{ {
file_t *f; file_t *f;
dir_t *dir = uptr; dir_t *dir = uptr;

View file

@ -287,8 +287,6 @@ static int WPhys_FlyMove (world_t *w, wedict_t *ent, const vec3_t gravitydir, fl
int blocked; int blocked;
vec3_t diff; vec3_t diff;
vec3_t startorg;
numbumps = 4; numbumps = 4;
blocked = 0; blocked = 0;
@ -298,8 +296,6 @@ static int WPhys_FlyMove (world_t *w, wedict_t *ent, const vec3_t gravitydir, fl
time_left = time; time_left = time;
VectorCopy (ent->v->origin, startorg);
for (bumpcount=0 ; bumpcount<numbumps ; bumpcount++) for (bumpcount=0 ; bumpcount<numbumps ; bumpcount++)
{ {
for (i=0 ; i<3 ; i++) for (i=0 ; i<3 ; i++)
@ -1072,7 +1068,6 @@ static void WPhys_Physics_Toss (world_t *w, wedict_t *ent)
vec3_t move; vec3_t move;
float backoff; float backoff;
vec3_t temporg;
int fl; int fl;
const float *gravitydir; const float *gravitydir;
@ -1120,7 +1115,6 @@ static void WPhys_Physics_Toss (world_t *w, wedict_t *ent)
VectorScale (ent->v->velocity, host_frametime, move); VectorScale (ent->v->velocity, host_frametime, move);
if (!DotProduct(move, move)) if (!DotProduct(move, move))
return; return;
VectorCopy(ent->v->origin, temporg);
fl = 0; fl = 0;
#ifndef CLIENTONLY #ifndef CLIENTONLY
@ -1648,7 +1642,8 @@ static int WPhys_SetOnGround (world_t *w, wedict_t *ent, const float *gravitydir
} }
static void WPhys_WalkMove (world_t *w, wedict_t *ent, const float *gravitydir) static void WPhys_WalkMove (world_t *w, wedict_t *ent, const float *gravitydir)
{ {
int clip, oldonground, originalmove_clip, originalmove_flags, originalmove_groundentity; //int originalmove_clip;
int clip, oldonground, originalmove_flags, originalmove_groundentity;
vec3_t upmove, downmove, start_origin, start_velocity, originalmove_origin, originalmove_velocity; vec3_t upmove, downmove, start_origin, start_velocity, originalmove_origin, originalmove_velocity;
trace_t downtrace, steptrace; trace_t downtrace, steptrace;
@ -1668,7 +1663,7 @@ static void WPhys_WalkMove (world_t *w, wedict_t *ent, const float *gravitydir)
VectorCopy(ent->v->origin, originalmove_origin); VectorCopy(ent->v->origin, originalmove_origin);
VectorCopy(ent->v->velocity, originalmove_velocity); VectorCopy(ent->v->velocity, originalmove_velocity);
originalmove_clip = clip; //originalmove_clip = clip;
originalmove_flags = (int)ent->v->flags; originalmove_flags = (int)ent->v->flags;
originalmove_groundentity = ent->v->groundentity; originalmove_groundentity = ent->v->groundentity;
@ -2210,12 +2205,7 @@ qboolean SV_Physics (void)
SV_PreRunCmd(); SV_PreRunCmd();
#ifdef SERVERONLY
ucmd.msec = host_frametime*1000;
#else
// FIXME: Something very weird is going on here!
ucmd.msec = ms; ucmd.msec = ms;
#endif
ucmd.angles[0] = (int)(sv_player->v->v_angle[0] * (65535/360.0f)); ucmd.angles[0] = (int)(sv_player->v->v_angle[0] * (65535/360.0f));
ucmd.angles[1] = (int)(sv_player->v->v_angle[1] * (65535/360.0f)); ucmd.angles[1] = (int)(sv_player->v->v_angle[1] * (65535/360.0f));
ucmd.angles[2] = (int)(sv_player->v->v_angle[2] * (65535/360.0f)); ucmd.angles[2] = (int)(sv_player->v->v_angle[2] * (65535/360.0f));

View file

@ -836,7 +836,7 @@ void SV_MulticastProtExt(vec3_t origin, multicast_t to, int dimension_mask, int
else else
msg = &demo.datagram; msg = &demo.datagram;
} }
SZ_Write(&demo.datagram, sv.multicast.data, sv.multicast.cursize); SZ_Write(msg, sv.multicast.data, sv.multicast.cursize);
} }
#ifdef NQPROT #ifdef NQPROT

View file

@ -188,9 +188,12 @@ int sql_serverworker(void *sref)
{ {
sqlserver_t *server = (sqlserver_t *)sref; sqlserver_t *server = (sqlserver_t *)sref;
const char *error = NULL; const char *error = NULL;
int tinit = -1, i; int i;
qboolean needlock = false; qboolean needlock = false;
qboolean allokay = true; qboolean allokay = true;
#ifdef USE_MYSQL
int tinit = -1;
#endif
switch(server->driver) switch(server->driver)
{ {
@ -260,11 +263,7 @@ int sql_serverworker(void *sref)
{ {
queryrequest_t *qreq = NULL; queryrequest_t *qreq = NULL;
queryresult_t *qres; queryresult_t *qres;
const char *qerror = NULL;
int rows = -1;
int columns = -1; int columns = -1;
int qesize = 0;
void *res = NULL;
if (!(qreq = SQL_PullRequest(server, needlock))) if (!(qreq = SQL_PullRequest(server, needlock)))
{ {
@ -279,8 +278,17 @@ int sql_serverworker(void *sref)
switch(server->driver) switch(server->driver)
{ {
default:
error = "Bad database driver";
allokay = false;
break;
#ifdef USE_MYSQL #ifdef USE_MYSQL
case SQLDRV_MYSQL: case SQLDRV_MYSQL:
{
void *res = NULL;
int qesize = 0;
int rows = -1;
const char *qerror = NULL;
// perform the query and fill out the result structure // perform the query and fill out the result structure
if (qmysql_query(server->mysql, qreq->query)) if (qmysql_query(server->mysql, qreq->query))
qerror = qmysql_error(server->mysql); qerror = qmysql_error(server->mysql);
@ -325,6 +333,7 @@ int sql_serverworker(void *sref)
error = "MALLOC ERROR! Unable to allocate query result!"; error = "MALLOC ERROR! Unable to allocate query result!";
break; break;
} }
}
break; break;
#endif #endif
#ifdef USE_SQLITE #ifdef USE_SQLITE
@ -335,7 +344,6 @@ int sql_serverworker(void *sref)
const char *trailingstring; const char *trailingstring;
char *statementstring = qreq->query; char *statementstring = qreq->query;
char **mat; char **mat;
int matsize;
int rowspace; int rowspace;
int totalrows = 0; int totalrows = 0;
qboolean keeplooping = true; qboolean keeplooping = true;
@ -353,8 +361,6 @@ int sql_serverworker(void *sref)
{ {
rowspace = 65; rowspace = 65;
matsize = columns * sizeof(char*);
qres = (queryresult_t *)ZF_Malloc(sizeof(queryresult_t) + columns * sizeof(char*) * rowspace); qres = (queryresult_t *)ZF_Malloc(sizeof(queryresult_t) + columns * sizeof(char*) * rowspace);
mat = (char**)(qres + 1); mat = (char**)(qres + 1);
if (qres) if (qres)
@ -461,6 +467,8 @@ int sql_serverworker(void *sref)
server->sqlite = NULL; server->sqlite = NULL;
break; break;
#endif #endif
default:
break;
} }
// if we have a server error we still need to put it on the queue // if we have a server error we still need to put it on the queue
@ -527,6 +535,8 @@ static void SQL_DeallocResult(sqlserver_t *server, queryresult_t *qres)
// deallocate current result // deallocate current result
switch(server->driver) switch(server->driver)
{ {
default:
break;
#ifdef USE_MYSQL #ifdef USE_MYSQL
case SQLDRV_MYSQL: case SQLDRV_MYSQL:
if (qres->result) if (qres->result)
@ -1030,6 +1040,9 @@ void SQL_Status_f(void)
server->connectparams[3], server->connectparams[3],
server->active ? "active" : "inactive"); server->active ? "active" : "inactive");
break; break;
default:
Con_Printf("Bad driver\n");
break;
} }
if (reqnum) if (reqnum)
@ -1116,7 +1129,7 @@ void SQL_ServerCycle (void)
if (!server) if (!server)
continue; continue;
while (qres = SQL_PullResult(server)) while ((qres = SQL_PullResult(server)))
{ {
qreq = qres->request; qreq = qres->request;
qres->next = NULL; qres->next = NULL;

View file

@ -917,6 +917,7 @@ void *Sys_GetAddressForName(dllhandle_t *module, const char *exportname)
} }
#if 0
static void *game_library; static void *game_library;
void Sys_UnloadGame(void) void Sys_UnloadGame(void)
@ -936,11 +937,10 @@ void *Sys_GetGameAPI(void *parms)
char curpath[MAX_OSPATH]; char curpath[MAX_OSPATH];
char *searchpath; char *searchpath;
const char *gamename = "gamei386.so"; const char *gamename = "gamei386.so";
char *result;
void *ret; void *ret;
result = getcwd(curpath, sizeof(curpath)); // do soemthing with the result getcwd(curpath, sizeof(curpath)); // do soemthing with the result
searchpath = 0; searchpath = 0;
while((searchpath = COM_NextPath(searchpath))) while((searchpath = COM_NextPath(searchpath)))
@ -962,6 +962,7 @@ void *Sys_GetGameAPI(void *parms)
return 0; return 0;
} }
#endif
void Sys_ServerActivity(void) void Sys_ServerActivity(void)
{ {

View file

@ -6631,7 +6631,7 @@ void SVQ2_ExecuteClientMessage (client_t *cl)
break; break;
#ifdef VOICECHAT #ifdef VOICECHAT
case clc_voicechat: case clcq2_voicechat:
SV_VoiceReadPacket(); SV_VoiceReadPacket();
break; break;
#endif #endif
@ -6769,7 +6769,6 @@ void SVNQ_ExecuteClientMessage (client_t *cl)
int c; int c;
char *s; char *s;
client_frame_t *frame; client_frame_t *frame;
int seq_hash;
cl->netchan.outgoing_sequence++; cl->netchan.outgoing_sequence++;
cl->netchan.incoming_acknowledged = cl->netchan.outgoing_sequence-1; cl->netchan.incoming_acknowledged = cl->netchan.outgoing_sequence-1;
@ -6795,8 +6794,6 @@ void SVNQ_ExecuteClientMessage (client_t *cl)
host_client = cl; host_client = cl;
sv_player = host_client->edict; sv_player = host_client->edict;
seq_hash = cl->netchan.incoming_sequence;
// mark time so clients will know how much to predict // mark time so clients will know how much to predict
// other players // other players
cl->localtime = sv.time; cl->localtime = sv.time;

View file

@ -1116,9 +1116,6 @@ static void World_AreaEdicts_r (areanode_t *node)
{ {
link_t *l, *next, *start; link_t *l, *next, *start;
wedict_t *check; wedict_t *check;
int count;
count = 0;
// touch linked edicts // touch linked edicts
start = &node->edicts; start = &node->edicts;
@ -1188,9 +1185,6 @@ static void WorldQ2_AreaEdicts_r (areanode_t *node)
{ {
link_t *l, *next, *start; link_t *l, *next, *start;
q2edict_t *check; q2edict_t *check;
int count;
count = 0;
// touch linked edicts // touch linked edicts
start = &node->edicts; start = &node->edicts;