ioquake3 resync to revision 2317 from 2210.

This commit is contained in:
zturtleman 2012-09-15 03:03:44 +00:00
parent 2cb5149b41
commit f079c4eb05
158 changed files with 1926 additions and 960 deletions

View file

@ -279,7 +279,7 @@
added Wheel support to the DirectInput code IN_DIMouse (in_mouse 1) added Wheel support to the DirectInput code IN_DIMouse (in_mouse 1)
tweaked the Wheel mouse reading for in_mouse -1 (old win32 input code) tweaked the Wheel mouse reading for in_mouse -1 (old win32 input code)
handle correctly when zDelta is > 120 handle correctly when zDelta is > 120
provide a in_logitechbug cvar to handle buggy Logitech MouseWare driver sending wheel events twice provide an in_logitechbug cvar to handle buggy Logitech MouseWare driver sending wheel events twice
2002-9-26 Timothee Besset <ttimo@idsoftware.com> 2002-9-26 Timothee Besset <ttimo@idsoftware.com>
+ ATVI Quake 3 1.32 Patch #38 + ATVI Quake 3 1.32 Patch #38

View file

@ -60,7 +60,7 @@ ifndef BUILD_DEFINES
endif endif
# ioquake3 svn version that this is based on # ioquake3 svn version that this is based on
IOQ3_REVISION = 2210 IOQ3_REVISION = 2317
############################################################################# #############################################################################
# #
@ -184,6 +184,10 @@ ifndef USE_VOIP
USE_VOIP=1 USE_VOIP=1
endif endif
ifndef USE_FREETYPE
USE_FREETYPE=0
endif
ifndef USE_INTERNAL_SPEEX ifndef USE_INTERNAL_SPEEX
USE_INTERNAL_SPEEX=1 USE_INTERNAL_SPEEX=1
endif endif
@ -255,6 +259,7 @@ ifneq ($(BUILD_CLIENT),0)
OPENAL_LIBS=$(shell pkg-config --silence-errors --libs openal) OPENAL_LIBS=$(shell pkg-config --silence-errors --libs openal)
SDL_CFLAGS=$(shell pkg-config --silence-errors --cflags sdl|sed 's/-Dmain=SDL_main//') SDL_CFLAGS=$(shell pkg-config --silence-errors --cflags sdl|sed 's/-Dmain=SDL_main//')
SDL_LIBS=$(shell pkg-config --silence-errors --libs sdl) SDL_LIBS=$(shell pkg-config --silence-errors --libs sdl)
FREETYPE_CFLAGS=$(shell pkg-config --silence-errors --cflags freetype2)
endif endif
# Use sdl-config if all else fails # Use sdl-config if all else fails
ifeq ($(SDL_CFLAGS),) ifeq ($(SDL_CFLAGS),)
@ -385,8 +390,8 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
CLIENT_LIBS += -lrt CLIENT_LIBS += -lrt
endif endif
ifeq ($(USE_LOCAL_HEADERS),1) ifeq ($(USE_FREETYPE),1)
CLIENT_CFLAGS += -I$(SDLHDIR)/include BASE_CFLAGS += $(FREETYPE_CFLAGS)
endif endif
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
@ -405,7 +410,7 @@ else # ifeq Linux
ifeq ($(PLATFORM),darwin) ifeq ($(PLATFORM),darwin)
HAVE_VM_COMPILED=true HAVE_VM_COMPILED=true
LIBS = -framework Cocoa LIBS = -framework Cocoa -framework SDL
CLIENT_LIBS= CLIENT_LIBS=
RENDERER_LIBS= RENDERER_LIBS=
OPTIMIZEVM= OPTIMIZEVM=
@ -443,6 +448,10 @@ ifeq ($(PLATFORM),darwin)
endif endif
endif endif
ifeq ($(USE_FREETYPE),1)
BASE_CFLAGS += $(FREETYPE_CFLAGS)
endif
ifeq ($(USE_CODEC_VORBIS),1) ifeq ($(USE_CODEC_VORBIS),1)
CLIENT_LIBS += -lvorbisfile -lvorbis -logg CLIENT_LIBS += -lvorbisfile -lvorbis -logg
endif endif
@ -458,8 +467,8 @@ ifeq ($(PLATFORM),darwin)
LIBSDLMAIN=$(B)/libSDLmain.a LIBSDLMAIN=$(B)/libSDLmain.a
LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a
CLIENT_LIBS += -framework IOKit \ CLIENT_LIBS += -framework IOKit \
$(LIBSDIR)/macosx/libSDL-1.2.0.dylib -framework SDL
RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL-1.2.0.dylib RENDERER_LIBS += -framework OpenGL -framework SDL
OPTIMIZEVM += -falign-loops=16 OPTIMIZEVM += -falign-loops=16
OPTIMIZE = $(OPTIMIZEVM) -ffast-math OPTIMIZE = $(OPTIMIZEVM) -ffast-math
@ -532,6 +541,10 @@ ifeq ($(PLATFORM),mingw32)
CLIENT_LIBS = -lgdi32 -lole32 CLIENT_LIBS = -lgdi32 -lole32
RENDERER_LIBS = -lgdi32 -lole32 -lopengl32 RENDERER_LIBS = -lgdi32 -lole32 -lopengl32
ifeq ($(USE_FREETYPE),1)
BASE_CFLAGS += -Ifreetype2
endif
ifeq ($(USE_CURL),1) ifeq ($(USE_CURL),1)
CLIENT_CFLAGS += $(CURL_CFLAGS) CLIENT_CFLAGS += $(CURL_CFLAGS)
ifneq ($(USE_CURL_DLOPEN),1) ifneq ($(USE_CURL_DLOPEN),1)
@ -570,16 +583,19 @@ ifeq ($(PLATFORM),mingw32)
$(LIBSDIR)/win32/libSDL.dll.a $(LIBSDIR)/win32/libSDL.dll.a
RENDERER_LIBS += $(LIBSDIR)/win32/libSDLmain.a \ RENDERER_LIBS += $(LIBSDIR)/win32/libSDLmain.a \
$(LIBSDIR)/win32/libSDL.dll.a $(LIBSDIR)/win32/libSDL.dll.a
SDLDLL=SDL.dll
else else
CLIENT_LIBS += $(LIBSDIR)/win64/libSDLmain.a \ CLIENT_LIBS += $(LIBSDIR)/win64/libSDLmain.a \
$(LIBSDIR)/win64/libSDL64.dll.a $(LIBSDIR)/win64/libSDL64.dll.a
RENDERER_LIBS += $(LIBSDIR)/win64/libSDLmain.a \ RENDERER_LIBS += $(LIBSDIR)/win64/libSDLmain.a \
$(LIBSDIR)/win64/libSDL64.dll.a $(LIBSDIR)/win64/libSDL64.dll.a
SDLDLL=SDL64.dll
endif endif
else else
CLIENT_CFLAGS += $(SDL_CFLAGS) CLIENT_CFLAGS += $(SDL_CFLAGS)
CLIENT_LIBS += $(SDL_LIBS) CLIENT_LIBS += $(SDL_LIBS)
RENDERER_LIBS += $(SDL_LIBS) RENDERER_LIBS += $(SDL_LIBS)
SDLDLL=SDL.dll
endif endif
BUILD_CLIENT_SMP = 0 BUILD_CLIENT_SMP = 0
@ -836,6 +852,10 @@ endif
TARGETS = TARGETS =
ifeq ($(USE_FREETYPE),1)
BASE_CFLAGS += -DBUILD_FREETYPE
endif
ifndef FULLBINEXT ifndef FULLBINEXT
# Leave .x86 off win32 binaries # Leave .x86 off win32 binaries
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
@ -949,6 +969,10 @@ else
RENDERER_LIBS += -ljpeg RENDERER_LIBS += -ljpeg
endif endif
ifeq ($(USE_FREETYPE),1)
RENDERER_LIBS += -lfreetype
endif
ifeq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) ifeq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
BASE_CFLAGS += -Qunused-arguments BASE_CFLAGS += -Qunused-arguments
endif endif
@ -1462,10 +1486,17 @@ Q3OBJ = \
$(B)/client/sdl_input.o \ $(B)/client/sdl_input.o \
$(B)/client/sdl_snd.o \ $(B)/client/sdl_snd.o \
\ \
$(B)/client/con_passive.o \
$(B)/client/con_log.o \ $(B)/client/con_log.o \
$(B)/client/sys_main.o $(B)/client/sys_main.o
ifeq ($(PLATFORM),mingw32)
Q3OBJ += \
$(B)/client/con_passive.o
else
Q3OBJ += \
$(B)/client/con_tty.o
endif
Q3ROBJ = \ Q3ROBJ = \
$(B)/renderer/tr_animation.o \ $(B)/renderer/tr_animation.o \
$(B)/renderer/tr_backend.o \ $(B)/renderer/tr_backend.o \
@ -2446,7 +2477,7 @@ TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ)
copyfiles: release copyfiles: release
@if [ ! -d $(COPYDIR)/$(BASENAME) ]; then echo "You need to set COPYDIR to where your Quake3 data is!"; fi @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_GAME_SO),0)
ifneq ($(BUILD_BASEGAME),0) ifneq ($(BUILD_BASEGAME),0)
-$(MKDIR) -p -m 0755 $(COPYDIR)/$(BASEGAME) -$(MKDIR) -p -m 0755 $(COPYDIR)/$(BASEGAME)
@ -2536,6 +2567,7 @@ distclean: clean toolsclean
installer: release installer: release
ifeq ($(PLATFORM),mingw32) ifeq ($(PLATFORM),mingw32)
@$(MAKE) VERSION=$(VERSION) -C $(NSISDIR) V=$(V) \ @$(MAKE) VERSION=$(VERSION) -C $(NSISDIR) V=$(V) \
SDLDLL=$(SDLDLL) \
USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \ USE_RENDERER_DLOPEN=$(USE_RENDERER_DLOPEN) \
USE_OPENAL_DLOPEN=$(USE_OPENAL_DLOPEN) \ USE_OPENAL_DLOPEN=$(USE_OPENAL_DLOPEN) \
USE_CURL_DLOPEN=$(USE_CURL_DLOPEN) \ USE_CURL_DLOPEN=$(USE_CURL_DLOPEN) \

View file

