mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2025-01-31 03:10:33 +00:00
Merge branch 'master' into game/eliteforce
Conflicts: README.md code/server/sv_client.c
This commit is contained in:
commit
e45538b1c5
160 changed files with 1038 additions and 1067 deletions
|
@ -14,8 +14,8 @@ env:
|
|||
- CC=gcc
|
||||
- CC=clang
|
||||
# extra libs
|
||||
- CC=gcc USE_CODEC_VORBIS=1 USE_FREETYPE=1
|
||||
- CC=clang USE_CODEC_VORBIS=1 USE_FREETYPE=1
|
||||
- CC=gcc USE_FREETYPE=1
|
||||
- CC=clang USE_FREETYPE=1
|
||||
# cross-compile using mingw
|
||||
# dlopen curl to workaround link error because mingw-w64 in trusty is missing strtok_r required by libcurl.a
|
||||
- CC= PLATFORM="mingw32" ARCH="x86" USE_CURL_DLOPEN=1
|
||||
|
|
18
ChangeLog
18
ChangeLog
|
@ -634,7 +634,7 @@
|
|||
#1 current directory
|
||||
#2 fs_homepath
|
||||
#3 fs_basepath
|
||||
this was needed to make mod developement easier
|
||||
this was needed to make mod development easier
|
||||
|
||||
2001-10-09 Timothee Besset <ttimo@idsoftware.com>
|
||||
+ https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=51
|
||||
|
@ -814,7 +814,7 @@
|
|||
* rebuilding 1.28b, various fixes on linux build:
|
||||
- SetProgramPath was renamed to Sys_SetDefaultCDPath in unix_shared.c
|
||||
updated unix_main.c accordingly
|
||||
- some prototypes in qgl.h are guarded by #ifndef GL_VERSION_1_2 (ARB extentions)
|
||||
- some prototypes in qgl.h are guarded by #ifndef GL_VERSION_1_2 (ARB extensions)
|
||||
those prototypes are needed by linux_glimp for importing functions and casting, added a #ifdef __linux__
|
||||
(not a clean solution)
|
||||
- game/q_shared.h
|
||||
|
@ -861,7 +861,7 @@
|
|||
2001-04-23 Timothee Besset <ttimo@idsoftware.com>
|
||||
|
||||
* cleanup the mod selection code, remove duplicates
|
||||
* some issues with release builds, my main developement box doesn't build stable binaries with release settings
|
||||
* some issues with release builds, my main development box doesn't build stable binaries with release settings
|
||||
removing -fomit-frame-pointer seems to fix (there's probably a performance hit)
|
||||
see OMIT-FRAME-POINTER.txt
|
||||
|
||||
|
@ -984,7 +984,7 @@
|
|||
//* or // /* or variations of this. I reverted to exact mirror
|
||||
image of SOS to be sure - short of removing it's too easy to mistake
|
||||
live code for dead one.
|
||||
Later: have to change 5 occurences to avoid gcc complaints about
|
||||
Later: have to change 5 occurrences to avoid gcc complaints about
|
||||
nested comment tokens.
|
||||
TODO: somebody please get rid of the cruft in here.
|
||||
|
||||
|
@ -1235,7 +1235,7 @@
|
|||
* code/game/g_cmds.c (G_SayTo): CON_CONNECTED.
|
||||
* code/game/ai_main.c: HOOK added (SOS).
|
||||
* code/botlib/be_aas_move.c (AAS_HorizontalVelocityForJump):
|
||||
correct fix for FPE occuring (SOS).
|
||||
correct fix for FPE occurring (SOS).
|
||||
* code/game/ai_dmq3.c: initmove.viewoffset (SOS).
|
||||
|
||||
* code/game/q_math.c: guard asser/isnan with Q3_VM (q3asm).
|
||||
|
@ -1679,7 +1679,7 @@
|
|||
* code/game/q_shared.c: Q_strncpyz does zero padding (duh).
|
||||
Note: calls strncpy, which does a zero fill up to destsize.
|
||||
If destsize exceeds memory size, zero padding will overwrite
|
||||
adjacent memory. Suspicion was this happend to botimport.
|
||||
adjacent memory. Suspicion was this happened to botimport.
|
||||
|
||||
* code/qcommon/cvar.c: possible problem in Q_strncpyz call.
|
||||
|
||||
|
@ -1783,7 +1783,7 @@
|
|||
* TEST: running with RC4 data files.
|
||||
TODO: "bot library used before setup" (Q3+TA)
|
||||
TODO: Q3 old mods wreak havoc (graceful bounce)
|
||||
TODO: supress "FreeType code not available" in renderer
|
||||
TODO: suppress "FreeType code not available" in renderer
|
||||
TODO: can't move in Q3
|
||||
TODO: items flicker in Q3
|
||||
TODO: no decals in Q3
|
||||
|
@ -2015,7 +2015,7 @@
|
|||
|
||||
* TEST: tried executing a script - get bounced.
|
||||
TODO: is there any way to jump into a map?
|
||||
TODO: cl_cinematics 0 (supress all fullscreen RoQ)
|
||||
TODO: cl_cinematics 0 (suppress all fullscreen RoQ)
|
||||
Next: used r_logfile 200 in Win32 (RC4) and Linux.
|
||||
There is a buckload of setup code seemingly not done
|
||||
at all in Linux? Either that, or logging is enabled
|
||||
|
@ -2983,7 +2983,7 @@
|
|||
Modules:
|
||||
code: the Q3 engine code, including a jpeg-6/ copy
|
||||
common: code shared by tools
|
||||
libs: code shared by tools, inlcuding a jpeg6/ copy
|
||||
libs: code shared by tools, including a jpeg6/ copy
|
||||
q3asm: VM bytecode assembly
|
||||
q3data: misc. Q3 data conversions
|
||||
q3map: BSP builder
|
||||
|
|
93
Makefile
93
Makefile
|
@ -203,7 +203,7 @@ USE_CODEC_MP3=0
|
|||
endif
|
||||
|
||||
ifndef USE_CODEC_VORBIS
|
||||
USE_CODEC_VORBIS=0
|
||||
USE_CODEC_VORBIS=1
|
||||
endif
|
||||
|
||||
ifndef USE_CODEC_OPUS
|
||||
|
@ -332,8 +332,8 @@ endif
|
|||
# Use sdl2-config if all else fails
|
||||
ifeq ($(SDL_CFLAGS),)
|
||||
ifneq ($(call bin_path, sdl2-config),)
|
||||
SDL_CFLAGS ?= $(shell sdl2-config --cflags)
|
||||
SDL_LIBS ?= $(shell sdl2-config --libs)
|
||||
SDL_CFLAGS = $(shell sdl2-config --cflags)
|
||||
SDL_LIBS = $(shell sdl2-config --libs)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -353,7 +353,7 @@ endif
|
|||
#############################################################################
|
||||
|
||||
INSTALL=install
|
||||
MKDIR=mkdir
|
||||
MKDIR=mkdir -p
|
||||
EXTRA_FILES=
|
||||
CLIENT_EXTRA_FILES=
|
||||
|
||||
|
@ -412,7 +412,7 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
|
|||
AUTOUPDATER_LIBS += -ldl
|
||||
|
||||
CLIENT_LIBS=$(SDL_LIBS)
|
||||
RENDERER_LIBS = $(SDL_LIBS) -lGL
|
||||
RENDERER_LIBS = $(SDL_LIBS)
|
||||
|
||||
ifeq ($(USE_PORTABLE_RPATH),1)
|
||||
# $ is escaped using two, so this is litterly $ORIGIN
|
||||
|
@ -456,15 +456,22 @@ ifeq ($(PLATFORM),darwin)
|
|||
LIBS = -framework Cocoa
|
||||
CLIENT_LIBS=
|
||||
RENDERER_LIBS=
|
||||
OPTIMIZEVM=
|
||||
OPTIMIZEVM = -O3
|
||||
|
||||
# Default minimum Mac OS X version
|
||||
ifeq ($(MACOSX_VERSION_MIN),)
|
||||
MACOSX_VERSION_MIN=10.7
|
||||
endif
|
||||
|
||||
# Multiply by 100 and then remove decimal. 10.7 -> 1070.0 -> 1070
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo '$(MACOSX_VERSION_MIN) * 100' | bc | cut -d. -f1)
|
||||
MACOSX_MAJOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f1)
|
||||
MACOSX_MINOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f2)
|
||||
ifeq ($(shell test $(MACOSX_MINOR) -gt 9; echo $$?),0)
|
||||
# Multiply and then remove decimal. 10.10 -> 101000.0 -> 101000
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_MAJOR) * 10000 + $(MACOSX_MINOR) * 100" | bc | cut -d. -f1)
|
||||
else
|
||||
# Multiply by 100 and then remove decimal. 10.7 -> 1070.0 -> 1070
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_VERSION_MIN) * 100" | bc | cut -d. -f1)
|
||||
endif
|
||||
|
||||
LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
|
||||
BASE_CFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) \
|
||||
|
@ -472,7 +479,6 @@ ifeq ($(PLATFORM),darwin)
|
|||
|
||||
ifeq ($(ARCH),ppc)
|
||||
BASE_CFLAGS += -arch ppc -faltivec
|
||||
OPTIMIZEVM += -O3
|
||||
endif
|
||||
ifeq ($(ARCH),ppc64)
|
||||
BASE_CFLAGS += -arch ppc64 -faltivec
|
||||
|
@ -650,7 +656,7 @@ ifdef MINGW
|
|||
CLIENT_LDFLAGS += -mwindows
|
||||
endif
|
||||
CLIENT_LIBS = -lgdi32 -lole32
|
||||
RENDERER_LIBS = -lgdi32 -lole32 -lopengl32
|
||||
RENDERER_LIBS = -lgdi32 -lole32 -static-libgcc
|
||||
|
||||
ifeq ($(USE_FREETYPE),1)
|
||||
FREETYPE_CFLAGS = -Ifreetype2
|
||||
|
@ -736,7 +742,7 @@ ifeq ($(PLATFORM),freebsd)
|
|||
CLIENT_LIBS =
|
||||
|
||||
CLIENT_LIBS += $(SDL_LIBS)
|
||||
RENDERER_LIBS = $(SDL_LIBS) -lGL
|
||||
RENDERER_LIBS = $(SDL_LIBS)
|
||||
|
||||
# optional features/libraries
|
||||
ifeq ($(USE_OPENAL),1)
|
||||
|
@ -827,7 +833,7 @@ ifeq ($(PLATFORM),openbsd)
|
|||
CLIENT_LIBS =
|
||||
|
||||
CLIENT_LIBS += $(SDL_LIBS)
|
||||
RENDERER_LIBS = $(SDL_LIBS) -lGL
|
||||
RENDERER_LIBS = $(SDL_LIBS)
|
||||
|
||||
ifeq ($(USE_OPENAL),1)
|
||||
ifneq ($(USE_OPENAL_DLOPEN),1)
|
||||
|
@ -873,7 +879,6 @@ ifeq ($(PLATFORM),irix64)
|
|||
ARCH=mips
|
||||
|
||||
CC = c99
|
||||
MKDIR = mkdir -p
|
||||
|
||||
BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 \
|
||||
-I. -I$(ROOT)/usr/include
|
||||
|
@ -890,7 +895,7 @@ ifeq ($(PLATFORM),irix64)
|
|||
# FIXME: The X libraries probably aren't necessary?
|
||||
CLIENT_LIBS=-L/usr/X11/$(LIB) $(SDL_LIBS) \
|
||||
-lX11 -lXext -lm
|
||||
RENDERER_LIBS = $(SDL_LIBS) -lGL
|
||||
RENDERER_LIBS = $(SDL_LIBS)
|
||||
|
||||
else # ifeq IRIX
|
||||
|
||||
|
@ -902,7 +907,7 @@ ifeq ($(PLATFORM),sunos)
|
|||
|
||||
CC=gcc
|
||||
INSTALL=ginstall
|
||||
MKDIR=gmkdir
|
||||
MKDIR=gmkdir -p
|
||||
COPYDIR="/usr/local/share/games/quake3"
|
||||
|
||||
ifneq ($(ARCH),x86)
|
||||
|
@ -946,7 +951,7 @@ ifeq ($(PLATFORM),sunos)
|
|||
BOTCFLAGS=-O0
|
||||
|
||||
CLIENT_LIBS +=$(SDL_LIBS) -lX11 -lXext -liconv -lm
|
||||
RENDERER_LIBS = $(SDL_LIBS) -lGL
|
||||
RENDERER_LIBS = $(SDL_LIBS)
|
||||
|
||||
else # ifeq sunos
|
||||
|
||||
|
@ -1230,7 +1235,7 @@ define DO_REF_STR
|
|||
$(echo_cmd) "REF_STR $<"
|
||||
$(Q)rm -f $@
|
||||
$(Q)echo "const char *fallbackShader_$(notdir $(basename $<)) =" >> $@
|
||||
$(Q)cat $< | sed 's/^/\"/;s/$$/\\n\"/' >> $@
|
||||
$(Q)cat $< | sed -e 's/^/\"/;s/$$/\\n\"/' | tr -d '\r' >> $@
|
||||
$(Q)echo ";" >> $@
|
||||
endef
|
||||
|
||||
|
@ -1426,34 +1431,28 @@ ifneq ($(PLATFORM),darwin)
|
|||
endif
|
||||
|
||||
makedirs:
|
||||
@if [ ! -d $(BUILD_DIR) ];then $(MKDIR) $(BUILD_DIR);fi
|
||||
@if [ ! -d $(B) ];then $(MKDIR) $(B);fi
|
||||
@if [ ! -d $(B)/autoupdater ];then $(MKDIR) $(B)/autoupdater;fi
|
||||
@if [ ! -d $(B)/client ];then $(MKDIR) $(B)/client;fi
|
||||
@if [ ! -d $(B)/client/opus ];then $(MKDIR) $(B)/client/opus;fi
|
||||
@if [ ! -d $(B)/client/vorbis ];then $(MKDIR) $(B)/client/vorbis;fi
|
||||
@if [ ! -d $(B)/renderergl1 ];then $(MKDIR) $(B)/renderergl1;fi
|
||||
@if [ ! -d $(B)/renderergl2 ];then $(MKDIR) $(B)/renderergl2;fi
|
||||
@if [ ! -d $(B)/renderergl2/glsl ];then $(MKDIR) $(B)/renderergl2/glsl;fi
|
||||
@if [ ! -d $(B)/ded ];then $(MKDIR) $(B)/ded;fi
|
||||
@if [ ! -d $(B)/$(BASEGAME) ];then $(MKDIR) $(B)/$(BASEGAME);fi
|
||||
@if [ ! -d $(B)/$(BASEGAME)/cgame ];then $(MKDIR) $(B)/$(BASEGAME)/cgame;fi
|
||||
@if [ ! -d $(B)/$(BASEGAME)/game ];then $(MKDIR) $(B)/$(BASEGAME)/game;fi
|
||||
@if [ ! -d $(B)/$(BASEGAME)/ui ];then $(MKDIR) $(B)/$(BASEGAME)/ui;fi
|
||||
@if [ ! -d $(B)/$(BASEGAME)/qcommon ];then $(MKDIR) $(B)/$(BASEGAME)/qcommon;fi
|
||||
@if [ ! -d $(B)/$(BASEGAME)/vm ];then $(MKDIR) $(B)/$(BASEGAME)/vm;fi
|
||||
@if [ ! -d $(B)/$(MISSIONPACK) ];then $(MKDIR) $(B)/$(MISSIONPACK);fi
|
||||
@if [ ! -d $(B)/$(MISSIONPACK)/cgame ];then $(MKDIR) $(B)/$(MISSIONPACK)/cgame;fi
|
||||
@if [ ! -d $(B)/$(MISSIONPACK)/game ];then $(MKDIR) $(B)/$(MISSIONPACK)/game;fi
|
||||
@if [ ! -d $(B)/$(MISSIONPACK)/ui ];then $(MKDIR) $(B)/$(MISSIONPACK)/ui;fi
|
||||
@if [ ! -d $(B)/$(MISSIONPACK)/qcommon ];then $(MKDIR) $(B)/$(MISSIONPACK)/qcommon;fi
|
||||
@if [ ! -d $(B)/$(MISSIONPACK)/vm ];then $(MKDIR) $(B)/$(MISSIONPACK)/vm;fi
|
||||
@if [ ! -d $(B)/tools ];then $(MKDIR) $(B)/tools;fi
|
||||
@if [ ! -d $(B)/tools/asm ];then $(MKDIR) $(B)/tools/asm;fi
|
||||
@if [ ! -d $(B)/tools/etc ];then $(MKDIR) $(B)/tools/etc;fi
|
||||
@if [ ! -d $(B)/tools/rcc ];then $(MKDIR) $(B)/tools/rcc;fi
|
||||
@if [ ! -d $(B)/tools/cpp ];then $(MKDIR) $(B)/tools/cpp;fi
|
||||
@if [ ! -d $(B)/tools/lburg ];then $(MKDIR) $(B)/tools/lburg;fi
|
||||
@$(MKDIR) $(B)/autoupdater
|
||||
@$(MKDIR) $(B)/client/opus
|
||||
@$(MKDIR) $(B)/client/vorbis
|
||||
@$(MKDIR) $(B)/renderergl1
|
||||
@$(MKDIR) $(B)/renderergl2
|
||||
@$(MKDIR) $(B)/renderergl2/glsl
|
||||
@$(MKDIR) $(B)/ded
|
||||
@$(MKDIR) $(B)/$(BASEGAME)/cgame
|
||||
@$(MKDIR) $(B)/$(BASEGAME)/game
|
||||
@$(MKDIR) $(B)/$(BASEGAME)/ui
|
||||
@$(MKDIR) $(B)/$(BASEGAME)/qcommon
|
||||
@$(MKDIR) $(B)/$(BASEGAME)/vm
|
||||
@$(MKDIR) $(B)/$(MISSIONPACK)/cgame
|
||||
@$(MKDIR) $(B)/$(MISSIONPACK)/game
|
||||
@$(MKDIR) $(B)/$(MISSIONPACK)/ui
|
||||
@$(MKDIR) $(B)/$(MISSIONPACK)/qcommon
|
||||
@$(MKDIR) $(B)/$(MISSIONPACK)/vm
|
||||
@$(MKDIR) $(B)/tools/asm
|
||||
@$(MKDIR) $(B)/tools/etc
|
||||
@$(MKDIR) $(B)/tools/rcc
|
||||
@$(MKDIR) $(B)/tools/cpp
|
||||
@$(MKDIR) $(B)/tools/lburg
|
||||
|
||||
#############################################################################
|
||||
# QVM BUILD TOOLS
|
||||
|
@ -2879,10 +2878,10 @@ copyfiles: release
|
|||
@if [ ! -d $(COPYDIR)/$(BASEGAME) ]; then echo "You need to set COPYDIR to where your Quake3 data is!"; fi
|
||||
ifneq ($(BUILD_GAME_SO),0)
|
||||
ifneq ($(BUILD_BASEGAME),0)
|
||||
-$(MKDIR) -p -m 0755 $(COPYDIR)/$(BASEGAME)
|
||||
-$(MKDIR) -m 0755 $(COPYDIR)/$(BASEGAME)
|
||||
endif
|
||||
ifneq ($(BUILD_MISSIONPACK),0)
|
||||
-$(MKDIR) -p -m 0755 $(COPYDIR)/$(MISSIONPACK)
|
||||
-$(MKDIR) -m 0755 $(COPYDIR)/$(MISSIONPACK)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ The intent of this project is to provide a baseline Quake 3 which may be used
|
|||
for further development and baseq3 fun.
|
||||
Some of the major features currently implemented are:
|
||||
|
||||
* SDL backend
|
||||
* SDL 2 backend
|
||||
* OpenAL sound API support (multiple speaker support and better sound
|
||||
quality)
|
||||
* Full x86_64 support on Linux
|
||||
|
@ -102,7 +102,6 @@ Makefile.local:
|
|||
USE_OPENAL_DLOPEN - link with OpenAL at runtime
|
||||
USE_CURL - use libcurl for http/ftp download support
|
||||
USE_CURL_DLOPEN - link with libcurl at runtime
|
||||
USE_CODEC_MP3 - enable MP3 support
|
||||
USE_CODEC_VORBIS - enable Ogg Vorbis support
|
||||
USE_CODEC_OPUS - enable Ogg Opus support
|
||||
USE_MUMBLE - enable Mumble support
|
||||
|
|
7
SECURITY.md
Normal file
7
SECURITY.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
## ioquake3 Security
|
||||
We take security very seriously at ioquake3. We welcome any peer review of our 100% free software source code to ensure nobody's ioquake3 clients or servers are ever compromised or hacked.
|
||||
|
||||
### Where should I report security issues?
|
||||
|
||||
In order to give the community time to respond and upgrade we strongly urge you report all security issues privately.
|
||||
Please contact zachary@ioquake.org directly to provide details and repro steps and we will respond ASAP.
|
|
@ -191,7 +191,7 @@ typedef struct aas_edge_s
|
|||
//edge index, negative if vertexes are reversed
|
||||
typedef int aas_edgeindex_t;
|
||||
|
||||
//a face bounds an area, often it will also seperate two areas
|
||||
//a face bounds an area, often it will also separate two areas
|
||||
typedef struct aas_face_s
|
||||
{
|
||||
int planenum; //number of the plane this face is in
|
||||
|
|
|
@ -70,7 +70,7 @@ typedef struct bsp_entity_s
|
|||
bsp_epair_t *epairs;
|
||||
} bsp_entity_t;
|
||||
|
||||
//id Sofware BSP data
|
||||
//id Software BSP data
|
||||
typedef struct bsp_s
|
||||
{
|
||||
//true when bsp file is loaded
|
||||
|
|
|
@ -1168,7 +1168,7 @@ void AAS_RemoveNotClusterClosingPortals(void)
|
|||
if (aasworld.areasettings[otherareanum].contents & AREACONTENTS_CLUSTERPORTAL) continue;
|
||||
//if the area already has a cluster set
|
||||
if (aasworld.areasettings[otherareanum].cluster) continue;
|
||||
//another cluster is seperated by this portal
|
||||
//another cluster is separated by this portal
|
||||
numseperatedclusters++;
|
||||
//flood the cluster
|
||||
AAS_FloodCluster_r(otherareanum, numseperatedclusters);
|
||||
|
@ -1185,13 +1185,13 @@ void AAS_RemoveNotClusterClosingPortals(void)
|
|||
if (aasworld.areasettings[otherareanum].contents & AREACONTENTS_CLUSTERPORTAL) continue;
|
||||
//if the area already has a cluster set
|
||||
if (aasworld.areasettings[otherareanum].cluster) continue;
|
||||
//another cluster is seperated by this portal
|
||||
//another cluster is separated by this portal
|
||||
numseperatedclusters++;
|
||||
//flood the cluster
|
||||
AAS_FloodCluster_r(otherareanum, numseperatedclusters);
|
||||
AAS_FloodClusterReachabilities(numseperatedclusters);
|
||||
} //end for
|
||||
//a portal must seperate no more and no less than 2 clusters
|
||||
//a portal must separate no more and no less than 2 clusters
|
||||
if (numseperatedclusters != 2)
|
||||
{
|
||||
aasworld.areasettings[i].contents &= ~AREACONTENTS_CLUSTERPORTAL;
|
||||
|
|
|
@ -774,4 +774,5 @@ void AAS_FloodAreas(vec3_t origin)
|
|||
areanum = AAS_PointAreaNum(origin);
|
||||
cluster = AAS_AreaCluster(areanum);
|
||||
AAS_FloodAreas_r(areanum, cluster, done);
|
||||
FreeMemory(done);
|
||||
}
|
||||
|
|
|
@ -39,10 +39,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define DF_AASENTCLIENT(x) (x - aasworld.entities - 1)
|
||||
#define DF_CLIENTAASENT(x) (&aasworld.entities[x + 1])
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH MAX_QPATH
|
||||
#endif
|
||||
|
||||
//structure to link entities to areas and areas to entities
|
||||
typedef struct aas_link_s
|
||||
{
|
||||
|
@ -187,8 +183,8 @@ typedef struct aas_s
|
|||
float time;
|
||||
int numframes;
|
||||
//name of the aas file
|
||||
char filename[MAX_PATH];
|
||||
char mapname[MAX_PATH];
|
||||
char filename[MAX_QPATH];
|
||||
char mapname[MAX_QPATH];
|
||||
//bounding boxes
|
||||
int numbboxes;
|
||||
aas_bbox_t *bboxes;
|
||||
|
|
|
@ -220,10 +220,9 @@ void AAS_ProjectPointOntoVector( vec3_t point, vec3_t vStart, vec3_t vEnd, vec3_
|
|||
int AAS_LoadFiles(const char *mapname)
|
||||
{
|
||||
int errnum;
|
||||
char aasfile[MAX_PATH];
|
||||
// char bspfile[MAX_PATH];
|
||||
char aasfile[MAX_QPATH];
|
||||
|
||||
strcpy(aasworld.mapname, mapname);
|
||||
Q_strncpyz(aasworld.mapname, mapname, sizeof(aasworld.mapname));
|
||||
//NOTE: first reset the entity links into the AAS areas and BSP leaves
|
||||
// the AAS link heap and BSP link heap are reset after respectively the
|
||||
// AAS file and BSP file are loaded
|
||||
|
@ -232,7 +231,7 @@ int AAS_LoadFiles(const char *mapname)
|
|||
AAS_LoadBSPFile();
|
||||
|
||||
//load the aas file
|
||||
Com_sprintf(aasfile, MAX_PATH, "maps/%s.aas", mapname);
|
||||
Com_sprintf(aasfile, sizeof(aasfile), "maps/%s.aas", mapname);
|
||||
errnum = AAS_LoadAASFile(aasfile);
|
||||
if (errnum != BLERR_NOERROR)
|
||||
return errnum;
|
||||
|
@ -242,7 +241,7 @@ int AAS_LoadFiles(const char *mapname)
|
|||
return BLERR_NOERROR;
|
||||
} //end of the function AAS_LoadFiles
|
||||
//===========================================================================
|
||||
// called everytime a map changes
|
||||
// called every time a map changes
|
||||
//
|
||||
// Parameter: -
|
||||
// Returns: -
|
||||
|
|
|
@ -439,7 +439,7 @@ int AAS_BestReachableArea(vec3_t origin, vec3_t mins, vec3_t maxs, vec3_t goalor
|
|||
//VectorSubtract(absmaxs, bbmins, absmaxs);
|
||||
//link an invalid (-1) entity
|
||||
areas = AAS_LinkEntityClientBBox(absmins, absmaxs, -1, PRESENCE_CROUCH);
|
||||
//get the reachable link arae
|
||||
//get the reachable link area
|
||||
areanum = AAS_BestReachableLinkArea(areas);
|
||||
//unlink the invalid entity
|
||||
AAS_UnlinkFromAreas(areas);
|
||||
|
@ -1416,7 +1416,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
|
|||
//if there IS water the sv_maxwaterjump height below the bestend point
|
||||
if (aasworld.areasettings[AAS_PointAreaNum(testpoint)].areaflags & AREA_LIQUID)
|
||||
{
|
||||
//don't create rediculous water jump reachabilities from areas very far below
|
||||
//don't create ridiculous water jump reachabilities from areas very far below
|
||||
//the water surface
|
||||
if (water_bestdist < aassettings.phys_maxwaterjump + 24)
|
||||
{
|
||||
|
@ -3054,7 +3054,7 @@ void AAS_Reachability_Elevator(void)
|
|||
bottomorg[2] += 24;
|
||||
} //end else
|
||||
//look at adjacent areas around the top of the plat
|
||||
//make larger steps to outside the plat everytime
|
||||
//make larger steps to outside the plat every time
|
||||
for (n = 0; n < 3; n++)
|
||||
{
|
||||
for (k = 0; k < 3; k++)
|
||||
|
|
|
@ -1603,7 +1603,7 @@ int AAS_AreaRouteToGoalArea(int areanum, vec3_t origin, int goalareanum, int tra
|
|||
*reachnum = 0;
|
||||
return qtrue;
|
||||
}
|
||||
//
|
||||
//check !AAS_AreaReachability(areanum) with custom developer-only debug message
|
||||
if (areanum <= 0 || areanum >= aasworld.numareas)
|
||||
{
|
||||
if (botDeveloper)
|
||||
|
@ -1620,6 +1620,10 @@ int AAS_AreaRouteToGoalArea(int areanum, vec3_t origin, int goalareanum, int tra
|
|||
} //end if
|
||||
return qfalse;
|
||||
} //end if
|
||||
if (!aasworld.areasettings[areanum].numreachableareas || !aasworld.areasettings[goalareanum].numreachableareas)
|
||||
{
|
||||
return qfalse;
|
||||
} //end if
|
||||
// make sure the routing cache doesn't grow to large
|
||||
while(AvailableMemory() < 1 * 1024 * 1024) {
|
||||
if (!AAS_FreeOldestCache()) break;
|
||||
|
|
|
@ -688,7 +688,7 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype,
|
|||
side = front < 0;
|
||||
//first put the end part of the line on the stack (back side)
|
||||
VectorCopy(cur_mid, tstack_p->start);
|
||||
//not necesary to store because still on stack
|
||||
//not necessary to store because still on stack
|
||||
//VectorCopy(cur_end, tstack_p->end);
|
||||
tstack_p->planenum = aasnode->planenum;
|
||||
tstack_p->nodenum = aasnode->children[!side];
|
||||
|
@ -874,7 +874,7 @@ int AAS_TraceAreas(vec3_t start, vec3_t end, int *areas, vec3_t *points, int max
|
|||
side = front < 0;
|
||||
//first put the end part of the line on the stack (back side)
|
||||
VectorCopy(cur_mid, tstack_p->start);
|
||||
//not necesary to store because still on stack
|
||||
//not necessary to store because still on stack
|
||||
//VectorCopy(cur_end, tstack_p->end);
|
||||
tstack_p->planenum = aasnode->planenum;
|
||||
tstack_p->nodenum = aasnode->children[!side];
|
||||
|
@ -959,7 +959,7 @@ qboolean AAS_InsideFace(aas_face_t *face, vec3_t pnormal, vec3_t point, float ep
|
|||
//edge) and through both the edge vector and the normal vector
|
||||
//of the plane
|
||||
AAS_OrthogonalToVectors(edgevec, pnormal, sepnormal);
|
||||
//check on wich side of the above plane the point is
|
||||
//check on which side of the above plane the point is
|
||||
//this is done by checking the sign of the dot product of the
|
||||
//vector orthogonal vector from above and the vector from the
|
||||
//origin (first vertex of edge) to the point
|
||||
|
|
|
@ -553,11 +553,11 @@ void StringReplaceWords(char *string, char *synonym, char *replacement)
|
|||
|
||||
//find the synonym in the string
|
||||
str = StringContainsWord(string, synonym, qfalse);
|
||||
//if the synonym occured in the string
|
||||
//if the synonym occurred in the string
|
||||
while(str)
|
||||
{
|
||||
//if the synonym isn't part of the replacement which is already in the string
|
||||
//usefull for abreviations
|
||||
//useful for abbreviations
|
||||
str2 = StringContainsWord(string, replacement, qfalse);
|
||||
while(str2)
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ int GeneticSelection(int numranks, float *rankings)
|
|||
} //end for
|
||||
if (sum > 0)
|
||||
{
|
||||
//select a bot where the ones with the higest rankings have
|
||||
//select a bot where the ones with the highest rankings have
|
||||
//the highest chance of being selected
|
||||
//sum *= random();
|
||||
for (i = 0; i < numranks; i++)
|
||||
|
|
|
@ -268,7 +268,7 @@ itemconfig_t *LoadItemConfig(char *filename)
|
|||
{
|
||||
int max_iteminfo;
|
||||
token_t token;
|
||||
char path[MAX_PATH];
|
||||
char path[MAX_QPATH];
|
||||
source_t *source;
|
||||
itemconfig_t *ic;
|
||||
iteminfo_t *ii;
|
||||
|
|
|
@ -1605,7 +1605,7 @@ bot_moveresult_t BotTravel_WalkOffLedge(bot_movestate_t *ms, aas_reachability_t
|
|||
VectorSubtract(reach->start, ms->origin, dir);
|
||||
VectorNormalize(dir);
|
||||
BotCheckBlocked(ms, dir, qtrue, &result);
|
||||
//if the reachability start and end are practially above each other
|
||||
//if the reachability start and end are practically above each other
|
||||
VectorSubtract(reach->end, reach->start, dir);
|
||||
dir[2] = 0;
|
||||
reachhordist = VectorLength(dir);
|
||||
|
@ -2744,7 +2744,7 @@ bot_moveresult_t BotTravel_RocketJump(bot_movestate_t *ms, aas_reachability_t *r
|
|||
result.ideal_viewangles[PITCH] = 90;
|
||||
//set the view angles directly
|
||||
EA_View(ms->client, result.ideal_viewangles);
|
||||
//view is important for the movment
|
||||
//view is important for the movement
|
||||
result.flags |= MOVERESULT_MOVEMENTVIEWSET;
|
||||
//select the rocket launcher
|
||||
EA_SelectWeapon(ms->client, (int) weapindex_rocketlauncher->value);
|
||||
|
@ -2804,7 +2804,7 @@ bot_moveresult_t BotTravel_BFGJump(bot_movestate_t *ms, aas_reachability_t *reac
|
|||
result.ideal_viewangles[PITCH] = 90;
|
||||
//set the view angles directly
|
||||
EA_View(ms->client, result.ideal_viewangles);
|
||||
//view is important for the movment
|
||||
//view is important for the movement
|
||||
result.flags |= MOVERESULT_MOVEMENTVIEWSET;
|
||||
//select the rocket launcher
|
||||
EA_SelectWeapon(ms->client, (int) weapindex_bfg10k->value);
|
||||
|
|
|
@ -199,7 +199,7 @@ weaponconfig_t *LoadWeaponConfig(char *filename)
|
|||
{
|
||||
int max_weaponinfo, max_projectileinfo;
|
||||
token_t token;
|
||||
char path[MAX_PATH];
|
||||
char path[MAX_QPATH];
|
||||
int i, j;
|
||||
source_t *source;
|
||||
weaponconfig_t *wc;
|
||||
|
|
|
@ -726,7 +726,7 @@ void EvolveFuzzySeperator_r(fuzzyseperator_t *fs)
|
|||
//every once in a while an evolution leap occurs, mutation
|
||||
if (random() < 0.01) fs->weight += crandom() * (fs->maxweight - fs->minweight);
|
||||
else fs->weight += crandom() * (fs->maxweight - fs->minweight) * 0.5;
|
||||
//modify bounds if necesary because of mutation
|
||||
//modify bounds if necessary because of mutation
|
||||
if (fs->weight < fs->minweight) fs->minweight = fs->weight;
|
||||
else if (fs->weight > fs->maxweight) fs->maxweight = fs->weight;
|
||||
} //end else if
|
||||
|
|
|
@ -64,7 +64,7 @@ typedef struct weightconfig_s
|
|||
weightconfig_t *ReadWeightConfig(char *filename);
|
||||
//free a weight configuration
|
||||
void FreeWeightConfig(weightconfig_t *config);
|
||||
//writes a weight configuration, returns true if successfull
|
||||
//writes a weight configuration, returns true if successful
|
||||
qboolean WriteWeightConfig(char *filename, weightconfig_t *config);
|
||||
//find the fuzzy weight with the given name
|
||||
int FindFuzzyWeight(weightconfig_t *wc, char *name);
|
||||
|
|
|
@ -144,26 +144,7 @@ int Export_BotLibSetup(void)
|
|||
|
||||
if(botDeveloper)
|
||||
{
|
||||
char *homedir, *gamedir, *basegame;
|
||||
char logfilename[MAX_OSPATH];
|
||||
|
||||
homedir = LibVarGetString("homedir");
|
||||
gamedir = LibVarGetString("gamedir");
|
||||
basegame = LibVarGetString("basegame");
|
||||
|
||||
if (*homedir)
|
||||
{
|
||||
if(*gamedir)
|
||||
Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP);
|
||||
else if(*basegame)
|
||||
Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, basegame, PATH_SEP);
|
||||
else
|
||||
Com_sprintf(logfilename, sizeof(logfilename), "%s%c" BASEGAME "%cbotlib.log", homedir, PATH_SEP, PATH_SEP);
|
||||
}
|
||||
else
|
||||
Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
|
||||
|
||||
Log_Open(logfilename);
|
||||
Log_Open("botlib.log");
|
||||
}
|
||||
|
||||
botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n");
|
||||
|
|
|
@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include <string.h>
|
||||
|
||||
#include "../qcommon/q_shared.h"
|
||||
#include "../qcommon/qcommon.h"
|
||||
#include "botlib.h"
|
||||
#include "be_interface.h" //for botimport.Print
|
||||
#include "l_libvar.h"
|
||||
|
@ -58,6 +59,7 @@ static logfile_t logfile;
|
|||
//===========================================================================
|
||||
void Log_Open(char *filename)
|
||||
{
|
||||
char *ospath;
|
||||
if (!LibVarValue("log", "0")) return;
|
||||
if (!filename || !strlen(filename))
|
||||
{
|
||||
|
@ -69,7 +71,8 @@ void Log_Open(char *filename)
|
|||
botimport.Print(PRT_ERROR, "log file %s is already opened\n", logfile.filename);
|
||||
return;
|
||||
} //end if
|
||||
logfile.fp = fopen(filename, "wb");
|
||||
ospath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), Cvar_VariableString("fs_game"), filename);
|
||||
logfile.fp = fopen(ospath, "wb");
|
||||
if (!logfile.fp)
|
||||
{
|
||||
botimport.Print(PRT_ERROR, "can't open the log file %s\n", filename);
|
||||
|
|
|
@ -971,7 +971,7 @@ int PC_Directive_include(source_t *source)
|
|||
{
|
||||
script_t *script;
|
||||
token_t token;
|
||||
char path[MAX_PATH];
|
||||
char path[MAX_QPATH];
|
||||
#ifdef QUAKE
|
||||
foundfile_t file;
|
||||
#endif //QUAKE
|
||||
|
|
|
@ -29,10 +29,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH MAX_QPATH
|
||||
#endif
|
||||
|
||||
#ifndef PATH_SEPERATORSTR
|
||||
#if defined(WIN32)|defined(_WIN32)|defined(__NT__)|defined(__WINDOWS__)|defined(__WINDOWS_386__)
|
||||
#define PATHSEPERATOR_STR "\\"
|
||||
|
|
|
@ -160,9 +160,7 @@ punctuation_t default_punctuations[] =
|
|||
{NULL, 0}
|
||||
};
|
||||
|
||||
#ifdef BSPC
|
||||
char basefolder[MAX_PATH];
|
||||
#else
|
||||
#ifdef BOTLIB
|
||||
char basefolder[MAX_QPATH];
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +218,7 @@ char *PunctuationFromNum(script_t *script, int num)
|
|||
{
|
||||
if (script->punctuations[i].n == num) return script->punctuations[i].p;
|
||||
} //end for
|
||||
return "unkown punctuation";
|
||||
return "unknown punctuation";
|
||||
} //end of the function PunctuationFromNum
|
||||
//===========================================================================
|
||||
//
|
||||
|
@ -838,7 +836,7 @@ int PS_ReadPrimitive(script_t *script, token_t *token)
|
|||
token->string[len] = 0;
|
||||
//copy the token into the script structure
|
||||
Com_Memcpy(&script->token, token, sizeof(token_t));
|
||||
//primitive reading successfull
|
||||
//primitive reading successful
|
||||
return 1;
|
||||
} //end of the function PS_ReadPrimitive
|
||||
//============================================================================
|
||||
|
@ -1441,9 +1439,7 @@ void FreeScript(script_t *script)
|
|||
//============================================================================
|
||||
void PS_SetBaseFolder(char *path)
|
||||
{
|
||||
#ifdef BSPC
|
||||
sprintf(basefolder, path);
|
||||
#else
|
||||
#ifdef BOTLIB
|
||||
Com_sprintf(basefolder, sizeof(basefolder), "%s", path);
|
||||
#endif
|
||||
} //end of the function PS_SetBaseFolder
|
||||
|
|
|
@ -30,8 +30,5 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*****************************************************************************/
|
||||
|
||||
#define Vector2Angles(v,a) vectoangles(v,a)
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH MAX_QPATH
|
||||
#endif
|
||||
#define Maximum(x,y) (x > y ? x : y)
|
||||
#define Minimum(x,y) (x < y ? x : y)
|
||||
|
|
|
@ -197,7 +197,7 @@ typedef struct centity_s {
|
|||
//======================================================================
|
||||
|
||||
// local entities are created as a result of events or predicted actions,
|
||||
// and live independantly from all server transmitted entities
|
||||
// and live independently from all server transmitted entities
|
||||
|
||||
typedef struct markPoly_s {
|
||||
struct markPoly_s *prevMark, *nextMark;
|
||||
|
@ -458,7 +458,7 @@ typedef struct {
|
|||
qboolean loading; // don't defer players at initial startup
|
||||
qboolean intermissionStarted; // don't play voice rewards, because game will end shortly
|
||||
|
||||
// there are only one or two snapshot_t that are relevent at a time
|
||||
// there are only one or two snapshot_t that are relevant at a time
|
||||
int latestSnapshotNum; // the number of snapshots the client system has received
|
||||
int latestSnapshotTime; // the time from latestSnapshotNum, so we don't need to read the snapshot yet
|
||||
|
||||
|
@ -601,7 +601,7 @@ typedef struct {
|
|||
|
||||
int itemPickup;
|
||||
int itemPickupTime;
|
||||
int itemPickupBlendTime; // the pulse around the crosshair is timed seperately
|
||||
int itemPickupBlendTime; // the pulse around the crosshair is timed separately
|
||||
|
||||
int weaponSelectTime;
|
||||
int weaponAnimation;
|
||||
|
@ -1613,7 +1613,7 @@ void trap_GetGlconfig( glconfig_t *glconfig );
|
|||
void trap_GetGameState( gameState_t *gamestate );
|
||||
|
||||
// cgame will poll each frame to see if a newer snapshot has arrived
|
||||
// that it is interested in. The time is returned seperately so that
|
||||
// that it is interested in. The time is returned separately so that
|
||||
// snapshot latency can be calculated.
|
||||
void trap_GetCurrentSnapshotNumber( int *snapshotNumber, int *serverTime );
|
||||
|
||||
|
|
|
@ -499,7 +499,7 @@ static void CG_RegisterItemSounds( int itemNum ) {
|
|||
trap_S_RegisterSound( item->pickup_sound, qfalse );
|
||||
}
|
||||
|
||||
// parse the space seperated precache string for other media
|
||||
// parse the space separated precache string for other media
|
||||
s = item->sounds;
|
||||
if (!s || !s[0])
|
||||
return;
|
||||
|
|
|
@ -1371,7 +1371,7 @@ static void CG_AddPainTwitch( centity_t *cent, vec3_t torsoAngles ) {
|
|||
===============
|
||||
CG_PlayerAngles
|
||||
|
||||
Handles seperate torso motion
|
||||
Handles separate torso motion
|
||||
|
||||
legs pivot based on direction of movement
|
||||
|
||||
|
@ -2508,6 +2508,8 @@ void CG_Player( centity_t *cent ) {
|
|||
|
||||
memcpy(&powerup, &torso, sizeof(torso));
|
||||
powerup.hModel = cgs.media.invulnerabilityPowerupModel;
|
||||
powerup.frame = 0;
|
||||
powerup.oldframe = 0;
|
||||
powerup.customSkin = 0;
|
||||
// always draw
|
||||
powerup.renderfx &= ~RF_THIRD_PERSON;
|
||||
|
@ -2532,6 +2534,8 @@ void CG_Player( centity_t *cent ) {
|
|||
if ( ci->medkitUsageTime && t < 500 ) {
|
||||
memcpy(&powerup, &torso, sizeof(torso));
|
||||
powerup.hModel = cgs.media.medkitUsageModel;
|
||||
powerup.frame = 0;
|
||||
powerup.oldframe = 0;
|
||||
powerup.customSkin = 0;
|
||||
// always draw
|
||||
powerup.renderfx &= ~RF_THIRD_PERSON;
|
||||
|
|
|
@ -47,6 +47,9 @@ void CG_CheckAmmo( void ) {
|
|||
if ( ! ( weapons & ( 1 << i ) ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( cg.snap->ps.ammo[i] < 0 ) {
|
||||
continue;
|
||||
}
|
||||
switch ( i ) {
|
||||
case WP_ROCKET_LAUNCHER:
|
||||
case WP_GRENADE_LAUNCHER:
|
||||
|
|
|
@ -213,7 +213,7 @@ typedef enum {
|
|||
|
||||
CG_SHUTDOWN,
|
||||
// void (*CG_Shutdown)( void );
|
||||
// oportunity to flush and close any open files
|
||||
// opportunity to flush and close any open files
|
||||
|
||||
CG_CONSOLE_COMMAND,
|
||||
// qboolean (*CG_ConsoleCommand)( void );
|
||||
|
|
|
@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*/
|
||||
//
|
||||
// cg_servercmds.c -- reliably sequenced text commands sent by the server
|
||||
// these are processed at snapshot transition time, so there will definately
|
||||
// these are processed at snapshot transition time, so there will definitely
|
||||
// be a valid snapshot this frame
|
||||
|
||||
#include "cg_local.h"
|
||||
|
|
|
@ -137,7 +137,7 @@ static void CG_TransitionSnapshot( void ) {
|
|||
// execute any server string commands before transitioning entities
|
||||
CG_ExecuteNewServerCommands( cg.nextSnap->serverCommandSequence );
|
||||
|
||||
// if we had a map_restart, set everthing with initial
|
||||
// if we had a map_restart, set everything with initial
|
||||
if ( cg.mapRestart ) {
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ Testmodel will create a fake entity 100 units in front of the current view
|
|||
position, directly facing the viewer. It will remain immobile, so you can
|
||||
move around it to view it from different angles.
|
||||
|
||||
Testgun will cause the model to follow the player around and supress the real
|
||||
Testgun will cause the model to follow the player around and suppress the real
|
||||
view weapon model. The default frame 0 of most guns is completely off screen,
|
||||
so you will probably have to cycle a couple frames to see it.
|
||||
|
||||
|
|
|
@ -1289,7 +1289,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
|
|||
nonPredictedCent = &cg_entities[cent->currentState.clientNum];
|
||||
|
||||
// if the index of the nonPredictedCent is not the same as the clientNum
|
||||
// then this is a fake player (like on teh single player podiums), so
|
||||
// then this is a fake player (like on the single player podiums), so
|
||||
// go ahead and use the cent
|
||||
if( ( nonPredictedCent - cg_entities ) != cent->currentState.clientNum ) {
|
||||
nonPredictedCent = cent;
|
||||
|
|
|
@ -351,7 +351,7 @@ rescan:
|
|||
// the clientLevelShot command is used during development
|
||||
// to generate 128*128 screenshots from the intermission
|
||||
// point of levels for the menu system to use
|
||||
// we pass it along to the cgame to make apropriate adjustments,
|
||||
// we pass it along to the cgame to make appropriate adjustments,
|
||||
// but we also clear the console and notify lines here
|
||||
if ( !strcmp( cmd, "clientLevelShot" ) ) {
|
||||
// don't do it if we aren't running the server locally,
|
||||
|
@ -1068,7 +1068,7 @@ void CL_SetCGameTime( void ) {
|
|||
}
|
||||
|
||||
// if we are playing a demo back, we can just keep reading
|
||||
// messages from the demo file until the cgame definately
|
||||
// messages from the demo file until the cgame definitely
|
||||
// has valid snapshots to interpolate between
|
||||
|
||||
// a timedemo will always use a deterministic set of time samples
|
||||
|
|
|
@ -320,7 +320,7 @@ void CL_KeyMove( usercmd_t *cmd ) {
|
|||
|
||||
//
|
||||
// adjust for speed key / running
|
||||
// the walking flag is to keep animations consistant
|
||||
// the walking flag is to keep animations consistent
|
||||
// even during acceleration and develeration
|
||||
//
|
||||
if ( in_speed.active ^ cl_run->integer ) {
|
||||
|
|
|
@ -177,7 +177,7 @@ keyname_t keynames[] =
|
|||
|
||||
{"PAUSE", K_PAUSE},
|
||||
|
||||
{"SEMICOLON", ';'}, // because a raw semicolon seperates commands
|
||||
{"SEMICOLON", ';'}, // because a raw semicolon separates commands
|
||||
|
||||
{"WORLD_0", K_WORLD_0},
|
||||
{"WORLD_1", K_WORLD_1},
|
||||
|
@ -919,7 +919,7 @@ void Key_SetBinding( int keynum, const char *binding ) {
|
|||
keys[keynum].binding = CopyString( binding );
|
||||
|
||||
// consider this like modifying an archived cvar, so the
|
||||
// file write will be triggered at the next oportunity
|
||||
// file write will be triggered at the next opportunity
|
||||
cvar_modifiedFlags |= CVAR_ARCHIVE;
|
||||
}
|
||||
|
||||
|
@ -1311,7 +1311,7 @@ void CL_KeyDownEvent( int key, unsigned time )
|
|||
// send the bound action
|
||||
CL_ParseBinding( key, qtrue, time );
|
||||
|
||||
// distribute the key down event to the apropriate handler
|
||||
// distribute the key down event to the appropriate handler
|
||||
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
|
||||
Console_Key( key );
|
||||
} else if ( Key_GetCatcher( ) & KEYCATCH_UI ) {
|
||||
|
@ -1397,7 +1397,7 @@ void CL_CharEvent( int key ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// distribute the key down event to the apropriate handler
|
||||
// distribute the key down event to the appropriate handler
|
||||
if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE )
|
||||
{
|
||||
Field_CharEvent( &g_consoleField, key );
|
||||
|
|
|
@ -573,7 +573,7 @@ CLIENT RELIABLE COMMAND COMMUNICATION
|
|||
======================
|
||||
CL_AddReliableCommand
|
||||
|
||||
The given command will be transmitted to the server, and is gauranteed to
|
||||
The given command will be transmitted to the server, and is guaranteed to
|
||||
not have future usercmd_t executed before it is executed
|
||||
======================
|
||||
*/
|
||||
|
@ -1302,7 +1302,7 @@ void CL_ClearMemory(qboolean shutdownRef)
|
|||
CL_ShutdownAll(shutdownRef);
|
||||
|
||||
// if not running a server clear the whole hunk
|
||||
if ( !com_sv_running->integer ) {
|
||||
if ( !com_sv_running || !com_sv_running->integer ) {
|
||||
// clear the whole hunk
|
||||
Hunk_Clear();
|
||||
// clear collision map data
|
||||
|
@ -1596,7 +1596,7 @@ void CL_RequestMotd( void ) {
|
|||
|
||||
info[0] = 0;
|
||||
|
||||
Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", ((rand() << 16) ^ rand()) ^ Com_Milliseconds());
|
||||
Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", (int)((((unsigned int)rand() << 16) ^ (unsigned int)rand()) ^ Com_Milliseconds()));
|
||||
|
||||
Info_SetValueForKey( info, "challenge", cls.updateChallenge );
|
||||
Info_SetValueForKey( info, "renderer", cls.glconfig.renderer_string );
|
||||
|
@ -1825,7 +1825,7 @@ void CL_Connect_f( void ) {
|
|||
clc.state = CA_CONNECTING;
|
||||
|
||||
// Set a client challenge number that ideally is mirrored back by the server.
|
||||
clc.challenge = ((rand() << 16) ^ rand()) ^ Com_Milliseconds();
|
||||
clc.challenge = (((unsigned int)rand() << 16) ^ (unsigned int)rand()) ^ Com_Milliseconds();
|
||||
}
|
||||
|
||||
Key_SetCatcher( 0 );
|
||||
|
@ -2022,7 +2022,7 @@ void CL_Vid_Restart_f( void ) {
|
|||
CL_ShutdownCGame();
|
||||
// shutdown the renderer and clear the renderer interface
|
||||
CL_ShutdownRef();
|
||||
// client is no longer pure untill new checksums are sent
|
||||
// client is no longer pure until new checksums are sent
|
||||
CL_ResetPureClientAtServer();
|
||||
// clear pak references
|
||||
FS_ClearPakReferences( FS_UI_REF | FS_CGAME_REF );
|
||||
|
@ -2033,7 +2033,7 @@ void CL_Vid_Restart_f( void ) {
|
|||
cls.cgameStarted = qfalse;
|
||||
cls.soundRegistered = qfalse;
|
||||
|
||||
// unpause so the cgame definately gets a snapshot and renders a frame
|
||||
// unpause so the cgame definitely gets a snapshot and renders a frame
|
||||
Cvar_Set("cl_paused", "0");
|
||||
|
||||
// initialize the renderer interface
|
||||
|
@ -3406,7 +3406,7 @@ void CL_InitRef( void ) {
|
|||
|
||||
re = *ret;
|
||||
|
||||
// unpause so the cgame definately gets a snapshot and renders a frame
|
||||
// unpause so the cgame definitely gets a snapshot and renders a frame
|
||||
Cvar_Set( "cl_paused", "0" );
|
||||
}
|
||||
|
||||
|
|
|
@ -402,7 +402,7 @@ void CL_SystemInfoChanged( void ) {
|
|||
// ehw!
|
||||
if (!Q_stricmp(key, "fs_game"))
|
||||
{
|
||||
if(FS_CheckDirTraversal(value))
|
||||
if(FS_InvalidGameDir(value))
|
||||
{
|
||||
Com_Printf(S_COLOR_YELLOW "WARNING: Server sent invalid fs_game value %s\n", value);
|
||||
continue;
|
||||
|
|
|
@ -648,9 +648,9 @@ CLUI_GetCDKey
|
|||
#ifndef ELITEFORCE
|
||||
static void CLUI_GetCDKey( char *buf, int buflen ) {
|
||||
#ifndef STANDALONE
|
||||
cvar_t *fs;
|
||||
fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
|
||||
if (UI_usesUniqueCDKey() && fs && fs->string[0] != 0) {
|
||||
const char *gamedir;
|
||||
gamedir = Cvar_VariableString( "fs_game" );
|
||||
if (UI_usesUniqueCDKey() && gamedir[0] != 0) {
|
||||
Com_Memcpy( buf, &cl_cdkey[16], 16);
|
||||
buf[16] = 0;
|
||||
} else {
|
||||
|
@ -671,9 +671,9 @@ CLUI_SetCDKey
|
|||
*/
|
||||
#ifndef STANDALONE
|
||||
static void CLUI_SetCDKey( char *buf ) {
|
||||
cvar_t *fs;
|
||||
fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
|
||||
if (UI_usesUniqueCDKey() && fs && fs->string[0] != 0) {
|
||||
const char *gamedir;
|
||||
gamedir = Cvar_VariableString( "fs_game" );
|
||||
if (UI_usesUniqueCDKey() && gamedir[0] != 0) {
|
||||
Com_Memcpy( &cl_cdkey[16], buf, 16 );
|
||||
cl_cdkey[32] = 0;
|
||||
// set the flag so the fle will be written at the next opportunity
|
||||
|
|
|
@ -25,7 +25,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
/*
|
||||
** Intel/DVI ADPCM coder/decoder.
|
||||
**
|
||||
** The algorithm for this coder was taken from the IMA Compatability Project
|
||||
** The algorithm for this coder was taken from the IMA Compatibility Project
|
||||
** proceedings, Vol 2, Number 2; May 1992.
|
||||
**
|
||||
** Version 1.2, 18-Dec-92.
|
||||
|
|
|
@ -446,7 +446,7 @@ void S_SpatializeOrigin (vec3_t origin, int master_vol, int *left_vol, int *righ
|
|||
|
||||
const float dist_mult = SOUND_ATTENUATE;
|
||||
|
||||
// calculate stereo seperation and distance attenuation
|
||||
// calculate stereo separation and distance attenuation
|
||||
VectorSubtract(origin, listener_origin, source_vec);
|
||||
|
||||
dist = VectorNormalize(source_vec);
|
||||
|
|
|
@ -515,7 +515,7 @@ static void S_PaintChannelFrom16_scalar( channel_t *ch, const sfx_t *sc, int cou
|
|||
static void S_PaintChannelFrom16( channel_t *ch, const sfx_t *sc, int count, int sampleOffset, int bufferOffset ) {
|
||||
#if idppc_altivec
|
||||
if (com_altivec->integer) {
|
||||
// must be in a seperate function or G3 systems will crash.
|
||||
// must be in a separate function or G3 systems will crash.
|
||||
S_PaintChannelFrom16_altivec( ch, sc, count, sampleOffset, bufferOffset );
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ int BotGetItemLongTermGoal(bot_state_t *bs, int tfl, bot_goal_t *goal) {
|
|||
==================
|
||||
BotGetLongTermGoal
|
||||
|
||||
we could also create a seperate AI node for every long term goal type
|
||||
we could also create a separate AI node for every long term goal type
|
||||
however this saves us a lot of code
|
||||
==================
|
||||
*/
|
||||
|
|
|
@ -2759,7 +2759,7 @@ bot_moveresult_t BotAttackMove(bot_state_t *bs, int tfl) {
|
|||
bs->flags ^= BFL_STRAFERIGHT;
|
||||
bs->attackstrafe_time = 0;
|
||||
}
|
||||
//bot couldn't do any usefull movement
|
||||
//bot couldn't do any useful movement
|
||||
// bs->attackchase_time = AAS_Time() + 6;
|
||||
return moveresult;
|
||||
}
|
||||
|
@ -4862,7 +4862,7 @@ void BotCheckEvents(bot_state_t *bs, entityState_t *state) {
|
|||
else*/
|
||||
#ifdef MISSIONPACK
|
||||
if (!strcmp(buf, "sound/items/kamikazerespawn.wav" )) {
|
||||
//the kamikaze respawned so dont avoid it
|
||||
//the kamikaze respawned so don't avoid it
|
||||
BotDontAvoid(bs, "Kamikaze");
|
||||
}
|
||||
else
|
||||
|
|
|
@ -136,7 +136,7 @@ int BotPopFromActivateGoalStack(bot_state_t *bs);
|
|||
void BotClearActivateGoalStack(bot_state_t *bs);
|
||||
//returns the team the bot is in
|
||||
int BotTeam(bot_state_t *bs);
|
||||
//retuns the opposite team of the bot
|
||||
//returns the opposite team of the bot
|
||||
int BotOppositeTeam(bot_state_t *bs);
|
||||
//returns the flag the bot is carrying (CTFFLAG_?)
|
||||
int BotCTFCarryingFlag(bot_state_t *bs);
|
||||
|
|
|
@ -55,10 +55,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include "inv.h"
|
||||
#include "syn.h"
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 144
|
||||
#endif
|
||||
|
||||
|
||||
//bot states
|
||||
bot_state_t *botstates[MAX_CLIENTS];
|
||||
|
@ -1174,7 +1170,7 @@ BotAISetupClient
|
|||
==============
|
||||
*/
|
||||
int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean restart) {
|
||||
char filename[MAX_PATH], name[MAX_PATH], gender[MAX_PATH];
|
||||
char filename[144], name[144], gender[144];
|
||||
bot_state_t *bs;
|
||||
int errnum;
|
||||
|
||||
|
@ -1206,7 +1202,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
//allocate a goal state
|
||||
bs->gs = trap_BotAllocGoalState(client);
|
||||
//load the item weights
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_ITEMWEIGHTS, filename, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_ITEMWEIGHTS, filename, sizeof(filename));
|
||||
errnum = trap_BotLoadItemWeights(bs->gs, filename);
|
||||
if (errnum != BLERR_NOERROR) {
|
||||
trap_BotFreeGoalState(bs->gs);
|
||||
|
@ -1215,7 +1211,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
//allocate a weapon state
|
||||
bs->ws = trap_BotAllocWeaponState();
|
||||
//load the weapon weights
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_WEAPONWEIGHTS, filename, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_WEAPONWEIGHTS, filename, sizeof(filename));
|
||||
errnum = trap_BotLoadWeaponWeights(bs->ws, filename);
|
||||
if (errnum != BLERR_NOERROR) {
|
||||
trap_BotFreeGoalState(bs->gs);
|
||||
|
@ -1225,8 +1221,8 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
//allocate a chat state
|
||||
bs->cs = trap_BotAllocChatState();
|
||||
//load the chat file
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_FILE, filename, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_NAME, name, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_FILE, filename, sizeof(filename));
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_NAME, name, sizeof(name));
|
||||
errnum = trap_BotLoadChatFile(bs->cs, filename, name);
|
||||
if (errnum != BLERR_NOERROR) {
|
||||
trap_BotFreeChatState(bs->cs);
|
||||
|
@ -1235,7 +1231,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
return qfalse;
|
||||
}
|
||||
//get the gender characteristic
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_GENDER, gender, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_GENDER, gender, sizeof(gender));
|
||||
//set the chat gender
|
||||
if (*gender == 'f' || *gender == 'F') trap_BotSetChatGender(bs->cs, CHAT_GENDERFEMALE);
|
||||
else if (*gender == 'm' || *gender == 'M') trap_BotSetChatGender(bs->cs, CHAT_GENDERMALE);
|
||||
|
@ -1264,7 +1260,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
if (restart) {
|
||||
BotReadSessionData(bs);
|
||||
}
|
||||
//bot has been setup succesfully
|
||||
//bot has been setup successfully
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1016,7 +1016,7 @@ void Bot1FCTFOrders_FlagAtCenter(bot_state_t *bs) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else { //agressive
|
||||
else { //aggressive
|
||||
//different orders based on the number of team mates
|
||||
switch(numteammates) {
|
||||
case 1: break;
|
||||
|
@ -1202,7 +1202,7 @@ void Bot1FCTFOrders_TeamHasFlag(bot_state_t *bs) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else { //agressive
|
||||
else { //aggressive
|
||||
//different orders based on the number of team mates
|
||||
switch(numteammates) {
|
||||
case 1: break;
|
||||
|
@ -1366,7 +1366,7 @@ void Bot1FCTFOrders_EnemyHasFlag(bot_state_t *bs) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else { //agressive
|
||||
else { //aggressive
|
||||
//different orders based on the number of team mates
|
||||
switch(numteammates) {
|
||||
case 1: break;
|
||||
|
@ -1513,7 +1513,7 @@ void Bot1FCTFOrders_EnemyDroppedFlag(bot_state_t *bs) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else { //agressive
|
||||
else { //aggressive
|
||||
//different orders based on the number of team mates
|
||||
switch(numteammates) {
|
||||
case 1: break;
|
||||
|
|
|
@ -1376,7 +1376,7 @@ double fabs( double x ) {
|
|||
* probably requires libm on most operating systems. Don't yet
|
||||
* support the exponent (e,E) and sigfig (g,G). Also, fmtint()
|
||||
* was pretty badly broken, it just wasn't being exercised in ways
|
||||
* which showed it, so that's been fixed. Also, formated the code
|
||||
* which showed it, so that's been fixed. Also, formatted the code
|
||||
* to mutt conventions, and removed dead code left over from the
|
||||
* original. Also, there is now a builtin-test, just compile with:
|
||||
* gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
|
||||
|
|
|
@ -899,7 +899,7 @@ static void PM_NoclipMove( void ) {
|
|||
================
|
||||
PM_FootstepForSurface
|
||||
|
||||
Returns an event number apropriate for the groundsurface
|
||||
Returns an event number appropriate for the groundsurface
|
||||
================
|
||||
*/
|
||||
static int PM_FootstepForSurface( void ) {
|
||||
|
@ -1402,7 +1402,7 @@ static void PM_Footsteps( void ) {
|
|||
old = pm->ps->bobCycle;
|
||||
pm->ps->bobCycle = (int)( old + bobmove * pml.msec ) & 255;
|
||||
|
||||
// if we just crossed a cycle boundary, play an apropriate footstep event
|
||||
// if we just crossed a cycle boundary, play an appropriate footstep event
|
||||
if ( ( ( old + 64 ) ^ ( pm->ps->bobCycle + 64 ) ) & 128 ) {
|
||||
if ( pm->waterlevel == 0 ) {
|
||||
// on ground will only play sounds if running
|
||||
|
@ -1694,8 +1694,8 @@ static void PM_Weapon( void ) {
|
|||
else
|
||||
if( bg_itemlist[pm->ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_AMMOREGEN ) {
|
||||
addTime /= 1.3;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ( pm->ps->powerups[PW_HASTE] ) {
|
||||
addTime /= 1.3;
|
||||
|
|
|
@ -210,7 +210,7 @@ typedef enum {
|
|||
STAT_ARMOR,
|
||||
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?)
|
||||
STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
|
||||
STAT_MAX_HEALTH // health / armor limit, changable by handicap
|
||||
STAT_MAX_HEALTH // health / armor limit, changeable by handicap
|
||||
} statIndex_t;
|
||||
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void P_DamageFeedback( gentity_t *player ) {
|
|||
client->ps.damageYaw = angles[YAW]/360.0 * 256;
|
||||
}
|
||||
|
||||
// play an apropriate pain sound
|
||||
// play an appropriate pain sound
|
||||
if ( (level.time > player->pain_debounce_time) && !(player->flags & FL_GODMODE) ) {
|
||||
player->pain_debounce_time = level.time + 700;
|
||||
G_AddEvent( player, EV_PAIN, player->health );
|
||||
|
@ -279,7 +279,7 @@ void G_TouchTriggers( gentity_t *ent ) {
|
|||
}
|
||||
}
|
||||
|
||||
// use seperate code for determining if an item is picked up
|
||||
// use separate code for determining if an item is picked up
|
||||
// so you don't have to actually contact its bounding box
|
||||
if ( hit->s.eType == ET_ITEM ) {
|
||||
if ( !BG_PlayerTouchesItem( &ent->client->ps, &hit->s, level.time ) ) {
|
||||
|
|
|
@ -724,6 +724,9 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay
|
|||
}
|
||||
Info_SetValueForKey( userinfo, "characterfile", s );
|
||||
|
||||
// don't send tinfo to bots, they don't parse it
|
||||
Info_SetValueForKey( userinfo, "teamoverlay", "0" );
|
||||
|
||||
// register the userinfo
|
||||
trap_SetUserinfo( clientNum, userinfo );
|
||||
|
||||
|
@ -814,19 +817,19 @@ void Svcmd_BotList_f( void ) {
|
|||
|
||||
trap_Print("^1name model aifile funname\n");
|
||||
for (i = 0; i < g_numBots; i++) {
|
||||
strcpy(name, Info_ValueForKey( g_botInfos[i], "name" ));
|
||||
Q_strncpyz(name, Info_ValueForKey( g_botInfos[i], "name" ), sizeof( name ));
|
||||
if ( !*name ) {
|
||||
strcpy(name, "UnnamedPlayer");
|
||||
}
|
||||
strcpy(funname, Info_ValueForKey( g_botInfos[i], "funname" ));
|
||||
Q_strncpyz(funname, Info_ValueForKey( g_botInfos[i], "funname" ), sizeof( funname ));
|
||||
if ( !*funname ) {
|
||||
strcpy(funname, "");
|
||||
}
|
||||
strcpy(model, Info_ValueForKey( g_botInfos[i], "model" ));
|
||||
Q_strncpyz(model, Info_ValueForKey( g_botInfos[i], "model" ), sizeof( model ));
|
||||
if ( !*model ) {
|
||||
strcpy(model, "visor/default");
|
||||
}
|
||||
strcpy(aifile, Info_ValueForKey( g_botInfos[i], "aifile"));
|
||||
Q_strncpyz(aifile, Info_ValueForKey( g_botInfos[i], "aifile"), sizeof( aifile ));
|
||||
if (!*aifile ) {
|
||||
strcpy(aifile, "bots/default_c.c");
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ void SP_info_player_deathmatch( gentity_t *ent ) {
|
|||
}
|
||||
|
||||
/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 32)
|
||||
equivelant to info_player_deathmatch
|
||||
equivalent to info_player_deathmatch
|
||||
*/
|
||||
void SP_info_player_start(gentity_t *ent) {
|
||||
ent->classname = "info_player_deathmatch";
|
||||
|
@ -377,7 +377,7 @@ void InitBodyQue (void) {
|
|||
=============
|
||||
BodySink
|
||||
|
||||
After sitting around for five seconds, fall into the ground and dissapear
|
||||
After sitting around for five seconds, fall into the ground and disappear
|
||||
=============
|
||||
*/
|
||||
void BodySink( gentity_t *ent ) {
|
||||
|
@ -803,7 +803,7 @@ void ClientUserinfoChanged( int clientNum ) {
|
|||
*/
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (g_gametype.integer >= GT_TEAM) {
|
||||
if (g_gametype.integer >= GT_TEAM && !(ent->r.svFlags & SVF_BOT)) {
|
||||
client->pers.teamInfo = qtrue;
|
||||
} else {
|
||||
s = Info_ValueForKey( userinfo, "teamoverlay" );
|
||||
|
@ -838,11 +838,11 @@ void ClientUserinfoChanged( int clientNum ) {
|
|||
teamLeader = client->sess.teamLeader;
|
||||
|
||||
// colors
|
||||
strcpy(c1, Info_ValueForKey( userinfo, "color1" ));
|
||||
strcpy(c2, Info_ValueForKey( userinfo, "color2" ));
|
||||
Q_strncpyz(c1, Info_ValueForKey( userinfo, "color1" ), sizeof( c1 ));
|
||||
Q_strncpyz(c2, Info_ValueForKey( userinfo, "color2" ), sizeof( c2 ));
|
||||
|
||||
strcpy(redTeam, Info_ValueForKey( userinfo, "g_redteam" ));
|
||||
strcpy(blueTeam, Info_ValueForKey( userinfo, "g_blueteam" ));
|
||||
Q_strncpyz(redTeam, Info_ValueForKey( userinfo, "g_redteam" ), sizeof( redTeam ));
|
||||
Q_strncpyz(blueTeam, Info_ValueForKey( userinfo, "g_blueteam" ), sizeof( blueTeam ));
|
||||
|
||||
// send over a subset of the userinfo keys so other clients can
|
||||
// print scoreboards, display models, and play custom sounds
|
||||
|
@ -954,7 +954,7 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
|
|||
}
|
||||
G_ReadSessionData( client );
|
||||
|
||||
// get and distribute relevent paramters
|
||||
// get and distribute relevant parameters
|
||||
G_LogPrintf( "ClientConnect: %i\n", clientNum );
|
||||
ClientUserinfoChanged( clientNum );
|
||||
|
||||
|
|
|
@ -639,7 +639,7 @@ void SetTeam( gentity_t *ent, const char *s ) {
|
|||
|
||||
BroadcastTeamChange( client, oldTeam );
|
||||
|
||||
// get and distribute relevent paramters
|
||||
// get and distribute relevant parameters
|
||||
ClientUserinfoChanged( clientNum );
|
||||
|
||||
// client hasn't spawned yet, they sent an early team command, teampref userinfo, or g_teamAutoJoin is enabled
|
||||
|
@ -921,7 +921,7 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
|
|||
G_Printf( "%s%s\n", name, text);
|
||||
}
|
||||
|
||||
// send it to all the apropriate clients
|
||||
// send it to all the appropriate clients
|
||||
for (j = 0; j < level.maxclients; j++) {
|
||||
other = &g_entities[j];
|
||||
G_SayTo( ent, other, mode, color, name, text );
|
||||
|
@ -1062,7 +1062,7 @@ void G_Voice( gentity_t *ent, gentity_t *target, int mode, const char *id, qbool
|
|||
G_Printf( "voice: %s %s\n", ent->client->pers.netname, id);
|
||||
}
|
||||
|
||||
// send it to all the apropriate clients
|
||||
// send it to all the appropriate clients
|
||||
for (j = 0; j < level.maxclients; j++) {
|
||||
other = &g_entities[j];
|
||||
G_VoiceTo( ent, other, mode, id, voiceonly );
|
||||
|
|
|
@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
Respawnable items don't actually go away when picked up, they are
|
||||
just made invisible and untouchable. This allows them to ride
|
||||
movers and respawn apropriately.
|
||||
movers and respawn appropriately.
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -1366,6 +1366,12 @@ void CheckExitRules( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( g_timelimit.integer < 0 || g_timelimit.integer > INT_MAX / 60000 ) {
|
||||
G_Printf( "timelimit %i is out of range, defaulting to 0\n", g_timelimit.integer );
|
||||
trap_Cvar_Set( "timelimit", "0" );
|
||||
trap_Cvar_Update( &g_timelimit );
|
||||
}
|
||||
|
||||
if ( g_timelimit.integer && !level.warmupTime ) {
|
||||
if ( level.time - level.startTime >= g_timelimit.integer*60000 ) {
|
||||
trap_SendServerCommand( -1, "print \"Timelimit hit.\n\"");
|
||||
|
@ -1374,6 +1380,12 @@ void CheckExitRules( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( g_fraglimit.integer < 0 ) {
|
||||
G_Printf( "fraglimit %i is out of range, defaulting to 0\n", g_fraglimit.integer );
|
||||
trap_Cvar_Set( "fraglimit", "0" );
|
||||
trap_Cvar_Update( &g_fraglimit );
|
||||
}
|
||||
|
||||
if ( g_gametype.integer < GT_CTF && g_fraglimit.integer ) {
|
||||
if ( level.teamScores[TEAM_RED] >= g_fraglimit.integer ) {
|
||||
trap_SendServerCommand( -1, "print \"Red hit the fraglimit.\n\"" );
|
||||
|
@ -1405,6 +1417,12 @@ void CheckExitRules( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( g_capturelimit.integer < 0 ) {
|
||||
G_Printf( "capturelimit %i is out of range, defaulting to 0\n", g_capturelimit.integer );
|
||||
trap_Cvar_Set( "capturelimit", "0" );
|
||||
trap_Cvar_Update( &g_capturelimit );
|
||||
}
|
||||
|
||||
if ( g_gametype.integer >= GT_CTF && g_capturelimit.integer ) {
|
||||
|
||||
if ( level.teamScores[TEAM_RED] >= g_capturelimit.integer ) {
|
||||
|
|
|
@ -145,7 +145,7 @@ void ProximityMine_Trigger( gentity_t *trigger, gentity_t *other, trace_t *trace
|
|||
}
|
||||
}
|
||||
|
||||
// ok, now check for ability to damage so we don't get triggered thru walls, closed doors, etc...
|
||||
// ok, now check for ability to damage so we don't get triggered through walls, closed doors, etc...
|
||||
if( !CanDamage( other, trigger->s.pos.trBase ) ) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
|
|||
}
|
||||
|
||||
// if it is ok to leave in the old position, do it
|
||||
// this is only relevent for riding entities, not pushed
|
||||
// this is only relevant for riding entities, not pushed
|
||||
// Sliding trapdoors can cause this.
|
||||
VectorCopy( (pushed_p-1)->origin, check->s.pos.trBase);
|
||||
if ( check->client ) {
|
||||
|
@ -424,7 +424,7 @@ void G_MoverTeam( gentity_t *ent ) {
|
|||
|
||||
obstacle = NULL;
|
||||
|
||||
// make sure all team slaves can move before commiting
|
||||
// make sure all team slaves can move before committing
|
||||
// any moves or calling any think functions
|
||||
// if the move is blocked, all moved objects will be backed out
|
||||
pushed_p = pushed;
|
||||
|
@ -718,7 +718,7 @@ void InitMover( gentity_t *ent ) {
|
|||
qboolean lightSet, colorSet;
|
||||
char *sound;
|
||||
|
||||
// if the "model2" key is set, use a seperate model
|
||||
// if the "model2" key is set, use a separate model
|
||||
// for drawing, but clip against the brushes
|
||||
if ( ent->model2 ) {
|
||||
ent->s.modelindex2 = G_ModelIndex( ent->model2 );
|
||||
|
@ -1279,7 +1279,7 @@ void Reached_Train( gentity_t *ent ) {
|
|||
vec3_t move;
|
||||
float length;
|
||||
|
||||
// copy the apropriate values
|
||||
// copy the appropriate values
|
||||
next = ent->nextTrain;
|
||||
if ( !next || !next->nextTrain ) {
|
||||
return; // just stop
|
||||
|
|
|
@ -391,7 +391,7 @@ void G_ParseField( const char *key, const char *value, gentity_t *ent ) {
|
|||
G_SpawnGEntityFromSpawnVars
|
||||
|
||||
Spawn an entity and fill in all of the level fields from
|
||||
level.spawnVars[], then call the class specfic spawn function
|
||||
level.spawnVars[], then call the class specific spawn function
|
||||
===================
|
||||
*/
|
||||
void G_SpawnGEntityFromSpawnVars( void ) {
|
||||
|
|
|
@ -102,7 +102,7 @@ void Use_Target_Delay( gentity_t *ent, gentity_t *other, gentity_t *activator )
|
|||
}
|
||||
|
||||
void SP_target_delay( gentity_t *ent ) {
|
||||
// check delay for backwards compatability
|
||||
// check delay for backwards compatibility
|
||||
if ( !G_SpawnFloat( "delay", "0", &ent->wait ) ) {
|
||||
G_SpawnFloat( "wait", "1", &ent->wait );
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ Any entity that touches this will be hurt.
|
|||
It does dmg points of damage each server frame
|
||||
Targeting the trigger will toggle its on / off state.
|
||||
|
||||
SILENT supresses playing the sound
|
||||
SILENT suppresses playing the sound
|
||||
SLOW changes the damage rate to once per second
|
||||
NO_PROTECTION *nothing* stops the damage
|
||||
|
||||
|
|
|
@ -275,6 +275,7 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
|
|||
vec3_t impactpoint, bouncedir;
|
||||
#endif
|
||||
vec3_t tr_start, tr_end;
|
||||
qboolean hitClient = qfalse;
|
||||
|
||||
passent = ent->s.number;
|
||||
VectorCopy( start, tr_start );
|
||||
|
@ -304,19 +305,12 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
|
|||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
damage, 0, MOD_SHOTGUN);
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
#else
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
#endif
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
hitClient = qtrue;
|
||||
}
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
|
||||
return hitClient;
|
||||
}
|
||||
return qfalse;
|
||||
}
|
||||
|
@ -663,14 +657,11 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
|||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
damage, 0, MOD_LIGHTNING);
|
||||
}
|
||||
#else
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
damage, 0, MOD_LIGHTNING);
|
||||
#endif
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
ent->client->accuracy_hits++;
|
||||
}
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_LIGHTNING);
|
||||
}
|
||||
|
||||
if ( traceEnt->takedamage && traceEnt->client ) {
|
||||
|
@ -678,9 +669,6 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
|||
tent->s.otherEntityNum = traceEnt->s.number;
|
||||
tent->s.eventParm = DirToByte( tr.plane.normal );
|
||||
tent->s.weapon = ent->s.weapon;
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
ent->client->accuracy_hits++;
|
||||
}
|
||||
} else if ( !( tr.surfaceFlags & SURF_NOIMPACT ) ) {
|
||||
tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS );
|
||||
tent->s.eventParm = DirToByte( tr.plane.normal );
|
||||
|
@ -930,7 +918,7 @@ static void KamikazeRadiusDamage( vec3_t origin, gentity_t *attacker, float dama
|
|||
continue;
|
||||
}
|
||||
|
||||
// dont hit things we have already hit
|
||||
// don't hit things we have already hit
|
||||
if( ent->kamikazeTime > level.time ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -990,7 +978,7 @@ static void KamikazeShockWave( vec3_t origin, gentity_t *attacker, float damage,
|
|||
for ( e = 0 ; e < numListedEntities ; e++ ) {
|
||||
ent = &g_entities[entityList[ e ]];
|
||||
|
||||
// dont hit things we have already hit
|
||||
// don't hit things we have already hit
|
||||
if( ent->kamikazeShockTime > level.time ) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -803,7 +803,7 @@ static void NeedCDKeyAction( qboolean result ) {
|
|||
|
||||
void UI_SetActiveMenu( uiMenuCommand_t menu ) {
|
||||
// this should be the ONLY way the menu system is brought up
|
||||
// enusure minumum menu data is cached
|
||||
// ensure minimum menu data is cached
|
||||
Menu_Cache();
|
||||
|
||||
switch ( menu ) {
|
||||
|
|
|
@ -169,7 +169,7 @@ static void UI_LoadArenas( void ) {
|
|||
int numdirs;
|
||||
vmCvar_t arenasFile;
|
||||
char filename[128];
|
||||
char dirlist[2048];
|
||||
char dirlist[4096];
|
||||
char* dirptr;
|
||||
int i, n;
|
||||
int dirlen;
|
||||
|
@ -188,7 +188,7 @@ static void UI_LoadArenas( void ) {
|
|||
}
|
||||
|
||||
// get all arenas from .arena files
|
||||
numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, 2048 );
|
||||
numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, 4096 );
|
||||
dirptr = dirlist;
|
||||
for (i = 0; i < numdirs; i++, dirptr += dirlen+1) {
|
||||
dirlen = strlen(dirptr);
|
||||
|
|
|
@ -221,7 +221,7 @@ typedef struct
|
|||
int width;
|
||||
int height;
|
||||
int columns;
|
||||
int seperation;
|
||||
int separation;
|
||||
} menulist_s;
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -339,14 +339,14 @@ static void PlayerModel_PicEvent( void* ptr, int event )
|
|||
Q_strncpyz(s_playermodel.modelskin,buffptr,pdest-buffptr+1);
|
||||
strcat(s_playermodel.modelskin,pdest + 5);
|
||||
|
||||
// seperate the model name
|
||||
// separate the model name
|
||||
maxlen = pdest-buffptr;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
Q_strncpyz( s_playermodel.modelname.string, buffptr, maxlen );
|
||||
Q_strupr( s_playermodel.modelname.string );
|
||||
|
||||
// seperate the skin name
|
||||
// separate the skin name
|
||||
maxlen = strlen(pdest+5)+1;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
|
@ -494,14 +494,14 @@ static void PlayerModel_SetMenuItems( void )
|
|||
s_playermodel.selectedmodel = i;
|
||||
s_playermodel.modelpage = i/MAX_MODELSPERPAGE;
|
||||
|
||||
// seperate the model name
|
||||
// separate the model name
|
||||
maxlen = pdest-buffptr;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
Q_strncpyz( s_playermodel.modelname.string, buffptr, maxlen );
|
||||
Q_strupr( s_playermodel.modelname.string );
|
||||
|
||||
// seperate the skin name
|
||||
// separate the skin name
|
||||
maxlen = strlen(pdest+5)+1;
|
||||
if (maxlen > 16)
|
||||
maxlen = 16;
|
||||
|
|
|
@ -881,13 +881,13 @@ static void ScrollList_Init( menulist_s *l )
|
|||
|
||||
if( !l->columns ) {
|
||||
l->columns = 1;
|
||||
l->seperation = 0;
|
||||
l->separation = 0;
|
||||
}
|
||||
else if( !l->seperation ) {
|
||||
l->seperation = 3;
|
||||
else if( !l->separation ) {
|
||||
l->separation = 3;
|
||||
}
|
||||
|
||||
w = ( (l->width + l->seperation) * l->columns - l->seperation) * SMALLCHAR_WIDTH;
|
||||
w = ( (l->width + l->separation) * l->columns - l->separation) * SMALLCHAR_WIDTH;
|
||||
|
||||
l->generic.left = l->generic.x;
|
||||
l->generic.top = l->generic.y;
|
||||
|
@ -926,14 +926,14 @@ sfxHandle_t ScrollList_Key( menulist_s *l, int key )
|
|||
// check scroll region
|
||||
x = l->generic.x;
|
||||
y = l->generic.y;
|
||||
w = ( (l->width + l->seperation) * l->columns - l->seperation) * SMALLCHAR_WIDTH;
|
||||
w = ( (l->width + l->separation) * l->columns - l->separation) * SMALLCHAR_WIDTH;
|
||||
if( l->generic.flags & QMF_CENTER_JUSTIFY ) {
|
||||
x -= w / 2;
|
||||
}
|
||||
if (UI_CursorInRect( x, y, w, l->height*SMALLCHAR_HEIGHT ))
|
||||
{
|
||||
cursorx = (uis.cursorx - x)/SMALLCHAR_WIDTH;
|
||||
column = cursorx / (l->width + l->seperation);
|
||||
column = cursorx / (l->width + l->separation);
|
||||
cursory = (uis.cursory - y)/SMALLCHAR_HEIGHT;
|
||||
index = column * l->height + cursory;
|
||||
if (l->top + index < l->numitems)
|
||||
|
@ -1285,7 +1285,7 @@ void ScrollList_Draw( menulist_s *l )
|
|||
|
||||
y += SMALLCHAR_HEIGHT;
|
||||
}
|
||||
x += (l->width + l->seperation) * SMALLCHAR_WIDTH;
|
||||
x += (l->width + l->separation) * SMALLCHAR_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1105,7 +1105,7 @@ static void CM_PatchCollideFromGrid( cGrid_t *grid, patchCollide_t *pf ) {
|
|||
numFacets++;
|
||||
}
|
||||
} else {
|
||||
// two seperate triangles
|
||||
// two separate triangles
|
||||
facet->surfacePlane = gridPlanes[i][j][0];
|
||||
facet->numBorders = 3;
|
||||
facet->borderPlanes[0] = borders[EN_TOP];
|
||||
|
@ -1214,7 +1214,7 @@ struct patchCollide_s *CM_GeneratePatchCollide( int width, int height, vec3_t *p
|
|||
CM_RemoveDegenerateColumns( &grid );
|
||||
|
||||
// we now have a grid of points exactly on the curve
|
||||
// the aproximate surface defined by these points will be
|
||||
// the approximate surface defined by these points will be
|
||||
// collided against
|
||||
pf = Hunk_Alloc( sizeof( *pf ), h_high );
|
||||
ClearBounds( pf->bounds[0], pf->bounds[1] );
|
||||
|
@ -1369,7 +1369,7 @@ int CM_CheckFacetPlane(float *plane, vec3_t start, vec3_t end, float *enterFrac,
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
// if it doesn't cross the plane, the plane isn't relevent
|
||||
// if it doesn't cross the plane, the plane isn't relevant
|
||||
if (d1 <= 0 && d2 <= 0 ) {
|
||||
return qtrue;
|
||||
}
|
||||
|
@ -1433,7 +1433,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
VectorCopy(planes->plane, plane);
|
||||
plane[3] = planes->plane[3];
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -1472,7 +1472,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
plane[3] = planes->plane[3];
|
||||
}
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -1561,7 +1561,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
|
|||
VectorCopy(planes->plane, plane);
|
||||
plane[3] = planes->plane[3];
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -1594,7 +1594,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli
|
|||
plane[3] = planes->plane[3];
|
||||
}
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
|
|
@ -353,7 +353,7 @@ void ClipWindingEpsilon (winding_t *in, vec3_t normal, vec_t dist,
|
|||
return;
|
||||
}
|
||||
|
||||
maxpts = in->numpoints+4; // cant use counts[0]+2 because
|
||||
maxpts = in->numpoints+4; // can't use counts[0]+2 because
|
||||
// of fp grouping errors
|
||||
|
||||
*front = f = AllocWinding (maxpts);
|
||||
|
@ -462,7 +462,7 @@ void ChopWindingInPlace (winding_t **inout, vec3_t normal, vec_t dist, vec_t eps
|
|||
if (!counts[1])
|
||||
return; // inout stays the same
|
||||
|
||||
maxpts = in->numpoints+4; // cant use counts[0]+2 because
|
||||
maxpts = in->numpoints+4; // can't use counts[0]+2 because
|
||||
// of fp grouping errors
|
||||
|
||||
f = AllocWinding (maxpts);
|
||||
|
@ -574,7 +574,7 @@ void CheckWinding (winding_t *w)
|
|||
if (d < -ON_EPSILON || d > ON_EPSILON)
|
||||
Com_Error (ERR_DROP, "CheckWinding: point off plane");
|
||||
|
||||
// check the edge isnt degenerate
|
||||
// check the edge isn't degenerate
|
||||
p2 = w->p[j];
|
||||
VectorSubtract (p2, p1, dir);
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void CM_TestBoxInBrush( traceWork_t *tw, cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
dist = plane->dist + tw->sphere.radius;
|
||||
// find the closest point on the capsule to the plane
|
||||
t = DotProduct( plane->normal, tw->sphere.offset );
|
||||
|
@ -214,7 +214,7 @@ void CM_TestBoxInBrush( traceWork_t *tw, cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for mins/maxs
|
||||
// adjust the plane distance appropriately for mins/maxs
|
||||
dist = plane->dist - DotProduct( tw->offsets[ plane->signbits ], plane->normal );
|
||||
|
||||
d1 = DotProduct( tw->start, plane->normal ) - dist;
|
||||
|
@ -517,7 +517,7 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for radius
|
||||
// adjust the plane distance appropriately for radius
|
||||
dist = plane->dist + tw->sphere.radius;
|
||||
|
||||
// find the closest point on the capsule to the plane
|
||||
|
@ -548,7 +548,7 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// if it doesn't cross the plane, the plane isn't relevent
|
||||
// if it doesn't cross the plane, the plane isn't relevant
|
||||
if (d1 <= 0 && d2 <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -584,7 +584,7 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) {
|
|||
side = brush->sides + i;
|
||||
plane = side->plane;
|
||||
|
||||
// adjust the plane distance apropriately for mins/maxs
|
||||
// adjust the plane distance appropriately for mins/maxs
|
||||
dist = plane->dist - DotProduct( tw->offsets[ plane->signbits ], plane->normal );
|
||||
|
||||
d1 = DotProduct( tw->start, plane->normal ) - dist;
|
||||
|
@ -602,7 +602,7 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// if it doesn't cross the plane, the plane isn't relevent
|
||||
// if it doesn't cross the plane, the plane isn't relevant
|
||||
if (d1 <= 0 && d2 <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1059,7 +1059,7 @@ void CM_TraceThroughTree( traceWork_t *tw, int num, float p1f, float p2f, vec3_t
|
|||
node = cm.nodes + num;
|
||||
plane = node->plane;
|
||||
|
||||
// adjust the plane distance apropriately for mins/maxs
|
||||
// adjust the plane distance appropriately for mins/maxs
|
||||
if ( plane->type < 3 ) {
|
||||
t1 = p1[plane->type] - plane->dist;
|
||||
t2 = p2[plane->type] - plane->dist;
|
||||
|
@ -1210,7 +1210,7 @@ void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, vec3_t mi
|
|||
|
||||
tw.maxOffset = tw.size[1][0] + tw.size[1][1] + tw.size[1][2];
|
||||
|
||||
// tw.offsets[signbits] = vector to apropriate corner from origin
|
||||
// tw.offsets[signbits] = vector to appropriate corner from origin
|
||||
tw.offsets[0][0] = tw.size[0][0];
|
||||
tw.offsets[0][1] = tw.size[0][1];
|
||||
tw.offsets[0][2] = tw.size[0][2];
|
||||
|
|
|
@ -489,8 +489,8 @@ void Cmd_Args_Sanitize(void)
|
|||
Cmd_TokenizeString
|
||||
|
||||
Parses the given string into command line tokens.
|
||||
The text is copied to a seperate buffer and 0 characters
|
||||
are inserted in the apropriate place, The argv array
|
||||
The text is copied to a separate buffer and 0 characters
|
||||
are inserted in the appropriate place, The argv array
|
||||
will point into this temporary buffer.
|
||||
============
|
||||
*/
|
||||
|
|
|
@ -55,7 +55,7 @@ int demo_protocols[] =
|
|||
int com_argc;
|
||||
char *com_argv[MAX_NUM_ARGVS+1];
|
||||
|
||||
jmp_buf abortframe; // an ERR_DROP occured, exit the entire frame
|
||||
jmp_buf abortframe; // an ERR_DROP occurred, exit the entire frame
|
||||
|
||||
|
||||
FILE *debuglogfile;
|
||||
|
@ -167,7 +167,7 @@ void Com_EndRedirect (void)
|
|||
Com_Printf
|
||||
|
||||
Both client and server can use this, and it will output
|
||||
to the apropriate place.
|
||||
to the appropriate place.
|
||||
|
||||
A raw string should NEVER be passed as fmt, because of "%f" type crashers.
|
||||
=============
|
||||
|
@ -379,7 +379,7 @@ void QDECL Com_Error( int code, const char *fmt, ... ) {
|
|||
Com_Quit_f
|
||||
|
||||
Both client and server can use this, and it will
|
||||
do the apropriate things.
|
||||
do the appropriate things.
|
||||
=============
|
||||
*/
|
||||
void Com_Quit_f( void ) {
|
||||
|
@ -407,7 +407,7 @@ void Com_Quit_f( void ) {
|
|||
|
||||
COMMAND LINE FUNCTIONS
|
||||
|
||||
+ characters seperate the commandLine string into multiple console
|
||||
+ characters separate the commandLine string into multiple console
|
||||
command lines.
|
||||
|
||||
All of these are valid:
|
||||
|
@ -516,7 +516,7 @@ void Com_StartupVariable( const char *match ) {
|
|||
Com_AddStartupCommands
|
||||
|
||||
Adds command line parameters as script statements
|
||||
Commands are seperated by + signs
|
||||
Commands are separated by + signs
|
||||
|
||||
Returns qtrue if any late commands were added, which
|
||||
will keep the demoloop from immediately starting
|
||||
|
@ -803,19 +803,19 @@ typedef struct {
|
|||
} memzone_t;
|
||||
|
||||
// main zone for all "dynamic" memory allocation
|
||||
memzone_t *mainzone;
|
||||
static memzone_t *mainzone;
|
||||
// we also have a small zone for small allocations that would only
|
||||
// fragment the main zone (think of cvar and cmd strings)
|
||||
memzone_t *smallzone;
|
||||
static memzone_t *smallzone;
|
||||
|
||||
void Z_CheckHeap( void );
|
||||
static void Z_CheckHeap( void );
|
||||
|
||||
/*
|
||||
========================
|
||||
Z_ClearZone
|
||||
========================
|
||||
*/
|
||||
void Z_ClearZone( memzone_t *zone, int size ) {
|
||||
static void Z_ClearZone( memzone_t *zone, int size ) {
|
||||
memblock_t *block;
|
||||
|
||||
// set the entire zone to one free block
|
||||
|
@ -840,7 +840,7 @@ void Z_ClearZone( memzone_t *zone, int size ) {
|
|||
Z_AvailableZoneMemory
|
||||
========================
|
||||
*/
|
||||
int Z_AvailableZoneMemory( memzone_t *zone ) {
|
||||
static int Z_AvailableZoneMemory( memzone_t *zone ) {
|
||||
return zone->size - zone->used;
|
||||
}
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ void *S_Malloc( int size ) {
|
|||
Z_CheckHeap
|
||||
========================
|
||||
*/
|
||||
void Z_CheckHeap( void ) {
|
||||
static void Z_CheckHeap( void ) {
|
||||
memblock_t *block;
|
||||
|
||||
for (block = mainzone->blocklist.next ; ; block = block->next) {
|
||||
|
@ -1218,7 +1218,7 @@ char *CopyString( const char *in ) {
|
|||
==============================================================================
|
||||
|
||||
Goals:
|
||||
reproducable without history effects -- no out of memory errors on weird map to map changes
|
||||
reproducible without history effects -- no out of memory errors on weird map to map changes
|
||||
allow restarting of the client without fragmentation
|
||||
minimize total pages in use at run time
|
||||
minimize total pages needed during load time
|
||||
|
@ -1385,7 +1385,7 @@ Touch all known used data to make sure it is paged in
|
|||
void Com_TouchMemory( void ) {
|
||||
int start, end;
|
||||
int i, j;
|
||||
int sum;
|
||||
unsigned sum;
|
||||
memblock_t *block;
|
||||
|
||||
Z_CheckHeap();
|
||||
|
@ -2448,16 +2448,7 @@ Expose possibility to change current running mod to the user
|
|||
|
||||
void Com_GameRestart_f(void)
|
||||
{
|
||||
if(!FS_FilenameCompare(Cmd_Argv(1), com_basegame->string))
|
||||
{
|
||||
// This is the standard base game. Servers and clients should
|
||||
// use "" and not the standard basegame name because this messes
|
||||
// up pak file negotiation and lots of other stuff
|
||||
|
||||
Cvar_Set("fs_game", "");
|
||||
}
|
||||
else
|
||||
Cvar_Set("fs_game", Cmd_Argv(1));
|
||||
Cvar_Set("fs_game", Cmd_Argv(1));
|
||||
|
||||
Com_GameRestart(0, qtrue);
|
||||
}
|
||||
|
@ -2793,10 +2784,7 @@ void Com_Init( char *commandLine ) {
|
|||
|
||||
com_standalone = Cvar_Get("com_standalone", "0", CVAR_ROM);
|
||||
com_basegame = Cvar_Get("com_basegame", BASEGAME, CVAR_INIT);
|
||||
com_homepath = Cvar_Get("com_homepath", "", CVAR_INIT);
|
||||
|
||||
if(!com_basegame->string[0])
|
||||
Cvar_ForceReset("com_basegame");
|
||||
com_homepath = Cvar_Get("com_homepath", "", CVAR_INIT|CVAR_PROTECTED);
|
||||
|
||||
FS_InitFilesystem ();
|
||||
|
||||
|
@ -3032,9 +3020,6 @@ Writes key bindings and archived cvars to config file if modified
|
|||
===============
|
||||
*/
|
||||
void Com_WriteConfiguration( void ) {
|
||||
#if !defined(DEDICATED) && !defined(STANDALONE)
|
||||
cvar_t *fs;
|
||||
#endif
|
||||
// if we are quiting without fully initializing, make sure
|
||||
// we don't write out anything
|
||||
if ( !com_fullyInitialized ) {
|
||||
|
@ -3050,12 +3035,12 @@ void Com_WriteConfiguration( void ) {
|
|||
|
||||
// not needed for dedicated or standalone
|
||||
#if !defined(DEDICATED) && !defined(STANDALONE)
|
||||
fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
|
||||
|
||||
if(!com_standalone->integer)
|
||||
{
|
||||
if (UI_usesUniqueCDKey() && fs && fs->string[0] != 0) {
|
||||
Com_WriteCDKey( fs->string, &cl_cdkey[16] );
|
||||
const char *gamedir;
|
||||
gamedir = Cvar_VariableString( "fs_game" );
|
||||
if (UI_usesUniqueCDKey() && gamedir[0] != 0) {
|
||||
Com_WriteCDKey( gamedir, &cl_cdkey[16] );
|
||||
} else {
|
||||
Com_WriteCDKey( BASEGAME, cl_cdkey );
|
||||
}
|
||||
|
|
|
@ -1332,12 +1332,42 @@ void Cvar_Register(vmCvar_t *vmCvar, const char *varName, const char *defaultVal
|
|||
// flags. Unfortunately some historical game code (including single player
|
||||
// baseq3) sets both flags. We unset CVAR_ROM for such cvars.
|
||||
if ((flags & (CVAR_ARCHIVE | CVAR_ROM)) == (CVAR_ARCHIVE | CVAR_ROM)) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: Unsetting CVAR_ROM cvar '%s', "
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: Unsetting CVAR_ROM from cvar '%s', "
|
||||
"since it is also CVAR_ARCHIVE\n", varName );
|
||||
flags &= ~CVAR_ROM;
|
||||
}
|
||||
|
||||
cv = Cvar_Get(varName, defaultValue, flags | CVAR_VM_CREATED);
|
||||
// Don't allow VM to specific a different creator or other internal flags.
|
||||
if ( flags & CVAR_USER_CREATED ) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_USER_CREATED on cvar '%s'\n", varName );
|
||||
flags &= ~CVAR_USER_CREATED;
|
||||
}
|
||||
if ( flags & CVAR_SERVER_CREATED ) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_SERVER_CREATED on cvar '%s'\n", varName );
|
||||
flags &= ~CVAR_SERVER_CREATED;
|
||||
}
|
||||
if ( flags & CVAR_PROTECTED ) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_PROTECTED on cvar '%s'\n", varName );
|
||||
flags &= ~CVAR_PROTECTED;
|
||||
}
|
||||
if ( flags & CVAR_MODIFIED ) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_MODIFIED on cvar '%s'\n", varName );
|
||||
flags &= ~CVAR_MODIFIED;
|
||||
}
|
||||
if ( flags & CVAR_NONEXISTENT ) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_NONEXISTENT on cvar '%s'\n", varName );
|
||||
flags &= ~CVAR_NONEXISTENT;
|
||||
}
|
||||
|
||||
cv = Cvar_FindVar(varName);
|
||||
|
||||
// Don't modify cvar if it's protected.
|
||||
if ( cv && ( cv->flags & CVAR_PROTECTED ) ) {
|
||||
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to register protected cvar '%s' with value '%s'%s\n",
|
||||
varName, defaultValue, ( flags & ~cv->flags ) != 0 ? " and new flags" : "" );
|
||||
} else {
|
||||
cv = Cvar_Get(varName, defaultValue, flags | CVAR_VM_CREATED);
|
||||
}
|
||||
|
||||
if (!vmCvar)
|
||||
return;
|
||||
|
|
|
@ -88,7 +88,7 @@ File search order: when FS_FOpenFileRead gets called it will go through the fs_s
|
|||
structure and stop on the first successful hit. fs_searchpaths is built with successive
|
||||
calls to FS_AddGameDirectory
|
||||
|
||||
Additionaly, we search in several subdirectories:
|
||||
Additionally, we search in several subdirectories:
|
||||
current game is the current mode
|
||||
base game is a variable to allow mods based on other mods
|
||||
(such as baseq3 + missionpack content combination in a mod for instance)
|
||||
|
@ -1430,7 +1430,7 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF
|
|||
}
|
||||
else
|
||||
{
|
||||
// When file is NULL, we're querying the existance of the file
|
||||
// When file is NULL, we're querying the existence of the file
|
||||
// If we've got here, it doesn't exist
|
||||
return 0;
|
||||
}
|
||||
|
@ -3077,6 +3077,23 @@ qboolean FS_CheckDirTraversal(const char *checkdir)
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
FS_InvalidGameDir
|
||||
|
||||
return true if path is a reference to current directory or directory traversal
|
||||
or a sub-directory
|
||||
================
|
||||
*/
|
||||
qboolean FS_InvalidGameDir( const char *gamedir ) {
|
||||
if ( !strcmp( gamedir, "." ) || !strcmp( gamedir, ".." )
|
||||
|| strchr( gamedir, '/' ) || strchr( gamedir, '\\' ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
FS_ComparePaks
|
||||
|
@ -3321,6 +3338,27 @@ static void FS_Startup( const char *gameName )
|
|||
fs_homepath = Cvar_Get ("fs_homepath", homePath, CVAR_INIT|CVAR_PROTECTED );
|
||||
fs_gamedirvar = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
|
||||
|
||||
if (!gameName[0]) {
|
||||
Cvar_ForceReset( "com_basegame" );
|
||||
}
|
||||
|
||||
if (!FS_FilenameCompare(fs_gamedirvar->string, gameName)) {
|
||||
// This is the standard base game. Servers and clients should
|
||||
// use "" and not the standard basegame name because this messes
|
||||
// up pak file negotiation and lots of other stuff
|
||||
Cvar_ForceReset( "fs_game" );
|
||||
}
|
||||
|
||||
if (FS_InvalidGameDir(gameName)) {
|
||||
Com_Error( ERR_DROP, "Invalid com_basegame '%s'", gameName );
|
||||
}
|
||||
if (FS_InvalidGameDir(fs_basegame->string)) {
|
||||
Com_Error( ERR_DROP, "Invalid fs_basegame '%s'", fs_basegame->string );
|
||||
}
|
||||
if (FS_InvalidGameDir(fs_gamedirvar->string)) {
|
||||
Com_Error( ERR_DROP, "Invalid fs_game '%s'", fs_gamedirvar->string );
|
||||
}
|
||||
|
||||
// add search path elements in reverse priority order
|
||||
fs_gogpath = Cvar_Get ("fs_gogpath", Sys_GogPath(), CVAR_INIT|CVAR_PROTECTED );
|
||||
if (fs_gogpath->string[0]) {
|
||||
|
@ -3381,14 +3419,10 @@ static void FS_Startup( const char *gameName )
|
|||
}
|
||||
|
||||
#ifndef STANDALONE
|
||||
if(!com_standalone->integer)
|
||||
{
|
||||
cvar_t *fs;
|
||||
|
||||
if (!com_standalone->integer) {
|
||||
Com_ReadCDKey(BASEGAME);
|
||||
fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO );
|
||||
if (fs && fs->string[0] != 0) {
|
||||
Com_AppendCDKey( fs->string );
|
||||
if (fs_gamedirvar->string[0]) {
|
||||
Com_AppendCDKey(fs_gamedirvar->string);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -4063,7 +4097,7 @@ void FS_PureServerSetReferencedPaks( const char *pakSums, const char *pakNames )
|
|||
================
|
||||
FS_InitFilesystem
|
||||
|
||||
Called only at inital startup, not when the filesystem
|
||||
Called only at initial startup, not when the filesystem
|
||||
is resetting due to a game change
|
||||
================
|
||||
*/
|
||||
|
|
|
@ -401,7 +401,7 @@ void Huff_Compress(msg_t *mbuf, int offset) {
|
|||
huff_t huff;
|
||||
|
||||
size = mbuf->cursize - offset;
|
||||
buffer = mbuf->data+ + offset;
|
||||
buffer = mbuf->data + offset;
|
||||
|
||||
if (size<=0) {
|
||||
return;
|
||||
|
|
|
@ -106,8 +106,11 @@ static void copy64(uint32_t *M, byte *in)
|
|||
int i;
|
||||
|
||||
for (i=0;i<16;i++)
|
||||
M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) |
|
||||
(in[i*4+1]<<8) | (in[i*4+0]<<0);
|
||||
M[i] =
|
||||
((uint32_t)in[i*4+3] << 24) |
|
||||
((uint32_t)in[i*4+2] << 16) |
|
||||
((uint32_t)in[i*4+1] << 8) |
|
||||
((uint32_t)in[i*4+0] << 0) ;
|
||||
}
|
||||
|
||||
static void copy4(byte *out,uint32_t x)
|
||||
|
|
|
@ -668,55 +668,10 @@ int MSG_HashKey(const char *string, int maxlen) {
|
|||
return hash;
|
||||
}
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
delta functions
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
extern cvar_t *cl_shownet;
|
||||
|
||||
#define LOG(x) if( cl_shownet && cl_shownet->integer == 4 ) { Com_Printf("%s ", x ); };
|
||||
|
||||
void MSG_WriteDelta( msg_t *msg, int oldV, int newV, int bits ) {
|
||||
if ( oldV == newV ) {
|
||||
MSG_WriteBits( msg, 0, 1 );
|
||||
return;
|
||||
}
|
||||
MSG_WriteBits( msg, 1, 1 );
|
||||
MSG_WriteBits( msg, newV, bits );
|
||||
}
|
||||
|
||||
int MSG_ReadDelta( msg_t *msg, int oldV, int bits ) {
|
||||
if ( MSG_ReadBits( msg, 1 ) ) {
|
||||
return MSG_ReadBits( msg, bits );
|
||||
}
|
||||
return oldV;
|
||||
}
|
||||
|
||||
void MSG_WriteDeltaFloat( msg_t *msg, float oldV, float newV ) {
|
||||
floatint_t fi;
|
||||
if ( oldV == newV ) {
|
||||
MSG_WriteBits( msg, 0, 1 );
|
||||
return;
|
||||
}
|
||||
fi.f = newV;
|
||||
MSG_WriteBits( msg, 1, 1 );
|
||||
MSG_WriteBits( msg, fi.i, 32 );
|
||||
}
|
||||
|
||||
float MSG_ReadDeltaFloat( msg_t *msg, float oldV ) {
|
||||
if ( MSG_ReadBits( msg, 1 ) ) {
|
||||
floatint_t fi;
|
||||
|
||||
fi.i = MSG_ReadBits( msg, 32 );
|
||||
return fi.f;
|
||||
}
|
||||
return oldV;
|
||||
}
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ to the new value before sending out any replies.
|
|||
#define FRAGMENT_SIZE (MAX_PACKETLEN - 100)
|
||||
#define PACKET_HEADER 10 // two ints and a short
|
||||
|
||||
#define FRAGMENT_BIT (1<<31)
|
||||
#define FRAGMENT_BIT (1U<<31)
|
||||
|
||||
cvar_t *showpackets;
|
||||
cvar_t *showdrop;
|
||||
|
|
|
@ -148,7 +148,7 @@ vec3_t bytedirs[NUMVERTEXNORMALS] =
|
|||
//==============================================================
|
||||
|
||||
int Q_rand( int *seed ) {
|
||||
*seed = (69069 * *seed + 1);
|
||||
*seed = (69069U * *seed + 1U);
|
||||
return *seed;
|
||||
}
|
||||
|
||||
|
|
|
@ -660,15 +660,15 @@ Com_HexStrToInt
|
|||
*/
|
||||
int Com_HexStrToInt( const char *str )
|
||||
{
|
||||
if ( !str || !str[ 0 ] )
|
||||
if ( !str )
|
||||
return -1;
|
||||
|
||||
// check for hex code
|
||||
if( str[ 0 ] == '0' && str[ 1 ] == 'x' )
|
||||
if( str[ 0 ] == '0' && str[ 1 ] == 'x' && str[ 2 ] != '\0' )
|
||||
{
|
||||
int i, n = 0;
|
||||
int i, n = 0, len = strlen( str );
|
||||
|
||||
for( i = 2; i < strlen( str ); i++ )
|
||||
for( i = 2; i < len; i++ )
|
||||
{
|
||||
char digit;
|
||||
|
||||
|
@ -746,13 +746,14 @@ qboolean Q_isintegral( float f )
|
|||
return (int)f == f;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
=============
|
||||
Q_vsnprintf
|
||||
|
||||
|
||||
Special wrapper function for Microsoft's broken _vsnprintf() function.
|
||||
MinGW comes with its own snprintf() which is not broken.
|
||||
MinGW comes with its own vsnprintf() which is not broken. mingw-w64
|
||||
however, uses Microsoft's broken _vsnprintf() function.
|
||||
=============
|
||||
*/
|
||||
|
||||
|
|
|
@ -186,6 +186,7 @@ typedef int intptr_t;
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
@ -202,13 +203,15 @@ typedef int intptr_t;
|
|||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
// vsnprintf is ISO/IEC 9899:1999
|
||||
// abstracting this to make it portable
|
||||
int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
||||
#else
|
||||
#include <stdint.h>
|
||||
|
||||
#define Q_vsnprintf vsnprintf
|
||||
#endif
|
||||
|
||||
|
@ -290,7 +293,7 @@ typedef int clipHandle_t;
|
|||
|
||||
#define MAX_SAY_TEXT 150
|
||||
|
||||
// paramters for command buffer stuffing
|
||||
// parameters for command buffer stuffing
|
||||
typedef enum {
|
||||
EXEC_NOW, // don't return until completed, a VM should NEVER use this,
|
||||
// because some commands might cause the VM to be unloaded...
|
||||
|
@ -1265,7 +1268,7 @@ typedef struct playerState_s {
|
|||
#define BUTTON_TALK 2 // displays talk balloon and disables actions
|
||||
#define BUTTON_USE_HOLDABLE 4
|
||||
#define BUTTON_GESTURE 8
|
||||
#define BUTTON_WALKING 16 // walking can't just be infered from MOVE_RUN
|
||||
#define BUTTON_WALKING 16 // walking can't just be inferred from MOVE_RUN
|
||||
// because a key pressed late in the frame will
|
||||
// only generate a small move value for that frame
|
||||
// walking will use different animations and
|
||||
|
|
|
@ -716,7 +716,7 @@ long FS_ReadFileDir(const char *qpath, void *searchPath, qboolean unpure, void *
|
|||
long FS_ReadFile(const char *qpath, void **buffer);
|
||||
// returns the length of the file
|
||||
// a null buffer will just return the file length without loading
|
||||
// as a quick check for existance. -1 length == not present
|
||||
// as a quick check for existence. -1 length == not present
|
||||
// A 0 byte will always be appended at the end, so string ops are safe.
|
||||
// the buffer should be considered read-only, because it may be cached
|
||||
// for other uses.
|
||||
|
@ -773,6 +773,7 @@ void FS_PureServerSetLoadedPaks( const char *pakSums, const char *pakNames );
|
|||
// sole exception of .cfg files.
|
||||
|
||||
qboolean FS_CheckDirTraversal(const char *checkdir);
|
||||
qboolean FS_InvalidGameDir(const char *gamedir);
|
||||
qboolean FS_idPak(char *pak, char *base, int numPaks);
|
||||
qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring );
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
//
|
||||
// This file must be identical in the quake and utils directories
|
||||
|
||||
// contents flags are seperate bits
|
||||
// contents flags are separate bits
|
||||
// a given brush can contribute multiple content bits
|
||||
|
||||
// these definitions also need to be in q_shared.h!
|
||||
|
|
|
@ -151,7 +151,7 @@ typedef struct
|
|||
/* ===========================================================================
|
||||
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
|
||||
for end of file.
|
||||
IN assertion: the stream s has been sucessfully opened for reading.
|
||||
IN assertion: the stream s has been successfully opened for reading.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -290,8 +290,8 @@ local int strcmpcasenosensitive_internal (fileName1,fileName2)
|
|||
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
|
|
|
@ -125,8 +125,8 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
|
|||
int iCaseSensitivity));
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
|
|
|
@ -401,7 +401,7 @@ struct symbolic_jump {
|
|||
// extensions / modifiers (branch-link)
|
||||
unsigned long ext;
|
||||
|
||||
// dest_instruction refering to this jump
|
||||
// dest_instruction referring to this jump
|
||||
dest_instruction_t *parent;
|
||||
|
||||
// next jump
|
||||
|
@ -656,7 +656,7 @@ PPC_MakeFastMask( int mask )
|
|||
* function local registers,
|
||||
*
|
||||
* normally only volatile registers are used, but if there aren't enough
|
||||
* or function has to preserve some value while calling annother one
|
||||
* or function has to preserve some value while calling another one
|
||||
* then caller safe registers are used as well
|
||||
*/
|
||||
static const long int gpr_list[] = {
|
||||
|
|
|
@ -103,7 +103,7 @@ static int isu8(uint32_t v)
|
|||
|
||||
static int NextConstant4(void)
|
||||
{
|
||||
return (code[pc] | (code[pc+1]<<8) | (code[pc+2]<<16) | (code[pc+3]<<24));
|
||||
return ((unsigned int)code[pc] | ((unsigned int)code[pc+1]<<8) | ((unsigned int)code[pc+2]<<16) | ((unsigned int)code[pc+3]<<24));
|
||||
}
|
||||
|
||||
static int Constant4( void ) {
|
||||
|
|
|
@ -42,342 +42,88 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
|||
|
||||
//===========================================================================
|
||||
|
||||
#define qglAccum glAccum
|
||||
#define qglAlphaFunc glAlphaFunc
|
||||
#define qglAreTexturesResident glAreTexturesResident
|
||||
#define qglArrayElement glArrayElement
|
||||
#define qglBegin glBegin
|
||||
#define qglBindTexture glBindTexture
|
||||
#define qglBitmap glBitmap
|
||||
#define qglBlendFunc glBlendFunc
|
||||
#define qglCallList glCallList
|
||||
#define qglCallLists glCallLists
|
||||
#define qglClear glClear
|
||||
#define qglClearAccum glClearAccum
|
||||
#define qglClearColor glClearColor
|
||||
#define qglClearDepth glClearDepth
|
||||
#define qglClearIndex glClearIndex
|
||||
#define qglClearStencil glClearStencil
|
||||
#define qglClipPlane glClipPlane
|
||||
#define qglColor3b glColor3b
|
||||
#define qglColor3bv glColor3bv
|
||||
#define qglColor3d glColor3d
|
||||
#define qglColor3dv glColor3dv
|
||||
#define qglColor3f glColor3f
|
||||
#define qglColor3fv glColor3fv
|
||||
#define qglColor3i glColor3i
|
||||
#define qglColor3iv glColor3iv
|
||||
#define qglColor3s glColor3s
|
||||
#define qglColor3sv glColor3sv
|
||||
#define qglColor3ub glColor3ub
|
||||
#define qglColor3ubv glColor3ubv
|
||||
#define qglColor3ui glColor3ui
|
||||
#define qglColor3uiv glColor3uiv
|
||||
#define qglColor3us glColor3us
|
||||
#define qglColor3usv glColor3usv
|
||||
#define qglColor4b glColor4b
|
||||
#define qglColor4bv glColor4bv
|
||||
#define qglColor4d glColor4d
|
||||
#define qglColor4dv glColor4dv
|
||||
#define qglColor4f glColor4f
|
||||
#define qglColor4fv glColor4fv
|
||||
#define qglColor4i glColor4i
|
||||
#define qglColor4iv glColor4iv
|
||||
#define qglColor4s glColor4s
|
||||
#define qglColor4sv glColor4sv
|
||||
#define qglColor4ub glColor4ub
|
||||
#define qglColor4ubv glColor4ubv
|
||||
#define qglColor4ui glColor4ui
|
||||
#define qglColor4uiv glColor4uiv
|
||||
#define qglColor4us glColor4us
|
||||
#define qglColor4usv glColor4usv
|
||||
#define qglColorMask glColorMask
|
||||
#define qglColorMaterial glColorMaterial
|
||||
#define qglColorPointer glColorPointer
|
||||
#define qglCopyPixels glCopyPixels
|
||||
#define qglCopyTexImage1D glCopyTexImage1D
|
||||
#define qglCopyTexImage2D glCopyTexImage2D
|
||||
#define qglCopyTexSubImage1D glCopyTexSubImage1D
|
||||
#define qglCopyTexSubImage2D glCopyTexSubImage2D
|
||||
#define qglCullFace glCullFace
|
||||
#define qglDeleteLists glDeleteLists
|
||||
#define qglDeleteTextures glDeleteTextures
|
||||
#define qglDepthFunc glDepthFunc
|
||||
#define qglDepthMask glDepthMask
|
||||
#define qglDepthRange glDepthRange
|
||||
#define qglDisable glDisable
|
||||
#define qglDisableClientState glDisableClientState
|
||||
#define qglDrawArrays glDrawArrays
|
||||
#define qglDrawBuffer glDrawBuffer
|
||||
#define qglDrawElements glDrawElements
|
||||
#define qglDrawPixels glDrawPixels
|
||||
#define qglEdgeFlag glEdgeFlag
|
||||
#define qglEdgeFlagPointer glEdgeFlagPointer
|
||||
#define qglEdgeFlagv glEdgeFlagv
|
||||
#define qglEnable glEnable
|
||||
#define qglEnableClientState glEnableClientState
|
||||
#define qglEnd glEnd
|
||||
#define qglEndList glEndList
|
||||
#define qglEvalCoord1d glEvalCoord1d
|
||||
#define qglEvalCoord1dv glEvalCoord1dv
|
||||
#define qglEvalCoord1f glEvalCoord1f
|
||||
#define qglEvalCoord1fv glEvalCoord1fv
|
||||
#define qglEvalCoord2d glEvalCoord2d
|
||||
#define qglEvalCoord2dv glEvalCoord2dv
|
||||
#define qglEvalCoord2f glEvalCoord2f
|
||||
#define qglEvalCoord2fv glEvalCoord2fv
|
||||
#define qglEvalMesh1 glEvalMesh1
|
||||
#define qglEvalMesh2 glEvalMesh2
|
||||
#define qglEvalPoint1 glEvalPoint1
|
||||
#define qglEvalPoint2 glEvalPoint2
|
||||
#define qglFeedbackBuffer glFeedbackBuffer
|
||||
#define qglFinish glFinish
|
||||
#define qglFlush glFlush
|
||||
#define qglFogf glFogf
|
||||
#define qglFogfv glFogfv
|
||||
#define qglFogi glFogi
|
||||
#define qglFogiv glFogiv
|
||||
#define qglFrontFace glFrontFace
|
||||
#define qglFrustum glFrustum
|
||||
#define qglGenLists glGenLists
|
||||
#define qglGenTextures glGenTextures
|
||||
#define qglGetBooleanv glGetBooleanv
|
||||
#define qglGetClipPlane glGetClipPlane
|
||||
#define qglGetDoublev glGetDoublev
|
||||
#define qglGetError glGetError
|
||||
#define qglGetFloatv glGetFloatv
|
||||
#define qglGetIntegerv glGetIntegerv
|
||||
#define qglGetLightfv glGetLightfv
|
||||
#define qglGetLightiv glGetLightiv
|
||||
#define qglGetMapdv glGetMapdv
|
||||
#define qglGetMapfv glGetMapfv
|
||||
#define qglGetMapiv glGetMapiv
|
||||
#define qglGetMaterialfv glGetMaterialfv
|
||||
#define qglGetMaterialiv glGetMaterialiv
|
||||
#define qglGetPixelMapfv glGetPixelMapfv
|
||||
#define qglGetPixelMapuiv glGetPixelMapuiv
|
||||
#define qglGetPixelMapusv glGetPixelMapusv
|
||||
#define qglGetPointerv glGetPointerv
|
||||
#define qglGetPolygonStipple glGetPolygonStipple
|
||||
#define qglGetString glGetString
|
||||
#define qglGetTexGendv glGetTexGendv
|
||||
#define qglGetTexGenfv glGetTexGenfv
|
||||
#define qglGetTexGeniv glGetTexGeniv
|
||||
#define qglGetTexImage glGetTexImage
|
||||
#define qglGetTexLevelParameterfv glGetTexLevelParameterfv
|
||||
#define qglGetTexLevelParameteriv glGetTexLevelParameteriv
|
||||
#define qglGetTexParameterfv glGetTexParameterfv
|
||||
#define qglGetTexParameteriv glGetTexParameteriv
|
||||
#define qglHint glHint
|
||||
#define qglIndexMask glIndexMask
|
||||
#define qglIndexPointer glIndexPointer
|
||||
#define qglIndexd glIndexd
|
||||
#define qglIndexdv glIndexdv
|
||||
#define qglIndexf glIndexf
|
||||
#define qglIndexfv glIndexfv
|
||||
#define qglIndexi glIndexi
|
||||
#define qglIndexiv glIndexiv
|
||||
#define qglIndexs glIndexs
|
||||
#define qglIndexsv glIndexsv
|
||||
#define qglIndexub glIndexub
|
||||
#define qglIndexubv glIndexubv
|
||||
#define qglInitNames glInitNames
|
||||
#define qglInterleavedArrays glInterleavedArrays
|
||||
#define qglIsEnabled glIsEnabled
|
||||
#define qglIsList glIsList
|
||||
#define qglIsTexture glIsTexture
|
||||
#define qglLightModelf glLightModelf
|
||||
#define qglLightModelfv glLightModelfv
|
||||
#define qglLightModeli glLightModeli
|
||||
#define qglLightModeliv glLightModeliv
|
||||
#define qglLightf glLightf
|
||||
#define qglLightfv glLightfv
|
||||
#define qglLighti glLighti
|
||||
#define qglLightiv glLightiv
|
||||
#define qglLineStipple glLineStipple
|
||||
#define qglLineWidth glLineWidth
|
||||
#define qglListBase glListBase
|
||||
#define qglLoadIdentity glLoadIdentity
|
||||
#define qglLoadMatrixd glLoadMatrixd
|
||||
#define qglLoadMatrixf glLoadMatrixf
|
||||
#define qglLoadName glLoadName
|
||||
#define qglLogicOp glLogicOp
|
||||
#define qglMap1d glMap1d
|
||||
#define qglMap1f glMap1f
|
||||
#define qglMap2d glMap2d
|
||||
#define qglMap2f glMap2f
|
||||
#define qglMapGrid1d glMapGrid1d
|
||||
#define qglMapGrid1f glMapGrid1f
|
||||
#define qglMapGrid2d glMapGrid2d
|
||||
#define qglMapGrid2f glMapGrid2f
|
||||
#define qglMaterialf glMaterialf
|
||||
#define qglMaterialfv glMaterialfv
|
||||
#define qglMateriali glMateriali
|
||||
#define qglMaterialiv glMaterialiv
|
||||
#define qglMatrixMode glMatrixMode
|
||||
#define qglMultMatrixd glMultMatrixd
|
||||
#define qglMultMatrixf glMultMatrixf
|
||||
#define qglNewList glNewList
|
||||
#define qglNormal3b glNormal3b
|
||||
#define qglNormal3bv glNormal3bv
|
||||
#define qglNormal3d glNormal3d
|
||||
#define qglNormal3dv glNormal3dv
|
||||
#define qglNormal3f glNormal3f
|
||||
#define qglNormal3fv glNormal3fv
|
||||
#define qglNormal3i glNormal3i
|
||||
#define qglNormal3iv glNormal3iv
|
||||
#define qglNormal3s glNormal3s
|
||||
#define qglNormal3sv glNormal3sv
|
||||
#define qglNormalPointer glNormalPointer
|
||||
#define qglOrtho glOrtho
|
||||
#define qglPassThrough glPassThrough
|
||||
#define qglPixelMapfv glPixelMapfv
|
||||
#define qglPixelMapuiv glPixelMapuiv
|
||||
#define qglPixelMapusv glPixelMapusv
|
||||
#define qglPixelStoref glPixelStoref
|
||||
#define qglPixelStorei glPixelStorei
|
||||
#define qglPixelTransferf glPixelTransferf
|
||||
#define qglPixelTransferi glPixelTransferi
|
||||
#define qglPixelZoom glPixelZoom
|
||||
#define qglPointSize glPointSize
|
||||
#define qglPolygonMode glPolygonMode
|
||||
#define qglPolygonOffset glPolygonOffset
|
||||
#define qglPolygonStipple glPolygonStipple
|
||||
#define qglPopAttrib glPopAttrib
|
||||
#define qglPopClientAttrib glPopClientAttrib
|
||||
#define qglPopMatrix glPopMatrix
|
||||
#define qglPopName glPopName
|
||||
#define qglPrioritizeTextures glPrioritizeTextures
|
||||
#define qglPushAttrib glPushAttrib
|
||||
#define qglPushClientAttrib glPushClientAttrib
|
||||
#define qglPushMatrix glPushMatrix
|
||||
#define qglPushName glPushName
|
||||
#define qglRasterPos2d glRasterPos2d
|
||||
#define qglRasterPos2dv glRasterPos2dv
|
||||
#define qglRasterPos2f glRasterPos2f
|
||||
#define qglRasterPos2fv glRasterPos2fv
|
||||
#define qglRasterPos2i glRasterPos2i
|
||||
#define qglRasterPos2iv glRasterPos2iv
|
||||
#define qglRasterPos2s glRasterPos2s
|
||||
#define qglRasterPos2sv glRasterPos2sv
|
||||
#define qglRasterPos3d glRasterPos3d
|
||||
#define qglRasterPos3dv glRasterPos3dv
|
||||
#define qglRasterPos3f glRasterPos3f
|
||||
#define qglRasterPos3fv glRasterPos3fv
|
||||
#define qglRasterPos3i glRasterPos3i
|
||||
#define qglRasterPos3iv glRasterPos3iv
|
||||
#define qglRasterPos3s glRasterPos3s
|
||||
#define qglRasterPos3sv glRasterPos3sv
|
||||
#define qglRasterPos4d glRasterPos4d
|
||||
#define qglRasterPos4dv glRasterPos4dv
|
||||
#define qglRasterPos4f glRasterPos4f
|
||||
#define qglRasterPos4fv glRasterPos4fv
|
||||
#define qglRasterPos4i glRasterPos4i
|
||||
#define qglRasterPos4iv glRasterPos4iv
|
||||
#define qglRasterPos4s glRasterPos4s
|
||||
#define qglRasterPos4sv glRasterPos4sv
|
||||
#define qglReadBuffer glReadBuffer
|
||||
#define qglReadPixels glReadPixels
|
||||
#define qglRectd glRectd
|
||||
#define qglRectdv glRectdv
|
||||
#define qglRectf glRectf
|
||||
#define qglRectfv glRectfv
|
||||
#define qglRecti glRecti
|
||||
#define qglRectiv glRectiv
|
||||
#define qglRects glRects
|
||||
#define qglRectsv glRectsv
|
||||
#define qglRenderMode glRenderMode
|
||||
#define qglRotated glRotated
|
||||
#define qglRotatef glRotatef
|
||||
#define qglScaled glScaled
|
||||
#define qglScalef glScalef
|
||||
#define qglScissor glScissor
|
||||
#define qglSelectBuffer glSelectBuffer
|
||||
#define qglShadeModel glShadeModel
|
||||
#define qglStencilFunc glStencilFunc
|
||||
#define qglStencilMask glStencilMask
|
||||
#define qglStencilOp glStencilOp
|
||||
#define qglTexCoord1d glTexCoord1d
|
||||
#define qglTexCoord1dv glTexCoord1dv
|
||||
#define qglTexCoord1f glTexCoord1f
|
||||
#define qglTexCoord1fv glTexCoord1fv
|
||||
#define qglTexCoord1i glTexCoord1i
|
||||
#define qglTexCoord1iv glTexCoord1iv
|
||||
#define qglTexCoord1s glTexCoord1s
|
||||
#define qglTexCoord1sv glTexCoord1sv
|
||||
#define qglTexCoord2d glTexCoord2d
|
||||
#define qglTexCoord2dv glTexCoord2dv
|
||||
#define qglTexCoord2f glTexCoord2f
|
||||
#define qglTexCoord2fv glTexCoord2fv
|
||||
#define qglTexCoord2i glTexCoord2i
|
||||
#define qglTexCoord2iv glTexCoord2iv
|
||||
#define qglTexCoord2s glTexCoord2s
|
||||
#define qglTexCoord2sv glTexCoord2sv
|
||||
#define qglTexCoord3d glTexCoord3d
|
||||
#define qglTexCoord3dv glTexCoord3dv
|
||||
#define qglTexCoord3f glTexCoord3f
|
||||
#define qglTexCoord3fv glTexCoord3fv
|
||||
#define qglTexCoord3i glTexCoord3i
|
||||
#define qglTexCoord3iv glTexCoord3iv
|
||||
#define qglTexCoord3s glTexCoord3s
|
||||
#define qglTexCoord3sv glTexCoord3sv
|
||||
#define qglTexCoord4d glTexCoord4d
|
||||
#define qglTexCoord4dv glTexCoord4dv
|
||||
#define qglTexCoord4f glTexCoord4f
|
||||
#define qglTexCoord4fv glTexCoord4fv
|
||||
#define qglTexCoord4i glTexCoord4i
|
||||
#define qglTexCoord4iv glTexCoord4iv
|
||||
#define qglTexCoord4s glTexCoord4s
|
||||
#define qglTexCoord4sv glTexCoord4sv
|
||||
#define qglTexCoordPointer glTexCoordPointer
|
||||
#define qglTexEnvf glTexEnvf
|
||||
#define qglTexEnvfv glTexEnvfv
|
||||
#define qglTexEnvi glTexEnvi
|
||||
#define qglTexEnviv glTexEnviv
|
||||
#define qglTexGend glTexGend
|
||||
#define qglTexGendv glTexGendv
|
||||
#define qglTexGenf glTexGenf
|
||||
#define qglTexGenfv glTexGenfv
|
||||
#define qglTexGeni glTexGeni
|
||||
#define qglTexGeniv glTexGeniv
|
||||
#define qglTexImage1D glTexImage1D
|
||||
#define qglTexImage2D glTexImage2D
|
||||
#define qglTexParameterf glTexParameterf
|
||||
#define qglTexParameterfv glTexParameterfv
|
||||
#define qglTexParameteri glTexParameteri
|
||||
#define qglTexParameteriv glTexParameteriv
|
||||
#define qglTexSubImage1D glTexSubImage1D
|
||||
#define qglTexSubImage2D glTexSubImage2D
|
||||
#define qglTranslated glTranslated
|
||||
#define qglTranslatef glTranslatef
|
||||
#define qglVertex2d glVertex2d
|
||||
#define qglVertex2dv glVertex2dv
|
||||
#define qglVertex2f glVertex2f
|
||||
#define qglVertex2fv glVertex2fv
|
||||
#define qglVertex2i glVertex2i
|
||||
#define qglVertex2iv glVertex2iv
|
||||
#define qglVertex2s glVertex2s
|
||||
#define qglVertex2sv glVertex2sv
|
||||
#define qglVertex3d glVertex3d
|
||||
#define qglVertex3dv glVertex3dv
|
||||
#define qglVertex3f glVertex3f
|
||||
#define qglVertex3fv glVertex3fv
|
||||
#define qglVertex3i glVertex3i
|
||||
#define qglVertex3iv glVertex3iv
|
||||
#define qglVertex3s glVertex3s
|
||||
#define qglVertex3sv glVertex3sv
|
||||
#define qglVertex4d glVertex4d
|
||||
#define qglVertex4dv glVertex4dv
|
||||
#define qglVertex4f glVertex4f
|
||||
#define qglVertex4fv glVertex4fv
|
||||
#define qglVertex4i glVertex4i
|
||||
#define qglVertex4iv glVertex4iv
|
||||
#define qglVertex4s glVertex4s
|
||||
#define qglVertex4sv glVertex4sv
|
||||
#define qglVertexPointer glVertexPointer
|
||||
#define qglViewport glViewport
|
||||
|
||||
// GL function loader, based on https://gist.github.com/rygorous/16796a0c876cf8a5f542caddb55bce8a
|
||||
// get missing functions from code/SDL2/include/SDL_opengl.h
|
||||
|
||||
// OpenGL 1.0/1.1 and OpenGL ES 1.0
|
||||
#define QGL_1_1_PROCS \
|
||||
GLE(void, AlphaFunc, GLenum func, GLclampf ref) \
|
||||
GLE(void, BindTexture, GLenum target, GLuint texture) \
|
||||
GLE(void, BlendFunc, GLenum sfactor, GLenum dfactor) \
|
||||
GLE(void, ClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) \
|
||||
GLE(void, Clear, GLbitfield mask) \
|
||||
GLE(void, ClearStencil, GLint s) \
|
||||
GLE(void, Color4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) \
|
||||
GLE(void, ColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) \
|
||||
GLE(void, ColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) \
|
||||
GLE(void, CopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) \
|
||||
GLE(void, CullFace, GLenum mode) \
|
||||
GLE(void, DeleteTextures, GLsizei n, const GLuint *textures) \
|
||||
GLE(void, DepthFunc, GLenum func) \
|
||||
GLE(void, DepthMask, GLboolean flag) \
|
||||
GLE(void, DisableClientState, GLenum cap) \
|
||||
GLE(void, Disable, GLenum cap) \
|
||||
GLE(void, DrawArrays, GLenum mode, GLint first, GLsizei count) \
|
||||
GLE(void, DrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) \
|
||||
GLE(void, EnableClientState, GLenum cap) \
|
||||
GLE(void, Enable, GLenum cap) \
|
||||
GLE(void, Finish, void) \
|
||||
GLE(void, Flush, void) \
|
||||
GLE(void, GenTextures, GLsizei n, GLuint *textures ) \
|
||||
GLE(void, GetBooleanv, GLenum pname, GLboolean *params) \
|
||||
GLE(GLenum, GetError, void) \
|
||||
GLE(void, GetIntegerv, GLenum pname, GLint *params) \
|
||||
GLE(const GLubyte *, GetString, GLenum name) \
|
||||
GLE(void, LineWidth, GLfloat width) \
|
||||
GLE(void, LoadIdentity, void) \
|
||||
GLE(void, LoadMatrixf, const GLfloat *m) \
|
||||
GLE(void, MatrixMode, GLenum mode) \
|
||||
GLE(void, PolygonOffset, GLfloat factor, GLfloat units) \
|
||||
GLE(void, PopMatrix, void) \
|
||||
GLE(void, PushMatrix, void) \
|
||||
GLE(void, ReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) \
|
||||
GLE(void, Scissor, GLint x, GLint y, GLsizei width, GLsizei height) \
|
||||
GLE(void, ShadeModel, GLenum mode) \
|
||||
GLE(void, StencilFunc, GLenum func, GLint ref, GLuint mask) \
|
||||
GLE(void, StencilMask, GLuint mask) \
|
||||
GLE(void, StencilOp, GLenum fail, GLenum zfail, GLenum zpass) \
|
||||
GLE(void, TexCoordPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) \
|
||||
GLE(void, TexEnvf, GLenum target, GLenum pname, GLfloat param) \
|
||||
GLE(void, TexImage2D, GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) \
|
||||
GLE(void, TexParameterf, GLenum target, GLenum pname, GLfloat param) \
|
||||
GLE(void, TexParameteri, GLenum target, GLenum pname, GLint param) \
|
||||
GLE(void, TexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) \
|
||||
GLE(void, Translatef, GLfloat x, GLfloat y, GLfloat z) \
|
||||
GLE(void, VertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) \
|
||||
GLE(void, Viewport, GLint x, GLint y, GLsizei width, GLsizei height) \
|
||||
|
||||
// OpenGL 1.0/1.1 but not OpenGL ES 1.x
|
||||
#define QGL_DESKTOP_1_1_PROCS \
|
||||
GLE(void, ArrayElement, GLint i) \
|
||||
GLE(void, Begin, GLenum mode) \
|
||||
GLE(void, ClearDepth, GLclampd depth) \
|
||||
GLE(void, ClipPlane, GLenum plane, const GLdouble *equation) \
|
||||
GLE(void, Color3f, GLfloat red, GLfloat green, GLfloat blue) \
|
||||
GLE(void, Color4ubv, const GLubyte *v) \
|
||||
GLE(void, DepthRange, GLclampd near_val, GLclampd far_val) \
|
||||
GLE(void, DrawBuffer, GLenum mode) \
|
||||
GLE(void, End, void) \
|
||||
GLE(void, Frustum, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val) \
|
||||
GLE(void, Ortho, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val) \
|
||||
GLE(void, PolygonMode, GLenum face, GLenum mode) \
|
||||
GLE(void, TexCoord2f, GLfloat s, GLfloat t) \
|
||||
GLE(void, TexCoord2fv, const GLfloat *v) \
|
||||
GLE(void, Vertex2f, GLfloat x, GLfloat y) \
|
||||
GLE(void, Vertex3f, GLfloat x, GLfloat y, GLfloat z) \
|
||||
GLE(void, Vertex3fv, const GLfloat *v) \
|
||||
|
||||
// OpenGL ES 1.1 but not desktop OpenGL 1.x
|
||||
#define QGL_ES_1_1_PROCS \
|
||||
GLE(void, ClearDepthf, GLclampf depth) \
|
||||
GLE(void, ClipPlanef, GLenum plane, const GLfloat *equation) \
|
||||
GLE(void, DepthRangef, GLclampf near_val, GLclampf far_val) \
|
||||
GLE(void, Frustumf, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near_val, GLfloat far_val) \
|
||||
GLE(void, Orthof, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near_val, GLfloat far_val) \
|
||||
|
||||
// OpenGL 1.3, was GL_ARB_texture_compression
|
||||
#define QGL_1_3_PROCS \
|
||||
|
@ -556,6 +302,9 @@ extern void (APIENTRYP qglUnlockArraysEXT) (void);
|
|||
GLE(GLvoid, NamedFramebufferRenderbufferEXT, GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) \
|
||||
|
||||
#define GLE(ret, name, ...) typedef ret APIENTRY name##proc(__VA_ARGS__); extern name##proc * qgl##name;
|
||||
QGL_1_1_PROCS;
|
||||
QGL_DESKTOP_1_1_PROCS;
|
||||
QGL_ES_1_1_PROCS;
|
||||
QGL_1_3_PROCS;
|
||||
QGL_1_5_PROCS;
|
||||
QGL_2_0_PROCS;
|
||||
|
@ -565,4 +314,9 @@ QGL_ARB_vertex_array_object_PROCS;
|
|||
QGL_EXT_direct_state_access_PROCS;
|
||||
#undef GLE
|
||||
|
||||
extern int qglMajorVersion, qglMinorVersion;
|
||||
extern int qglesMajorVersion, qglesMinorVersion;
|
||||
#define QGL_VERSION_ATLEAST( major, minor ) ( qglMajorVersion > major || ( qglMajorVersion == major && qglMinorVersion >= minor ) )
|
||||
#define QGLES_VERSION_ATLEAST( major, minor ) ( qglesMajorVersion > major || ( qglesMajorVersion == major && qglesMinorVersion >= minor ) )
|
||||
|
||||
#endif
|
||||
|
|
|
@ -571,7 +571,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
|
|||
{
|
||||
/*
|
||||
* Rewind to the start of this adventure
|
||||
* and return unsuccessfull
|
||||
* and return unsuccessful
|
||||
*/
|
||||
|
||||
BufferedFileRewind(BF, BytesToRewind);
|
||||
|
@ -754,7 +754,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
|
|||
ri.Free(CompressedData);
|
||||
|
||||
/*
|
||||
* Check if the last puff() was successfull.
|
||||
* Check if the last puff() was successful.
|
||||
*/
|
||||
|
||||
if(!((puffResult == 0) && (puffDestLen > 0)))
|
||||
|
|
|
@ -154,7 +154,7 @@ typedef struct {
|
|||
void (*CM_DrawDebugSurface)( void (*drawPoly)(int color, int numPoints, float *points) );
|
||||
|
||||
// a -1 return means the file does not exist
|
||||
// NULL can be passed for buf to just determine existance
|
||||
// NULL can be passed for buf to just determine existence
|
||||
int (*FS_FileIsInPAK)( const char *name, int *pCheckSum );
|
||||
long (*FS_ReadFile)( const char *name, void **buf );
|
||||
void (*FS_FreeFile)( void *buf );
|
||||
|
|
|
@ -247,7 +247,7 @@ typedef enum {
|
|||
} glDriverType_t;
|
||||
|
||||
typedef enum {
|
||||
GLHW_GENERIC, // where everthing works the way it should
|
||||
GLHW_GENERIC, // where everything works the way it should
|
||||
GLHW_3DFX_2D3D, // Voodoo Banshee or Voodoo3, relevant since if this is
|
||||
// the hardware type then there can NOT exist a secondary
|
||||
// display adapter
|
||||
|
|
|
@ -548,7 +548,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
|
||||
//
|
||||
// change the tess parameters if needed
|
||||
// a "entityMergable" shader is a shader that can have surfaces from seperate
|
||||
// a "entityMergable" shader is a shader that can have surfaces from separate
|
||||
// entities merged into a single batch, like smoke and blood puff sprites
|
||||
if ( shader != NULL && ( shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted
|
||||
|| ( entityNum != oldEntityNum && !shader->entityMergable ) ) ) {
|
||||
|
@ -749,7 +749,7 @@ void RE_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte *
|
|||
RB_EndSurface();
|
||||
}
|
||||
|
||||
// we definately want to sync every frame for the cinematics
|
||||
// we definitely want to sync every frame for the cinematics
|
||||
qglFinish();
|
||||
|
||||
start = 0;
|
||||
|
|
|
@ -330,7 +330,7 @@ static void ParseFace( dsurface_t *ds, drawVert_t *verts, msurface_t *surf, int
|
|||
numIndexes = LittleLong( ds->numIndexes );
|
||||
|
||||
// create the srfSurfaceFace_t
|
||||
sfaceSize = ( size_t ) &((srfSurfaceFace_t *)0)->points[numPoints];
|
||||
sfaceSize = offsetof( srfSurfaceFace_t, points ) + sizeof( *cv->points ) * numPoints;
|
||||
ofsIndexes = sfaceSize;
|
||||
sfaceSize += sizeof( int ) * numIndexes;
|
||||
|
||||
|
@ -1428,7 +1428,7 @@ static void R_LoadNodesAndLeafs (lump_t *nodeLump, lump_t *leafLump) {
|
|||
out->nummarksurfaces = LittleLong(inLeaf->numLeafSurfaces);
|
||||
}
|
||||
|
||||
// chain decendants
|
||||
// chain descendants
|
||||
R_SetParent (s_worldData.nodes, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -941,7 +941,7 @@ static int numImageLoaders = ARRAY_LEN( imageLoaders );
|
|||
=================
|
||||
R_LoadImage
|
||||
|
||||
Loads any of the supported image types into a cannonical
|
||||
Loads any of the supported image types into a canonical
|
||||
32 bit format.
|
||||
=================
|
||||
*/
|
||||
|
@ -1400,7 +1400,7 @@ SKINS
|
|||
CommaParse
|
||||
|
||||
This is unfortunate, but the skin files aren't
|
||||
compatable with our normal parsing rules.
|
||||
compatible with our normal parsing rules.
|
||||
==================
|
||||
*/
|
||||
static char *CommaParse( char **data_p ) {
|
||||
|
|
|
@ -927,7 +927,21 @@ void GfxInfo_f( void )
|
|||
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
|
||||
ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
|
||||
ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
|
||||
R_PrintLongString( glConfig.extensions_string );
|
||||
if ( qglGetStringi )
|
||||
{
|
||||
GLint numExtensions;
|
||||
int i;
|
||||
|
||||
qglGetIntegerv( GL_NUM_EXTENSIONS, &numExtensions );
|
||||
for ( i = 0; i < numExtensions; i++ )
|
||||
{
|
||||
ri.Printf( PRINT_ALL, "%s ", qglGetStringi( GL_EXTENSIONS, i ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
R_PrintLongString( glConfig.extensions_string );
|
||||
}
|
||||
ri.Printf( PRINT_ALL, "\n" );
|
||||
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
|
||||
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits );
|
||||
|
|
|
@ -134,7 +134,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
|
|||
float totalFactor;
|
||||
|
||||
if ( ent->e.renderfx & RF_LIGHTING_ORIGIN ) {
|
||||
// seperate lightOrigins are needed so an object that is
|
||||
// separate lightOrigins are needed so an object that is
|
||||
// sinking into the ground can still be lit, and so
|
||||
// multi-part models can be lit identically
|
||||
VectorCopy( ent->e.lightingOrigin, lightOrigin );
|
||||
|
@ -318,7 +318,7 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
|
|||
// trace a sample point down to find ambient light
|
||||
//
|
||||
if ( ent->e.renderfx & RF_LIGHTING_ORIGIN ) {
|
||||
// seperate lightOrigins are needed so an object that is
|
||||
// separate lightOrigins are needed so an object that is
|
||||
// sinking into the ground can still be lit, and so
|
||||
// multi-part models can be lit identically
|
||||
VectorCopy( ent->e.lightingOrigin, lightOrigin );
|
||||
|
|
|
@ -836,7 +836,7 @@ typedef struct {
|
|||
int msec; // total msec for backend run
|
||||
} backEndCounters_t;
|
||||
|
||||
// all state modified by the back end is seperated
|
||||
// all state modified by the back end is separated
|
||||
// from the front end state
|
||||
typedef struct {
|
||||
trRefdef_t refdef;
|
||||
|
@ -978,7 +978,7 @@ extern cvar_t *r_measureOverdraw; // enables stencil buffer overdraw measuremen
|
|||
extern cvar_t *r_lodbias; // push/pull LOD transitions
|
||||
extern cvar_t *r_lodscale;
|
||||
|
||||
extern cvar_t *r_primitives; // "0" = based on compiled vertex array existance
|
||||
extern cvar_t *r_primitives; // "0" = based on compiled vertex array existence
|
||||
// "1" = glDrawElemet tristrips
|
||||
// "2" = glDrawElements triangles
|
||||
// "-1" = no drawing
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue