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)
tweaked the Wheel mouse reading for in_mouse -1 (old win32 input code)
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>
+ ATVI Quake 3 1.32 Patch #38

View file

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

View file

@ -103,6 +103,7 @@ Makefile.local:
USE_VOIP - enable built-in VoIP support
USE_INTERNAL_SPEEX - build internal speex library instead of dynamically
linking against system libspeex
USE_FREETYPE - enable FreeType support for rendering fonts
USE_OLD_VM64 - use Ludwig Nussel's old JIT compiler implementation
for x86_64
USE_INTERNAL_ZLIB - build and link against internal zlib
@ -136,6 +137,7 @@ New cvars
for forward movement speed/direction.
j_side - Joystick analogue to m_side,
for side movement speed/direction.
j_up - Joystick up movement speed/direction.
j_pitch - Joystick analogue to m_pitch,
for pitch rotation speed/direction.
j_yaw - Joystick analogue to m_yaw,
@ -144,6 +146,8 @@ New cvars
controls forward/back.
j_side_axis - Selects which joystick axis
controls left/right.
j_up_axis - Selects which joystick axis
controls up/down.
j_pitch_axis - Selects which joystick axis
controls pitch.
j_yaw_axis - Selects which joystick axis
@ -269,6 +273,8 @@ New cvars
captured using screenshotJPEG
r_aviMotionJpegQuality - Controls quality of video capture when
cl_aviMotionJpeg is enabled
r_mode -2 - This new video mode automatically uses the
desktop resolution.
New commands
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
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 -----
@ -657,9 +673,9 @@ Building with MinGW for pre Windows XP
------------------------------------------------------------- Contributing -----
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
best case scenario is that you submit your patch to bugzilla, and then post the
URL to the mailing list.
mailing list (http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org) and
submit your patch there. The best case scenario is that you submit your patch
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
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
Copyright (C) 1997-2009 Sam Lantinga
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
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 */
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#if 0
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
@ -37,6 +40,7 @@ typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;
#endif
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public
@ -39,6 +39,10 @@
/*@}*/
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#else /* __linux __ */
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \
@ -48,6 +52,7 @@
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif
#endif /* __linux __ */
#endif /* !SDL_BYTEORDER */
@ -81,12 +86,12 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x)
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
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));
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)
{
__asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
@ -94,7 +99,7 @@ static __inline__ Uint16 SDL_Swap16(Uint16 x)
}
#else
static __inline__ Uint16 SDL_Swap16(Uint16 x) {
return((x<<8)|(x>>8));
return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
}
#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));
return result;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
__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
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
@ -166,7 +171,7 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x)
x = SDL_Swap32(lo);
x <<= 32;
x |= SDL_Swap32(hi);
return(x);
return (x);
}
#endif
#else

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
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
/* GL types for handling large vertex buffer objects */
#ifdef __APPLE__
typedef long GLintptr;
typedef long GLsizeiptr;
#else
typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr;
#endif
#endif
#ifndef GL_ARB_vertex_buffer_object
/* GL types for handling large vertex buffer objects */
#ifdef __APPLE__
typedef long GLintptrARB;
typedef long GLsizeiptrARB;
#else
typedef ptrdiff_t GLintptrARB;
typedef ptrdiff_t GLsizeiptrARB;
#endif
#endif
#ifndef GL_ARB_shader_objects
/* GL types for handling shader object handles and program/shader text */
typedef char GLcharARB; /* native character */
#if defined(__APPLE__)
typedef void *GLhandleARB; /* shader object handle */
#else
typedef unsigned int GLhandleARB; /* shader object handle */
#endif
#endif
/* GL types for "half" precision (s10e5) float data in host memory */
#ifndef GL_ARB_half_float_pixel

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
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.
* 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
* the version member of the 'info' structure is invalid, it returns 0.
* returns 0 if the function is not implemented, 1 if the function is
* 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:
* @code
* SDL_SysWMInfo info;
* SDL_SysWMinfo info;
* SDL_VERSION(&info.version);
* if ( SDL_GetWMInfo(&info) ) { ... }
* @endcode

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public
@ -68,11 +68,6 @@ typedef struct SDL_Thread SDL_Thread;
#ifdef __OS2__
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
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
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg,

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public
@ -41,7 +41,7 @@ extern "C" {
/*@{*/
#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL 14
#define SDL_PATCHLEVEL 15
/*@}*/
typedef struct SDL_version {

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Lesser General Public

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Library General Public
@ -43,7 +43,7 @@
#ifndef DECLSPEC
# if defined(__BEOS__) || defined(__HAIKU__)
# if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport)
# define DECLSPEC
# else
# define DECLSPEC __declspec(export)
# endif
@ -132,7 +132,12 @@
#ifdef __BORLANDC__
#pragma nopackwarning
#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)
#endif
#elif (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=mac68k4byte
#pragma enumsalwaysint on

View file

@ -1,6 +1,6 @@
/*
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
modify it under the terms of the GNU Library General Public

View file

@ -23,26 +23,8 @@
;
; assumes __fastcall calling convention
DoSyscall PROTO
.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
; prototype:
; 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, "{"))
{
ScriptError(script, "invalid %s\n", token.string);
ScriptError(script, "invalid %s", token.string);
AAS_FreeBSPEntities();
FreeScript(script);
return;
@ -413,7 +413,7 @@ void AAS_ParseBSPEntities(void)
ent->epairs = epair;
if (token.type != TT_STRING)
{
ScriptError(script, "invalid %s\n", token.string);
ScriptError(script, "invalid %s", token.string);
AAS_FreeBSPEntities();
FreeScript(script);
return;
@ -433,7 +433,7 @@ void AAS_ParseBSPEntities(void)
} //end while
if (strcmp(token.string, "}"))
{
ScriptError(script, "missing }\n");
ScriptError(script, "missing }");
AAS_FreeBSPEntities();
FreeScript(script);
return;
@ -469,7 +469,7 @@ void AAS_DumpBSPData(void)
Com_Memset( &bspworld, 0, sizeof(bspworld) );
} //end of the function AAS_DumpBSPData
//===========================================================================
// load an bsp file
// load a .bsp file
//
// Parameter: -
// Returns: -

View file

@ -130,7 +130,7 @@ int AAS_UpdatePortal(int areanum, int clusternum)
//
if (portalnum == aasworld.numportals)
{
AAS_Error("no portal of area %d", areanum);
AAS_Error("no portal of area %d\n", areanum);
return qtrue;
} //end if
//
@ -157,7 +157,7 @@ int AAS_UpdatePortal(int areanum, int clusternum)
} //end else
if (aasworld.portalindexsize >= AAS_MAX_PORTALINDEXSIZE)
{
AAS_Error("AAS_MAX_PORTALINDEXSIZE");
AAS_Error("AAS_MAX_PORTALINDEXSIZE\n");
return qtrue;
} //end if
//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)
{
AAS_Error("AAS_FloodClusterAreas_r: areanum out of range");
AAS_Error("AAS_FloodClusterAreas_r: areanum out of range\n");
return qfalse;
} //end if
//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
//
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);
return qfalse;
} //end if
@ -410,7 +410,7 @@ int AAS_FindClusters(void)
continue;
if (aasworld.numclusters >= AAS_MAX_CLUSTERS)
{
AAS_Error("AAS_MAX_CLUSTERS");
AAS_Error("AAS_MAX_CLUSTERS\n");
return qfalse;
} //end if
cluster = &aasworld.clusters[aasworld.numclusters];
@ -449,7 +449,7 @@ void AAS_CreatePortals(void)
{
if (aasworld.numportals >= AAS_MAX_PORTALS)
{
AAS_Error("AAS_MAX_PORTALS");
AAS_Error("AAS_MAX_PORTALS\n");
return;
} //end if
portal = &aasworld.portals[aasworld.numportals];
@ -776,7 +776,7 @@ int AAS_GetAdjacentAreasWithLessPresenceTypes_r(int *areanums, int numareas, int
{
if (numareas >= MAX_PORTALAREAS)
{
AAS_Error("MAX_PORTALAREAS");
AAS_Error("MAX_PORTALAREAS\n");
return numareas;
} //end if
numareas = AAS_GetAdjacentAreasWithLessPresenceTypes_r(areanums, numareas, otherareanum);

View file

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

View file

@ -423,7 +423,7 @@ void AAS_Shutdown(void)
//aas has not been initialized
aasworld.initialized = qfalse;
//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
botimport.Print(PRT_MESSAGE, "AAS shutdown.\n");
} //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
{
//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
#if 0
if (AAS_PointAreaNum(start))
@ -490,7 +490,7 @@ aas_lreachability_t *AAS_AllocReachability(void)
if (!nextreachability) return NULL;
//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;
nextreachability = nextreachability->next;
@ -523,7 +523,7 @@ int AAS_AreaReachability(int areanum)
{
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;
} //end if
return aasworld.areasettings[areanum].numreachableareas;
@ -848,7 +848,7 @@ int AAS_Reachability_Swim(int area1num, int area2num)
area1 = &aasworld.areas[area1num];
area2 = &aasworld.areas[area2num];
//if the areas are not near anough
//if the areas are not near enough
for (i = 0; i < 3; i++)
{
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];
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++)
{
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];
//if the first area contains a liquid
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++)
{
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
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++)
{
if (area1->mins[i] > area2->maxs[i] + maxjumpdistance) return qfalse;

View file

@ -106,7 +106,7 @@ void AAS_RoutingInfo(void)
// Returns: -
// Changes Globals: -
//===========================================================================
ID_INLINE int AAS_ClusterAreaNum(int cluster, int areanum)
static ID_INLINE int AAS_ClusterAreaNum(int cluster, int areanum)
{
int side, areacluster;
@ -166,7 +166,7 @@ void AAS_InitTravelFlagFromType(void)
// Returns: -
// Changes Globals: -
//===========================================================================
ID_INLINE int AAS_TravelFlagForType_inline(int traveltype)
static ID_INLINE int AAS_TravelFlagForType_inline(int traveltype)
{
int tfl;
@ -339,7 +339,7 @@ int AAS_EnableRoutingArea(int areanum, int enable)
// Returns: -
// Changes Globals: -
//===========================================================================
ID_INLINE float AAS_RoutingTime(void)
static ID_INLINE float AAS_RoutingTime(void)
{
return AAS_Time();
} //end of the function AAS_RoutingTime
@ -379,7 +379,7 @@ int AAS_GetAreaContentsTravelFlags(int areanum)
// Returns: -
// Changes Globals: -
//===========================================================================
ID_INLINE int AAS_AreaContentsTravelFlags_inline(int areanum)
static ID_INLINE int AAS_AreaContentsTravelFlags_inline(int areanum)
{
return aasworld.areacontentstravelflags[areanum];
} //end of the function AAS_AreaContentsTravelFlags
@ -1074,7 +1074,7 @@ int AAS_ReadRouteCache(void)
} //end if
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;
} //end if
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 (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);
BotFreeCharacterStrings(ch);
FreeMemory(ch);
@ -265,7 +265,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
index = token.intvalue;
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);
BotFreeCharacterStrings(ch);
FreeMemory(ch);
@ -273,7 +273,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
} //end if
if (ch->c[index].type)
{
SourceError(source, "characteristic %d already initialized\n", index);
SourceError(source, "characteristic %d already initialized", index);
FreeSource(source);
BotFreeCharacterStrings(ch);
FreeMemory(ch);
@ -308,7 +308,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
} //end else if
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);
BotFreeCharacterStrings(ch);
FreeMemory(ch);
@ -336,7 +336,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
} //end if
else
{
SourceError(source, "unknown definition %s\n", token.string);
SourceError(source, "unknown definition %s", token.string);
FreeSource(source);
BotFreeCharacterStrings(ch);
FreeMemory(ch);
@ -713,7 +713,7 @@ int Characteristic_Integer(int character, int index)
} //end else if
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;
} //end else if
// return 0;

View file

@ -739,7 +739,7 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename)
} //end while
if (numsynonyms < 2)
{
SourceError(source, "synonym must have at least two entries\n");
SourceError(source, "synonym must have at least two entries");
FreeSource(source);
return NULL;
} //end if
@ -891,7 +891,7 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring)
StripDoubleQuotes(token.string);
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;
} //end if
strcat(ptr, token.string);
@ -901,7 +901,7 @@ int BotLoadChatMessage(source_t *source, char *chatmessagestring)
{
if (strlen(ptr) + 7 > MAX_MESSAGE_SIZE)
{
SourceError(source, "chat message too long\n");
SourceError(source, "chat message too long");
return qfalse;
} //end if
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)
{
SourceError(source, "chat message too long\n");
SourceError(source, "chat message too long");
return qfalse;
} //end if
sprintf(&ptr[strlen(ptr)], "%cr%s%c", ESCAPE_CHAR, token.string, ESCAPE_CHAR);
} //end else if
else
{
SourceError(source, "unknown message component %s\n", token.string);
SourceError(source, "unknown message component %s", token.string);
return qfalse;
} //end else
if (PC_CheckTokenString(source, ";")) break;
@ -1175,14 +1175,14 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken)
{
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);
BotFreeMatchPieces(firstpiece);
return NULL;
} //end if
if (lastwasvariable)
{
SourceError(source, "not allowed to have adjacent variables\n");
SourceError(source, "not allowed to have adjacent variables");
FreeSource(source);
BotFreeMatchPieces(firstpiece);
return NULL;
@ -1238,7 +1238,7 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken)
} //end if
else
{
SourceError(source, "invalid token %s\n", token.string);
SourceError(source, "invalid token %s", token.string);
FreeSource(source);
BotFreeMatchPieces(firstpiece);
return NULL;
@ -1298,7 +1298,7 @@ bot_matchtemplate_t *BotLoadMatchTemplates(char *matchfile)
{
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);
FreeSource(source);
return NULL;
@ -2080,7 +2080,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
return NULL;
} //end if
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, "{"))
{
FreeSource(source);
@ -2101,7 +2101,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
if (!strcmp(token.string, "}")) break;
if (strcmp(token.string, "type"))
{
SourceError(source, "expected type found %s\n", token.string);
SourceError(source, "expected type found %s", token.string);
FreeSource(source);
return NULL;
} //end if
@ -2172,7 +2172,7 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
} //end if
else
{
SourceError(source, "unknown definition %s\n", token.string);
SourceError(source, "unknown definition %s", token.string);
FreeSource(source);
return NULL;
} //end else

View file

@ -300,7 +300,7 @@ itemconfig_t *LoadItemConfig(char *filename)
{
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);
FreeSource(source);
return NULL;
@ -326,7 +326,7 @@ itemconfig_t *LoadItemConfig(char *filename)
} //end if
else
{
SourceError(source, "unknown definition %s\n", token.string);
SourceError(source, "unknown definition %s", token.string);
FreeMemory(ic);
FreeSource(source);
return NULL;
@ -1018,7 +1018,7 @@ void BotUpdateEntityItems(void)
for (li = levelitems; li; li = nextli)
{
nextli = li->next;
//if it is a item that will time out
//if it is an item that will time out
if (li->timeout)
{
//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 lastgoalareanum, int lastareanum,
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)
{
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))
{
travelflags |= TFL_DONOTENTER;
movetravelflags |= TFL_DONOTENTER;
} //end if
//use the routing to find the next area to go to
besttime = 0;
@ -764,7 +763,7 @@ int BotGetReachabilityToGoal(vec3_t origin, int areanum,
reachnum = AAS_NextAreaReachability(areanum, reachnum))
{
#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++)
{
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 (AAS_AreaContentsTravelFlags(reach.areanum) & ~travelflags) continue;
//if the travel isn't valid
if (!BotValidTravel(origin, &reach, movetravelflags)) continue;
if (!BotValidTravel(origin, &reach, travelflags)) continue;
//get the travel time
t = AAS_AreaTravelTimeToGoalArea(reach.areanum, reach.end, goal->areanum, travelflags);
//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,
ms->lastgoalareanum, lastareanum,
ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries,
goal, travelflags, travelflags, NULL, 0, NULL);
goal, travelflags, NULL, 0, NULL);
VectorCopy(reach.end, end);
lastareanum = reach.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,
lastgoalareanum, lastareanum,
avoidreach, avoidreachtimes, avoidreachtries,
goal, travelflags, travelflags, NULL, 0, NULL);
goal, travelflags, NULL, 0, NULL);
if (!reachnum) return qfalse;
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");
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);
hordir[2] = 0;
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,
ms->lastgoalareanum, ms->lastareanum,
ms->avoidreach, ms->avoidreachtimes, ms->avoidreachtries,
goal, travelflags, travelflags,
goal, travelflags,
ms->avoidspots, ms->numavoidspots, &resultflags);
//the area number the reachability starts in
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],
ms->lastgoalareanum, ms->lastareanum,
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)
{
ms->lastreachnum = lastreachnum;
@ -3389,7 +3388,6 @@ void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, in
ms->lastreachnum = lastreachnum;
ms->lastareanum = areas[i];
//botimport.Print(PRT_MESSAGE, "found jumppad reachability hard!!\n");
break;
} //end if
} //end for
if (lastreachnum) break;

View file

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

View file

@ -269,7 +269,7 @@ token_t *PC_CopyToken(token_t *token)
if (!t)
{
#ifdef BSPC
Error("out of token space\n");
Error("out of token space");
#else
Com_Error(ERR_FATAL, "out of token space");
#endif
@ -1666,7 +1666,7 @@ int PC_OperatorPriority(int op)
#define MAX_OPERATORS 64
#define AllocValue(val) \
if (numvalues >= MAX_VALUES) { \
SourceError(source, "out of value space\n"); \
SourceError(source, "out of value space"); \
error = 1; \
break; \
} \
@ -1676,7 +1676,7 @@ int PC_OperatorPriority(int op)
//
#define AllocOperator(op) \
if (numoperators >= MAX_OPERATORS) { \
SourceError(source, "out of operator space\n"); \
SourceError(source, "out of operator space"); \
error = 1; \
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_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;
break;
} //end if
@ -2005,7 +2005,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
v1->floatvalue *= v2->floatvalue; break;
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;
break;
}
@ -2013,7 +2013,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
v1->floatvalue /= v2->floatvalue; break;
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;
break;
}
@ -2750,7 +2750,7 @@ int PC_ReadToken(source_t *source, token_t *token)
token->string[strlen(token->string)-1] = '\0';
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;
}
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);
//returns true when the token is available
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);
//skip tokens until the given token string is read
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;
} //end if
//if an literal
//if a literal
else if (*script->script_p == '\'')
{
//if (!PS_ReadLiteral(script, token)) return 0;
@ -1158,7 +1158,7 @@ float ReadSignedFloat(script_t *script)
{
if(!PS_ExpectAnyToken(script, &token))
{
ScriptError(script, "Missing float value\n");
ScriptError(script, "Missing float value");
return 0;
}
@ -1167,7 +1167,7 @@ float ReadSignedFloat(script_t *script)
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;
}
@ -1189,7 +1189,7 @@ signed long int ReadSignedInt(script_t *script)
{
if(!PS_ExpectAnyToken(script, &token))
{
ScriptError(script, "Missing integer value\n");
ScriptError(script, "Missing integer value");
return 0;
}
@ -1198,7 +1198,7 @@ signed long int ReadSignedInt(script_t *script)
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;
}

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);
//returns true when the token is available
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);
//skip tokens until the given token string is read
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
#include "cg_local.h"
#include "../ui/ui_shared.h"
#ifdef MISSIONPACK
#include "../ui/ui_shared.h"
extern menuDef_t *menuScoreboard;
#endif
@ -211,6 +211,7 @@ static void CG_TellAttacker_f( void ) {
trap_SendClientCommand( command );
}
#ifdef MISSIONPACK
static void CG_VoiceTellTarget_f( void ) {
int clientNum;
char command[128];
@ -241,7 +242,6 @@ static void CG_VoiceTellAttacker_f( void ) {
trap_SendClientCommand( command );
}
#ifdef MISSIONPACK
static void CG_NextTeamMember_f( void ) {
CG_SelectNextPlayer();
}
@ -613,12 +613,12 @@ static consoleCommand_t commands[] = {
{ "weapnext", CG_NextWeapon_f },
{ "weapprev", CG_PrevWeapon_f },
{ "weapon", CG_Weapon_f },
{ "tcmd", CG_TargetCommand_f },
{ "tell_target", CG_TellTarget_f },
{ "tell_attacker", CG_TellAttacker_f },
#ifdef MISSIONPACK
{ "vtell_target", CG_VoiceTellTarget_f },
{ "vtell_attacker", CG_VoiceTellAttacker_f },
{ "tcmd", CG_TargetCommand_f },
#ifdef MISSIONPACK
{ "loadhud", CG_LoadHud_f },
{ "nextTeamMember", CG_NextTeamMember_f },
{ "prevTeamMember", CG_PrevTeamMember_f },
@ -709,6 +709,7 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("say");
trap_AddCommand ("say_team");
trap_AddCommand ("tell");
#ifdef MISSIONPACK
trap_AddCommand ("vsay");
trap_AddCommand ("vsay_team");
trap_AddCommand ("vtell");
@ -716,12 +717,16 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("vosay");
trap_AddCommand ("vosay_team");
trap_AddCommand ("votell");
#endif
trap_AddCommand ("give");
trap_AddCommand ("god");
trap_AddCommand ("notarget");
trap_AddCommand ("noclip");
trap_AddCommand ("where");
trap_AddCommand ("team");
trap_AddCommand ("follow");
trap_AddCommand ("follownext");
trap_AddCommand ("followprev");
trap_AddCommand ("levelshot");
trap_AddCommand ("addbot");
trap_AddCommand ("setviewpos");

View file

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

View file

@ -849,20 +849,21 @@ CG_AdjustPositionForMover
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;
vec3_t oldOrigin, origin, deltaOrigin;
vec3_t oldAngles, angles;
//vec3_t deltaAngles;
vec3_t oldAngles, angles, deltaAngles;
if ( moverNum <= 0 || moverNum >= ENTITYNUM_MAX_NORMAL ) {
VectorCopy( in, out );
VectorCopy(angles_in, angles_out);
return;
}
cent = &cg_entities[ moverNum ];
if ( cent->currentState.eType != ET_MOVER ) {
VectorCopy( in, out );
VectorCopy(angles_in, angles_out);
return;
}
@ -873,10 +874,10 @@ void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int
BG_EvaluateTrajectory( &cent->currentState.apos, toTime, angles );
VectorSubtract( origin, oldOrigin, deltaOrigin );
//VectorSubtract( angles, oldAngles, deltaAngles );
VectorSubtract( angles, oldAngles, deltaAngles );
VectorAdd( in, deltaOrigin, out );
VectorAdd( angles_in, deltaAngles, angles_out );
// FIXME: origin change when on a rotating object
}
@ -969,7 +970,7 @@ static void CG_CalcEntityLerpPositions( centity_t *cent ) {
// player state
if ( cent != &cg.predictedPlayerEntity ) {
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 ) {
default:
CG_Error( "Bad entity type: %i\n", cent->currentState.eType );
CG_Error( "Bad entity type: %i", cent->currentState.eType );
break;
// Q3Rally Code Start
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]) {
}
else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
#ifdef MISSIONPACK
@ -1276,6 +1276,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
}
break;
#ifdef MISSIONPACK
case GTS_REDOBELISK_ATTACKED: // Overload: red obelisk is being attacked
if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
@ -1286,6 +1287,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
}
break;
#endif
case GTS_REDTEAM_SCORED:
CG_AddBufferedSound(cgs.media.redScoredSound);

View file

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

View file

@ -195,8 +195,10 @@ vmCvar_t cg_drawTeamOverlay;
vmCvar_t cg_teamOverlayUserinfo;
vmCvar_t cg_drawFriend;
vmCvar_t cg_teamChatsOnly;
#ifdef MISSIONPACK
vmCvar_t cg_noVoiceChats;
vmCvar_t cg_noVoiceText;
#endif
vmCvar_t cg_hudFiles;
vmCvar_t cg_scorePlum;
vmCvar_t cg_smoothClients;
@ -382,8 +384,10 @@ static cvarTable_t cvarTable[] = {
{ &cg_stats, "cg_stats", "0", 0 },
{ &cg_drawFriend, "cg_drawFriend", "1", CVAR_ARCHIVE },
{ &cg_teamChatsOnly, "cg_teamChatsOnly", "0", CVAR_ARCHIVE },
#ifdef MISSIONPACK
{ &cg_noVoiceChats, "cg_noVoiceChats", "0", CVAR_ARCHIVE },
{ &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE },
#endif
// the following variables are created in other parts of the system,
// but we also reference them here
{ &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);
va_end (argptr);
CG_Error( "%s", text);
trap_Error( text );
}
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);
va_end (argptr);
CG_Printf ("%s", text);
trap_Print( text );
}
#endif
@ -752,9 +756,6 @@ static void CG_RegisterSounds( void ) {
#else
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.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
}
@ -1273,10 +1274,9 @@ static void CG_RegisterGraphics( void ) {
cgs.media.invulnerabilityJuicedModel = trap_R_RegisterModel( "models/powerups/shield/juicer.md3" );
cgs.media.medkitUsageModel = trap_R_RegisterModel( "models/powerups/regen.md3" );
cgs.media.heartShader = trap_R_RegisterShaderNoMip( "ui/assets/statusbar/selectedhealth.tga" );
cgs.media.invulnerabilityPowerupModel = trap_R_RegisterModel( "models/powerups/shield/shield.md3" );
#endif
cgs.media.invulnerabilityPowerupModel = trap_R_RegisterModel( "models/powerups/shield/shield.md3" );
cgs.media.medalImpressive = trap_R_RegisterShaderNoMip( "medal_impressive" );
cgs.media.medalExcellent = trap_R_RegisterShaderNoMip( "medal_excellent" );
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 );
len = trap_FS_FOpenFile( "ui/hud.txt", &f, FS_READ );
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 ) {
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 );
CG_Error( S_COLOR_RED "menu file too large: %s is %i, max allowed is %i", menuFile, len, MAX_MENUDEFFILE );
return;
}

View file

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

View file

@ -2130,7 +2130,7 @@ static void CG_PlayerFlag( centity_t *cent, qhandle_t hSkin, refEntity_t *torso
dir[2] += 100;
VectorNormalize( 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) {
//
d = DotProduct(pole.axis[0], dir);
@ -4035,7 +4035,7 @@ void CG_ResetPlayerEntity( centity_t *cent ) {
cent->pe.legs.pitchAngle = 0;
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.yawing = qfalse;
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]) {
#ifdef MISSIONPACK
if (ops->persistant[PERS_GAUNTLET_FRAG_COUNT] == 1) {
if (ps->persistant[PERS_GAUNTLET_FRAG_COUNT] == 1) {
sfx = cgs.media.firstHumiliationSound;
} else {
sfx = cgs.media.humiliationSound;

View file

@ -1028,9 +1028,9 @@ void CG_PredictPlayerState( void ) {
}
cg.thisFrameTeleport = qfalse;
} else {
vec3_t adjusted;
vec3_t adjusted, new_angles;
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
/*
@ -1128,7 +1128,7 @@ void CG_PredictPlayerState( void ) {
// adjust for the movement of the groundentity
CG_AdjustPositionForMover( cg.predictedPlayerState.origin,
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.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
#include "cg_local.h"
#ifdef MISSIONPACK
#include "../../ui/menudef.h"
typedef struct {
@ -47,7 +48,6 @@ static const orderTask_t validOrders[] = {
static const int numValidOrders = ARRAY_LEN(validOrders);
#ifdef MISSIONPACK
static int CG_ValidOrder(const char *p) {
int i;
for (i = 0; i < numValidOrders; i++) {
@ -515,7 +515,8 @@ static void CG_MapRestart( void ) {
cg.fraglimitWarnings = 0;
cg.timelimitWarnings = 0;
cg.rewardTime = 0;
cg.rewardStack = 0;
cg.intermissionStarted = qfalse;
cg.levelShot = qfalse;
@ -566,6 +567,8 @@ static void CG_MapRestart( void ) {
// END
}
#ifdef MISSIONPACK
#define MAX_VOICEFILESIZE 16384
#define MAX_VOICEFILES 8
#define MAX_VOICECHATS 64
@ -1025,7 +1028,6 @@ CG_VoiceChat
=================
*/
void CG_VoiceChat( int mode ) {
#ifdef MISSIONPACK
const char *cmd;
int clientNum, color;
qboolean voiceOnly;
@ -1044,8 +1046,8 @@ void CG_VoiceChat( int mode ) {
}
CG_VoiceChatLocal( mode, voiceOnly, clientNum, color, cmd );
#endif
}
#endif
/*
=================
@ -1178,6 +1180,8 @@ static void CG_ServerCommand( void ) {
CG_Printf( "%s\n", text );
return;
}
#ifdef MISSIONPACK
if ( !strcmp( cmd, "vchat" ) ) {
CG_VoiceChat( SAY_ALL );
return;
@ -1192,6 +1196,7 @@ static void CG_ServerCommand( void ) {
CG_VoiceChat( SAY_TELL );
return;
}
#endif
if ( !strcmp( cmd, "scores" ) ) {
CG_ParseScores();

View file

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

View file

@ -873,7 +873,7 @@ void CG_RegisterItemVisuals( int itemNum ) {
item = &bg_itemlist[ itemNum ];
memset( itemInfo, 0, sizeof( &itemInfo ) );
memset( itemInfo, 0, sizeof( *itemInfo ) );
itemInfo->registered = qtrue;
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->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_forward;
cvar_t *j_side;
cvar_t *j_up;
cvar_t *j_pitch_axis;
cvar_t *j_yaw_axis;
cvar_t *j_forward_axis;
cvar_t *j_side_axis;
cvar_t *j_up_axis;
cvar_t *cl_activeAction;
@ -3202,7 +3204,7 @@ void CL_InitRef( void ) {
Cvar_ForceReset("cl_renderer");
Com_sprintf(dllName, sizeof(dllName), "renderer_opengl1_" ARCH_STRING DLL_EXT);
rendererLib = Sys_LoadLibrary(dllName);
rendererLib = Sys_LoadDll(dllName, qfalse);
}
if(!rendererLib)
@ -3524,10 +3526,19 @@ void CL_Init( void ) {
j_yaw = Cvar_Get ("j_yaw", "-0.022", CVAR_ARCHIVE);
j_forward = Cvar_Get ("j_forward", "-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_yaw_axis = Cvar_Get ("j_yaw_axis", "4", 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_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 );
@ -3943,7 +3954,7 @@ int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen )
// if this server status request has the same 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) {
Q_strncpyz(serverStatusString, serverStatus->string, maxLen);
serverStatus->retrieved = qtrue;

View file

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

View file

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

View file

@ -219,11 +219,11 @@ qboolean S_LoadSound( sfx_t *sfx )
return qfalse;
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 ) {
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);

View file

@ -491,7 +491,7 @@ sfxHandle_t S_AL_RegisterSound( const char *sample, qboolean compressed )
=================
S_AL_BufferGet
Return's an sfx's buffer
Return's a sfx's buffer
=================
*/
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_StopLoopingSound(int entityNum );
// recompute the reletive volumes for all running sounds
// reletive to the given entityNum / orientation
// recompute the relative volumes for all running sounds
// relative to the given entityNum / orientation
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

View file

@ -496,7 +496,9 @@ int BotChat_StartLevel(bot_state_t *bs) {
if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;
//don't chat in teamplay
if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt");
#endif
return qfalse;
}
// don't chat in tournament mode
@ -531,9 +533,11 @@ int BotChat_EndLevel(bot_state_t *bs) {
// teamplay
if (TeamPlayIsOn())
{
#ifdef MISSIONPACK
if (BotIsFirstInRankings(bs)) {
trap_EA_Command(bs->client, "vtaunt");
}
#endif
return qtrue;
}
// don't chat in tournament mode
@ -614,7 +618,9 @@ int BotChat_Death(bot_state_t *bs) {
{
//teamplay
if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt");
#endif
return qtrue;
}
//
@ -718,7 +724,9 @@ int BotChat_Kill(bot_state_t *bs) {
{
//don't chat in teamplay
if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt");
#endif
return qfalse; // don't wait
}
//
@ -951,7 +959,9 @@ int BotChat_Random(bot_state_t *bs) {
EasyClientName(bs->lastkilledplayer, name, sizeof(name));
}
if (TeamPlayIsOn()) {
#ifdef MISSIONPACK
trap_EA_Command(bs->client, "vtaunt");
#endif
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)
&& !(bs->flags & BFL_IDEALVIEWSET) ) {
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) {
BotAimAtEnemy(bs);
}
@ -2835,7 +2835,7 @@ int AINode_Battle_NBG(bot_state_t *bs) {
else if (!(moveresult.flags & MOVERESULT_MOVEMENTVIEWSET)
&& !(bs->flags & BFL_IDEALVIEWSET)) {
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) {
//&& BotEntityVisible(bs->entitynum, bs->eye, bs->viewangles, 360, bs->enemy)
BotAimAtEnemy(bs);

View file

@ -713,7 +713,7 @@ void BotCTFSeekGoals(bot_state_t *bs) {
//if the bot is roaming
if (bs->ctfroam_time > FloatTime())
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)
return;
//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 (bs->ctfroam_time > FloatTime())
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)
return;
//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 (bs->ctfroam_time > FloatTime())
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)
return;
//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 (bs->ctfroam_time > FloatTime())
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)
return;
//set the time to send a message to the team mates
@ -2322,7 +2322,6 @@ int BotWantsToRetreat(bot_state_t *bs) {
#endif
//
if (bs->enemy >= 0) {
//if the enemy is carrying a flag
BotEntityInfo(bs->enemy, &entinfo);
// if the enemy is carrying a flag
if (EntityCarriesFlag(&entinfo)) return qfalse;
@ -2537,7 +2536,7 @@ int BotWantsToCamp(bot_state_t *bs) {
bs->camp_time = FloatTime();
return qfalse;
}
//if the bot isn't healthy anough
//if the bot isn't healthy enough
if (BotAggression(bs) < 50) return qfalse;
//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]) &&
@ -2629,7 +2628,7 @@ void BotRoamGoal(bot_state_t *bs, vec3_t goal) {
//direction and length towards the roam target
VectorSubtract(trace.endpos, bs->origin, dir);
len = VectorNormalize(dir);
//if the roam target is far away anough
//if the roam target is far away enough
if (len > 200) {
//the roam target is in the given direction before walls
VectorScale(dir, len * trace.fraction - 40, dir);
@ -3461,7 +3460,7 @@ void BotAimAtEnemy(bot_state_t *bs) {
VectorSubtract(entinfo.origin, bs->enemyorigin, dir);
//if the enemy is NOT pretty far away and strafing just small steps left and right
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 the weapon is ready to fire
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 (fabs(trace.endpos[2] - groundtarget[2]) < 50) {
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)) {
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)) {
//check if the bot is visible from the ground target
trace.endpos[2] += 1;
@ -3546,7 +3545,7 @@ void BotAimAtEnemy(bot_state_t *bs) {
//
VectorCopy(bs->lastenemyorigin, bestorigin);
bestorigin[2] += 8;
//if the bot is skilled anough
//if the bot is skilled enough
if (aim_skill > 0.5) {
//do prediction shots around corners
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);
//returns the name of the client
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);
//returns the skin used by the client
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];
bot_goal_t *goal = NULL;
// STONELANCE
if (gametype == GT_CTF /*|| gametype == GT_1FCTF*/) {
// END
#ifdef MISSIONPACK
if (gametype == GT_CTF || gametype == GT_1FCTF)
#else
if (gametype == GT_CTF)
#endif
{
if (BotTeam(bs) == TEAM_RED)
goal = &ctf_redflag;
else

View file

@ -777,6 +777,43 @@ double atan2( double y, double x ) {
#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 ) {
return sin(x) / cos(x);
}
@ -1223,7 +1260,6 @@ double strtod( const char *nptr, char **endptr )
if( end != s && tolower( *nptr ) == 'p' )
{
int exp;
float res2;
// apparently (confusingly) the exponent should be
// decimal
exp = strtol( &nptr[1], (char **)&end, 10 );
@ -1234,28 +1270,8 @@ double strtod( const char *nptr, char **endptr )
*endptr = (char *)nptr;
return res;
}
if( exp > 0 )
{
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;
}
}
res *= powN( 2, exp );
}
if( endptr )
*endptr = (char *)end;
@ -1289,7 +1305,6 @@ double strtod( const char *nptr, char **endptr )
if( p != end && tolower( *nptr ) == 'e' )
{
int exp;
float res10;
exp = strtol( &nptr[1], (char **)&end, 10 );
if( &nptr[1] == end )
{
@ -1298,30 +1313,8 @@ double strtod( const char *nptr, char **endptr )
*endptr = (char *)nptr;
return res;
}
if( exp > 0 )
{
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;
}
}
res *= powN( 10, exp );
}
if( endptr )
*endptr = (char *)end;
@ -2088,19 +2081,6 @@ static LDOUBLE abs_val (LDOUBLE value)
return result;
}
static LDOUBLE pow10 (int exp)
{
LDOUBLE result = 1;
while (exp)
{
result *= 10;
exp--;
}
return result;
}
static long round (LDOUBLE value)
{
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
* 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++;
fracpart -= pow10 (max);
fracpart -= powN (10, max);
}
#ifdef DEBUG_SNPRINTF

View file

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

View file

@ -485,7 +485,7 @@ typedef enum {
#define PLAYEREVENT_HOLYSHIT 0x0004
// 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.
// 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
if ( level.time - ent->client->lastCmdTime > 1000 ) {
ent->s.eFlags |= EF_CONNECTION;
ent->client->ps.eFlags |= EF_CONNECTION;
} 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...

View file

@ -130,12 +130,12 @@ static void G_LoadArenasFromFile( char *filename ) {
len = trap_FS_FOpenFile( filename, &f, FS_READ );
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;
}
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_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_ARENAS_TEXT ) );
return;
}
@ -182,7 +182,7 @@ static void G_LoadArenas( void ) {
strcat(filename, dirptr);
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++ ) {
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");
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;
}
@ -733,7 +733,7 @@ void Svcmd_AddBot_f( void ) {
// name
trap_Argv( 1, name, sizeof( name ) );
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;
}
@ -783,7 +783,7 @@ void Svcmd_BotList_f( void ) {
char model[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++) {
strcpy(name, Info_ValueForKey( g_botInfos[i], "name" ));
if ( !*name ) {
@ -801,7 +801,7 @@ void Svcmd_BotList_f( void ) {
if (!*aifile ) {
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 );
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;
}
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 );
return;
}
@ -929,7 +929,7 @@ static void G_LoadBots( void ) {
strcat(filename, dirptr);
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 ) {
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 g_botInfos[num];

View file

@ -892,6 +892,8 @@ void ClientUserinfoChanged( int clientNum ) {
// check for malformed or illegal info strings
if ( !Info_Validate(userinfo) ) {
strcpy (userinfo, "\\name\\badinfo");
// don't keep those clients and userinfo
trap_DropClient(clientNum, "Invalid userinfo");
}
// check for local client
@ -1165,7 +1167,12 @@ char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) {
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
ent->client = level.clients + clientNum;
client = ent->client;
@ -1746,7 +1753,7 @@ void ClientDisconnect( int clientNum ) {
G_RemoveQueuedBotBegin( clientNum );
ent = g_entities + clientNum;
if ( !ent->client ) {
if (!ent->client || ent->client->pers.connected == CON_DISCONNECTED) {
return;
}

View file

@ -23,7 +23,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#include "g_local.h"
#ifdef MISSIONPACK
#include "../../ui/menudef.h" // for the voice chats
#endif
/*
==================
@ -144,11 +146,11 @@ CheatsOk
*/
qboolean CheatsOk( gentity_t *ent ) {
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;
}
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 qtrue;
@ -942,6 +944,16 @@ void Cmd_FollowCycle_f( gentity_t *ent, int 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;
original = clientnum;
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 ) {
int color;
char *cmd;
@ -1360,6 +1373,7 @@ static void Cmd_VoiceTaunt_f( gentity_t *ent ) {
// just say something
G_Voice( ent, NULL, SAY_ALL, VOICECHAT_TAUNT, qfalse );
}
#endif
@ -1767,11 +1781,11 @@ void Cmd_SetViewpos_f( gentity_t *ent ) {
int i;
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;
}
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;
}
@ -1924,7 +1938,7 @@ void ClientCommand( int clientNum ) {
// END
ent = g_entities + clientNum;
if ( !ent->client ) {
if (!ent->client || ent->client->pers.connected != CON_CONNECTED) {
return; // not fully in game yet
}
@ -1943,6 +1957,7 @@ void ClientCommand( int clientNum ) {
Cmd_Tell_f ( ent );
return;
}
#ifdef MISSIONPACK
if (Q_stricmp (cmd, "vsay") == 0) {
Cmd_Voice_f (ent, SAY_ALL, qfalse, qfalse);
return;
@ -1971,6 +1986,7 @@ void ClientCommand( int clientNum ) {
Cmd_VoiceTaunt_f ( ent );
return;
}
#endif
if (Q_stricmp (cmd, "score") == 0) {
Cmd_Score_f (ent);
return;

View file

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

View file

@ -139,7 +139,6 @@ struct gentity_s {
int timestamp; // body queue sinking, etc
float angle; // set in editor, -1 = up, -2 = down
char *target;
char *targetname;
char *team;
@ -285,11 +284,6 @@ typedef struct {
float lastfraggedcarrier;
} 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
// 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
@ -595,7 +589,6 @@ void G_FreeEntity( gentity_t *e );
qboolean G_EntitiesFree( void );
void G_TouchTriggers (gentity_t *ent);
void G_TouchSolids (gentity_t *ent);
float *tv (float x, float y, float z);
// 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 ClientRespawn(gentity_t *ent);
void BeginIntermission (void);
void InitClientPersistant (gclient_t *client);
void InitClientResp (gclient_t *client);
void InitBodyQue (void);
void ClientSpawn( gentity_t *ent );
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
//
// p_hud.c
//
void MoveClientToIntermission (gentity_t *client);
void G_SetStats (gentity_t *ent);
void DeathmatchScoreboardMessage (gentity_t *client);
//
// g_cmds.c
//
//
// g_pweapon.c
//
void DeathmatchScoreboardMessage( gentity_t *ent );
//
// g_main.c
//
void MoveClientToIntermission( gentity_t *ent );
void FindIntermissionPoint( void );
void SetLeader(int team, int client);
void CheckTeamLeader( int team );
@ -1011,8 +992,8 @@ extern vmCvar_t car_air_frac_to_df;
extern vmCvar_t car_friction_scale;
// END
void trap_Printf( const char *fmt );
void trap_Error(const char *fmt) __attribute__((noreturn));
void trap_Print( const char *text );
void trap_Error( const char *text ) __attribute__((noreturn));
int trap_Milliseconds( void );
int trap_Argc( void );
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);
va_end (argptr);
trap_Printf( text );
trap_Print( text );
}
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);
va_end (argptr);
G_Error( "%s", text);
trap_Error( text );
}
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);
va_end (argptr);
G_Printf ("%s", text);
trap_Print( text );
}
#endif
@ -1315,7 +1315,7 @@ void ExitLevel (void) {
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();
// change all client states to connecting, so the early players into the
@ -1729,10 +1729,6 @@ void CheckExitRules( void ) {
}
// END
if ( level.numPlayingClients < 2 ) {
return;
}
// STONELANCE
// dont check frags or captures during a race or derby
if ( isRallyRace() || g_gametype.integer == GT_DERBY ){
@ -1913,7 +1909,12 @@ void CheckTournament( void ) {
// if all players have arrived, start the countdown
if ( level.warmupTime < 0 ) {
// 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) );
return;
}
@ -2030,11 +2031,14 @@ void CheckTeamLeader( int team ) {
break;
}
}
for ( i = 0 ; i < level.maxclients ; i++ ) {
if (level.clients[i].sess.sessionTeam != team)
continue;
level.clients[i].sess.teamLeader = qtrue;
break;
if (i >= level.maxclients) {
for ( i = 0 ; i < level.maxclients ; i++ ) {
if (level.clients[i].sess.sessionTeam != team)
continue;
level.clients[i].sess.teamLeader = qtrue;
break;
}
}
}
}

View file

@ -42,7 +42,7 @@ void *G_Alloc( int size ) {
}
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;
}

View file

@ -34,8 +34,6 @@ PUSHMOVE
===============================================================================
*/
void MatchTeam( gentity_t *teamLeader, int moverState, int time );
typedef struct {
gentity_t *ent;
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
if ( check->s.groundEntityNum != pusher->s.number ) {
check->s.groundEntityNum = -1;
check->s.groundEntityNum = ENTITYNUM_NONE;
}
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 );
block = G_TestEntityPosition (check);
if ( !block ) {
check->s.groundEntityNum = -1;
check->s.groundEntityNum = ENTITYNUM_NONE;
pushed_p--;
return qtrue;
}

View file

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

View file

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

View file

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

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