Skip to content

Commit

Permalink
Merge branch 'master' into joyfix
Browse files Browse the repository at this point in the history
  • Loading branch information
eukara committed Apr 17, 2023
2 parents 1fda671 + 96dd67b commit 73a71a2
Show file tree
Hide file tree
Showing 152 changed files with 7,064 additions and 2,565 deletions.
33 changes: 22 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ SET(FTE_BUILD_CONFIG ${CMAKE_HOME_DIRECTORY}/engine/common/config_fteqw.h CACHE
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};CONFIG_FILE_NAME=${FTE_BUILD_CONFIG})
SET(FTE_USE_SDL false CACHE BOOL "Force the use of SDL instead of using native builds.")

INCLUDE(GNUInstallDirs)
SET(FTE_INSTALL_BINDIR games CACHE STRING "Binary dir to install to.")
SET(FTE_INSTALL_LIBDIR fteqw CACHE STRING "Binary dir to install to.")

IF(NOT WIN32)
SET(SYS_LIBS ${SYS_LIBS} m)
ELSE()
Expand Down Expand Up @@ -131,8 +135,12 @@ ELSE()
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_OPENGL)
ENDIF()

FIND_PACKAGE(JPEG)
SET(FTE_DEP_JPEG true CACHE BOOL "Link against libjpeg.")
IF(FTE_DEP_JPEG)
FIND_PACKAGE(JPEG)
ENDIF()
IF(JPEG_FOUND)
INCLUDE_DIRECTORIES( ${JPEG_INCLUDE_DIRS} )
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};LIBJPEG_STATIC)
SET(FTE_LIBS ${FTE_LIBS} ${JPEG_LIBRARIES})
ELSE()
Expand All @@ -142,6 +150,7 @@ ENDIF()

FIND_PACKAGE(PNG)
IF(PNG_FOUND)
INCLUDE_DIRECTORIES( ${PNG_INCLUDE_DIRS} )
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};LIBPNG_STATIC)
SET(FTE_LIBS ${FTE_LIBS} ${PNG_LIBRARIES})
ELSE()
Expand Down Expand Up @@ -169,6 +178,7 @@ ENDIF()

FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile)
IF(NOT VORBISFILE_LIBRARY)
INCLUDE_DIRECTORIES( ${VORBISFILE_INCLUDE_DIRS} )
MESSAGE(WARNING "libvorbisfile library NOT available. Who listens to the bgm anyway?")
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_OGG)
ENDIF()
Expand Down Expand Up @@ -215,11 +225,13 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
ENDIF()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFTE_LIBRARY_PATH=${CMAKE_INSTALL_FULL_LIBDIR}/${FTE_INSTALL_LIBDIR}")

