Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be3e5a964d | ||
|
|
83d20a72ab | ||
|
|
e47e58a982 | ||
|
|
c05068f22f | ||
|
|
f5cb473f3d | ||
|
|
c5b72f24b5 | ||
|
|
7c34733eea | ||
|
|
393ade780c | ||
|
|
8b2e6ea17b | ||
|
|
8c31682723 | ||
|
|
7c87b5259a |
No files matched your search
+8
-7
@@ -13,16 +13,17 @@ Win32_LIB_ASM_Release
|
|||||||
*.dgb
|
*.dgb
|
||||||
*.debug
|
*.debug
|
||||||
*.debug.txt
|
*.debug.txt
|
||||||
/bin/VC10/
|
|
||||||
/objs/VC10/
|
|
||||||
*.user
|
*.user
|
||||||
*.db
|
*.db
|
||||||
*.opendb
|
*.opendb
|
||||||
/.vs
|
/.vs
|
||||||
/debian
|
/debian
|
||||||
/assets/debian
|
/assets/debian
|
||||||
compile.sh
|
/make
|
||||||
*.gz
|
/bin
|
||||||
.vscode/
|
/build
|
||||||
out
|
/build/*
|
||||||
build
|
/CMakeUserPresets.json
|
||||||
|
/out
|
||||||
|
/objs/VC10
|
||||||
|
*.kate-swp
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/lsdlsrb2
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/lsdlsrb2
|
|
||||||
/pnd
|
|
||||||
/*.mo
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/lsdlsrb2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/lsdl2srb2kart
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
*.exe
|
|
||||||
*.mo
|
|
||||||
r_opengl.dll
|
|
||||||
*.bat
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
*.exe
|
|
||||||
*.mo
|
|
||||||
r_opengl.dll
|
|
||||||
*.bat
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/srb2sdl.exe
|
|
||||||
/srb2win.exe
|
|
||||||
/r_opengl.dll
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
*.exe
|
|
||||||
*.mo
|
|
||||||
r_opengl.dll
|
|
||||||
*.bat
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#All folders
|
|
||||||
SRB2.res
|
|
||||||
depend.dep
|
|
||||||
depend.ped
|
|
||||||
*.o
|
|
||||||
#VC9 folder only
|
|
||||||
/VC9/Win32
|
|
||||||
/VC9/x64
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# DON'T REMOVE
|
|
||||||
# This keeps the folder from disappearing
|
|
||||||
+13
-1
@@ -228,6 +228,14 @@ set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
|||||||
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
||||||
set(SRB2_CONFIG_USE_FBO_OGL ON CACHE BOOL
|
set(SRB2_CONFIG_USE_FBO_OGL ON CACHE BOOL
|
||||||
"Enable OpenGL FBO Downsampling support.")
|
"Enable OpenGL FBO Downsampling support.")
|
||||||
|
set(SRB2_CONFIG_DEDICATED OFF CACHE BOOL
|
||||||
|
"Build a dedicated server.")
|
||||||
|
|
||||||
|
if(${SRB2_CONFIG_DEDICATED})
|
||||||
|
set(SRB2_CONFIG_HAVE_GME NO)
|
||||||
|
set(SRB2_CONFIG_HAVE_OPENMPT NO)
|
||||||
|
set(SRB2_CONFIG_HWRENDER NO)
|
||||||
|
endif()
|
||||||
|
|
||||||
### use internal libraries?
|
### use internal libraries?
|
||||||
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
||||||
@@ -554,7 +562,11 @@ add_definitions(-DCMAKECONFIG)
|
|||||||
# ${SRB2_BLUA_HEADERS}
|
# ${SRB2_BLUA_HEADERS}
|
||||||
#)
|
#)
|
||||||
|
|
||||||
add_subdirectory(sdl)
|
if(${SRB2_CONFIG_DEDICATED})
|
||||||
|
add_subdirectory(dedicated)
|
||||||
|
else()
|
||||||
|
add_subdirectory(sdl)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT ${SRB2_SDL2_AVAILABLE} AND NOT ${SRB2_WIN32_AVAILABLE})
|
if(NOT ${SRB2_SDL2_AVAILABLE} AND NOT ${SRB2_WIN32_AVAILABLE})
|
||||||
message(FATAL_ERROR "There are no targets available to build an SRB2Kart executable. :(")
|
message(FATAL_ERROR "There are no targets available to build an SRB2Kart executable. :(")
|
||||||
|
|||||||
+357
-710
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,21 @@
|
|||||||
|
makedir:=$(makedir)/Dedicated
|
||||||
|
|
||||||
|
sources+=$(call List,dedicated/Sourcefile)
|
||||||
|
|
||||||
|
opts+=-DDEDICATED
|
||||||
|
|
||||||
|
libs+=-lpthread
|
||||||
|
|
||||||
|
ifdef MINGW
|
||||||
|
libs+=-mconsole
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOTHREADS
|
||||||
|
opts+=-DHAVE_THREADS
|
||||||
|
sources+=dedicated/i_threads.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
NOOPENMPT=1
|
||||||
|
NOGME=1
|
||||||
|
NOHW=1
|
||||||
|
NOUPNP=1
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
#
|
||||||
|
# Detect the host system and compiler version.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Previously featured:\
|
||||||
|
PANDORA\
|
||||||
|
DUMMY\
|
||||||
|
DJGPPDOS\
|
||||||
|
SOLARIS\
|
||||||
|
MACOSX\
|
||||||
|
|
||||||
|
all_systems:=\
|
||||||
|
LINUX64\
|
||||||
|
MINGW64\
|
||||||
|
MINGW\
|
||||||
|
UNIX\
|
||||||
|
LINUX\
|
||||||
|
FREEBSD\
|
||||||
|
HAIKU\
|
||||||
|
|
||||||
|
# check for user specified system
|
||||||
|
ifeq (,$(filter $(all_systems),$(.VARIABLES)))
|
||||||
|
ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
|
||||||
|
|
||||||
|
ifeq ($(shell uname -s | grep -o MINGW64),MINGW64) # 64-bit MinGW
|
||||||
|
_m=Detected a Windows system,\
|
||||||
|
compiling for 64-bit MinGW SDL...)
|
||||||
|
$(call Print,$(_m))
|
||||||
|
MINGW64=1
|
||||||
|
else # 32-bit MinGW
|
||||||
|
_m=Detected a Windows system,\
|
||||||
|
compiling for 32-bit MinGW SDL...)
|
||||||
|
$(call Print,$(_m))
|
||||||
|
MINGW=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
NOOBJDUMP=1
|
||||||
|
else # if you on the *nix
|
||||||
|
|
||||||
|
system:=$(shell uname -s)
|
||||||
|
|
||||||
|
ifeq ($(system),Linux)
|
||||||
|
new_system:=LINUX
|
||||||
|
else ifeq ($(system),Haiku)
|
||||||
|
new_system:=HAIKU
|
||||||
|
else
|
||||||
|
|
||||||
|
$(error \
|
||||||
|
Could not automatically detect your system,\
|
||||||
|
try specifying a system manually)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(shell getconf LONG_BIT),64)
|
||||||
|
system+=64-bit
|
||||||
|
new_system:=$(new_system)64
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(call Print,Detected $(system) ($(new_system))...)
|
||||||
|
$(new_system):=1
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# This must have high to low order.
|
||||||
|
gcc_versions:=\
|
||||||
|
151 150 15\
|
||||||
|
142 141 140 14\
|
||||||
|
132 131 130 13\
|
||||||
|
123 122 121 120 12\
|
||||||
|
114 113 112 111 110 11\
|
||||||
|
105 104 103 102 101 100 10\
|
||||||
|
95 94 93 92 91 90\
|
||||||
|
85 84 83 82 81 80\
|
||||||
|
75 74 73 72 71 70\
|
||||||
|
64 63 62 61 60\
|
||||||
|
55 54 53 52 51 50\
|
||||||
|
49 48 47 46 45 44 43 42 41 40
|
||||||
|
|
||||||
|
latest_gcc_version:=15.1.1
|
||||||
|
|
||||||
|
# Automatically set version flag, but not if one was
|
||||||
|
# manually set. And don't bother if this is a clean only
|
||||||
|
# run.
|
||||||
|
ifeq (,$(call Wildvar,GCC% destructive))
|
||||||
|
|
||||||
|
# can't use $(CC) --version here since that uses argv[0] to display the name
|
||||||
|
# also gcc outputs the information to stderr, so I had to do 2>&1
|
||||||
|
# this program really doesn't like identifying itself
|
||||||
|
shellversion:=$(shell $(CC) -v 2>&1)
|
||||||
|
# Try to remove "-win32"
|
||||||
|
version:=$(subst -win32,.0,$(shellversion))
|
||||||
|
|
||||||
|
# check if this is in fact GCC
|
||||||
|
ifneq (,$(findstring gcc version,$(version)))
|
||||||
|
|
||||||
|
# in stark contrast to the name, gcc will give me a nicely formatted version number for free
|
||||||
|
shellversion:=$(shell $(CC) -dumpfullversion)
|
||||||
|
|
||||||
|
# Try to remove "-win32"
|
||||||
|
version:=$(subst -win32,.0,$(shellversion))
|
||||||
|
|
||||||
|
# Turn version into words of major, minor
|
||||||
|
v:=$(subst ., ,$(version))
|
||||||
|
# concat. major minor
|
||||||
|
v:=$(word 1,$(v))$(word 2,$(v))
|
||||||
|
|
||||||
|
# If this version is not in the list,
|
||||||
|
# default to the latest supported
|
||||||
|
ifeq (,$(filter $(v),$(gcc_versions)))
|
||||||
|
define line =
|
||||||
|
Your compiler version, GCC $(version), \
|
||||||
|
is not supported by the Makefile.
|
||||||
|
The Makefile will assume GCC $(latest_gcc_version).
|
||||||
|
endef
|
||||||
|
$(call Print,$(line))
|
||||||
|
GCC$(subst .,,$(latest_gcc_version)):=1
|
||||||
|
else
|
||||||
|
$(call Print,Detected GCC $(version) (GCC$(v)))
|
||||||
|
GCC$(v):=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
#
|
||||||
|
# Makefile for feature flags.
|
||||||
|
#
|
||||||
|
|
||||||
|
passthru_opts+=\
|
||||||
|
NOHW NOMD5 NOPOSTPROCESSING\
|
||||||
|
MOBJCONSISTANCY PACKETDROP ZDEBUG\
|
||||||
|
HAVE_MINIUPNPC\
|
||||||
|
HAVE_DISCORDRPC DEVELOP\
|
||||||
|
NOBLUAJIT
|
||||||
|
|
||||||
|
# build with debugging information
|
||||||
|
ifdef DEBUGMODE
|
||||||
|
PACKETDROP=1
|
||||||
|
opts+=-DPARANOIA -DRANGECHECK
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
opts+=-DHWRENDER
|
||||||
|
|
||||||
|
ifndef NOSCREENFBO
|
||||||
|
opts+=-DUSE_FBO_OGL
|
||||||
|
endif
|
||||||
|
|
||||||
|
sources+=$(call List,hardware/Sourcefile)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOMD5
|
||||||
|
sources+=md5.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
|
ifndef NOSATURNJOIN
|
||||||
|
opts+=-DDOSATURNJOIN
|
||||||
|
endif
|
||||||
|
ifndef NOSATURNPAK
|
||||||
|
opts+=-DDOSATURNPAK
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOZLIB
|
||||||
|
ifndef NOPNG
|
||||||
|
ifdef PNG_PKGCONFIG
|
||||||
|
$(eval $(call Use_pkg_config,PNG_PKGCONFIG))
|
||||||
|
else
|
||||||
|
PNG_CONFIG?=$(call Prefix,libpng-config)
|
||||||
|
$(eval $(call Configure,PNG,$(PNG_CONFIG) \
|
||||||
|
$(if $(PNG_STATIC),--static),,--ldflags))
|
||||||
|
endif
|
||||||
|
ifdef LINUX
|
||||||
|
opts+=-D_LARGEFILE64_SOURCE
|
||||||
|
endif
|
||||||
|
opts+=-DHAVE_PNG
|
||||||
|
sources+=apng.c
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOCURL
|
||||||
|
CURLCONFIG?=curl-config
|
||||||
|
$(eval $(call Configure,CURL,$(CURLCONFIG)))
|
||||||
|
opts+=-DHAVE_CURL
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef HAVE_MINIUPNPC
|
||||||
|
MINIUPNPC_PKGCONFIG?=miniupnpc
|
||||||
|
$(eval $(call Use_pkg_config,MINIUPNPC))
|
||||||
|
HAVE_MINIUPNPC=1
|
||||||
|
opts+=-DHAVE_MINIUPNPC
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOLIBBACKTRACE
|
||||||
|
$(eval $(call Propogate_flags,LIBBACKTRACE))
|
||||||
|
libs+=-lbacktrace
|
||||||
|
opts+=-DHAVE_LIBBACKTRACE
|
||||||
|
endif
|
||||||
|
|
||||||
|
#windoze hack
|
||||||
|
ifdef MINGW
|
||||||
|
ifndef NODISCORDRPC
|
||||||
|
HAVE_DISCORDRPC=1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef HAVE_DISCORDRPC
|
||||||
|
$(eval $(call Propogate_flags,DISCORDRPC))
|
||||||
|
libs+=-ldiscord-rpc
|
||||||
|
opts+=-DUSE_STUN
|
||||||
|
sources+=discord.c stun.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
# (Valgrind is a memory debugger.)
|
||||||
|
ifdef VALGRIND
|
||||||
|
VALGRIND_PKGCONFIG?=valgrind
|
||||||
|
VALGRIND_LDFLAGS=
|
||||||
|
$(eval $(call Use_pkg_config,VALGRIND))
|
||||||
|
ZDEBUG=1
|
||||||
|
opts+=-DHAVE_VALGRIND
|
||||||
|
endif
|
||||||
|
|
||||||
|
default_packages:=\
|
||||||
|
GME/libgme/LIBGME\
|
||||||
|
OPENMPT/libopenmpt/LIBOPENMPT\
|
||||||
|
ZLIB/zlib\
|
||||||
|
|
||||||
|
$(foreach p,$(default_packages),\
|
||||||
|
$(eval $(call Check_pkg_config,$(p))))
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#
|
||||||
|
# Makefile options for Haiku
|
||||||
|
#
|
||||||
|
|
||||||
|
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
|
||||||
|
|
||||||
|
ifndef DEDICATED
|
||||||
|
ifndef DUMMY
|
||||||
|
SDL?=1
|
||||||
|
DEDICATED?=0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
NOEXECINFO=1
|
||||||
|
|
||||||
|
ifeq (${SDL},1)
|
||||||
|
EXENAME?=srb2haiku
|
||||||
|
else ifeq (${DEDICATED},1)
|
||||||
|
EXENAME?=srb2haikud
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
|
libs+=-lnetwork
|
||||||
|
endif
|
||||||
|
|
||||||
|
define _set =
|
||||||
|
$(1)_CFLAGS?=$($(1)_opts)
|
||||||
|
$(1)_LDFLAGS?=$($(1)_libs)
|
||||||
|
endef
|
||||||
|
|
||||||
|
lib:=../libs/gme
|
||||||
|
LIBGME_opts:=-I$(lib)/include
|
||||||
|
LIBGME_libs:=-l:libgme.so.0
|
||||||
|
$(eval $(call _set,LIBGME))
|
||||||
|
|
||||||
|
lib:=../libs/libopenmpt
|
||||||
|
LIBOPENMPT_opts:=-I$(lib)/inc
|
||||||
|
LIBOPENMPT_libs:=-l:libopenmpt.so.0
|
||||||
|
$(eval $(call _set,LIBOPENMPT))
|
||||||
|
|
||||||
|
ifdef SDL
|
||||||
|
lib:=../libs/SDL2_mixer
|
||||||
|
mixer_opts:=-I$(lib)/include
|
||||||
|
mixer_libs:=-l:libSDL2_mixer-2.0.so.0
|
||||||
|
|
||||||
|
lib:=../libs/SDL2
|
||||||
|
SDL_opts:=-I$(lib)/include $(mixer_opts)
|
||||||
|
SDL_libs:=$(mixer_libs) -l:libSDL2-2.0.so.0
|
||||||
|
$(eval $(call _set,SDL))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/zlib
|
||||||
|
ZLIB_opts:=-I$(lib)
|
||||||
|
ZLIB_libs:=-l:libz.so.1
|
||||||
|
$(eval $(call _set,ZLIB))
|
||||||
|
|
||||||
|
ifndef PNG_CONFIG
|
||||||
|
PNG_opts:=
|
||||||
|
PNG_libs:=-l:libpng16.so.16
|
||||||
|
$(eval $(call _set,PNG))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/curl
|
||||||
|
CURL_opts:=-I$(lib)/include
|
||||||
|
CURL_libs:=-l:libcurl.so.4
|
||||||
|
$(eval $(call _set,CURL))
|
||||||
|
|
||||||
|
lib:=../libs/miniupnpc
|
||||||
|
MINIUPNPC_opts:=-I$(lib)/include
|
||||||
|
MINIUPNPC_libs:=-l:libminiupnpc.so.17
|
||||||
|
$(eval $(call _set,MINIUPNPC))
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#
|
||||||
|
# Makefile options for unices (linux, bsd...)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
|
||||||
|
# Use -rdynamic so a backtrace log shows function names
|
||||||
|
# instead of addresses
|
||||||
|
libs+=-lm -rdynamic
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
opts+=-I/usr/X11R6/include
|
||||||
|
libs+=-L/usr/X11R6/lib
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef DEDICATED
|
||||||
|
SDL?=1
|
||||||
|
DEDICATED?=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq (${SDL},1)
|
||||||
|
EXENAME?=lsdl2srb2kart
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq (${DEDICATED},1)
|
||||||
|
EXENAME?=lsrb2kartd
|
||||||
|
endif
|
||||||
|
|
||||||
|
# In common usage.
|
||||||
|
ifdef LINUX
|
||||||
|
libs+=-lrt
|
||||||
|
passthru_opts+=NOTERMIOS
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Tested by Steel, as of release 2.2.8.
|
||||||
|
ifdef FREEBSD
|
||||||
|
opts+=-I/usr/X11R6/include -DLINUX -DFREEBSD
|
||||||
|
libs+=-L/usr/X11R6/lib -lkvm -lexecinfo
|
||||||
|
endif
|
||||||
|
|
||||||
|
# FIXME: UNTESTED
|
||||||
|
#ifdef SOLARIS
|
||||||
|
#NOIPX=1
|
||||||
|
#opts+=-I/usr/local/include -I/opt/sfw/include \
|
||||||
|
# -DSOLARIS -DINADDR_NONE=INADDR_ANY -DBSD_COMP
|
||||||
|
#libs+=-L/opt/sfw/lib -lsocket -lnsl
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#
|
||||||
|
# Warn about old build directories and offer to purge.
|
||||||
|
#
|
||||||
|
|
||||||
|
_old:=$(wildcard $(addprefix ../bin/,FreeBSD Linux \
|
||||||
|
Linux64 Mingw Mingw64 SDL dummy) ../objs ../dep)
|
||||||
|
|
||||||
|
ifdef _old
|
||||||
|
$(foreach v,$(_old),$(info $(abspath $(v))))
|
||||||
|
$(info )
|
||||||
|
$(info These directories are no longer\
|
||||||
|
required and should be removed.)
|
||||||
|
$(info You may remove them manually or\
|
||||||
|
by using 'make distclean')
|
||||||
|
$(error )
|
||||||
|
endif
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
#
|
||||||
|
# Platform specific options.
|
||||||
|
#
|
||||||
|
|
||||||
|
PKG_CONFIG?=pkg-config
|
||||||
|
|
||||||
|
ifdef WINDOWSHELL
|
||||||
|
rmrf=-2>NUL DEL /S /Q
|
||||||
|
mkdir=-2>NUL MD
|
||||||
|
cat=TYPE
|
||||||
|
else
|
||||||
|
rmrf=rm -rf
|
||||||
|
mkdir=mkdir -p
|
||||||
|
cat=cat
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef LINUX64
|
||||||
|
LINUX=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW64
|
||||||
|
MINGW=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef LINUX
|
||||||
|
UNIX=1
|
||||||
|
ifdef LINUX64
|
||||||
|
NONX86=1
|
||||||
|
# LINUX64 does not imply X86_64=1;
|
||||||
|
# could mean ARM64 or Itanium
|
||||||
|
platform=linux/64
|
||||||
|
else
|
||||||
|
platform=linux
|
||||||
|
endif
|
||||||
|
else ifdef FREEBSD
|
||||||
|
UNIX=1
|
||||||
|
platform=freebsd
|
||||||
|
else ifdef HAIKU
|
||||||
|
# Give Haiku its own configuration, since it
|
||||||
|
# isn't actually UNIX.
|
||||||
|
include Makefile.d/haiku.mk
|
||||||
|
else ifdef SOLARIS # FIXME: UNTESTED
|
||||||
|
UNIX=1
|
||||||
|
platform=solaris
|
||||||
|
else ifdef CYGWIN32 # FIXME: UNTESTED
|
||||||
|
platform=cygwin
|
||||||
|
else ifdef MINGW
|
||||||
|
ifdef MINGW64
|
||||||
|
NONX86=1
|
||||||
|
NOASM=1
|
||||||
|
# MINGW64 should not necessarily imply X86_64=1,
|
||||||
|
# but we make that assumption elsewhere
|
||||||
|
# Once that changes, remove this
|
||||||
|
X86_64=1
|
||||||
|
platform=mingw/64
|
||||||
|
else
|
||||||
|
platform=mingw
|
||||||
|
endif
|
||||||
|
include Makefile.d/win32.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef platform
|
||||||
|
makedir:=$(makedir)/$(platform)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef UNIX
|
||||||
|
include Makefile.d/nix.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(SDL), 1)
|
||||||
|
include Makefile.d/sdl.mk
|
||||||
|
else ifeq ($(DEDICATED), 1)
|
||||||
|
include Makefile.d/dedicated.mk
|
||||||
|
else
|
||||||
|
include Makefile.d/dummy.mk
|
||||||
|
endif
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#
|
||||||
|
# Makefile options for SDL2 backend.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# SDL...., *looks at Alam*, THIS IS A MESS!
|
||||||
|
#
|
||||||
|
# ...a little bird flexes its muscles...
|
||||||
|
#
|
||||||
|
|
||||||
|
makedir:=$(makedir)/SDL
|
||||||
|
|
||||||
|
sources+=$(call List,sdl/Sourcefile)
|
||||||
|
opts+=-DDIRECTFULLSCREEN -DHAVE_SDL
|
||||||
|
|
||||||
|
NOUPNP=1
|
||||||
|
|
||||||
|
# FIXME: UNTESTED
|
||||||
|
#ifdef PANDORA
|
||||||
|
#include sdl/SRB2Pandora/Makefile.cfg
|
||||||
|
#endif #ifdef PANDORA
|
||||||
|
|
||||||
|
# FIXME: UNTESTED
|
||||||
|
#ifdef CYGWIN32
|
||||||
|
#include sdl/MakeCYG.cfg
|
||||||
|
#endif #ifdef CYGWIN32
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
sources+=sdl/ogl_sdl.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NOMIXER
|
||||||
|
sources+=sdl/sdl_sound.c
|
||||||
|
else
|
||||||
|
opts+=-DHAVE_MIXER
|
||||||
|
sources+=sdl/mixer_sound.c
|
||||||
|
|
||||||
|
ifndef HAIKU # Haiku has a special import path
|
||||||
|
libs+=-lSDL2_mixer
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOTHREADS
|
||||||
|
opts+=-DHAVE_THREADS
|
||||||
|
sources+=sdl/i_threads.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef SDL_PKGCONFIG
|
||||||
|
$(eval $(call Use_pkg_config,SDL))
|
||||||
|
else
|
||||||
|
SDL_CONFIG?=$(call Prefix,sdl2-config)
|
||||||
|
SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags)
|
||||||
|
SDL_LDFLAGS?=$(shell $(SDL_CONFIG) \
|
||||||
|
$(if $(STATIC),--static-libs,--libs))
|
||||||
|
$(eval $(call Propogate_flags,SDL))
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW
|
||||||
|
ifndef NOSDLMAIN
|
||||||
|
SDLMAIN=1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef SDLMAIN
|
||||||
|
opts+=-DSDLMAIN
|
||||||
|
else
|
||||||
|
ifdef MINGW
|
||||||
|
opts+=-Umain
|
||||||
|
libs+=-mconsole
|
||||||
|
endif
|
||||||
|
endif
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
#
|
||||||
|
# Utility macros for the rest of the Makefiles.
|
||||||
|
#
|
||||||
|
|
||||||
|
Ifnot=$(if $(1),$(3),$(2))
|
||||||
|
Ifndef=$(call Ifnot,$($(1)),$(2),$(3))
|
||||||
|
|
||||||
|
# Match and expand a list of variables by pattern.
|
||||||
|
Wildvar=$(foreach v,$(filter $(1),$(.VARIABLES)),$($(v)))
|
||||||
|
|
||||||
|
# Read a list of words from file and prepend each with the
|
||||||
|
# directory of the file.
|
||||||
|
_cat=$(shell $(cat) $(call Windows_path,$(1)))
|
||||||
|
List=$(addprefix $(dir $(1)),$(call _cat,$(1)))
|
||||||
|
|
||||||
|
# Convert path separators to backslash on Windows.
|
||||||
|
Windows_path=$(if $(WINDOWSHELL),$(subst /,\,$(1)),$(1))
|
||||||
|
|
||||||
|
define Propogate_flags =
|
||||||
|
opts+=$$($(1)_CFLAGS)
|
||||||
|
libs+=$$($(1)_LDFLAGS)
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Set library's _CFLAGS and _LDFLAGS from some command.
|
||||||
|
# Automatically propogates the flags too.
|
||||||
|
# 1: variable prefix (e.g. CURL)
|
||||||
|
# 2: start of command (e.g. curl-config)
|
||||||
|
# --- optional ----
|
||||||
|
# 3: CFLAGS command arguments, default '--cflags'
|
||||||
|
# 4: LDFLAGS command arguments, default '--libs'
|
||||||
|
# 5: common command arguments at the end of command
|
||||||
|
define Configure =
|
||||||
|
$(1)_CFLAGS?=$$(shell $(2) $(or $(3),--cflags) $(5))
|
||||||
|
$(1)_LDFLAGS?=$$(shell $(2) $(or $(4),--libs) $(5))
|
||||||
|
$(call Propogate_flags,$(1))
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Configure library with pkg-config. The package name is
|
||||||
|
# taken from a _PKGCONFIG variable.
|
||||||
|
# 1: variable prefix
|
||||||
|
#
|
||||||
|
# LIBGME_PKGCONFIG=libgme
|
||||||
|
# $(eval $(call Use_pkg_config,LIBGME))
|
||||||
|
define Use_pkg_config =
|
||||||
|
$(call Configure,$(1),$(PKG_CONFIG),,,$($(1)_PKGCONFIG))
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Check disabling flag and configure package in one step
|
||||||
|
# according to delimited argument.
|
||||||
|
# (There is only one argument, but it split by slash.)
|
||||||
|
# 1/: short form library name (uppercase). This is
|
||||||
|
# prefixed with 'NO' and 'HAVE_'. E.g. NOGME, HAVE_GME
|
||||||
|
# /2: package name (e.g. libgme)
|
||||||
|
# /3: variable prefix
|
||||||
|
#
|
||||||
|
# The following example would check if NOGME is not
|
||||||
|
# defined before attempting to define LIBGME_CFLAGS and
|
||||||
|
# LIBGME_LDFLAGS as with Use_pkg_config.
|
||||||
|
#
|
||||||
|
# $(eval $(call Check_pkg_config,GME/libgme/LIBGME))
|
||||||
|
define Check_pkg_config =
|
||||||
|
_p:=$(subst /, ,$(1))
|
||||||
|
_v1:=$$(word 1,$$(_p))
|
||||||
|
_v2:=$$(or $$(word 3,$$(_p)),$$(_v1))
|
||||||
|
ifndef NO$$(_v1)
|
||||||
|
$$(_v2)_PKGCONFIG?=$$(word 2,$$(_p))
|
||||||
|
$$(eval $$(call Use_pkg_config,$$(_v2)))
|
||||||
|
opts+=-DHAVE_$$(_v1)
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
|
||||||
|
# $(call Prefix,gcc)
|
||||||
|
Prefix=$(if $(PREFIX),$(PREFIX)-)$(1)
|
||||||
|
|
||||||
|
Echo=
|
||||||
|
Echo_name=
|
||||||
|
Print=
|
||||||
|
|
||||||
|
ifndef SILENT
|
||||||
|
Echo=@echo $(1)
|
||||||
|
ifndef ECHO
|
||||||
|
ifndef NOECHOFILENAMES
|
||||||
|
Echo_name=$(call Echo,-- $(1) ...)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef MAKE_RESTARTS
|
||||||
|
ifndef destructive
|
||||||
|
Print=$(info $(1))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
.=$(call Ifndef,ECHO,@)
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
#
|
||||||
|
# Flags to put a sock in GCC!
|
||||||
|
#
|
||||||
|
|
||||||
|
# See the versions list in detect.mk
|
||||||
|
# This will define all version flags going backward.
|
||||||
|
# Yes, it's magic.
|
||||||
|
define _predecessor =
|
||||||
|
ifdef GCC$(firstword $(1))
|
||||||
|
GCC$(lastword $(1)):=1
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
_n:=$(words $(gcc_versions))
|
||||||
|
$(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
|
||||||
|
$(addprefix =,$(wordlist 2,$(_n),$(gcc_versions)))),\
|
||||||
|
$(and $(findstring =,$(v)),\
|
||||||
|
$(eval $(call _predecessor,$(subst =, ,$(v))))))
|
||||||
|
|
||||||
|
# -W -Wno-unused
|
||||||
|
|
||||||
|
ifdef GCC150
|
||||||
|
opts+=-std=gnu17
|
||||||
|
endif
|
||||||
|
WFLAGS:=-Wall -Wno-trigraphs
|
||||||
|
ifndef GCC295
|
||||||
|
#WFLAGS+=-Wno-packed
|
||||||
|
endif
|
||||||
|
ifndef RELAXWARNINGS
|
||||||
|
WFLAGS+=-W
|
||||||
|
#WFLAGS+=-Wno-sign-compare
|
||||||
|
ifndef GCC295
|
||||||
|
WFLAGS+=-Wno-div-by-zero
|
||||||
|
endif
|
||||||
|
#WFLAGS+=-Wsystem-headers
|
||||||
|
WFLAGS+=-Wfloat-equal
|
||||||
|
#WFLAGS+=-Wtraditional
|
||||||
|
WFLAGS+=-Wundef
|
||||||
|
ifndef GCC295
|
||||||
|
WFLAGS+=-Wendif-labels
|
||||||
|
endif
|
||||||
|
ifdef GCC41
|
||||||
|
WFLAGS+=-Wshadow
|
||||||
|
endif
|
||||||
|
#WFLAGS+=-Wlarger-than-%len%
|
||||||
|
WFLAGS+=-Wpointer-arith -Wbad-function-cast
|
||||||
|
ifdef GCC45
|
||||||
|
#WFLAGS+=-Wc++-compat
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wcast-qual
|
||||||
|
ifndef NOCASTALIGNWARN
|
||||||
|
WFLAGS+=-Wcast-align
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wwrite-strings
|
||||||
|
ifndef ERRORMODE
|
||||||
|
#WFLAGS+=-Wconversion
|
||||||
|
ifdef GCC43
|
||||||
|
#WFLAGS+=-Wno-sign-conversion
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wsign-compare
|
||||||
|
ifdef GCC91
|
||||||
|
WFLAGS+=-Wno-error=address-of-packed-member
|
||||||
|
endif
|
||||||
|
ifdef GCC45
|
||||||
|
WFLAGS+=-Wlogical-op
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Waggregate-return
|
||||||
|
ifdef HAIKU
|
||||||
|
ifdef GCC41
|
||||||
|
#WFLAGS+=-Wno-attributes
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
#WFLAGS+=-Wstrict-prototypes
|
||||||
|
ifdef GCC40
|
||||||
|
WFLAGS+=-Wold-style-definition
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
|
||||||
|
ifdef GCC40
|
||||||
|
WFLAGS+=-Wmissing-field-initializers
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wmissing-noreturn
|
||||||
|
#WFLAGS+=-Wmissing-format-attribute
|
||||||
|
#WFLAGS+=-Wno-multichar
|
||||||
|
#WFLAGS+=-Wno-deprecated-declarations
|
||||||
|
#WFLAGS+=-Wpacked
|
||||||
|
#WFLAGS+=-Wpadded
|
||||||
|
#WFLAGS+=-Wredundant-decls
|
||||||
|
WFLAGS+=-Wnested-externs
|
||||||
|
#WFLAGS+=-Wunreachable-code
|
||||||
|
WFLAGS+=-Winline
|
||||||
|
ifdef DEBUGMODE
|
||||||
|
WFLAGS+=-Wno-error=inline
|
||||||
|
endif
|
||||||
|
ifdef GCC43
|
||||||
|
WFLAGS+=-funit-at-a-time
|
||||||
|
WFLAGS+=-Wlogical-op
|
||||||
|
endif
|
||||||
|
ifndef GCC295
|
||||||
|
WFLAGS+=-Wdisabled-optimization
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wformat-y2k
|
||||||
|
ifdef GCC71
|
||||||
|
WFLAGS+=-Wno-error=format-overflow=2
|
||||||
|
endif
|
||||||
|
WFLAGS+=-Wformat-security
|
||||||
|
ifndef GCC29
|
||||||
|
#WFLAGS+=-Winit-self
|
||||||
|
endif
|
||||||
|
ifdef GCC46
|
||||||
|
WFLAGS+=-Wno-suggest-attribute=noreturn
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NOLDWARNING
|
||||||
|
LDFLAGS+=-Wl,--as-needed
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef ERRORMODE
|
||||||
|
WFLAGS+=-Werror
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef GCC43
|
||||||
|
#WFLAGS+=-Wno-error=clobbered
|
||||||
|
endif
|
||||||
|
ifdef GCC44
|
||||||
|
#WFLAGS+=-Wno-error=array-bounds
|
||||||
|
endif
|
||||||
|
ifdef GCC46
|
||||||
|
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||||
|
endif
|
||||||
|
ifdef GCC54
|
||||||
|
WFLAGS+=-Wno-logical-op -Wno-error=logical-op
|
||||||
|
endif
|
||||||
|
ifdef GCC61
|
||||||
|
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
|
||||||
|
endif
|
||||||
|
ifdef GCC71
|
||||||
|
WFLAGS+=-Wimplicit-fallthrough=4
|
||||||
|
endif
|
||||||
|
ifdef GCC81
|
||||||
|
WFLAGS+=-Wno-error=format-overflow
|
||||||
|
WFLAGS+=-Wno-format-overflow
|
||||||
|
WFLAGS+=-Wno-error=multistatement-macros
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NONX86
|
||||||
|
ifdef X86_64 # yeah that SEEMS contradictory
|
||||||
|
opts+=-march=nocona
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifndef GCC29
|
||||||
|
opts+=-msse3 -mfpmath=sse
|
||||||
|
else
|
||||||
|
opts+=-mpentium
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef DEBUGMODE
|
||||||
|
ifdef GCC48
|
||||||
|
opts+=-Og
|
||||||
|
else
|
||||||
|
opts+=-O0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef VALGRIND
|
||||||
|
ifdef GCC46
|
||||||
|
WFLAGS+=-Wno-error=unused-but-set-variable
|
||||||
|
WFLAGS+=-Wno-unused-but-set-variable
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Lua
|
||||||
|
ifdef GCC43
|
||||||
|
ifndef GCC44
|
||||||
|
WFLAGS+=-Wno-logical-op
|
||||||
|
endif
|
||||||
|
endif
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
#
|
||||||
|
# Mingw, if you don't know, that's Win32/Win64
|
||||||
|
#
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
EXENAME?=srb2kart-saturn_32bit.exe
|
||||||
|
else
|
||||||
|
EXENAME?=srb2kart-saturn_64bit.exe
|
||||||
|
endif
|
||||||
|
|
||||||
|
# disable dynamicbase if under msys2
|
||||||
|
ifdef MSYSTEM
|
||||||
|
libs+=-Wl,--disable-dynamicbase
|
||||||
|
endif
|
||||||
|
|
||||||
|
sources+=win32/Srb2win.rc
|
||||||
|
opts+=-DSTDC_HEADERS
|
||||||
|
libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
|
||||||
|
|
||||||
|
ifndef DEDICATED
|
||||||
|
ifndef DUMMY
|
||||||
|
SDL?=1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NOHW
|
||||||
|
opts+=-DUSE_WGL_SWAP
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW64
|
||||||
|
libs+=-lws2_32
|
||||||
|
else
|
||||||
|
#ifndef HAVE_IPV6
|
||||||
|
#libs+=-lwsock32
|
||||||
|
#else
|
||||||
|
libs+=-lws2_32
|
||||||
|
#endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
libs+=-Wl,--large-address-aware
|
||||||
|
NOLIBBACKTRACE=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef MINGW64
|
||||||
|
32=32
|
||||||
|
x86=x86
|
||||||
|
i686=i686
|
||||||
|
else
|
||||||
|
32=64
|
||||||
|
x86=x86_64
|
||||||
|
i686=x86_64
|
||||||
|
endif
|
||||||
|
|
||||||
|
mingw:=$(i686)-w64-mingw32
|
||||||
|
|
||||||
|
define _set =
|
||||||
|
$(1)_CFLAGS?=$($(1)_opts)
|
||||||
|
$(1)_LDFLAGS?=$($(1)_libs)
|
||||||
|
endef
|
||||||
|
|
||||||
|
lib:=../libs/gme
|
||||||
|
LIBGME_opts:=-I$(lib)/include
|
||||||
|
LIBGME_libs:=-L$(lib)/win$(32) -lgme
|
||||||
|
$(eval $(call _set,LIBGME))
|
||||||
|
|
||||||
|
lib:=../libs/libopenmpt
|
||||||
|
LIBOPENMPT_opts:=-I$(lib)/inc
|
||||||
|
LIBOPENMPT_libs:=-L$(lib)/lib/$(x86)/mingw -lopenmpt
|
||||||
|
$(eval $(call _set,LIBOPENMPT))
|
||||||
|
|
||||||
|
lib:=../libs/SDL2_mixer/$(mingw)
|
||||||
|
|
||||||
|
ifdef SDL
|
||||||
|
mixer_opts:=-I$(lib)/include/SDL2
|
||||||
|
mixer_libs:=-L$(lib)/lib
|
||||||
|
|
||||||
|
lib:=../libs/SDL2/$(mingw)
|
||||||
|
SDL_opts:=-I$(lib)/include/SDL2\
|
||||||
|
$(mixer_opts) -Dmain=SDL_main
|
||||||
|
SDL_libs:=-L$(lib)/lib $(mixer_libs)\
|
||||||
|
-lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||||
|
$(eval $(call _set,SDL))
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef MINGW64
|
||||||
|
lib:=../libs/libbacktrace
|
||||||
|
LIBBACKTRACE_opts:=-I$(lib)/include
|
||||||
|
LIBBACKTRACE_libs:=-L$(lib)/lib/x86_64 -lbacktrace
|
||||||
|
$(eval $(call _set,LIBBACKTRACE))
|
||||||
|
else
|
||||||
|
lib:=../libs/drmingw
|
||||||
|
opts+=-I$(lib)/include
|
||||||
|
libs+=-L$(lib)/lib/win32 -lmgwhelp -lexchndl
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/zlib
|
||||||
|
ZLIB_opts:=-I$(lib)
|
||||||
|
ZLIB_libs:=-L$(lib)/win32 -l:libz$(32).a
|
||||||
|
$(eval $(call _set,ZLIB))
|
||||||
|
|
||||||
|
ifndef PNG_CONFIG
|
||||||
|
lib:=../libs/libpng-src
|
||||||
|
PNG_opts:=-I$(lib)
|
||||||
|
PNG_libs:=-L$(lib)/projects -lpng$(32)
|
||||||
|
$(eval $(call _set,PNG))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/curl
|
||||||
|
CURL_opts:=-I$(lib)/include
|
||||||
|
CURL_libs:=-L$(lib)/lib$(32) -lcurl
|
||||||
|
$(eval $(call _set,CURL))
|
||||||
|
|
||||||
|
ifndef MINGW64 # miniupnc is broken with MINGW64
|
||||||
|
lib:=../libs/miniupnpc
|
||||||
|
MINIUPNPC_opts:=-I$(lib)/include -DMINIUPNP_STATICLIB
|
||||||
|
MINIUPNPC_libs:=-L$(lib)/mingw$(32) -lminiupnpc -lws2_32 -liphlpapi
|
||||||
|
$(eval $(call _set,MINIUPNPC))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/discord-rpc/win$(32)-dynamic
|
||||||
|
DISCORDRPC_opts+=-I$(lib)/include
|
||||||
|
DISCORDRPC_libs+=-L$(lib)/lib -ldiscord-rpc
|
||||||
|
$(eval $(call _set,DISCORDRPC))
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
am_map.c
|
||||||
|
b_bot.c
|
||||||
|
command.c
|
||||||
|
console.c
|
||||||
|
d_clisrv.c
|
||||||
|
d_main.c
|
||||||
|
d_net.c
|
||||||
|
d_netcmd.c
|
||||||
|
d_netfil.c
|
||||||
|
d_protocol.c
|
||||||
|
dehacked.c
|
||||||
|
f_finale.c
|
||||||
|
f_wipe.c
|
||||||
|
filesrch.c
|
||||||
|
g_game.c
|
||||||
|
g_input.c
|
||||||
|
hu_stuff.c
|
||||||
|
i_tcp.c
|
||||||
|
i_time.c
|
||||||
|
info.c
|
||||||
|
lzf.c
|
||||||
|
m_aatree.c
|
||||||
|
m_anigif.c
|
||||||
|
m_argv.c
|
||||||
|
m_bbox.c
|
||||||
|
m_cheat.c
|
||||||
|
m_cond.c
|
||||||
|
m_fixed.c
|
||||||
|
m_menu.c
|
||||||
|
m_textinput.c
|
||||||
|
m_misc.c
|
||||||
|
m_perfstats.c
|
||||||
|
m_queue.c
|
||||||
|
m_random.c
|
||||||
|
mserv.c
|
||||||
|
http-mserv.c
|
||||||
|
qs22j.c
|
||||||
|
s_sound.c
|
||||||
|
screen.c
|
||||||
|
sounds.c
|
||||||
|
st_stuff.c
|
||||||
|
string.c
|
||||||
|
tables.c
|
||||||
|
v_video.c
|
||||||
|
w_wad.c
|
||||||
|
y_inter.c
|
||||||
|
z_zone.c
|
||||||
|
r_bsp.c
|
||||||
|
r_data.c
|
||||||
|
r_draw.c
|
||||||
|
r_fps.c
|
||||||
|
r_main.c
|
||||||
|
r_patch.c
|
||||||
|
r_patchrotation.c
|
||||||
|
r_plane.c
|
||||||
|
r_segs.c
|
||||||
|
r_sky.c
|
||||||
|
r_splats.c
|
||||||
|
r_things.c
|
||||||
|
r_portal.c
|
||||||
|
p_ceilng.c
|
||||||
|
p_enemy.c
|
||||||
|
p_floor.c
|
||||||
|
p_inter.c
|
||||||
|
p_lights.c
|
||||||
|
p_map.c
|
||||||
|
p_maputl.c
|
||||||
|
p_mobj.c
|
||||||
|
p_polyobj.c
|
||||||
|
p_saveg.c
|
||||||
|
p_setup.c
|
||||||
|
p_sight.c
|
||||||
|
p_slopes.c
|
||||||
|
p_spec.c
|
||||||
|
p_telept.c
|
||||||
|
p_tick.c
|
||||||
|
p_user.c
|
||||||
|
k_director.c
|
||||||
|
k_kart.c
|
||||||
|
k_stats.c
|
||||||
|
lua_baselib.c
|
||||||
|
lua_blockmaplib.c
|
||||||
|
lua_consolelib.c
|
||||||
|
lua_hooklib.c
|
||||||
|
lua_hudlib.c
|
||||||
|
lua_hudlib_drawlist.c
|
||||||
|
lua_infolib.c
|
||||||
|
lua_maplib.c
|
||||||
|
lua_mathlib.c
|
||||||
|
lua_mobjlib.c
|
||||||
|
lua_playerlib.c
|
||||||
|
lua_script.c
|
||||||
|
lua_skinlib.c
|
||||||
|
lua_thinkerlib.c
|
||||||
|
lua_udatalib.c
|
||||||
|
lua_glib.c
|
||||||
+3
-7
@@ -197,7 +197,7 @@ static fixed_t scale_mtof = (fixed_t)INITSCALEMTOF;
|
|||||||
// used by FTOM to scale from frame-buffer-to-map coords (=1/scale_mtof)
|
// used by FTOM to scale from frame-buffer-to-map coords (=1/scale_mtof)
|
||||||
static fixed_t scale_ftom;
|
static fixed_t scale_ftom;
|
||||||
|
|
||||||
static player_t *plr = NULL; // the player represented by an arrow
|
static player_t *plr; // the player represented by an arrow
|
||||||
|
|
||||||
static boolean followplayer = true; // specifies whether to follow the player around
|
static boolean followplayer = true; // specifies whether to follow the player around
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ static inline void AM_restoreScaleAndLoc(void)
|
|||||||
m_x = old_m_x;
|
m_x = old_m_x;
|
||||||
m_y = old_m_y;
|
m_y = old_m_y;
|
||||||
}
|
}
|
||||||
else if (plr && plr->mo)
|
else
|
||||||
{
|
{
|
||||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||||
@@ -318,8 +318,7 @@ static void AM_initVariables(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
plr = &players[pnum];
|
plr = &players[pnum];
|
||||||
|
if (plr != NULL && plr->mo != NULL)
|
||||||
if (plr && plr->mo)
|
|
||||||
{
|
{
|
||||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||||
@@ -598,9 +597,6 @@ static inline void AM_changeWindowScale(void)
|
|||||||
|
|
||||||
static inline void AM_doFollowPlayer(void)
|
static inline void AM_doFollowPlayer(void)
|
||||||
{
|
{
|
||||||
if (!plr || !plr->mo)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (f_oldloc.x != plr->mo->x || f_oldloc.y != plr->mo->y)
|
if (f_oldloc.x != plr->mo->x || f_oldloc.y != plr->mo->y)
|
||||||
{
|
{
|
||||||
m_x = FTOM(MTOF(plr->mo->x >> FRACTOMAPBITS)) - m_w/2;
|
m_x = FTOM(MTOF(plr->mo->x >> FRACTOMAPBITS)) - m_w/2;
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
ifdef UNIXCOMMON
|
|
||||||
LUA_CFLAGS+=-DLUA_USE_POSIX
|
|
||||||
endif
|
|
||||||
ifdef LINUX
|
|
||||||
LUA_CFLAGS+=-DLUA_USE_POSIX
|
|
||||||
endif
|
|
||||||
ifdef GCC43
|
|
||||||
ifndef GCC44
|
|
||||||
WFLAGS+=-Wno-logical-op
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS:=$(OBJS) \
|
|
||||||
$(OBJDIR)/lapi.o \
|
|
||||||
$(OBJDIR)/lbaselib.o \
|
|
||||||
$(OBJDIR)/ldo.o \
|
|
||||||
$(OBJDIR)/ldblib.o \
|
|
||||||
$(OBJDIR)/lfunc.o \
|
|
||||||
$(OBJDIR)/linit.o \
|
|
||||||
$(OBJDIR)/liolib.o \
|
|
||||||
$(OBJDIR)/llex.o \
|
|
||||||
$(OBJDIR)/lmem.o \
|
|
||||||
$(OBJDIR)/lobject.o \
|
|
||||||
$(OBJDIR)/lstate.o \
|
|
||||||
$(OBJDIR)/lstrlib.o \
|
|
||||||
$(OBJDIR)/ltablib.o \
|
|
||||||
$(OBJDIR)/lundump.o \
|
|
||||||
$(OBJDIR)/lzio.o \
|
|
||||||
$(OBJDIR)/lauxlib.o \
|
|
||||||
$(OBJDIR)/lcode.o \
|
|
||||||
$(OBJDIR)/ldebug.o \
|
|
||||||
$(OBJDIR)/ldump.o \
|
|
||||||
$(OBJDIR)/lgc.o \
|
|
||||||
$(OBJDIR)/lopcodes.o \
|
|
||||||
$(OBJDIR)/lparser.o \
|
|
||||||
$(OBJDIR)/lstring.o \
|
|
||||||
$(OBJDIR)/ltable.o \
|
|
||||||
$(OBJDIR)/ltm.o \
|
|
||||||
$(OBJDIR)/lvm.o \
|
|
||||||
$(OBJDIR)/lua_script.o \
|
|
||||||
$(OBJDIR)/lua_baselib.o \
|
|
||||||
$(OBJDIR)/lua_blockmaplib.o \
|
|
||||||
$(OBJDIR)/lua_mathlib.o \
|
|
||||||
$(OBJDIR)/lua_hooklib.o \
|
|
||||||
$(OBJDIR)/lua_consolelib.o \
|
|
||||||
$(OBJDIR)/lua_infolib.o \
|
|
||||||
$(OBJDIR)/lua_mobjlib.o \
|
|
||||||
$(OBJDIR)/lua_playerlib.o \
|
|
||||||
$(OBJDIR)/lua_skinlib.o \
|
|
||||||
$(OBJDIR)/lua_thinkerlib.o \
|
|
||||||
$(OBJDIR)/lua_maplib.o \
|
|
||||||
$(OBJDIR)/lua_hudlib.o \
|
|
||||||
$(OBJDIR)/lua_hudlib_drawlist.o \
|
|
||||||
$(OBJDIR)/lua_udatalib.o \
|
|
||||||
$(OBJDIR)/lua_glib.o
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
lapi.c
|
||||||
|
lauxlib.c
|
||||||
|
lbaselib.c
|
||||||
|
ldblib.c
|
||||||
|
lcode.c
|
||||||
|
ldebug.c
|
||||||
|
ldo.c
|
||||||
|
ldump.c
|
||||||
|
lfunc.c
|
||||||
|
lgc.c
|
||||||
|
linit.c
|
||||||
|
liolib.c
|
||||||
|
llex.c
|
||||||
|
lmem.c
|
||||||
|
lobject.c
|
||||||
|
lopcodes.c
|
||||||
|
lparser.c
|
||||||
|
lstate.c
|
||||||
|
lstring.c
|
||||||
|
lstrlib.c
|
||||||
|
ltable.c
|
||||||
|
ltablib.c
|
||||||
|
ltm.c
|
||||||
|
lundump.c
|
||||||
|
lvm.c
|
||||||
|
lzio.c
|
||||||
@@ -240,6 +240,7 @@ void COM_ImmedExecute(const char *ptext)
|
|||||||
|
|
||||||
while (i < strlen(ptext))
|
while (i < strlen(ptext))
|
||||||
{
|
{
|
||||||
|
|
||||||
quotes = 0;
|
quotes = 0;
|
||||||
for (j = 0; i < strlen(ptext); i++,j++)
|
for (j = 0; i < strlen(ptext); i++,j++)
|
||||||
{
|
{
|
||||||
|
|||||||
+24
-19
@@ -1068,7 +1068,6 @@ static void SV_RequireResynch(INT32 node)
|
|||||||
|
|
||||||
// Initial setup
|
// Initial setup
|
||||||
memset(resynch_sent[node], 0, MAXPLAYERS);
|
memset(resynch_sent[node], 0, MAXPLAYERS);
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; ++i)
|
for (i = 0; i < MAXPLAYERS; ++i)
|
||||||
{
|
{
|
||||||
if (!playeringame[i]) // Player not in game so just drop it from required synch
|
if (!playeringame[i]) // Player not in game so just drop it from required synch
|
||||||
@@ -1688,7 +1687,13 @@ static void SV_SendPlayerInfo(INT32 node)
|
|||||||
|
|
||||||
for (i = 0; i < MSCOMPAT_MAXPLAYERS; i++)
|
for (i = 0; i < MSCOMPAT_MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if ((i >= MAXPLAYERS) || !playeringame[i])
|
if (i >= MAXPLAYERS)
|
||||||
|
{
|
||||||
|
netbuffer->u.playerinfo[i].node = 255;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playeringame[i] == UINT8_MAX || !playeringame[i])
|
||||||
{
|
{
|
||||||
netbuffer->u.playerinfo[i].node = 255; // This slot is empty.
|
netbuffer->u.playerinfo[i].node = 255; // This slot is empty.
|
||||||
continue;
|
continue;
|
||||||
@@ -1773,6 +1778,8 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||||||
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||||
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
||||||
|
|
||||||
|
memset(netbuffer->u.servercfg.adminplayers, -1, sizeof(netbuffer->u.servercfg.adminplayers));
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
netbuffer->u.servercfg.adminplayers[i] = (SINT8)adminplayers[i];
|
netbuffer->u.servercfg.adminplayers[i] = (SINT8)adminplayers[i];
|
||||||
@@ -3268,7 +3275,7 @@ void CL_ClearPlayer(INT32 playernum)
|
|||||||
P_RemoveMobj(players[playernum].mo);
|
P_RemoveMobj(players[playernum].mo);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&players[playernum], 0, sizeof(player_t));
|
memset(&players[playernum], 0, sizeof (player_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -4277,14 +4284,14 @@ void SV_ResetServer(void)
|
|||||||
sprintf(player_names[i], "Player %d", i + 1);
|
sprintf(player_names[i], "Player %d", i + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(player_name_changes, 0, sizeof(player_name_changes));
|
memset(player_name_changes, 0, sizeof player_name_changes);
|
||||||
|
|
||||||
memset(playeringame, false, sizeof(playeringame));
|
memset(playeringame, false, sizeof playeringame);
|
||||||
memset(playernode, UINT8_MAX, sizeof(playernode));
|
memset(playernode, UINT8_MAX, sizeof playernode);
|
||||||
|
|
||||||
pingmeasurecount = 1;
|
pingmeasurecount = 1;
|
||||||
memset(realpingtable, 0, sizeof(realpingtable));
|
memset(realpingtable, 0, sizeof realpingtable);
|
||||||
memset(playerpingtable, 0, sizeof(playerpingtable));
|
memset(playerpingtable, 0, sizeof playerpingtable);
|
||||||
|
|
||||||
ClearAdminPlayers();
|
ClearAdminPlayers();
|
||||||
|
|
||||||
@@ -5317,18 +5324,18 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||||||
/// \todo Use a separate cvar for that kind of timeout?
|
/// \todo Use a separate cvar for that kind of timeout?
|
||||||
freezetimeout[node] = I_GetTime() + connectiontimeout;
|
freezetimeout[node] = I_GetTime() + connectiontimeout;
|
||||||
|
|
||||||
// Don't do anything for packets of type NODEKEEPALIVE?
|
|
||||||
// Sryder 2018/07/01: Update the freezetimeout still!
|
|
||||||
if (netbuffer->packettype == PT_NODEKEEPALIVE
|
|
||||||
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// If we've alredy received a ticcmd for this tic, just submit it for the next one.
|
// If we've alredy received a ticcmd for this tic, just submit it for the next one.
|
||||||
tic_t faketic = maketic;
|
tic_t faketic = maketic;
|
||||||
if ((!!(netcmds[maketic % TICQUEUE][netconsole].angleturn & TICCMD_RECEIVED))
|
if ((!!(netcmds[maketic % TICQUEUE][netconsole].angleturn & TICCMD_RECEIVED))
|
||||||
&& (maketic - firstticstosend < TICQUEUE - 1))
|
&& (maketic - firstticstosend < TICQUEUE - 1))
|
||||||
faketic++;
|
faketic++;
|
||||||
|
|
||||||
|
// Don't do anything for packets of type NODEKEEPALIVE?
|
||||||
|
// Sryder 2018/07/01: Update the freezetimeout still!
|
||||||
|
if (netbuffer->packettype == PT_NODEKEEPALIVE
|
||||||
|
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
|
||||||
|
break;
|
||||||
|
|
||||||
// Copy ticcmd
|
// Copy ticcmd
|
||||||
G_MoveTiccmd(&netcmds[faketic%TICQUEUE][netconsole], &netbuffer->u.clientpak.cmd, 1);
|
G_MoveTiccmd(&netcmds[faketic%TICQUEUE][netconsole], &netbuffer->u.clientpak.cmd, 1);
|
||||||
|
|
||||||
@@ -5388,7 +5395,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||||||
|
|
||||||
// Check player consistancy during the level
|
// Check player consistancy during the level
|
||||||
if (gamestate == GS_LEVEL
|
if (gamestate == GS_LEVEL
|
||||||
&& (realstart <= gametic && realstart + TICQUEUE - 1 > gametic)
|
&& (realstart > gametic - TICQUEUE+1 && realstart <= gametic)
|
||||||
&& consistancy[realstart%TICQUEUE] != SHORT(netbuffer->u.clientpak.consistancy)
|
&& consistancy[realstart%TICQUEUE] != SHORT(netbuffer->u.clientpak.consistancy)
|
||||||
&& (!UseSaturnSynch(node) || (!resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime() && !SV_ResendingSavegameToAnyone())))
|
&& (!UseSaturnSynch(node) || (!resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime() && !SV_ResendingSavegameToAnyone())))
|
||||||
{
|
{
|
||||||
@@ -5418,13 +5425,10 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cv_blamecfail.value)
|
if (cv_blamecfail.value)
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("Synch failure for player %d (%s); expected %hd, got %hd\n"),
|
CONS_Printf(M_GetText("Synch failure for player %d (%s); expected %hd, got %hd\n"),
|
||||||
netconsole+1, player_names[netconsole],
|
netconsole+1, player_names[netconsole],
|
||||||
consistancy[realstart%TICQUEUE],
|
consistancy[realstart%TICQUEUE],
|
||||||
SHORT(netbuffer->u.clientpak.consistancy));
|
SHORT(netbuffer->u.clientpak.consistancy));
|
||||||
}
|
|
||||||
|
|
||||||
DEBFILE(va("Restoring player %d (synch failure) [%update] %d!=%d\n",
|
DEBFILE(va("Restoring player %d (synch failure) [%update] %d!=%d\n",
|
||||||
netconsole, realstart, consistancy[realstart%TICQUEUE],
|
netconsole, realstart, consistancy[realstart%TICQUEUE],
|
||||||
SHORT(netbuffer->u.clientpak.consistancy)));
|
SHORT(netbuffer->u.clientpak.consistancy)));
|
||||||
@@ -5696,7 +5700,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update client ping table from the server.
|
//Update client ping table from the server.
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
@@ -6506,6 +6510,7 @@ static inline void PingUpdate(void)
|
|||||||
if (pingtimeout[i] > 0)
|
if (pingtimeout[i] > 0)
|
||||||
pingtimeout[i]--;
|
pingtimeout[i]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//kick lagging players... unless everyone but the server's ping sucks.
|
//kick lagging players... unless everyone but the server's ping sucks.
|
||||||
|
|||||||
+126
-127
@@ -197,10 +197,12 @@ static void D_PadMenuScrollInput(UINT8 input)
|
|||||||
// and pass it to the eventlist
|
// and pass it to the eventlist
|
||||||
static void D_GamePadMenuScrollTicker(void)
|
static void D_GamePadMenuScrollTicker(void)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
|
||||||
static UINT8 menuInputDelayTimer = 0;
|
static UINT8 menuInputDelayTimer = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
if (dedicated)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (UINT8 i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
if (dpadscrollstate[i])
|
if (dpadscrollstate[i])
|
||||||
{
|
{
|
||||||
@@ -220,10 +222,10 @@ static void D_GamePadMenuScrollTicker(void)
|
|||||||
static void D_DeviceLEDTick(void)
|
static void D_DeviceLEDTick(void)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0};
|
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0};
|
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||||
|
|
||||||
if (numcontrollers == 0)
|
if (dedicated || numcontrollers == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -250,6 +252,7 @@ static void D_DeviceLEDTick(void)
|
|||||||
void D_ProcessEvents(void)
|
void D_ProcessEvents(void)
|
||||||
{
|
{
|
||||||
event_t *ev;
|
event_t *ev;
|
||||||
|
|
||||||
boolean eaten;
|
boolean eaten;
|
||||||
|
|
||||||
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
|
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
|
||||||
@@ -288,10 +291,8 @@ void D_ProcessEvents(void)
|
|||||||
|
|
||||||
// Demo input:
|
// Demo input:
|
||||||
if (demo.playback)
|
if (demo.playback)
|
||||||
{
|
|
||||||
if (M_DemoResponder(ev))
|
if (M_DemoResponder(ev))
|
||||||
continue; // demo ate the event
|
continue; // demo ate the event
|
||||||
}
|
|
||||||
|
|
||||||
// console input
|
// console input
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
@@ -316,88 +317,6 @@ void D_ProcessEvents(void)
|
|||||||
// draw current display, possibly wiping it from the previous
|
// draw current display, possibly wiping it from the previous
|
||||||
//
|
//
|
||||||
|
|
||||||
static void D_Renderview(void)
|
|
||||||
{
|
|
||||||
UINT8 i;
|
|
||||||
|
|
||||||
if (automapactive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
R_ApplyLevelInterpolators(rendertimefrac);
|
|
||||||
|
|
||||||
for (i = 0; i <= splitscreen; i++)
|
|
||||||
{
|
|
||||||
const boolean issplitscreen = (i > 0);
|
|
||||||
|
|
||||||
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
|
||||||
{
|
|
||||||
viewssnum = i;
|
|
||||||
|
|
||||||
if (!issplitscreen) // Initialize for P1
|
|
||||||
{
|
|
||||||
viewwindowy = viewwindowx = 0;
|
|
||||||
topleft = screens[0];
|
|
||||||
objectsdrawn = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HWRENDER
|
|
||||||
if (rendermode == render_opengl)
|
|
||||||
{
|
|
||||||
HWR_RenderPlayerView();
|
|
||||||
R_RestoreLevelInterpolators();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (issplitscreen) // Splitscreen-specific
|
|
||||||
{
|
|
||||||
const INT32 len = viewheight*sizeof(ylookup[0]);
|
|
||||||
|
|
||||||
switch (i)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
if (splitscreen > 1)
|
|
||||||
{
|
|
||||||
viewwindowx = viewwidth;
|
|
||||||
viewwindowy = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
viewwindowx = 0;
|
|
||||||
viewwindowy = viewheight;
|
|
||||||
}
|
|
||||||
M_Memcpy(ylookup, ylookup2, len);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
viewwindowx = 0;
|
|
||||||
viewwindowy = viewheight;
|
|
||||||
M_Memcpy(ylookup, ylookup3, len);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
viewwindowx = viewwidth;
|
|
||||||
viewwindowy = viewheight;
|
|
||||||
M_Memcpy(ylookup, ylookup4, len);
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
|
||||||
}
|
|
||||||
|
|
||||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
|
||||||
|
|
||||||
if (issplitscreen)
|
|
||||||
M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!issplitscreen)
|
|
||||||
R_ApplyViewMorph();
|
|
||||||
|
|
||||||
V_DoPostProcessor(i, postimgparam[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
R_RestoreLevelInterpolators();
|
|
||||||
}
|
|
||||||
|
|
||||||
// wipegamestate can be set to -1 to force a wipe on the next draw
|
// wipegamestate can be set to -1 to force a wipe on the next draw
|
||||||
// added comment : there is a wipe eatch change of the gamestate
|
// added comment : there is a wipe eatch change of the gamestate
|
||||||
gamestate_t wipegamestate = GS_LEVEL;
|
gamestate_t wipegamestate = GS_LEVEL;
|
||||||
@@ -408,6 +327,7 @@ static boolean D_Display(void)
|
|||||||
boolean forcerefresh = false;
|
boolean forcerefresh = false;
|
||||||
static boolean wipe = false;
|
static boolean wipe = false;
|
||||||
INT32 wipedefindex = 0;
|
INT32 wipedefindex = 0;
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
if (!dedicated)
|
if (!dedicated)
|
||||||
{
|
{
|
||||||
@@ -446,7 +366,6 @@ static boolean D_Display(void)
|
|||||||
{
|
{
|
||||||
// set for all later
|
// set for all later
|
||||||
wipedefindex = gamestate; // wipe_xxx_toblack
|
wipedefindex = gamestate; // wipe_xxx_toblack
|
||||||
|
|
||||||
if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO)
|
if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO)
|
||||||
wipedefindex = wipe_timeattack_toblack;
|
wipedefindex = wipe_timeattack_toblack;
|
||||||
else if (gamestate == GS_INTERMISSION)
|
else if (gamestate == GS_INTERMISSION)
|
||||||
@@ -459,28 +378,26 @@ static boolean D_Display(void)
|
|||||||
|
|
||||||
if (!dedicated)
|
if (!dedicated)
|
||||||
{
|
{
|
||||||
if (gamestate != GS_LEVEL)
|
// Fade to black first
|
||||||
|
if (gamestate != GS_LEVEL // fades to black on its own timing, always
|
||||||
|
&& wipedefs[wipedefindex] != UINT8_MAX)
|
||||||
{
|
{
|
||||||
// Fade to black first
|
F_WipeStartScreen();
|
||||||
if (wipedefs[wipedefindex] != UINT8_MAX) // fades to black on its own timing, always
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||||
{
|
F_WipeEndScreen();
|
||||||
F_WipeStartScreen();
|
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
ranwipe = true;
|
||||||
F_WipeEndScreen();
|
}
|
||||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
|
||||||
ranwipe = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rendermode != render_none)
|
if (gamestate != GS_LEVEL && rendermode != render_none)
|
||||||
{
|
{
|
||||||
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
||||||
R_ReInitColormaps(0, LUMPERROR);
|
R_ReInitColormaps(0, LUMPERROR);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
}
|
}
|
||||||
else // dedicated servers
|
else //dedicated servers
|
||||||
{
|
{
|
||||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||||
ranwipe = true;
|
ranwipe = true;
|
||||||
@@ -488,7 +405,7 @@ static boolean D_Display(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dedicated) // bail out after wipe logic
|
if (dedicated) //bail out after wipe logic
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// do buffered drawing
|
// do buffered drawing
|
||||||
@@ -513,6 +430,9 @@ static boolean D_Display(void)
|
|||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GS_TIMEATTACK:
|
||||||
|
break;
|
||||||
|
|
||||||
case GS_INTRO:
|
case GS_INTRO:
|
||||||
F_IntroDrawer();
|
F_IntroDrawer();
|
||||||
if (wipegamestate == (gamestate_t)-1)
|
if (wipegamestate == (gamestate_t)-1)
|
||||||
@@ -564,7 +484,6 @@ static boolean D_Display(void)
|
|||||||
HU_Erase();
|
HU_Erase();
|
||||||
HU_Drawer();
|
HU_Drawer();
|
||||||
}
|
}
|
||||||
case GS_TIMEATTACK:
|
|
||||||
case GS_DEDICATEDSERVER:
|
case GS_DEDICATEDSERVER:
|
||||||
case GS_NULL:
|
case GS_NULL:
|
||||||
break;
|
break;
|
||||||
@@ -573,10 +492,89 @@ static boolean D_Display(void)
|
|||||||
if (gamestate == GS_LEVEL)
|
if (gamestate == GS_LEVEL)
|
||||||
{
|
{
|
||||||
// draw the view directly
|
// draw the view directly
|
||||||
if (cv_renderview.value)
|
if (cv_renderview.value && !automapactive)
|
||||||
{
|
{
|
||||||
PS_START_TIMING(ps_rendercalltime);
|
PS_START_TIMING(ps_rendercalltime);
|
||||||
D_Renderview();
|
|
||||||
|
R_ApplyLevelInterpolators(rendertimefrac);
|
||||||
|
|
||||||
|
for (i = 0; i <= splitscreen; i++)
|
||||||
|
{
|
||||||
|
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
||||||
|
{
|
||||||
|
viewssnum = i;
|
||||||
|
|
||||||
|
if (i == 0) // Initialize for P1
|
||||||
|
{
|
||||||
|
viewwindowy = 0;
|
||||||
|
viewwindowx = 0;
|
||||||
|
|
||||||
|
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||||
|
objectsdrawn = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
if (rendermode == render_opengl)
|
||||||
|
HWR_RenderPlayerView();
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (rendermode != render_none)
|
||||||
|
{
|
||||||
|
if (i > 0) // Splitscreen-specific
|
||||||
|
{
|
||||||
|
switch (i)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
if (splitscreen > 1)
|
||||||
|
{
|
||||||
|
viewwindowx = viewwidth;
|
||||||
|
viewwindowy = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
viewwindowx = 0;
|
||||||
|
viewwindowy = viewheight;
|
||||||
|
}
|
||||||
|
M_Memcpy(ylookup, ylookup2, viewheight*sizeof (ylookup[0]));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
viewwindowx = 0;
|
||||||
|
viewwindowy = viewheight;
|
||||||
|
M_Memcpy(ylookup, ylookup3, viewheight*sizeof (ylookup[0]));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
viewwindowx = viewwidth;
|
||||||
|
viewwindowy = viewheight;
|
||||||
|
M_Memcpy(ylookup, ylookup4, viewheight*sizeof (ylookup[0]));
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||||
|
}
|
||||||
|
|
||||||
|
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||||
|
|
||||||
|
if (i > 0)
|
||||||
|
M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rendermode == render_soft)
|
||||||
|
{
|
||||||
|
if (!splitscreen)
|
||||||
|
R_ApplyViewMorph();
|
||||||
|
|
||||||
|
for (i = 0; i <= splitscreen; i++)
|
||||||
|
{
|
||||||
|
V_DoPostProcessor(i, postimgparam[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
R_RestoreLevelInterpolators();
|
||||||
|
|
||||||
PS_STOP_TIMING(ps_rendercalltime);
|
PS_STOP_TIMING(ps_rendercalltime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +584,6 @@ static boolean D_Display(void)
|
|||||||
{
|
{
|
||||||
VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
|
VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastdraw = false;
|
lastdraw = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -609,8 +606,13 @@ static boolean D_Display(void)
|
|||||||
// draw pause pic
|
// draw pause pic
|
||||||
if (paused && cv_showhud.value && !demo.playback)
|
if (paused && cv_showhud.value && !demo.playback)
|
||||||
{
|
{
|
||||||
INT32 py = (automapactive) ? 4 : (viewwindowy + 4);
|
INT32 py;
|
||||||
patch_t *patch = W_CachePatchName("M_PAUSE", PU_PATCH);
|
patch_t *patch;
|
||||||
|
if (automapactive)
|
||||||
|
py = 4;
|
||||||
|
else
|
||||||
|
py = viewwindowy + 4;
|
||||||
|
patch = W_CachePatchName("M_PAUSE", PU_PATCH);
|
||||||
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, V_SNAPTOTOP, patch);
|
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, V_SNAPTOTOP, patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,7 +754,7 @@ void D_SRB2Loop(void)
|
|||||||
|
|
||||||
// Casting the return value of a function is bad practice (apparently)
|
// Casting the return value of a function is bad practice (apparently)
|
||||||
double budget = ((R_GetFramerateCap() == 0) ? 0.0 : round((1.0 / R_GetFramerateCap()) * I_GetPrecisePrecision()));
|
double budget = ((R_GetFramerateCap() == 0) ? 0.0 : round((1.0 / R_GetFramerateCap()) * I_GetPrecisePrecision()));
|
||||||
capbudget = (precise_t)budget;
|
capbudget = (precise_t) budget;
|
||||||
|
|
||||||
boolean ranwipe = false;
|
boolean ranwipe = false;
|
||||||
|
|
||||||
@@ -822,15 +824,12 @@ void D_SRB2Loop(void)
|
|||||||
doDisplay = true;
|
doDisplay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dedicated)
|
if (menuactive)
|
||||||
{
|
{
|
||||||
if (menuactive)
|
D_GamePadMenuScrollTicker();
|
||||||
{
|
|
||||||
D_GamePadMenuScrollTicker();
|
|
||||||
}
|
|
||||||
|
|
||||||
D_DeviceLEDTick();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
D_DeviceLEDTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interp)
|
if (interp)
|
||||||
@@ -842,9 +841,7 @@ void D_SRB2Loop(void)
|
|||||||
ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(g_time.timefrac)) * 1000.0f);
|
ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(g_time.timefrac)) * 1000.0f);
|
||||||
ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0f);
|
ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0f);
|
||||||
|
|
||||||
const boolean lagging = ((deltatics >= 1.0) || hu_stopped);
|
if (!(paused || P_AutoPause()) && deltatics < 1.0 && !hu_stopped)
|
||||||
|
|
||||||
if (!(paused || P_AutoPause()) && !lagging)
|
|
||||||
{
|
{
|
||||||
rendertimefrac = g_time.timefrac;
|
rendertimefrac = g_time.timefrac;
|
||||||
}
|
}
|
||||||
@@ -853,7 +850,7 @@ void D_SRB2Loop(void)
|
|||||||
rendertimefrac = FRACUNIT;
|
rendertimefrac = FRACUNIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lagging)
|
if ((deltatics < 1.0) && !hu_stopped)
|
||||||
{
|
{
|
||||||
rendertimefrac_unpaused = g_time.timefrac;
|
rendertimefrac_unpaused = g_time.timefrac;
|
||||||
}
|
}
|
||||||
@@ -1610,7 +1607,9 @@ void D_SRB2Main(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// for dedicated server
|
// for dedicated server
|
||||||
|
#if !defined (DEDICATED)
|
||||||
dedicated = M_CheckParm("-dedicated") != 0;
|
dedicated = M_CheckParm("-dedicated") != 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
strcpy(title, "SRB2Kart");
|
strcpy(title, "SRB2Kart");
|
||||||
strcpy(srb2, "SRB2Kart");
|
strcpy(srb2, "SRB2Kart");
|
||||||
@@ -1812,7 +1811,7 @@ void D_SRB2Main(void)
|
|||||||
{
|
{
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
|
|
||||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||||
{
|
{
|
||||||
INT16 num;
|
INT16 num;
|
||||||
if (name[5] != '\0')
|
if (name[5] != '\0')
|
||||||
@@ -1842,7 +1841,7 @@ void D_SRB2Main(void)
|
|||||||
{
|
{
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
|
|
||||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||||
{
|
{
|
||||||
INT16 num;
|
INT16 num;
|
||||||
if (name[5] != '\0')
|
if (name[5] != '\0')
|
||||||
|
|||||||
+7
-11
@@ -216,8 +216,11 @@ static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2
|
|||||||
|
|
||||||
static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t sleeping_cons_t[] = {{0, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t sleeping_cons_t[] = {{0, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"}, {3, "None"}, {0, NULL}};
|
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"},
|
||||||
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"}, {3, "None"}, {0, NULL}};
|
{3, "None"}, {0, NULL}};
|
||||||
|
|
||||||
|
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
|
||||||
|
{3, "None"}, {0, NULL}};
|
||||||
|
|
||||||
//static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
//static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}};
|
static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}};
|
||||||
@@ -302,14 +305,12 @@ consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS] = {
|
|||||||
{"verticallook4", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
{"verticallook4", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
|
|
||||||
consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = {
|
consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = {
|
||||||
{"use_joystick", "1", CV_SAVE|CV_CALL, NULL, I_InitJoystick1, 0, NULL, NULL, 0, 0, NULL},
|
{"use_joystick", "1", CV_SAVE|CV_CALL, NULL, I_InitJoystick1, 0, NULL, NULL, 0, 0, NULL},
|
||||||
{"use_joystick2", "2", CV_SAVE|CV_CALL, NULL, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL},
|
{"use_joystick2", "2", CV_SAVE|CV_CALL, NULL, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL},
|
||||||
{"use_joystick3", "3", CV_SAVE|CV_CALL, NULL, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL},
|
{"use_joystick3", "3", CV_SAVE|CV_CALL, NULL, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL},
|
||||||
{"use_joystick4", "4", CV_SAVE|CV_CALL, NULL, I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL}
|
{"use_joystick4", "4", CV_SAVE|CV_CALL, NULL, I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (HAVE_SDL)
|
#if defined (HAVE_SDL)
|
||||||
consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = {
|
consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = {
|
||||||
@@ -2774,7 +2775,7 @@ static void Command_Map_f(void)
|
|||||||
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!mapheaderinfo[newmapnum-1])
|
if (!mapheaderinfo[newmapnum-1] || mapheaderinfo[newmapnum-1] == NULL)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Invalid mapheaderinfo for Course %s (%s)\n"), realmapname, G_BuildMapName(newmapnum));
|
CONS_Alert(CONS_WARNING, M_GetText("Invalid mapheaderinfo for Course %s (%s)\n"), realmapname, G_BuildMapName(newmapnum));
|
||||||
Z_Free(realmapname);
|
Z_Free(realmapname);
|
||||||
@@ -3028,14 +3029,9 @@ static void Command_ReplayMarker(void)
|
|||||||
adjustedleveltime = 0;
|
adjustedleveltime = 0;
|
||||||
|
|
||||||
char *title = G_BuildMapTitle(gamemap);
|
char *title = G_BuildMapTitle(gamemap);
|
||||||
|
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", title, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||||
if (title)
|
if (title)
|
||||||
{
|
|
||||||
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", title, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
|
||||||
Z_Free(title);
|
Z_Free(title);
|
||||||
}
|
|
||||||
else
|
|
||||||
snprintf(demo.titlename, 64, "[%i:%02d/%.5s]", G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
|
||||||
|
|
||||||
CONS_Printf("Replay will be saved!\n");
|
CONS_Printf("Replay will be saved!\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
# Declare dedicated interface sources
|
||||||
|
|
||||||
|
target_sourcefile(c)
|
||||||
|
|
||||||
|
target_sources(SRB2SDL2 PRIVATE)
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Windows)
|
||||||
|
target_sources(SRB2SDL2 PRIVATE
|
||||||
|
../win32/win_dbg.c
|
||||||
|
../win32/Srb2win.rc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Windows)
|
||||||
|
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2legacy)
|
||||||
|
elseif(${CMAKE_SYSTEM} MATCHES Linux)
|
||||||
|
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME lsrb2dlegacy)
|
||||||
|
else()
|
||||||
|
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2legacy)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Darwin)
|
||||||
|
find_library(CORE_LIB CoreFoundation)
|
||||||
|
target_link_libraries(SRB2SDL2 PRIVATE
|
||||||
|
${CORE_LIB}
|
||||||
|
${PNG_LIBRARIES}
|
||||||
|
${ZLIB_LIBRARIES}
|
||||||
|
)
|
||||||
|
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
|
||||||
|
else()
|
||||||
|
target_link_libraries(SRB2SDL2 PRIVATE
|
||||||
|
${PNG_LIBRARIES}
|
||||||
|
${ZLIB_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Linux)
|
||||||
|
target_link_libraries(SRB2SDL2 PRIVATE
|
||||||
|
m
|
||||||
|
rt
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#target_link_libraries(SRB2SDL2 PRIVATE SRB2Core)
|
||||||
|
|
||||||
|
set_target_properties(SRB2SDL2 PROPERTIES VERSION ${SRB2_VERSION})
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Windows)
|
||||||
|
target_link_libraries(SRB2SDL2 PRIVATE
|
||||||
|
ws2_32
|
||||||
|
)
|
||||||
|
target_compile_options(SRB2SDL2 PRIVATE
|
||||||
|
-U_WINDOWS
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(SRB2SDL2 PRIVATE
|
||||||
|
${PNG_INCLUDE_DIRS}
|
||||||
|
${ZLIB_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(SRB2SDL2 PRIVATE
|
||||||
|
-DDEDICATED
|
||||||
|
)
|
||||||
|
|
||||||
|
## strip debug symbols into separate file when using gcc
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||||
|
message(STATUS "Will make separate debug symbols in *.debug")
|
||||||
|
add_custom_command(TARGET SRB2SDL2 POST_BUILD
|
||||||
|
COMMAND ${OBJCOPY} --only-keep-debug $<TARGET_FILE:SRB2SDL2> $<TARGET_FILE:SRB2SDL2>.debug
|
||||||
|
COMMAND ${OBJCOPY} --strip-debug $<TARGET_FILE:SRB2SDL2>
|
||||||
|
COMMAND ${OBJCOPY} --add-gnu-debuglink=$<TARGET_FILE_NAME:SRB2SDL2>.debug $<TARGET_FILE:SRB2SDL2>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#### Installation ####
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Darwin)
|
||||||
|
install(TARGETS SRB2SDL2
|
||||||
|
BUNDLE DESTINATION .
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
install(TARGETS SRB2SDL2 SRB2SDL2
|
||||||
|
RUNTIME DESTINATION .
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Mac bundle fixup
|
||||||
|
# HACK: THIS IS IMPORTANT! See the escaped \${CMAKE_INSTALL_PREFIX}? This
|
||||||
|
# makes it so that var is evaluated LATER during cpack, not right now!
|
||||||
|
# This fixes the quirk where the bundled libraries don't land in the final package
|
||||||
|
# https://cmake.org/pipermail/cmake/2011-March/043532.html
|
||||||
|
#
|
||||||
|
# HOWEVER: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} is NOT escaped, because that var
|
||||||
|
# is only available to us at this step. Read the link: ${CMAKE_INSTALL_PREFIX} at
|
||||||
|
# this current step points to the CMAKE build folder, NOT the folder that CPACK uses.
|
||||||
|
# Therefore, it makes sense to escape that var, but not the other.
|
||||||
|
if(${CMAKE_SYSTEM} MATCHES Darwin)
|
||||||
|
install(CODE "
|
||||||
|
include(BundleUtilities)
|
||||||
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${CPACK_PACKAGE_DESCRIPTION_SUMMARY}.app\"
|
||||||
|
\"\"
|
||||||
|
/Library/Frameworks
|
||||||
|
)"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SRB2_SDL2_AVAILABLE YES PARENT_SCOPE)
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
i_system.c
|
||||||
|
i_main.c
|
||||||
|
i_video.c
|
||||||
|
i_sound.c
|
||||||
|
i_threads.c
|
||||||
|
dosstr.c
|
||||||
|
endtxt.c
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
// Emacs style mode select -*- C++ -*-
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file is in the public domain.
|
||||||
|
// (Re)written by Graue in 2006.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file
|
||||||
|
/// \brief String uppercasing/lowercasing functions for non-DOS non-Win32
|
||||||
|
/// systems
|
||||||
|
|
||||||
|
#include "../doomtype.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_DOSSTR_FUNCS
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int strupr(char *n)
|
||||||
|
{
|
||||||
|
while (*n != '\0')
|
||||||
|
{
|
||||||
|
*n = toupper(*n);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int strlwr(char *n)
|
||||||
|
{
|
||||||
|
while (*n != '\0')
|
||||||
|
{
|
||||||
|
*n = tolower(*n);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
/*
|
||||||
|
* Function to write the SRB2 end message text
|
||||||
|
*
|
||||||
|
* Copyright (C) 1998 by Udo Munk <udo@umserver.umnet.de>
|
||||||
|
*
|
||||||
|
* This code is provided AS IS and there are no guarantees, none.
|
||||||
|
* Feel free to share and modify.
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file
|
||||||
|
/// \brief Support to show ENDOOM text
|
||||||
|
///
|
||||||
|
/// Loads the lump ENDOOM, set up the console to print
|
||||||
|
/// out the colors and text
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
// need this 19990118 by Kin
|
||||||
|
#include "../doomdef.h"
|
||||||
|
#include "../w_wad.h"
|
||||||
|
#include "../z_zone.h"
|
||||||
|
#include "endtxt.h"
|
||||||
|
/** \brief The ShowEndTxt function
|
||||||
|
|
||||||
|
|
||||||
|
Prints out the ENDOOM the way DOOM.EXE/DOOM2.EXE did for Win32 or Linux/GNU
|
||||||
|
|
||||||
|
\return void
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
void ShowEndTxt(void)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
UINT16 j, att = 0;
|
||||||
|
INT32 nlflag = 1;
|
||||||
|
#ifdef _WIN32
|
||||||
|
HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
DWORD mode, bytesWritten;
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO backupcon;
|
||||||
|
COORD resizewin = {80,-1};
|
||||||
|
CHAR let = 0;
|
||||||
|
#endif
|
||||||
|
UINT16 *ptext;
|
||||||
|
void *data;
|
||||||
|
lumpnum_t endoomnum = W_GetNumForName("ENDOOM");
|
||||||
|
//char *col;
|
||||||
|
|
||||||
|
/* if the xterm has more then 80 columns we need to add nl's */
|
||||||
|
/* doesn't work, COLUMNS is not in the environment at this time ???
|
||||||
|
col = I_getenv("COLUMNS");
|
||||||
|
if (col) {
|
||||||
|
if (atoi(col) > 80)
|
||||||
|
nlflag++;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* get the lump with the text */
|
||||||
|
data = ptext = W_CacheLumpNum(endoomnum, PU_CACHE);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (co == INVALID_HANDLE_VALUE || GetFileType(co) != FILE_TYPE_CHAR || !GetConsoleMode(co, &mode)) // test if it a good handle
|
||||||
|
{
|
||||||
|
Z_Free(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
backupcon.wAttributes = FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE; // Just in case
|
||||||
|
GetConsoleScreenBufferInfo(co, &backupcon); //Store old state
|
||||||
|
resizewin.Y = backupcon.dwSize.Y;
|
||||||
|
if (backupcon.dwSize.X < resizewin.X)
|
||||||
|
SetConsoleScreenBufferSize(co, resizewin);
|
||||||
|
|
||||||
|
for (i=1; i<=80*25; i++) // print 80x25 text and deal with the attributes too
|
||||||
|
{
|
||||||
|
j = (UINT16)(*ptext >> 8); // attribute first
|
||||||
|
let = (char)(*ptext & 0xff); // text second
|
||||||
|
if (j != att) // attribute changed?
|
||||||
|
{
|
||||||
|
att = j; // save current attribute
|
||||||
|
SetConsoleTextAttribute(co, j); //set fg and bg color for buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteConsoleA(co, &let, 1, &bytesWritten, NULL); // now the text
|
||||||
|
|
||||||
|
if (nlflag && !(i % 80) && backupcon.dwSize.X > resizewin.X) // do we need a nl?
|
||||||
|
{
|
||||||
|
att = backupcon.wAttributes;
|
||||||
|
SetConsoleTextAttribute(co, att); // all attributes off
|
||||||
|
WriteConsoleA(co, "\n", 1, &bytesWritten, NULL); // newline to console
|
||||||
|
}
|
||||||
|
ptext++;
|
||||||
|
}
|
||||||
|
SetConsoleTextAttribute(co, backupcon.wAttributes); // all attributes off
|
||||||
|
#else
|
||||||
|
/* print 80x25 text and deal with the attributes too */
|
||||||
|
for (i=1; i<=80*25; i++) {
|
||||||
|
/* attribute first */
|
||||||
|
/* attribute changed? */
|
||||||
|
if ((j = *ptext >> 8) != att) {
|
||||||
|
/* save current attribute */
|
||||||
|
att = j;
|
||||||
|
/* set new attribute, forground color first */
|
||||||
|
printf("\033[");
|
||||||
|
switch (j & 0x0f) {
|
||||||
|
case 0: /* black */
|
||||||
|
printf("30");
|
||||||
|
break;
|
||||||
|
case 1: /* blue */
|
||||||
|
printf("34");
|
||||||
|
break;
|
||||||
|
case 2: /* green */
|
||||||
|
printf("32");
|
||||||
|
break;
|
||||||
|
case 3: /* cyan */
|
||||||
|
printf("36");
|
||||||
|
break;
|
||||||
|
case 4: /* red */
|
||||||
|
printf("31");
|
||||||
|
break;
|
||||||
|
case 5: /* magenta */
|
||||||
|
printf("35");
|
||||||
|
break;
|
||||||
|
case 6: /* brown */
|
||||||
|
printf("33");
|
||||||
|
break;
|
||||||
|
case 7: /* bright grey */
|
||||||
|
printf("37");
|
||||||
|
break;
|
||||||
|
case 8: /* dark grey */
|
||||||
|
printf("1;30");
|
||||||
|
break;
|
||||||
|
case 9: /* bright blue */
|
||||||
|
printf("1;34");
|
||||||
|
break;
|
||||||
|
case 10: /* bright green */
|
||||||
|
printf("1;32");
|
||||||
|
break;
|
||||||
|
case 11: /* bright cyan */
|
||||||
|
printf("1;36");
|
||||||
|
break;
|
||||||
|
case 12: /* bright red */
|
||||||
|
printf("1;31");
|
||||||
|
break;
|
||||||
|
case 13: /* bright magenta */
|
||||||
|
printf("1;35");
|
||||||
|
break;
|
||||||
|
case 14: /* yellow */
|
||||||
|
printf("1;33");
|
||||||
|
break;
|
||||||
|
case 15: /* white */
|
||||||
|
printf("1;37");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printf("m");
|
||||||
|
/* now background color */
|
||||||
|
printf("\033[");
|
||||||
|
switch ((j >> 4) & 0x0f) {
|
||||||
|
case 0: /* black */
|
||||||
|
printf("40");
|
||||||
|
break;
|
||||||
|
case 1: /* blue */
|
||||||
|
printf("44");
|
||||||
|
break;
|
||||||
|
case 2: /* green */
|
||||||
|
printf("42");
|
||||||
|
break;
|
||||||
|
case 3: /* cyan */
|
||||||
|
printf("46");
|
||||||
|
break;
|
||||||
|
case 4: /* red */
|
||||||
|
printf("41");
|
||||||
|
break;
|
||||||
|
case 5: /* magenta */
|
||||||
|
printf("45");
|
||||||
|
break;
|
||||||
|
case 6: /* brown */
|
||||||
|
printf("43");
|
||||||
|
break;
|
||||||
|
case 7: /* bright grey */
|
||||||
|
printf("47");
|
||||||
|
break;
|
||||||
|
case 8: /* dark grey */
|
||||||
|
printf("1;40");
|
||||||
|
break;
|
||||||
|
case 9: /* bright blue */
|
||||||
|
printf("1;44");
|
||||||
|
break;
|
||||||
|
case 10: /* bright green */
|
||||||
|
printf("1;42");
|
||||||
|
break;
|
||||||
|
case 11: /* bright cyan */
|
||||||
|
printf("1;46");
|
||||||
|
break;
|
||||||
|
case 12: /* bright red */
|
||||||
|
printf("1;41");
|
||||||
|
break;
|
||||||
|
case 13: /* bright magenta */
|
||||||
|
printf("1;45");
|
||||||
|
break;
|
||||||
|
case 14: /* yellow */
|
||||||
|
printf("1;43");
|
||||||
|
break;
|
||||||
|
case 15: /* white */
|
||||||
|
printf("1;47");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printf("m");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* now the text */
|
||||||
|
printf("%c",*ptext++ & 0xff);
|
||||||
|
|
||||||
|
/* do we need a nl? */
|
||||||
|
if (nlflag)
|
||||||
|
{
|
||||||
|
if (!(i % 80))
|
||||||
|
{
|
||||||
|
printf("\033[0m");
|
||||||
|
att = 0;
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* all attributes off */
|
||||||
|
printf("\033[0m");
|
||||||
|
#endif
|
||||||
|
if (nlflag)
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
Z_Free(data);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Emacs style mode select -*- C++ -*-
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||||
|
//
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU General Public License
|
||||||
|
// as published by the Free Software Foundation; either version 2
|
||||||
|
// of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file
|
||||||
|
/// \brief Support to show ENDOOM text
|
||||||
|
|
||||||
|
#ifndef __ENDTXT__
|
||||||
|
#define __ENDTXT__
|
||||||
|
|
||||||
|
void ShowEndTxt (void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,238 @@
|
|||||||
|
// Emacs style mode select -*- C++ -*-
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||||
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||||
|
//
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU General Public License
|
||||||
|
// as published by the Free Software Foundation; either version 2
|
||||||
|
// of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file
|
||||||
|
/// \brief Main program, simply calls D_SRB2Main and D_SRB2Loop, the high level loop.
|
||||||
|
|
||||||
|
#include "../doomdef.h"
|
||||||
|
#include "../m_argv.h"
|
||||||
|
#include "../d_main.h"
|
||||||
|
#include "../m_misc.h" /* path shit */
|
||||||
|
#include "../i_system.h"
|
||||||
|
#include "../d_clisrv.h"
|
||||||
|
|
||||||
|
#if defined (__GNUC__) || defined (__unix__)
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __unix__
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "time.h" // For log timestamps
|
||||||
|
|
||||||
|
#ifdef HAVE_TTF
|
||||||
|
#include "i_ttf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBBACKTRACE
|
||||||
|
#include <backtrace.h>
|
||||||
|
|
||||||
|
struct backtrace_state *bt_state = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOGMESSAGES
|
||||||
|
FILE *logstream = NULL;
|
||||||
|
char logfilename[1024];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DOXYGEN
|
||||||
|
#ifndef O_TEXT
|
||||||
|
#define O_TEXT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef O_SEQUENTIAL
|
||||||
|
#define O_SEQUENTIAL 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifndef _AMD64_
|
||||||
|
#include "exchndl.h"
|
||||||
|
#define DRMINGW
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (_WIN32)
|
||||||
|
#include "../win32/win_dbg.h"
|
||||||
|
typedef BOOL (WINAPI *p_IsDebuggerPresent)(VOID);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
static void
|
||||||
|
ChDirToExe (void)
|
||||||
|
{
|
||||||
|
CHAR path[MAX_PATH];
|
||||||
|
if (GetModuleFileNameA(NULL, path, MAX_PATH) > 0)
|
||||||
|
{
|
||||||
|
strrchr(path, '\\')[0] = '\0';
|
||||||
|
SetCurrentDirectoryA(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** \brief The main function
|
||||||
|
|
||||||
|
\param argc number of arg
|
||||||
|
\param *argv string table
|
||||||
|
|
||||||
|
\return int
|
||||||
|
*/
|
||||||
|
#if defined (__GNUC__) && (__GNUC__ >= 4)
|
||||||
|
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOGMESSAGES
|
||||||
|
static void InitLogging(void)
|
||||||
|
{
|
||||||
|
const char *logdir = NULL;
|
||||||
|
time_t my_time;
|
||||||
|
struct tm * timeinfo;
|
||||||
|
const char *format;
|
||||||
|
const char *reldir;
|
||||||
|
int left;
|
||||||
|
boolean fileabs;
|
||||||
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
|
const char *link;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
logdir = D_Home();
|
||||||
|
|
||||||
|
my_time = time(NULL);
|
||||||
|
timeinfo = localtime(&my_time);
|
||||||
|
|
||||||
|
if (M_CheckParm("-logfile") && M_IsNextParm())
|
||||||
|
{
|
||||||
|
format = M_GetNextParm();
|
||||||
|
fileabs = M_IsPathAbsolute(format);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format = "log-%Y-%m-%d_%H-%M-%S.txt";
|
||||||
|
fileabs = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileabs)
|
||||||
|
{
|
||||||
|
strftime(logfilename, sizeof logfilename, format, timeinfo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (M_CheckParm("-logdir") && M_IsNextParm())
|
||||||
|
reldir = M_GetNextParm();
|
||||||
|
else
|
||||||
|
reldir = "logs";
|
||||||
|
|
||||||
|
if (M_IsPathAbsolute(reldir))
|
||||||
|
{
|
||||||
|
left = snprintf(logfilename, sizeof logfilename,
|
||||||
|
"%s"PATHSEP, reldir);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#ifdef DEFAULTDIR
|
||||||
|
if (logdir)
|
||||||
|
{
|
||||||
|
left = snprintf(logfilename, sizeof logfilename,
|
||||||
|
"%s"PATHSEP DEFAULTDIR PATHSEP"%s"PATHSEP, logdir, reldir);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif/*DEFAULTDIR*/
|
||||||
|
{
|
||||||
|
left = snprintf(logfilename, sizeof logfilename,
|
||||||
|
"."PATHSEP"%s"PATHSEP, reldir);
|
||||||
|
}
|
||||||
|
|
||||||
|
strftime(&logfilename[left], sizeof logfilename - left,
|
||||||
|
format, timeinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
M_MkdirEachUntil(logfilename,
|
||||||
|
M_PathParts(logdir) - 1,
|
||||||
|
M_PathParts(logfilename) - 1, 0755);
|
||||||
|
|
||||||
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
|
logstream = fopen(logfilename, "w");
|
||||||
|
#ifdef DEFAULTDIR
|
||||||
|
if (logdir)
|
||||||
|
link = va("%s/"DEFAULTDIR"/latest-log.txt", logdir);
|
||||||
|
else
|
||||||
|
#endif/*DEFAULTDIR*/
|
||||||
|
link = "latest-log.txt";
|
||||||
|
unlink(link);
|
||||||
|
if (symlink(logfilename, link) == -1)
|
||||||
|
{
|
||||||
|
I_OutputMsg("Error symlinking latest-log.txt: %s\n", strerror(errno));
|
||||||
|
}
|
||||||
|
#else/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||||
|
logstream = fopen("latest-log.txt", "wt+");
|
||||||
|
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
myargc = argc;
|
||||||
|
myargv = argv; /// \todo pull out path to exe from this string
|
||||||
|
|
||||||
|
dedicated = true;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBBACKTRACE
|
||||||
|
bt_state = backtrace_create_state(
|
||||||
|
argv[0],
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
1,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
ChDirToExe();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOGMESSAGES
|
||||||
|
if (!M_CheckParm("-nolog"))
|
||||||
|
InitLogging();
|
||||||
|
#endif/*LOGMESSAGES*/
|
||||||
|
|
||||||
|
//I_OutputMsg("I_StartupSystem() ...\n");
|
||||||
|
I_StartupSystem();
|
||||||
|
#if defined (_WIN32)
|
||||||
|
{
|
||||||
|
#ifdef DRMINGW
|
||||||
|
ExcHndlInit();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// startup SRB2
|
||||||
|
CONS_Printf("Setting up SRB2Kart...\n");
|
||||||
|
D_SRB2Main();
|
||||||
|
CONS_Printf("Entering main game loop...\n");
|
||||||
|
// never return
|
||||||
|
D_SRB2Loop();
|
||||||
|
|
||||||
|
#ifdef BUGTRAP
|
||||||
|
// This is safe even if BT didn't start.
|
||||||
|
ShutdownBugTrap();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// return to OS
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,339 @@
|
|||||||
|
// Emacs style mode select -*- C++ -*-
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU General Public License
|
||||||
|
// as published by the Free Software Foundation; either version 2
|
||||||
|
// of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The source is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file
|
||||||
|
/// \brief SDL interface for sound
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include "../doomdef.h"
|
||||||
|
#include "../i_sound.h"
|
||||||
|
#include "../s_sound.h"
|
||||||
|
|
||||||
|
/** \brief Sound subsystem runing and waiting
|
||||||
|
*/
|
||||||
|
UINT8 sound_started = false;
|
||||||
|
|
||||||
|
/** \brief The I_GetSfx function
|
||||||
|
|
||||||
|
\param sfx sfx to setup
|
||||||
|
|
||||||
|
\return data for sfx
|
||||||
|
*/
|
||||||
|
void *I_GetSfx(sfxinfo_t *sfx)
|
||||||
|
{
|
||||||
|
(void)sfx;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief The I_FreeSfx function
|
||||||
|
|
||||||
|
\param sfx sfx to be freed up
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_FreeSfx(sfxinfo_t *sfx)
|
||||||
|
{
|
||||||
|
(void)sfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Init at program start...
|
||||||
|
*/
|
||||||
|
void I_StartupSound(void){}
|
||||||
|
|
||||||
|
/** \brief ... shut down and relase at program termination.
|
||||||
|
*/
|
||||||
|
void I_ShutdownSound(void){}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
/// SFX I/O
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
/** \brief Starts a sound in a particular sound channel.
|
||||||
|
\param id sfxid
|
||||||
|
\param vol volume for sound
|
||||||
|
\param sep left-right balancle
|
||||||
|
\param pitch not used
|
||||||
|
\param priority not used
|
||||||
|
|
||||||
|
\return sfx handle
|
||||||
|
*/
|
||||||
|
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
|
||||||
|
{
|
||||||
|
(void)id;
|
||||||
|
(void)vol;
|
||||||
|
(void)sep;
|
||||||
|
(void)pitch;
|
||||||
|
(void)priority;
|
||||||
|
(void)channel;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Stops a sound channel.
|
||||||
|
|
||||||
|
\param handle stop sfx handle
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_StopSound(INT32 handle)
|
||||||
|
{
|
||||||
|
(void)handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Some digital sound drivers need this.
|
||||||
|
*/
|
||||||
|
void I_UpdateSound(void){}
|
||||||
|
|
||||||
|
/** \brief Called by S_*() functions to see if a channel is still playing.
|
||||||
|
|
||||||
|
\param handle sfx handle
|
||||||
|
|
||||||
|
\return 0 if no longer playing, 1 if playing.
|
||||||
|
*/
|
||||||
|
boolean I_SoundIsPlaying(INT32 handle)
|
||||||
|
{
|
||||||
|
(void)handle;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Updates the sfx handle
|
||||||
|
|
||||||
|
\param handle sfx handle
|
||||||
|
\param vol volume
|
||||||
|
\param sep separation
|
||||||
|
\param pitch ptich
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
|
||||||
|
{
|
||||||
|
(void)handle;
|
||||||
|
(void)vol;
|
||||||
|
(void)sep;
|
||||||
|
(void)pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief The I_SetSfxVolume function
|
||||||
|
|
||||||
|
\param volume volume to set at
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_SetSfxVolume(UINT8 volume)
|
||||||
|
{
|
||||||
|
(void)volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
// MUSIC SYSTEM
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
/** \brief Init the music systems
|
||||||
|
*/
|
||||||
|
void I_InitMusic(void){}
|
||||||
|
|
||||||
|
/** \brief Shutdown the music systems
|
||||||
|
*/
|
||||||
|
void I_ShutdownMusic(void){}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
// MUSIC PROPERTIES
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
musictype_t I_SongType(void)
|
||||||
|
{
|
||||||
|
return MU_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_SongPlaying(void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_SongPaused(void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
// MUSIC EFFECTS
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
boolean I_SetSongSpeed(float speed)
|
||||||
|
{
|
||||||
|
(void)speed;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
// MUSIC SEEKING
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
UINT32 I_GetSongLength(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_SetSongLoopPoint(UINT32 looppoint)
|
||||||
|
{
|
||||||
|
(void)looppoint;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT32 I_GetSongLoopPoint(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_SetSongPosition(UINT32 position)
|
||||||
|
{
|
||||||
|
(void)position;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT32 I_GetSongPosition(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
// MUSIC PLAYBACK
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
/** \brief Registers a song handle to song data.
|
||||||
|
|
||||||
|
\param data pointer to song data
|
||||||
|
\param len len of data
|
||||||
|
|
||||||
|
\return song handle
|
||||||
|
|
||||||
|
\todo Remove this
|
||||||
|
*/
|
||||||
|
boolean I_LoadSong(char *data, size_t len)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)len;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief See ::I_LoadSong, then think backwards
|
||||||
|
|
||||||
|
\param handle song handle
|
||||||
|
|
||||||
|
\sa I_LoadSong
|
||||||
|
\todo remove midi handle
|
||||||
|
*/
|
||||||
|
void I_UnloadSong(void){}
|
||||||
|
|
||||||
|
/** \brief Called by anything that wishes to start music
|
||||||
|
|
||||||
|
\param handle Song handle
|
||||||
|
\param looping looping it if true
|
||||||
|
|
||||||
|
\return if true, it's playing the song
|
||||||
|
|
||||||
|
\todo pass music name, not handle
|
||||||
|
*/
|
||||||
|
boolean I_PlaySong(boolean looping)
|
||||||
|
{
|
||||||
|
(void)looping;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Stops a song over 3 seconds
|
||||||
|
|
||||||
|
\param handle Song handle
|
||||||
|
\return void
|
||||||
|
|
||||||
|
/todo drop handle
|
||||||
|
*/
|
||||||
|
void I_StopSong(void){}
|
||||||
|
|
||||||
|
/** \brief PAUSE game handling.
|
||||||
|
|
||||||
|
\param handle song handle
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_PauseSong(void){}
|
||||||
|
|
||||||
|
/** \brief RESUME game handling
|
||||||
|
|
||||||
|
\param handle song handle
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_ResumeSong(void){}
|
||||||
|
|
||||||
|
/** \brief The I_SetMusicVolume function
|
||||||
|
|
||||||
|
\param volume volume to set at
|
||||||
|
|
||||||
|
\return void
|
||||||
|
*/
|
||||||
|
void I_SetMusicVolume(UINT8 volume)
|
||||||
|
{
|
||||||
|
(void)volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_SetSongTrack(INT32 track)
|
||||||
|
{
|
||||||
|
(void)track;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// ------------------------
|
||||||
|
/// MUSIC FADING
|
||||||
|
/// ------------------------
|
||||||
|
|
||||||
|
void I_SetInternalMusicVolume(UINT8 volume)
|
||||||
|
{
|
||||||
|
(void)volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_StopFadingSong(void){}
|
||||||
|
|
||||||
|
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void))
|
||||||
|
{
|
||||||
|
(void)target_volume;
|
||||||
|
(void)source_volume;
|
||||||
|
(void)ms;
|
||||||
|
(void)callback;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void))
|
||||||
|
{
|
||||||
|
(void)target_volume;
|
||||||
|
(void)ms;
|
||||||
|
(void)callback;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_FadeOutStopSong(UINT32 ms)
|
||||||
|
{
|
||||||
|
(void)ms;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
|
||||||
|
{
|
||||||
|
(void)ms;
|
||||||
|
(void)looping;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_UpdateSongLagThreshold(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,364 @@
|
|||||||
|
// SONIC ROBO BLAST 2
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2020-2023 by James R.
|
||||||
|
//
|
||||||
|
// This program is free software distributed under the
|
||||||
|
// terms of the GNU General Public License, version 2.
|
||||||
|
// See the 'LICENSE' file for more details.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file i_threads.c
|
||||||
|
/// \brief Multithreading abstraction
|
||||||
|
|
||||||
|
#if defined (__unix__) || (!defined(__APPLE__) && defined (UNIXCOMMON))
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#include "../i_threads.h"
|
||||||
|
#include "../doomdef.h"
|
||||||
|
|
||||||
|
typedef struct thread_s thread_t;
|
||||||
|
|
||||||
|
struct thread_s
|
||||||
|
{
|
||||||
|
thread_t *next;
|
||||||
|
void *userdata;
|
||||||
|
I_thread_fn func;
|
||||||
|
pthread_t thread;
|
||||||
|
};
|
||||||
|
|
||||||
|
// we use a linked list to avoid moving memory blocks when allocating new threads.
|
||||||
|
static thread_t *thread_list;
|
||||||
|
static pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
static void *HandleThread(void *data)
|
||||||
|
{
|
||||||
|
thread_t *thread = data;
|
||||||
|
thread->func(thread->userdata);
|
||||||
|
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
thread->func = NULL;
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
I_spawn_thread (
|
||||||
|
const char * name,
|
||||||
|
I_thread_fn entry,
|
||||||
|
void * userdata
|
||||||
|
)
|
||||||
|
{
|
||||||
|
thread_t *thread;
|
||||||
|
(void)name;
|
||||||
|
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
thread = thread_list;
|
||||||
|
while (thread != NULL)
|
||||||
|
{
|
||||||
|
if (thread->func == NULL)
|
||||||
|
{
|
||||||
|
// join with the exited thread to release it's resources.
|
||||||
|
pthread_join(thread->thread, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
thread = thread->next;
|
||||||
|
}
|
||||||
|
if (thread == NULL)
|
||||||
|
{
|
||||||
|
thread = malloc(sizeof(thread_t));
|
||||||
|
thread->next = thread_list;
|
||||||
|
thread_list = thread;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread->func = entry;
|
||||||
|
thread->userdata = userdata;
|
||||||
|
pthread_create(&thread->thread, NULL, HandleThread, thread);
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
int I_thread_is_stopped(void)
|
||||||
|
{
|
||||||
|
thread_t *thread;
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
thread = thread_list;
|
||||||
|
while (thread != NULL)
|
||||||
|
{
|
||||||
|
if (thread->func != NULL)
|
||||||
|
{
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
thread = thread->next;
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_start_threads(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_stop_threads(void)
|
||||||
|
{
|
||||||
|
thread_t *thread = thread_list;
|
||||||
|
while (thread != NULL)
|
||||||
|
{
|
||||||
|
// join with all threads here, since finished threads haven't been awaited yet.
|
||||||
|
pthread_join(thread->thread, NULL);
|
||||||
|
thread = thread->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_lock_mutex(I_mutex *anchor)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
if (*anchor == NULL)
|
||||||
|
{
|
||||||
|
pthread_mutexattr_t attr;
|
||||||
|
pthread_mutexattr_init(&attr);
|
||||||
|
|
||||||
|
// SRB2 relies on lock recursion, so we need a mutex configured for that.
|
||||||
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||||
|
*anchor = malloc(sizeof(pthread_mutex_t));
|
||||||
|
pthread_mutex_init(*anchor, &attr);
|
||||||
|
pthread_mutexattr_destroy(&attr);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
pthread_mutex_lock(*anchor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_unlock_mutex(I_mutex id)
|
||||||
|
{
|
||||||
|
pthread_mutex_unlock(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
|
||||||
|
{
|
||||||
|
I_Assert(mutex_id != NULL);
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
if (*cond_anchor == NULL)
|
||||||
|
{
|
||||||
|
*cond_anchor = malloc(sizeof(pthread_cond_t));
|
||||||
|
pthread_cond_init(*cond_anchor, NULL);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
pthread_cond_wait(*cond_anchor, mutex_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_wake_one_cond(I_cond *anchor)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
if (*anchor == NULL)
|
||||||
|
{
|
||||||
|
*anchor = malloc(sizeof(pthread_cond_t));
|
||||||
|
pthread_cond_init(*anchor, NULL);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
pthread_cond_signal(*anchor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_wake_all_cond(I_cond *anchor)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&thread_lock);
|
||||||
|
if (*anchor == NULL)
|
||||||
|
{
|
||||||
|
*anchor = malloc(sizeof(pthread_cond_t));
|
||||||
|
pthread_cond_init(*anchor, NULL);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&thread_lock);
|
||||||
|
pthread_cond_broadcast(*anchor);
|
||||||
|
}
|
||||||
|
#elif defined (_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include "../i_threads.h"
|
||||||
|
#include "../doomdef.h"
|
||||||
|
#include "../doomtype.h"
|
||||||
|
|
||||||
|
typedef struct thread_s thread_t;
|
||||||
|
|
||||||
|
struct thread_s
|
||||||
|
{
|
||||||
|
thread_t *next;
|
||||||
|
void *userdata;
|
||||||
|
I_thread_fn func;
|
||||||
|
HANDLE thread;
|
||||||
|
DWORD thread_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
// we use a linked list to avoid moving memory blocks when allocating new threads.
|
||||||
|
static thread_t *thread_list;
|
||||||
|
static CRITICAL_SECTION thread_lock;
|
||||||
|
|
||||||
|
static DWORD __stdcall HandleThread(void *data)
|
||||||
|
{
|
||||||
|
thread_t *thread = data;
|
||||||
|
thread->func(thread->userdata);
|
||||||
|
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
thread->func = NULL;
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_spawn_thread(const char *name, I_thread_fn entry, void *userdata)
|
||||||
|
{
|
||||||
|
thread_t *thread;
|
||||||
|
(void)name;
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
thread = thread_list;
|
||||||
|
while (thread != NULL)
|
||||||
|
{
|
||||||
|
if (thread->func == NULL)
|
||||||
|
{
|
||||||
|
CloseHandle(thread->thread);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
thread = thread->next;
|
||||||
|
}
|
||||||
|
if (thread == NULL)
|
||||||
|
{
|
||||||
|
thread = malloc(sizeof(thread_t));
|
||||||
|
thread->next = thread_list;
|
||||||
|
thread_list = thread;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread->func = entry;
|
||||||
|
thread->userdata = userdata;
|
||||||
|
thread->thread = CreateThread(NULL, 0, HandleThread, thread, 0, &thread->thread_id);
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
int I_thread_is_stopped(void)
|
||||||
|
{
|
||||||
|
thread_t *thread;
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
thread = thread_list;
|
||||||
|
while (thread != NULL)
|
||||||
|
{
|
||||||
|
if (thread->func != NULL)
|
||||||
|
{
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
thread = thread->next;
|
||||||
|
}
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_start_threads(void)
|
||||||
|
{
|
||||||
|
InitializeCriticalSection(&thread_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_stop_threads(void)
|
||||||
|
{
|
||||||
|
thread_t *thread = thread_list;
|
||||||
|
while (thread != NULL)
|
||||||
|
{
|
||||||
|
WaitForSingleObject(thread->thread, INFINITE);
|
||||||
|
CloseHandle(thread->thread);
|
||||||
|
thread = thread->next;
|
||||||
|
}
|
||||||
|
DeleteCriticalSection(&thread_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_lock_mutex(I_mutex *anchor)
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
if (*anchor == NULL)
|
||||||
|
{
|
||||||
|
*anchor = malloc(sizeof(CRITICAL_SECTION));
|
||||||
|
InitializeCriticalSection(*anchor);
|
||||||
|
}
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
EnterCriticalSection(*anchor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_unlock_mutex(I_mutex id)
|
||||||
|
{
|
||||||
|
LeaveCriticalSection(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
|
||||||
|
{
|
||||||
|
I_Assert(mutex_id != NULL);
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
if (*cond_anchor == NULL)
|
||||||
|
{
|
||||||
|
*cond_anchor = malloc(sizeof(CONDITION_VARIABLE));
|
||||||
|
InitializeConditionVariable(*cond_anchor);
|
||||||
|
}
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
SleepConditionVariableCS(*cond_anchor, mutex_id, INFINITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_wake_one_cond(I_cond *anchor)
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
if (*anchor == NULL)
|
||||||
|
{
|
||||||
|
*anchor = malloc(sizeof(CONDITION_VARIABLE));
|
||||||
|
InitializeConditionVariable(*anchor);
|
||||||
|
}
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
WakeConditionVariable(*anchor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_wake_all_cond(I_cond *anchor)
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&thread_lock);
|
||||||
|
if (*anchor == NULL)
|
||||||
|
{
|
||||||
|
*anchor = malloc(sizeof(CONDITION_VARIABLE));
|
||||||
|
InitializeConditionVariable(*anchor);
|
||||||
|
}
|
||||||
|
LeaveCriticalSection(&thread_lock);
|
||||||
|
WakeAllConditionVariable(*anchor);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void I_spawn_thread(const char *name, I_thread_fn entry, void *userdata)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
entry(userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
int I_thread_is_stopped(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_start_threads(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_stop_threads(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_lock_mutex(I_mutex *anchor)
|
||||||
|
{
|
||||||
|
(void)anchor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_unlock_mutex(I_mutex id)
|
||||||
|
{
|
||||||
|
(void)id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
|
||||||
|
{
|
||||||
|
(void)cond_anchor;
|
||||||
|
(void)mutex_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_wake_one_cond(I_cond *anchor)
|
||||||
|
{
|
||||||
|
(void)anchor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_wake_all_cond(I_cond *anchor)
|
||||||
|
{
|
||||||
|
(void)anchor;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
// Emacs style mode select -*- C++ -*-
|
||||||
|
// SONIC ROBO BLAST 2
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||||
|
// Portions Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||||
|
// Copyright (C) 2014-2018 by Sonic Team Junior.
|
||||||
|
//
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU General Public License
|
||||||
|
// as published by the Free Software Foundation; either version 2
|
||||||
|
// of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/// \file
|
||||||
|
/// \brief SRB2 graphics stuff for dedicated
|
||||||
|
|
||||||
|
#include "../doomdef.h"
|
||||||
|
#include "../i_system.h"
|
||||||
|
#include "../i_video.h"
|
||||||
|
#include "../console.h"
|
||||||
|
#include "../command.h"
|
||||||
|
#include "../i_system.h"
|
||||||
|
#include "../screen.h"
|
||||||
|
|
||||||
|
rendermode_t rendermode = render_none;
|
||||||
|
|
||||||
|
boolean highcolor = false;
|
||||||
|
|
||||||
|
// synchronize page flipping with screen refresh
|
||||||
|
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
static CV_PossibleValue_t keyboardlayout_cons_t[] = {{1,"Default US"}, {2, "Native"}, {3, "AZERTY"}, {0, NULL}};
|
||||||
|
consvar_t cv_keyboardlayout = {"keyboardlayout", "Default US", CV_SAVE, keyboardlayout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
consvar_t cv_alwaysgrabmouse = {"alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
INT32 numcontrollers = 0;
|
||||||
|
|
||||||
|
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||||
|
|
||||||
|
// To disable fullscreen at startup; is set in VID_PrepareModeList
|
||||||
|
boolean allow_fullscreen = false;
|
||||||
|
UINT16 realwidth = BASEVIDWIDTH;
|
||||||
|
UINT16 realheight = BASEVIDHEIGHT;
|
||||||
|
|
||||||
|
extern boolean consolevent;
|
||||||
|
|
||||||
|
void I_GetConsoleEvents(void);
|
||||||
|
|
||||||
|
void I_GetEvent(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_StartupMouse(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_OsPolling
|
||||||
|
//
|
||||||
|
void I_OsPolling(void)
|
||||||
|
{
|
||||||
|
if (consolevent)
|
||||||
|
I_GetConsoleEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_UpdateNoBlit
|
||||||
|
//
|
||||||
|
void I_UpdateNoBlit(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_FinishUpdate
|
||||||
|
//
|
||||||
|
void I_FinishUpdate(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_UpdateNoVsync
|
||||||
|
//
|
||||||
|
void I_UpdateNoVsync(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_ReadScreen
|
||||||
|
//
|
||||||
|
void I_ReadScreen(UINT8 *scr)
|
||||||
|
{
|
||||||
|
(void)scr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// I_SetPalette
|
||||||
|
//
|
||||||
|
void I_SetPalette(RGBA_t *palette)
|
||||||
|
{
|
||||||
|
(void)palette;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return number of fullscreen + X11 modes
|
||||||
|
INT32 VID_NumModes(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *VID_GetModeName(INT32 modenum)
|
||||||
|
{
|
||||||
|
(void)modenum;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
||||||
|
{
|
||||||
|
(void)w;
|
||||||
|
(void)h;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VID_PrepareModeList(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 VID_SetMode(INT32 modeNum)
|
||||||
|
{
|
||||||
|
(void)modeNum;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_StartupGraphics(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void I_ShutdownGraphics(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT32 I_GetRefreshRate(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean I_UseNativeKeyboard(void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
+4
-10
@@ -388,7 +388,7 @@ static void DRPC_GotServerIP(UINT32 address)
|
|||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
static const char *DRPC_GetServerIP(void)
|
static const char *DRPC_GetServerIP(void)
|
||||||
{
|
{
|
||||||
const char *address;
|
const char *address;
|
||||||
|
|
||||||
// If you're connected
|
// If you're connected
|
||||||
if (I_GetNodeAddress && (address = I_GetNodeAddress(servernode)) != NULL)
|
if (I_GetNodeAddress && (address = I_GetNodeAddress(servernode)) != NULL)
|
||||||
@@ -489,7 +489,7 @@ void DRPC_UpdatePresence(void)
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
discordPresence.state = "Private";
|
discordPresence.state = "Private";
|
||||||
#ifdef MASTERSERVER
|
#ifdef MASTERSERVER
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -571,15 +571,9 @@ void DRPC_UpdatePresence(void)
|
|||||||
{
|
{
|
||||||
// Map name on tool tip
|
// Map name on tool tip
|
||||||
char *title = G_BuildMapTitle(gamemap);
|
char *title = G_BuildMapTitle(gamemap);
|
||||||
if (title)
|
snprintf(mapname, 48, "Map: %s", title);
|
||||||
{
|
|
||||||
snprintf(mapname, 48, "Map: %s", title);
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
snprintf(mapname, 48, "Map: UNKNOWN");
|
|
||||||
|
|
||||||
discordPresence.largeImageText = mapname;
|
discordPresence.largeImageText = mapname;
|
||||||
|
Z_Free(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gamestate == GS_LEVEL && Playing())
|
if (gamestate == GS_LEVEL && Playing())
|
||||||
|
|||||||
+5
-11
@@ -3998,6 +3998,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *G_BuildMapTitle(INT32 mapnum)
|
char *G_BuildMapTitle(INT32 mapnum)
|
||||||
{
|
{
|
||||||
char *title = NULL;
|
char *title = NULL;
|
||||||
@@ -6067,19 +6068,15 @@ void G_BeginRecording(void)
|
|||||||
char *title = G_BuildMapTitle(gamemap);
|
char *title = G_BuildMapTitle(gamemap);
|
||||||
|
|
||||||
// Print to a separate temp buffer instead of demo.titlename, so we can use it in M_TextInputSetString
|
// Print to a separate temp buffer instead of demo.titlename, so we can use it in M_TextInputSetString
|
||||||
if (title)
|
snprintf(demotitlename, 64, "%s - %s", title, modeattacking ? "Time Attack" : connectedservername);
|
||||||
{
|
|
||||||
snprintf(demotitlename, 64, "%s - %s", title, modeattacking ? "Time Attack" : connectedservername);
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
snprintf(demotitlename, 64, "%s", modeattacking ? "Time Attack" : connectedservername);
|
|
||||||
|
|
||||||
// Init just in case it isn't initialized already
|
// Init just in case it isn't initialized already
|
||||||
M_TextInputInit(&demo.titlenameinput, demo.titlename, sizeof(demo.titlename));
|
M_TextInputInit(&demo.titlenameinput, demo.titlename, sizeof(demo.titlename));
|
||||||
|
|
||||||
// This will indirectly assign to demo.titlename too
|
// This will indirectly assign to demo.titlename too
|
||||||
M_TextInputSetString(&demo.titlenameinput, demotitlename);
|
M_TextInputSetString(&demo.titlenameinput, demotitlename);
|
||||||
|
|
||||||
|
Z_Free(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
// demo checksum
|
// demo checksum
|
||||||
@@ -8120,9 +8117,6 @@ void G_SaveDemo(void)
|
|||||||
|
|
||||||
UINT8 *p = demobuf.buffer+16; // after version
|
UINT8 *p = demobuf.buffer+16; // after version
|
||||||
UINT32 length;
|
UINT32 length;
|
||||||
#ifdef NOMD5
|
|
||||||
UINT8 i;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Ensure extrainfo pointer is always available, even if no info is present.
|
// Ensure extrainfo pointer is always available, even if no info is present.
|
||||||
if (demoinfo_p && *(UINT32 *)demoinfo_p == 0)
|
if (demoinfo_p && *(UINT32 *)demoinfo_p == 0)
|
||||||
@@ -8177,7 +8171,7 @@ void G_SaveDemo(void)
|
|||||||
length = *(UINT32 *)demoinfo_p;
|
length = *(UINT32 *)demoinfo_p;
|
||||||
WRITEUINT32(demoinfo_p, length);
|
WRITEUINT32(demoinfo_p, length);
|
||||||
#ifdef NOMD5
|
#ifdef NOMD5
|
||||||
for (i = 0; i < 16; i++, p++)
|
for (UINT8 k = 0; k < 16; k++, p++)
|
||||||
*p = M_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct.
|
*p = M_RandomByte(); // This MD5 was chosen by fair dice roll and most likely < 50% correct.
|
||||||
#else
|
#else
|
||||||
// Make a checksum of everything after the checksum in the file up to the end of the standard data. Extrainfo is freely modifiable.
|
// Make a checksum of everything after the checksum in the file up to the end of the standard data. Extrainfo is freely modifiable.
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
hw_bsp.c
|
||||||
|
hw_draw.c
|
||||||
|
hw_main.c
|
||||||
|
hw_clip.c
|
||||||
|
hw_md2.c
|
||||||
|
hw_cache.c
|
||||||
|
hw_md2load.c
|
||||||
|
hw_md3load.c
|
||||||
|
hw_model.c
|
||||||
|
hw_portal.c
|
||||||
|
hw_batching.c
|
||||||
|
hw_shaders.c
|
||||||
|
u_list.c
|
||||||
|
r_opengl/r_opengl.c
|
||||||
@@ -124,7 +124,7 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
|||||||
polygonArray[polygonArraySize].numVerts = iNumPts;
|
polygonArray[polygonArraySize].numVerts = iNumPts;
|
||||||
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
||||||
polygonArray[polygonArraySize].texture = current_texture;
|
polygonArray[polygonArraySize].texture = current_texture;
|
||||||
polygonArray[polygonArraySize].shader = (shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
polygonArray[polygonArraySize].shader = (shader_target != -1) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||||
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
||||||
polygonArraySize++;
|
polygonArraySize++;
|
||||||
|
|
||||||
|
|||||||
+9
-14
@@ -46,16 +46,12 @@ RGBA_t *HWR_GetTexturePalette(void)
|
|||||||
|
|
||||||
static INT32 format2bpp(GLTextureFormat_t format)
|
static INT32 format2bpp(GLTextureFormat_t format)
|
||||||
{
|
{
|
||||||
switch (format)
|
if (format == GL_TEXFMT_RGBA)
|
||||||
{
|
return 4;
|
||||||
case GL_TEXFMT_RGBA:
|
else if (format == GL_TEXFMT_ALPHA_INTENSITY_88 || format == GL_TEXFMT_AP_88)
|
||||||
return 4;
|
return 2;
|
||||||
case GL_TEXFMT_ALPHA_INTENSITY_88:
|
else
|
||||||
case GL_TEXFMT_AP_88:
|
return 1;
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This code was originally placed directly in HWR_DrawPatchInCache.
|
// This code was originally placed directly in HWR_DrawPatchInCache.
|
||||||
@@ -225,6 +221,8 @@ static void HWR_DrawTexturePatchInCache(GLMipmap_t *mipmap,
|
|||||||
if (texture->width <= 0 || texture->height <= 0)
|
if (texture->width <= 0 || texture->height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
palette = HWR_GetTexturePalette();
|
||||||
|
|
||||||
x1 = patch->originx;
|
x1 = patch->originx;
|
||||||
width = SHORT(realpatch->width);
|
width = SHORT(realpatch->width);
|
||||||
height = SHORT(realpatch->height);
|
height = SHORT(realpatch->height);
|
||||||
@@ -236,8 +234,6 @@ static void HWR_DrawTexturePatchInCache(GLMipmap_t *mipmap,
|
|||||||
if (patch->originy > texture->height || (patch->originy + height) < 0)
|
if (patch->originy > texture->height || (patch->originy + height) < 0)
|
||||||
return; // patch not located within texture's y bounds, ignore
|
return; // patch not located within texture's y bounds, ignore
|
||||||
|
|
||||||
palette = HWR_GetTexturePalette();
|
|
||||||
|
|
||||||
// patch is actually inside the texture!
|
// patch is actually inside the texture!
|
||||||
// now check if texture is partly off-screen and adjust accordingly
|
// now check if texture is partly off-screen and adjust accordingly
|
||||||
|
|
||||||
@@ -327,6 +323,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
|||||||
boolean skyspecial = false; // poor hack for Legacy large skies..
|
boolean skyspecial = false; // poor hack for Legacy large skies..
|
||||||
|
|
||||||
RGBA_t *palette;
|
RGBA_t *palette;
|
||||||
|
palette = HWR_GetTexturePalette();
|
||||||
|
|
||||||
texture = textures[texnum];
|
texture = textures[texnum];
|
||||||
|
|
||||||
@@ -364,8 +361,6 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
|||||||
INT32 j;
|
INT32 j;
|
||||||
RGBA_t col;
|
RGBA_t col;
|
||||||
|
|
||||||
palette = HWR_GetTexturePalette();
|
|
||||||
|
|
||||||
col = palette[HWR_CHROMAKEY_EQUIVALENTCOLORINDEX];
|
col = palette[HWR_CHROMAKEY_EQUIVALENTCOLORINDEX];
|
||||||
|
|
||||||
for (idx = 0, j = 0; j < blockheight; j++)
|
for (idx = 0, j = 0; j < blockheight; j++)
|
||||||
|
|||||||
@@ -318,8 +318,6 @@ enum hwdsetspecialstate
|
|||||||
HWD_SET_TEXTUREFILTERMODE,
|
HWD_SET_TEXTUREFILTERMODE,
|
||||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||||
|
|
||||||
HWD_SET_WIREFRAME,
|
|
||||||
|
|
||||||
HWD_SET_MSAA,
|
HWD_SET_MSAA,
|
||||||
|
|
||||||
HWD_SET_SCREEN_TEXTURES,
|
HWD_SET_SCREEN_TEXTURES,
|
||||||
|
|||||||
+15
-29
@@ -226,8 +226,6 @@ consvar_t cv_glsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL,
|
|||||||
|
|
||||||
consvar_t cv_glbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_glbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_glwireframe = {"gr_wireframe", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
|
||||||
|
|
||||||
consvar_t cv_glrenderdistance = {"gr_renderdistance", "Max", CV_SAVE, glrenderdistance_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_glrenderdistance = {"gr_renderdistance", "Max", CV_SAVE, glrenderdistance_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_glhorizonlines = {"gr_horizonlines", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_glhorizonlines = {"gr_horizonlines", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
@@ -340,11 +338,6 @@ static void HWR_SetShaderState(void)
|
|||||||
GL_SetSpecialState(HWD_SET_SHADERS, HWR_UseShader() ? 1 : 0);
|
GL_SetSpecialState(HWD_SET_SHADERS, HWR_UseShader() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean HWR_IsWireframeMode(void)
|
|
||||||
{
|
|
||||||
return (cv_glwireframe.value /*&& cv_debug*/);
|
|
||||||
}
|
|
||||||
|
|
||||||
static boolean HWR_OverrideObjectLightLevel(mobj_t *thing, INT32 *lightlevel)
|
static boolean HWR_OverrideObjectLightLevel(mobj_t *thing, INT32 *lightlevel)
|
||||||
{
|
{
|
||||||
if (R_ThingIsFullBright(thing))
|
if (R_ThingIsFullBright(thing))
|
||||||
@@ -4234,6 +4227,7 @@ static void *HWR_CreateDrawNode(gl_drawnode_type_t type)
|
|||||||
Z_Realloc(drawnodes, alloceddrawnodes * sizeof(gl_drawnode_t), PU_LEVEL, &drawnodes);
|
Z_Realloc(drawnodes, alloceddrawnodes * sizeof(gl_drawnode_t), PU_LEVEL, &drawnodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
drawnode = &drawnodes[numdrawnodes++];
|
drawnode = &drawnodes[numdrawnodes++];
|
||||||
drawnode->type = type;
|
drawnode->type = type;
|
||||||
|
|
||||||
@@ -5265,9 +5259,6 @@ static void HWR_DrawSkyBackground(void)
|
|||||||
if (drewsky)
|
if (drewsky)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (HWR_IsWireframeMode())
|
|
||||||
return;
|
|
||||||
|
|
||||||
GL_SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
GL_SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
||||||
|
|
||||||
memcpy(&dometransform, &atransform, sizeof(FTransform));
|
memcpy(&dometransform, &atransform, sizeof(FTransform));
|
||||||
@@ -5470,8 +5461,8 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
|||||||
HWR_PortalClipping(rootportal);
|
HWR_PortalClipping(rootportal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HWR_IsWireframeMode())
|
// Set transform.
|
||||||
GL_SetSpecialState(HWD_SET_WIREFRAME, 1);
|
GL_SetTransform(&atransform);
|
||||||
|
|
||||||
ps_numbspcalls.value.i = 0;
|
ps_numbspcalls.value.i = 0;
|
||||||
ps_numpolyobjects.value.i = 0;
|
ps_numpolyobjects.value.i = 0;
|
||||||
@@ -5536,9 +5527,6 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
|||||||
ps_hw_nodedrawtime.value.p = 0;
|
ps_hw_nodedrawtime.value.p = 0;
|
||||||
HWR_RenderDrawNodes();
|
HWR_RenderDrawNodes();
|
||||||
|
|
||||||
if (HWR_IsWireframeMode())
|
|
||||||
GL_SetSpecialState(HWD_SET_WIREFRAME, 0);
|
|
||||||
|
|
||||||
HWR_FreePortalList(portallist);
|
HWR_FreePortalList(portallist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5762,7 +5750,7 @@ static void HWR_TogglePaletteRendering(void)
|
|||||||
// If the r_opengl "texture palette" stays the same during this switch, these textures
|
// If the r_opengl "texture palette" stays the same during this switch, these textures
|
||||||
// will not be cleared out. However they are still out of date since the
|
// will not be cleared out. However they are still out of date since the
|
||||||
// composite texture blending method has changed. Therefore they need to be cleared.
|
// composite texture blending method has changed. Therefore they need to be cleared.
|
||||||
HWR_LoadMapTextures(numtextures);
|
GL_ClearMipMapCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5776,7 +5764,7 @@ static void HWR_TogglePaletteRendering(void)
|
|||||||
// If the r_opengl "texture palette" stays the same during this switch, these textures
|
// If the r_opengl "texture palette" stays the same during this switch, these textures
|
||||||
// will not be cleared out. However they are still out of date since the
|
// will not be cleared out. However they are still out of date since the
|
||||||
// composite texture blending method has changed. Therefore they need to be cleared.
|
// composite texture blending method has changed. Therefore they need to be cleared.
|
||||||
HWR_LoadMapTextures(numtextures);
|
GL_ClearMipMapCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5813,8 +5801,6 @@ void HWR_AddCommands(void)
|
|||||||
|
|
||||||
CV_RegisterVar(&cv_glbatching);
|
CV_RegisterVar(&cv_glbatching);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_glwireframe);
|
|
||||||
|
|
||||||
CV_RegisterVar(&cv_glrenderdistance);
|
CV_RegisterVar(&cv_glrenderdistance);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_glhorizonlines);
|
CV_RegisterVar(&cv_glhorizonlines);
|
||||||
@@ -5887,6 +5873,7 @@ static void COM_HWR_glinfo(void)
|
|||||||
CONS_Printf("Unrecognized argument: %s\n", argv);
|
CONS_Printf("Unrecognized argument: %s\n", argv);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CONS_Printf("\x88OpenGL %s\x80\n", gl_version);
|
CONS_Printf("\x88OpenGL %s\x80\n", gl_version);
|
||||||
@@ -6006,19 +5993,19 @@ static void HWR_DoPostProcessor(player_t *player)
|
|||||||
if (cv_glscreentextures.value != 2) // screen textures are needed for the rest of the effects
|
if (cv_glscreentextures.value != 2) // screen textures are needed for the rest of the effects
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//UINT8 viewnum = R_GetViewNumber(); // see below
|
// Capture the screen for intermission and screen waving
|
||||||
|
if (gamestate != GS_INTERMISSION)
|
||||||
|
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC1);
|
||||||
|
|
||||||
|
if (splitscreen) // Not supported in splitscreen - someone want to add support?
|
||||||
|
return;
|
||||||
|
|
||||||
|
//UINT8 viewnum = R_GetViewNumber(); // see above
|
||||||
//camera_t *thiscam = &camera[viewnum];
|
//camera_t *thiscam = &camera[viewnum];
|
||||||
camera_t *thiscam = &camera[0];
|
camera_t *thiscam = &camera[0];
|
||||||
|
|
||||||
// Not supported in splitscreen - someone want to add support?
|
|
||||||
const boolean screenwave = (!splitscreen && (thiscam->postimg & POSTIMG_WATER || thiscam->postimg & POSTIMG_HEAT));
|
|
||||||
|
|
||||||
// Capture the screen for intermission and screen waving
|
|
||||||
if ((lastdraw || screenwave) && gamestate != GS_INTERMISSION)
|
|
||||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC1);
|
|
||||||
|
|
||||||
// Drunken vision! WooOOooo~
|
// Drunken vision! WooOOooo~
|
||||||
if (screenwave)
|
if (thiscam->postimg & POSTIMG_WATER || thiscam->postimg & POSTIMG_HEAT)
|
||||||
{
|
{
|
||||||
// 10 by 10 grid. 2 coordinates (xy)
|
// 10 by 10 grid. 2 coordinates (xy)
|
||||||
float v[SCREENVERTS][SCREENVERTS][2];
|
float v[SCREENVERTS][SCREENVERTS][2];
|
||||||
@@ -6052,7 +6039,6 @@ static void HWR_DoPostProcessor(player_t *player)
|
|||||||
v[x][y][1] = (y/((float)(SCREENVERTS-1.0f)/9.0f))-4.5f;
|
v[x][y][1] = (y/((float)(SCREENVERTS-1.0f)/9.0f))-4.5f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_PostImgRedraw(v);
|
GL_PostImgRedraw(v);
|
||||||
|
|
||||||
// Capture the screen again for screen waving on the intermission
|
// Capture the screen again for screen waving on the intermission
|
||||||
|
|||||||
@@ -202,8 +202,6 @@ extern consvar_t cv_glsolvetjoin;
|
|||||||
|
|
||||||
extern consvar_t cv_glbatching;
|
extern consvar_t cv_glbatching;
|
||||||
|
|
||||||
extern consvar_t cv_glwireframe;
|
|
||||||
|
|
||||||
extern consvar_t cv_glrenderdistance;
|
extern consvar_t cv_glrenderdistance;
|
||||||
|
|
||||||
extern consvar_t cv_glhorizonlines;
|
extern consvar_t cv_glhorizonlines;
|
||||||
@@ -225,7 +223,7 @@ FUNCINLINE static ATTRINLINE boolean HWR_ShouldUsePaletteRendering(void)
|
|||||||
|
|
||||||
FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
|
FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
|
||||||
{
|
{
|
||||||
return (cv_glflashpal.value && HWR_ShouldUsePaletteRendering());
|
return (HWR_ShouldUsePaletteRendering() && cv_glflashpal.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -350,8 +350,6 @@ typedef void (APIENTRY * PFNglDisable) (GLenum cap);
|
|||||||
static PFNglDisable pglDisable;
|
static PFNglDisable pglDisable;
|
||||||
typedef void (APIENTRY * PFNglGetFloatv) (GLenum pname, GLfloat *params);
|
typedef void (APIENTRY * PFNglGetFloatv) (GLenum pname, GLfloat *params);
|
||||||
static PFNglGetFloatv pglGetFloatv;
|
static PFNglGetFloatv pglGetFloatv;
|
||||||
typedef void (APIENTRY * PFNglPolygonMode) (GLenum, GLenum);
|
|
||||||
static PFNglPolygonMode pglPolygonMode;
|
|
||||||
|
|
||||||
/* Depth Buffer */
|
/* Depth Buffer */
|
||||||
typedef void (APIENTRY * PFNglClearDepth) (GLclampd depth);
|
typedef void (APIENTRY * PFNglClearDepth) (GLclampd depth);
|
||||||
@@ -551,7 +549,6 @@ boolean SetupGLfunc(void)
|
|||||||
GETOPENGLFUNC(pglGetFloatv, glGetFloatv)
|
GETOPENGLFUNC(pglGetFloatv, glGetFloatv)
|
||||||
GETOPENGLFUNC(pglGetIntegerv, glGetIntegerv)
|
GETOPENGLFUNC(pglGetIntegerv, glGetIntegerv)
|
||||||
GETOPENGLFUNC(pglGetString, glGetString)
|
GETOPENGLFUNC(pglGetString, glGetString)
|
||||||
GETOPENGLFUNC(pglPolygonMode, glPolygonMode)
|
|
||||||
|
|
||||||
GETOPENGLFUNC(pglClearDepth, glClearDepth)
|
GETOPENGLFUNC(pglClearDepth, glClearDepth)
|
||||||
GETOPENGLFUNC(pglDepthFunc, glDepthFunc)
|
GETOPENGLFUNC(pglDepthFunc, glDepthFunc)
|
||||||
@@ -2367,10 +2364,6 @@ void GL_SetSpecialState(hwdspecialstate_t IdState, INT32 Value)
|
|||||||
GL_Flush(); //??? if we want to change filter mode by texture, remove this
|
GL_Flush(); //??? if we want to change filter mode by texture, remove this
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HWD_SET_WIREFRAME:
|
|
||||||
pglPolygonMode(GL_FRONT_AND_BACK, Value ? GL_LINE : GL_FILL);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HWD_SET_TEXTURE_FORMAT:
|
case HWD_SET_TEXTURE_FORMAT:
|
||||||
gltexformat = (Value == 32) ? GL_RGBA : GL_RGB5_A1;
|
gltexformat = (Value == 32) ? GL_RGBA : GL_RGB5_A1;
|
||||||
GL_Flush();
|
GL_Flush();
|
||||||
|
|||||||
@@ -259,6 +259,8 @@ INT32 HU_FallBackFrSpecialLetter(INT32 key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static char cechotext[1024];
|
static char cechotext[1024];
|
||||||
static tic_t cechotimer = 0;
|
static tic_t cechotimer = 0;
|
||||||
static tic_t cechoduration = 5*TICRATE;
|
static tic_t cechoduration = 5*TICRATE;
|
||||||
|
|||||||
+16
-4
@@ -1260,10 +1260,15 @@ extern int lib_hudadd(lua_State *L);
|
|||||||
|
|
||||||
static int lib_hudsetvotebackground(lua_State *L)
|
static int lib_hudsetvotebackground(lua_State *L)
|
||||||
{
|
{
|
||||||
memset(VoteScreen.luaPrefix, 0, sizeof(VoteScreen.luaPrefix));
|
|
||||||
|
|
||||||
if (lua_isnoneornil(L, 1))
|
if (lua_isnoneornil(L, 1))
|
||||||
{
|
{
|
||||||
|
if (luaVoteScreen)
|
||||||
|
{
|
||||||
|
free(luaVoteScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
luaVoteScreen = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1274,8 +1279,15 @@ static int lib_hudsetvotebackground(lua_State *L)
|
|||||||
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(VoteScreen.luaPrefix, prefix, 4);
|
if (!luaVoteScreen)
|
||||||
strupr(VoteScreen.luaPrefix);
|
{
|
||||||
|
luaVoteScreen = (char*)malloc(5);
|
||||||
|
luaVoteScreen[4] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy(luaVoteScreen, prefix, 4);
|
||||||
|
|
||||||
|
strupr(luaVoteScreen);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-36
@@ -7133,7 +7133,7 @@ static void DrawReplayHutReplayInfo(void)
|
|||||||
|
|
||||||
case MD_OUTDATED:
|
case MD_OUTDATED:
|
||||||
V_DrawThinString(17, 64, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT|highlightflags, va("Recorded on an outdated version. %s", demolist[dir_on[menudepthleft]].version));
|
V_DrawThinString(17, 64, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT|highlightflags, va("Recorded on an outdated version. %s", demolist[dir_on[menudepthleft]].version));
|
||||||
/*fallthru*/
|
/* FALLTHRU */
|
||||||
default:
|
default:
|
||||||
// Draw level stuff
|
// Draw level stuff
|
||||||
x = 15; y = 15;
|
x = 15; y = 15;
|
||||||
@@ -7167,11 +7167,8 @@ static void DrawReplayHutReplayInfo(void)
|
|||||||
if (mapheaderinfo[demolist[dir_on[menudepthleft]].map-1])
|
if (mapheaderinfo[demolist[dir_on[menudepthleft]].map-1])
|
||||||
{
|
{
|
||||||
char *title = G_BuildMapTitle(demolist[dir_on[menudepthleft]].map);
|
char *title = G_BuildMapTitle(demolist[dir_on[menudepthleft]].map);
|
||||||
if (title)
|
V_DrawString(x, y, V_SNAPTOTOP|MENUCAPS, title);
|
||||||
{
|
Z_Free(title);
|
||||||
V_DrawString(x, y, V_SNAPTOTOP|MENUCAPS, title);
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawString(x, y, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
|
V_DrawString(x, y, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
|
||||||
@@ -8123,9 +8120,6 @@ UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES];
|
|||||||
|
|
||||||
static char *M_GetConditionString(condition_t cond)
|
static char *M_GetConditionString(condition_t cond)
|
||||||
{
|
{
|
||||||
char *title = NULL;
|
|
||||||
char *response = NULL;
|
|
||||||
|
|
||||||
switch(cond.type)
|
switch(cond.type)
|
||||||
{
|
{
|
||||||
case UC_PLAYTIME:
|
case UC_PLAYTIME:
|
||||||
@@ -8152,45 +8146,33 @@ static char *M_GetConditionString(condition_t cond)
|
|||||||
G_TicsToSeconds(cond.requirement));
|
G_TicsToSeconds(cond.requirement));
|
||||||
case UC_MAPVISITED:
|
case UC_MAPVISITED:
|
||||||
{
|
{
|
||||||
title = G_BuildMapTitle(cond.requirement-1);
|
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||||
if (title)
|
char *response = va("Visit %s", title);
|
||||||
{
|
Z_Free(title);
|
||||||
response = va("Visit %s", title);
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
case UC_MAPBEATEN:
|
case UC_MAPBEATEN:
|
||||||
{
|
{
|
||||||
title = G_BuildMapTitle(cond.requirement-1);
|
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||||
if (title)
|
char *response = va("Beat %s", title);
|
||||||
{
|
Z_Free(title);
|
||||||
response = va("Beat %s", title);
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
case UC_MAPALLEMERALDS:
|
case UC_MAPALLEMERALDS:
|
||||||
{
|
{
|
||||||
title = G_BuildMapTitle(cond.requirement-1);
|
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||||
if (title)
|
char *response = va("Beat %s w/ all emeralds", title);
|
||||||
{
|
Z_Free(title);
|
||||||
response = va("Beat %s w/ all emeralds", title);
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
case UC_MAPTIME:
|
case UC_MAPTIME:
|
||||||
{
|
{
|
||||||
title = G_BuildMapTitle(cond.extrainfo1-1);
|
char *title = G_BuildMapTitle(cond.extrainfo1-1);
|
||||||
if (title)
|
char *response = va("Beat %s in %i:%02i.%02i", title,
|
||||||
{
|
G_TicsToMinutes(cond.requirement, true),
|
||||||
response = va("Beat %s in %i:%02i.%02i", title,
|
G_TicsToSeconds(cond.requirement),
|
||||||
G_TicsToMinutes(cond.requirement, true),
|
G_TicsToCentiseconds(cond.requirement));
|
||||||
G_TicsToSeconds(cond.requirement),
|
Z_Free(title);
|
||||||
G_TicsToCentiseconds(cond.requirement));
|
|
||||||
Z_Free(title);
|
|
||||||
}
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
case UC_TOTALEMBLEMS:
|
case UC_TOTALEMBLEMS:
|
||||||
|
|||||||
+2
-1
@@ -55,12 +55,13 @@
|
|||||||
|
|
||||||
#ifdef HAVE_SDL
|
#ifdef HAVE_SDL
|
||||||
#include "sdl/hwsym_sdl.h"
|
#include "sdl/hwsym_sdl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#ifndef _LARGEFILE64_SOURCE
|
#ifndef _LARGEFILE64_SOURCE
|
||||||
typedef off_t off64_t;
|
typedef off_t off64_t;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8)
|
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8)
|
||||||
#define PRIdS "u"
|
#define PRIdS "u"
|
||||||
|
|||||||
@@ -26,6 +26,12 @@
|
|||||||
|
|
||||||
#if defined (STDC_HEADERS) || defined (_LIBC)
|
#if defined (STDC_HEADERS) || defined (_LIBC)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#else
|
||||||
|
#ifndef HAVE_MEMCPY
|
||||||
|
#if !(defined (_WIN32) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||||
|
#define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
|
|||||||
+2
-2
@@ -7025,7 +7025,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||||||
P_RemoveMobj(mobj);
|
P_RemoveMobj(mobj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// fallthru
|
/* FALLTHRU */
|
||||||
case MT_ORBINAUT_SHIELD:
|
case MT_ORBINAUT_SHIELD:
|
||||||
case MT_BANANA_SHIELD:
|
case MT_BANANA_SHIELD:
|
||||||
case MT_EGGMANITEM_SHIELD:
|
case MT_EGGMANITEM_SHIELD:
|
||||||
@@ -7035,7 +7035,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||||||
case MT_JAWZ_DUD:
|
case MT_JAWZ_DUD:
|
||||||
if (P_IsObjectOnGround(mobj))
|
if (P_IsObjectOnGround(mobj))
|
||||||
P_SetMobjState(mobj, mobj->info->xdeathstate);
|
P_SetMobjState(mobj, mobj->info->xdeathstate);
|
||||||
// fallthru
|
/* FALLTHRU */
|
||||||
case MT_JAWZ_SHIELD:
|
case MT_JAWZ_SHIELD:
|
||||||
mobj->flags2 ^= MF2_DONTDRAW;
|
mobj->flags2 ^= MF2_DONTDRAW;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+114
-143
@@ -67,8 +67,6 @@
|
|||||||
#include "lua_script.h"
|
#include "lua_script.h"
|
||||||
#include "lua_hook.h"
|
#include "lua_hook.h"
|
||||||
|
|
||||||
#include "y_inter.h"
|
|
||||||
|
|
||||||
#if !defined (UNDER_CE)
|
#if !defined (UNDER_CE)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -2870,9 +2868,12 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||||
F_WipeEndScreen();
|
F_WipeEndScreen();
|
||||||
|
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false);
|
||||||
|
}
|
||||||
|
else //dedicated servers
|
||||||
|
{
|
||||||
|
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the palette now all fades have been done
|
// Reset the palette now all fades have been done
|
||||||
@@ -3108,128 +3109,11 @@ boolean P_AddWadFile(const char *wadfilename, boolean local)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t sreplaces = 0, mreplaces = 0, digmreplaces = 0;
|
// check for replacement votescreen backgrounds
|
||||||
|
boolean wideracereplaced = false;
|
||||||
//
|
boolean racereplaced = false;
|
||||||
// search for sound replacements
|
boolean widebattlereplaced = false;
|
||||||
//
|
boolean battlereplaced = false;
|
||||||
static boolean P_CheckSoundReplacements(UINT16 wadnum, char *name, size_t i)
|
|
||||||
{
|
|
||||||
size_t j;
|
|
||||||
lumpnum_t lumpnum = (i|(wadnum<<16));
|
|
||||||
|
|
||||||
if (name[0] == 'D')
|
|
||||||
{
|
|
||||||
if (name[1] == 'S')
|
|
||||||
{
|
|
||||||
for (j = 1; j < NUMSFX; j++)
|
|
||||||
{
|
|
||||||
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6)
|
|
||||||
&& (S_sfx[j].lumpnum != lumpnum) && (S_sfx[j].lumpnum != LUMPERROR))
|
|
||||||
{
|
|
||||||
// the sound will be reloaded when needed,
|
|
||||||
// since sfx->data will be NULL
|
|
||||||
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
|
||||||
|
|
||||||
I_FreeSfx(&S_sfx[j]);
|
|
||||||
|
|
||||||
// Re-cache it
|
|
||||||
if (S_PrecacheSound())
|
|
||||||
S_sfx[j].data = I_GetSfx(&S_sfx[j]);
|
|
||||||
|
|
||||||
sreplaces++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (name[1] == '_')
|
|
||||||
{
|
|
||||||
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
|
|
||||||
mreplaces++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (name[0] == 'O' && name[1] == '_')
|
|
||||||
{
|
|
||||||
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
|
|
||||||
digmreplaces++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// search for maps
|
|
||||||
//
|
|
||||||
static boolean P_CheckMapReplacements(char *name)
|
|
||||||
{
|
|
||||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
|
||||||
{
|
|
||||||
INT16 num;
|
|
||||||
|
|
||||||
if (name[5] != '\0')
|
|
||||||
return false;
|
|
||||||
|
|
||||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
|
||||||
|
|
||||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
|
||||||
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
|
||||||
{
|
|
||||||
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
|
||||||
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
|
||||||
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (num == gamemap)
|
|
||||||
partadd_replacescurrentmap = true;
|
|
||||||
|
|
||||||
CONS_Printf("%s\n", name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// check for non Lua votescreen replacements
|
|
||||||
//
|
|
||||||
static boolean P_CheckVoteReplacements(char *name)
|
|
||||||
{
|
|
||||||
// widescreen patch Race
|
|
||||||
if (!VoteScreen.replaced.widerace && !memcmp(name, "INTERSCW", 8))
|
|
||||||
{
|
|
||||||
VoteScreen.replaced.widerace = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!VoteScreen.replaced.race && !memcmp(name, "INTERSCR", 8))
|
|
||||||
{
|
|
||||||
VoteScreen.replaced.race = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// widescreen patch Battle
|
|
||||||
if (!VoteScreen.replaced.widebattle && !memcmp(name, "BATTLSCW", 8))
|
|
||||||
{
|
|
||||||
VoteScreen.replaced.widebattle = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!VoteScreen.replaced.battle && !memcmp(name, "BATTLSCR", 8))
|
|
||||||
{
|
|
||||||
VoteScreen.replaced.battle = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VoteScreen.replaced.widerace && VoteScreen.replaced.race
|
|
||||||
&& VoteScreen.replaced.widebattle && VoteScreen.replaced.battle)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add a WAD file and do the per-WAD setup stages.
|
// Add a WAD file and do the per-WAD setup stages.
|
||||||
@@ -3237,15 +3121,12 @@ static boolean P_CheckVoteReplacements(char *name)
|
|||||||
//
|
//
|
||||||
UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i, j, sreplaces = 0, mreplaces = 0, digmreplaces = 0;
|
||||||
UINT16 numlumps, wadnum;
|
UINT16 numlumps, wadnum;
|
||||||
char *name;
|
char *name;
|
||||||
boolean mapsadded = false;
|
boolean mapsadded = false;
|
||||||
static boolean allvotereplaced = false;
|
|
||||||
lumpinfo_t *lumpinfo;
|
lumpinfo_t *lumpinfo;
|
||||||
|
|
||||||
sreplaces = mreplaces = digmreplaces = 0;
|
|
||||||
|
|
||||||
if ((numlumps = W_InitFile(wadfilename, local)) == INT16_MAX)
|
if ((numlumps = W_InitFile(wadfilename, local)) == INT16_MAX)
|
||||||
{
|
{
|
||||||
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
||||||
@@ -3260,24 +3141,46 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
|
|
||||||
wadfiles[wadnum]->localfile = local;
|
wadfiles[wadnum]->localfile = local;
|
||||||
|
|
||||||
|
//
|
||||||
|
// search for sound replacements
|
||||||
|
//
|
||||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||||
{
|
{
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
|
lumpnum_t lumpnum = i|(wadnum<<16);
|
||||||
|
|
||||||
if (P_CheckSoundReplacements(wadnum, name, i))
|
if (name[0] == 'D')
|
||||||
continue;
|
|
||||||
|
|
||||||
if (P_CheckMapReplacements(name))
|
|
||||||
{
|
{
|
||||||
mapsadded = true;
|
if (name[1] == 'S') for (j = 1; j < NUMSFX; j++)
|
||||||
continue;
|
{
|
||||||
|
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6) && S_sfx[j].lumpnum != lumpnum && S_sfx[j].lumpnum != LUMPERROR)
|
||||||
|
{
|
||||||
|
// the sound will be reloaded when needed,
|
||||||
|
// since sfx->data will be NULL
|
||||||
|
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
||||||
|
|
||||||
|
I_FreeSfx(&S_sfx[j]);
|
||||||
|
|
||||||
|
// Re-cache it
|
||||||
|
if (S_PrecacheSound())
|
||||||
|
S_sfx[j].data = I_GetSfx(&S_sfx[j]);
|
||||||
|
|
||||||
|
sreplaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (name[1] == '_')
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
|
||||||
|
mreplaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (name[0] == 'O' && name[1] == '_')
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
|
||||||
|
digmreplaces++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allvotereplaced && P_CheckVoteReplacements(name))
|
|
||||||
allvotereplaced = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!devparm && sreplaces)
|
if (!devparm && sreplaces)
|
||||||
CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces));
|
CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces));
|
||||||
if (!devparm && mreplaces)
|
if (!devparm && mreplaces)
|
||||||
@@ -3285,9 +3188,6 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
if (!devparm && digmreplaces)
|
if (!devparm && digmreplaces)
|
||||||
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
|
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
|
||||||
|
|
||||||
if (!mapsadded)
|
|
||||||
CONS_Printf(M_GetText("No maps added\n"));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// search for sprite replacements
|
// search for sprite replacements
|
||||||
//
|
//
|
||||||
@@ -3312,9 +3212,80 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
//
|
//
|
||||||
S_LoadMusicDefs(wadnum);
|
S_LoadMusicDefs(wadnum);
|
||||||
|
|
||||||
|
//
|
||||||
|
// search for maps
|
||||||
|
//
|
||||||
|
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||||
|
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||||
|
{
|
||||||
|
name = lumpinfo->name;
|
||||||
|
|
||||||
|
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||||
|
{
|
||||||
|
INT16 num;
|
||||||
|
if (name[5]!='\0')
|
||||||
|
continue;
|
||||||
|
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||||
|
|
||||||
|
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||||
|
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
||||||
|
{
|
||||||
|
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
||||||
|
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
||||||
|
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num == gamemap)
|
||||||
|
partadd_replacescurrentmap = true;
|
||||||
|
|
||||||
|
CONS_Printf("%s\n", name);
|
||||||
|
mapsadded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!mapsadded)
|
||||||
|
CONS_Printf(M_GetText("No maps added\n"));
|
||||||
|
|
||||||
// TODO: Experimental SPRTINFO support, test first
|
// TODO: Experimental SPRTINFO support, test first
|
||||||
R_LoadSpriteInfoLumps(wadnum, wadfiles[wadnum]->numlumps);
|
R_LoadSpriteInfoLumps(wadnum, wadfiles[wadnum]->numlumps);
|
||||||
|
|
||||||
|
//
|
||||||
|
// check for votescreen replacements
|
||||||
|
//
|
||||||
|
if (!wideracereplaced && !racereplaced && !widebattlereplaced && !battlereplaced)
|
||||||
|
{
|
||||||
|
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||||
|
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||||
|
{
|
||||||
|
name = lumpinfo->name;
|
||||||
|
|
||||||
|
// widescreen patch Race
|
||||||
|
if (!wideracereplaced && !strncmp(name, "INTERSCW", 8))
|
||||||
|
{
|
||||||
|
wideracereplaced = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!racereplaced && !strncmp(name, "INTERSCR", 8))
|
||||||
|
{
|
||||||
|
racereplaced = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// widescreen patch Battle
|
||||||
|
if (!widebattlereplaced && !strncmp(name, "BATTLSCW", 8))
|
||||||
|
{
|
||||||
|
widebattlereplaced = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!battlereplaced && !strncmp(name, "BATTLSCR", 8))
|
||||||
|
{
|
||||||
|
battlereplaced = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
refreshdirmenu &= ~REFRESHDIR_GAMEDATA; // Under usual circumstances we'd wait for REFRESHDIR_GAMEDATA to disappear the next frame, but it's a bit too dangerous for that...
|
refreshdirmenu &= ~REFRESHDIR_GAMEDATA; // Under usual circumstances we'd wait for REFRESHDIR_GAMEDATA to disappear the next frame, but it's a bit too dangerous for that...
|
||||||
partadd_stage = 0;
|
partadd_stage = 0;
|
||||||
return wadnum;
|
return wadnum;
|
||||||
|
|||||||
@@ -68,6 +68,11 @@ void HWR_LoadLevel(boolean reloadinggamestate);
|
|||||||
|
|
||||||
boolean P_AddWadFile(const char *wadfilename, boolean local);
|
boolean P_AddWadFile(const char *wadfilename, boolean local);
|
||||||
|
|
||||||
|
extern boolean wideracereplaced;
|
||||||
|
extern boolean racereplaced;
|
||||||
|
extern boolean widebattlereplaced;
|
||||||
|
extern boolean battlereplaced;
|
||||||
|
|
||||||
// WARNING: The following functions should be grouped as follows:
|
// WARNING: The following functions should be grouped as follows:
|
||||||
// any amount of PartialAdds followed by MultiSetups until returned true,
|
// any amount of PartialAdds followed by MultiSetups until returned true,
|
||||||
// as soon as possible.
|
// as soon as possible.
|
||||||
|
|||||||
+1
-1
@@ -668,7 +668,7 @@ typedef struct
|
|||||||
INT16 height;
|
INT16 height;
|
||||||
INT16 leftoffset; // pixels to the left of origin
|
INT16 leftoffset; // pixels to the left of origin
|
||||||
INT16 topoffset; // pixels below the origin
|
INT16 topoffset; // pixels below the origin
|
||||||
INT32 columnofs[]; // only [width] used
|
INT32 columnofs[8]; // only [width] used
|
||||||
// the [0] is &columnofs[width]
|
// the [0] is &columnofs[width]
|
||||||
} ATTRPACK softwarepatch_t;
|
} ATTRPACK softwarepatch_t;
|
||||||
|
|
||||||
|
|||||||
+7
-8
@@ -125,17 +125,16 @@ static CV_PossibleValue_t drawdist_cons_t[] = {
|
|||||||
{8192, "8192"}, {12288, "12288"}, {20480, "20480"},
|
{8192, "8192"}, {12288, "12288"}, {20480, "20480"},
|
||||||
{24576, "24576"},{0, "Infinite"}, {0, NULL}};
|
{24576, "24576"},{0, "Infinite"}, {0, NULL}};
|
||||||
|
|
||||||
#if __SIZEOF_POINTER__ < 8 // only for 64bit
|
#if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) || defined(__arm64__) // only for 64bit (idk how else to proper check lmao)
|
||||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||||
{256, "256"}, {512, "512"}, {768, "768"},
|
{256, "256"}, {512, "512"}, {768, "768"},
|
||||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
|
||||||
{0, "None"}, {0, NULL}};
|
|
||||||
|
|
||||||
#else
|
|
||||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
|
||||||
{256, "256"}, {512, "512"}, {768, "768"},
|
|
||||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||||
{3072, "3072"}, {4096, "4096"}, {0, "None"}, {0, NULL}};
|
{3072, "3072"}, {4096, "4096"}, {0, "None"}, {0, NULL}};
|
||||||
|
#else
|
||||||
|
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||||
|
{256, "256"}, {512, "512"}, {768, "768"},
|
||||||
|
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||||
|
{0, "None"}, {0, NULL}};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static CV_PossibleValue_t maxinterpdist_cons_t[] = {
|
static CV_PossibleValue_t maxinterpdist_cons_t[] = {
|
||||||
|
|||||||
+3
-6
@@ -2042,12 +2042,9 @@ static boolean S_SkipIntroMusic(void)
|
|||||||
|
|
||||||
char *maptitle = G_BuildMapTitle(gamemap); // Zzz...
|
char *maptitle = G_BuildMapTitle(gamemap); // Zzz...
|
||||||
|
|
||||||
if (maptitle)
|
// check if menu music is playing, otherwise it may continue playing
|
||||||
{
|
if (!stricmp(music.name, "titles") || (maptitle && (!stricmp(maptitle, "Wandering Falls")))) // wandering balls changes its song when the race starts Zzz...
|
||||||
// check if menu music is playing, otherwise it may continue playing
|
skip = false;
|
||||||
if (!stricmp(music.name, "titles") || (maptitle && (!stricmp(maptitle, "Wandering Falls")))) // wandering balls changes its song when the race starts Zzz...
|
|
||||||
skip = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Z_Free(maptitle);
|
Z_Free(maptitle);
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
#
|
|
||||||
# sdl/makeCYG.cfg for SRB2/Cygwin
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
#Cygwin, for debugging
|
|
||||||
|
|
||||||
NOHW=1
|
|
||||||
NOHS=1
|
|
||||||
|
|
||||||
OPTS+=-DLINUX
|
|
||||||
|
|
||||||
i_system_o+=$(OBJDIR)/SRB2.res
|
|
||||||
|
|
||||||
# name of the exefile
|
|
||||||
EXENAME?=lsdlsrb2.exe
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
#
|
|
||||||
# sdl/makeNIX.cfg for SRB2/?nix
|
|
||||||
#
|
|
||||||
|
|
||||||
#Valgrind support
|
|
||||||
ifdef VALGRIND
|
|
||||||
VALGRIND_PKGCONFIG?=valgrind
|
|
||||||
VALGRIND_CFLAGS?=$(shell $(PKG_CONFIG) $(VALGRIND_PKGCONFIG) --cflags)
|
|
||||||
VALGRIND_LDFLAGS?=$(shell $(PKG_CONFIG) $(VALGRIND_PKGCONFIG) --libs)
|
|
||||||
ZDEBUG=1
|
|
||||||
LIBS+=$(VALGRIND_LDFLAGS)
|
|
||||||
ifdef GCC46
|
|
||||||
WFLAGS+=-Wno-error=unused-but-set-variable
|
|
||||||
WFLAGS+=-Wno-unused-but-set-variable
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
#here is GNU/Linux and other
|
|
||||||
#
|
|
||||||
|
|
||||||
OPTS=-DUNIXCOMMON
|
|
||||||
|
|
||||||
#Use -rdynamic so a backtrace log shows function names instead of addresses
|
|
||||||
LDFLAGS+=-rdynamic
|
|
||||||
|
|
||||||
#LDFLAGS = -L/usr/local/lib
|
|
||||||
LIBS=-lm
|
|
||||||
ifdef LINUX
|
|
||||||
LIBS+=-lrt
|
|
||||||
ifdef NOTERMIOS
|
|
||||||
OPTS+=-DNOTERMIOS
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef LINUX64
|
|
||||||
OPTS+=-DLINUX64
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
#here is Solaris
|
|
||||||
#
|
|
||||||
ifdef SOLARIS
|
|
||||||
NOIPX=1
|
|
||||||
OPTS+=-DSOLARIS -DINADDR_NONE=INADDR_ANY -DBSD_COMP
|
|
||||||
OPTS+=-I/usr/local/include -I/opt/sfw/include
|
|
||||||
LDFLAGS+=-L/opt/sfw/lib
|
|
||||||
LIBS+=-lsocket -lnsl
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
#here is FreeBSD
|
|
||||||
#
|
|
||||||
ifdef FREEBSD
|
|
||||||
OPTS+=-DLINUX -DFREEBSD -I/usr/X11R6/include
|
|
||||||
SDL_CONFIG?=sdl11-config
|
|
||||||
LDFLAGS+=-L/usr/X11R6/lib
|
|
||||||
LIBS+=-lkvm -lexecinfo
|
|
||||||
endif
|
|
||||||
|
|
||||||
#
|
|
||||||
#here is Mac OS X
|
|
||||||
#
|
|
||||||
ifdef MACOSX
|
|
||||||
OBJS+=$(OBJDIR)/mac_resources.o
|
|
||||||
OBJS+=$(OBJDIR)/mac_alert.o
|
|
||||||
LIBS+=-framework CoreFoundation
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NOHW
|
|
||||||
OPTS+=-I/usr/X11R6/include
|
|
||||||
LDFLAGS+=-L/usr/X11R6/lib
|
|
||||||
endif
|
|
||||||
|
|
||||||
# name of the exefile
|
|
||||||
EXENAME?=lsdl2srb2kart
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
#
|
|
||||||
# sdl/makefile.cfg for SRB2/SDL
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
#SDL...., *looks at Alam*, THIS IS A MESS!
|
|
||||||
#
|
|
||||||
|
|
||||||
ifdef UNIXCOMMON
|
|
||||||
include sdl/MakeNIX.cfg
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef PANDORA
|
|
||||||
include sdl/SRB2Pandora/Makefile.cfg
|
|
||||||
endif #ifdef PANDORA
|
|
||||||
|
|
||||||
ifdef CYGWIN32
|
|
||||||
include sdl/MakeCYG.cfg
|
|
||||||
endif #ifdef CYGWIN32
|
|
||||||
|
|
||||||
ifdef SDL_PKGCONFIG
|
|
||||||
SDL_CFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --cflags)
|
|
||||||
SDL_LDFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --libs)
|
|
||||||
else
|
|
||||||
ifdef PREFIX
|
|
||||||
SDL_CONFIG?=$(PREFIX)-sdl2-config
|
|
||||||
else
|
|
||||||
SDL_CONFIG?=sdl2-config
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef STATIC
|
|
||||||
SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags)
|
|
||||||
SDL_LDFLAGS?=$(shell $(SDL_CONFIG) --static-libs)
|
|
||||||
else
|
|
||||||
SDL_CFLAGS?=$(shell $(SDL_CONFIG) --cflags)
|
|
||||||
SDL_LDFLAGS?=$(shell $(SDL_CONFIG) --libs)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/dosstr.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o
|
|
||||||
|
|
||||||
OPTS+=-DDIRECTFULLSCREEN -DHAVE_SDL
|
|
||||||
|
|
||||||
ifndef NOHW
|
|
||||||
OBJS+=$(OBJDIR)/r_opengl.o $(OBJDIR)/ogl_sdl.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NOMIXER
|
|
||||||
i_sound_o=$(OBJDIR)/sdl_sound.o
|
|
||||||
else
|
|
||||||
i_sound_o=$(OBJDIR)/mixer_sound.o
|
|
||||||
OPTS+=-DHAVE_MIXER
|
|
||||||
SDL_LDFLAGS+=-lSDL2_mixer
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NOTHREADS
|
|
||||||
OPTS+=-DHAVE_THREADS
|
|
||||||
OBJS+=$(OBJDIR)/i_threads.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef SDL_TTF
|
|
||||||
OPTS+=-DHAVE_TTF
|
|
||||||
SDL_LDFLAGS+=-lSDL2_ttf -lfreetype -lz
|
|
||||||
OBJS+=$(OBJDIR)/i_ttf.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef SDL_IMAGE
|
|
||||||
OPTS+=-DHAVE_IMAGE
|
|
||||||
SDL_LDFLAGS+=-lSDL2_image
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef SDL_NET
|
|
||||||
OPTS+=-DHAVE_SDLNET
|
|
||||||
SDL_LDFLAGS+=-lSDL2_net
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef MINGW
|
|
||||||
ifndef NOSDLMAIN
|
|
||||||
SDLMAIN=1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef SDLMAIN
|
|
||||||
OPTS+=-DSDLMAIN
|
|
||||||
else
|
|
||||||
ifdef MINGW
|
|
||||||
SDL_CFLAGS+=-Umain
|
|
||||||
SDL_LDFLAGS+=-mconsole
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NOLIBBACKTRACE
|
|
||||||
OPTS+=-DHAVE_LIBBACKTRACE
|
|
||||||
ifdef MINGW64
|
|
||||||
CPPFLAGS+=-I../libs/libbacktrace/include
|
|
||||||
LDFLAGS+=-L../libs/libbacktrace/lib/x86_64
|
|
||||||
endif
|
|
||||||
LIBS:=-lbacktrace $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS+=$(SDL_CFLAGS)
|
|
||||||
LIBS:=$(SDL_LDFLAGS) $(LIBS)
|
|
||||||
ifdef STATIC
|
|
||||||
LIBS+=$(shell $(SDL_CONFIG) --static-libs)
|
|
||||||
endif
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
i_net.c
|
||||||
|
i_system.c
|
||||||
|
i_main.c
|
||||||
|
i_video.c
|
||||||
|
dosstr.c
|
||||||
|
endtxt.c
|
||||||
|
hwsym_sdl.c
|
||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
#include "../doomdef.h"
|
#include "../doomdef.h"
|
||||||
#include "../m_argv.h"
|
#include "../m_argv.h"
|
||||||
#include "../d_main.h"
|
#include "../d_main.h"
|
||||||
#include "../m_misc.h"/* path shit */
|
#include "../m_misc.h" /* path shit */
|
||||||
#include "../i_system.h"
|
#include "../i_system.h"
|
||||||
|
|
||||||
#if defined (__GNUC__) || defined (__unix__)
|
#if defined (__GNUC__) || defined (__unix__)
|
||||||
|
|||||||
+1
-1
@@ -743,7 +743,7 @@ static void Impl_HandleKeyboardConsoleEvent(KEY_EVENT_RECORD evt, HANDLE co)
|
|||||||
break;
|
break;
|
||||||
case VK_RETURN:
|
case VK_RETURN:
|
||||||
entering_con_command = false;
|
entering_con_command = false;
|
||||||
// Fall through.
|
/* FALLTHRU */
|
||||||
default:
|
default:
|
||||||
//event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char
|
//event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char
|
||||||
event.data1 = evt.uChar.AsciiChar;
|
event.data1 = evt.uChar.AsciiChar;
|
||||||
|
|||||||
+1
-1
@@ -187,7 +187,7 @@ void ST_doPaletteStuff(void)
|
|||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl && !HWR_PalRenderFlashpal())
|
if (rendermode == render_opengl && !HWR_PalRenderFlashpal())
|
||||||
palette = 0; // Don't set the palette to a flashpal in OpenGL's truecolor mode
|
palette = 0; // No flashpals here in OpenGL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
palette = min(max(palette, 0), 13);
|
palette = min(max(palette, 0), 13);
|
||||||
|
|||||||
@@ -457,9 +457,6 @@ static void LoadPalette(const char *lumpname)
|
|||||||
#endif
|
#endif
|
||||||
pLocalPalette[i].s.alpha = 0xFF;
|
pLocalPalette[i].s.alpha = 0xFF;
|
||||||
|
|
||||||
if (!Cubeapply)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// lerp of colour cubing! if you want, make it smoother yourself
|
// lerp of colour cubing! if you want, make it smoother yourself
|
||||||
V_CubeApply(&pLocalPalette[i].s.red, &pLocalPalette[i].s.green, &pLocalPalette[i].s.blue);
|
V_CubeApply(&pLocalPalette[i].s.red, &pLocalPalette[i].s.green, &pLocalPalette[i].s.blue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -724,7 +724,9 @@ UINT16 W_InitFile(const char *filename, boolean local)
|
|||||||
wadfile_t *wadfile;
|
wadfile_t *wadfile;
|
||||||
restype_t type;
|
restype_t type;
|
||||||
UINT16 numlumps = 0;
|
UINT16 numlumps = 0;
|
||||||
|
#ifndef NOMD5
|
||||||
size_t i;
|
size_t i;
|
||||||
|
#endif
|
||||||
UINT8 md5sum[16];
|
UINT8 md5sum[16];
|
||||||
boolean important;
|
boolean important;
|
||||||
|
|
||||||
|
|||||||
@@ -1,154 +0,0 @@
|
|||||||
#
|
|
||||||
# win32/Makefile.cfg for SRB2/Minwgw
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
#Mingw, if you don't know, that's Win32/Win64
|
|
||||||
#
|
|
||||||
|
|
||||||
ifdef MINGW64
|
|
||||||
HAVE_LIBGME=1
|
|
||||||
LIBGME_CFLAGS=-I../libs/gme/include
|
|
||||||
LIBGME_LDFLAGS=-L../libs/gme/win64 -lgme
|
|
||||||
ifdef HAVE_OPENMPT
|
|
||||||
LIBOPENMPT_CFLAGS?=-I../libs/libopenmpt/inc
|
|
||||||
LIBOPENMPT_LDFLAGS?=-L../libs/libopenmpt/lib/x86_64 -lopenmpt
|
|
||||||
endif
|
|
||||||
|
|
||||||
SDL_CFLAGS?=-I../libs/SDL2/x86_64-w64-mingw32/include/SDL2 -I../libs/SDL2_mixer/x86_64-w64-mingw32/include/SDL2 -Dmain=SDL_main
|
|
||||||
SDL_LDFLAGS?=-L../libs/SDL2/x86_64-w64-mingw32/lib -L../libs/SDL2_mixer/x86_64-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
|
|
||||||
else
|
|
||||||
HAVE_LIBGME=1
|
|
||||||
LIBGME_CFLAGS=-I../libs/gme/include
|
|
||||||
LIBGME_LDFLAGS=-L../libs/gme/win32 -lgme
|
|
||||||
ifdef HAVE_OPENMPT
|
|
||||||
LIBOPENMPT_CFLAGS?=-I../libs/libopenmpt/inc
|
|
||||||
LIBOPENMPT_LDFLAGS?=-L../libs/libopenmpt/lib/x86 -lopenmpt
|
|
||||||
endif
|
|
||||||
SDL_CFLAGS?=-I../libs/SDL2/i686-w64-mingw32/include/SDL2 -I../libs/SDL2_mixer/i686-w64-mingw32/include/SDL2 -Dmain=SDL_main
|
|
||||||
SDL_LDFLAGS?=-L../libs/SDL2/i686-w64-mingw32/lib -L../libs/SDL2_mixer/i686-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NONET
|
|
||||||
ifndef MINGW64 #miniupnc is broken with MINGW64
|
|
||||||
HAVE_MINIUPNPC=1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NO_DISCORDRPC
|
|
||||||
HAVE_DISCORDRPC=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
OPTS=-DSTDC_HEADERS
|
|
||||||
|
|
||||||
ifndef GCC44
|
|
||||||
#OPTS+=-mms-bitfields
|
|
||||||
endif
|
|
||||||
|
|
||||||
OPTS+=-D__USE_MINGW_ANSI_STDIO=0
|
|
||||||
|
|
||||||
LIBS+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
|
|
||||||
ifdef MINGW64
|
|
||||||
LIBS+=-lws2_32
|
|
||||||
else
|
|
||||||
ifdef NO_IPV6
|
|
||||||
LIBS+=-lwsock32
|
|
||||||
else
|
|
||||||
LIBS+=-lws2_32
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef MINGW64
|
|
||||||
CPPFLAGS+=-I../libs/drmingw/include
|
|
||||||
LDFLAGS+=-L../libs/drmingw/lib/win32
|
|
||||||
LIBS+=-lmgwhelp -lexchndl
|
|
||||||
endif
|
|
||||||
|
|
||||||
# name of the exefile
|
|
||||||
EXENAME?=srb2kart-saturn.exe
|
|
||||||
|
|
||||||
i_system_o+=$(OBJDIR)/SRB2.res
|
|
||||||
#i_main_o+=$(OBJDIR)/win_dbg.o
|
|
||||||
ifndef NOHW
|
|
||||||
OPTS+=-DUSE_WGL_SWAP
|
|
||||||
endif
|
|
||||||
|
|
||||||
ZLIB_CFLAGS?=-I../libs/zlib
|
|
||||||
ifdef MINGW64
|
|
||||||
ZLIB_LDFLAGS?=-L../libs/zlib/win32 -lz64
|
|
||||||
else
|
|
||||||
ZLIB_LDFLAGS?=-L../libs/zlib/win32 -lz32
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NOPNG
|
|
||||||
ifndef PNG_CONFIG
|
|
||||||
PNG_CFLAGS?=-I../libs/libpng-src
|
|
||||||
ifdef MINGW64
|
|
||||||
PNG_LDFLAGS?=-L../libs/libpng-src/projects -lpng64
|
|
||||||
else
|
|
||||||
PNG_LDFLAGS?=-L../libs/libpng-src/projects -lpng32
|
|
||||||
endif #MINGW64
|
|
||||||
endif #PNG_CONFIG
|
|
||||||
endif #NOPNG
|
|
||||||
|
|
||||||
ifdef GETTEXT
|
|
||||||
ifndef CCBS
|
|
||||||
MSGFMT?=../libs/gettext/bin32/msgfmt.exe
|
|
||||||
endif
|
|
||||||
ifdef MINGW64
|
|
||||||
CPPFLAGS+=-I../libs/gettext/include64
|
|
||||||
LDFLAGS+=-L../libs/gettext/lib64
|
|
||||||
LIBS+=-lmingwex
|
|
||||||
else
|
|
||||||
CPPFLAGS+=-I../libs/gettext/include32
|
|
||||||
LDFLAGS+=-L../libs/gettext/lib32
|
|
||||||
STATIC_GETTEXT=1
|
|
||||||
endif #MINGW64
|
|
||||||
ifdef STATIC_GETTEXT
|
|
||||||
LIBS+=-lasprintf -lintl
|
|
||||||
else
|
|
||||||
LIBS+=-lintl.dll
|
|
||||||
endif #STATIC_GETTEXT
|
|
||||||
endif #GETTEXT
|
|
||||||
|
|
||||||
ifdef HAVE_MINIUPNPC
|
|
||||||
CPPFLAGS+=-I../libs/ -DSTATIC_MINIUPNPC
|
|
||||||
ifdef MINGW64
|
|
||||||
LDFLAGS+=-L../libs/miniupnpc/mingw64
|
|
||||||
else
|
|
||||||
LDFLAGS+=-L../libs/miniupnpc/mingw32
|
|
||||||
endif #MINGW64
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef NOCURL
|
|
||||||
CURL_CFLAGS+=-I../libs/curl/include
|
|
||||||
ifdef MINGW64
|
|
||||||
CURL_LDFLAGS+=-L../libs/curl/lib64 -lcurl
|
|
||||||
else
|
|
||||||
CURL_LDFLAGS+=-L../libs/curl/lib32 -lcurl
|
|
||||||
endif #MINGW64
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef HAVE_DISCORDRPC
|
|
||||||
ifdef MINGW64
|
|
||||||
CPPFLAGS+=-I../libs/discord-rpc/win64-dynamic/include
|
|
||||||
LDFLAGS+=-L../libs/discord-rpc/win64-dynamic/lib
|
|
||||||
else
|
|
||||||
CPPFLAGS+=-I../libs/discord-rpc/win32-dynamic/include
|
|
||||||
LDFLAGS+=-L../libs/discord-rpc/win32-dynamic/lib
|
|
||||||
endif
|
|
||||||
LIBS+=-ldiscord-rpc
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef MINGW64
|
|
||||||
LDFLAGS+=-Wl,--large-address-aware
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef MINGW64
|
|
||||||
NOLIBBACKTRACE=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
# disable dynamicbase if under msys2
|
|
||||||
ifdef MSYSTEM
|
|
||||||
LDFLAGS+=-Wl,--disable-dynamicbase
|
|
||||||
endif
|
|
||||||
+134
-146
@@ -57,15 +57,30 @@ typedef struct
|
|||||||
|
|
||||||
static y_data_t data;
|
static y_data_t data;
|
||||||
|
|
||||||
// graphics
|
|
||||||
static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK
|
|
||||||
|
|
||||||
|
// graphics
|
||||||
|
static patch_t *bgpatch = NULL; // INTERSCR
|
||||||
|
static patch_t *widebgpatch = NULL; // INTERSCW
|
||||||
|
static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK
|
||||||
static INT32 timer;
|
static INT32 timer;
|
||||||
|
|
||||||
static INT32 intertic;
|
static INT32 intertic;
|
||||||
static INT32 endtic = -1;
|
static INT32 endtic = -1;
|
||||||
static INT32 sorttic = -1;
|
static INT32 sorttic = -1;
|
||||||
|
|
||||||
|
patch_t *animVoteFramesPatches = NULL;
|
||||||
|
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||||
|
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||||
|
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch used in software)
|
||||||
|
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch used in software)
|
||||||
|
char animPrefix[] = "INTSC";
|
||||||
|
char animWidePrefix[] = "INTSW";
|
||||||
|
char *luaVoteScreen = NULL;
|
||||||
|
|
||||||
|
INT32 currentAnimFrame = 0;
|
||||||
|
static INT32 foundAnimVoteFrames = 0;
|
||||||
|
static INT32 foundAnimVoteWideFrames = 0;
|
||||||
|
|
||||||
intertype_t intertype = int_none;
|
intertype_t intertype = int_none;
|
||||||
|
|
||||||
static huddrawlist_h luahuddrawlist_intermission = NULL;
|
static huddrawlist_h luahuddrawlist_intermission = NULL;
|
||||||
@@ -103,13 +118,17 @@ typedef struct
|
|||||||
boolean loaded;
|
boolean loaded;
|
||||||
} y_voteclient;
|
} y_voteclient;
|
||||||
|
|
||||||
// votescreen stuff
|
|
||||||
votescreen_t VoteScreen = {0};
|
|
||||||
|
|
||||||
static y_votelvlinfo levelinfo[5];
|
static y_votelvlinfo levelinfo[5];
|
||||||
static y_voteclient voteclient;
|
static y_voteclient voteclient;
|
||||||
static INT32 votetic;
|
static INT32 votetic;
|
||||||
static INT32 voteendtic = -1;
|
static INT32 voteendtic = -1;
|
||||||
|
static patch_t *cursor = NULL;
|
||||||
|
static patch_t *cursor1 = NULL;
|
||||||
|
static patch_t *cursor2 = NULL;
|
||||||
|
static patch_t *cursor3 = NULL;
|
||||||
|
static patch_t *cursor4 = NULL;
|
||||||
|
static patch_t *randomlvl = NULL;
|
||||||
|
static patch_t *rubyicon = NULL;
|
||||||
|
|
||||||
static void Y_UnloadVoteData(void);
|
static void Y_UnloadVoteData(void);
|
||||||
|
|
||||||
@@ -268,6 +287,49 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y_AnimatedVoteScreenCheck
|
||||||
|
//
|
||||||
|
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
||||||
|
static void Y_AnimatedVoteScreenCheck(void)
|
||||||
|
{
|
||||||
|
char tmpPrefix[] = "INTS";
|
||||||
|
|
||||||
|
if (luaVoteScreen)
|
||||||
|
strncpy(tmpPrefix, luaVoteScreen, 4);
|
||||||
|
else if (G_BattleGametype())
|
||||||
|
strcpy(tmpPrefix, "BTLS");
|
||||||
|
|
||||||
|
strncpy(animPrefix, tmpPrefix, 4);
|
||||||
|
animPrefix[4] = 'C';
|
||||||
|
strncpy(animWidePrefix, tmpPrefix, 4);
|
||||||
|
animWidePrefix[4] = 'W';
|
||||||
|
|
||||||
|
foundAnimVoteFrames = foundAnimVoteWideFrames = 0;
|
||||||
|
currentAnimFrame = 0;
|
||||||
|
|
||||||
|
INT32 i = 1;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
boolean normalLumpExists = W_LumpExists(va("%sC%d", tmpPrefix, i));
|
||||||
|
boolean wideLumpExists = W_LumpExists(va("%sW%d", tmpPrefix, i));
|
||||||
|
|
||||||
|
if (normalLumpExists || wideLumpExists)
|
||||||
|
{
|
||||||
|
if (normalLumpExists)
|
||||||
|
foundAnimVoteFrames++;
|
||||||
|
|
||||||
|
if (wideLumpExists)
|
||||||
|
foundAnimVoteWideFrames++;
|
||||||
|
}
|
||||||
|
else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
||||||
|
break;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Y_PlayerStandingsDrawer
|
// Y_PlayerStandingsDrawer
|
||||||
//
|
//
|
||||||
// Handles drawing the center-of-screen player standings.
|
// Handles drawing the center-of-screen player standings.
|
||||||
@@ -801,8 +863,7 @@ void Y_StartIntermission(void)
|
|||||||
//
|
//
|
||||||
void Y_EndIntermission(void)
|
void Y_EndIntermission(void)
|
||||||
{
|
{
|
||||||
if (!dedicated)
|
Y_UnloadData();
|
||||||
Y_UnloadData();
|
|
||||||
|
|
||||||
endtic = -1;
|
endtic = -1;
|
||||||
sorttic = -1;
|
sorttic = -1;
|
||||||
@@ -820,72 +881,28 @@ static void Y_FollowIntermission(void)
|
|||||||
G_AfterIntermission();
|
G_AfterIntermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define UNLOAD(x) {if ((x) != NULL) {Patch_Free(x);} x = NULL;}
|
#define UNLOAD(x) if (x) {Patch_Free(x);} x = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y_UnloadData
|
// Y_UnloadData
|
||||||
//
|
//
|
||||||
static void Y_UnloadData(void)
|
static void Y_UnloadData(void)
|
||||||
{
|
{
|
||||||
|
// In hardware mode, don't Z_ChangeTag a pointer returned by W_CachePatchName().
|
||||||
|
// It doesn't work and is unnecessary.
|
||||||
|
if (rendermode != render_soft)
|
||||||
|
return;
|
||||||
|
|
||||||
// unload the background patches
|
// unload the background patches
|
||||||
UNLOAD(VoteScreen.bgpatch);
|
UNLOAD(bgpatch);
|
||||||
UNLOAD(VoteScreen.widebgpatch);
|
UNLOAD(widebgpatch);
|
||||||
UNLOAD(bgtile);
|
UNLOAD(bgtile);
|
||||||
//UNLOAD(interpic);
|
//UNLOAD(interpic);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SRB2Kart: Voting!
|
// SRB2Kart: Voting!
|
||||||
|
|
||||||
//
|
static void Y_DrawVoteBackground(patch_t *patch)
|
||||||
// Y_VoteScreenCheck
|
|
||||||
//
|
|
||||||
static void Y_VoteScreenCheck(void)
|
|
||||||
{
|
|
||||||
strcpy(VoteScreen.Prefix, "INTS");
|
|
||||||
|
|
||||||
if (VoteScreen.luaPrefix[0] != 0)
|
|
||||||
strlcpy(VoteScreen.Prefix, VoteScreen.luaPrefix, sizeof(VoteScreen.Prefix));
|
|
||||||
else if (G_BattleGametype())
|
|
||||||
strcpy(VoteScreen.Prefix, "BTLS");
|
|
||||||
|
|
||||||
VoteScreen.foundLuaVoteFrames = VoteScreen.foundLuaVoteWideFrames = 0;
|
|
||||||
VoteScreen.currentAnimFrame = 0;
|
|
||||||
|
|
||||||
INT32 i = 1;
|
|
||||||
|
|
||||||
// check for lua vote background replacements
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
|
||||||
boolean normalLumpExists = W_LumpExists(va("%sC%d", VoteScreen.Prefix, i));
|
|
||||||
boolean wideLumpExists = W_LumpExists(va("%sW%d", VoteScreen.Prefix, i));
|
|
||||||
|
|
||||||
if (normalLumpExists || wideLumpExists)
|
|
||||||
{
|
|
||||||
if (normalLumpExists)
|
|
||||||
VoteScreen.foundLuaVoteFrames++;
|
|
||||||
|
|
||||||
if (wideLumpExists)
|
|
||||||
VoteScreen.foundLuaVoteWideFrames++;
|
|
||||||
}
|
|
||||||
else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
|
||||||
break;
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// non lua vote background handling
|
|
||||||
boolean prefbattletype = ((votelevels[0][1] & ~0x80) == GT_MATCH);
|
|
||||||
VoteScreen.widebgpatch = W_CachePatchName((prefbattletype ? "BATTLSCW" : "INTERSCW"), PU_PATCH);
|
|
||||||
VoteScreen.bgpatch = W_CachePatchName((prefbattletype ? "BATTLSCR" : "INTERSCR"), PU_PATCH);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Y_VoteBackgroundDrawer
|
|
||||||
//
|
|
||||||
// Determines which patch drawer to use for scaling
|
|
||||||
//
|
|
||||||
static void Y_VoteBackgroundDrawer(patch_t *patch)
|
|
||||||
{
|
{
|
||||||
switch (cv_votebgscaling.value)
|
switch (cv_votebgscaling.value)
|
||||||
{
|
{
|
||||||
@@ -907,74 +924,57 @@ static void Y_VoteBackgroundDrawer(patch_t *patch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Y_DrawAnimatedVoteScreenPatch
|
||||||
//
|
//
|
||||||
// Y_DrawLuaVoteScreenPatch
|
// Draw animated patch based on frame counter on vote screen
|
||||||
//
|
//
|
||||||
// Handles votebackgrounds set by "setVoteBackground"
|
static void Y_DrawAnimatedVoteScreenPatch(boolean widePatch)
|
||||||
// Aswell as animated patches
|
|
||||||
//
|
|
||||||
static void Y_DrawLuaVoteScreenPatch(boolean widePatch)
|
|
||||||
{
|
{
|
||||||
INT32 nextframe = 0;
|
INT32 nextframe = 0;
|
||||||
patch_t *votebg = NULL;
|
patch_t *votebg = NULL;
|
||||||
char tempPrefix[6];
|
char tempAnimPrefix[7];
|
||||||
const INT32 tempfoundAnimLuaVoteFrames = ((widePatch ? VoteScreen.foundLuaVoteWideFrames : VoteScreen.foundLuaVoteFrames) - 1);
|
const INT32 tempFoundAnimVoteFrames = ((widePatch ? foundAnimVoteWideFrames : foundAnimVoteFrames) - 1);
|
||||||
|
|
||||||
strcpy(tempPrefix, va("%s%s", VoteScreen.Prefix, (widePatch ? "W" : "C")));
|
strcpy(tempAnimPrefix, (widePatch ? animWidePrefix : animPrefix));
|
||||||
|
|
||||||
// Draw non animated patch
|
|
||||||
if (!tempfoundAnimLuaVoteFrames)
|
|
||||||
{
|
|
||||||
votebg = W_CachePatchName(va("%s1", tempPrefix), PU_PATCH);
|
|
||||||
Y_VoteBackgroundDrawer(votebg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw animated patch based on frame counter on vote screen
|
|
||||||
|
|
||||||
// Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0
|
// Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0
|
||||||
if (VoteScreen.currentAnimFrame > tempfoundAnimLuaVoteFrames)
|
if (currentAnimFrame > tempFoundAnimVoteFrames)
|
||||||
VoteScreen.currentAnimFrame = 0;
|
currentAnimFrame = 0;
|
||||||
|
|
||||||
nextframe = (VoteScreen.currentAnimFrame + 1);
|
nextframe = (currentAnimFrame + 1);
|
||||||
|
|
||||||
votebg = W_CachePatchName(va("%s%d", tempPrefix, nextframe), PU_PATCH);
|
votebg = W_CachePatchName(va("%s%d", (widePatch ? animWidePrefix : animPrefix), nextframe), PU_PATCH);
|
||||||
|
|
||||||
Y_VoteBackgroundDrawer(votebg);
|
Y_DrawVoteBackground(votebg);
|
||||||
|
|
||||||
if (renderisnewtic && (votetic % 2 == 0) && !paused)
|
if (renderisnewtic && (votetic % 2 == 0) && !paused)
|
||||||
VoteScreen.currentAnimFrame = (nextframe > tempfoundAnimLuaVoteFrames) ? 0 : nextframe;
|
currentAnimFrame = (nextframe > tempFoundAnimVoteFrames) ? 0 : nextframe;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Y_DrawVoteScreenPatch
|
|
||||||
//
|
|
||||||
static void Y_DrawVoteScreenPatch(void)
|
static void Y_DrawVoteScreenPatch(void)
|
||||||
{
|
{
|
||||||
patch_t *votebg = NULL;
|
patch_t *votebg = NULL;
|
||||||
const boolean widescreen = (vid.width / vid.dupx > 320);
|
const boolean widescreen = (vid.width / vid.dupx > 320);
|
||||||
|
|
||||||
if (VoteScreen.foundLuaVoteWideFrames || VoteScreen.foundLuaVoteFrames)
|
if (foundAnimVoteWideFrames || foundAnimVoteFrames)
|
||||||
{
|
{
|
||||||
Y_DrawLuaVoteScreenPatch(((widescreen && VoteScreen.foundLuaVoteWideFrames) || !VoteScreen.foundLuaVoteFrames));
|
Y_DrawAnimatedVoteScreenPatch((foundAnimVoteWideFrames && widescreen));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// non widescreen patch
|
votebg = bgpatch; // non widescreen patch
|
||||||
votebg = VoteScreen.bgpatch;
|
|
||||||
|
|
||||||
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
||||||
const boolean widebgreplaced = (prefgametype == GT_MATCH) ? VoteScreen.replaced.widebattle : VoteScreen.replaced.widerace;
|
const boolean widebgreplaced = (prefgametype == GT_MATCH) ? widebattlereplaced : wideracereplaced;
|
||||||
const boolean bgreplaced = (prefgametype == GT_MATCH) ? VoteScreen.replaced.battle : VoteScreen.replaced.race;
|
const boolean bgreplaced = (prefgametype == GT_MATCH) ? battlereplaced : racereplaced;
|
||||||
|
|
||||||
// we check a bunch of stuff to always have a "valid" fallback
|
|
||||||
if ((widescreen && (widebgreplaced || !bgreplaced))
|
if ((widescreen && (widebgreplaced || !bgreplaced))
|
||||||
|| (!widescreen && (widebgreplaced && !bgreplaced)))
|
|| (!widescreen && (widebgreplaced && !bgreplaced)))
|
||||||
{
|
{
|
||||||
votebg = VoteScreen.widebgpatch; // widescreen patch
|
votebg = widebgpatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
Y_VoteBackgroundDrawer(votebg);
|
Y_DrawVoteBackground(votebg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1037,7 +1037,7 @@ void Y_VoteDrawer(void)
|
|||||||
if (i == 3)
|
if (i == 3)
|
||||||
{
|
{
|
||||||
str = "RANDOM";
|
str = "RANDOM";
|
||||||
pic = VoteScreen.randomlvl;
|
pic = randomlvl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1061,7 +1061,7 @@ void Y_VoteDrawer(void)
|
|||||||
|
|
||||||
if (!splitscreen)
|
if (!splitscreen)
|
||||||
{
|
{
|
||||||
thiscurs = VoteScreen.cursor[0];
|
thiscurs = cursor;
|
||||||
p = consoleplayer;
|
p = consoleplayer;
|
||||||
color = levelinfo[i].gtc;
|
color = levelinfo[i].gtc;
|
||||||
colormap = NULL;
|
colormap = NULL;
|
||||||
@@ -1071,19 +1071,19 @@ void Y_VoteDrawer(void)
|
|||||||
switch (j)
|
switch (j)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
thiscurs = VoteScreen.cursor[2];
|
thiscurs = cursor2;
|
||||||
p = displayplayers[1];
|
p = displayplayers[1];
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
thiscurs = VoteScreen.cursor[3];
|
thiscurs = cursor3;
|
||||||
p = displayplayers[2];
|
p = displayplayers[2];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
thiscurs = VoteScreen.cursor[4];
|
thiscurs = cursor4;
|
||||||
p = displayplayers[3];
|
p = displayplayers[3];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
thiscurs = VoteScreen.cursor[1];
|
thiscurs = cursor1;
|
||||||
p = displayplayers[0];
|
p = displayplayers[0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1111,7 +1111,7 @@ void Y_VoteDrawer(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, rubyicon, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH-21, 40+y, V_SNAPTORIGHT|V_6WIDTHSPACE, str);
|
V_DrawRightAlignedThinString(BASEVIDWIDTH-21, 40+y, V_SNAPTORIGHT|V_6WIDTHSPACE, str);
|
||||||
@@ -1135,7 +1135,7 @@ void Y_VoteDrawer(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||||
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, rubyicon, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelinfo[i].gts)
|
if (levelinfo[i].gts)
|
||||||
@@ -1164,13 +1164,13 @@ void Y_VoteDrawer(void)
|
|||||||
patch_t *pic;
|
patch_t *pic;
|
||||||
|
|
||||||
if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
|
if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
|
||||||
pic = VoteScreen.randomlvl;
|
pic = randomlvl;
|
||||||
else
|
else
|
||||||
pic = levelinfo[votes[i]].pic;
|
pic = levelinfo[votes[i]].pic;
|
||||||
|
|
||||||
if (!timer && i == voteclient.ranim)
|
if (!timer && i == voteclient.ranim)
|
||||||
{
|
{
|
||||||
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, VoteScreen.cursor[0]);
|
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, cursor);
|
||||||
if (voteendtic != -1 && !(votetic % 4))
|
if (voteendtic != -1 && !(votetic % 4))
|
||||||
V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT);
|
V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT);
|
||||||
else
|
else
|
||||||
@@ -1182,7 +1182,7 @@ void Y_VoteDrawer(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
|
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
|
||||||
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, VoteScreen.rubyicon, NULL);
|
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, rubyicon, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelinfo[votes[i]].gts)
|
if (levelinfo[votes[i]].gts)
|
||||||
@@ -1471,28 +1471,10 @@ void Y_VoteTicker(void)
|
|||||||
//
|
//
|
||||||
// MK online style voting screen, appears after intermission
|
// MK online style voting screen, appears after intermission
|
||||||
//
|
//
|
||||||
|
|
||||||
static void Y_InitVoteDrawing(void)
|
|
||||||
{
|
|
||||||
if (dedicated)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// setup the background patches
|
|
||||||
Y_VoteScreenCheck();
|
|
||||||
|
|
||||||
VoteScreen.cursor[0] = W_CachePatchName("M_CURSOR", PU_PATCH);
|
|
||||||
VoteScreen.cursor[1] = W_CachePatchName("P1CURSOR", PU_PATCH);
|
|
||||||
VoteScreen.cursor[2] = W_CachePatchName("P2CURSOR", PU_PATCH);
|
|
||||||
VoteScreen.cursor[3] = W_CachePatchName("P3CURSOR", PU_PATCH);
|
|
||||||
VoteScreen.cursor[4] = W_CachePatchName("P4CURSOR", PU_PATCH);
|
|
||||||
|
|
||||||
VoteScreen.randomlvl = W_CachePatchName("RANDOMLV", PU_PATCH);
|
|
||||||
VoteScreen.rubyicon = W_CachePatchName("RUBYICON", PU_PATCH);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Y_StartVote(void)
|
void Y_StartVote(void)
|
||||||
{
|
{
|
||||||
INT32 i = 0;
|
INT32 i = 0;
|
||||||
|
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
||||||
|
|
||||||
votetic = -1;
|
votetic = -1;
|
||||||
|
|
||||||
@@ -1501,8 +1483,17 @@ void Y_StartVote(void)
|
|||||||
I_Error("voteendtic is dirty");
|
I_Error("voteendtic is dirty");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// cache vote patches
|
Y_AnimatedVoteScreenCheck();
|
||||||
Y_InitVoteDrawing();
|
|
||||||
|
widebgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_PATCH);
|
||||||
|
bgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_PATCH);
|
||||||
|
cursor = W_CachePatchName("M_CURSOR", PU_PATCH);
|
||||||
|
cursor1 = W_CachePatchName("P1CURSOR", PU_PATCH);
|
||||||
|
cursor2 = W_CachePatchName("P2CURSOR", PU_PATCH);
|
||||||
|
cursor3 = W_CachePatchName("P3CURSOR", PU_PATCH);
|
||||||
|
cursor4 = W_CachePatchName("P4CURSOR", PU_PATCH);
|
||||||
|
randomlvl = W_CachePatchName("RANDOMLV", PU_PATCH);
|
||||||
|
rubyicon = W_CachePatchName("RUBYICON", PU_PATCH);
|
||||||
|
|
||||||
timer = cv_votetime.value*TICRATE;
|
timer = cv_votetime.value*TICRATE;
|
||||||
pickedvote = -1;
|
pickedvote = -1;
|
||||||
@@ -1568,14 +1559,11 @@ void Y_StartVote(void)
|
|||||||
levelinfo[i].gts = NULL;
|
levelinfo[i].gts = NULL;
|
||||||
|
|
||||||
// set up the pic
|
// set up the pic
|
||||||
if (!dedicated)
|
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));
|
||||||
{
|
if (lumpnum != LUMPERROR)
|
||||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));
|
levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_PATCH);
|
||||||
if (lumpnum != LUMPERROR)
|
else
|
||||||
levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_PATCH);
|
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_PATCH);
|
||||||
else
|
|
||||||
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_PATCH);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
voteclient.loaded = true;
|
voteclient.loaded = true;
|
||||||
@@ -1600,18 +1588,18 @@ static void Y_UnloadVoteData(void)
|
|||||||
{
|
{
|
||||||
voteclient.loaded = false;
|
voteclient.loaded = false;
|
||||||
|
|
||||||
if (dedicated)
|
if (rendermode != render_soft)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UNLOAD(VoteScreen.widebgpatch);
|
UNLOAD(widebgpatch);
|
||||||
UNLOAD(VoteScreen.bgpatch);
|
UNLOAD(bgpatch);
|
||||||
UNLOAD(VoteScreen.cursor[0]);
|
UNLOAD(cursor);
|
||||||
UNLOAD(VoteScreen.cursor[1]);
|
UNLOAD(cursor1);
|
||||||
UNLOAD(VoteScreen.cursor[2]);
|
UNLOAD(cursor2);
|
||||||
UNLOAD(VoteScreen.cursor[3]);
|
UNLOAD(cursor3);
|
||||||
UNLOAD(VoteScreen.cursor[4]);
|
UNLOAD(cursor4);
|
||||||
UNLOAD(VoteScreen.randomlvl);
|
UNLOAD(randomlvl);
|
||||||
UNLOAD(VoteScreen.rubyicon);
|
UNLOAD(rubyicon);
|
||||||
|
|
||||||
UNLOAD(levelinfo[3].pic);
|
UNLOAD(levelinfo[3].pic);
|
||||||
UNLOAD(levelinfo[2].pic);
|
UNLOAD(levelinfo[2].pic);
|
||||||
|
|||||||
+1
-34
@@ -10,6 +10,7 @@
|
|||||||
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
||||||
|
|
||||||
extern boolean usebuffer;
|
extern boolean usebuffer;
|
||||||
|
extern char *luaVoteScreen;
|
||||||
|
|
||||||
void Y_IntermissionDrawer(void);
|
void Y_IntermissionDrawer(void);
|
||||||
void Y_Ticker(void);
|
void Y_Ticker(void);
|
||||||
@@ -54,37 +55,3 @@ typedef enum
|
|||||||
int_classicrace, // Competition
|
int_classicrace, // Competition
|
||||||
} intertype_t;
|
} intertype_t;
|
||||||
extern intertype_t intertype;
|
extern intertype_t intertype;
|
||||||
|
|
||||||
// Votescreen stuff
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
boolean race; // non lua race patch replaced
|
|
||||||
boolean widerace; // non lua widescreen race patch replaced
|
|
||||||
boolean battle; // non lua battle patch replaced
|
|
||||||
boolean widebattle; // non lua widescreen battle patch replaced
|
|
||||||
} votereplace_t;
|
|
||||||
|
|
||||||
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
|
||||||
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch)
|
|
||||||
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
|
||||||
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch)
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
char Prefix[5]; // Race = INTSX, Battle = BTLSX
|
|
||||||
char luaPrefix[5]; // prefix for lua votescreens
|
|
||||||
|
|
||||||
INT32 currentAnimFrame; // current animated background frame
|
|
||||||
|
|
||||||
INT32 foundLuaVoteFrames; // normal lua patch frames
|
|
||||||
INT32 foundLuaVoteWideFrames; // widescreen lua patch frames
|
|
||||||
|
|
||||||
votereplace_t replaced; // checks which non lua patch has been replaced
|
|
||||||
|
|
||||||
patch_t *bgpatch; // votebackground patch
|
|
||||||
patch_t *widebgpatch; // wide votebackground patch
|
|
||||||
|
|
||||||
patch_t *cursor[5]; // cursor patches
|
|
||||||
patch_t *randomlvl; // randomlevel patch
|
|
||||||
patch_t *rubyicon; // encore ruby patch
|
|
||||||
} votescreen_t;
|
|
||||||
extern votescreen_t VoteScreen;
|
|
||||||
Reference in new issue
Block a user