Skip to content

Commit

Permalink
Fixed crash from too many csqc entities (reported by shpuld)
Browse files Browse the repository at this point in the history
Added .psd, .pbm/.pgm/.ppm, .pfm, and .hdr image formats. Extensions NOT added to r_imageextensions.
png (and the above formats) can now be loaded as RGBA16, instead of being truncated to RGBA8 (8bit pngs not affected).
r_imagelist will now show images from memory, instead of potentially loading new/different ones from disk.
Fix serverbrowser bug being too eager to join the server (eg from alt+tab).
Don't send ipv6 packets to qw/q2 masters. They won't be able to report ipv6 addresses anyway, and this reduces warnings when a host STILL has no ipv6 (my ISP sucks). this does not affect q3/dpmasters, for people without ipv4 addresses.
Tried to improve compat with Bloodshot's particle effects.
Fixed a couple of issues with R_AddTrisoup.
Fixed string tokenizing bug where it was using the wrong buffer size values.
Don't show link-local/localhost addresses in eg the status command (unless developer).
qtv-rel is now an easier target, for new qtv releases.
qtv warning fixes.
added a nailtrail effect to 'high' particles.
fixed terrain shaders.
fixed fogged water issue (on one of bal's maps).
first attempt at gltf2 format support



git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5400 fc73d0e0-1445-4013-8a0c-d673dee63da5
  • Loading branch information
Spoike committed Feb 16, 2019
1 parent 9548e23 commit fa0c73d
Show file tree
Hide file tree
Showing 82 changed files with 5,820 additions and 1,078 deletions.
54 changes: 52 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
#might as well do this, public builds use the regular Makefile.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-pointer-sign -Wno-unknown-pragmas -Wno-format-zero-length -Wno-strict-aliasing")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wcast-align -Werror -Wno-pointer-sign -Wno-unknown-pragmas -Wno-format-zero-length -Wno-strict-aliasing -Wno-error=cpp")
ELSE()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
ENDIF()
Expand Down Expand Up @@ -740,6 +740,31 @@ ELSE()
)
SET_TARGET_PROPERTIES(iqmtool PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}")

ADD_EXECUTABLE(qtv
fteqtv/netchan.c
fteqtv/parse.c
fteqtv/msg.c
fteqtv/qw.c
fteqtv/source.c
fteqtv/bsp.c
fteqtv/rcon.c
fteqtv/mdfour.c
fteqtv/crc.c
fteqtv/control.c
fteqtv/forward.c
fteqtv/pmove.c
fteqtv/menu.c
fteqtv/httpsv.c
fteqtv/libqtvc/glibc_sucks.c
engine/common/sha1.c
)
SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON};stricmp=strcasecmp;strnicmp=strncasecmp")
IF(WIN32)
TARGET_LINK_LIBRARIES(qtv ${ZLIB_LIBRARIES} ws2_32 winmm)
ELSE()
TARGET_LINK_LIBRARIES(qtv m)
ENDIF()