FUNCTION(EMBED_PLUGIN_META PLUGNAME PLUGTITLE PLUGDESC)
SET_TARGET_PROPERTIES(plug_${PLUGNAME} PROPERTIES OUTPUT_NAME "${PLUGNAME}")
SET_TARGET_PROPERTIES(plug_${PLUGNAME} PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(plug_${PLUGNAME} PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
SET(INSTALLTARGS ${INSTALLTARGS} "plug_${PLUGNAME}")
SET(INSTALLTARGS ${INSTALLTARGS} "plug_${PLUGNAME}" PARENT_SCOPE)
#sadly we need to use a temp zip file, because otherwise zip insists on using zip64 extensions which breaks zip -A (as well as any attempts to read any files).
ADD_CUSTOM_COMMAND(
TARGET plug_${PLUGNAME} POST_BUILD
Expand Down Expand Up @@ -1020,6 +1032,7 @@ ELSE()
engine/common/cvar.c
engine/common/cmd.c
engine/common/sha1.c #for websockets
engine/common/sha2.c #for fingerprints
engine/http/httpclient.c #for the pipe stuff
engine/common/log.c
engine/common/fs.c
Expand Down Expand Up @@ -1157,8 +1170,7 @@ SET(FTE_PLUG_QI true CACHE BOOL "Compile Quake-Injnector plugin.")
IF(FTE_PLUG_QI)
ADD_LIBRARY(plug_qi MODULE
plugins/plugin.c
plugins/qi/qi.c
plugins/emailnot/md5.c
plugins/qi/qi.c
plugins/jabber/xml.c
)
SET_TARGET_PROPERTIES(plug_qi PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
Expand Down Expand Up @@ -1241,11 +1253,7 @@ IF(FTE_PLUG_NAMEMAKER)
plugins/namemaker/namemaker.c
)
SET_TARGET_PROPERTIES(plug_namemaker PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(plug_namemaker PROPERTIES OUTPUT_NAME "namemaker")
SET_TARGET_PROPERTIES(plug_namemaker PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(plug_namemaker PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(plug_namemaker ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} plug_namemaker)

EMBED_PLUGIN_META(namemaker "Name Maker Plugin" "Provides a lame UI for selecting arbitrary non-ascii glyphs as part of your nickname.")
ENDIF()
Expand Down Expand Up @@ -1525,13 +1533,16 @@ IF(FTE_PLUG_XMPP)
ENDIF()
ENDIF() #android

INCLUDE(GNUInstallDirs)
SET(FTE_INSTALL_BINDIR games CACHE STRING "Binary dir to install to.")
INSTALL(TARGETS ${INSTALLTARGS}
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${FTE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/${FTE_INSTALL_LIBDIR}"
)

INSTALL(FILES
fteqw.desktop
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications/")


SET(FTE_MENU_SYS true CACHE BOOL "Compile System Menu.")
IF(FTE_MENU_SYS)
ADD_CUSTOM_TARGET(menusys ALL
Expand Down
23 changes: 19 additions & 4 deletions engine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ MAKE:=$(MAKE) --no-print-directory SVNREVISION="$(SVNREVISION)" SVN_VERSION="$(S
#update these to download+build a different version. this assumes that the url+subdirs etc contain a consistant version everywhere.
JPEGVER=9c
ZLIBVER=1.2.13
PNGVER=1.6.37
PNGVER=1.6.39
OGGVER=1.3.4
VORBISVER=1.3.6
SDL2VER=2.0.10
SDL2VER=2.26.4
SCINTILLAVER=373
OPUSVER=1.3.1
SPEEXVER=1.2.0
Expand Down Expand Up @@ -1044,6 +1044,14 @@ endif
ifeq (1,$(LINK_ZLIB))
CLIENTLIBFLAGS+=-DZLIB_STATIC
CLIENTLDDEPS+=-lz

#and deflate64, because why not.
ifneq ("$(wildcard $(ARCHLIBS)/infback9.h)","")
CLIENTLIBFLAGS+=-DZLIB_DEFLATE64
CLIENTLDDEPS+=-lz9
QCC_CFLAGS+=-DZLIB_DEFLATE64
QCC_LDFLAGS+=-lz9
endif
endif
ifeq (1,$(LINK_ODE))
ALL_CFLAGS+=$(shell $(PKGCONFIG) ode --cflags --silence-errors) -DODE_STATIC
Expand Down Expand Up @@ -2124,7 +2132,7 @@ m-profile:


_qcc-tmp: $(REQDIR)
@$(MAKE) $(TYPE) EXE_NAME="$(EXE_NAME)$(EXEPOSTFIX)" PRECOMPHEADERS="" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS) $(QCC_LDFLAGS)" OBJS="QCC_OBJS SOBJS"
@$(MAKE) $(TYPE) EXE_NAME="$(EXE_NAME)$(EXEPOSTFIX)" PRECOMPHEADERS="" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(QCC_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS) $(QCC_LDFLAGS)" OBJS="QCC_OBJS SOBJS"
qcc-rel:
@$(MAKE) _qcc-tmp TYPE=_out-rel REQDIR=reldir EXE_NAME="../fteqcc$(BITS)" OUT_DIR="$(RELEASE_DIR)/$(NCDIRPREFIX)$(QCC_DIR)" SOBJS="qcctui.o packager.o $(if $(findstring win,$(FTE_TARGET)),fteqcc.o)"
qccgui-rel:
Expand Down Expand Up @@ -2429,6 +2437,13 @@ libs-$(ARCH)/libz.a libs-$(ARCH)/libz.pc:
test -f zlib-$(ZLIBVER).tar.gz || wget http://zlib.net/zlib-$(ZLIBVER).tar.gz
-test -f libs-$(ARCH)/libz.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../zlib-$(ZLIBVER).tar.gz && cd zlib-$(ZLIBVER) && $(TOOLOVERRIDES) ./configure --static && $(TOOLOVERRIDES) $(MAKE) libz.a CC="$(CC) $(W32_CFLAGS) -fPIC" && cp libz.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libz.a && cp zlib.h zconf.h zutil.h zlib.pc ../ )
endif
libs-$(ARCH)/libz9.a: libs-$(ARCH)/libz.a
(cd libs-$(ARCH)/zlib-$(ZLIBVER) && \
$(CC) -o contrib/infback9/infback9.o -c contrib/infback9/infback9.c -I. && \
$(CC) -o contrib/infback9/inftree9.o -c contrib/infback9/inftree9.c -I. && \
cp contrib/infback9/infback9.h .. && \
$(AR) rcs ../libz9.a contrib/infback9/infback9.o contrib/infback9/inftree9.o)


libs-$(ARCH)/libpng.a libs-$(ARCH)/libpng.pc: libs-$(ARCH)/libz.a libs-$(ARCH)/libz.pc
test -f libpng-$(PNGVER).tar.gz || wget http://prdownloads.sourceforge.net/libpng/libpng-$(PNGVER).tar.gz?download -O libpng-$(PNGVER).tar.gz
Expand Down Expand Up @@ -2465,7 +2480,7 @@ libs-$(ARCH)/libBulletDynamics.a:
ifeq ($(FTE_TARGET),web)
makelibs: libs-$(ARCH)/libz.a $(MAKELIBS)
else
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)
makelibs: libs-$(ARCH)/libjpeg.a libs-$(ARCH)/libz9.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)
endif

HTTP_OBJECTS=http/httpserver.c http/iwebiface.c common/fs_stdio.c http/ftpserver.c
Expand Down
4 changes: 2 additions & 2 deletions engine/client/cl_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -3009,9 +3009,9 @@ void CL_QTVPoll (void)
else if (!strcmp(auth, "SHA1"))
hashfunc = &hash_sha1;
else if (!strcmp(auth, "SHA2_256"))
hashfunc = &hash_sha256;
hashfunc = &hash_sha2_256;
else if (!strcmp(auth, "SHA2_512"))
hashfunc = &hash_sha512;
hashfunc = &hash_sha2_512;
else if (*auth)
Con_Printf("Server requires unsupported auth method: %s\n", auth);

Expand Down
4 changes: 2 additions & 2 deletions engine/client/cl_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,7 @@ void CLQ1_AddShadow(entity_t *ent)
scenetris_t *t;
cl_adddecal_ctx_t ctx;

if (!r_blobshadows || !ent->model || (ent->model->type != mod_alias && ent->model->type != mod_halflife))
if (!r_blobshadows || !ent->model || (ent->model->type != mod_alias && ent->model->type != mod_halflife) || (ent->flags & RF_NOSHADOW))
return;

s = R_RegisterShader("shadowshader", SUF_NONE,
Expand Down Expand Up @@ -3295,7 +3295,7 @@ void CLQ1_AddShadow(entity_t *ent)
}

ctx.t = t;
Vector4Set(ctx.rgbavalue, 0, 0, 0, r_blobshadows);
Vector4Set(ctx.rgbavalue, 0, 0, 0, r_blobshadows*((ent->flags & RF_TRANSLUCENT)?ent->shaderRGBAf[3]:1));
Mod_ClipDecal(cl.worldmodel, shadoworg, ctx.axis[0], ctx.axis[1], ctx.axis[2], radius, 0,0, CL_AddDecal_Callback, &ctx);
if (!t->numidx)
cl_numstris--;
Expand Down
11 changes: 7 additions & 4 deletions engine/client/cl_ignore.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,13 @@ static void Ignoreteam_f(void)
}
if (j == MAX_TEAMIGNORELIST)
Con_Printf("You cannot ignore more than %d teams\n", MAX_TEAMIGNORELIST);
Q_strncpyz(ignoreteamlist[j], arg, sizeof(ignoreteamlist[j]));
if (j + 1 < MAX_TEAMIGNORELIST)
ignoreteamlist[j + 1][0] = 0;
Con_Printf("Added team %s to ignore list\n", arg);
else
{
Q_strncpyz(ignoreteamlist[j], arg, sizeof(ignoreteamlist[j]));
if (j + 1 < MAX_TEAMIGNORELIST)
ignoreteamlist[j + 1][0] = 0;
Con_Printf("Added team %s to ignore list\n", arg);
}
return;
}
}
Expand Down
11 changes: 10 additions & 1 deletion engine/client/cl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cvar_t cl_c2sdupe = CVARD("cl_c2sdupe", "0", "Send duplicate copies of packets t
cvar_t cl_c2spps = CVARD("cl_c2spps", "0", "Reduces outgoing packet rates by dropping up to a third of outgoing packets.");
cvar_t cl_c2sImpulseBackup = CVARD("cl_c2sImpulseBackup","3", "Prevents the cl_c2spps setting from dropping redundant packets that contain impulses, in an attempt to keep impulses more reliable.");
static cvar_t cl_c2sMaxRedundancy = CVARD("cl_c2sMaxRedundancy","5", "This is the maximum number of input frames to send in each input packet. Values greater than 1 provide redundancy and avoid prediction misses, though you might find cl_c2sdupe provides equivelent result and at lower latency. It is locked at 3 for vanilla quakeworld, and locked at 1 for vanilla netquake.");
cvar_t cl_netfps = CVARD("cl_netfps", "150", "Send up to this many packets to the server per second. The rate used is also limited by the server which usually forces a cap to this setting of 77. Low packet rates can result in extra extrapolation to try to hide the resulting latencies.");
cvar_t cl_netfps = CVARFD("cl_netfps", "150", CVAR_ARCHIVE, "Send up to this many packets to the server per second. The rate used is also limited by the server which usually forces a cap to this setting of 77. Low packet rates can result in extra extrapolation to try to hide the resulting latencies.");
cvar_t cl_queueimpulses = CVARD("cl_queueimpulses", "0", "Queues unsent impulses instead of replacing them. This avoids the need for extra wait commands (and the timing issues of such commands), but potentially increases latency and can cause scripts to be desynced with regard to buttons and impulses.");
cvar_t cl_smartjump = CVARD("cl_smartjump", "1", "Makes the jump button act as +moveup when in water. This is typically quieter and faster.");
cvar_t cl_iDrive = CVARFD("cl_iDrive", "1", CVAR_SEMICHEAT, "Effectively releases movement keys when the opposing key is pressed. This avoids dead-time when both keys are pressed. This can be emulated with various scripts, but that's messy.");
Expand Down Expand Up @@ -1393,6 +1393,9 @@ void CL_ClampPitch (int pnum, float frametime)
VectorAngles(view[0], view[2], pv->viewangles, false);
VectorClear(pv->viewanglechange);

//fixme: in_vraim stuff
VectorCopy(pv->viewangles, pv->aimangles);

return;
}
#if 1
Expand Down Expand Up @@ -1450,7 +1453,10 @@ void CL_ClampPitch (int pnum, float frametime)
if (!vang[ROLL])
{
if (!pv->viewanglechange[PITCH] && !pv->viewanglechange[YAW] && !pv->viewanglechange[ROLL])
{
VectorCopy(pv->viewangles, pv->aimangles);
return;
}
}
else
{
Expand Down Expand Up @@ -1490,6 +1496,9 @@ void CL_ClampPitch (int pnum, float frametime)
pv->viewangles[ROLL] += 360;
if (pv->viewangles[PITCH] < -180)
pv->viewangles[PITCH] += 360;

//fixme: in_vraim stuff
VectorCopy(pv->viewangles, pv->aimangles);
return;
}
#endif
Expand Down
Loading

0 comments on commit 73a71a2

Please sign in to comment.