@ -103,6 +103,7 @@ Makefile.local:
USE_VOIP - enable built-in VoIP support USE_VOIP - enable built-in VoIP support
USE_INTERNAL_SPEEX - build internal speex library instead of dynamically USE_INTERNAL_SPEEX - build internal speex library instead of dynamically
linking against system libspeex linking against system libspeex
USE_FREETYPE - enable FreeType support for rendering fonts
USE_OLD_VM64 - use Ludwig Nussel's old JIT compiler implementation USE_OLD_VM64 - use Ludwig Nussel's old JIT compiler implementation
for x86_64 for x86_64
USE_INTERNAL_ZLIB - build and link against internal zlib USE_INTERNAL_ZLIB - build and link against internal zlib
@ -136,6 +137,7 @@ New cvars
for forward movement speed/direction. for forward movement speed/direction.
j_side - Joystick analogue to m_side, j_side - Joystick analogue to m_side,
for side movement speed/direction. for side movement speed/direction.
j_up - Joystick up movement speed/direction.
j_pitch - Joystick analogue to m_pitch, j_pitch - Joystick analogue to m_pitch,
for pitch rotation speed/direction. for pitch rotation speed/direction.
j_yaw - Joystick analogue to m_yaw, j_yaw - Joystick analogue to m_yaw,
@ -144,6 +146,8 @@ New cvars
controls forward/back. controls forward/back.
j_side_axis - Selects which joystick axis j_side_axis - Selects which joystick axis
controls left/right. controls left/right.
j_up_axis - Selects which joystick axis
controls up/down.
j_pitch_axis - Selects which joystick axis j_pitch_axis - Selects which joystick axis
controls pitch. controls pitch.
j_yaw_axis - Selects which joystick axis j_yaw_axis - Selects which joystick axis
@ -269,6 +273,8 @@ New cvars
captured using screenshotJPEG captured using screenshotJPEG
r_aviMotionJpegQuality - Controls quality of video capture when r_aviMotionJpegQuality - Controls quality of video capture when
cl_aviMotionJpeg is enabled cl_aviMotionJpeg is enabled
r_mode -2 - This new video mode automatically uses the
desktop resolution.
New commands New commands
video [filename] - start video capture (use with demo command) video [filename] - start video capture (use with demo command)
@ -294,6 +300,16 @@ New commands
which <filename/path> - print out the path on disk to a loaded item which <filename/path> - print out the path on disk to a loaded item
execq <filename> - quiet exec command, doesn't print "execing file.cfg"
kicknum <client number> - kick a client by number, same as clientkick command
kickall - kick all clients, similar to "kick all" (but kicks
everyone even if someone is named "all")
kickbots - kick all bots, similar to "kick allbots" (but kicks
all bots even if someone is named "allbots")
tell <client num> <msg> - send message to a single client (new to server)
--------------------------------------------------------- README for Users ----- --------------------------------------------------------- README for Users -----
@ -657,9 +673,9 @@ Building with MinGW for pre Windows XP
------------------------------------------------------------- Contributing ----- ------------------------------------------------------------- Contributing -----
Please send all patches to bugzilla (https://bugzilla.icculus.org), or join the Please send all patches to bugzilla (https://bugzilla.icculus.org), or join the
mailing list (quake3-subscribe@icculus.org) and submit your patch there. The mailing list (http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org) and
best case scenario is that you submit your patch to bugzilla, and then post the submit your patch there. The best case scenario is that you submit your patch
URL to the mailing list. to bugzilla, and then post the URL to the mailing list.
The focus for ioq3 is to develop a stable base suitable for further development The focus for ioq3 is to develop a stable base suitable for further development
and provide players with the same Quake 3 experience they've had for years. As and provide players with the same Quake 3 experience they've had for years. As

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -27,8 +27,11 @@
/* This is the minimal configuration that can be used to build SDL */ /* This is the minimal configuration that can be used to build SDL */
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h> #include <stdarg.h>
#if 0
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef signed short int16_t; typedef signed short int16_t;
@ -37,6 +40,7 @@ typedef signed int int32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned int size_t; typedef unsigned int size_t;
typedef unsigned long uintptr_t; typedef unsigned long uintptr_t;
#endif
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -39,6 +39,10 @@
/*@}*/ /*@}*/
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#else /* __linux __ */
#if defined(__hppa__) || \ #if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \ (defined(__MIPS__) && defined(__MISPEB__)) || \
@ -48,6 +52,7 @@
#else #else
#define SDL_BYTEORDER SDL_LIL_ENDIAN #define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif #endif
#endif /* __linux __ */
#endif /* !SDL_BYTEORDER */ #endif /* !SDL_BYTEORDER */
@ -81,12 +86,12 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x)
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint16 SDL_Swap16(Uint16 x) static __inline__ Uint16 SDL_Swap16(Uint16 x)
{ {
Uint16 result; int result;
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
return result; return (Uint16)result;
} }
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) #elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
static __inline__ Uint16 SDL_Swap16(Uint16 x) static __inline__ Uint16 SDL_Swap16(Uint16 x)
{ {
__asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
@ -94,7 +99,7 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x)
} }
#else #else
static __inline__ Uint16 SDL_Swap16(Uint16 x) { static __inline__ Uint16 SDL_Swap16(Uint16 x) {
return((x<<8)|(x>>8)); return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
} }
#endif #endif
@ -121,7 +126,7 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x)
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
return result; return result;
} }
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) #elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
static __inline__ Uint32 SDL_Swap32(Uint32 x) static __inline__ Uint32 SDL_Swap32(Uint32 x)
{ {
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
@ -129,7 +134,7 @@ static __inline__ Uint32 SDL_Swap32(Uint32 x)
} }
#else #else
static __inline__ Uint32 SDL_Swap32(Uint32 x) { static __inline__ Uint32 SDL_Swap32(Uint32 x) {
return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)));
} }
#endif #endif
@ -166,7 +171,7 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x)
x = SDL_Swap32(lo); x = SDL_Swap32(lo);
x <<= 32; x <<= 32;
x |= SDL_Swap32(hi); x |= SDL_Swap32(hi);
return(x); return (x);
} }
#endif #endif
#else #else

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -3108,21 +3108,35 @@ typedef char GLchar; /* native character */
#ifndef GL_VERSION_1_5 #ifndef GL_VERSION_1_5
/* GL types for handling large vertex buffer objects */ /* GL types for handling large vertex buffer objects */
#ifdef __APPLE__
typedef long GLintptr;
typedef long GLsizeiptr;
#else
typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr; typedef ptrdiff_t GLsizeiptr;
#endif #endif
#endif
#ifndef GL_ARB_vertex_buffer_object #ifndef GL_ARB_vertex_buffer_object
/* GL types for handling large vertex buffer objects */ /* GL types for handling large vertex buffer objects */
#ifdef __APPLE__
typedef long GLintptrARB;
typedef long GLsizeiptrARB;
#else
typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB; typedef ptrdiff_t GLsizeiptrARB;
#endif #endif
#endif
#ifndef GL_ARB_shader_objects #ifndef GL_ARB_shader_objects
/* GL types for handling shader object handles and program/shader text */ /* GL types for handling shader object handles and program/shader text */
typedef char GLcharARB; /* native character */ typedef char GLcharARB; /* native character */
#if defined(__APPLE__)
typedef void *GLhandleARB; /* shader object handle */
#else
typedef unsigned int GLhandleARB; /* shader object handle */ typedef unsigned int GLhandleARB; /* shader object handle */
#endif #endif
#endif
/* GL types for "half" precision (s10e5) float data in host memory */ /* GL types for "half" precision (s10e5) float data in host memory */
#ifndef GL_ARB_half_float_pixel #ifndef GL_ARB_half_float_pixel

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -203,12 +203,13 @@ typedef struct SDL_SysWMinfo {
/** /**
* This function gives you custom hooks into the window manager information. * This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and * It fills the structure pointed to by 'info' with custom information and
* returns 1 if the function is implemented. If it's not implemented, or * returns 0 if the function is not implemented, 1 if the function is
* the version member of the 'info' structure is invalid, it returns 0. * implemented and no error occurred, and -1 if the version member of
* the 'info' structure is not filled in or not supported.
* *
* You typically use this function like this: * You typically use this function like this:
* @code * @code
* SDL_SysWMInfo info; * SDL_SysWMinfo info;
* SDL_VERSION(&info.version); * SDL_VERSION(&info.version);
* if ( SDL_GetWMInfo(&info) ) { ... } * if ( SDL_GetWMInfo(&info) ) { ... }
* @endcode * @endcode

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -68,11 +68,6 @@ typedef struct SDL_Thread SDL_Thread;
#ifdef __OS2__ #ifdef __OS2__
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
typedef void (*pfnSDL_CurrentEndThread)(void); typedef void (*pfnSDL_CurrentEndThread)(void);
#elif __GNUC__
typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg,
unsigned, unsigned *threadID);
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
#else #else
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg, unsigned (__stdcall *func)(void *), void *arg,

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -41,7 +41,7 @@ extern "C" {
/*@{*/ /*@{*/
#define SDL_MAJOR_VERSION 1 #define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2 #define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL 14 #define SDL_PATCHLEVEL 15
/*@}*/ /*@}*/
typedef struct SDL_version { typedef struct SDL_version {

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
@ -43,7 +43,7 @@
#ifndef DECLSPEC #ifndef DECLSPEC
# if defined(__BEOS__) || defined(__HAIKU__) # if defined(__BEOS__) || defined(__HAIKU__)
# if defined(__GNUC__) # if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport) # define DECLSPEC
# else # else
# define DECLSPEC __declspec(export) # define DECLSPEC __declspec(export)
# endif # endif
@ -132,7 +132,12 @@
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma nopackwarning #pragma nopackwarning
#endif #endif
#ifdef _M_X64
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
#pragma pack(push,8)
#else
#pragma pack(push,4) #pragma pack(push,4)
#endif
#elif (defined(__MWERKS__) && defined(__MACOS__)) #elif (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=mac68k4byte #pragma options align=mac68k4byte
#pragma enumsalwaysint on #pragma enumsalwaysint on

View file

@ -1,6 +1,6 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public

View file

@ -23,26 +23,8 @@
; ;
; assumes __fastcall calling convention ; assumes __fastcall calling convention
DoSyscall PROTO
.code .code
; Call to static void DoSyscall(int syscallNum, int programStack, int *opStackBase, uint8_t opStackOfs, intptr_t arg)
qsyscall64 PROC
sub rsp, 28h ; after this esp will be aligned to 16 byte boundary
mov qword ptr [rsp + 20h], rcx ; 5th parameter "arg" is passed on stack
mov r9b, bl ; opStackOfs
mov r8, rdi ; opStackBase
mov edx, esi ; programStack
mov ecx, eax ; syscallNum
mov rax, DoSyscall ; store call address of DoSyscall in rax
call rax
add rsp, 28h
ret
qsyscall64 ENDP
; Call to compiled code after setting up the register environment for the VM ; Call to compiled code after setting up the register environment for the VM
; prototype: ; prototype:
; uint8_t qvmcall64(int *programStack, int *opStack, intptr_t *instructionPointers, byte *dataBase); ; uint8_t qvmcall64(int *programStack, int *opStack, intptr_t *instructionPointers, byte *dataBase);

View file

@ -392,7 +392,7 @@ void AAS_ParseBSPEntities(void)
{ {
if (strcmp(token.string, "{")) if (strcmp(token.string, "{"))
{ {
ScriptError(script, "invalid %s\n", token.string); ScriptError(script, "invalid %s", token.string);
AAS_FreeBSPEntities(); AAS_FreeBSPEntities();
FreeScript(script); FreeScript(script);
return; return;
@ -413,7 +413,7 @@ void AAS_ParseBSPEntities(void)
ent->epairs = epair; ent->epairs = epair;
if (token.type != TT_STRING) if (token.type != TT_STRING)
{ {
ScriptError(script, "invalid %s\n", token.string); ScriptError(script, "invalid %s", token.string);
AAS_FreeBSPEntities(); AAS_FreeBSPEntities();
FreeScript(script); FreeScript(script);
return; return;
@ -433,7 +433,7 @@ void AAS_ParseBSPEntities(void)
} //end while } //end while
if (strcmp(token.string, "}")) if (strcmp(token.string, "}"))
{ {
ScriptError(script, "missing }\n"); ScriptError(script, "missing }");
AAS_FreeBSPEntities(); AAS_FreeBSPEntities();
FreeScript(script); FreeScript(script);
return; return;
@ -469,7 +469,7 @@ void AAS_DumpBSPData(void)
Com_Memset( &bspworld, 0, sizeof(bspworld) ); Com_Memset( &bspworld, 0, sizeof(bspworld) );
} //end of the function AAS_DumpBSPData } //end of the function AAS_DumpBSPData
//=========================================================================== //===========================================================================
// load an bsp file // load a .bsp file
// //
// Parameter: - // Parameter: -
// Returns: - // Returns: -

View file

@ -130,7 +130,7 @@ int AAS_UpdatePortal(int areanum, int clusternum)
// //
if (portalnum == aasworld.numportals) if (portalnum == aasworld.numportals)
{ {
AAS_Error("no portal of area %d", areanum); AAS_Error("no portal of area %d\n", areanum);
return qtrue; return qtrue;
} //end if } //end if
// //
@ -157,7 +157,7 @@ int AAS_UpdatePortal(int areanum, int clusternum)
} //end else } //end else
if (aasworld.portalindexsize >= AAS_MAX_PORTALINDEXSIZE) if (aasworld.portalindexsize >= AAS_MAX_PORTALINDEXSIZE)
{ {
AAS_Error("AAS_MAX_PORTALINDEXSIZE"); AAS_Error("AAS_MAX_PORTALINDEXSIZE\n");
return qtrue; return qtrue;
} //end if } //end if
//set the area cluster number to the negative portal number //set the area cluster number to the negative portal number
@ -184,7 +184,7 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum)
// //
if (areanum <= 0 || areanum >= aasworld.numareas) if (areanum <= 0 || areanum >= aasworld.numareas)
{ {
AAS_Error("AAS_FloodClusterAreas_r: areanum out of range"); AAS_Error("AAS_FloodClusterAreas_r: areanum out of range\n");
return qfalse; return qfalse;
} //end if } //end if
//if the area is already part of a cluster //if the area is already part of a cluster
@ -194,7 +194,7 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum)
// //
//there's a reachability going from one cluster to another only in one direction //there's a reachability going from one cluster to another only in one direction
// //
AAS_Error("cluster %d touched cluster %d at area %d\r\n", AAS_Error("cluster %d touched cluster %d at area %d\n",
clusternum, aasworld.areasettings[areanum].cluster, areanum); clusternum, aasworld.areasettings[areanum].cluster, areanum);
return qfalse; return qfalse;
} //end if } //end if
@ -410,7 +410,7 @@ int AAS_FindClusters(void)
continue; continue;
if (aasworld.numclusters >= AAS_MAX_CLUSTERS) if (aasworld.numclusters >= AAS_MAX_CLUSTERS)
{ {
AAS_Error("AAS_MAX_CLUSTERS"); AAS_Error("AAS_MAX_CLUSTERS\n");
return qfalse; return qfalse;
} //end if } //end if
cluster = &aasworld.clusters[aasworld.numclusters]; cluster = &aasworld.clusters[aasworld.numclusters];
@ -449,7 +449,7 @@ void AAS_CreatePortals(void)
{ {
if (aasworld.numportals >= AAS_MAX_PORTALS) if (aasworld.numportals >= AAS_MAX_PORTALS)
{ {
AAS_Error("AAS_MAX_PORTALS"); AAS_Error("AAS_MAX_PORTALS\n");
return; return;
} //end if } //end if
portal = &aasworld.portals[aasworld.numportals]; portal = &aasworld.portals[aasworld.numportals];
@ -776,7 +776,7 @@ int AAS_GetAdjacentAreasWithLessPresenceTypes_r(int *areanums, int numareas, int
{ {
if (numareas >= MAX_PORTALAREAS) if (numareas >= MAX_PORTALAREAS)
{ {
AAS_Error("MAX_PORTALAREAS"); AAS_Error("MAX_PORTALAREAS\n");
return numareas; return numareas;
} //end if } //end if
numareas = AAS_GetAdjacentAreasWithLessPresenceTypes_r(areanums, numareas, otherareanum); numareas = AAS_GetAdjacentAreasWithLessPresenceTypes_r(areanums, numareas, otherareanum);

View file

@ -281,7 +281,7 @@ void AAS_FileInfo(void)
} //end of the function AAS_FileInfo } //end of the function AAS_FileInfo
#endif //AASFILEDEBUG #endif //AASFILEDEBUG
//=========================================================================== //===========================================================================
// allocate memory and read a lump of a AAS file // allocate memory and read a lump of an AAS file
// //
// Parameter: - // Parameter: -
// Returns: - // Returns: -

View file

@ -423,7 +423,7 @@ void AAS_Shutdown(void)
//aas has not been initialized //aas has not been initialized
aasworld.initialized = qfalse; aasworld.initialized = qfalse;
//NOTE: as soon as a new .bsp file is loaded the .bsp file memory is //NOTE: as soon as a new .bsp file is loaded the .bsp file memory is
// freed an reallocated, so there's no need to free that memory here // freed and reallocated, so there's no need to free that memory here
//print shutdown //print shutdown
botimport.Print(PRT_MESSAGE, "AAS shutdown.\n"); botimport.Print(PRT_MESSAGE, "AAS shutdown.\n");
} //end of the function AAS_Shutdown } //end of the function AAS_Shutdown

View file

@ -412,7 +412,7 @@ int AAS_BestReachableArea(vec3_t origin, vec3_t mins, vec3_t maxs, vec3_t goalor
else else
{ {
//it can very well happen that the AAS_PointAreaNum function tells that //it can very well happen that the AAS_PointAreaNum function tells that
//a point is in an area and that starting a AAS_TraceClientBBox from that //a point is in an area and that starting an AAS_TraceClientBBox from that
//point will return trace.startsolid qtrue //point will return trace.startsolid qtrue
#if 0 #if 0
if (AAS_PointAreaNum(start)) if (AAS_PointAreaNum(start))
@ -490,7 +490,7 @@ aas_lreachability_t *AAS_AllocReachability(void)
if (!nextreachability) return NULL; if (!nextreachability) return NULL;
//make sure the error message only shows up once //make sure the error message only shows up once
if (!nextreachability->next) AAS_Error("AAS_MAX_REACHABILITYSIZE"); if (!nextreachability->next) AAS_Error("AAS_MAX_REACHABILITYSIZE\n");
// //
r = nextreachability; r = nextreachability;
nextreachability = nextreachability->next; nextreachability = nextreachability->next;
@ -523,7 +523,7 @@ int AAS_AreaReachability(int areanum)
{ {
if (areanum < 0 || areanum >= aasworld.numareas) if (areanum < 0 || areanum >= aasworld.numareas)
{ {
AAS_Error("AAS_AreaReachability: areanum %d out of range", areanum); AAS_Error("AAS_AreaReachability: areanum %d out of range\n", areanum);
return 0; return 0;
} //end if } //end if
return aasworld.areasettings[areanum].numreachableareas; return aasworld.areasettings[areanum].numreachableareas;
@ -848,7 +848,7 @@ int AAS_Reachability_Swim(int area1num, int area2num)
area1 = &aasworld.areas[area1num]; area1 = &aasworld.areas[area1num];
area2 = &aasworld.areas[area2num]; area2 = &aasworld.areas[area2num];
//if the areas are not near anough //if the areas are not near enough
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
if (area1->mins[i] > area2->maxs[i] + 10) return qfalse; if (area1->mins[i] > area2->maxs[i] + 10) return qfalse;
@ -923,7 +923,7 @@ int AAS_Reachability_EqualFloorHeight(int area1num, int area2num)
area1 = &aasworld.areas[area1num]; area1 = &aasworld.areas[area1num];
area2 = &aasworld.areas[area2num]; area2 = &aasworld.areas[area2num];
//if the areas are not near anough in the x-y direction //if the areas are not near enough in the x-y direction
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (area1->mins[i] > area2->maxs[i] + 10) return qfalse; if (area1->mins[i] > area2->maxs[i] + 10) return qfalse;
@ -1085,7 +1085,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
area2 = &aasworld.areas[area2num]; area2 = &aasworld.areas[area2num];
//if the first area contains a liquid //if the first area contains a liquid
area1swim = AAS_AreaSwim(area1num); area1swim = AAS_AreaSwim(area1num);
//if the areas are not near anough in the x-y direction //if the areas are not near enough in the x-y direction
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (area1->mins[i] > area2->maxs[i] + 10) return qfalse; if (area1->mins[i] > area2->maxs[i] + 10) return qfalse;
@ -2131,7 +2131,7 @@ int AAS_Reachability_Jump(int area1num, int area2num)
//maximum height a player can jump with the given initial z velocity //maximum height a player can jump with the given initial z velocity
maxjumpheight = AAS_MaxJumpHeight(phys_jumpvel); maxjumpheight = AAS_MaxJumpHeight(phys_jumpvel);
//if the areas are not near anough in the x-y direction //if the areas are not near enough in the x-y direction
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (area1->mins[i] > area2->maxs[i] + maxjumpdistance) return qfalse; if (area1->mins[i] > area2->maxs[i] + maxjumpdistance) return qfalse;

View file

@ -106,7 +106,7 @@ void AAS_RoutingInfo(void)
// Returns: - // Returns: -
// Changes Globals: - // Changes Globals: -
//=========================================================================== //===========================================================================
ID_INLINE int AAS_ClusterAreaNum(int cluster, int areanum) static ID_INLINE int AAS_ClusterAreaNum(int cluster, int areanum)
{ {
int side, areacluster; int side, areacluster;
@ -166,7 +166,7 @@ void AAS_InitTravelFlagFromType(void)
// Returns: - // Returns: -
// Changes Globals: - // Changes Globals: -
//=========================================================================== //===========================================================================
ID_INLINE int AAS_TravelFlagForType_inline(int traveltype) static ID_INLINE int AAS_TravelFlagForType_inline(int traveltype)
{ {
int tfl; int tfl;
@ -339,7 +339,7 @@ int AAS_EnableRoutingArea(int areanum, int enable)
// Returns: - // Returns: -
// Changes Globals: - // Changes Globals: -
//=========================================================================== //===========================================================================
ID_INLINE float AAS_RoutingTime(void) static ID_INLINE float AAS_RoutingTime(void)
{ {
return AAS_Time(); return AAS_Time();
} //end of the function AAS_RoutingTime } //end of the function AAS_RoutingTime
@ -379,7 +379,7 @@ int AAS_GetAreaContentsTravelFlags(int areanum)
// Returns: - // Returns: -
// Changes Globals: - // Changes Globals: -
//=========================================================================== //===========================================================================
ID_INLINE int AAS_AreaContentsTravelFlags_inline(int areanum) static ID_INLINE int AAS_AreaContentsTravelFlags_inline(int areanum)
{ {
return aasworld.areacontentstravelflags[areanum]; return aasworld.areacontentstravelflags[areanum];
} //end of the function AAS_AreaContentsTravelFlags } //end of the function AAS_AreaContentsTravelFlags
@ -1074,7 +1074,7 @@ int AAS_ReadRouteCache(void)
} //end if } //end if
if (routecacheheader.version != RCVERSION) if (routecacheheader.version != RCVERSION)
{ {
AAS_Error("route cache dump has wrong version %d, should be %d", routecacheheader.version, RCVERSION); AAS_Error("route cache dump has wrong version %d, should be %d\n", routecacheheader.version, RCVERSION);
return qfalse; return qfalse;
} //end if } //end if
if (routecacheheader.numareas != aasworld.numareas) if (routecacheheader.numareas != aasworld.numareas)

View file

@ -256,7 +256,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
if (!strcmp(token.string, "}")) break; if (!strcmp(token.string, "}")) break;
if (token.type != TT_NUMBER || !(token.subtype & TT_INTEGER)) if (token.type != TT_NUMBER || !(token.subtype & TT_INTEGER))
{ {
SourceError(source, "expected integer index, found %s\n", token.string); SourceError(source, "expected integer index, found %s", token.string);
FreeSource(source); FreeSource(source);
BotFreeCharacterStrings(ch); BotFreeCharacterStrings(ch);
FreeMemory(ch); FreeMemory(ch);
@ -265,7 +265,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
index = token.intvalue; index = token.intvalue;
if (index < 0 || index > MAX_CHARACTERISTICS) if (index < 0 || index > MAX_CHARACTERISTICS)
{ {
SourceError(source, "characteristic index out of range [0, %d]\n", MAX_CHARACTERISTICS); SourceError(source, "characteristic index out of range [0, %d]", MAX_CHARACTERISTICS);
FreeSource(source); FreeSource(source);
BotFreeCharacterStrings(ch); BotFreeCharacterStrings(ch);
FreeMemory(ch); FreeMemory(ch);
@ -273,7 +273,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
} //end if } //end if
if (ch->c[index].type) if (ch->c[index].type)
{ {
SourceError(source, "characteristic %d already initialized\n", index); SourceError(source, "characteristic %d already initialized", index);
FreeSource(source); FreeSource(source);
BotFreeCharacterStrings(ch); BotFreeCharacterStrings(ch);
FreeMemory(ch); FreeMemory(ch);
@ -308,7 +308,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
} //end else if } //end else if
else else
{ {
SourceError(source, "expected integer, float or string, found %s\n", token.string); SourceError(source, "expected integer, float or string, found %s", token.string);
FreeSource(source); FreeSource(source);
BotFreeCharacterStrings(ch); BotFreeCharacterStrings(ch);
FreeMemory(ch); FreeMemory(ch);
@ -336,7 +336,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
} //end if } //end if
else else
{ {
SourceError(source, "unknown definition %s\n", token.string); SourceError(source, "unknown definition %s", token.string);
FreeSource(source); FreeSource(source);
BotFreeCharacterStrings(ch); BotFreeCharacterStrings(ch);
FreeMemory(ch); FreeMemory(ch);
@ -713,7 +713,7 @@ int Characteristic_Integer(int character, int index)
} //end else if } //end else if
else else
{ {
botimport.Print(PRT_ERROR, "characteristic %d is not a integer\n", index); botimport.Print(PRT_ERROR, "characteristic %d is not an integer\n", index);
return 0; return 0;
} //end else if } //end else if
// return 0; // return 0;

View file

@ -739,7 +739,7 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename)
} //end while } //end while
if (numsynonyms < 2) if (numsynonyms < 2)
{ {
SourceError(source, "synonym must have at least two entries\n"); SourceError(source, "synonym must have at least two entries");
FreeSource(source); FreeSource(source);
return NULL; return NULL;
} //end if } //end if
@ -891,7 +891,7 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring)
StripDoubleQuotes(token.string); StripDoubleQuotes(token.string);
if (strlen(ptr) + strlen(token.string) + 1 > MAX_MESSAGE_SIZE) if (strlen(ptr) + strlen(token.string) + 1 > MAX_MESSAGE_SIZE)
{ {
SourceError(source, "chat message too long\n"); SourceError(source, "chat message too long");
return qfalse; return qfalse;
} //end if } //end if
strcat(ptr, token.string); strcat(ptr, token.string);
@ -901,7 +901,7 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring)
{ {
if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE) if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE)
{ {
SourceError(source, "chat message too long\n"); SourceError(source, "chat message too long");
return qfalse; return qfalse;
} //end if } //end if
sprintf(&ptr[strlen(ptr)], "%cv%ld%c", ESCAPE_CHAR, token.intvalue, ESCAPE_CHAR); sprintf(&ptr[strlen(ptr)], "%cv%ld%c", ESCAPE_CHAR, token.intvalue, ESCAPE_CHAR);
@ -911,14 +911,14 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring)
{ {
if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE) if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE)
{ {
SourceError(source, "chat message too long\n"); SourceError(source, "chat message too long");
return qfalse; return qfalse;
} //end if } //end if
sprintf(&ptr[strlen(ptr)], "%cr%s%c", ESCAPE_CHAR, token.string, ESCAPE_CHAR); sprintf(&ptr[strlen(ptr)], "%cr%s%c", ESCAPE_CHAR, token.string, ESCAPE_CHAR);
} //end else if } //end else if
else else
{ {
SourceError(source, "unknown message component %s\n", token.string); SourceError(source, "unknown message component %s", token.string);
return qfalse; return qfalse;
} //end else } //end else
if (PC_CheckTokenString(source, ";")) break; if (PC_CheckTokenString(source, ";")) break;
@ -1175,14 +1175,14 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken)
{ {
if (token.intvalue >= MAX_MATCHVARIABLES) if (token.intvalue >= MAX_MATCHVARIABLES)
{ {
SourceError(source, "can't have more than %d match variables\n", MAX_MATCHVARIABLES); SourceError(source, "can't have more than %d match variables", MAX_MATCHVARIABLES);
FreeSource(source); FreeSource(source);
BotFreeMatchPieces(firstpiece); BotFreeMatchPieces(firstpiece);
return NULL; return NULL;
} //end if } //end if
if (lastwasvariable) if (lastwasvariable)
{ {
SourceError(source, "not allowed to have adjacent variables\n"); SourceError(source, "not allowed to have adjacent variables");
FreeSource(source); FreeSource(source);
BotFreeMatchPieces(firstpiece); BotFreeMatchPieces(firstpiece);
return NULL; return NULL;
@ -1238,7 +1238,7 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken)
} //end if } //end if
else else
{ {
SourceError(source, "invalid token %s\n", token.string); SourceError(source, "invalid token %s", token.string);
FreeSource(source); FreeSource(source);
BotFreeMatchPieces(firstpiece); BotFreeMatchPieces(firstpiece);
return NULL; return NULL;
@ -1298,7 +1298,7 @@ bot_matchtemplate_t *BotLoadMatchTemplates(char *matchfile)
{ {
if (token.type != TT_NUMBER || !(token.subtype & TT_INTEGER)) if (token.type != TT_NUMBER || !(token.subtype & TT_INTEGER))
{ {
SourceError(source, "expected integer, found %s\n", token.string); SourceError(source, "expected integer, found %s", token.string);
BotFreeMatchTemplates(matches); BotFreeMatchTemplates(matches);
FreeSource(source); FreeSource(source);
return NULL; return NULL;
@ -2080,7 +2080,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
return NULL; return NULL;
} //end if } //end if
StripDoubleQuotes(token.string); StripDoubleQuotes(token.string);
//after the chat name we expect a opening brace //after the chat name we expect an opening brace
if (!PC_ExpectTokenString(source, "{")) if (!PC_ExpectTokenString(source, "{"))
{ {
FreeSource(source); FreeSource(source);
@ -2101,7 +2101,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
if (!strcmp(token.string, "}")) break; if (!strcmp(token.string, "}")) break;
if (strcmp(token.string, "type")) if (strcmp(token.string, "type"))
{ {
SourceError(source, "expected type found %s\n", token.string); SourceError(source, "expected type found %s", token.string);
FreeSource(source); FreeSource(source);
return NULL; return NULL;
} //end if } //end if
@ -2172,7 +2172,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
} //end if } //end if
else else
{ {
SourceError(source, "unknown definition %s\n", token.string); SourceError(source, "unknown definition %s", token.string);
FreeSource(source); FreeSource(source);
return NULL; return NULL;
} //end else } //end else

View file

@ -300,7 +300,7 @@ itemconfig_t *LoadItemConfig(char *filename)
{ {
if (ic->numiteminfo >= max_iteminfo) if (ic->numiteminfo >= max_iteminfo)
{ {
SourceError(source, "more than %d item info defined\n", max_iteminfo); SourceError(source, "more than %d item info defined", max_iteminfo);
FreeMemory(ic); FreeMemory(ic);
FreeSource(source); FreeSource(source);
return NULL; return NULL;
@ -326,7 +326,7 @@ itemconfig_t *LoadItemConfig(char *filename)
} //end if } //end if
else else
{ {
SourceError(source, "unknown definition %s\n", token.string); SourceError(source, "unknown definition %s", token.string);
FreeMemory(ic); FreeMemory(ic);
FreeSource(source); FreeSource(source);
return NULL; return NULL;
@ -1018,7 +1018,7 @@ void BotUpdateEntityItems(void)
for (li = levelitems; li; li = nextli) for (li = levelitems; li; li = nextli)
{ {
nextli = li->next; nextli = li->next;
//if it is a item that will time out //if it is an item that will time out
if (li->timeout) if (li->timeout)
{ {
//timeout the item //timeout the item

View file

@ -742,7 +742,7 @@ void BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type)
int BotGetReachabilityToGoal(vec3_t origin, int areanum, int BotGetReachabilityToGoal(vec3_t origin, int areanum,
int lastgoalareanum, int lastareanum, int lastgoalareanum, int lastareanum,
int *avoidreach, float *avoidreachtimes, int *avoidreachtries, int *avoidreach, float *avoidreachtimes, int *avoidreachtries,
bot_goal_t *goal, int travelflags, int movetravelflags, bot_goal_t *goal, int travelflags,
struct bot_avoidspot_s *avoidspots, int numavoidspots, int *flags) struct bot_avoidspot_s *avoidspots, int numavoidspots, int *flags)
{ {
int i, t, besttime, bestreachnum, reachnum; int i, t, besttime, bestreachnum, reachnum;
@ -754,7 +754,6 @@ int BotGetReachabilityToGoal(vec3_t origin, int areanum,
if (AAS_AreaDoNotEnter(areanum) || AAS_AreaDoNotEnter(goal->areanum)) if (AAS_AreaDoNotEnter(areanum) || AAS_AreaDoNotEnter(goal->areanum))
{ {
travelflags |= TFL_DONOTENTER; travelflags |= TFL_DONOTENTER;
movetravelflags |= TFL_DONOTENTER;
} //end if } //end if
//use the routing to find the next area to go to //use the routing to find the next area to go to
besttime = 0; besttime = 0;
@ -764,7 +763,7 @@ int BotGetReachabilityToGoal(vec3_t origin, int areanum,
reachnum = AAS_NextAreaReachability(areanum, reachnum)) reachnum = AAS_NextAreaReachability(areanum, reachnum))
{ {
#ifdef AVOIDREACH #ifdef AVOIDREACH
//check if it isn't an reachability to avoid //check if it isn't a reachability to avoid
for (i = 0; i < MAX_AVOIDREACH; i++) for (i = 0; i < MAX_AVOIDREACH; i++)
{ {
if (avoidreach[i] == reachnum && avoidreachtimes[i] >= AAS_Time()) break; if (avoidreach[i] == reachnum && avoidreachtimes[i] >= AAS_Time()) break;
@ -787,7 +786,7 @@ int BotGetReachabilityToGoal(vec3_t origin, int areanum,
if (lastgoalareanum == goal->areanum && reach.areanum == lastareanum) continue; if (lastgoalareanum == goal->areanum && reach.areanum == lastareanum) continue;
//if (AAS_AreaContentsTravelFlags(reach.areanum) & ~travelflags) continue; //if (AAS_AreaContentsTravelFlags(reach.areanum) & ~travelflags) continue;
//if the travel isn't valid //if the travel isn't valid
if (!BotValidTravel(origin, &reach, movetravelflags)) continue; if (!BotValidTravel(origin, &reach, travelflags)) continue;
//get the travel time //get the travel time
t = AAS_AreaTravelTimeToGoalArea(reach.areanum, reach.end, goal->areanum, travelflags); t = AAS_AreaTravelTimeToGoalArea(reach.areanum, reach.end, goal->areanum, travelflags);
//if the goal area isn't reachable from the reachable area //if the goal area isn't reachable from the reachable area
@ -874,7 +873,7 @@ int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, floa
reachnum = BotGetReachabilityToGoal(reach.end, reach.areanum, reachnum = BotGetReachabilityToGoal(reach.end, reach.areanum,
ms->lastgoalareanum, lastareanum, ms->lastgoalareanum, lastareanum,
ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries, ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries,
goal, travelflags, travelflags, NULL, 0, NULL); goal, travelflags, NULL, 0, NULL);
VectorCopy(reach.end, end); VectorCopy(reach.end, end);
lastareanum = reach.areanum; lastareanum = reach.areanum;
if (lastareanum == goal->areanum) if (lastareanum == goal->areanum)
@ -933,7 +932,7 @@ int BotPredictVisiblePosition(vec3_t origin, int areanum, bot_goal_t *goal, int
reachnum = BotGetReachabilityToGoal(end, areanum, reachnum = BotGetReachabilityToGoal(end, areanum,
lastgoalareanum, lastareanum, lastgoalareanum, lastareanum,
avoidreach, avoidreachtimes, avoidreachtries, avoidreach, avoidreachtimes, avoidreachtries,
goal, travelflags, travelflags, NULL, 0, NULL); goal, travelflags, NULL, 0, NULL);
if (!reachnum) return qfalse; if (!reachnum) return qfalse;
AAS_ReachabilityFromNum(reachnum, &reach); AAS_ReachabilityFromNum(reachnum, &reach);
// //
@ -1988,7 +1987,7 @@ bot_moveresult_t BotTravel_Ladder(bot_movestate_t *ms, aas_reachability_t *reach
{ {
//botimport.Print(PRT_MESSAGE, "moving towards ladder\n"); //botimport.Print(PRT_MESSAGE, "moving towards ladder\n");
VectorSubtract(reach->end, ms->origin, dir); VectorSubtract(reach->end, ms->origin, dir);
//make sure the horizontal movement is large anough //make sure the horizontal movement is large enough
VectorCopy(dir, hordir); VectorCopy(dir, hordir);
hordir[2] = 0; hordir[2] = 0;
dist = VectorNormalize(hordir); dist = VectorNormalize(hordir);
@ -3246,7 +3245,7 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in
reachnum = BotGetReachabilityToGoal(ms->origin, ms->areanum, reachnum = BotGetReachabilityToGoal(ms->origin, ms->areanum,
ms->lastgoalareanum, ms->lastareanum, ms->lastgoalareanum, ms->lastareanum,
ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries, ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries,
goal, travelflags, travelflags, goal, travelflags,
ms->avoidspots, ms->numavoidspots, &resultflags); ms->avoidspots, ms->numavoidspots, &resultflags);
//the area number the reachability starts in //the area number the reachability starts in
ms->reachareanum = ms->areanum; ms->reachareanum = ms->areanum;
@ -3369,7 +3368,7 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in
lastreachnum = BotGetReachabilityToGoal(end, areas[i], lastreachnum = BotGetReachabilityToGoal(end, areas[i],
ms->lastgoalareanum, ms->lastareanum, ms->lastgoalareanum, ms->lastareanum,
ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries, ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries,
goal, travelflags, TFL_JUMPPAD, ms->avoidspots, ms->numavoidspots, NULL); goal, TFL_JUMPPAD, ms->avoidspots, ms->numavoidspots, NULL);
if (lastreachnum) if (lastreachnum)
{ {
ms->lastreachnum = lastreachnum; ms->lastreachnum = lastreachnum;
@ -3389,7 +3388,6 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in
ms->lastreachnum = lastreachnum; ms->lastreachnum = lastreachnum;
ms->lastareanum = areas[i]; ms->lastareanum = areas[i];
//botimport.Print(PRT_MESSAGE, "found jumppad reachability hard!!\n"); //botimport.Print(PRT_MESSAGE, "found jumppad reachability hard!!\n");
break;
} //end if } //end if
} //end for } //end for
if (lastreachnum) break; if (lastreachnum) break;

View file

@ -63,18 +63,18 @@ int ReadValue(source_t *source, float *value)
if (!PC_ExpectAnyToken(source, &token)) return qfalse; if (!PC_ExpectAnyToken(source, &token)) return qfalse;
if (!strcmp(token.string, "-")) if (!strcmp(token.string, "-"))
{ {
SourceWarning(source, "negative value set to zero\n"); SourceWarning(source, "negative value set to zero");
if(!PC_ExpectAnyToken(source, &token)) if(!PC_ExpectAnyToken(source, &token))
{ {
SourceError(source, "Missing return value\n"); SourceError(source, "Missing return value");
return qfalse; return qfalse;
} }
} }
if (token.type != TT_NUMBER) if (token.type != TT_NUMBER)
{ {
SourceError(source, "invalid return value %s\n", token.string); SourceError(source, "invalid return value %s", token.string);
return qfalse; return qfalse;
} }
@ -186,7 +186,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source)
{ {
if (founddefault) if (founddefault)
{ {
SourceError(source, "switch already has a default\n"); SourceError(source, "switch already has a default");
FreeFuzzySeperators_r(firstfs); FreeFuzzySeperators_r(firstfs);
return NULL; return NULL;
} //end if } //end if
@ -236,7 +236,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source)
} //end else if } //end else if
else else
{ {
SourceError(source, "invalid name %s\n", token.string); SourceError(source, "invalid name %s", token.string);
return NULL; return NULL;
} //end else } //end else
if (newindent) if (newindent)
@ -251,7 +251,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source)
else else
{ {
FreeFuzzySeperators_r(firstfs); FreeFuzzySeperators_r(firstfs);
SourceError(source, "invalid name %s\n", token.string); SourceError(source, "invalid name %s", token.string);
return NULL; return NULL;
} //end else } //end else
if (!PC_ExpectAnyToken(source, &token)) if (!PC_ExpectAnyToken(source, &token))
@ -263,7 +263,7 @@ fuzzyseperator_t *ReadFuzzySeperators_r(source_t *source)
// //
if (!founddefault) if (!founddefault)
{ {
SourceWarning(source, "switch without default\n"); SourceWarning(source, "switch without default");
fs = (fuzzyseperator_t *) GetClearedMemory(sizeof(fuzzyseperator_t)); fs = (fuzzyseperator_t *) GetClearedMemory(sizeof(fuzzyseperator_t));
fs->index = index; fs->index = index;
fs->value = MAX_INVENTORYVALUE; fs->value = MAX_INVENTORYVALUE;
@ -342,7 +342,7 @@ weightconfig_t *ReadWeightConfig(char *filename)
{ {
if (config->numweights >= MAX_WEIGHTS) if (config->numweights >= MAX_WEIGHTS)
{ {
SourceWarning(source, "too many fuzzy weights\n"); SourceWarning(source, "too many fuzzy weights");
break; break;
} //end if } //end if
if (!PC_ExpectTokenType(source, TT_STRING, 0, &token)) if (!PC_ExpectTokenType(source, TT_STRING, 0, &token))
@ -400,7 +400,7 @@ weightconfig_t *ReadWeightConfig(char *filename)
} //end else if } //end else if
else else
{ {
SourceError(source, "invalid name %s\n", token.string); SourceError(source, "invalid name %s", token.string);
FreeWeightConfig(config); FreeWeightConfig(config);
FreeSource(source); FreeSource(source);
return NULL; return NULL;
@ -418,7 +418,7 @@ weightconfig_t *ReadWeightConfig(char *filename)
} //end if } //end if
else else
{ {
SourceError(source, "invalid name %s\n", token.string); SourceError(source, "invalid name %s", token.string);
FreeWeightConfig(config); FreeWeightConfig(config);
FreeSource(source); FreeSource(source);
return NULL; return NULL;

View file

@ -323,7 +323,7 @@ void ElevatorBottomCenter(aas_reachability_t *reach, vec3_t bottomcenter);
int BotGetReachabilityToGoal(vec3_t origin, int areanum, int BotGetReachabilityToGoal(vec3_t origin, int areanum,
int lastgoalareanum, int lastareanum, int lastgoalareanum, int lastareanum,
int *avoidreach, float *avoidreachtimes, int *avoidreachtries, int *avoidreach, float *avoidreachtimes, int *avoidreachtries,
bot_goal_t *goal, int travelflags, int movetravelflags, bot_goal_t *goal, int travelflags,
struct bot_avoidspot_s *avoidspots, int numavoidspots, int *flags); struct bot_avoidspot_s *avoidspots, int numavoidspots, int *flags);
int AAS_PointLight(vec3_t origin, int *red, int *green, int *blue); int AAS_PointLight(vec3_t origin, int *red, int *green, int *blue);

View file

@ -103,7 +103,7 @@ struct weaponinfo_s;
#define ACTION_FOLLOWME 0x08000000 #define ACTION_FOLLOWME 0x08000000
#define ACTION_JUMPEDLASTFRAME 0x10000000 #define ACTION_JUMPEDLASTFRAME 0x10000000
//the bot input, will be converted to an usercmd_t //the bot input, will be converted to a usercmd_t
typedef struct bot_input_s typedef struct bot_input_s
{ {
float thinktime; //time since last output (in seconds) float thinktime; //time since last output (in seconds)

View file

@ -269,7 +269,7 @@ token_t *PC_CopyToken(token_t *token)
if (!t) if (!t)
{ {
#ifdef BSPC #ifdef BSPC
Error("out of token space\n"); Error("out of token space");
#else #else
Com_Error(ERR_FATAL, "out of token space"); Com_Error(ERR_FATAL, "out of token space");
#endif #endif
@ -1666,7 +1666,7 @@ int PC_OperatorPriority(int op)
#define MAX_OPERATORS 64 #define MAX_OPERATORS 64
#define AllocValue(val) \ #define AllocValue(val) \
if (numvalues >= MAX_VALUES) { \ if (numvalues >= MAX_VALUES) { \
SourceError(source, "out of value space\n"); \ SourceError(source, "out of value space"); \
error = 1; \ error = 1; \
break; \ break; \
} \ } \
@ -1676,7 +1676,7 @@ int PC_OperatorPriority(int op)
// //
#define AllocOperator(op) \ #define AllocOperator(op) \
if (numoperators >= MAX_OPERATORS) { \ if (numoperators >= MAX_OPERATORS) { \
SourceError(source, "out of operator space\n"); \ SourceError(source, "out of operator space"); \
error = 1; \ error = 1; \
break; \ break; \
} \ } \
@ -1838,7 +1838,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
t->subtype == P_BIN_AND || t->subtype == P_BIN_OR || t->subtype == P_BIN_AND || t->subtype == P_BIN_OR ||
t->subtype == P_BIN_XOR) t->subtype == P_BIN_XOR)
{ {
SourceError(source, "illigal operator %s on floating point operands\n", t->string); SourceError(source, "illigal operator %s on floating point operands", t->string);
error = 1; error = 1;
break; break;
} //end if } //end if
@ -2005,7 +2005,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
v1->floatvalue *= v2->floatvalue; break; v1->floatvalue *= v2->floatvalue; break;
case P_DIV: if (!v2->intvalue || !v2->floatvalue) case P_DIV: if (!v2->intvalue || !v2->floatvalue)
{ {
SourceError(source, "divide by zero in #if/#elif\n"); SourceError(source, "divide by zero in #if/#elif");
error = 1; error = 1;
break; break;
} }
@ -2013,7 +2013,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
v1->floatvalue /= v2->floatvalue; break; v1->floatvalue /= v2->floatvalue; break;
case P_MOD: if (!v2->intvalue) case P_MOD: if (!v2->intvalue)
{ {
SourceError(source, "divide by zero in #if/#elif\n"); SourceError(source, "divide by zero in #if/#elif");
error = 1; error = 1;
break; break;
} }
@ -2750,7 +2750,7 @@ int PC_ReadToken(source_t *source, token_t *token)
token->string[strlen(token->string)-1] = '\0'; token->string[strlen(token->string)-1] = '\0';
if (strlen(token->string) + strlen(newtoken.string+1) + 1 >= MAX_TOKEN) if (strlen(token->string) + strlen(newtoken.string+1) + 1 >= MAX_TOKEN)
{ {
SourceError(source, "string longer than MAX_TOKEN %d\n", MAX_TOKEN); SourceError(source, "string longer than MAX_TOKEN %d", MAX_TOKEN);
return qfalse; return qfalse;
} }
strcat(token->string, newtoken.string+1); strcat(token->string, newtoken.string+1);

View file

@ -117,7 +117,7 @@ int PC_ExpectTokenType(source_t *source, int type, int subtype, token_t *token);
int PC_ExpectAnyToken(source_t *source, token_t *token); int PC_ExpectAnyToken(source_t *source, token_t *token);
//returns true when the token is available //returns true when the token is available
int PC_CheckTokenString(source_t *source, char *string); int PC_CheckTokenString(source_t *source, char *string);
//returns true an reads the token when a token with the given type is available //returns true and reads the token when a token with the given type is available
int PC_CheckTokenType(source_t *source, int type, int subtype, token_t *token); int PC_CheckTokenType(source_t *source, int type, int subtype, token_t *token);
//skip tokens until the given token string is read //skip tokens until the given token string is read
int PC_SkipUntilString(source_t *source, char *string); int PC_SkipUntilString(source_t *source, char *string);

View file

@ -879,7 +879,7 @@ int PS_ReadToken(script_t *script, token_t *token)
{ {
if (!PS_ReadString(script, token, '\"')) return 0; if (!PS_ReadString(script, token, '\"')) return 0;
} //end if } //end if
//if an literal //if a literal
else if (*script->script_p == '\'') else if (*script->script_p == '\'')
{ {
//if (!PS_ReadLiteral(script, token)) return 0; //if (!PS_ReadLiteral(script, token)) return 0;
@ -1158,7 +1158,7 @@ float ReadSignedFloat(script_t *script)
{ {
if(!PS_ExpectAnyToken(script, &token)) if(!PS_ExpectAnyToken(script, &token))
{ {
ScriptError(script, "Missing float value\n"); ScriptError(script, "Missing float value");
return 0; return 0;
} }
@ -1167,7 +1167,7 @@ float ReadSignedFloat(script_t *script)
if (token.type != TT_NUMBER) if (token.type != TT_NUMBER)
{ {
ScriptError(script, "expected float value, found %s\n", token.string); ScriptError(script, "expected float value, found %s", token.string);
return 0; return 0;
} }
@ -1189,7 +1189,7 @@ signed long int ReadSignedInt(script_t *script)
{ {
if(!PS_ExpectAnyToken(script, &token)) if(!PS_ExpectAnyToken(script, &token))
{ {
ScriptError(script, "Missing integer value\n"); ScriptError(script, "Missing integer value");
return 0; return 0;
} }
@ -1198,7 +1198,7 @@ signed long int ReadSignedInt(script_t *script)
if (token.type != TT_NUMBER || token.subtype == TT_FLOAT) if (token.type != TT_NUMBER || token.subtype == TT_FLOAT)
{ {
ScriptError(script, "expected integer value, found %s\n", token.string); ScriptError(script, "expected integer value, found %s", token.string);
return 0; return 0;
} }

View file

@ -201,7 +201,7 @@ int PS_ExpectTokenType(script_t *script, int type, int subtype, token_t *token);
int PS_ExpectAnyToken(script_t *script, token_t *token); int PS_ExpectAnyToken(script_t *script, token_t *token);
//returns true when the token is available //returns true when the token is available
int PS_CheckTokenString(script_t *script, char *string); int PS_CheckTokenString(script_t *script, char *string);
//returns true an reads the token when a token with the given type is available //returns true and reads the token when a token with the given type is available
int PS_CheckTokenType(script_t *script, int type, int subtype, token_t *token); int PS_CheckTokenType(script_t *script, int type, int subtype, token_t *token);
//skip tokens until the given token string is read //skip tokens until the given token string is read
int PS_SkipUntilString(script_t *script, char *string); int PS_SkipUntilString(script_t *script, char *string);

View file

@ -25,8 +25,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// executed by a key binding // executed by a key binding
#include "cg_local.h" #include "cg_local.h"
#include "../ui/ui_shared.h"
#ifdef MISSIONPACK #ifdef MISSIONPACK
#include "../ui/ui_shared.h"
extern menuDef_t *menuScoreboard; extern menuDef_t *menuScoreboard;
#endif #endif
@ -211,6 +211,7 @@ static void CG_TellAttacker_f( void ) {
trap_SendClientCommand( command ); trap_SendClientCommand( command );
} }
#ifdef MISSIONPACK
static void CG_VoiceTellTarget_f( void ) { static void CG_VoiceTellTarget_f( void ) {
int clientNum; int clientNum;
char command[128]; char command[128];
@ -241,7 +242,6 @@ static void CG_VoiceTellAttacker_f( void ) {
trap_SendClientCommand( command ); trap_SendClientCommand( command );
} }
#ifdef MISSIONPACK
static void CG_NextTeamMember_f( void ) { static void CG_NextTeamMember_f( void ) {
CG_SelectNextPlayer(); CG_SelectNextPlayer();
} }
@ -613,12 +613,12 @@ static consoleCommand_t commands[] = {
{ "weapnext", CG_NextWeapon_f }, { "weapnext", CG_NextWeapon_f },
{ "weapprev", CG_PrevWeapon_f }, { "weapprev", CG_PrevWeapon_f },
{ "weapon", CG_Weapon_f }, { "weapon", CG_Weapon_f },
{ "tcmd", CG_TargetCommand_f },
{ "tell_target", CG_TellTarget_f }, { "tell_target", CG_TellTarget_f },
{ "tell_attacker", CG_TellAttacker_f }, { "tell_attacker", CG_TellAttacker_f },
#ifdef MISSIONPACK
{ "vtell_target", CG_VoiceTellTarget_f }, { "vtell_target", CG_VoiceTellTarget_f },
{ "vtell_attacker", CG_VoiceTellAttacker_f }, { "vtell_attacker", CG_VoiceTellAttacker_f },
{ "tcmd", CG_TargetCommand_f },
#ifdef MISSIONPACK
{ "loadhud", CG_LoadHud_f }, { "loadhud", CG_LoadHud_f },
{ "nextTeamMember", CG_NextTeamMember_f }, { "nextTeamMember", CG_NextTeamMember_f },
{ "prevTeamMember", CG_PrevTeamMember_f }, { "prevTeamMember", CG_PrevTeamMember_f },
@ -709,6 +709,7 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("say"); trap_AddCommand ("say");
trap_AddCommand ("say_team"); trap_AddCommand ("say_team");
trap_AddCommand ("tell"); trap_AddCommand ("tell");
#ifdef MISSIONPACK
trap_AddCommand ("vsay"); trap_AddCommand ("vsay");
trap_AddCommand ("vsay_team"); trap_AddCommand ("vsay_team");
trap_AddCommand ("vtell"); trap_AddCommand ("vtell");
@ -716,12 +717,16 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("vosay"); trap_AddCommand ("vosay");
trap_AddCommand ("vosay_team"); trap_AddCommand ("vosay_team");
trap_AddCommand ("votell"); trap_AddCommand ("votell");
#endif
trap_AddCommand ("give"); trap_AddCommand ("give");
trap_AddCommand ("god"); trap_AddCommand ("god");
trap_AddCommand ("notarget"); trap_AddCommand ("notarget");
trap_AddCommand ("noclip"); trap_AddCommand ("noclip");
trap_AddCommand ("where");
trap_AddCommand ("team"); trap_AddCommand ("team");
trap_AddCommand ("follow"); trap_AddCommand ("follow");
trap_AddCommand ("follownext");
trap_AddCommand ("followprev");
trap_AddCommand ("levelshot"); trap_AddCommand ("levelshot");
trap_AddCommand ("addbot"); trap_AddCommand ("addbot");
trap_AddCommand ("setviewpos"); trap_AddCommand ("setviewpos");

View file

@ -2349,7 +2349,7 @@ static void CG_DrawLagometer( void ) {
trap_R_SetColor( NULL ); trap_R_SetColor( NULL );
if ( cg_nopredict.integer || cg_synchronousClients.integer ) { if ( cg_nopredict.integer || cg_synchronousClients.integer ) {
CG_DrawBigString( ax, ay, "snc", 1.0 ); CG_DrawBigString( x, y, "snc", 1.0 );
} }
CG_DrawDisconnect(); CG_DrawDisconnect();

View file

@ -849,20 +849,21 @@ CG_AdjustPositionForMover
Also called by client movement prediction code Also called by client movement prediction code
========================= =========================
*/ */
void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out ) { void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out, vec3_t angles_in, vec3_t angles_out) {
centity_t *cent; centity_t *cent;
vec3_t oldOrigin, origin, deltaOrigin; vec3_t oldOrigin, origin, deltaOrigin;
vec3_t oldAngles, angles; vec3_t oldAngles, angles, deltaAngles;
//vec3_t deltaAngles;
if ( moverNum <= 0 || moverNum >= ENTITYNUM_MAX_NORMAL ) { if ( moverNum <= 0 || moverNum >= ENTITYNUM_MAX_NORMAL ) {
VectorCopy( in, out ); VectorCopy( in, out );
VectorCopy(angles_in, angles_out);
return; return;
} }
cent = &cg_entities[ moverNum ]; cent = &cg_entities[ moverNum ];
if ( cent->currentState.eType != ET_MOVER ) { if ( cent->currentState.eType != ET_MOVER ) {
VectorCopy( in, out ); VectorCopy( in, out );
VectorCopy(angles_in, angles_out);
return; return;
} }
@ -873,10 +874,10 @@ void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int
BG_EvaluateTrajectory( &cent->currentState.apos, toTime, angles ); BG_EvaluateTrajectory( &cent->currentState.apos, toTime, angles );
VectorSubtract( origin, oldOrigin, deltaOrigin ); VectorSubtract( origin, oldOrigin, deltaOrigin );
//VectorSubtract( angles, oldAngles, deltaAngles ); VectorSubtract( angles, oldAngles, deltaAngles );
VectorAdd( in, deltaOrigin, out ); VectorAdd( in, deltaOrigin, out );
VectorAdd( angles_in, deltaAngles, angles_out );
// FIXME: origin change when on a rotating object // FIXME: origin change when on a rotating object
} }
@ -969,7 +970,7 @@ static void CG_CalcEntityLerpPositions( centity_t *cent ) {
// player state // player state
if ( cent != &cg.predictedPlayerEntity ) { if ( cent != &cg.predictedPlayerEntity ) {
CG_AdjustPositionForMover( cent->lerpOrigin, cent->currentState.groundEntityNum, CG_AdjustPositionForMover( cent->lerpOrigin, cent->currentState.groundEntityNum,
cg.snap->serverTime, cg.time, cent->lerpOrigin ); cg.snap->serverTime, cg.time, cent->lerpOrigin, cent->lerpAngles, cent->lerpAngles);
} }
} }
@ -1149,7 +1150,7 @@ void CG_AddCEntity( centity_t *cent ) {
switch ( cent->currentState.eType ) { switch ( cent->currentState.eType ) {
default: default:
CG_Error( "Bad entity type: %i\n", cent->currentState.eType ); CG_Error( "Bad entity type: %i", cent->currentState.eType );
break; break;
// Q3Rally Code Start // Q3Rally Code Start
case ET_CHECKPOINT: case ET_CHECKPOINT:

View file

@ -1235,13 +1235,13 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
if (cg.snap->ps.powerups[PW_BLUEFLAG] || cg.snap->ps.powerups[PW_NEUTRALFLAG]) { if (cg.snap->ps.powerups[PW_BLUEFLAG] || cg.snap->ps.powerups[PW_NEUTRALFLAG]) {
} }
else { else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) { if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
#ifdef MISSIONPACK #ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF) if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound ); CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else else
#endif #endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound ); CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
} }
else if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) { else if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
#ifdef MISSIONPACK #ifdef MISSIONPACK
@ -1276,6 +1276,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
} }
} }
break; break;
#ifdef MISSIONPACK
case GTS_REDOBELISK_ATTACKED: // Overload: red obelisk is being attacked case GTS_REDOBELISK_ATTACKED: // Overload: red obelisk is being attacked
if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) { if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound ); CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
@ -1286,6 +1287,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound ); CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
} }
break; break;
#endif
case GTS_REDTEAM_SCORED: case GTS_REDTEAM_SCORED:
CG_AddBufferedSound(cgs.media.redScoredSound); CG_AddBufferedSound(cgs.media.redScoredSound);

View file

@ -744,10 +744,12 @@ typedef struct {
int soundTime; int soundTime;
qhandle_t soundBuffer[MAX_SOUNDBUFFER]; qhandle_t soundBuffer[MAX_SOUNDBUFFER];
#ifdef MISSIONPACK
// for voice chat buffer // for voice chat buffer
int voiceChatTime; int voiceChatTime;
int voiceChatBufferIn; int voiceChatBufferIn;
int voiceChatBufferOut; int voiceChatBufferOut;
#endif
// warmup countdown // warmup countdown
int warmup; int warmup;
@ -1026,8 +1028,10 @@ typedef struct {
qhandle_t battleWeaponShader; qhandle_t battleWeaponShader;
qhandle_t hastePuffShader; qhandle_t hastePuffShader;
#ifdef MISSIONPACK
qhandle_t redKamikazeShader; qhandle_t redKamikazeShader;
qhandle_t blueKamikazeShader; qhandle_t blueKamikazeShader;
#endif
// Q3Rally Code Start // Q3Rally Code Start
qhandle_t SMAsphaltShader; qhandle_t SMAsphaltShader;
@ -1074,12 +1078,13 @@ typedef struct {
qhandle_t medkitUsageModel; qhandle_t medkitUsageModel;
qhandle_t dustPuffShader; qhandle_t dustPuffShader;
qhandle_t heartShader; qhandle_t heartShader;
qhandle_t invulnerabilityPowerupModel;
// Q3Rally Code Start // Q3Rally Code Start
#endif #endif
qhandle_t dustPuffShader; qhandle_t dustPuffShader;
//#endif //#endif
// Q3Rally Code END // Q3Rally Code END
qhandle_t invulnerabilityPowerupModel;
// scoreboard headers // scoreboard headers
qhandle_t scoreboardName; qhandle_t scoreboardName;
@ -1200,7 +1205,9 @@ typedef struct {
sfxHandle_t flightSound; sfxHandle_t flightSound;
sfxHandle_t medkitSound; sfxHandle_t medkitSound;
#ifdef MISSIONPACK
sfxHandle_t weaponHoverSound; sfxHandle_t weaponHoverSound;
#endif
// teamplay sounds // teamplay sounds
sfxHandle_t captureAwardSound; sfxHandle_t captureAwardSound;
@ -1219,13 +1226,17 @@ typedef struct {
sfxHandle_t redFlagReturnedSound; sfxHandle_t redFlagReturnedSound;
sfxHandle_t blueFlagReturnedSound; sfxHandle_t blueFlagReturnedSound;
#ifdef MISSIONPACK
sfxHandle_t neutralFlagReturnedSound; sfxHandle_t neutralFlagReturnedSound;
#endif
sfxHandle_t enemyTookYourFlagSound; sfxHandle_t enemyTookYourFlagSound;
sfxHandle_t enemyTookTheFlagSound;
sfxHandle_t yourTeamTookEnemyFlagSound; sfxHandle_t yourTeamTookEnemyFlagSound;
sfxHandle_t yourTeamTookTheFlagSound;
sfxHandle_t youHaveFlagSound; sfxHandle_t youHaveFlagSound;
#ifdef MISSIONPACK
sfxHandle_t enemyTookTheFlagSound;
sfxHandle_t yourTeamTookTheFlagSound;
sfxHandle_t yourBaseIsUnderAttackSound; sfxHandle_t yourBaseIsUnderAttackSound;
#endif
sfxHandle_t holyShitSound; sfxHandle_t holyShitSound;
// tournament sounds // tournament sounds
@ -1252,10 +1263,11 @@ typedef struct {
sfxHandle_t doublerSound; sfxHandle_t doublerSound;
sfxHandle_t guardSound; sfxHandle_t guardSound;
sfxHandle_t scoutSound; sfxHandle_t scoutSound;
#endif
qhandle_t cursor; qhandle_t cursor;
qhandle_t selectCursor; qhandle_t selectCursor;
qhandle_t sizeCursor; qhandle_t sizeCursor;
#endif
sfxHandle_t regenSound; sfxHandle_t regenSound;
sfxHandle_t protectSound; sfxHandle_t protectSound;
@ -1462,8 +1474,10 @@ extern vmCvar_t cg_predictItems;
extern vmCvar_t cg_deferPlayers; extern vmCvar_t cg_deferPlayers;
extern vmCvar_t cg_drawFriend; extern vmCvar_t cg_drawFriend;
extern vmCvar_t cg_teamChatsOnly; extern vmCvar_t cg_teamChatsOnly;
#ifdef MISSIONPACK
extern vmCvar_t cg_noVoiceChats; extern vmCvar_t cg_noVoiceChats;
extern vmCvar_t cg_noVoiceText; extern vmCvar_t cg_noVoiceText;
#endif
extern vmCvar_t cg_scorePlum; extern vmCvar_t cg_scorePlum;
extern vmCvar_t cg_smoothClients; extern vmCvar_t cg_smoothClients;
extern vmCvar_t pmove_fixed; extern vmCvar_t pmove_fixed;
@ -1688,7 +1702,7 @@ void CG_AddCEntity( centity_t *cent );
void CG_SetEntitySoundPosition( centity_t *cent ); void CG_SetEntitySoundPosition( centity_t *cent );
void CG_AddPacketEntities( void ); void CG_AddPacketEntities( void );
void CG_Beam( centity_t *cent ); void CG_Beam( centity_t *cent );
void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out ); void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out, vec3_t angles_in, vec3_t angles_out);
// Q3Rally Code Start // Q3Rally Code Start
qboolean CG_TagExists( qhandle_t parentModel, char *tagName ); qboolean CG_TagExists( qhandle_t parentModel, char *tagName );
@ -1839,10 +1853,12 @@ void CG_InitConsoleCommands( void );
void CG_ExecuteNewServerCommands( int latestSequence ); void CG_ExecuteNewServerCommands( int latestSequence );
void CG_ParseServerinfo( void ); void CG_ParseServerinfo( void );
void CG_SetConfigValues( void ); void CG_SetConfigValues( void );
void CG_LoadVoiceChats( void );
void CG_ShaderStateChanged(void); void CG_ShaderStateChanged(void);
#ifdef MISSIONPACK
void CG_LoadVoiceChats( void );
void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color, const char *cmd ); void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color, const char *cmd );
void CG_PlayBufferedVoiceChats( void ); void CG_PlayBufferedVoiceChats( void );
#endif
// //
// cg_playerstate.c // cg_playerstate.c

View file

@ -195,8 +195,10 @@ vmCvar_t cg_drawTeamOverlay;
vmCvar_t cg_teamOverlayUserinfo; vmCvar_t cg_teamOverlayUserinfo;
vmCvar_t cg_drawFriend; vmCvar_t cg_drawFriend;
vmCvar_t cg_teamChatsOnly; vmCvar_t cg_teamChatsOnly;
#ifdef MISSIONPACK
vmCvar_t cg_noVoiceChats; vmCvar_t cg_noVoiceChats;
vmCvar_t cg_noVoiceText; vmCvar_t cg_noVoiceText;
#endif
vmCvar_t cg_hudFiles; vmCvar_t cg_hudFiles;
vmCvar_t cg_scorePlum; vmCvar_t cg_scorePlum;
vmCvar_t cg_smoothClients; vmCvar_t cg_smoothClients;
@ -382,8 +384,10 @@ static cvarTable_t cvarTable[] = {
{ &cg_stats, "cg_stats", "0", 0 }, { &cg_stats, "cg_stats", "0", 0 },
{ &cg_drawFriend, "cg_drawFriend", "1", CVAR_ARCHIVE }, { &cg_drawFriend, "cg_drawFriend", "1", CVAR_ARCHIVE },
{ &cg_teamChatsOnly, "cg_teamChatsOnly", "0", CVAR_ARCHIVE }, { &cg_teamChatsOnly, "cg_teamChatsOnly", "0", CVAR_ARCHIVE },
#ifdef MISSIONPACK
{ &cg_noVoiceChats, "cg_noVoiceChats", "0", CVAR_ARCHIVE }, { &cg_noVoiceChats, "cg_noVoiceChats", "0", CVAR_ARCHIVE },
{ &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE }, { &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE },
#endif
// the following variables are created in other parts of the system, // the following variables are created in other parts of the system,
// but we also reference them here // but we also reference them here
{ &cg_buildScript, "com_buildScript", "0", 0 }, // force loading of all possible data amd error on failures { &cg_buildScript, "com_buildScript", "0", 0 }, // force loading of all possible data amd error on failures
@ -562,7 +566,7 @@ void QDECL Com_Error( int level, const char *error, ... ) {
Q_vsnprintf (text, sizeof(text), error, argptr); Q_vsnprintf (text, sizeof(text), error, argptr);
va_end (argptr); va_end (argptr);
CG_Error( "%s", text); trap_Error( text );
} }
void QDECL Com_Printf( const char *msg, ... ) { void QDECL Com_Printf( const char *msg, ... ) {
@ -573,7 +577,7 @@ void QDECL Com_Printf( const char *msg, ... ) {
Q_vsnprintf (text, sizeof(text), msg, argptr); Q_vsnprintf (text, sizeof(text), msg, argptr);
va_end (argptr); va_end (argptr);
CG_Printf ("%s", text); trap_Print( text );
} }
#endif #endif
@ -752,9 +756,6 @@ static void CG_RegisterSounds( void ) {
#else #else
cgs.media.youHaveFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_you_flag.wav", qtrue ); cgs.media.youHaveFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_you_flag.wav", qtrue );
cgs.media.holyShitSound = trap_S_RegisterSound("sound/feedback/voc_holyshit.wav", qtrue); cgs.media.holyShitSound = trap_S_RegisterSound("sound/feedback/voc_holyshit.wav", qtrue);
cgs.media.neutralFlagReturnedSound = trap_S_RegisterSound( "sound/teamplay/flagreturn_opponent.wav", qtrue );
cgs.media.yourTeamTookTheFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_team_1flag.wav", qtrue );
cgs.media.enemyTookTheFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_enemy_1flag.wav", qtrue );
#endif #endif
} }
@ -1273,10 +1274,9 @@ static void CG_RegisterGraphics( void ) {
cgs.media.invulnerabilityJuicedModel = trap_R_RegisterModel( "models/powerups/shield/juicer.md3" ); cgs.media.invulnerabilityJuicedModel = trap_R_RegisterModel( "models/powerups/shield/juicer.md3" );
cgs.media.medkitUsageModel = trap_R_RegisterModel( "models/powerups/regen.md3" ); cgs.media.medkitUsageModel = trap_R_RegisterModel( "models/powerups/regen.md3" );
cgs.media.heartShader = trap_R_RegisterShaderNoMip( "ui/assets/statusbar/selectedhealth.tga" ); cgs.media.heartShader = trap_R_RegisterShaderNoMip( "ui/assets/statusbar/selectedhealth.tga" );
cgs.media.invulnerabilityPowerupModel = trap_R_RegisterModel( "models/powerups/shield/shield.md3" );
#endif #endif
cgs.media.invulnerabilityPowerupModel = trap_R_RegisterModel( "models/powerups/shield/shield.md3" );
cgs.media.medalImpressive = trap_R_RegisterShaderNoMip( "medal_impressive" ); cgs.media.medalImpressive = trap_R_RegisterShaderNoMip( "medal_impressive" );
cgs.media.medalExcellent = trap_R_RegisterShaderNoMip( "medal_excellent" ); cgs.media.medalExcellent = trap_R_RegisterShaderNoMip( "medal_excellent" );
cgs.media.medalGauntlet = trap_R_RegisterShaderNoMip( "medal_gauntlet" ); cgs.media.medalGauntlet = trap_R_RegisterShaderNoMip( "medal_gauntlet" );
@ -1728,13 +1728,13 @@ void CG_LoadMenus(const char *menuFile) {
Com_Printf( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile ); Com_Printf( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile );
len = trap_FS_FOpenFile( "ui/hud.txt", &f, FS_READ ); len = trap_FS_FOpenFile( "ui/hud.txt", &f, FS_READ );
if (!f) { if (!f) {
trap_Error( va( S_COLOR_RED "default menu file not found: ui/hud.txt, unable to continue!\n") ); CG_Error( S_COLOR_RED "default menu file not found: ui/hud.txt, unable to continue!" );
} }
} }
if ( len >= MAX_MENUDEFFILE ) { if ( len >= MAX_MENUDEFFILE ) {
trap_Error( va( S_COLOR_RED "menu file too large: %s is %i, max allowed is %i\n", menuFile, len, MAX_MENUDEFFILE ) );
trap_FS_FCloseFile( f ); trap_FS_FCloseFile( f );
CG_Error( S_COLOR_RED "menu file too large: %s is %i, max allowed is %i", menuFile, len, MAX_MENUDEFFILE );
return; return;
} }

View file

@ -1275,7 +1275,7 @@ void CG_ParticleExplosion (char *animStr, vec3_t origin, vec3_t vel, int duratio
break; break;
} }
if (!shaderAnimNames[anim]) { if (!shaderAnimNames[anim]) {
CG_Error("CG_ParticleExplosion: unknown animation string: %s\n", animStr); CG_Error("CG_ParticleExplosion: unknown animation string: %s", animStr);
return; return;
} }

View file

@ -2130,7 +2130,7 @@ static void CG_PlayerFlag( centity_t *cent, qhandle_t hSkin, refEntity_t *torso
dir[2] += 100; dir[2] += 100;
VectorNormalize( dir ); VectorNormalize( dir );
d = DotProduct(pole.axis[2], dir); d = DotProduct(pole.axis[2], dir);
// if there is anough movement orthogonal to the flag pole // if there is enough movement orthogonal to the flag pole
if (fabs(d) < 0.9) { if (fabs(d) < 0.9) {
// //
d = DotProduct(pole.axis[0], dir); d = DotProduct(pole.axis[0], dir);
@ -4035,7 +4035,7 @@ void CG_ResetPlayerEntity( centity_t *cent ) {
cent->pe.legs.pitchAngle = 0; cent->pe.legs.pitchAngle = 0;
cent->pe.legs.pitching = qfalse; cent->pe.legs.pitching = qfalse;
memset( &cent->pe.torso, 0, sizeof( cent->pe.legs ) ); memset( &cent->pe.torso, 0, sizeof( cent->pe.torso ) );
cent->pe.torso.yawAngle = cent->rawAngles[YAW]; cent->pe.torso.yawAngle = cent->rawAngles[YAW];
cent->pe.torso.yawing = qfalse; cent->pe.torso.yawing = qfalse;
cent->pe.torso.pitchAngle = cent->rawAngles[PITCH]; cent->pe.torso.pitchAngle = cent->rawAngles[PITCH];

View file

@ -384,7 +384,7 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
} }
if (ps->persistant[PERS_GAUNTLET_FRAG_COUNT] != ops->persistant[PERS_GAUNTLET_FRAG_COUNT]) { if (ps->persistant[PERS_GAUNTLET_FRAG_COUNT] != ops->persistant[PERS_GAUNTLET_FRAG_COUNT]) {
#ifdef MISSIONPACK #ifdef MISSIONPACK
if (ops->persistant[PERS_GAUNTLET_FRAG_COUNT] == 1) { if (ps->persistant[PERS_GAUNTLET_FRAG_COUNT] == 1) {
sfx = cgs.media.firstHumiliationSound; sfx = cgs.media.firstHumiliationSound;
} else { } else {
sfx = cgs.media.humiliationSound; sfx = cgs.media.humiliationSound;

View file

@ -1028,9 +1028,9 @@ void CG_PredictPlayerState( void ) {
} }
cg.thisFrameTeleport = qfalse; cg.thisFrameTeleport = qfalse;
} else { } else {
vec3_t adjusted; vec3_t adjusted, new_angles;
CG_AdjustPositionForMover( cg.predictedPlayerState.origin, CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum, cg.physicsTime, cg.oldTime, adjusted ); cg.predictedPlayerState.groundEntityNum, cg.physicsTime, cg.oldTime, adjusted, cg.predictedPlayerState.viewangles, new_angles);
// Q3Rally Code Start // Q3Rally Code Start
/* /*
@ -1128,7 +1128,7 @@ void CG_PredictPlayerState( void ) {
// adjust for the movement of the groundentity // adjust for the movement of the groundentity
CG_AdjustPositionForMover( cg.predictedPlayerState.origin, CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum, cg.predictedPlayerState.groundEntityNum,
cg.physicsTime, cg.time, cg.predictedPlayerState.origin ); cg.physicsTime, cg.time, cg.predictedPlayerState.origin, cg.predictedPlayerState.viewangles, cg.predictedPlayerState.viewangles);
if ( cg_showmiss.integer ) { if ( cg_showmiss.integer ) {
if (cg.predictedPlayerState.eventSequence > oldPlayerState.eventSequence + MAX_PS_EVENTS) { if (cg.predictedPlayerState.eventSequence > oldPlayerState.eventSequence + MAX_PS_EVENTS) {

View file

@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// be a valid snapshot this frame // be a valid snapshot this frame
#include "cg_local.h" #include "cg_local.h"
#ifdef MISSIONPACK
#include "../../ui/menudef.h" #include "../../ui/menudef.h"
typedef struct { typedef struct {
@ -47,7 +48,6 @@ static const orderTask_t validOrders[] = {
static const int numValidOrders = ARRAY_LEN(validOrders); static const int numValidOrders = ARRAY_LEN(validOrders);
#ifdef MISSIONPACK
static int CG_ValidOrder(const char *p) { static int CG_ValidOrder(const char *p) {
int i; int i;
for (i = 0; i < numValidOrders; i++) { for (i = 0; i < numValidOrders; i++) {
@ -515,7 +515,8 @@ static void CG_MapRestart( void ) {
cg.fraglimitWarnings = 0; cg.fraglimitWarnings = 0;
cg.timelimitWarnings = 0; cg.timelimitWarnings = 0;
cg.rewardTime = 0;
cg.rewardStack = 0;
cg.intermissionStarted = qfalse; cg.intermissionStarted = qfalse;
cg.levelShot = qfalse; cg.levelShot = qfalse;
@ -566,6 +567,8 @@ static void CG_MapRestart( void ) {
// END // END
} }
#ifdef MISSIONPACK
#define MAX_VOICEFILESIZE 16384 #define MAX_VOICEFILESIZE 16384
#define MAX_VOICEFILES 8 #define MAX_VOICEFILES 8
#define MAX_VOICECHATS 64 #define MAX_VOICECHATS 64
@ -1025,7 +1028,6 @@ CG_VoiceChat
================= =================
*/ */
void CG_VoiceChat( int mode ) { void CG_VoiceChat( int mode ) {
#ifdef MISSIONPACK
const char *cmd; const char *cmd;
int clientNum, color; int clientNum, color;
qboolean voiceOnly; qboolean voiceOnly;
@ -1044,8 +1046,8 @@ void CG_VoiceChat( int mode ) {
} }
CG_VoiceChatLocal( mode, voiceOnly, clientNum, color, cmd ); CG_VoiceChatLocal( mode, voiceOnly, clientNum, color, cmd );
#endif
} }
#endif
/* /*
================= =================
@ -1178,6 +1180,8 @@ static void CG_ServerCommand( void ) {
CG_Printf( "%s\n", text ); CG_Printf( "%s\n", text );
return; return;
} }
#ifdef MISSIONPACK
if ( !strcmp( cmd, "vchat" ) ) { if ( !strcmp( cmd, "vchat" ) ) {
CG_VoiceChat( SAY_ALL ); CG_VoiceChat( SAY_ALL );
return; return;
@ -1192,6 +1196,7 @@ static void CG_ServerCommand( void ) {
CG_VoiceChat( SAY_TELL ); CG_VoiceChat( SAY_TELL );
return; return;
} }
#endif
if ( !strcmp( cmd, "scores" ) ) { if ( !strcmp( cmd, "scores" ) ) {
CG_ParseScores(); CG_ParseScores();

View file

@ -150,7 +150,7 @@ static void CG_AddTestModel (void) {
return; return;
} }
// if testing a gun, set the origin reletive to the view origin // if testing a gun, set the origin relative to the view origin
if ( cg.testGun ) { if ( cg.testGun ) {
VectorCopy( cg.refdef.vieworg, cg.testModelEntity.origin ); VectorCopy( cg.refdef.vieworg, cg.testModelEntity.origin );
VectorCopy( cg.refdef.viewaxis[0], cg.testModelEntity.axis[0] ); VectorCopy( cg.refdef.viewaxis[0], cg.testModelEntity.axis[0] );
@ -901,7 +901,7 @@ static int CG_CalcViewValues( void ) {
} }
// END // END
// position eye reletive to origin // position eye relative to origin
AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis );
if ( cg.hyperspace ) { if ( cg.hyperspace ) {
@ -1069,8 +1069,10 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo
// add buffered sounds // add buffered sounds
CG_PlayBufferedSounds(); CG_PlayBufferedSounds();
#ifdef MISSIONPACK
// play buffered voice chats // play buffered voice chats
CG_PlayBufferedVoiceChats(); CG_PlayBufferedVoiceChats();
#endif
// finish up the rest of the refdef // finish up the rest of the refdef
if ( cg.testModelEntity.hModel ) { if ( cg.testModelEntity.hModel ) {

View file

@ -873,7 +873,7 @@ void CG_RegisterItemVisuals( int itemNum ) {
item = &bg_itemlist[ itemNum ]; item = &bg_itemlist[ itemNum ];
memset( itemInfo, 0, sizeof( &itemInfo ) ); memset( itemInfo, 0, sizeof( *itemInfo ) );
itemInfo->registered = qtrue; itemInfo->registered = qtrue;
itemInfo->models[0] = trap_R_RegisterModel( item->world_model[0] ); itemInfo->models[0] = trap_R_RegisterModel( item->world_model[0] );

View file

@ -418,7 +418,7 @@ void CL_JoystickMove( usercmd_t *cmd ) {
cmd->forwardmove = ClampChar( cmd->forwardmove + (int) (j_forward->value * cl.joystickAxis[j_forward_axis->integer]) ); cmd->forwardmove = ClampChar( cmd->forwardmove + (int) (j_forward->value * cl.joystickAxis[j_forward_axis->integer]) );
} }
cmd->upmove = ClampChar( cmd->upmove + cl.joystickAxis[AXIS_UP] ); cmd->upmove = ClampChar( cmd->upmove + (int) (j_up->value * cl.joystickAxis[j_up_axis->integer]) );
} }
/* /*

View file

@ -96,10 +96,12 @@ cvar_t *j_pitch;
cvar_t *j_yaw; cvar_t *j_yaw;
cvar_t *j_forward; cvar_t *j_forward;
cvar_t *j_side; cvar_t *j_side;
cvar_t *j_up;
cvar_t *j_pitch_axis; cvar_t *j_pitch_axis;
cvar_t *j_yaw_axis; cvar_t *j_yaw_axis;
cvar_t *j_forward_axis; cvar_t *j_forward_axis;
cvar_t *j_side_axis; cvar_t *j_side_axis;
cvar_t *j_up_axis;
cvar_t *cl_activeAction; cvar_t *cl_activeAction;
@ -3202,7 +3204,7 @@ void CL_InitRef( void ) {
Cvar_ForceReset("cl_renderer"); Cvar_ForceReset("cl_renderer");
Com_sprintf(dllName, sizeof(dllName), "renderer_opengl1_" ARCH_STRING DLL_EXT); Com_sprintf(dllName, sizeof(dllName), "renderer_opengl1_" ARCH_STRING DLL_EXT);
rendererLib = Sys_LoadLibrary(dllName); rendererLib = Sys_LoadDll(dllName, qfalse);
} }
if(!rendererLib) if(!rendererLib)
@ -3524,10 +3526,19 @@ void CL_Init( void ) {
j_yaw = Cvar_Get ("j_yaw", "-0.022", CVAR_ARCHIVE); j_yaw = Cvar_Get ("j_yaw", "-0.022", CVAR_ARCHIVE);
j_forward = Cvar_Get ("j_forward", "-0.25", CVAR_ARCHIVE); j_forward = Cvar_Get ("j_forward", "-0.25", CVAR_ARCHIVE);
j_side = Cvar_Get ("j_side", "0.25", CVAR_ARCHIVE); j_side = Cvar_Get ("j_side", "0.25", CVAR_ARCHIVE);
j_up = Cvar_Get ("j_up", "1", CVAR_ARCHIVE);
j_pitch_axis = Cvar_Get ("j_pitch_axis", "3", CVAR_ARCHIVE); j_pitch_axis = Cvar_Get ("j_pitch_axis", "3", CVAR_ARCHIVE);
j_yaw_axis = Cvar_Get ("j_yaw_axis", "4", CVAR_ARCHIVE); j_yaw_axis = Cvar_Get ("j_yaw_axis", "4", CVAR_ARCHIVE);
j_forward_axis = Cvar_Get ("j_forward_axis", "1", CVAR_ARCHIVE); j_forward_axis = Cvar_Get ("j_forward_axis", "1", CVAR_ARCHIVE);
j_side_axis = Cvar_Get ("j_side_axis", "0", CVAR_ARCHIVE); j_side_axis = Cvar_Get ("j_side_axis", "0", CVAR_ARCHIVE);
j_up_axis = Cvar_Get ("j_up_axis", "2", CVAR_ARCHIVE);
Cvar_CheckRange(j_pitch_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
Cvar_CheckRange(j_yaw_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
Cvar_CheckRange(j_forward_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
Cvar_CheckRange(j_side_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
Cvar_CheckRange(j_up_axis, 0, MAX_JOYSTICK_AXIS-1, qtrue);
cl_motdString = Cvar_Get( "cl_motdString", "", CVAR_ROM ); cl_motdString = Cvar_Get( "cl_motdString", "", CVAR_ROM );
@ -3943,7 +3954,7 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
// if this server status request has the same address // if this server status request has the same address
if ( NET_CompareAdr( to, serverStatus->address) ) { if ( NET_CompareAdr( to, serverStatus->address) ) {
// if we recieved an response for this server status request // if we received a response for this server status request
if (!serverStatus->pending) { if (!serverStatus->pending) {
Q_strncpyz(serverStatusString, serverStatus->string, maxLen); Q_strncpyz(serverStatusString, serverStatus->string, maxLen);
serverStatus->retrieved = qtrue; serverStatus->retrieved = qtrue;

View file

@ -403,10 +403,12 @@ extern cvar_t *j_pitch;
extern cvar_t *j_yaw; extern cvar_t *j_yaw;
extern cvar_t *j_forward; extern cvar_t *j_forward;
extern cvar_t *j_side; extern cvar_t *j_side;
extern cvar_t *j_up;
extern cvar_t *j_pitch_axis; extern cvar_t *j_pitch_axis;
extern cvar_t *j_yaw_axis; extern cvar_t *j_yaw_axis;
extern cvar_t *j_forward_axis; extern cvar_t *j_forward_axis;
extern cvar_t *j_side_axis; extern cvar_t *j_side_axis;
extern cvar_t *j_up_axis;
extern cvar_t *cl_timedemo; extern cvar_t *cl_timedemo;
extern cvar_t *cl_aviFrameRate; extern cvar_t *cl_aviFrameRate;

View file

@ -690,7 +690,6 @@ void S_Base_ClearLoopingSounds( qboolean killall ) {
int i; int i;
for ( i = 0 ; i < MAX_GENTITIES ; i++) { for ( i = 0 ; i < MAX_GENTITIES ; i++) {
if (killall || loopSounds[i].kill == qtrue || (loopSounds[i].sfx && loopSounds[i].sfx->soundLength == 0)) { if (killall || loopSounds[i].kill == qtrue || (loopSounds[i].sfx && loopSounds[i].sfx->soundLength == 0)) {
loopSounds[i].kill = qfalse;
S_Base_StopLoopingSound(i); S_Base_StopLoopingSound(i);
} }
} }

View file

@ -219,11 +219,11 @@ qboolean S_LoadSound( sfx_t *sfx )
return qfalse; return qfalse;
if ( info.width == 1 ) { if ( info.width == 1 ) {
Com_DPrintf(S_COLOR_YELLOW "WARNING: %s is a 8 bit wav file\n", sfx->soundName); Com_DPrintf(S_COLOR_YELLOW "WARNING: %s is a 8 bit audio file\n", sfx->soundName);
} }
if ( info.rate != 22050 ) { if ( info.rate != 22050 ) {
Com_DPrintf(S_COLOR_YELLOW "WARNING: %s is not a 22kHz wav file\n", sfx->soundName); Com_DPrintf(S_COLOR_YELLOW "WARNING: %s is not a 22kHz audio file\n", sfx->soundName);
} }
samples = Hunk_AllocateTempMemory(info.samples * sizeof(short) * 2); samples = Hunk_AllocateTempMemory(info.samples * sizeof(short) * 2);

View file

@ -491,7 +491,7 @@ sfxHandle_t S_AL_RegisterSound( const char *sample, qboolean compressed )
================= =================
S_AL_BufferGet S_AL_BufferGet
Return's an sfx's buffer Return's a sfx's buffer
================= =================
*/ */
static static

View file

@ -45,8 +45,8 @@ void S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocit
void S_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx ); void S_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx );
void S_StopLoopingSound(int entityNum ); void S_StopLoopingSound(int entityNum );
// recompute the reletive volumes for all running sounds // recompute the relative volumes for all running sounds
// reletive to the given entityNum / orientation // relative to the given entityNum / orientation
void S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater ); void S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater );
// let the sound system know where an entity currently is // let the sound system know where an entity currently is

View file

@ -496,7 +496,9 @@ int BotChat_StartLevel(bot_state_t *bs) {
if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse; if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;
//don't chat in teamplay //don't chat in teamplay
if (TeamPlayIsOn()) { if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt"); trap_EA_Command(bs->client, "vtaunt");
#endif
return qfalse; return qfalse;
} }
// don't chat in tournament mode // don't chat in tournament mode
@ -531,9 +533,11 @@ int BotChat_EndLevel(bot_state_t *bs) {
// teamplay // teamplay
if (TeamPlayIsOn()) if (TeamPlayIsOn())
{ {
#ifdef MISSIONPACK
if (BotIsFirstInRankings(bs)) { if (BotIsFirstInRankings(bs)) {
trap_EA_Command(bs->client, "vtaunt"); trap_EA_Command(bs->client, "vtaunt");
} }
#endif
return qtrue; return qtrue;
} }
// don't chat in tournament mode // don't chat in tournament mode
@ -614,7 +618,9 @@ int BotChat_Death(bot_state_t *bs) {
{ {
//teamplay //teamplay
if (TeamPlayIsOn()) { if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt"); trap_EA_Command(bs->client, "vtaunt");
#endif
return qtrue; return qtrue;
} }
// //
@ -718,7 +724,9 @@ int BotChat_Kill(bot_state_t *bs) {
{ {
//don't chat in teamplay //don't chat in teamplay
if (TeamPlayIsOn()) { if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt"); trap_EA_Command(bs->client, "vtaunt");
#endif
return qfalse; // don't wait return qfalse; // don't wait
} }
// //
@ -951,7 +959,9 @@ int BotChat_Random(bot_state_t *bs) {
EasyClientName(bs->lastkilledplayer, name, sizeof(name)); EasyClientName(bs->lastkilledplayer, name, sizeof(name));
} }
if (TeamPlayIsOn()) { if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt"); trap_EA_Command(bs->client, "vtaunt");
#endif
return qfalse; // don't wait return qfalse; // don't wait
} }
// //

View file

@ -2676,7 +2676,7 @@ int AINode_Battle_Retreat(bot_state_t *bs) {
else if (!(moveresult.flags & MOVERESULT_MOVEMENTVIEWSET) else if (!(moveresult.flags & MOVERESULT_MOVEMENTVIEWSET)
&& !(bs->flags & BFL_IDEALVIEWSET) ) { && !(bs->flags & BFL_IDEALVIEWSET) ) {
attack_skill = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_ATTACK_SKILL, 0, 1); attack_skill = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_ATTACK_SKILL, 0, 1);
//if the bot is skilled anough //if the bot is skilled enough
if (attack_skill > 0.3) { if (attack_skill > 0.3) {
BotAimAtEnemy(bs); BotAimAtEnemy(bs);
} }
@ -2835,7 +2835,7 @@ int AINode_Battle_NBG(bot_state_t *bs) {
else if (!(moveresult.flags & MOVERESULT_MOVEMENTVIEWSET) else if (!(moveresult.flags & MOVERESULT_MOVEMENTVIEWSET)
&& !(bs->flags & BFL_IDEALVIEWSET)) { && !(bs->flags & BFL_IDEALVIEWSET)) {
attack_skill = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_ATTACK_SKILL, 0, 1); attack_skill = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_ATTACK_SKILL, 0, 1);
//if the bot is skilled anough and the enemy is visible //if the bot is skilled enough and the enemy is visible
if (attack_skill > 0.3) { if (attack_skill > 0.3) {
//&& BotEntityVisible(bs->entitynum, bs->eye, bs->viewangles, 360, bs->enemy) //&& BotEntityVisible(bs->entitynum, bs->eye, bs->viewangles, 360, bs->enemy)
BotAimAtEnemy(bs); BotAimAtEnemy(bs);

View file

@ -713,7 +713,7 @@ void BotCTFSeekGoals(bot_state_t *bs) {
//if the bot is roaming //if the bot is roaming
if (bs->ctfroam_time > FloatTime()) if (bs->ctfroam_time > FloatTime())
return; return;
//if the bot has anough aggression to decide what to do //if the bot has enough aggression to decide what to do
if (BotAggression(bs) < 50) if (BotAggression(bs) < 50)
return; return;
//set the time to send a message to the team mates //set the time to send a message to the team mates
@ -960,7 +960,7 @@ void Bot1FCTFSeekGoals(bot_state_t *bs) {
//if the bot is roaming //if the bot is roaming
if (bs->ctfroam_time > FloatTime()) if (bs->ctfroam_time > FloatTime())
return; return;
//if the bot has anough aggression to decide what to do //if the bot has enough aggression to decide what to do
if (BotAggression(bs) < 50) if (BotAggression(bs) < 50)
return; return;
//set the time to send a message to the team mates //set the time to send a message to the team mates
@ -1074,7 +1074,7 @@ void BotObeliskSeekGoals(bot_state_t *bs) {
//if the bot is roaming //if the bot is roaming
if (bs->ctfroam_time > FloatTime()) if (bs->ctfroam_time > FloatTime())
return; return;
//if the bot has anough aggression to decide what to do //if the bot has enough aggression to decide what to do
if (BotAggression(bs) < 50) if (BotAggression(bs) < 50)
return; return;
//set the time to send a message to the team mates //set the time to send a message to the team mates
@ -1219,7 +1219,7 @@ void BotHarvesterSeekGoals(bot_state_t *bs) {
//if the bot is roaming //if the bot is roaming
if (bs->ctfroam_time > FloatTime()) if (bs->ctfroam_time > FloatTime())
return; return;
//if the bot has anough aggression to decide what to do //if the bot has enough aggression to decide what to do
if (BotAggression(bs) < 50) if (BotAggression(bs) < 50)
return; return;
//set the time to send a message to the team mates //set the time to send a message to the team mates
@ -2322,7 +2322,6 @@ int BotWantsToRetreat(bot_state_t *bs) {
#endif #endif
// //
if (bs->enemy >= 0) { if (bs->enemy >= 0) {
//if the enemy is carrying a flag
BotEntityInfo(bs->enemy, &entinfo); BotEntityInfo(bs->enemy, &entinfo);
// if the enemy is carrying a flag // if the enemy is carrying a flag
if (EntityCarriesFlag(&entinfo)) return qfalse; if (EntityCarriesFlag(&entinfo)) return qfalse;
@ -2537,7 +2536,7 @@ int BotWantsToCamp(bot_state_t *bs) {
bs->camp_time = FloatTime(); bs->camp_time = FloatTime();
return qfalse; return qfalse;
} }
//if the bot isn't healthy anough //if the bot isn't healthy enough
if (BotAggression(bs) < 50) return qfalse; if (BotAggression(bs) < 50) return qfalse;
//the bot should have at least have the rocket launcher, the railgun or the bfg10k with some ammo //the bot should have at least have the rocket launcher, the railgun or the bfg10k with some ammo
if ((bs->inventory[INVENTORY_ROCKETLAUNCHER] <= 0 || bs->inventory[INVENTORY_ROCKETS < 10]) && if ((bs->inventory[INVENTORY_ROCKETLAUNCHER] <= 0 || bs->inventory[INVENTORY_ROCKETS < 10]) &&
@ -2629,7 +2628,7 @@ void BotRoamGoal(bot_state_t *bs, vec3_t goal) {
//direction and length towards the roam target //direction and length towards the roam target
VectorSubtract(trace.endpos, bs->origin, dir); VectorSubtract(trace.endpos, bs->origin, dir);
len = VectorNormalize(dir); len = VectorNormalize(dir);
//if the roam target is far away anough //if the roam target is far away enough
if (len > 200) { if (len > 200) {
//the roam target is in the given direction before walls //the roam target is in the given direction before walls
VectorScale(dir, len * trace.fraction - 40, dir); VectorScale(dir, len * trace.fraction - 40, dir);
@ -3461,7 +3460,7 @@ void BotAimAtEnemy(bot_state_t *bs) {
VectorSubtract(entinfo.origin, bs->enemyorigin, dir); VectorSubtract(entinfo.origin, bs->enemyorigin, dir);
//if the enemy is NOT pretty far away and strafing just small steps left and right //if the enemy is NOT pretty far away and strafing just small steps left and right
if (!(dist > 100 && VectorLengthSquared(dir) < Square(32))) { if (!(dist > 100 && VectorLengthSquared(dir) < Square(32))) {
//if skilled anough do exact prediction //if skilled enough do exact prediction
if (aim_skill > 0.8 && if (aim_skill > 0.8 &&
//if the weapon is ready to fire //if the weapon is ready to fire
bs->cur_ps.weaponstate == WEAPON_READY) { bs->cur_ps.weaponstate == WEAPON_READY) {
@ -3521,10 +3520,10 @@ void BotAimAtEnemy(bot_state_t *bs) {
//if hitpoint is not vertically too far from the ground target //if hitpoint is not vertically too far from the ground target
if (fabs(trace.endpos[2] - groundtarget[2]) < 50) { if (fabs(trace.endpos[2] - groundtarget[2]) < 50) {
VectorSubtract(trace.endpos, groundtarget, dir); VectorSubtract(trace.endpos, groundtarget, dir);
//if the hitpoint is near anough the ground target //if the hitpoint is near enough the ground target
if (VectorLengthSquared(dir) < Square(60)) { if (VectorLengthSquared(dir) < Square(60)) {
VectorSubtract(trace.endpos, start, dir); VectorSubtract(trace.endpos, start, dir);
//if the hitpoint is far anough from the bot //if the hitpoint is far enough from the bot
if (VectorLengthSquared(dir) > Square(100)) { if (VectorLengthSquared(dir) > Square(100)) {
//check if the bot is visible from the ground target //check if the bot is visible from the ground target
trace.endpos[2] += 1; trace.endpos[2] += 1;
@ -3546,7 +3545,7 @@ void BotAimAtEnemy(bot_state_t *bs) {
// //
VectorCopy(bs->lastenemyorigin, bestorigin); VectorCopy(bs->lastenemyorigin, bestorigin);
bestorigin[2] += 8; bestorigin[2] += 8;
//if the bot is skilled anough //if the bot is skilled enough
if (aim_skill > 0.5) { if (aim_skill > 0.5) {
//do prediction shots around corners //do prediction shots around corners
if (wi.number == WP_BFG || if (wi.number == WP_BFG ||

View file

@ -73,7 +73,7 @@ void BotSetUserInfo(bot_state_t *bs, char *key, char *value);
void BotSetTeamStatus(bot_state_t *bs); void BotSetTeamStatus(bot_state_t *bs);
//returns the name of the client //returns the name of the client
char *ClientName(int client, char *name, int size); char *ClientName(int client, char *name, int size);
//returns an simplyfied client name //returns a simplified client name
char *EasyClientName(int client, char *name, int size); char *EasyClientName(int client, char *name, int size);
//returns the skin used by the client //returns the skin used by the client
char *ClientSkin(int client, char *skin, int size); char *ClientSkin(int client, char *skin, int size);

View file

@ -132,9 +132,12 @@ int BotSortTeamMatesByBaseTravelTime(bot_state_t *bs, int *teammates, int maxtea
int traveltimes[MAX_CLIENTS]; int traveltimes[MAX_CLIENTS];
bot_goal_t *goal = NULL; bot_goal_t *goal = NULL;
// STONELANCE #ifdef MISSIONPACK
if (gametype == GT_CTF /*|| gametype == GT_1FCTF*/) { if (gametype == GT_CTF || gametype == GT_1FCTF)
// END #else
if (gametype == GT_CTF)
#endif
{
if (BotTeam(bs) == TEAM_RED) if (BotTeam(bs) == TEAM_RED)
goal = &ctf_redflag; goal = &ctf_redflag;
else else

View file

@ -777,6 +777,43 @@ double atan2( double y, double x ) {
#endif #endif
/*
===============
powN
Raise a double to a integer power
===============
*/
static double powN( double base, int exp )
{
if( exp >= 0 )
{
double result = 1.0;
// calculate x, x^2, x^4, ... by repeated squaring
// and multiply together the ones corresponding to the
// binary digits of the exponent
// e.g. x^73 = x^(1 + 8 + 64) = x * x^8 * x^64
while( exp > 0 )
{
if( exp % 2 == 1 )
result *= base;
base *= base;
exp /= 2;
}
return result;
}
// if exp is INT_MIN, the next clause will be upset,
// because -exp isn't representable
else if( exp == INT_MIN )
return powN( base, exp + 1 ) / base;
// x < 0
else
return 1.0 / powN( base, -exp );
}
double tan( double x ) { double tan( double x ) {
return sin(x) / cos(x); return sin(x) / cos(x);
} }
@ -1223,7 +1260,6 @@ double strtod( const char *nptr, char **endptr )
if( end != s && tolower( *nptr ) == 'p' ) if( end != s && tolower( *nptr ) == 'p' )
{ {
int exp; int exp;
float res2;
// apparently (confusingly) the exponent should be // apparently (confusingly) the exponent should be
// decimal // decimal
exp = strtol( &nptr[1], (char **)&end, 10 ); exp = strtol( &nptr[1], (char **)&end, 10 );
@ -1234,28 +1270,8 @@ double strtod( const char *nptr, char **endptr )
*endptr = (char *)nptr; *endptr = (char *)nptr;
return res; return res;
} }
if( exp > 0 )
{ res *= powN( 2, exp );
while( exp-- > 0 )
{
res2 = res * 2;
// check for infinity
if( res2 <= res )
break;
res = res2;
}
}
else
{
while( exp++ < 0 )
{
res2 = res / 2;
// check for underflow
if( res2 >= res )
break;
res = res2;
}
}
} }
if( endptr ) if( endptr )
*endptr = (char *)end; *endptr = (char *)end;
@ -1289,7 +1305,6 @@ double strtod( const char *nptr, char **endptr )
if( p != end && tolower( *nptr ) == 'e' ) if( p != end && tolower( *nptr ) == 'e' )
{ {
int exp; int exp;
float res10;
exp = strtol( &nptr[1], (char **)&end, 10 ); exp = strtol( &nptr[1], (char **)&end, 10 );
if( &nptr[1] == end ) if( &nptr[1] == end )
{ {
@ -1298,30 +1313,8 @@ double strtod( const char *nptr, char **endptr )
*endptr = (char *)nptr; *endptr = (char *)nptr;
return res; return res;
} }
if( exp > 0 )
{ res *= powN( 10, exp );
while( exp-- > 0 )
{
res10 = res * 10;
// check for infinity to save us time
if( res10 <= res )
break;
res = res10;
}
}
else if( exp < 0 )
{
while( exp++ < 0 )
{
res10 = res / 10;
// check for underflow
// (test for 0 would probably be just
// as good)
if( res10 >= res )
break;
res = res10;
}
}
} }
if( endptr ) if( endptr )
*endptr = (char *)end; *endptr = (char *)end;
@ -2088,19 +2081,6 @@ static LDOUBLE abs_val (LDOUBLE value)
return result; return result;
} }
static LDOUBLE pow10 (int exp)
{
LDOUBLE result = 1;
while (exp)
{
result *= 10;
exp--;
}
return result;
}
static long round (LDOUBLE value) static long round (LDOUBLE value)
{ {
long intpart; long intpart;
@ -2163,12 +2143,12 @@ static int fmtfp (char *buffer, size_t *currlen, size_t maxlen,
/* We "cheat" by converting the fractional part to integer by /* We "cheat" by converting the fractional part to integer by
* multiplying by a factor of 10 * multiplying by a factor of 10
*/ */
fracpart = round ((pow10 (max)) * (ufvalue - intpart)); fracpart = round ((powN (10, max)) * (ufvalue - intpart));
if (fracpart >= pow10 (max)) if (fracpart >= powN (10, max))
{ {
intpart++; intpart++;
fracpart -= pow10 (max); fracpart -= powN (10, max);
} }
#ifdef DEBUG_SNPRINTF #ifdef DEBUG_SNPRINTF

View file

@ -345,7 +345,7 @@ static float PM_CmdScale( usercmd_t *cmd ) {
================ ================
PM_SetMovementDir PM_SetMovementDir
Determine the rotation of the legs reletive Determine the rotation of the legs relative
to the facing dir to the facing dir
================ ================
*/ */

View file

@ -485,7 +485,7 @@ typedef enum {
#define PLAYEREVENT_HOLYSHIT 0x0004 #define PLAYEREVENT_HOLYSHIT 0x0004
// entityState_t->event values // entityState_t->event values
// entity events are for effects that take place reletive // entity events are for effects that take place relative
// to an existing entities origin. Very network efficient. // to an existing entities origin. Very network efficient.
// two bits at the top of the entityState->event field // two bits at the top of the entityState->event field

View file

@ -1895,9 +1895,9 @@ void ClientEndFrame( gentity_t *ent ) {
// add the EF_CONNECTION flag if we haven't gotten commands recently // add the EF_CONNECTION flag if we haven't gotten commands recently
if ( level.time - ent->client->lastCmdTime > 1000 ) { if ( level.time - ent->client->lastCmdTime > 1000 ) {
ent->s.eFlags |= EF_CONNECTION; ent->client->ps.eFlags |= EF_CONNECTION;
} else { } else {
ent->s.eFlags &= ~EF_CONNECTION; ent->client->ps.eFlags &= ~EF_CONNECTION;
} }
ent->client->ps.stats[STAT_HEALTH] = ent->health; // FIXME: get rid of ent->health... ent->client->ps.stats[STAT_HEALTH] = ent->health; // FIXME: get rid of ent->health...

View file

@ -130,12 +130,12 @@ static void G_LoadArenasFromFile( char *filename ) {
len = trap_FS_FOpenFile( filename, &f, FS_READ ); len = trap_FS_FOpenFile( filename, &f, FS_READ );
if ( !f ) { if ( !f ) {
trap_Printf( va( S_COLOR_RED "file not found: %s\n", filename ) ); trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
return; return;
} }
if ( len >= MAX_ARENAS_TEXT ) { if ( len >= MAX_ARENAS_TEXT ) {
trap_Printf( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_ARENAS_TEXT ) );
trap_FS_FCloseFile( f ); trap_FS_FCloseFile( f );
trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_ARENAS_TEXT ) );
return; return;
} }
@ -182,7 +182,7 @@ static void G_LoadArenas( void ) {
strcat(filename, dirptr); strcat(filename, dirptr);
G_LoadArenasFromFile(filename); G_LoadArenasFromFile(filename);
} }
trap_Printf( va( "%i arenas parsed\n", g_numArenas ) ); trap_Print( va( "%i arenas parsed\n", g_numArenas ) );
for( n = 0; n < g_numArenas; n++ ) { for( n = 0; n < g_numArenas; n++ ) {
Info_SetValueForKey( g_arenaInfos[n], "num", va( "%i", n ) ); Info_SetValueForKey( g_arenaInfos[n], "num", va( "%i", n ) );
@ -660,7 +660,7 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay
s = Info_ValueForKey(botinfo, "aifile"); s = Info_ValueForKey(botinfo, "aifile");
if (!*s ) { if (!*s ) {
trap_Printf( S_COLOR_RED "Error: bot has no aifile specified\n" ); trap_Print( S_COLOR_RED "Error: bot has no aifile specified\n" );
return; return;
} }
@ -733,7 +733,7 @@ void Svcmd_AddBot_f( void ) {
// name // name
trap_Argv( 1, name, sizeof( name ) ); trap_Argv( 1, name, sizeof( name ) );
if ( !name[0] ) { if ( !name[0] ) {
trap_Printf( "Usage: Addbot <botname> [skill 1-5] [team] [msec delay] [altname]\n" ); trap_Print( "Usage: Addbot <botname> [skill 1-5] [team] [msec delay] [altname]\n" );
return; return;
} }
@ -783,7 +783,7 @@ void Svcmd_BotList_f( void ) {
char model[MAX_TOKEN_CHARS]; char model[MAX_TOKEN_CHARS];
char aifile[MAX_TOKEN_CHARS]; char aifile[MAX_TOKEN_CHARS];
trap_Printf("^1name model aifile funname\n"); trap_Print("^1name model aifile funname\n");
for (i = 0; i < g_numBots; i++) { for (i = 0; i < g_numBots; i++) {
strcpy(name, Info_ValueForKey( g_botInfos[i], "name" )); strcpy(name, Info_ValueForKey( g_botInfos[i], "name" ));
if ( !*name ) { if ( !*name ) {
@ -801,7 +801,7 @@ void Svcmd_BotList_f( void ) {
if (!*aifile ) { if (!*aifile ) {
strcpy(aifile, "bots/default_c.c"); strcpy(aifile, "bots/default_c.c");
} }
trap_Printf(va("%-16s %-16s %-20s %-20s\n", name, model, aifile, funname)); trap_Print(va("%-16s %-16s %-20s %-20s\n", name, model, aifile, funname));
} }
} }
@ -876,11 +876,11 @@ static void G_LoadBotsFromFile( char *filename ) {
len = trap_FS_FOpenFile( filename, &f, FS_READ ); len = trap_FS_FOpenFile( filename, &f, FS_READ );
if ( !f ) { if ( !f ) {
trap_Printf( va( S_COLOR_RED "file not found: %s\n", filename ) ); trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) );
return; return;
} }
if ( len >= MAX_BOTS_TEXT ) { if ( len >= MAX_BOTS_TEXT ) {
trap_Printf( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_BOTS_TEXT ) ); trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_BOTS_TEXT ) );
trap_FS_FCloseFile( f ); trap_FS_FCloseFile( f );
return; return;
} }
@ -929,7 +929,7 @@ static void G_LoadBots( void ) {
strcat(filename, dirptr); strcat(filename, dirptr);
G_LoadBotsFromFile(filename); G_LoadBotsFromFile(filename);
} }
trap_Printf( va( "%i bots parsed\n", g_numBots ) ); trap_Print( va( "%i bots parsed\n", g_numBots ) );
} }
@ -941,7 +941,7 @@ G_GetBotInfoByNumber
*/ */
char *G_GetBotInfoByNumber( int num ) { char *G_GetBotInfoByNumber( int num ) {
if( num < 0 || num >= g_numBots ) { if( num < 0 || num >= g_numBots ) {
trap_Printf( va( S_COLOR_RED "Invalid bot number: %i\n", num ) ); trap_Print( va( S_COLOR_RED "Invalid bot number: %i\n", num ) );
return NULL; return NULL;
} }
return g_botInfos[num]; return g_botInfos[num];

View file

@ -892,6 +892,8 @@ void ClientUserinfoChanged( int clientNum ) {
// check for malformed or illegal info strings // check for malformed or illegal info strings
if ( !Info_Validate(userinfo) ) { if ( !Info_Validate(userinfo) ) {
strcpy (userinfo, "\\name\\badinfo"); strcpy (userinfo, "\\name\\badinfo");
// don't keep those clients and userinfo
trap_DropClient(clientNum, "Invalid userinfo");
} }
// check for local client // check for local client
@ -1165,7 +1167,12 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
return "Invalid password"; return "Invalid password";
} }
} }
// if a player reconnects quickly after a disconnect, the client disconnect may never be called, thus flag can get lost in the ether
if (ent->inuse) {
G_LogPrintf("Forcing disconnect on active client: %i\n", clientNum);
// so lets just fix up anything that should happen on a disconnect
ClientDisconnect(clientNum);
}
// they can connect // they can connect
ent->client = level.clients + clientNum; ent->client = level.clients + clientNum;
client = ent->client; client = ent->client;
@ -1746,7 +1753,7 @@ void ClientDisconnect( int clientNum ) {
G_RemoveQueuedBotBegin( clientNum ); G_RemoveQueuedBotBegin( clientNum );
ent = g_entities + clientNum; ent = g_entities + clientNum;
if ( !ent->client ) { if (!ent->client || ent->client->pers.connected == CON_DISCONNECTED) {
return; return;
} }

View file

@ -23,7 +23,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// //
#include "g_local.h" #include "g_local.h"
#ifdef MISSIONPACK
#include "../../ui/menudef.h" // for the voice chats #include "../../ui/menudef.h" // for the voice chats
#endif
/* /*
================== ==================
@ -144,11 +146,11 @@ CheatsOk
*/ */
qboolean CheatsOk( gentity_t *ent ) { qboolean CheatsOk( gentity_t *ent ) {
if ( !g_cheats.integer ) { if ( !g_cheats.integer ) {
trap_SendServerCommand( ent-g_entities, va("print \"Cheats are not enabled on this server.\n\"")); trap_SendServerCommand( ent-g_entities, "print \"Cheats are not enabled on this server.\n\"");
return qfalse; return qfalse;
} }
if ( ent->health <= 0 ) { if ( ent->health <= 0 ) {
trap_SendServerCommand( ent-g_entities, va("print \"You must be alive to use this command.\n\"")); trap_SendServerCommand( ent-g_entities, "print \"You must be alive to use this command.\n\"");
return qfalse; return qfalse;
} }
return qtrue; return qtrue;
@ -942,6 +944,16 @@ void Cmd_FollowCycle_f( gentity_t *ent, int dir ) {
G_Error( "Cmd_FollowCycle_f: bad dir %i", dir ); G_Error( "Cmd_FollowCycle_f: bad dir %i", dir );
} }
// if dedicated follow client, just switch between the two auto clients
if (ent->client->sess.spectatorClient < 0) {
if (ent->client->sess.spectatorClient == -1) {
ent->client->sess.spectatorClient = -2;
} else if (ent->client->sess.spectatorClient == -2) {
ent->client->sess.spectatorClient = -1;
}
return;
}
clientnum = ent->client->sess.spectatorClient; clientnum = ent->client->sess.spectatorClient;
original = clientnum; original = clientnum;
do { do {
@ -1161,6 +1173,7 @@ static void Cmd_Tell_f( gentity_t *ent ) {
} }
#ifdef MISSIONPACK
static void G_VoiceTo( gentity_t *ent, gentity_t *other, int mode, const char *id, qboolean voiceonly ) { static void G_VoiceTo( gentity_t *ent, gentity_t *other, int mode, const char *id, qboolean voiceonly ) {
int color; int color;
char *cmd; char *cmd;
@ -1360,6 +1373,7 @@ static void Cmd_VoiceTaunt_f( gentity_t *ent ) {
// just say something // just say something
G_Voice( ent, NULL, SAY_ALL, VOICECHAT_TAUNT, qfalse ); G_Voice( ent, NULL, SAY_ALL, VOICECHAT_TAUNT, qfalse );
} }
#endif
@ -1767,11 +1781,11 @@ void Cmd_SetViewpos_f( gentity_t *ent ) {
int i; int i;
if ( !g_cheats.integer ) { if ( !g_cheats.integer ) {
trap_SendServerCommand( ent-g_entities, va("print \"Cheats are not enabled on this server.\n\"")); trap_SendServerCommand( ent-g_entities, "print \"Cheats are not enabled on this server.\n\"");
return; return;
} }
if ( trap_Argc() != 5 ) { if ( trap_Argc() != 5 ) {
trap_SendServerCommand( ent-g_entities, va("print \"usage: setviewpos x y z yaw\n\"")); trap_SendServerCommand( ent-g_entities, "print \"usage: setviewpos x y z yaw\n\"");
return; return;
} }
@ -1924,7 +1938,7 @@ void ClientCommand( int clientNum ) {
// END // END
ent = g_entities + clientNum; ent = g_entities + clientNum;
if ( !ent->client ) { if (!ent->client || ent->client->pers.connected != CON_CONNECTED) {
return; // not fully in game yet return; // not fully in game yet
} }
@ -1943,6 +1957,7 @@ void ClientCommand( int clientNum ) {
Cmd_Tell_f ( ent ); Cmd_Tell_f ( ent );
return; return;
} }
#ifdef MISSIONPACK
if (Q_stricmp (cmd, "vsay") == 0) { if (Q_stricmp (cmd, "vsay") == 0) {
Cmd_Voice_f (ent, SAY_ALL, qfalse, qfalse); Cmd_Voice_f (ent, SAY_ALL, qfalse, qfalse);
return; return;
@ -1971,6 +1986,7 @@ void ClientCommand( int clientNum ) {
Cmd_VoiceTaunt_f ( ent ); Cmd_VoiceTaunt_f ( ent );
return; return;
} }
#endif
if (Q_stricmp (cmd, "score") == 0) { if (Q_stricmp (cmd, "score") == 0) {
Cmd_Score_f (ent); Cmd_Score_f (ent);
return; return;

View file

@ -1029,8 +1029,8 @@ void G_RunItem( gentity_t *ent ) {
int contents; int contents;
int mask; int mask;
// if groundentity has been set to -1, it may have been pushed off an edge // if its groundentity has been set to none, it may have been pushed off an edge
if ( ent->s.groundEntityNum == -1 ) { if ( ent->s.groundEntityNum == ENTITYNUM_NONE ) {
if ( ent->s.pos.trType != TR_GRAVITY ) { if ( ent->s.pos.trType != TR_GRAVITY ) {
ent->s.pos.trType = TR_GRAVITY; ent->s.pos.trType = TR_GRAVITY;
ent->s.pos.trTime = level.time; ent->s.pos.trTime = level.time;

View file

@ -139,7 +139,6 @@ struct gentity_s {
int timestamp; // body queue sinking, etc int timestamp; // body queue sinking, etc
float angle; // set in editor, -1 = up, -2 = down
char *target; char *target;
char *targetname; char *targetname;
char *team; char *team;
@ -285,11 +284,6 @@ typedef struct {
float lastfraggedcarrier; float lastfraggedcarrier;
} playerTeamState_t; } playerTeamState_t;
// the auto following clients don't follow a specific client
// number, but instead follow the first two active players
#define FOLLOW_ACTIVE1 -1
#define FOLLOW_ACTIVE2 -2
// client data that stays across multiple levels or tournament restarts // client data that stays across multiple levels or tournament restarts
// this is achieved by writing all the data to cvar strings at game shutdown // this is achieved by writing all the data to cvar strings at game shutdown
// time and reading them back at connection time. Anything added here // time and reading them back at connection time. Anything added here
@ -595,7 +589,6 @@ void G_FreeEntity( gentity_t *e );
qboolean G_EntitiesFree( void ); qboolean G_EntitiesFree( void );
void G_TouchTriggers (gentity_t *ent); void G_TouchTriggers (gentity_t *ent);
void G_TouchSolids (gentity_t *ent);
float *tv (float x, float y, float z); float *tv (float x, float y, float z);
// STONELANCE - moved to q_shared // STONELANCE - moved to q_shared
@ -719,8 +712,6 @@ gentity_t *SelectSpawnPoint (vec3_t avoidPoint, vec3_t origin, vec3_t angles, qb
void CopyToBodyQue( gentity_t *ent ); void CopyToBodyQue( gentity_t *ent );
void ClientRespawn(gentity_t *ent); void ClientRespawn(gentity_t *ent);
void BeginIntermission (void); void BeginIntermission (void);
void InitClientPersistant (gclient_t *client);
void InitClientResp (gclient_t *client);
void InitBodyQue (void); void InitBodyQue (void);
void ClientSpawn( gentity_t *ent ); void ClientSpawn( gentity_t *ent );
void player_die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod); void player_die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);
@ -809,25 +800,15 @@ void CreateSmokeHazard (gentity_t *owner, vec3_t origin);
// END // END
//
// p_hud.c
//
void MoveClientToIntermission (gentity_t *client);
void G_SetStats (gentity_t *ent);
void DeathmatchScoreboardMessage (gentity_t *client);
// //
// g_cmds.c // g_cmds.c
// //
void DeathmatchScoreboardMessage( gentity_t *ent );
//
// g_pweapon.c
//
// //
// g_main.c // g_main.c
// //
void MoveClientToIntermission( gentity_t *ent );
void FindIntermissionPoint( void ); void FindIntermissionPoint( void );
void SetLeader(int team, int client); void SetLeader(int team, int client);
void CheckTeamLeader( int team ); void CheckTeamLeader( int team );
@ -1011,8 +992,8 @@ extern vmCvar_t car_air_frac_to_df;
extern vmCvar_t car_friction_scale; extern vmCvar_t car_friction_scale;
// END // END
void trap_Printf( const char *fmt ); void trap_Print( const char *text );
void trap_Error(const char *fmt) __attribute__((noreturn)); void trap_Error( const char *text ) __attribute__((noreturn));
int trap_Milliseconds( void ); int trap_Milliseconds( void );
int trap_Argc( void ); int trap_Argc( void );
void trap_Argv( int n, char *buffer, int bufferLength ); void trap_Argv( int n, char *buffer, int bufferLength );

View file

@ -354,7 +354,7 @@ void QDECL G_Printf( const char *fmt, ... ) {
Q_vsnprintf (text, sizeof(text), fmt, argptr); Q_vsnprintf (text, sizeof(text), fmt, argptr);
va_end (argptr); va_end (argptr);
trap_Printf( text ); trap_Print( text );
} }
void QDECL G_Error( const char *fmt, ... ) { void QDECL G_Error( const char *fmt, ... ) {
@ -684,7 +684,7 @@ void QDECL Com_Error ( int level, const char *error, ... ) {
Q_vsnprintf (text, sizeof(text), error, argptr); Q_vsnprintf (text, sizeof(text), error, argptr);
va_end (argptr); va_end (argptr);
G_Error( "%s", text); trap_Error( text );
} }
void QDECL Com_Printf( const char *msg, ... ) { void QDECL Com_Printf( const char *msg, ... ) {
@ -695,7 +695,7 @@ void QDECL Com_Printf( const char *msg, ... ) {
Q_vsnprintf (text, sizeof(text), msg, argptr); Q_vsnprintf (text, sizeof(text), msg, argptr);
va_end (argptr); va_end (argptr);
G_Printf ("%s", text); trap_Print( text );
} }
#endif #endif
@ -1315,7 +1315,7 @@ void ExitLevel (void) {
cl->ps.persistant[PERS_SCORE] = 0; cl->ps.persistant[PERS_SCORE] = 0;
} }
// we need to do this here before chaning to CON_CONNECTING // we need to do this here before changing to CON_CONNECTING
G_WriteSessionData(); G_WriteSessionData();
// change all client states to connecting, so the early players into the // change all client states to connecting, so the early players into the
@ -1729,10 +1729,6 @@ void CheckExitRules( void ) {
} }
// END // END
if ( level.numPlayingClients < 2 ) {
return;
}
// STONELANCE // STONELANCE
// dont check frags or captures during a race or derby // dont check frags or captures during a race or derby
if ( isRallyRace() || g_gametype.integer == GT_DERBY ){ if ( isRallyRace() || g_gametype.integer == GT_DERBY ){
@ -1913,7 +1909,12 @@ void CheckTournament( void ) {
// if all players have arrived, start the countdown // if all players have arrived, start the countdown
if ( level.warmupTime < 0 ) { if ( level.warmupTime < 0 ) {
// fudge by -1 to account for extra delays // fudge by -1 to account for extra delays
level.warmupTime = level.time + ( g_warmup.integer - 1 ) * 1000; if ( g_warmup.integer > 1 ) {
level.warmupTime = level.time + ( g_warmup.integer - 1 ) * 1000;
} else {
level.warmupTime = 0;
}
trap_SetConfigstring( CS_WARMUP, va("%i", level.warmupTime) ); trap_SetConfigstring( CS_WARMUP, va("%i", level.warmupTime) );
return; return;
} }
@ -2030,11 +2031,14 @@ void CheckTeamLeader( int team ) {
break; break;
} }
} }
for ( i = 0 ; i < level.maxclients ; i++ ) {
if (level.clients[i].sess.sessionTeam != team) if (i >= level.maxclients) {
continue; for ( i = 0 ; i < level.maxclients ; i++ ) {
level.clients[i].sess.teamLeader = qtrue; if (level.clients[i].sess.sessionTeam != team)
break; continue;
level.clients[i].sess.teamLeader = qtrue;
break;
}
} }
} }
} }

View file

@ -42,7 +42,7 @@ void *G_Alloc( int size ) {
} }
if ( allocPoint + size > POOLSIZE ) { if ( allocPoint + size > POOLSIZE ) {
G_Error( "G_Alloc: failed on allocation of %i bytes\n", size ); // bk010103 - was %u, but is signed G_Error( "G_Alloc: failed on allocation of %i bytes", size );
return NULL; return NULL;
} }

View file

@ -34,8 +34,6 @@ PUSHMOVE
=============================================================================== ===============================================================================
*/ */
void MatchTeam( gentity_t *teamLeader, int moverState, int time );
typedef struct { typedef struct {
gentity_t *ent; gentity_t *ent;
vec3_t origin; vec3_t origin;
@ -199,7 +197,7 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
// may have pushed them off an edge // may have pushed them off an edge
if ( check->s.groundEntityNum != pusher->s.number ) { if ( check->s.groundEntityNum != pusher->s.number ) {
check->s.groundEntityNum = -1; check->s.groundEntityNum = ENTITYNUM_NONE;
} }
block = G_TestEntityPosition( check ); block = G_TestEntityPosition( check );
@ -224,7 +222,7 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
VectorCopy( (pushed_p-1)->angles, check->s.apos.trBase ); VectorCopy( (pushed_p-1)->angles, check->s.apos.trBase );
block = G_TestEntityPosition (check); block = G_TestEntityPosition (check);
if ( !block ) { if ( !block ) {
check->s.groundEntityNum = -1; check->s.groundEntityNum = ENTITYNUM_NONE;
pushed_p--; pushed_p--;
return qtrue; return qtrue;
} }

View file

@ -103,6 +103,9 @@ Called on a first-time connect
void G_InitSessionData( gclient_t *client, char *userinfo ) { void G_InitSessionData( gclient_t *client, char *userinfo ) {
clientSession_t *sess; clientSession_t *sess;
const char *value; const char *value;
qboolean isBot;
isBot = (g_entities[ client - level.clients ].r.svFlags & SVF_BOT);
sess = &client->sess; sess = &client->sess;
@ -116,7 +119,7 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) {
// can only spawn as spectator after race starts // can only spawn as spectator after race starts
sess->sessionTeam = TEAM_SPECTATOR; sess->sessionTeam = TEAM_SPECTATOR;
} }
else if ( g_teamAutoJoin.integer || value[0] == 'r' ){ else if ( (g_teamAutoJoin.integer && !isBot) || value[0] == 'r' ) {
// force them to join // force them to join
sess->sessionTeam = PickTeam( -1 ); sess->sessionTeam = PickTeam( -1 );
BroadcastTeamChange( client, -1 ); BroadcastTeamChange( client, -1 );
@ -127,7 +130,7 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) {
} }
else else
// END // END
if ( g_teamAutoJoin.integer ) { if ( g_teamAutoJoin.integer && !isBot ) {
sess->sessionTeam = PickTeam( -1 ); sess->sessionTeam = PickTeam( -1 );
BroadcastTeamChange( client, -1 ); BroadcastTeamChange( client, -1 );
} else { } else {

View file

@ -239,7 +239,7 @@ void Svcmd_AddIP_f (void)
char str[MAX_TOKEN_CHARS]; char str[MAX_TOKEN_CHARS];
if ( trap_Argc() < 2 ) { if ( trap_Argc() < 2 ) {
G_Printf("Usage: addip <ip-mask>\n"); G_Printf("Usage: addip <ip-mask>\n");
return; return;
} }
@ -261,7 +261,7 @@ void Svcmd_RemoveIP_f (void)
char str[MAX_TOKEN_CHARS]; char str[MAX_TOKEN_CHARS];
if ( trap_Argc() < 2 ) { if ( trap_Argc() < 2 ) {
G_Printf("Usage: sv removeip <ip-mask>\n"); G_Printf("Usage: removeip <ip-mask>\n");
return; return;
} }
@ -412,6 +412,11 @@ void Svcmd_ForceTeam_f( void ) {
gclient_t *cl; gclient_t *cl;
char str[MAX_TOKEN_CHARS]; char str[MAX_TOKEN_CHARS];
if ( trap_Argc() < 3 ) {
G_Printf("Usage: forceteam <player> <team>\n");
return;
}
// find the player // find the player
trap_Argv( 1, str, sizeof( str ) ); trap_Argv( 1, str, sizeof( str ) );
cl = ClientForString( str ); cl = ClientForString( str );

View file

@ -1,6 +1,6 @@
code code
equ trap_Printf -1 equ trap_Print -1
equ trap_Error -2 equ trap_Error -2
equ trap_Milliseconds -3 equ trap_Milliseconds -3
equ trap_Cvar_Register -4 equ trap_Cvar_Register -4

Some files were not shown because too many files have changed in this diff Show more