mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 06:32:00 +00:00
Fix some warnings. Hopefully fix bullet plugin.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5287 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
aede46c776
commit
98b71860ed
33 changed files with 439 additions and 264 deletions
200
CMakeLists.txt
200
CMakeLists.txt
|
@ -1,7 +1,13 @@
|
|||
#Note: this file was made primarily to support msvc and its project file incompatibilities nightmare.
|
||||
#Its also useful for various other IDEs like QtCreator etc.
|
||||
#It uses system libraries, so it will have dependancy issues with public releases where those dependancies are distro/version-specific.
|
||||
#Public builds are still built using the (overcomplicated) traditional (g)makefile.
|
||||
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
|
||||
IF(${ANDROID})
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.6) #special dispensation for android crap.
|
||||
ELSE()
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
|
||||
ENDIF()
|
||||
PROJECT(fteqw)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
|
@ -30,14 +36,38 @@ ENDIF()
|
|||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
|
||||
#use LTO where possible. reportedly requires cmake 3.9 to actually work
|
||||
INCLUDE(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT result)
|
||||
IF(result)
|
||||
SET(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
IF(${CMAKE_VERSION} VERSION_LESS "3.9.0")
|
||||
#android studio sucks and insists on using an outdated version of cmake instead of the system version.
|
||||
ELSE()
|
||||
IF(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
#use LTO where possible. reportedly requires cmake 3.9 to actually work
|
||||
INCLUDE(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT result)
|
||||
IF(result)
|
||||
SET(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(${WIN32})
|
||||
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pointer-sign")
|
||||
endif()
|
||||
|
||||
IF(${ANDROID})
|
||||
# FIND_PACKAGE(Freetype REQUIRED)
|
||||
|
||||
# INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} )
|
||||
|
||||
SET(FTE_DEFINES ANDROID;GLQUAKE;VKQUAKE;DYNAMIC_LIBPNG;DYNAMIC_LIBJPEG;MULTITHREAD;stricmp=strcasecmp;strnicmp=strncasecmp)
|
||||
SET(FTE_LIBS android log EGL z m ${CMAKE_DL_LIBS})
|
||||
SET(FTE_ARCH_FILES
|
||||
engine/client/sys_droid.c
|
||||
engine/common/sys_linux_threads.c
|
||||
engine/client/snd_droid.c
|
||||
engine/client/cd_null.c
|
||||
engine/gl/gl_viddroid.c
|
||||
)
|
||||
ELSEIF(${WIN32})
|
||||
INCLUDE_DIRECTORIES(engine/libs engine/libs/freetype2/include)
|
||||
# LINK_DIRECTORIES(engine/libs/mingw64-libs)
|
||||
|
||||
|
@ -129,13 +159,13 @@ ELSEIF(${UNIX}) #linux(ish)
|
|||
)
|
||||
ENDIF()
|
||||
|
||||
SET(FTESV_DEFINES stricmp=strcasecmp;strnicmp=strncasecmp)
|
||||
SET(FTESV_DEFINES MULTITHREAD;stricmp=strcasecmp;strnicmp=strncasecmp)
|
||||
SET(FTESV_ARCH_FILES
|
||||
engine/server/sv_sys_unix.c
|
||||
engine/common/sys_linux_threads.c
|
||||
engine/common/net_ssl_gnutls.c
|
||||
)
|
||||
SET(FTESV_LIBS z m ${CMAKE_DL_LIBS})
|
||||
SET(FTESV_LIBS z m ${CMAKE_DL_LIBS} pthread)
|
||||
ELSEIF(1) #SDL
|
||||
FIND_PACKAGE(Freetype REQUIRED)
|
||||
# INCLUDE_DIRECTORIES(engine/libs engine/libs/freetype2/include)
|
||||
|
@ -318,11 +348,9 @@ SET(FTE_COMMON_FILES
|
|||
|
||||
engine/http/httpclient.c
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(fteqw WIN32
|
||||
${FTE_ARCH_FILES}
|
||||
${FTE_COMMON_FILES}
|
||||
|
||||
|
||||
#these files are only in the client
|
||||
SET(FTE_CLIENT_FILES
|
||||
engine/client/cl_cam.c
|
||||
engine/client/cl_cg.c
|
||||
engine/client/cl_demo.c
|
||||
|
@ -402,53 +430,73 @@ ADD_EXECUTABLE(fteqw WIN32
|
|||
engine/gl/gl_screen.c
|
||||
engine/gl/gl_vidcommon.c
|
||||
engine/gl/glmod_doom.c
|
||||
|
||||
|
||||
engine/vk/vk_backend.c
|
||||
engine/vk/vk_init.c
|
||||
)
|
||||
SET_TARGET_PROPERTIES(fteqw PROPERTIES COMPILE_DEFINITIONS "${FTE_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(fteqw ${FTE_LIBS} )
|
||||
|
||||
ADD_EXECUTABLE(fteqw-sv
|
||||
${FTESV_ARCH_FILES}
|
||||
${FTE_COMMON_FILES}
|
||||
)
|
||||
SET_TARGET_PROPERTIES(fteqw-sv PROPERTIES COMPILE_DEFINITIONS "SERVERONLY;${FTESV_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(fteqw-sv ${FTESV_LIBS})
|
||||
IF(${ANDROID})
|
||||
#android sucks. everything is a library. so we build the engine as a shared library and completely ignore dedicated servers+tools
|
||||
|
||||
ADD_LIBRARY(ftedroid MODULE
|
||||
${FTE_ARCH_FILES}
|
||||
${FTE_COMMON_FILES}
|
||||
${FTE_CLIENT_FILES}
|
||||
)
|
||||
SET_TARGET_PROPERTIES(ftedroid PROPERTIES COMPILE_DEFINITIONS "${FTE_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(ftedroid ${FTE_LIBS} )
|
||||
|
||||
ELSE()
|
||||
#systems that actually have executables...
|
||||
ADD_EXECUTABLE(fteqw WIN32
|
||||
${FTE_ARCH_FILES}
|
||||
${FTE_COMMON_FILES}
|
||||
${FTE_CLIENT_FILES}
|
||||
)
|
||||
|
||||
SET_TARGET_PROPERTIES(fteqw PROPERTIES COMPILE_DEFINITIONS "${FTE_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(fteqw ${FTE_LIBS} )
|
||||
|
||||
ADD_EXECUTABLE(fteqw-sv
|
||||
${FTESV_ARCH_FILES}
|
||||
${FTE_COMMON_FILES}
|
||||
)
|
||||
SET_TARGET_PROPERTIES(fteqw-sv PROPERTIES COMPILE_DEFINITIONS "SERVERONLY;${FTESV_DEFINES};${FTE_REVISON}")
|
||||
TARGET_LINK_LIBRARIES(fteqw-sv ${FTESV_LIBS})
|
||||
|
||||
|
||||
ADD_EXECUTABLE(fteqcc
|
||||
engine/qclib/qcctui.c
|
||||
engine/qclib/comprout.c
|
||||
engine/qclib/hash.c
|
||||
engine/qclib/qcc_cmdlib.c
|
||||
engine/qclib/qcc_pr_comp.c
|
||||
engine/qclib/qcc_pr_lex.c
|
||||
engine/qclib/qccmain.c
|
||||
engine/qclib/qcd_main.c
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(fteqcc z m)
|
||||
ADD_EXECUTABLE(fteqcc
|
||||
engine/qclib/qcctui.c
|
||||
engine/qclib/comprout.c
|
||||
engine/qclib/hash.c
|
||||
engine/qclib/qcc_cmdlib.c
|
||||
engine/qclib/qcc_pr_comp.c
|
||||
engine/qclib/qcc_pr_lex.c
|
||||
engine/qclib/qccmain.c
|
||||
engine/qclib/qcd_main.c
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(fteqcc z m)
|
||||
|
||||
|
||||
IF(${WIN32})
|
||||
ADD_EXECUTABLE(fteqccgui WIN32
|
||||
engine/qclib/qccgui.c
|
||||
engine/qclib/qccguistuff.c
|
||||
engine/qclib/comprout.c
|
||||
engine/qclib/hash.c
|
||||
engine/qclib/qcc_cmdlib.c
|
||||
engine/qclib/qcc_pr_comp.c
|
||||
engine/qclib/qcc_pr_lex.c
|
||||
engine/qclib/qccmain.c
|
||||
engine/qclib/decomp.c
|
||||
engine/qclib/packager.c
|
||||
engine/qclib/qcd_main.c
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(fteqccgui z shlwapi ole32 comctl32 comdlg32)
|
||||
IF(${WIN32})
|
||||
ADD_EXECUTABLE(fteqccgui WIN32
|
||||
engine/qclib/qccgui.c
|
||||
engine/qclib/qccguistuff.c
|
||||
engine/qclib/comprout.c
|
||||
engine/qclib/hash.c
|
||||
engine/qclib/qcc_cmdlib.c
|
||||
engine/qclib/qcc_pr_comp.c
|
||||
engine/qclib/qcc_pr_lex.c
|
||||
engine/qclib/qccmain.c
|
||||
engine/qclib/decomp.c
|
||||
engine/qclib/packager.c
|
||||
engine/qclib/qcd_main.c
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(fteqccgui z shlwapi ole32 comctl32 comdlg32)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
#Quake Injector Alike plugin
|
||||
ADD_LIBRARY(qi MODULE
|
||||
plugins/qvm_api.c
|
||||
|
@ -460,6 +508,28 @@ ADD_LIBRARY(qi MODULE
|
|||
SET_TARGET_PROPERTIES(qi PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN")
|
||||
SET_TARGET_PROPERTIES(qi PROPERTIES PREFIX "fteplug_")
|
||||
|
||||
#Bullet Physics library plugin
|
||||
FIND_PACKAGE(Bullet REQUIRED)
|
||||
ADD_LIBRARY(bullet MODULE
|
||||
plugins/qvm_api.c
|
||||
plugins/plugin.c
|
||||
plugins/bullet/bulletplug.cpp
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(bullet PUBLIC ${BULLET_INCLUDE_DIRS})
|
||||
SET_TARGET_PROPERTIES(bullet PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN")
|
||||
SET_TARGET_PROPERTIES(bullet PROPERTIES PREFIX "fteplug_")
|
||||
|
||||
#Bullet Physics library plugin
|
||||
#FIND_PACKAGE(ode REQUIRED)
|
||||
ADD_LIBRARY(ode MODULE
|
||||
plugins/qvm_api.c
|
||||
plugins/plugin.c
|
||||
engine/common/com_phys_ode.c
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(ode PUBLIC ${BULLET_INCLUDE_DIRS})
|
||||
SET_TARGET_PROPERTIES(ode PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;ODE_STATIC")
|
||||
SET_TARGET_PROPERTIES(ode PROPERTIES PREFIX "fteplug_")
|
||||
|
||||
#EzQuake Hud port plugin
|
||||
ADD_LIBRARY(ezhud MODULE
|
||||
plugins/qvm_api.c
|
||||
|
@ -481,19 +551,21 @@ ADD_LIBRARY(irc MODULE
|
|||
SET_TARGET_PROPERTIES(irc PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN")
|
||||
SET_TARGET_PROPERTIES(irc PROPERTIES PREFIX "fteplug_")
|
||||
|
||||
#XMPP/jabber client plugin
|
||||
ADD_LIBRARY(xmpp MODULE
|
||||
plugins/qvm_api.c
|
||||
plugins/plugin.c
|
||||
plugins/jabber/jabberclient.c
|
||||
plugins/jabber/xml.c
|
||||
plugins/jabber/jingle.c
|
||||
plugins/jabber/sift.c
|
||||
engine/common/sha1.c
|
||||
plugins/emailnot/md5.c
|
||||
)
|
||||
SET_TARGET_PROPERTIES(xmpp PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN")
|
||||
SET_TARGET_PROPERTIES(xmpp PROPERTIES PREFIX "fteplug_")
|
||||
IF(NOT ${ANDROID})
|
||||
#XMPP/jabber client plugin
|
||||
ADD_LIBRARY(xmpp MODULE
|
||||
plugins/qvm_api.c
|
||||
plugins/plugin.c
|
||||
plugins/jabber/jabberclient.c
|
||||
plugins/jabber/xml.c
|
||||
plugins/jabber/jingle.c
|
||||
plugins/jabber/sift.c
|
||||
engine/common/sha1.c
|
||||
plugins/emailnot/md5.c
|
||||
)
|
||||
SET_TARGET_PROPERTIES(xmpp PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN")
|
||||
SET_TARGET_PROPERTIES(xmpp PROPERTIES PREFIX "fteplug_")
|
||||
ENDIF()
|
||||
|
||||
#ffmpeg plugin
|
||||
#cef plugin
|
||||
|
|
|
@ -35,6 +35,7 @@ OPUSVER=1.2.1
|
|||
SPEEXVER=1.2.0
|
||||
SPEEXDSPVER=1.2rc3
|
||||
FREETYPEVER=2.9
|
||||
BULLETVER=2.87
|
||||
|
||||
#only limited forms of cross-making is supported
|
||||
#only the following 3 are supported
|
||||
|
@ -106,9 +107,11 @@ endif
|
|||
|
||||
ifeq ($(BITS),64)
|
||||
CC:=$(CC) -m64
|
||||
CXX:=$(CXX) -m64
|
||||
endif
|
||||
ifeq ($(BITS),32)
|
||||
CC:=$(CC) -m32
|
||||
CXX:=$(CXX) -m32
|
||||
endif
|
||||
|
||||
#correct the gcc build when cross compiling
|
||||
|
@ -119,6 +122,7 @@ ifneq (,$(findstring win32,$(FTE_TARGET)))
|
|||
ifneq ($(shell which i586-mingw32msvc-gcc 2> /dev/null),)
|
||||
#yup, the alternative exists (this matches the one debian has)
|
||||
CC=i586-mingw32msvc-gcc
|
||||
CXX=i586-mingw32msvc-g++
|
||||
AR=i586-mingw32msvc-ar
|
||||
WINDRES=i586-mingw32msvc-windres
|
||||
STRIP=i586-mingw32msvc-strip
|
||||
|
@ -128,6 +132,7 @@ ifneq (,$(findstring win32,$(FTE_TARGET)))
|
|||
ifneq ($(shell which i686-w64-mingw32-gcc 2> /dev/null),)
|
||||
#yup, the alternative exists (this matches the one debian has)
|
||||
CC=i686-w64-mingw32-gcc
|
||||
CXX=i686-w64-mingw32-g++
|
||||
AR=i686-w64-mingw32-ar
|
||||
WINDRES=i686-w64-mingw32-windres
|
||||
STRIP=i686-w64-mingw32-strip
|
||||
|
@ -143,6 +148,7 @@ ifneq (,$(findstring win64,$(FTE_TARGET)))
|
|||
ifneq ($(shell which x86_64-w64-mingw32-gcc 2> /dev/null),)
|
||||
#yup, the alternative exists (this matches the one debian has)
|
||||
CC=x86_64-w64-mingw32-gcc -m64
|
||||
CXX=x86_64-w64-mingw32-g++ -m64
|
||||
AR=x86_64-w64-mingw32-ar
|
||||
WINDRES=x86_64-w64-mingw32-windres
|
||||
STRIP=x86_64-w64-mingw32-strip
|
||||
|
@ -151,6 +157,7 @@ ifneq (,$(findstring win64,$(FTE_TARGET)))
|
|||
ifneq ($(shell which amd64-mingw32msvc-gcc 2> /dev/null),)
|
||||
#yup, the alternative exists (this matches the one debian has)
|
||||
CC=amd64-mingw32msvc-gcc -m64
|
||||
CXX=amd64-mingw32msvc-g++ -m64
|
||||
AR=amd64-mingw32msvc-ar
|
||||
WINDRES=amd64-mingw32msvc-windres
|
||||
STRIP=amd64-mingw32msvc-strip
|
||||
|
@ -279,6 +286,7 @@ ifeq ($(FTE_TARGET),droid)
|
|||
ANDROID_SCRIPT=android.bat
|
||||
#make can't cope with absolute win32 paths in dependancy files
|
||||
DEPCC=
|
||||
DEPCXX=
|
||||
|
||||
ifneq ($(realpath $(TOOLCHAINPATH)),) #don't invoke cygpath when realpath returns nothing due to dodgy paths (which happens when stuff isn't set up right for the top-level makefile)
|
||||
#configure hates android, with its broken default sysroot and lack of path etc
|
||||
|
@ -289,6 +297,7 @@ ifeq ($(FTE_TARGET),droid)
|
|||
endif
|
||||
|
||||
CC:=$(TOOLCHAIN)gcc --sysroot="$(DROIDSYSROOT)" -DANDROID $(DROID_ABI) -fno-strict-aliasing
|
||||
CXX:=$(TOOLCHAIN)g++ --sysroot="$(DROIDSYSROOT)" -DANDROID $(DROID_ABI) -fno-strict-aliasing
|
||||
DO_LD=$(DO_ECHO) $(CC) -Wl,-soname,libftedroid.so -shared -Wl,--no-undefined -Wl,-z,noexecstack -o $@ $(LTO_LD) $(WCFLAGS) $(BRANDFLAGS) $(CFLAGS) -llog -lc -lm -lz
|
||||
LD:=$(TOOLCHAIN)ld
|
||||
AR:=$(TOOLCHAIN)ar
|
||||
|
@ -305,6 +314,7 @@ ifeq ($(FTE_TARGET),macosx)
|
|||
ifeq ($(shell $(CC) -v 2>&1 | grep apple),)
|
||||
ifneq ($(shell which powerpc-apple-darwin8-gcc 2> /dev/null),)
|
||||
CC=powerpc-apple-darwin8-gcc
|
||||
CXX=powerpc-apple-darwin8-g++
|
||||
STRIP=powerpc-apple-darwin8-strip
|
||||
#seems, macosx has a more limited version of strip
|
||||
STRIPFLAGS=
|
||||
|
@ -319,6 +329,7 @@ ifeq ($(FTE_TARGET),macosx_ppc64)
|
|||
ifneq ($(shell which powerpc-apple-darwin8-gcc 2> /dev/null),)
|
||||
FTE_TARGET=macosx
|
||||
CC=powerpc-apple-darwin8-gcc -arch ppc64
|
||||
CXX=powerpc-apple-darwin8-g++ -arch ppc64
|
||||
STRIP=powerpc-apple-darwin8-strip
|
||||
#seems, macosx has a more limited version of strip
|
||||
STRIPFLAGS=
|
||||
|
@ -334,6 +345,7 @@ ifeq ($(FTE_TARGET),macosx_x86)
|
|||
FTE_TARGET=macosx
|
||||
# i686-apple-darwin8-gcc's default target is i386, powerpc-apple-darwin8-gcc -arch i386 just invokes i686-apple-darwin8-gcc anyway
|
||||
CC=i686-apple-darwin8-gcc
|
||||
CXX=i686-apple-darwin8-g++
|
||||
STRIP=i686-apple-darwin8-strip
|
||||
#seems, macosx has a more limited version of strip
|
||||
STRIPFLAGS=
|
||||
|
@ -347,6 +359,7 @@ ifeq ($(FTE_TARGET),morphos)
|
|||
ifeq ($(shell $(CC) -v 2>&1 | grep morphos),)
|
||||
ifneq ($(shell which ppc-morphos-gcc 2> /dev/null),)
|
||||
CC=ppc-morphos-gcc
|
||||
CXX=ppc-morphos-g++
|
||||
#morphos strip has a 'feature', it strips permissions
|
||||
STRIP=ppc-morphos-strip
|
||||
endif
|
||||
|
@ -356,6 +369,7 @@ endif
|
|||
ifeq ($(FTE_TARGET),dos)
|
||||
#at least from dos.
|
||||
CC=i586-pc-msdosdjgpp-gcc
|
||||
CXX=i586-pc-msdosdjgpp-g++
|
||||
CFLAGS+=-DNO_ZLIB
|
||||
endif
|
||||
|
||||
|
@ -363,12 +377,14 @@ endif
|
|||
ifeq ($(FTE_TARGET),linux32)
|
||||
FTE_TARGET=linux
|
||||
CC=gcc -m32
|
||||
CXX=g++ -m32
|
||||
BITS=32
|
||||
endif
|
||||
ifeq ($(FTE_TARGET),linuxarmhf)
|
||||
#debian's armhf is armv7, but armv6 works on RPI too.
|
||||
FTE_TARGET=linux
|
||||
CC=arm-linux-gnueabihf-gcc -marm -march=armv6 -mfpu=vfp -mfloat-abi=hard
|
||||
CXX=arm-linux-gnueabihf-g++ -marm -march=armv6 -mfpu=vfp -mfloat-abi=hard
|
||||
BITS=armhf
|
||||
endif
|
||||
ifeq ($(FTE_TARGET),linuxx32)
|
||||
|
@ -376,11 +392,13 @@ ifeq ($(FTE_TARGET),linuxx32)
|
|||
#at the current time, you will need to edit your kernel's commandline to allow this stuff to run
|
||||
FTE_TARGET=linux
|
||||
CC=gcc -mx32
|
||||
CXX=g++ -mx32
|
||||
BITS=x32
|
||||
endif
|
||||
ifeq ($(FTE_TARGET),linux64)
|
||||
FTE_TARGET=linux
|
||||
CC=gcc -m64
|
||||
CXX=g++ -m64
|
||||
BITS=64
|
||||
endif
|
||||
ifeq ($(FTE_TARGET),cygwin)
|
||||
|
@ -445,6 +463,7 @@ ifeq ($(NOCOMPAT),1)
|
|||
NCDIRPREFIX=nc
|
||||
endif
|
||||
ALL_CFLAGS=$(HAVECONFIG) $(VISIBILITY_FLAGS) $(BRANDFLAGS) $(CFLAGS) $(BASE_CFLAGS) $(WCFLAGS) $(ARCH_CFLAGS) $(NCCFLAGS) -I$(ARCHLIBS)
|
||||
ALL_CXXFLAGS=$(subst -Wno-pointer-sign,,$(ALL_CFLAGS))
|
||||
|
||||
#cheap compile-everything-in-one-unit (compile becomes preprocess only)
|
||||
ifneq ($(WPO),)
|
||||
|
@ -463,6 +482,7 @@ endif
|
|||
DO_ECHO=@
|
||||
#DO_ECHO=
|
||||
DO_CC=$(DO_ECHO) $(CC) $(LTO_CC) $(ALL_CFLAGS) -o $@ -c $<
|
||||
DO_CXX=$(DO_ECHO) $(CXX) $(LTO_CC) $(ALL_CXXFLAGS) -o $@ -c $<
|
||||
|
||||
ifeq ($(FTE_TARGET),vc)
|
||||
BASELDFLAGS=
|
||||
|
@ -829,6 +849,12 @@ ifeq (1,$(USE_BOTLIB))
|
|||
l_struct.o
|
||||
endif
|
||||
|
||||
COMMONLIBFLAGS=
|
||||
COMMONLDDEPS=
|
||||
CLIENTLIBFLAGS=$(COMMONLIBFLAGS) $(LIBOPUS_STATIC) $(LIBSPEEX_STATIC) $(OGGVORBISFILE_STATIC) $(LIBFREETYPE_STATIC)
|
||||
SERVERLIBFLAGS=$(COMMONLIBFLAGS)
|
||||
CLIENTLDDEPS=$(COMMONLDDEPS) $(LIBOPUS_LDFLAGS) $(LIBSPEEX_LDFLAGS) $(OGGVORBISLDFLAGS) $(LIBFREETYPE_LDFLAGS)
|
||||
SERVERLDDEPS=$(COMMONLDDEPS)
|
||||
ifeq (1,$(USE_OPUS))
|
||||
LIBOPUS_STATIC=-DOPUS_STATIC
|
||||
LIBOPUS_LDFLAGS=-lopus
|
||||
|
@ -851,15 +877,12 @@ ifeq (1,$(USE_FREETYPE))
|
|||
endif
|
||||
ifeq (1,$(strip $(INTERNAL_BULLET)))
|
||||
COMMON_OBJS+=com_phys_bullet.o
|
||||
ALL_CFLAGS+=-I/usr/include/bullet -I$(ARCHLIBS)/bullet3-$(BULLETVER)/src
|
||||
COMMONLDDEPS+=-lBulletDynamics -lBulletCollision -lLinearMath
|
||||
LDCC=$(CXX)
|
||||
MAKELIBS+=libs-$(ARCH)/libBulletDynamics.a
|
||||
endif
|
||||
|
||||
COMMONLIBFLAGS=
|
||||
CLIENTLIBFLAGS=$(COMMONLIBFLAGS) $(LIBOPUS_STATIC) $(LIBSPEEX_STATIC) $(OGGVORBISFILE_STATIC) $(LIBFREETYPE_STATIC)
|
||||
SERVERLIBFLAGS=$(COMMONLIBFLAGS)
|
||||
COMMONLDDEPS=
|
||||
CLIENTLDDEPS=$(COMMONLDDEPS) $(LIBOPUS_LDFLAGS) $(LIBSPEEX_LDFLAGS) $(OGGVORBISLDFLAGS) $(LIBFREETYPE_LDFLAGS)
|
||||
SERVERLDDEPS=$(COMMONLDDEPS)
|
||||
|
||||
#the defaults for sdl come first
|
||||
#CC_MACHINE:=$(shell $(CC) -dumpmachine)
|
||||
ifeq ($(FTE_TARGET),SDL2)
|
||||
|
@ -941,28 +964,33 @@ ifeq ($(FTE_TARGET),nacl)
|
|||
endif
|
||||
|
||||
CC=
|
||||
CXX=
|
||||
STRIP=
|
||||
NACLLIBC=glibc
|
||||
ifeq ($(NARCH),x86_32)
|
||||
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-gcc -DNACL -m32
|
||||
CXX=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-g++ -DNACL -m32
|
||||
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-strip
|
||||
BITS=
|
||||
NACLLIBS=$(NACLLIBC)_x86_32/Release
|
||||
endif
|
||||
ifeq ($(NARCH),x86_64)
|
||||
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-gcc -DNACL -m64
|
||||
CXX=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-g++ -DNACL -m64
|
||||
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-strip
|
||||
BITS=
|
||||
NACLLIBS=$(NACLLIBC)_x86_64/Release
|
||||
endif
|
||||
ifeq ($(NARCH),arm)
|
||||
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_arm_$(NACLLIBC)/bin/arm-nacl-gcc -DNACL
|
||||
CXX=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_arm_$(NACLLIBC)/bin/arm-nacl-g++ -DNACL
|
||||
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_arm_$(NACLLIBC)/bin/arm-nacl-strip
|
||||
BITS=
|
||||
NACLLIBS=$(NACLLIBC)_arm/Release
|
||||
endif
|
||||
ifeq ($(NARCH),pnacl)
|
||||
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_pnacl/bin/pnacl-clang -DNACL
|
||||
CXX=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_pnacl/bin/pnacl-clang++ -DNACL
|
||||
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_pnacl/bin/pnacl-strip
|
||||
STRIPFLAGS=
|
||||
BITS=
|
||||
|
@ -1121,6 +1149,7 @@ ifeq ($(FTE_TARGET),vc)
|
|||
EXEPOSTFIX=.exe
|
||||
|
||||
CC=PATH="C:\Program Files (x86)\$(MSVCDIR)\Common7\IDE" "$(MSVCPATH)cl" $(SDKINC) $(MSVCINC) -D_CRT_SECURE_NO_WARNINGS
|
||||
CXX=PATH="C:\Program Files (x86)\$(MSVCDIR)\Common7\IDE" "$(MSVCPATH)cl" $(SDKINC) $(MSVCINC) -D_CRT_SECURE_NO_WARNINGS
|
||||
DEBUG_CFLAGS ?= -Od $(CPUOPTIMIZATIONS) /fp:fast
|
||||
PROFILE_CFLAGS = -O2 -Ot -Ox -GL $(CPUOPTIMISATIONS) /fp:fast
|
||||
PROFILE_LDFLAGS = /LTCG:PGINSTRUMENT
|
||||
|
@ -1129,9 +1158,11 @@ ifeq ($(FTE_TARGET),vc)
|
|||
# /LTCG:PGOPTIMIZE
|
||||
|
||||
DO_CC=$(DO_ECHO) $(CC) /nologo $(ALL_CFLAGS) -Fo$(shell cygpath -m $@) -c $(shell cygpath -m $<)
|
||||
DO_CXX=$(DO_ECHO) $(CXX) /nologo $(ALL_CFLAGS) -Fo$(shell cygpath -m $@) -c $(shell cygpath -m $<)
|
||||
DO_LD=$(DO_ECHO) PATH="C:\Program Files (x86)\$(MSVCDIR)\Common7\IDE" "$(MSVCPATH)link" /nologo /out:"$(shell cygpath -m $@)" /nodefaultlib:libc.lib /LARGEADDRESSAWARE /nodefaultlib:MSVCRT $(MSVCLIB) $(SDKLIB) /manifest:no /OPT:REF wsock32.lib user32.lib kernel32.lib advapi32.lib winmm.lib libs/zlib$(BITS).lib shell32.lib
|
||||
PRECOMPHEADERS =
|
||||
DEPCC=
|
||||
DEPCXX=
|
||||
|
||||
LIBS_DIR=./libs/
|
||||
|
||||
|
@ -1372,6 +1403,7 @@ ifneq (,$(findstring rpi,$(FTE_TARGET)))
|
|||
#These next two lines enable cross compiling. If you're compiling natively you can just kill the two.
|
||||
RPI_SYSROOT:=$(realpath $(shell echo ~)/rpi/rpi-sysroot/)
|
||||
CC=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$(RPI_SYSROOT)
|
||||
CXX=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ --sysroot=$(RPI_SYSROOT)
|
||||
SDLCONFIG=$(RPI_SYSROOT)/usr/bin/sdl-config --prefix=$(RPI_SYSROOT)/usr
|
||||
GL_CFLAGS+= -I$(RPI_SYSROOT)/opt/vc/include -I$(RPI_SYSROOT)/opt/vc/include/interface/vmcs_host/linux -I$(RPI_SYSROOT)/opt/vc/include/interface/vcos/pthreads -DFTE_RPI -DUSE_EGL
|
||||
GL_LDFLAGS+= -L$(RPI_SYSROOT)/opt/vc/lib -Wl,--sysroot=$(RPI_SYSROOT),-rpath=/opt/vc/lib,-rpath-link=$(RPI_SYSROOT)/opt/vc/lib -lbcm_host
|
||||
|
@ -1544,6 +1576,7 @@ ifeq ($(FTE_TARGET),web)
|
|||
# RELEASE_LDFLAGS=-s ASM_JS=0 -O1 -s TOTAL_MEMORY=$(WEB_MEMORY) $(EMCC_ARGS)
|
||||
DEBUG_LDFLAGS=-O0 -g4 -s TOTAL_MEMORY=$(WEB_MEMORY) $(EMCC_ARGS) -s SAFE_HEAP=1 -s ALIASING_FUNCTION_POINTERS=0 -s ASSERTIONS=2
|
||||
CC?=emcc
|
||||
CXX?=emcc
|
||||
#BASELDFLAGS=
|
||||
PRECOMPHEADERS=
|
||||
|
||||
|
@ -1574,10 +1607,12 @@ ifeq ($(FTE_TARGET),web)
|
|||
BOTLIB_CFLAGS=
|
||||
#generate deps properly
|
||||
#DEPCC=
|
||||
#DEPCXX=
|
||||
endif
|
||||
|
||||
SV_DIR?=sv_sdl
|
||||
DEPCC?=$(CC)
|
||||
DEPCXX?=$(CXX)
|
||||
ARCH:=$(ARCH)
|
||||
BASELDFLAGS:=-L$(ARCHLIBS) $(BASELDFLAGS)
|
||||
|
||||
|
@ -1648,24 +1683,24 @@ endif
|
|||
$(DO_CC) -I$(OUT_DIR)
|
||||
|
||||
$(OUT_DIR)/%.o $(OUT_DIR)/%.d : %.cpp
|
||||
ifneq ($(DEPCC),)
|
||||
ifneq ($(DEPCXX),)
|
||||
@-set -e; rm -f $@.d; \
|
||||
$(DEPCC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \
|
||||
$(DEPCXX) -MM $(ALL_CXXFLAGS) $< > $@.d.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \
|
||||
sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \
|
||||
rm -f $@.d.$$$$
|
||||
endif
|
||||
$(DO_CC) -I$(OUT_DIR)
|
||||
$(DO_CXX) -I$(OUT_DIR)
|
||||
|
||||
$(OUT_DIR)/%.o $(OUT_DIR)/%.d : %.cxx
|
||||
ifneq ($(DEPCC),)
|
||||
ifneq ($(DEPCXX),)
|
||||
@-set -e; rm -f $@.d; \
|
||||
$(DEPCC) -MM $(ALL_CFLAGS) $< > $@.d.$$$$; \
|
||||
$(DEPCXX) -MM $(ALL_CXXFLAGS) $< > $@.d.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,$@ $@.d : ,g' < $@.d.$$$$ > $@.d; \
|
||||
sed -e 's/.*://' -e 's/\\$$//' < $@.d.$$$$ | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.d; \
|
||||
rm -f $@.d.$$$$
|
||||
endif
|
||||
$(DO_CC) -I$(OUT_DIR)
|
||||
$(DO_CXX) -I$(OUT_DIR)
|
||||
|
||||
$(OUT_DIR)/%.oo $(OUT_DIR)/%.d : %.c
|
||||
ifneq ($(DEPCC),)
|
||||
|
@ -1696,7 +1731,8 @@ PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch
|
|||
#god knows how gcc loads the list properly.
|
||||
#or at least I hope he does. It makes no sence to mortals.
|
||||
|
||||
DO_LD ?= $(DO_ECHO) $(CC) -o $@ $(LTO_LD) $(WCFLAGS) $(BRANDFLAGS) $(CFLAGS)
|
||||
LDCC ?=$(CC)
|
||||
DO_LD ?= $(DO_ECHO) $(LDCC) -o $@ $(LTO_LD) $(WCFLAGS) $(BRANDFLAGS) $(CFLAGS)
|
||||
$(OUT_DIR)/$(EXE_NAME): $(PRECOMPHEADERS) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS), $($(ol))),$(if $(findstring ltox,$(fn)),,$(OUT_DIR)/$(fn)))
|
||||
$(DO_LD) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS) $(LTO_END), $($(ol))),$(if $(findstring ltox,$(fn)),$(subst ltox,-x ,$(fn)),$(NATIVE_OUT_DIR)/$(fn)) ) $(LDFLAGS)
|
||||
|
||||
|
@ -2152,7 +2188,11 @@ libs-$(ARCH)/libfreetype.a:
|
|||
test -f freetype-$(FREETYPEVER).tar.gz || wget https://download.savannah.gnu.org/releases/freetype/freetype-$(FREETYPEVER).tar.gz
|
||||
-test -f libs-$(ARCH)/libfreetype.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../freetype-$(FREETYPEVER).tar.gz && cd freetype-$(FREETYPEVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) && $(TOOLOVERRIDES) $(MAKE) && cp objs/.libs/libfreetype.a ../ && cp -r include/ ../)
|
||||
|
||||
makelibs: libs-$(ARCH)/libjpeg.a libs-$(ARCH)/libz.a libs-$(ARCH)/libpng.a libs-$(ARCH)/libogg.a libs-$(ARCH)/libvorbis.a libs-$(ARCH)/libopus.a libs-$(ARCH)/libspeex.a libs-$(ARCH)/libspeexdsp.a libs-$(ARCH)/libfreetype.a
|
||||
libs-$(ARCH)/libBulletDynamics.a:
|
||||
test -f bullet3-$(BULLETVER).tar.gz || wget https://github.com/bulletphysics/bullet3/archive/$(BULLETVER).tar.gz
|
||||
-test -f libs-$(ARCH)/libBulletDynamics.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../bullet3-$(BULLETVER).tar.gz && cd bullet3-$(BULLETVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) cmake . && $(TOOLOVERRIDES) $(MAKE) LinearMath BulletDynamics BulletCollision && cp src/LinearMath/libLinearMath.a src/BulletDynamics/libBulletDynamics.a src/BulletCollision/libBulletCollision.a src/btBulletCollisionCommon.h src/btBulletDynamicsCommon.h ..)
|
||||
|
||||
makelibs: libs-$(ARCH)/libjpeg.a libs-$(ARCH)/libz.a libs-$(ARCH)/libpng.a libs-$(ARCH)/libogg.a libs-$(ARCH)/libvorbis.a libs-$(ARCH)/libopus.a libs-$(ARCH)/libspeex.a libs-$(ARCH)/libspeexdsp.a libs-$(ARCH)/libfreetype.a $(MAKELIBS)
|
||||
|
||||
HTTP_OBJECTS=http/httpserver.c http/iwebiface.c common/fs_stdio.c http/ftpserver.c
|
||||
$(RELEASE_DIR)/httpserver$(BITS): $(HTTP_OBJECTS)
|
||||
|
|
|
@ -28,10 +28,7 @@ struct searchpathfuncs_s;
|
|||
struct model_s;
|
||||
struct font_s;
|
||||
struct shader_s;
|
||||
enum slist_test_e;
|
||||
enum hostcachekey_e; //obtained via calls to gethostcacheindexforkey
|
||||
enum fs_relative;
|
||||
enum com_tokentype_e;
|
||||
|
||||
#ifndef __QUAKEDEF_H__
|
||||
#ifdef __cplusplus
|
||||
typedef enum {qfalse, qtrue} qboolean;//false and true are forcivly defined.
|
||||
|
@ -52,6 +49,15 @@ enum com_tokentype_e;
|
|||
typedef uint64_t qofs_t;
|
||||
#endif
|
||||
|
||||
#if 1 //c++ or standard C
|
||||
#include "cl_master.h"
|
||||
#else
|
||||
enum slist_test_e;
|
||||
enum hostcachekey_e; //obtained via calls to gethostcacheindexforkey
|
||||
#endif
|
||||
enum fs_relative;
|
||||
enum com_tokentype_e;
|
||||
|
||||
struct menu_inputevent_args_s
|
||||
{
|
||||
enum {
|
||||
|
@ -166,8 +172,8 @@ typedef struct {
|
|||
char *(*gethostcachestring) (struct serverinfo_s *host, enum hostcachekey_e fld);
|
||||
float (*gethostcachenumber) (struct serverinfo_s *host, enum hostcachekey_e fld);
|
||||
void (*resethostcachemasks) (void);
|
||||
void (*sethostcachemaskstring) (qboolean or, enum hostcachekey_e fld, const char *str, enum slist_test_e op);
|
||||
void (*sethostcachemasknumber) (qboolean or, enum hostcachekey_e fld, int num, enum slist_test_e op);
|
||||
void (*sethostcachemaskstring) (qboolean or_, enum hostcachekey_e fld, const char *str, enum slist_test_e op);
|
||||
void (*sethostcachemasknumber) (qboolean or_, enum hostcachekey_e fld, int num, enum slist_test_e op);
|
||||
void (*sethostcachesort) (enum hostcachekey_e fld, qboolean descending);
|
||||
int (*resorthostcache) (void);
|
||||
void (*refreshhostcache) (qboolean fullreset);
|
||||
|
|
|
@ -485,7 +485,7 @@ static int CL_FindHighTrack(int seat, char *rule)
|
|||
; //don't block if the players have different powerups
|
||||
else if ((cl.players[j].stats[STAT_ITEMS] & (IT_ROCKET_LAUNCHER|IT_LIGHTNING)) && !(cl.players[i].stats[STAT_ITEMS] & (IT_ROCKET_LAUNCHER|IT_LIGHTNING)))
|
||||
; //don't block the switch if the new player has a decent weapon, and the guy we're tracking does not.
|
||||
else if ((cl.players[j].stats[STAT_ITEMS] & (IT_ROCKET_LAUNCHER|IT_INVULNERABILITY))==(IT_ROCKET_LAUNCHER|IT_INVULNERABILITY) && (cl.players[i].stats[STAT_ITEMS] & (IT_ROCKET_LAUNCHER|IT_LIGHTNING)) != (IT_ROCKET_LAUNCHER|IT_INVULNERABILITY))
|
||||
else if ((cl.players[j].stats[STAT_ITEMS] & (IT_ROCKET_LAUNCHER|IT_INVULNERABILITY))==(IT_ROCKET_LAUNCHER|IT_INVULNERABILITY) && (cl.players[i].stats[STAT_ITEMS] & (IT_ROCKET_LAUNCHER|IT_INVULNERABILITY)) != (IT_ROCKET_LAUNCHER|IT_INVULNERABILITY))
|
||||
; //don't block if we're switching to someone with pent+rl from someone that does not.
|
||||
else
|
||||
#endif
|
||||
|
|
|
@ -5045,17 +5045,17 @@ done:
|
|||
goto done;
|
||||
}
|
||||
|
||||
snprintf(loadcommand, sizeof(loadcommand), "map \"%s\"\n", shortname);
|
||||
snprintf(displayname, sizeof(displayname), "map: %s", shortname);
|
||||
snprintf(qname, sizeof(qname), "maps/%s.bsp", shortname);
|
||||
Q_snprintfz(loadcommand, sizeof(loadcommand), "map \"%s\"\n", shortname);
|
||||
Q_snprintfz(displayname, sizeof(displayname), "map: %s", shortname);
|
||||
Q_snprintfz(qname, sizeof(qname), "maps/%s.bsp", shortname);
|
||||
}
|
||||
else if (f->flags & HRF_PACKAGE)
|
||||
{
|
||||
char *shortname;
|
||||
shortname = COM_SkipPath(f->fname);
|
||||
snprintf(qname, sizeof(qname), "%s", shortname);
|
||||
snprintf(loadcommand, sizeof(loadcommand), "fs_restart\n");
|
||||
snprintf(displayname, sizeof(displayname), "package: %s", shortname);
|
||||
Q_snprintfz(qname, sizeof(qname), "%s", shortname);
|
||||
Q_snprintfz(loadcommand, sizeof(loadcommand), "fs_restart\n");
|
||||
Q_snprintfz(displayname, sizeof(displayname), "package: %s", shortname);
|
||||
}
|
||||
else if (f->flags & HRF_MANIFEST)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef CL_MASTER_H
|
||||
#define CL_MASTER_H
|
||||
|
||||
enum masterprotocol_e
|
||||
{
|
||||
MP_UNSPECIFIED,
|
||||
|
@ -238,9 +241,13 @@ qboolean Master_GetSortDescending(void);
|
|||
int Master_NumSorted(void);
|
||||
void Master_ClearMasks(void);
|
||||
serverinfo_t *Master_SortedServer(int idx);
|
||||
void Master_SetMaskString(qboolean or, hostcachekey_t field, const char *param, slist_test_t testop);
|
||||
void Master_SetMaskInteger(qboolean or, hostcachekey_t field, int param, slist_test_t testop);
|
||||
void Master_SetMaskString(qboolean or_, hostcachekey_t field, const char *param, slist_test_t testop);
|
||||
void Master_SetMaskInteger(qboolean or_, hostcachekey_t field, int param, slist_test_t testop);
|
||||
serverinfo_t *Master_FindRoute(netadr_t target);
|
||||
#else
|
||||
#define MasterInfo_WriteServers()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3457,7 +3457,7 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
|
|||
info->special = type;
|
||||
info->refreshtime = 0;
|
||||
|
||||
snprintf(info->name, sizeof(info->name), "%s (via %s)", NET_AdrToString(adr, sizeof(adr), &info->adr), madr);
|
||||
Q_snprintfz(info->name, sizeof(info->name), "%s (via %s)", NET_AdrToString(adr, sizeof(adr), &info->adr), madr);
|
||||
|
||||
info->next = last;
|
||||
last = info;
|
||||
|
|
|
@ -2927,7 +2927,7 @@ static void P_ImportEffectInfo(char *config, char *line)
|
|||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
parenttype = ptype - part_type;
|
||||
snprintf(newname, sizeof(newname), "%i+%s", i, arg[1]);
|
||||
Q_snprintfz(newname, sizeof(newname), "%i+%s", i, arg[1]);
|
||||
ptype = P_GetParticleType(config, newname);
|
||||
if (!ptype->loaded)
|
||||
{
|
||||
|
|
|
@ -317,6 +317,17 @@ static cvar_t s_al_velocityscale = CVAR("s_al_velocityscale", "1");
|
|||
static cvar_t s_al_static_listener = CVAR("s_al_static_listener", "0"); //cheat
|
||||
extern cvar_t snd_doppler;
|
||||
|
||||
enum distancemodel_e
|
||||
{
|
||||
DM_INVERSE = 0,
|
||||
DM_INVERSE_CLAMPED = 1,
|
||||
DM_LINEAR = 2,
|
||||
DM_LINEAR_CLAMPED = 3,
|
||||
DM_EXPONENT = 4,
|
||||
DM_EXPONENT_CLAMPED = 5,
|
||||
DM_NONE = 6
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ALuint *source;
|
||||
|
@ -873,20 +884,20 @@ static void OpenAL_ChannelUpdate(soundcardinfo_t *sc, channel_t *chan, unsigned
|
|||
if (srcrel)
|
||||
{
|
||||
#ifdef FTE_TARGET_WEB
|
||||
switch(0) //emscripten omits it, and this is webaudio's default too.
|
||||
switch(DM_INVERSE) //emscripten omits it, and this is webaudio's default too.
|
||||
#else
|
||||
switch(s_al_distancemodel.ival)
|
||||
switch((enum distancemodel_e)s_al_distancemodel.ival)
|
||||
#endif
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
case 1:
|
||||
case DM_INVERSE:
|
||||
case DM_INVERSE_CLAMPED:
|
||||
palSourcef(src, AL_ROLLOFF_FACTOR, 0);
|
||||
palSourcef(src, AL_REFERENCE_DISTANCE, 1); //0 would be silent, or a division by 0
|
||||
palSourcef(src, AL_MAX_DISTANCE, 1); //only used for clamped mode
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case DM_LINEAR:
|
||||
case DM_LINEAR_CLAMPED:
|
||||
palSourcef(src, AL_ROLLOFF_FACTOR, 0);
|
||||
palSourcef(src, AL_REFERENCE_DISTANCE, 0); //doesn't matter when rolloff is 0
|
||||
palSourcef(src, AL_MAX_DISTANCE, 1); //doesn't matter, so long as its not a nan
|
||||
|
@ -896,20 +907,20 @@ static void OpenAL_ChannelUpdate(soundcardinfo_t *sc, channel_t *chan, unsigned
|
|||
else
|
||||
{
|
||||
#ifdef FTE_TARGET_WEB
|
||||
switch(2) //emscripten hardcodes it.
|
||||
switch(DM_LINEAR) //emscripten hardcodes it in a buggy kind of way.
|
||||
#else
|
||||
switch(s_al_distancemodel.ival)
|
||||
switch((enum distancemodel_e)s_al_distancemodel.ival)
|
||||
#endif
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
case 1:
|
||||
case DM_INVERSE:
|
||||
case DM_INVERSE_CLAMPED:
|
||||
palSourcef(src, AL_ROLLOFF_FACTOR, s_al_reference_distance.value);
|
||||
palSourcef(src, AL_REFERENCE_DISTANCE, 1);
|
||||
palSourcef(src, AL_MAX_DISTANCE, 1/chan->dist_mult); //clamp to the maximum distance you'd normally be allowed to hear... this is probably going to be annoying.
|
||||
break;
|
||||
case 2: //linear, mimic quake.
|
||||
case 3: //linear clamped to further than ref distance
|
||||
case DM_LINEAR: //linear, mimic quake.
|
||||
case DM_LINEAR_CLAMPED: //linear clamped to further than ref distance
|
||||
palSourcef(src, AL_ROLLOFF_FACTOR, 1);
|
||||
#ifdef FTE_TARGET_WEB
|
||||
//chrome complains about 0.
|
||||
|
@ -1093,45 +1104,45 @@ static void QDECL OnChangeALSettings (cvar_t *var, char *value)
|
|||
|
||||
if (palDistanceModel)
|
||||
{
|
||||
switch (s_al_distancemodel.ival)
|
||||
switch ((enum distancemodel_e)s_al_distancemodel.ival)
|
||||
{
|
||||
case 0:
|
||||
case DM_INVERSE:
|
||||
//gain = AL_REFERENCE_DISTANCE / (AL_REFERENCE_DISTANCE + AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE) )
|
||||
palDistanceModel(AL_INVERSE_DISTANCE);
|
||||
break;
|
||||
case 1: //openal's default mode
|
||||
case DM_INVERSE_CLAMPED: //openal's default mode
|
||||
//istance = max(distance,AL_REFERENCE_DISTANCE);
|
||||
//distance = min(distance,AL_MAX_DISTANCE);
|
||||
//gain = AL_REFERENCE_DISTANCE / (AL_REFERENCE_DISTANCE + AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE) )
|
||||
palDistanceModel(AL_INVERSE_DISTANCE_CLAMPED);
|
||||
break;
|
||||
case 2: //most quake-like
|
||||
case DM_LINEAR: //most quake-like. linear
|
||||
//distance = min(distance, AL_MAX_DISTANCE) // avoid negative gain
|
||||
//gain = ( 1 – AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE) / (AL_MAX_DISTANCE – AL_REFERENCE_DISTANCE) )
|
||||
palDistanceModel(AL_LINEAR_DISTANCE);
|
||||
break;
|
||||
case 3:
|
||||
case DM_LINEAR_CLAMPED: //linear, with near stuff clamped to further away
|
||||
//distance = max(distance, AL_REFERENCE_DISTANCE)
|
||||
//distance = min(distance, AL_MAX_DISTANCE)
|
||||
//gain = ( 1 – AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE) / (AL_MAX_DISTANCE – AL_REFERENCE_DISTANCE) )
|
||||
palDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
|
||||
break;
|
||||
case 4:
|
||||
case DM_EXPONENT:
|
||||
//gain = (distance / AL_REFERENCE_DISTANCE) ^ (- AL_ROLLOFF_FACTOR)
|
||||
palDistanceModel(AL_EXPONENT_DISTANCE);
|
||||
break;
|
||||
case 5:
|
||||
case DM_EXPONENT_CLAMPED:
|
||||
//distance = max(distance, AL_REFERENCE_DISTANCE)
|
||||
//distance = min(distance, AL_MAX_DISTANCE)
|
||||
//gain = (distance / AL_REFERENCE_DISTANCE) ^ (- AL_ROLLOFF_FACTOR)
|
||||
palDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED);
|
||||
break;
|
||||
case 6:
|
||||
case DM_NONE:
|
||||
//gain = 1
|
||||
palDistanceModel(AL_NONE);
|
||||
break;
|
||||
default:
|
||||
Cvar_ForceSet(&s_al_distancemodel, "0");
|
||||
Cvar_ForceSet(&s_al_distancemodel, "2");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1258,7 +1269,6 @@ static ALuint OpenAL_LoadEffect(const struct reverbproperties_s *reverb)
|
|||
{
|
||||
/* EAX Reverb is available. Set the EAX effect type then load the
|
||||
* reverb properties. */
|
||||
|
||||
palEffectf(effect, AL_EAXREVERB_DENSITY, reverb->flDensity);
|
||||
palEffectf(effect, AL_EAXREVERB_DIFFUSION, reverb->flDiffusion);
|
||||
palEffectf(effect, AL_EAXREVERB_GAIN, reverb->flGain);
|
||||
|
@ -1284,7 +1294,9 @@ static ALuint OpenAL_LoadEffect(const struct reverbproperties_s *reverb)
|
|||
palEffecti(effect, AL_EAXREVERB_DECAY_HFLIMIT, reverb->iDecayHFLimit);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef AL_EFFECT_REVERB
|
||||
/* No EAX Reverb. Set the standard reverb effect type then load the
|
||||
* available reverb properties. */
|
||||
palEffecti(effect, AL_EFFECT_TYPE, AL_EFFECT_REVERB);
|
||||
|
@ -1302,8 +1314,8 @@ static ALuint OpenAL_LoadEffect(const struct reverbproperties_s *reverb)
|
|||
palEffectf(effect, AL_REVERB_AIR_ABSORPTION_GAINHF, reverb->flAirAbsorptionGainHF);
|
||||
palEffectf(effect, AL_REVERB_ROOM_ROLLOFF_FACTOR, reverb->flRoomRolloffFactor);
|
||||
palEffecti(effect, AL_REVERB_DECAY_HFLIMIT, reverb->iDecayHFLimit);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
|
|
@ -3881,11 +3881,11 @@ void S_PlayVol(void)
|
|||
{
|
||||
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
||||
{
|
||||
Q_strncpy(name, Cmd_Argv(i), sizeof(name)-4);
|
||||
Q_strncpyz(name, Cmd_Argv(i), sizeof(name)-4);
|
||||
Q_strcat(name, ".wav");
|
||||
}
|
||||
else
|
||||
Q_strncpy(name, Cmd_Argv(i), sizeof(name));
|
||||
Q_strncpyz(name, Cmd_Argv(i), sizeof(name));
|
||||
sfx = S_PrecacheSound(name);
|
||||
vol = Q_atof(Cmd_Argv(i+1));
|
||||
S_StartSound(0, -1, sfx, NULL, NULL, vol, 0.0, 0, 0, CF_NOSPACIALISE);
|
||||
|
|
|
@ -719,7 +719,12 @@ void Cmd_Exec_f (void)
|
|||
return;
|
||||
}
|
||||
if (cl_warncmd.ival || developer.ival || cvar_watched)
|
||||
Con_TPrintf ("execing %s\n",name);
|
||||
{
|
||||
if (loc.search)
|
||||
Con_TPrintf ("execing %s/%s\n",name, loc.search->logicalpath);
|
||||
else
|
||||
Con_TPrintf ("execing %s\n",name);
|
||||
}
|
||||
|
||||
l = VFS_GETLEN(file);
|
||||
f = BZ_Malloc(l+1);
|
||||
|
|
|
@ -568,7 +568,7 @@ void Q_ftoa(char *str, float in)
|
|||
sprintf(str, "%.0f", in);
|
||||
else
|
||||
{
|
||||
char tstr[8];
|
||||
char tstr[32];
|
||||
char *lsig = str - 1;
|
||||
sprintf(tstr, "%%.%if", exp);
|
||||
sprintf(str, tstr, in);
|
||||
|
@ -5040,6 +5040,12 @@ void COM_Version_f (void)
|
|||
#else
|
||||
Con_DPrintf(" ^h(disabled: openal)^7");
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_INTERNAL_BULLET
|
||||
Con_Printf(" bullet");
|
||||
#endif
|
||||
#ifdef ENGINE_ROUTING
|
||||
Con_Printf(" routing");
|
||||
#endif
|
||||
Con_Printf("\n");
|
||||
|
||||
|
@ -5102,6 +5108,9 @@ void COM_Version_f (void)
|
|||
#if defined(MENU_DAT)
|
||||
Con_Printf(" menuqc");
|
||||
#endif
|
||||
#if defined(MENU_NATIVECODE)
|
||||
Con_Printf(" nmenu");
|
||||
#endif
|
||||
#if defined(CSQC_DAT)
|
||||
Con_Printf(" csqc");
|
||||
#endif
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
#undef TEXTEDITOR //my funky text editor! its awesome!
|
||||
#undef TCPCONNECT //support for playing over tcp sockets, instead of just udp. compatible with qizmo.
|
||||
#undef IRCCONNECT //lame support for routing game packets via irc server. not a good idea.
|
||||
#undef PLUGINS //support for external plugins (like huds or fancy menus or whatever)
|
||||
#define PLUGINS //support for external plugins (like huds or fancy menus or whatever)
|
||||
#undef SUPPORT_ICE //Internet Connectivity Establishment, for use by plugins to establish voice or game connections.
|
||||
#undef PSET_CLASSIC //support the 'classic' particle system, for that classic quake feel.
|
||||
#undef HAVE_CDPLAYER //includes cd playback. actual cds. named/numbered tracks are supported regardless (though you need to use the 'music' command to play them without this).
|
||||
|
|
|
@ -2553,7 +2553,7 @@ static void FS_AddDataFiles(searchpath_t **oldpaths, const char *purepath, const
|
|||
char pakfile[MAX_OSPATH];
|
||||
char logicalpaths[MAX_OSPATH]; //with a slash
|
||||
char purefile[MAX_OSPATH];
|
||||
char logicalfile[MAX_OSPATH];
|
||||
char logicalfile[MAX_OSPATH*2];
|
||||
unsigned int keptflags;
|
||||
vfsfile_t *vfs;
|
||||
flocation_t loc;
|
||||
|
@ -2621,7 +2621,7 @@ static void FS_AddDataFiles(searchpath_t **oldpaths, const char *purepath, const
|
|||
if (!search->handle->FindFile(search->handle, &loc, pakfile, NULL))
|
||||
break; //not found..
|
||||
|
||||
snprintf (logicalfile, sizeof(pakfile), "%spak%i.%s", logicalpaths, i, extension);
|
||||
snprintf (logicalfile, sizeof(logicalfile), "%spak%i.%s", logicalpaths, i, extension);
|
||||
snprintf (purefile, sizeof(purefile), "%s/pak%i.%s", purepath, i, extension);
|
||||
|
||||
for (existing = com_searchpaths; existing; existing = existing->next)
|
||||
|
|
|
@ -7777,13 +7777,15 @@ int QDECL VFSTCP_WriteBytes (struct vfsfile_s *file, const void *buffer, int byt
|
|||
|
||||
if (tf->conpending)
|
||||
{
|
||||
fd_set fd;
|
||||
fd_set fdw, fdx;
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 0;
|
||||
FD_ZERO(&fd);
|
||||
FD_SET(tf->sock, &fd);
|
||||
if (!select((int)tf->sock+1, NULL, &fd, &fd, &timeout))
|
||||
FD_ZERO(&fdw);
|
||||
FD_SET(tf->sock, &fdw);
|
||||
FD_ZERO(&fdx);
|
||||
FD_SET(tf->sock, &fdx);
|
||||
if (!select((int)tf->sock+1, NULL, &fdw, &fdx, &timeout))
|
||||
return 0;
|
||||
tf->conpending = false;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ struct
|
|||
} staticplugins[] =
|
||||
{
|
||||
#if defined(USE_INTERNAL_BULLET)
|
||||
{"Bullet_internal", Plug_Bullet_Init},
|
||||
{"bullet_internal", Plug_Bullet_Init},
|
||||
#endif
|
||||
#if defined(USE_INTERNAL_ODE)
|
||||
{"ODE_internal", Plug_ODE_Init},
|
||||
|
|
|
@ -2508,7 +2508,7 @@ void Mod_BSPXRW_SetLump(struct bspxrw *ctx, const char *lumpname, void *data, si
|
|||
}
|
||||
}
|
||||
|
||||
Z_ReallocElements(&ctx->lumps, &ctx->totallumps, ctx->totallumps+1, sizeof(*ctx->lumps));
|
||||
Z_ReallocElements((void**)&ctx->lumps, &ctx->totallumps, ctx->totallumps+1, sizeof(*ctx->lumps));
|
||||
Q_strncpyz(ctx->lumps[i].lumpname, lumpname, sizeof(ctx->lumps[i].lumpname));
|
||||
ctx->lumps[i].data = data;
|
||||
ctx->lumps[i].filelen = datasize;
|
||||
|
@ -2594,7 +2594,7 @@ qboolean Mod_BSPXRW_Read(struct bspxrw *ctx, const char *fname)
|
|||
l = (lump_t*)(ctx->origfile+ctx->lumpofs);
|
||||
for (i = 0; i < ctx->corelumps; i++)
|
||||
{
|
||||
Z_ReallocElements(&ctx->lumps, &ctx->totallumps, ctx->totallumps+1, sizeof(*ctx->lumps));
|
||||
Z_ReallocElements((void**)&ctx->lumps, &ctx->totallumps, ctx->totallumps+1, sizeof(*ctx->lumps));
|
||||
ctx->lumps[ctx->totallumps-1].data = ctx->origfile+l[i].fileofs;
|
||||
ctx->lumps[ctx->totallumps-1].filelen = l[i].filelen;
|
||||
if (corelumpnames)
|
||||
|
@ -2608,7 +2608,7 @@ qboolean Mod_BSPXRW_Read(struct bspxrw *ctx, const char *fname)
|
|||
{
|
||||
for (i = 0; i < bspxheader->numlumps; i++)
|
||||
{
|
||||
Z_ReallocElements(&ctx->lumps, &ctx->totallumps, ctx->totallumps+1, sizeof(*ctx->lumps));
|
||||
Z_ReallocElements((void**)&ctx->lumps, &ctx->totallumps, ctx->totallumps+1, sizeof(*ctx->lumps));
|
||||
ctx->lumps[ctx->totallumps-1].data = ctx->origfile+bspxheader->lumps[i].fileofs;
|
||||
ctx->lumps[ctx->totallumps-1].filelen = bspxheader->lumps[i].filelen;
|
||||
memcpy(ctx->lumps[ctx->totallumps-1].lumpname, bspxheader->lumps[i].lumpname, sizeof(ctx->lumps[0].lumpname));
|
||||
|
@ -2730,7 +2730,7 @@ void Mod_FindCubemaps_f(void)
|
|||
if (isenvmap)
|
||||
{
|
||||
int e = nenvmap;
|
||||
if (ZF_ReallocElements(&envmap, &nenvmap, nenvmap+1, sizeof(*envmap)))
|
||||
if (ZF_ReallocElements((void**)&envmap, &nenvmap, nenvmap+1, sizeof(*envmap)))
|
||||
{
|
||||
VectorCopy(origin, envmap[e].origin);
|
||||
envmap[e].cubesize = size;
|
||||
|
@ -2741,7 +2741,7 @@ void Mod_FindCubemaps_f(void)
|
|||
if (nenvmap)
|
||||
{
|
||||
qsort(envmap, nenvmap, sizeof(*envmap), envmapsort);
|
||||
if (ZF_ReallocElements(&envmapidx, &nenvmapidx, cl.worldmodel->numsurfaces, sizeof(*envmapidx)))
|
||||
if (ZF_ReallocElements((void**)&envmapidx, &nenvmapidx, cl.worldmodel->numsurfaces, sizeof(*envmapidx)))
|
||||
{
|
||||
for(i = 0; i < cl.worldmodel->numsurfaces; i++)
|
||||
envmapidx[i] = Mod_NearestCubeForSurf(cl.worldmodel->surfaces+i, envmap, nenvmap);
|
||||
|
@ -2778,11 +2778,11 @@ void Mod_BSPX_List_f(void)
|
|||
{
|
||||
for (i = 0; i < ctx.corelumps; i++)
|
||||
{
|
||||
Con_Printf("%s: %u\n", ctx.lumps[i].lumpname, ctx.lumps[i].filelen);
|
||||
Con_Printf("%s: %u\n", ctx.lumps[i].lumpname, (unsigned int)ctx.lumps[i].filelen);
|
||||
}
|
||||
for ( ; i < ctx.totallumps; i++)
|
||||
{
|
||||
Con_Printf("%s: %u\n", ctx.lumps[i].lumpname, ctx.lumps[i].filelen);
|
||||
Con_Printf("%s: %u\n", ctx.lumps[i].lumpname, (unsigned int)ctx.lumps[i].filelen);
|
||||
}
|
||||
Mod_BSPXRW_Free(&ctx);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ qboolean QVM_LoadDLL(vm_t *vm, const char *name, qboolean binroot, void **vmMain
|
|||
char dllname_anycpu[MAX_OSPATH];//simple
|
||||
dllhandle_t *hVM;
|
||||
|
||||
char fname[MAX_OSPATH];
|
||||
char fname[MAX_OSPATH*2];
|
||||
char gpath[MAX_OSPATH];
|
||||
void *iterator;
|
||||
|
||||
|
|
|
@ -151,7 +151,9 @@ void *Sys_CreateMutexNamed(char *file, int line);
|
|||
#define Sys_IsMainThread() Sys_MutexStub()
|
||||
#define Sys_LockMutex(m) Sys_MutexStub()
|
||||
#define Sys_UnlockMutex(m) Sys_MutexStub()
|
||||
static inline qboolean Sys_IsThread(void *thread) {return !thread;}
|
||||
#ifndef __cplusplus
|
||||
static inline qboolean Sys_IsThread(void *thread) {return !thread;}
|
||||
#endif
|
||||
#else
|
||||
#define Sys_IsMainThread() (qboolean)(true)
|
||||
#define Sys_CreateMutex() (void*)(NULL)
|
||||
|
|
|
@ -1777,7 +1777,7 @@ struct font_s *Font_LoadFont(const char *fontfilename, float vheight)
|
|||
char *aname;
|
||||
char *parms;
|
||||
int height = ((vheight * vid.rotpixelheight)/vid.height) + 0.5;
|
||||
char facename[MAX_QPATH];
|
||||
char facename[MAX_QPATH*12];
|
||||
struct charcache_s *c;
|
||||
float aspect = 1;
|
||||
enum
|
||||
|
@ -1790,7 +1790,7 @@ struct font_s *Font_LoadFont(const char *fontfilename, float vheight)
|
|||
FMT_HORIZONTAL, //unicode, charcount=width/(height-2). single strip of chars, like halflife.
|
||||
} fmt = FMT_AUTO;
|
||||
|
||||
Q_strncpy(facename, fontfilename, sizeof(facename));
|
||||
Q_strncpyz(facename, fontfilename, sizeof(facename));
|
||||
|
||||
aname = strstr(facename, ":");
|
||||
if (aname)
|
||||
|
|
|
@ -800,8 +800,14 @@ void Mod_Init (qboolean initial)
|
|||
|
||||
//q2/q3bsps
|
||||
#if defined(Q2BSPS) || defined(Q3BSPS)
|
||||
#ifndef Q2BSPS
|
||||
Mod_RegisterModelFormatMagic(NULL, "Quake3 Map (bsp)", IDBSPHEADER, Mod_LoadQ2BrushModel);
|
||||
#elif !defined(Q3BSPS)
|
||||
Mod_RegisterModelFormatMagic(NULL, "Quake2 Map (bsp)", IDBSPHEADER, Mod_LoadQ2BrushModel);
|
||||
#else
|
||||
Mod_RegisterModelFormatMagic(NULL, "Quake2/Quake3 Map (bsp)", IDBSPHEADER, Mod_LoadQ2BrushModel);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef RFBSPS
|
||||
Mod_RegisterModelFormatMagic(NULL, "Raven Map (bsp)", ('R'<<0)+('B'<<8)+('S'<<16)+('P'<<24), Mod_LoadQ2BrushModel);
|
||||
Mod_RegisterModelFormatMagic(NULL, "QFusion Map (bsp)", ('F'<<0)+('B'<<8)+('S'<<16)+('P'<<24), Mod_LoadQ2BrushModel);
|
||||
|
|
|
@ -11188,7 +11188,7 @@ void QCC_PR_ParseStatement (void)
|
|||
pr_labels = realloc(pr_labels, sizeof(*pr_labels)*max_labels);
|
||||
}
|
||||
|
||||
strncpy(pr_labels[num_labels].name, pr_token, sizeof(pr_labels[num_labels].name) -1);
|
||||
QC_strlcpy(pr_labels[num_labels].name, pr_token, sizeof(pr_labels[num_labels].name));
|
||||
pr_labels[num_labels].lineno = pr_source_line;
|
||||
pr_labels[num_labels].statementno = numstatements;
|
||||
|
||||
|
@ -11368,7 +11368,7 @@ void QCC_PR_ParseStatement (void)
|
|||
pr_labels = realloc(pr_labels, sizeof(*pr_labels)*max_labels);
|
||||
}
|
||||
|
||||
strncpy(pr_labels[num_labels].name, pr_token, sizeof(pr_labels[num_labels].name) -1);
|
||||
QC_strlcpy(pr_labels[num_labels].name, pr_token, sizeof(pr_labels[num_labels].name));
|
||||
pr_labels[num_labels].lineno = pr_source_line;
|
||||
pr_labels[num_labels].statementno = numstatements;
|
||||
|
||||
|
@ -13588,6 +13588,7 @@ QCC_def_t *QCC_PR_DummyDef(QCC_type_t *type, const char *name, QCC_function_t *s
|
|||
break;
|
||||
|
||||
case ev_accessor: //shouldn't happen.
|
||||
case ev_enum:
|
||||
case ev_float:
|
||||
case ev_string:
|
||||
case ev_entity:
|
||||
|
@ -14007,6 +14008,7 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, QCC_function_t *scope, int arr
|
|||
break;
|
||||
}
|
||||
//fallthrough. any named structs will become global structs that contain field references. hopefully.
|
||||
case ev_enum:
|
||||
case ev_accessor:
|
||||
case ev_float:
|
||||
case ev_string:
|
||||
|
@ -14120,15 +14122,15 @@ pbool QCC_PR_ParseInitializerType(int arraysize, QCC_def_t *basedef, QCC_sref_t
|
|||
else if (pr_token_type == tt_immediate && pr_immediate_type == type_integer)
|
||||
binum = pr_immediate._int;
|
||||
else if (pr_token_type == tt_immediate && pr_immediate_type == type_string)
|
||||
strncpy(fname, pr_immediate_string, sizeof(fname));
|
||||
QC_strlcpy(fname, pr_immediate_string, sizeof(fname));
|
||||
else if (pr_token_type == tt_name)
|
||||
strncpy(fname, pr_token, sizeof(fname));
|
||||
QC_strlcpy(fname, pr_token, sizeof(fname));
|
||||
else
|
||||
QCC_PR_ParseError (ERR_BADBUILTINIMMEDIATE, "Bad builtin immediate");
|
||||
QCC_PR_Lex();
|
||||
|
||||
if (!*fname && QCC_PR_CheckToken (":"))
|
||||
strncpy(fname, QCC_PR_ParseName(), sizeof(fname));
|
||||
QC_strlcpy(fname, QCC_PR_ParseName(), sizeof(fname));
|
||||
|
||||
//if the builtin already exists, just use that dfunction instead
|
||||
if (basedef && basedef->initialized)
|
||||
|
|
|
@ -5271,7 +5271,6 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
|
|||
pbool redeclaration;
|
||||
int basicindex;
|
||||
QCC_def_t *d;
|
||||
int d_offset = 0;
|
||||
QCC_type_t *pc;
|
||||
pbool found = false;
|
||||
int assumevirtual = 0; //0=erk, 1=yes, -1=no
|
||||
|
|
|
@ -4375,7 +4375,7 @@ int qccmline;
|
|||
char *qccmsrc;
|
||||
//char *qccmsrc2;
|
||||
char qccmfilename[1024];
|
||||
char qccmprogsdat[1024];
|
||||
char qccmprogsdat[1024*2];
|
||||
|
||||
void QCC_FinishCompile(void);
|
||||
|
||||
|
@ -4930,14 +4930,15 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
|
|||
{
|
||||
p = QCC_CheckParm ("-qc");
|
||||
if (p && p < argc-1 )
|
||||
sprintf (qccmprogsdat, "%s", argv[p+1]);
|
||||
QC_strlcpy(qccmprogsdat, argv[p+1], sizeof(qccmprogsdat));
|
||||
else
|
||||
{ //look for a preprogs.src... :o)
|
||||
sprintf (qccmprogsdat, "%spreprogs.src", qccmsourcedir);
|
||||
if (externs->FileSize(qccmprogsdat) <= 0)
|
||||
sprintf (qccmprogsdat, "progs.src");
|
||||
char tmp[sizeof(qccmsourcedir)+16];
|
||||
QC_snprintfz (tmp, sizeof(tmp), "%spreprogs.src", qccmsourcedir);
|
||||
if (externs->FileSize(tmp) <= 0)
|
||||
QC_snprintfz (qccmprogsdat, sizeof(qccmprogsdat), "progs.src");
|
||||
else
|
||||
sprintf (qccmprogsdat, "preprogs.src");
|
||||
QC_snprintfz (qccmprogsdat, sizeof(qccmprogsdat), "preprogs.src");
|
||||
}
|
||||
|
||||
numsourcefiles = 0;
|
||||
|
@ -4958,7 +4959,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
|
|||
else
|
||||
printf("%s\n", QCC_VersionString());
|
||||
|
||||
sprintf (qccmprogsdat, "%s%s", qccmsourcedir, sourcefileslist[currentsourcefile++]);
|
||||
QC_snprintfz (qccmprogsdat, sizeof(qccmprogsdat), "%s%s", qccmsourcedir, sourcefileslist[currentsourcefile++]);
|
||||
printf ("Source file: %s\n", qccmprogsdat);
|
||||
|
||||
QC_strlcpy(compilingrootfile, qccmprogsdat, sizeof(compilingrootfile));
|
||||
|
|
|
@ -462,7 +462,7 @@ void SV_Map_f (void)
|
|||
{
|
||||
char level[MAX_QPATH];
|
||||
char spot[MAX_QPATH];
|
||||
char expanded[MAX_QPATH];
|
||||
char expanded[MAX_QPATH+64];
|
||||
char *nextserver;
|
||||
qboolean preserveplayers= false;
|
||||
qboolean isrestart = false; //don't hurt settings
|
||||
|
|
|
@ -323,7 +323,7 @@ int sql_serverworker(void *sref)
|
|||
if (qres)
|
||||
{
|
||||
if (qerror)
|
||||
Q_strncpy(qres->error, qerror, qesize);
|
||||
Q_strncpyz(qres->error, qerror, qesize);
|
||||
qres->result = res;
|
||||
qres->rows = rows;
|
||||
qres->columns = columns;
|
||||
|
@ -491,7 +491,7 @@ int sql_serverworker(void *sref)
|
|||
if (qres)
|
||||
{ // hopefully the qmysql_close gained us some memory otherwise we're pretty screwed
|
||||
qres->rows = qres->columns = -1;
|
||||
Q_strncpy(qres->error, error, esize);
|
||||
Q_strncpyz(qres->error, error, esize);
|
||||
|
||||
SQL_PushResult(server, qres);
|
||||
}
|
||||
|
@ -872,14 +872,14 @@ int SQL_NewServer(const char *driver, const char **paramstr)
|
|||
for (i = 0; i < SQL_CONNECT_STRUCTPARAMS; i++)
|
||||
{
|
||||
server->connectparams[i] = ((char *)(server + 1)) + tsize;
|
||||
Q_strncpy(server->connectparams[i], paramstr[i], paramsize[i]);
|
||||
Q_strncpyz(server->connectparams[i], paramstr[i], paramsize[i]);
|
||||
// string should be null-terminated due to Z_Malloc
|
||||
tsize += paramsize[i] + 1;
|
||||
}
|
||||
for (i = SQL_CONNECT_STRUCTPARAMS; i < SQL_CONNECT_PARAMS; i++)
|
||||
{
|
||||
server->connectparams[i] = (char *)Z_Malloc(sizeof(char) * (paramsize[i] + 1));
|
||||
Q_strncpy(server->connectparams[i], paramstr[i], paramsize[i]);
|
||||
Q_strncpyz(server->connectparams[i], paramstr[i], paramsize[i]);
|
||||
// string should be null-terminated due to Z_Malloc
|
||||
}
|
||||
|
||||
|
@ -936,7 +936,7 @@ int SQL_NewQuery(sqlserver_t *server, qboolean (*callback)(queryrequest_t *req,
|
|||
}
|
||||
|
||||
qreq->callback = callback;
|
||||
Q_strncpy(qreq->query, str, qsize);
|
||||
Q_strncpyz(qreq->query, str, qsize);
|
||||
|
||||
qreq->nextreq = server->requests;
|
||||
server->requests = qreq;
|
||||
|
|
|
@ -1231,9 +1231,9 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
|||
{
|
||||
//grab the model name... without a progs/ prefix if it has one
|
||||
if (!strncmp(sv.strings.vw_model_precache[i], "progs/", 6))
|
||||
Q_strncpy(mname, sv.strings.vw_model_precache[i]+6, sizeof(mname));
|
||||
Q_strncpyz(mname, sv.strings.vw_model_precache[i]+6, sizeof(mname));
|
||||
else
|
||||
Q_strncpy(mname, sv.strings.vw_model_precache[i], sizeof(mname));
|
||||
Q_strncpyz(mname, sv.strings.vw_model_precache[i], sizeof(mname));
|
||||
|
||||
//strip .mdl extensions, for compat with ezquake
|
||||
COM_FileExtension(mname, ext, sizeof(ext));
|
||||
|
|
|
@ -72,6 +72,7 @@ PLUG_NATIVE_EXT?=_unk.so
|
|||
PLUG_DEFFILE?=
|
||||
PLUG_CFLAGS?=-fPIC -Wl,--no-undefined -Bsymbolic -fvisibility=hidden
|
||||
PLUG_CXXFLAGS?=-fPIC -Wl,--no-undefined -Bsymbolic -fvisibility=hidden
|
||||
PLUG_CMAKE?=-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX)
|
||||
PLUG_LDFLAGS_ZLIB?=
|
||||
ARCH:=$(shell $(CC) -dumpmachine)
|
||||
PLUG_LDFLAGS:=-L../engine/libs-$(ARCH) $(PLUG_LDFLAGS)
|
||||
|
@ -222,20 +223,28 @@ $(OUT_DIR)/fteplug_ode$(PLUG_NATIVE_EXT): $(ODE_FILES)
|
|||
#NATIVE_PLUGINS+=ode
|
||||
|
||||
|
||||
BULLET_VER=2.83.7
|
||||
BULLET_VER=2.87
|
||||
BULLET_URL=https://github.com/bulletphysics/bullet3/archive/$(BULLET_VER).tar.gz
|
||||
BULLET_BASE=$(OUT_DIR)/../bullet3-$(ODE_VER)_$(FTE_TARGET)/
|
||||
BULLET_LIB=$(ODE_BASE)bullet3-$(ODE_VER)/ode/src/.libs/libode.a
|
||||
BULLET_BASE=$(OUT_DIR)/../bullet3-$(BULLET_VER)_$(FTE_TARGET)/
|
||||
BULLET_LIBS= \
|
||||
$(BULLET_BASE)bullet3-$(BULLET_VER)/src/BulletDynamics/libBulletDynamics.a \
|
||||
$(BULLET_BASE)bullet3-$(BULLET_VER)/src/BulletCollision/libBulletCollision.a \
|
||||
$(BULLET_BASE)bullet3-$(BULLET_VER)/src/LinearMath/libLinearMath.a
|
||||
BULLET_CFLAGS=-I$(BULLET_BASE)bullet3-$(BULLET_VER)/src
|
||||
$(OUT_DIR)/../bullet3-$(BULLET_VER).tar.gz:
|
||||
mkdir -p $(BULLET_BASE)
|
||||
wget -N $(BULLET_URL) -O $@
|
||||
|
||||
BULLET_LIB=$(BULLET_BASE)bullet3-$(BULLET_VER)/src/LinearMath/libLinearMath.a
|
||||
$(BULLET_BASE)bullet3-$(BULLET_VER)/src/BulletDynamics/libBulletDynamics.a $(BULLET_BASE)bullet3-$(BULLET_VER)/src/BulletCollision/libBulletCollision.a: $(BULLET_LIB)
|
||||
$(BULLET_LIB): $(OUT_DIR)/../bullet3-$(BULLET_VER).tar.gz
|
||||
mkdir -p $(BULLET_BASE) && cd $(BULLET_BASE) && tar xvfz $<
|
||||
cd $(BULLET_BASE)bullet3-$(BULLET_VER)/ && ./bootstrap && ./configure --enable-double-precision --disable-demos --without-x CXX="$(CC)" CFLAGS="$(PLUG_CFLAGS)" CXXFLAGS="$(PLUG_CXXFLAGS)" --host=`$(CC) -dumpmachine` && make
|
||||
cd $(BULLET_BASE)bullet3-$(BULLET_VER)/ && cmake $(PLUG_CMAKE) . && $(MAKE) LinearMath BulletDynamics BulletCollision
|
||||
#./configure --enable-double-precision --disable-demos --without-x CXX="$(CC)" CFLAGS="$(PLUG_CFLAGS)" CXXFLAGS="$(PLUG_CXXFLAGS)" --host=`$(CC) -dumpmachine` && make
|
||||
|
||||
|
||||
$(OUT_DIR)/fteplug_bullet$(PLUG_NATIVE_EXT): bullet/bulletplug.c plugin.c qvm_api.c $(BULLET_LIB)
|
||||
$(CC) $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -o $@ -shared $(PLUG_CFLAGS) $^ $(PLUG_DEFFILE) $(PLUG_LDFLAGS)
|
||||
$(OUT_DIR)/fteplug_bullet$(PLUG_NATIVE_EXT): bullet/bulletplug.cpp plugin.c qvm_api.c $(BULLET_LIBS)
|
||||
$(CXX) $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -o $@ -shared $(PLUG_CFLAGS) $^ $(PLUG_DEFFILE) $(PLUG_LDFLAGS) $(BULLET_CFLAGS)
|
||||
#NATIVE_PLUGINS+=bullet
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define BZ_Malloc malloc
|
||||
#define BZ_Free free
|
||||
#define Z_Free BZ_Free
|
||||
static vec3_t vec3_origin;
|
||||
//#define vec3_origin vec3_origin_
|
||||
//static vec3_t vec3_origin;
|
||||
#define VectorCompare VectorCompare_
|
||||
static int VectorCompare (const vec3_t v1, const vec3_t v2)
|
||||
{
|
||||
int i;
|
||||
|
@ -62,7 +64,7 @@ static rbeplugfuncs_t *rbefuncs;
|
|||
#define DEG2RAD(d) (d * M_PI * (1/180.0f))
|
||||
#define RAD2DEG(d) ((d*180) / M_PI)
|
||||
|
||||
#include <btBulletDynamicsCommon.h>
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
|
||||
|
||||
static void World_Bullet_RunCmd(world_t *world, rbecommandqueue_t *cmd);
|
||||
|
@ -176,13 +178,13 @@ static void QDECL World_Bullet_RemoveFromEntity(world_t *world, wedict_t *ed)
|
|||
ed->rbe.physics = qfalse;
|
||||
|
||||
body = (btRigidBody*)ed->rbe.body.body;
|
||||
ed->rbe.body = NULL;
|
||||
ed->rbe.body.body = NULL;
|
||||
if (body)
|
||||
ctx->dworld->removeRigidBody (body);
|
||||
|
||||
geom = (btCollisionShape*)ed->rbe.geom;
|
||||
ed->rbe.geom = NULL;
|
||||
if (ed->rbe.geom)
|
||||
geom = (btCollisionShape*)ed->rbe.body.geom;
|
||||
ed->rbe.body.geom = NULL;
|
||||
if (ed->rbe.body.geom)
|
||||
delete geom;
|
||||
|
||||
//FIXME: joints
|
||||
|
@ -202,7 +204,7 @@ static void World_Bullet_Frame_BodyToEntity(world_t *world, wedict_t *ed)
|
|||
const float *o;
|
||||
const float *r; // for some reason dBodyGetRotation returns a [3][4] matrix
|
||||
const float *vel;
|
||||
btRigidBody *body = (btRigidBody*)ed->rbe.body;
|
||||
btRigidBody *body = (btRigidBody*)ed->rbe.body.body;
|
||||
int movetype;
|
||||
float bodymatrix[16];
|
||||
float entitymatrix[16];
|
||||
|
@ -352,11 +354,11 @@ static void World_Bullet_Frame_JointFromEntity(world_t *world, wedict_t *ed)
|
|||
jointtype = 0; // can't have both
|
||||
|
||||
e1 = (wedict_t*)PROG_TO_EDICT(world->progs, enemy);
|
||||
b1 = (btRigidBody*)e1->rbe.body;
|
||||
b1 = (btRigidBody*)e1->rbe.body.body;
|
||||
if(ED_ISFREE(e1) || !b1)
|
||||
enemy = 0;
|
||||
e2 = (wedict_t*)PROG_TO_EDICT(world->progs, aiment);
|
||||
b2 = (btRigidBody*)e2->rbe.body;
|
||||
b2 = (btRigidBody*)e2->rbe.body.body;
|
||||
if(ED_ISFREE(e2) || !b2)
|
||||
aiment = 0;
|
||||
// see http://www.ode.org/old_list_archives/2006-January/017614.html
|
||||
|
@ -364,9 +366,9 @@ static void World_Bullet_Frame_JointFromEntity(world_t *world, wedict_t *ed)
|
|||
// note: if movedir[2] is 0, it becomes ERP = 1, CFM = 1.0 / (H * K)
|
||||
if(movedir[0] > 0 && movedir[1] > 0)
|
||||
{
|
||||
float K = movedir[0];
|
||||
float D = movedir[1];
|
||||
float R = 2.0 * D * sqrt(K); // we assume D is premultiplied by sqrt(sprungMass)
|
||||
// float K = movedir[0];
|
||||
// float D = movedir[1];
|
||||
// float R = 2.0 * D * sqrt(K); // we assume D is premultiplied by sqrt(sprungMass)
|
||||
// CFM = 1.0 / (rbe->ode_step * K + R); // always > 0
|
||||
// ERP = rbe->ode_step * K * CFM;
|
||||
Vel = 0;
|
||||
|
@ -392,11 +394,11 @@ static void World_Bullet_Frame_JointFromEntity(world_t *world, wedict_t *ed)
|
|||
if(jointtype == ed->rbe.joint_type && VectorCompare(origin, ed->rbe.joint_origin) && VectorCompare(velocity, ed->rbe.joint_velocity) && VectorCompare(ed->v->angles, ed->rbe.joint_angles) && enemy == ed->rbe.joint_enemy && aiment == ed->rbe.joint_aiment && VectorCompare(movedir, ed->rbe.joint_movedir))
|
||||
return; // nothing to do
|
||||
|
||||
if(ed->rbe.joint)
|
||||
if(ed->rbe.joint.joint)
|
||||
{
|
||||
j = (btTypedConstraint*)ed->rbe.joint;
|
||||
j = (btTypedConstraint*)ed->rbe.joint.joint;
|
||||
rbe->dworld->removeConstraint(j);
|
||||
ed->rbe.joint = NULL;
|
||||
ed->rbe.joint.joint = NULL;
|
||||
delete j;
|
||||
}
|
||||
if (!jointtype)
|
||||
|
@ -523,7 +525,7 @@ static void World_Bullet_Frame_JointFromEntity(world_t *world, wedict_t *ed)
|
|||
break;
|
||||
}
|
||||
|
||||
ed->rbe.joint = (void *) j;
|
||||
ed->rbe.joint.joint = (void *) j;
|
||||
if (j)
|
||||
{
|
||||
j->setUserConstraintPtr((void *) ed);
|
||||
|
@ -575,7 +577,7 @@ static qboolean QDECL World_Bullet_RagCreateBody(world_t *world, rbebody_t *body
|
|||
bulletcontext_t *ctx = (bulletcontext_t*)world->rbe;
|
||||
int axisindex;
|
||||
ctx->hasextraobjs = true;
|
||||
|
||||
|
||||
switch(bodyinfo->geomshape)
|
||||
{
|
||||
/*
|
||||
|
@ -953,7 +955,7 @@ public:
|
|||
|
||||
rbefuncs->VectorAngles(fwd, up, edict->v->angles, (qboolean)NegativeMeshPitch(world, edict));
|
||||
|
||||
const btVector3 &vel = ((btRigidBody*)edict->rbe.body)->getLinearVelocity();
|
||||
const btVector3 &vel = ((btRigidBody*)edict->rbe.body.body)->getLinearVelocity();
|
||||
VectorCopy(vel.m_floats, edict->v->velocity);
|
||||
|
||||
//so it doesn't get rebuilt
|
||||
|
@ -1218,7 +1220,7 @@ static void World_Bullet_Frame_BodyFromEntity(world_t *world, wedict_t *ed)
|
|||
// ed->rbe.massbuf = BZ_Malloc(sizeof(dMass));
|
||||
// memcpy(ed->rbe.massbuf, &mass, sizeof(dMass));
|
||||
|
||||
ed->rbe.geom = (void *)geom;
|
||||
ed->rbe.body.geom = (void *)geom;
|
||||
}
|
||||
|
||||
//non-moving objects need to be static objects (and thus need 0 mass)
|
||||
|
@ -1229,32 +1231,32 @@ static void World_Bullet_Frame_BodyFromEntity(world_t *world, wedict_t *ed)
|
|||
if (ed->rbe.mass != massval)
|
||||
{
|
||||
ed->rbe.mass = massval;
|
||||
body = (btRigidBody*)ed->rbe.body;
|
||||
body = (btRigidBody*)ed->rbe.body.body;
|
||||
if (body)
|
||||
ctx->dworld->removeRigidBody(body);
|
||||
ed->rbe.body = NULL;
|
||||
ed->rbe.body.body = NULL;
|
||||
}
|
||||
|
||||
// if(ed->rbe.geom)
|
||||
// dGeomSetData(ed->rbe.geom, (void*)ed);
|
||||
// if(ed->rbe.body.geom)
|
||||
// dGeomSetData(ed->rbe.body.geom, (void*)ed);
|
||||
if (movetype == MOVETYPE_PHYSICS && ed->rbe.mass)
|
||||
{
|
||||
if (ed->rbe.body == NULL)
|
||||
if (ed->rbe.body.body == NULL)
|
||||
{
|
||||
// ed->rbe.body = (void *)(body = dBodyCreate(world->rbe.world));
|
||||
// dGeomSetBody(ed->rbe.geom, body);
|
||||
// ed->rbe.body.body = (void *)(body = dBodyCreate(world->rbe.world));
|
||||
// dGeomSetBody(ed->rbe.body.geom, body);
|
||||
// dBodySetData(body, (void*)ed);
|
||||
// dBodySetMass(body, (dMass *) ed->rbe.massbuf);
|
||||
|
||||
btVector3 fallInertia(0, 0, 0);
|
||||
((btCollisionShape*)ed->rbe.geom)->calculateLocalInertia(ed->rbe.mass, fallInertia);
|
||||
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(ed->rbe.mass, new QCMotionState(ed,world), (btCollisionShape*)ed->rbe.geom, fallInertia);
|
||||
((btCollisionShape*)ed->rbe.body.geom)->calculateLocalInertia(ed->rbe.mass, fallInertia);
|
||||
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(ed->rbe.mass, new QCMotionState(ed,world), (btCollisionShape*)ed->rbe.body.geom, fallInertia);
|
||||
body = new btRigidBody(fallRigidBodyCI);
|
||||
body->setUserPointer(ed);
|
||||
// btTransform trans;
|
||||
// trans.setFromOpenGLMatrix(ed->rbe.offsetmatrix);
|
||||
// body->setCenterOfMassTransform(trans);
|
||||
ed->rbe.body = (void*)body;
|
||||
ed->rbe.body.body = (void*)body;
|
||||
|
||||
//motion threshhold should be speed/physicsframerate.
|
||||
//FIXME: recalculate...
|
||||
|
@ -1269,15 +1271,15 @@ static void World_Bullet_Frame_BodyFromEntity(world_t *world, wedict_t *ed)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (ed->rbe.body == NULL)
|
||||
if (ed->rbe.body.body == NULL)
|
||||
{
|
||||
btRigidBody::btRigidBodyConstructionInfo rbci(ed->rbe.mass, new QCMotionState(ed,world), (btCollisionShape*)ed->rbe.geom, btVector3(0, 0, 0));
|
||||
btRigidBody::btRigidBodyConstructionInfo rbci(ed->rbe.mass, new QCMotionState(ed,world), (btCollisionShape*)ed->rbe.body.geom, btVector3(0, 0, 0));
|
||||
body = new btRigidBody(rbci);
|
||||
body->setUserPointer(ed);
|
||||
// btTransform trans;
|
||||
// trans.setFromOpenGLMatrix(ed->rbe.offsetmatrix);
|
||||
// body->setCenterOfMassTransform(trans);
|
||||
ed->rbe.body = (void*)body;
|
||||
ed->rbe.body.body = (void*)body;
|
||||
if (ed->rbe.mass)
|
||||
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
|
||||
else
|
||||
|
@ -1288,7 +1290,7 @@ static void World_Bullet_Frame_BodyFromEntity(world_t *world, wedict_t *ed)
|
|||
}
|
||||
}
|
||||
|
||||
body = (btRigidBody*)ed->rbe.body;
|
||||
body = (btRigidBody*)ed->rbe.body.body;
|
||||
|
||||
// get current data from entity
|
||||
gravity = qtrue;
|
||||
|
@ -1376,7 +1378,7 @@ static void World_Bullet_Frame_BodyFromEntity(world_t *world, wedict_t *ed)
|
|||
modified = qtrue;
|
||||
|
||||
// store the qc values into the physics engine
|
||||
body = (btRigidBody*)ed->rbe.body;
|
||||
body = (btRigidBody*)ed->rbe.body.body;
|
||||
if (modified && body)
|
||||
{
|
||||
// dVector3 r[3];
|
||||
|
@ -1508,7 +1510,7 @@ static void VARGS nearCallback (void *data, dGeomID o1, dGeomID o2)
|
|||
//ragdolls don't make contact with the bbox of the doll entity
|
||||
//the origional entity should probably not be solid anyway.
|
||||
//these bodies should probably not collide against bboxes of other entities with ragdolls either, but meh.
|
||||
if (ed1->rbe.body == b1 || ed2->rbe.body == b2)
|
||||
if (ed1->rbe.body.body == b1 || ed2->rbe.body == b2)
|
||||
return;
|
||||
}
|
||||
if(!ed1 || ed1->isfree)
|
||||
|
@ -1605,7 +1607,7 @@ static void QDECL World_Bullet_Frame(world_t *world, double frametime, double gr
|
|||
struct bulletcontext_s *ctx = (struct bulletcontext_s*)world->rbe;
|
||||
if (world->rbe_hasphysicsents || ctx->hasextraobjs)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
wedict_t *ed;
|
||||
|
||||
// world->rbe.iterations = bound(1, physics_bullet_iterationsperframe.ival, 1000);
|
||||
|
@ -1674,7 +1676,7 @@ static void QDECL World_Bullet_Frame(world_t *world, double frametime, double gr
|
|||
|
||||
static void World_Bullet_RunCmd(world_t *world, rbecommandqueue_t *cmd)
|
||||
{
|
||||
btRigidBody *body = (btRigidBody*)(cmd->edict->rbe.body);
|
||||
btRigidBody *body = (btRigidBody*)(cmd->edict->rbe.body.body);
|
||||
switch(cmd->command)
|
||||
{
|
||||
case RBECMD_ENABLE:
|
||||
|
@ -1693,7 +1695,7 @@ static void World_Bullet_RunCmd(world_t *world, rbecommandqueue_t *cmd)
|
|||
}
|
||||
break;
|
||||
case RBECMD_TORQUE:
|
||||
if (cmd->edict->rbe.body)
|
||||
if (cmd->edict->rbe.body.body)
|
||||
{
|
||||
body->setActivationState(1);
|
||||
body->applyTorque(btVector3(cmd->v1[0], cmd->v1[1], cmd->v1[2]));
|
||||
|
@ -1722,7 +1724,7 @@ static void QDECL World_Bullet_PushCommand(world_t *world, rbecommandqueue_t *va
|
|||
static void QDECL World_Bullet_TraceEntity(world_t *world, vec3_t start, vec3_t end, wedict_t *ed)
|
||||
{
|
||||
struct bulletcontext_s *ctx = (struct bulletcontext_s*)world->rbe;
|
||||
btCollisionShape *shape = (btCollisionShape*)ed->rbe.geom;
|
||||
btCollisionShape *shape = (btCollisionShape*)ed->rbe.body.geom;
|
||||
|
||||
class myConvexResultCallback : public btCollisionWorld::ConvexResultCallback
|
||||
{
|
||||
|
|
|
@ -150,9 +150,9 @@ void SCR_HUD_DrawBar(int direction, int value, float max_value, float *rgba, int
|
|||
|
||||
if(direction >= 2)
|
||||
// top-down
|
||||
amount = Q_rint(abs((height * value) / max_value));
|
||||
amount = Q_rint(fabs((height * value) / max_value));
|
||||
else// left-right
|
||||
amount = Q_rint(abs((width * value) / max_value));
|
||||
amount = Q_rint(fabs((width * value) / max_value));
|
||||
|
||||
pDraw_Colour4f(rgba[0]/255.0, rgba[1]/255.0, rgba[2]/255.0, rgba[3]/255.0 * alphamul);
|
||||
if(direction == 0)
|
||||
|
@ -390,7 +390,7 @@ char *SCR_GetGameTime(int t, char *buffer, size_t buffersize)
|
|||
if (cl.countdown || cl.standby)
|
||||
SecondsToMinutesString(timelimit, buffer, buffersize);
|
||||
else
|
||||
SecondsToMinutesString((int) abs(timelimit - (cl.time - cl.matchstart)), buffer, buffersize);
|
||||
SecondsToMinutesString((int) fabs(timelimit - (cl.time - cl.matchstart)), buffer, buffersize);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@ BUILTINR(qhandle_t, Con_POpen, (const char *conname, quintptr_t flags));
|
|||
#define ARGNAMES ,conname,text
|
||||
BUILTIN(void, Con_SubPrint, (const char *conname, const char *text)); //on to named sub console (creating it too).
|
||||
#undef ARGNAMES
|
||||
#define ARGNAMES ,old,new
|
||||
BUILTIN(void, Con_RenameSub, (const char *old, const char *new)); //rename a subconsole
|
||||
#define ARGNAMES ,old,newname
|
||||
BUILTIN(void, Con_RenameSub, (const char *old, const char *newname)); //rename a subconsole
|
||||
#undef ARGNAMES
|
||||
#define ARGNAMES ,conname
|
||||
BUILTINR(int, Con_IsActive, (const char *conname));
|
||||
|
@ -565,18 +565,18 @@ qintptr_t QDECL Plug_InitAPI(qintptr_t *args)
|
|||
|
||||
qboolean Plug_Export(const char *name, export_t func)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < sizeof(exports)/sizeof(exports[0]); i++)
|
||||
{
|
||||
if (!exports[i].name)
|
||||
{
|
||||
exports[i].name = name;
|
||||
exports[i].func = func;
|
||||
return pPlug_ExportToEngine(name, i);
|
||||
return pPlug_ExportToEngine(name, i)?qtrue:qfalse;
|
||||
}
|
||||
}
|
||||
pSys_Error("Plugin exports too many functions");
|
||||
return 0;
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ void QI_RefreshMapList(qboolean forcedisplay)
|
|||
|
||||
tech = XML_ChildOfTree(file, "techinfo", 0);
|
||||
//if the filter isn't contained in the id/desc then don't display it.
|
||||
if (filters.namefilter)
|
||||
if (*filters.namefilter)
|
||||
{
|
||||
if (!QI_strcasestr(id, filters.namefilter) && !QI_strcasestr(desc, filters.namefilter) && !QI_strcasestr(author, filters.namefilter))
|
||||
{
|
||||
|
|
|
@ -13,12 +13,13 @@ You can probably get a better version from somewhere.
|
|||
int Q_vsnprintf(char *buffer, size_t maxlen, const char *format, va_list vargs)
|
||||
{
|
||||
int tokens=0;
|
||||
const char *string_;
|
||||
char *string;
|
||||
char tempbuffer[64];
|
||||
char sign;
|
||||
unsigned int _uint;
|
||||
int _int;
|
||||
float _float;
|
||||
unsigned int uint_;
|
||||
int int_;
|
||||
float float_;
|
||||
int i;
|
||||
int use0s;
|
||||
int width, useprepad, plus;
|
||||
|
@ -75,50 +76,50 @@ retry:
|
|||
*buffer++ = *format;
|
||||
break;
|
||||
case 's':
|
||||
string = va_arg(vargs, char *);
|
||||
if (!string)
|
||||
string = "(null)";
|
||||
string_ = va_arg(vargs, char *);
|
||||
if (!string_)
|
||||
string_ = "(null)";
|
||||
if (width)
|
||||
{
|
||||
while (*string && width--)
|
||||
while (*string_ && width--)
|
||||
{
|
||||
if (maxlen-- == 0)
|
||||
{*buffer++='\0';return tokens;}
|
||||
*buffer++ = *string++;
|
||||
*buffer++ = *string_++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*string)
|
||||
while (*string_)
|
||||
{
|
||||
if (maxlen-- == 0)
|
||||
{*buffer++='\0';return tokens;}
|
||||
*buffer++ = *string++;
|
||||
*buffer++ = *string_++;
|
||||
}
|
||||
}
|
||||
tokens++;
|
||||
break;
|
||||
case 'c':
|
||||
_int = va_arg(vargs, int);
|
||||
int_ = va_arg(vargs, int);
|
||||
if (maxlen-- == 0)
|
||||
{*buffer++='\0';return tokens;}
|
||||
*buffer++ = _int;
|
||||
*buffer++ = int_;
|
||||
tokens++;
|
||||
break;
|
||||
case 'p':
|
||||
if (1)
|
||||
_uint = (size_t)va_arg(vargs, void*);
|
||||
uint_ = (size_t)va_arg(vargs, void*);
|
||||
else
|
||||
case 'x':
|
||||
_uint = va_arg(vargs, unsigned int);
|
||||
uint_ = va_arg(vargs, unsigned int);
|
||||
i = sizeof(tempbuffer)-2;
|
||||
tempbuffer[i+1] = '\0';
|
||||
while(_uint)
|
||||
while(uint_)
|
||||
{
|
||||
tempbuffer[i] = (_uint&0xf) + '0';
|
||||
tempbuffer[i] = (uint_&0xf) + '0';
|
||||
if (tempbuffer[i] > '9')
|
||||
tempbuffer[i] = tempbuffer[i] - ':' + 'a';
|
||||
_uint/=16;
|
||||
uint_/=16;
|
||||
i--;
|
||||
}
|
||||
string = tempbuffer+i+1;
|
||||
|
@ -153,23 +154,23 @@ retry:
|
|||
case 'd':
|
||||
case 'u':
|
||||
case 'i':
|
||||
_int = va_arg(vargs, int);
|
||||
int_ = va_arg(vargs, int);
|
||||
if (useprepad)
|
||||
{
|
||||
/*
|
||||
if (_int >= 1000)
|
||||
if (int_ >= 1000)
|
||||
useprepad = 4;
|
||||
else if (_int >= 100)
|
||||
else if (int_ >= 100)
|
||||
useprepad = 3;
|
||||
else if (_int >= 10)
|
||||
else if (int_ >= 10)
|
||||
useprepad = 2;
|
||||
else if (_int >= 0)
|
||||
else if (int_ >= 0)
|
||||
useprepad = 1;
|
||||
else if (_int <= -1000)
|
||||
else if (int_ <= -1000)
|
||||
useprepad = 5;
|
||||
else if (_int <= -100)
|
||||
else if (int_ <= -100)
|
||||
useprepad = 4;
|
||||
else if (_int <= -10)
|
||||
else if (int_ <= -10)
|
||||
useprepad = 3;
|
||||
else
|
||||
useprepad = 2;
|
||||
|
@ -186,10 +187,10 @@ Con_Printf("add %i chars\n", useprepad);
|
|||
Con_Printf("%i bytes left\n", maxlen);
|
||||
*/
|
||||
}
|
||||
if (_int < 0)
|
||||
if (int_ < 0)
|
||||
{
|
||||
sign = '-';
|
||||
_int *= -1;
|
||||
int_ *= -1;
|
||||
}
|
||||
else if (plus)
|
||||
sign = '+';
|
||||
|
@ -197,10 +198,10 @@ Con_Printf("%i bytes left\n", maxlen);
|
|||
sign = 0;
|
||||
i = sizeof(tempbuffer)-2;
|
||||
tempbuffer[sizeof(tempbuffer)-1] = '\0';
|
||||
while(_int)
|
||||
while(int_)
|
||||
{
|
||||
tempbuffer[i--] = _int%10 + '0';
|
||||
_int/=10;
|
||||
tempbuffer[i--] = int_%10 + '0';
|
||||
int_/=10;
|
||||
}
|
||||
if (sign)
|
||||
tempbuffer[i--] = sign;
|
||||
|
@ -242,29 +243,29 @@ Con_Printf("%i bytes left\n", maxlen);
|
|||
tokens++;
|
||||
break;
|
||||
case 'f':
|
||||
_float = (float)va_arg(vargs, double);
|
||||
float_ = (float)va_arg(vargs, double);
|
||||
|
||||
//integer part.
|
||||
_int = (int)_float;
|
||||
if (_int < 0)
|
||||
int_ = (int)float_;
|
||||
if (int_ < 0)
|
||||
{
|
||||
if (maxlen-- == 0)
|
||||
{*buffer++='\0';return tokens;}
|
||||
*buffer++ = '-';
|
||||
_int *= -1;
|
||||
int_ *= -1;
|
||||
}
|
||||
i = sizeof(tempbuffer)-2;
|
||||
tempbuffer[sizeof(tempbuffer)-1] = '\0';
|
||||
if (!_int)
|
||||
if (!int_)
|
||||
{
|
||||
tempbuffer[i--] = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
while(_int)
|
||||
while(int_)
|
||||
{
|
||||
tempbuffer[i--] = _int%10 + '0';
|
||||
_int/=10;
|
||||
tempbuffer[i--] = int_%10 + '0';
|
||||
int_/=10;
|
||||
}
|
||||
}
|
||||
string = tempbuffer+i+1;
|
||||
|
@ -275,21 +276,21 @@ Con_Printf("%i bytes left\n", maxlen);
|
|||
*buffer++ = *string++;
|
||||
}
|
||||
|
||||
_int = sizeof(tempbuffer)-2-i;
|
||||
int_ = sizeof(tempbuffer)-2-i;
|
||||
|
||||
//floating point part.
|
||||
_float -= (int)_float;
|
||||
float_ -= (int)float_;
|
||||
i = 0;
|
||||
tempbuffer[i++] = '.';
|
||||
if (precision < 0)
|
||||
precision = 7;
|
||||
while(_float - (int)_float)
|
||||
while(float_ - (int)float_)
|
||||
{
|
||||
if (i > precision) //remove the excess presision.
|
||||
break;
|
||||
|
||||
_float*=10;
|
||||
tempbuffer[i++] = (int)_float%10 + '0';
|
||||
float_*=10;
|
||||
tempbuffer[i++] = (int)float_%10 + '0';
|
||||
}
|
||||
if (i == 1) //no actual fractional part
|
||||
{
|
||||
|
@ -310,12 +311,12 @@ Con_Printf("%i bytes left\n", maxlen);
|
|||
tokens++;
|
||||
break;
|
||||
default:
|
||||
string = "ERROR IN FORMAT";
|
||||
while (*string)
|
||||
string_ = "ERROR IN FORMAT";
|
||||
while (*string_)
|
||||
{
|
||||
if (maxlen-- == 0)
|
||||
{*buffer++='\0';return tokens;}
|
||||
*buffer++ = *string++;
|
||||
*buffer++ = *string_++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -635,7 +636,7 @@ char *Plug_Info_ValueForKey (const char *s, const char *key, char *out, size_t o
|
|||
isvalue = !isvalue;
|
||||
if (isvalue)
|
||||
{
|
||||
if (strlen(key) == s - start && !strncmp(start, key, s - start))
|
||||
if (strlen(key) == (size_t)(s - start) && !strncmp(start, key, s - start))
|
||||
{
|
||||
s++;
|
||||
while (outsize --> 1)
|
||||
|
|
Loading…
Reference in a new issue