IF(NOT WIN32)
ADD_EXECUTABLE(ftemaster
${FTESV_ARCH_FILES}
Expand Down Expand Up @@ -785,7 +810,6 @@ ELSE()
SET_TARGET_PROPERTIES(fteqcc PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES};${FTE_REVISON}")
TARGET_LINK_LIBRARIES(fteqcc ${ZLIB_LIBRARIES} m)


IF(${WIN32})
ADD_EXECUTABLE(fteqccgui WIN32
engine/qclib/qccgui.c
Expand Down Expand Up @@ -882,6 +906,32 @@ SET_TARGET_PROPERTIES(irc PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(irc PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(irc m)

#model formats plugin
ADD_LIBRARY(models MODULE
plugins/qvm_api.c
plugins/plugin.c
plugins/models/models.c
plugins/models/gltf.c
)
SET_TARGET_PROPERTIES(models PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(models PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(models PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(models m)

#x11 formats plugin
ADD_LIBRARY(x11 MODULE
plugins/qvm_api.c
plugins/plugin.c
plugins/xsv/m_x.c
plugins/xsv/x_reqs.c
plugins/xsv/x_res.c
engine/qclib/hash.c
)
SET_TARGET_PROPERTIES(x11 PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(x11 PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(x11 PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(x11 m)

#ffmpeg client plugin. no proper way to detect dependancies right now, so I've gotta try the manual way.
FIND_PATH(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h)
FIND_PATH(AVFORMAT_INCLUDE_DIR libavformat/avformat.h)
Expand Down
54 changes: 41 additions & 13 deletions engine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,14 @@ ifeq ($(FTE_TARGET),vc)
WARNINGFLAGS=-W3 -D_CRT_SECURE_NO_WARNINGS
GNUC_FUNCS=
else
WARNINGFLAGS=-Wall -Wno-pointer-sign -Wno-unknown-pragmas -Wno-format-zero-length -Wno-strict-aliasing
WARNINGFLAGS=-Wall -Wno-pointer-sign -Wno-unknown-pragmas -Wno-format-zero-length -Wno-strict-aliasing -Wcast-align
GNUC_FUNCS= -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp
endif

SDL_INCLUDES=
#-I$(LIBS_DIR)/sdl/include -I/usr/include/SDL -I$(LIBS_DIR)/sdl/include/SDL
BASE_CFLAGS=$(WARNINGFLAGS) $(GNUC_FUNCS) -I$(CLIENT_DIR) -I$(SERVER_DIR) -I$(COMMON_DIR) -I$(GL_DIR) -I$(D3D_DIR) -I$(PROGS_DIR) -I. -I$(LIBS_DIR) -I$(LIBS_DIR)/dxsdk9/include -I$(LIBS_DIR)/dxsdk7/include $(SDL_INCLUDES) -I./libs/freetype2/include -I./libs/freetype2/include/freetype $(BOTLIB_CFLAGS) $(SVNREVISION)
BASE_INCLUDES=-I$(CLIENT_DIR) -I$(SERVER_DIR) -I$(COMMON_DIR) -I$(GL_DIR) -I$(D3D_DIR) -I$(PROGS_DIR) -I. -I$(LIBS_DIR)
BASE_CFLAGS=$(WARNINGFLAGS) $(GNUC_FUNCS) $(BASE_INCLUDES) -I$(LIBS_DIR)/dxsdk9/include -I$(LIBS_DIR)/dxsdk7/include $(SDL_INCLUDES) -I./libs/freetype2/include -I./libs/freetype2/include/freetype $(BOTLIB_CFLAGS) $(SVNREVISION)
CLIENT_ONLY_CFLAGS=-DCLIENTONLY
SERVER_ONLY_CFLAGS=-DSERVERONLY
JOINT_CFLAGS=
Expand Down Expand Up @@ -1263,6 +1264,8 @@ ifeq (win,$(findstring win,$(FTE_TARGET))$(findstring _SDL,$(FTE_TARGET)))
BASELDFLAGS+=-lcomctl32
EXEPOSTFIX=.exe

QTV_LDFLAGS=-lws2_32 -lwinmm

LIBS_DIR = $(BASE_DIR)/libs
SV_EXE_NAME=../$(EXE_NAME)sv$(BITS)$(EXEPOSTFIX)
SV_LDFLAGS=$(MINGW_LIBS_DIR)/libz.a -lws2_32 -lwinmm
Expand Down Expand Up @@ -2233,21 +2236,46 @@ libs-$(ARCH)/libBulletDynamics.a:
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)
$(CC) -o $(RELEASE_DIR)/httpserver$(BITS) -Icommon -Iclient -Iqclib -Igl -Iserver -DWEBSERVER -DWEBSVONLY -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_PNG $(HTTP_OBJECTS)
httpserver: $(RELEASE_DIR)/httpserver$(BITS)
$(RELEASE_DIR)/httpserver$(BITS)$(EXEPOSTFIX): $(HTTP_OBJECTS)
$(CC) -o $@ -Icommon -Iclient -Iqclib -Igl -Iserver -DWEBSERVER -DWEBSVONLY -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_PNG $(HTTP_OBJECTS)
httpserver: $(RELEASE_DIR)/httpserver$(BITS)$(EXEPOSTFIX)

IQM_OBJECTS=../iqm/iqm.cpp
$(RELEASE_DIR)/iqm$(BITS): $(IQM_OBJECTS)
$(CC) -o $(RELEASE_DIR)/iqm$(BITS) $(IQM_OBJECTS) -lstdc++ -lm
iqm: $(RELEASE_DIR)/iqm$(BITS)
$(RELEASE_DIR)/iqm$(BITS)$(EXEPOSTFIX): $(IQM_OBJECTS)
$(CC) -o $@ $(IQM_OBJECTS) -lstdc++ -lm
iqm-rel: $(RELEASE_DIR)/iqm$(BITS)$(EXEPOSTFIX)
iqm: iqm-rel

MASTER_OBJECTS=server/sv_sys_unix.c common/sys_linux_threads.c common/net_ssl_gnutls.c server/sv_master.c common/net_wins.c common/cvar.c common/cmd.c common/sha1.c http/httpclient.c common/log.c common/fs.c common/fs_stdio.c common/common.c common/translate.c common/zone.c qclib/hash.c
$(RELEASE_DIR)/ftemaster$(BITS): $(MASTER_OBJECTS)
$(CC) -o $(RELEASE_DIR)/master$(BITS) $(MASTER_OBJECTS) -Icommon -Iclient -Iqclib -Igl -Iserver -DMASTERONLY -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -lm -ldl
master: $(RELEASE_DIR)/ftemaster$(BITS)

utils: httpserver iqm master
$(RELEASE_DIR)/ftemaster$(BITS)$(EXEPOSTFIX): $(MASTER_OBJECTS)
$(CC) -o $@ $(MASTER_OBJECTS) -Icommon -Iclient -Iqclib -Igl -Iserver -DMASTERONLY -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -lm -ldl
master-rel: $(RELEASE_DIR)/ftemaster$(BITS)$(EXEPOSTFIX)
master: master-rel

QTV_OBJECTS= \
netchan.c \
parse.c \
msg.c \
qw.c \
source.c \
bsp.c \
rcon.c \
mdfour.c \
crc.c \
control.c \
forward.c \
pmove.c \
menu.c \
httpsv.c \
sha1.c \
libqtvc/glibc_sucks.c
$(RELEASE_DIR)/qtv$(BITS)$(EXEPOSTFIX): $(QTV_OBJECTS)
$(CC) -o $@ $? -lstdc++ -lm $(BASE_INCLUDES) $(QTV_LDFLAGS)
qtv-rel:
$(MAKE) $(RELEASE_DIR)/qtv$(BITS)$(EXEPOSTFIX) VPATH="$(BASE_DIR)/../fteqtv:$(VPATH)"
qtv: qtv-rel

utils: httpserver iqm master qtv-rel

prefix ?= /usr/local
exec_prefix ?= $(prefix)
Expand Down
4 changes: 3 additions & 1 deletion engine/client/cl_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -3894,7 +3894,9 @@ void CL_LinkPacketEntities (void)
int trailef, trailidx;
int modelflags;
struct itemtimer_s *timer, **timerlink;
float timestep = host_frametime;
float timestep = cl.time-cl.lastlinktime;
cl.lastlinktime = cl.time;
timestep = bound(0, timestep, 0.1);

pack = cl.currentpackentities;
if (!pack)
Expand Down
2 changes: 1 addition & 1 deletion engine/client/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -8304,7 +8304,7 @@ struct sortedsvcs_s
const char *name;
size_t bytes;
};
static QDECL int sorttraffic(const void *l, const void *r)
static int QDECL sorttraffic(const void *l, const void *r)
{
const struct sortedsvcs_s *a=l, *b=r;

Expand Down
1 change: 1 addition & 0 deletions engine/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ typedef struct
double time; // this is the time value that the client
// is rendering at. always <= realtime
double lasttime; //cl.time from last frame.
double lastlinktime; //cl.time from last frame.

float servertime; //current server time, bound between gametime and gametimemark
float mtime; //server time as on the server when we last received a packet. not allowed to decrease.
Expand Down
9 changes: 9 additions & 0 deletions engine/client/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,15 @@ void Con_DrawConsole (int lines, qboolean noback)
if ((buf = FS_LoadMallocFile (key, &fsize)))
Image_LoadTextureFromMemory(shader->defaulttextures->base, shader->defaulttextures->base->flags|IF_NOWORKER, key, key, buf, fsize);
}
}
key = Info_ValueForKey(info, "tipimgptr");
if (*key)
{
shader = R2D_SafeCachePic("tiprawimg");
shader->defaulttextures->base = Image_TextureIsValid(strtoull(key, NULL, 0));
}
if (shader && shader->defaulttextures->base)
{
shader->width = shader->defaulttextures->base->width;
shader->height = shader->defaulttextures->base->height;
if (shader->width > 320)
Expand Down
Loading

0 comments on commit fa0c73d

Please sign in to comment.