Compare commits
75
Commits
v8
...
newmakefiles
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be3e5a964d | ||
|
|
83d20a72ab | ||
|
|
e47e58a982 | ||
|
|
c05068f22f | ||
|
|
f5cb473f3d | ||
|
|
c5b72f24b5 | ||
|
|
7c34733eea | ||
|
|
393ade780c | ||
|
|
8b2e6ea17b | ||
|
|
8c31682723 | ||
|
|
7c87b5259a | ||
|
|
e8969b0645 | ||
|
|
7932c1af6f | ||
|
|
95b4228d3c | ||
|
|
a0ff44043f | ||
|
|
1e15816057 | ||
|
|
a4566e9496 | ||
|
|
18f88c28dd | ||
|
|
b8dc1b13df | ||
|
|
33c03f1e7a | ||
|
|
7e5ae71714 | ||
|
|
b574ed0b1b | ||
|
|
01c621832b | ||
|
|
608cc66d78 | ||
|
|
35103ad810 | ||
|
|
5ac0262654 | ||
|
|
c361285790 | ||
|
|
a168b5e2b9 | ||
|
|
f70c38a853 | ||
|
|
4c05c063a9 | ||
|
|
ed05a909cb | ||
|
|
e1e45ad3ad | ||
|
|
ca9b001c9f | ||
|
|
3976d80867 | ||
|
|
1ee10457f8 | ||
|
|
116bcd0cb1 | ||
|
|
fcdccb96aa | ||
|
|
723286826b | ||
|
|
b190f09aea | ||
|
|
ff6358b031 | ||
|
|
5899a0c453 | ||
|
|
db4d9a330a | ||
|
|
03264e760f | ||
|
|
224e3b25e5 | ||
|
|
03c624a77b | ||
|
|
1ed76de58a | ||
|
|
5f40ff5a03 | ||
|
|
b1baa90b19 | ||
|
|
f0579de244 | ||
|
|
044836b026 | ||
|
|
c2a761c895 | ||
|
|
5b6e7abd91 | ||
|
|
c47c6aa6e4 | ||
|
|
5a6a954d4f | ||
|
|
92bf8c0788 | ||
|
|
058139f52b | ||
|
|
612d01a8ce | ||
|
|
bc130ce1f9 | ||
|
|
8abab58a5c | ||
|
|
740de2babe | ||
|
|
9d54baf544 | ||
|
|
c68c61975e | ||
|
|
6f7947dd5f | ||
|
|
cb8930fef6 | ||
|
|
93d87e1132 | ||
|
|
d5583ba040 | ||
|
|
7bb3e4445e | ||
|
|
001a38bbd2 | ||
|
|
463778cd88 | ||
|
|
f263585a72 | ||
|
|
ec0ca0d1ab | ||
|
|
121540f428 | ||
|
|
8b5fd5f646 | ||
|
|
23a9afb727 | ||
|
|
38b862ff16 |
No files matched your search
+8
-7
@@ -13,16 +13,17 @@ Win32_LIB_ASM_Release
|
||||
*.dgb
|
||||
*.debug
|
||||
*.debug.txt
|
||||
/bin/VC10/
|
||||
/objs/VC10/
|
||||
*.user
|
||||
*.db
|
||||
*.opendb
|
||||
/.vs
|
||||
/debian
|
||||
/assets/debian
|
||||
compile.sh
|
||||
*.gz
|
||||
.vscode/
|
||||
out
|
||||
build
|
||||
/make
|
||||
/bin
|
||||
/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,5 +1,5 @@
|
||||
/* backtrace.h -- Public header file for stack backtrace library.
|
||||
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2024 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,13 +54,14 @@ struct backtrace_state;
|
||||
invalid after this function returns.
|
||||
|
||||
As a special case, the ERRNUM argument will be passed as -1 if no
|
||||
debug info can be found for the executable, but the function
|
||||
requires debug info (e.g., backtrace_full, backtrace_pcinfo). The
|
||||
MSG in this case will be something along the lines of "no debug
|
||||
info". Similarly, ERRNUM will be passed as -1 if there is no
|
||||
symbol table, but the function requires a symbol table (e.g.,
|
||||
backtrace_syminfo). This may be used as a signal that some other
|
||||
approach should be tried. */
|
||||
debug info can be found for the executable, or if the debug info
|
||||
exists but has an unsupported version, but the function requires
|
||||
debug info (e.g., backtrace_full, backtrace_pcinfo). The MSG in
|
||||
this case will be something along the lines of "no debug info".
|
||||
Similarly, ERRNUM will be passed as -1 if there is no symbol table,
|
||||
but the function requires a symbol table (e.g., backtrace_syminfo).
|
||||
This may be used as a signal that some other approach should be
|
||||
tried. */
|
||||
|
||||
typedef void (*backtrace_error_callback) (void *data, const char *msg,
|
||||
int errnum);
|
||||
|
||||
Binary file not shown.
@@ -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
|
||||
@@ -1,4 +1,3 @@
|
||||
/cscope.out
|
||||
/srb2wii
|
||||
*.json
|
||||
*.idx
|
||||
+13
-1
@@ -228,6 +228,14 @@ set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
||||
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
||||
set(SRB2_CONFIG_USE_FBO_OGL ON CACHE BOOL
|
||||
"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?
|
||||
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
||||
@@ -554,7 +562,11 @@ add_definitions(-DCMAKECONFIG)
|
||||
# ${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})
|
||||
message(FATAL_ERROR "There are no targets available to build an SRB2Kart executable. :(")
|
||||
|
||||
+356
-727
File diff suppressed because it is too large.
Load diff
@@ -489,7 +489,6 @@ ifndef CYGWIN32
|
||||
ifndef MINGW
|
||||
ifndef MINGW64
|
||||
ifndef SDL
|
||||
ifndef DUMMY
|
||||
$(error No interface or platform flag defined)
|
||||
endif
|
||||
endif
|
||||
@@ -497,7 +496,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#determine the interface directory (where you put all i_*.c)
|
||||
i_net_o=$(OBJDIR)/i_net.o
|
||||
@@ -522,11 +520,6 @@ UPX_OPTS+=-q
|
||||
endif
|
||||
|
||||
#Interface Setup
|
||||
ifdef DUMMY
|
||||
INTERFACE=dummy
|
||||
OBJDIR:=$(OBJDIR)/dummy
|
||||
BIN:=$(BIN)/dummy
|
||||
else
|
||||
ifdef LINUX
|
||||
SDL=1
|
||||
ifdef LINUX64
|
||||
@@ -573,7 +566,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ARCHNAME
|
||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
||||
@@ -588,7 +580,6 @@ ifdef SDL
|
||||
OBJDIR:=$(OBJDIR)/SDL
|
||||
endif
|
||||
|
||||
ifndef DUMMY
|
||||
ifdef DEBUGMODE
|
||||
OBJDIR:=$(OBJDIR)/Debug
|
||||
BIN:=$(BIN)/Debug
|
||||
@@ -596,4 +587,3 @@ else
|
||||
OBJDIR:=$(OBJDIR)/Release
|
||||
BIN:=$(BIN)/Release
|
||||
endif
|
||||
endif
|
||||
@@ -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
|
||||
@@ -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
|
||||
+1
-10
@@ -1984,7 +1984,7 @@ static boolean CV_FilterJoyAxisVars(consvar_t *v, const char *valstr)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Block the Xbox DInput default axes and reset to the current defaults
|
||||
// Block the Xbox DInput default axes and reset to the current defaults
|
||||
static boolean CV_FilterJoyAxisVars2(consvar_t *v, const char *valstr)
|
||||
{
|
||||
if (!stricmp(v->name, "joyaxis_turn") && !stricmp(valstr, "X-Axis"))
|
||||
@@ -2041,15 +2041,6 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
|
||||
|
||||
if (GETMAJOREXECVERSION(cv_execversion.value) < 2) // 2 = 1.0.2
|
||||
{
|
||||
#if 0
|
||||
// We don't have changed saved cvars yet
|
||||
if (!stricmp(v->name, "alwaysmlook")
|
||||
|| !stricmp(v->name, "alwaysmlook2")
|
||||
|| !stricmp(v->name, "mousemove")
|
||||
|| !stricmp(v->name, "mousemove2"))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
// axis defaults were changed to be friendly to 360 controllers
|
||||
// if ALL axis settings are defaults, then change them to new values
|
||||
if (!CV_FilterJoyAxisVars(v, valstr))
|
||||
|
||||
+20
-21
@@ -275,29 +275,28 @@ void CON_SetupBackColormap(void)
|
||||
|
||||
switch (cons_backcolor.value)
|
||||
{
|
||||
case 0: palindex = 15; break; // White
|
||||
case 1: palindex = 31; break; // Gray
|
||||
case 2: palindex = 47; break; // Sepia
|
||||
case 3: palindex = 63; break; // Brown
|
||||
case 4: palindex = 150; shift = 7; break; // Pink
|
||||
case 5: palindex = 127; shift = 7; break; // Raspberry
|
||||
case 6: palindex = 143; break; // Red
|
||||
case 7: palindex = 86; shift = 7; break; // Creamsicle
|
||||
case 8: palindex = 95; break; // Orange
|
||||
case 9: palindex = 119; shift = 7; break; // Gold
|
||||
case 10: palindex = 111; break; // Yellow
|
||||
case 11: palindex = 191; shift = 7; break; // Emerald
|
||||
case 12: palindex = 175; break; // Green
|
||||
case 13: palindex = 219; break; // Cyan
|
||||
case 14: palindex = 207; shift = 7; break; // Steel
|
||||
case 15: palindex = 230; shift = 7; break; // Periwinkle
|
||||
case 16: palindex = 239; break; // Blue
|
||||
case 17: palindex = 199; shift = 7; break; // Purple
|
||||
case 18: palindex = 255; shift = 7; break; // Lavender
|
||||
case 0: palindex = 15; break; // White
|
||||
case 1: palindex = 31; break; // Gray
|
||||
case 2: palindex = 47; break; // Sepia
|
||||
case 3: palindex = 63; break; // Brown
|
||||
case 4: palindex = 150; shift = 7; break; // Pink
|
||||
case 5: palindex = 127; shift = 7; break; // Raspberry
|
||||
case 6: palindex = 143; break; // Red
|
||||
case 7: palindex = 86; shift = 7; break; // Creamsicle
|
||||
case 8: palindex = 95; break; // Orange
|
||||
case 9: palindex = 119; shift = 7; break; // Gold
|
||||
case 10: palindex = 111; break; // Yellow
|
||||
case 11: palindex = 191; shift = 7; break; // Emerald
|
||||
case 12: palindex = 175; break; // Green
|
||||
case 13: palindex = 219; break; // Cyan
|
||||
case 14: palindex = 207; shift = 7; break; // Steel
|
||||
case 15: palindex = 230; shift = 7; break; // Periwinkle
|
||||
case 16: palindex = 239; break; // Blue
|
||||
case 17: palindex = 199; shift = 7; break; // Purple
|
||||
case 18: palindex = 255; shift = 7; break; // Lavender
|
||||
// Default green
|
||||
default: palindex = 175; break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// setup background colormap
|
||||
for (i = 0, j = 0; i < 768; i += 3, j++)
|
||||
|
||||
+26
-44
@@ -238,6 +238,18 @@ static boolean UseLocalDelay(void)
|
||||
return (cv_mindelay.value || (server && !server_lagless));
|
||||
}
|
||||
|
||||
#ifdef SATURNPAK
|
||||
static inline boolean UseSaturnSynch(INT32 node)
|
||||
{
|
||||
return (is_client_saturn[node] && cv_gamestateattempts.value);
|
||||
}
|
||||
|
||||
static inline boolean UseVanillaSynch(INT32 node)
|
||||
{
|
||||
return (!UseSaturnSynch(node) && cv_resynchattempts.value);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void *G_DcpyTiccmd(void* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
const size_t d = n / sizeof(ticcmd_t);
|
||||
@@ -2278,7 +2290,7 @@ static void M_ConfirmConnect(event_t *ev)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void AbortConnection(void)
|
||||
void CL_AbortConnection(void)
|
||||
{
|
||||
#ifdef HAVE_CURL
|
||||
CURLAbortFile();
|
||||
@@ -2291,7 +2303,6 @@ static void AbortConnection(void)
|
||||
cl_mode = CL_ABORTED;
|
||||
}
|
||||
|
||||
|
||||
static boolean CL_FinishedFileList(void)
|
||||
{
|
||||
INT32 i;
|
||||
@@ -2304,7 +2315,7 @@ static boolean CL_FinishedFileList(void)
|
||||
}
|
||||
else if (i == 3) // too many files
|
||||
{
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(M_GetText(
|
||||
"You have too many WAD files loaded\n"
|
||||
"to add ones the server is using.\n"
|
||||
@@ -2315,7 +2326,7 @@ static boolean CL_FinishedFileList(void)
|
||||
}
|
||||
else if (i == 2) // cannot join for some reason
|
||||
{
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(M_GetText(
|
||||
"You have the wrong addons loaded.\n\n"
|
||||
"To play on this server, restart\n"
|
||||
@@ -2352,7 +2363,7 @@ static boolean CL_FinishedFileList(void)
|
||||
{
|
||||
if (!CL_CheckDownloadable()) // nope!
|
||||
{
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(M_GetText(
|
||||
"An error occured when trying to\n"
|
||||
"download missing addons.\n"
|
||||
@@ -2617,7 +2628,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
{
|
||||
CONS_Printf(M_GetText("Legacy downloader request packet failed.\n"));
|
||||
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(M_GetText(
|
||||
"The direct download encountered an error.\n"
|
||||
"See the logfile for more info.\n"
|
||||
@@ -2644,7 +2655,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
{
|
||||
CONS_Printf("%d minute wait time exceeded.\n", cv_connectawaittime.value);
|
||||
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(va(
|
||||
"%d minute wait time exceeded.\n"
|
||||
"You may retry connection.\n"
|
||||
@@ -2715,7 +2726,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||
if (!modeattacking && (key == KEY_ESCAPE || key == KEY_JOY1+1 || cl_mode == CL_ABORTED))
|
||||
{
|
||||
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -3302,36 +3313,6 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||
if (gametype == GT_CTF)
|
||||
P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you!
|
||||
|
||||
// If in a special stage, redistribute the player's rings across
|
||||
// the remaining players.
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
{
|
||||
INT32 i, count, increment, rings;
|
||||
|
||||
for (i = 0, count = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i])
|
||||
count++;
|
||||
}
|
||||
|
||||
count--;
|
||||
rings = players[playernum].health - 1;
|
||||
increment = rings/count;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && i != playernum)
|
||||
{
|
||||
if (rings < increment)
|
||||
P_GivePlayerRings(&players[i], rings);
|
||||
else
|
||||
P_GivePlayerRings(&players[i], increment);
|
||||
|
||||
rings -= increment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LUA_HookPlayerQuit(&players[playernum], reason); // Lua hook for player quitting
|
||||
|
||||
if (playernum == displayplayers[0] && !demo.playback)
|
||||
@@ -3973,7 +3954,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||
#ifdef DUMPCONSISTENCY
|
||||
if (msg == KICK_MSG_CON_FAIL) SV_SavedGame();
|
||||
#endif
|
||||
AbortConnection();
|
||||
CL_AbortConnection();
|
||||
|
||||
if (msg == KICK_MSG_CON_FAIL)
|
||||
M_StartMessage(M_GetText("Server closed connection\n(Synch failure)\nPress ESC\n"), NULL, MM_NOTHING);
|
||||
@@ -5416,25 +5397,26 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
if (gamestate == GS_LEVEL
|
||||
&& (realstart > gametic - TICQUEUE+1 && realstart <= gametic)
|
||||
&& consistancy[realstart%TICQUEUE] != SHORT(netbuffer->u.clientpak.consistancy)
|
||||
&& (!is_client_saturn[node] || (!resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime() && !SV_ResendingSavegameToAnyone())))
|
||||
&& (!UseSaturnSynch(node) || (!resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime() && !SV_ResendingSavegameToAnyone())))
|
||||
{
|
||||
resendingsavegame[node] = false; // reset this before just in case
|
||||
|
||||
// Check if a client is saturn before sending ANYTHING!
|
||||
// this way we only send stuff to clients we know can use the gamestate resend
|
||||
// and dont have to wait for a response from clients that never would send a response back
|
||||
if (is_client_saturn[node])
|
||||
if (UseSaturnSynch(node))
|
||||
{
|
||||
// Tell the client we are about to resend them the gamestate
|
||||
netbuffer->packettype = PT_WILLRESENDGAMESTATE;
|
||||
HSendPacket(node, true, 0, 0);
|
||||
resendingsavegame[node] = true;
|
||||
}
|
||||
else
|
||||
else if (UseVanillaSynch(node))
|
||||
{
|
||||
SV_RequireResynch(node);
|
||||
resendingsavegame[node] = false;
|
||||
}
|
||||
|
||||
if ((!is_client_saturn[node] && (cv_resynchattempts.value && resynch_score[node] <= (unsigned)cv_resynchattempts.value*250)) || (is_client_saturn[node] && (gamestate_resend_counter[node] < cv_gamestateattempts.value)))
|
||||
if ((UseVanillaSynch(node) && (resynch_score[node] <= (unsigned)cv_resynchattempts.value*250)) || (UseSaturnSynch(node) && (gamestate_resend_counter[node] < cv_gamestateattempts.value)))
|
||||
{
|
||||
if (is_client_saturn[node] && resendingsavegame[node])
|
||||
{
|
||||
|
||||
@@ -635,6 +635,9 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason);
|
||||
void CL_QueryServerList(msg_server_t *list);
|
||||
void CL_UpdateServerList(void);
|
||||
void CL_TimeoutServerList(void);
|
||||
|
||||
void CL_AbortConnection(void);
|
||||
|
||||
// Is there a game running
|
||||
boolean Playing(void);
|
||||
|
||||
|
||||
@@ -472,6 +472,7 @@ static boolean D_Display(void)
|
||||
F_TitleScreenDrawer();
|
||||
if (wipe)
|
||||
wipedefindex = wipe_titlescreen_toblack;
|
||||
HU_DrawSongCredits();
|
||||
break;
|
||||
|
||||
case GS_WAITINGPLAYERS:
|
||||
@@ -1606,7 +1607,9 @@ void D_SRB2Main(void)
|
||||
#endif
|
||||
|
||||
// for dedicated server
|
||||
#if !defined (DEDICATED)
|
||||
dedicated = M_CheckParm("-dedicated") != 0;
|
||||
#endif
|
||||
|
||||
strcpy(title, "SRB2Kart");
|
||||
strcpy(srb2, "SRB2Kart");
|
||||
|
||||
+33
-117
@@ -211,14 +211,6 @@ void SendWeaponPref4(void);
|
||||
|
||||
static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}};
|
||||
|
||||
#ifdef LJOYSTICK
|
||||
static CV_PossibleValue_t joyport_cons_t[] = {{1, "/dev/js0"}, {2, "/dev/js1"}, {3, "/dev/js2"},
|
||||
{4, "/dev/js3"}, {0, NULL}};
|
||||
#else
|
||||
// accept whatever value - it is in fact the joystick device number
|
||||
#define usejoystick_cons_t NULL
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t autobalance_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2, "Points"}, {0, NULL}};
|
||||
|
||||
@@ -307,36 +299,32 @@ consvar_t cv_mouseturn = {"mouseturn", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL,
|
||||
consvar_t cv_laglesscam = {"lagless_camera", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS] = {
|
||||
{"verticallook", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"verticallook", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"verticallook2", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"verticallook3", "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] = {
|
||||
{"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick1, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick3", "3", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"use_joystick4", "4", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick4, 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_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}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (defined (LJOYSTICK) || defined (HAVE_SDL))
|
||||
#ifdef LJOYSTICK
|
||||
consvar_t cv_joyport = {"joyport", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_joyport2 = {"joyport2", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; //Alam: for later
|
||||
#endif
|
||||
#if defined (HAVE_SDL)
|
||||
consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyscale", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale2", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale3", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale4", "1", CV_SAVE|CV_CALL, NULL, I_JoyScale4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
#else
|
||||
consvar_t cv_joyscale[2] = { //Alam: Dummy for save
|
||||
{"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = { //Alam: Dummy for save
|
||||
{"joyscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale2", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale3", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyscale4", "1", CV_SAVE|CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -344,19 +332,6 @@ consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT|CV_NOSHOWH
|
||||
consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
/*consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_teleporters = {"tv_teleporter", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_superring = {"tv_superring", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_supersneakers = {"tv_supersneaker", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_invincibility = {"tv_invincibility", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_jumpshield = {"tv_jumpshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_watershield = {"tv_watershield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_ringshield = {"tv_ringshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_forceshield = {"tv_forceshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_bombshield = {"tv_bombshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_1up = {"tv_1up", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/
|
||||
|
||||
// SRB2kart
|
||||
consvar_t cv_sneaker = {"sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_rocketsneaker = {"rocketsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -472,7 +447,6 @@ consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_On
|
||||
consvar_t cv_netstat = {"netstat", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics
|
||||
static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_nettimeout = {"nettimeout", "210", CV_CALL|CV_SAVE, nettimeout_cons_t, NetTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
//static CV_PossibleValue_t jointimeout_cons_t[] = {{5*TICRATE, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_jointimeout = {"jointimeout", "210", CV_CALL|CV_SAVE, nettimeout_cons_t, JoinTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_maxping = {"maxdelay", "20", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -992,7 +966,18 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_showfocuslost);
|
||||
CV_RegisterVar(&cv_pauseifunfocused);
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
CV_RegisterVar(&cv_addons_md5);
|
||||
CV_RegisterVar(&cv_addons_showall);
|
||||
CV_RegisterVar(&cv_addons_search_type);
|
||||
CV_RegisterVar(&cv_addons_search_case);
|
||||
|
||||
// g_input.c
|
||||
CV_RegisterVar(&cv_controlperkey);
|
||||
CV_RegisterVar(&cv_turnsmooth);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_turnaxis[i]);
|
||||
@@ -1010,45 +995,17 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_custom3axis[i]);
|
||||
CV_RegisterVar(&cv_xdeadzone[i]);
|
||||
CV_RegisterVar(&cv_ydeadzone[i]);
|
||||
}
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
CV_RegisterVar(&cv_addons_md5);
|
||||
CV_RegisterVar(&cv_addons_showall);
|
||||
CV_RegisterVar(&cv_addons_search_type);
|
||||
CV_RegisterVar(&cv_addons_search_case);
|
||||
|
||||
CV_RegisterVar(&cv_controlperkey);
|
||||
CV_RegisterVar(&cv_turnsmooth);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_usejoystick[i]);
|
||||
CV_RegisterVar(&cv_joyscale[i]);
|
||||
CV_RegisterVar(&cv_rumble[i]);
|
||||
CV_RegisterVar(&cv_gamepadled[i]);
|
||||
CV_RegisterVar(&cv_ledpowerup[i]);
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_usemouse);
|
||||
CV_RegisterVar(&cv_invertmouse);
|
||||
CV_RegisterVar(&cv_mousesens);
|
||||
CV_RegisterVar(&cv_mouseysens);
|
||||
//CV_RegisterVar(&cv_mousemove);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_usejoystick[i]);
|
||||
}
|
||||
#ifdef LJOYSTICK
|
||||
CV_RegisterVar(&cv_joyport);
|
||||
CV_RegisterVar(&cv_joyport2);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_joyscale[i]);
|
||||
}
|
||||
|
||||
// s_sound.c
|
||||
CV_RegisterVar(&cv_soundvolume);
|
||||
@@ -1097,6 +1054,7 @@ void D_RegisterClientCommands(void)
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_demodateformat);
|
||||
CV_RegisterVar(&cv_showspecstuff);
|
||||
|
||||
// ingame object placing
|
||||
COM_AddCommand("objectplace", Command_ObjectPlace_f);
|
||||
@@ -1131,8 +1089,6 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_discordasks);
|
||||
#endif
|
||||
|
||||
CV_RegisterVar(&cv_showspecstuff);
|
||||
|
||||
COM_AddCommand("listskins", Command_ListSkins);
|
||||
COM_AddCommand("skinsearch", Command_SkinSearch);
|
||||
}
|
||||
@@ -1441,6 +1397,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
|
||||
|
||||
if (server && netgame)
|
||||
{
|
||||
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||
@@ -1798,24 +1755,8 @@ static void SendNameAndColor3(void)
|
||||
|
||||
if ((foundskin = R_SkinAvailable(cv_skin3.string)) != -1)
|
||||
{
|
||||
//boolean notsame;
|
||||
|
||||
cv_skin3.value = foundskin;
|
||||
|
||||
//notsame = (cv_skin3.value != players[thirdplaya].skin);
|
||||
|
||||
SetPlayerSkin(thirdplaya, cv_skin3.string);
|
||||
|
||||
// SRB2Kart
|
||||
/*if (notsame)
|
||||
{
|
||||
CV_StealthSetValue(&cv_playercolor3, skins[players[thirdplaya].skin].prefcolor);
|
||||
|
||||
players[thirdplaya].skincolor = (cv_playercolor3.value&0x3F) % MAXSKINCOLORS;
|
||||
|
||||
if (players[thirdplaya].mo)
|
||||
players[thirdplaya].mo->color = players[thirdplaya].skincolor;
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2127,6 +2068,7 @@ void D_SendPlayerConfig(void)
|
||||
SendNameAndColor3();
|
||||
if (splitscreen > 2)
|
||||
SendNameAndColor4();
|
||||
|
||||
SendWeaponPref();
|
||||
if (splitscreen)
|
||||
SendWeaponPref2();
|
||||
@@ -2150,7 +2092,7 @@ static INT32 LookupPlayer(const char *s)
|
||||
if (*s == '0')/* clever way to bypass atoi */
|
||||
return 0;
|
||||
|
||||
if (( playernum = atoi(s) ))
|
||||
if ((playernum = atoi(s)))
|
||||
{
|
||||
playernum = max(min(playernum, MAXPLAYERS-1), 0);/* not out of range */
|
||||
return playernum;
|
||||
@@ -2231,8 +2173,7 @@ static void Command_View_f(void)
|
||||
|
||||
if (viewnum > 1 && !( multiplayer && demo.playback ))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE,
|
||||
"You must be viewing a multiplayer replay to use this.\n");
|
||||
CONS_Alert(CONS_NOTICE, "You must be viewing a multiplayer replay to use this.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2314,10 +2255,9 @@ static void Command_SetViews_f(void)
|
||||
UINT8 splits;
|
||||
UINT8 newsplits;
|
||||
|
||||
if (!( demo.playback && multiplayer ))
|
||||
if (!(demo.playback && multiplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE,
|
||||
"You must be viewing a multiplayer replay to use this.\n");
|
||||
CONS_Alert(CONS_NOTICE, "You must be viewing a multiplayer replay to use this.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2536,18 +2476,8 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r
|
||||
// Kick bot from special stages
|
||||
if (botskin)
|
||||
{
|
||||
if (G_IsSpecialStage(mapnum))
|
||||
if (!botingame)
|
||||
{
|
||||
if (botingame)
|
||||
{
|
||||
//CL_RemoveSplitscreenPlayer();
|
||||
botingame = false;
|
||||
playeringame[1] = false;
|
||||
}
|
||||
}
|
||||
else if (!botingame)
|
||||
{
|
||||
//CL_AddSplitscreenPlayer();
|
||||
botingame = true;
|
||||
displayplayers[1] = 1;
|
||||
playeringame[1] = true;
|
||||
@@ -3133,20 +3063,6 @@ static void Command_Respawn(void)
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (!G_RaceGametype()) // srb2kart: not necessary, respawning makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit
|
||||
{
|
||||
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
|
||||
return;
|
||||
}*/
|
||||
|
||||
// Retry is quicker. Probably should force people to use it.
|
||||
// nope, this is srb2kart - a complete retry is overkill
|
||||
/*if (!(netgame || multiplayer))
|
||||
{
|
||||
CONS_Printf(M_GetText("You can't use this in Single Player! Use \"retry\" instead.\n"));
|
||||
return;
|
||||
}*/
|
||||
|
||||
SendNetXCmd(XD_RESPAWN, &buf, 4);
|
||||
}
|
||||
|
||||
|
||||
@@ -1306,6 +1306,21 @@ void CURLPrepareFile(const char* url, int dfilenum)
|
||||
|
||||
strcatbf(curl_curfile->filename, downloaddir, "/");
|
||||
curl_curfile->file = fopen(curl_curfile->filename, "wb");
|
||||
|
||||
if (!curl_curfile->file)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Couldnt open %s for writing!\nAborting file download.\nCheck if you have write access to your download folder!\n", curl_curfile->filename);
|
||||
CL_AbortConnection();
|
||||
M_StartMessage(M_GetText(
|
||||
"An error occured when trying to\n"
|
||||
"download missing addons.\n"
|
||||
"See the console or log file\n"
|
||||
"for additional details.\n\n"
|
||||
"Press ESC\n"
|
||||
), NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
curl_easy_setopt(http_handle, CURLOPT_WRITEDATA, curl_curfile->file);
|
||||
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, curlwrite_data);
|
||||
curl_easy_setopt(http_handle, CURLOPT_NOPROGRESS, 0L);
|
||||
@@ -1366,6 +1381,7 @@ void CURLGetFile(void)
|
||||
CONS_Alert(CONS_WARNING, "curl_multi_wait() failed, code %d.\n", mc);
|
||||
continue;
|
||||
}
|
||||
|
||||
curl_curfile->currentsize = curl_dlnow;
|
||||
curl_curfile->totalsize = curl_dltotal;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// libwad: Doom WAD format interface library.
|
||||
// Copyright (C) 2011 by Callum Dickinson.
|
||||
// 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
|
||||
@@ -14,21 +13,12 @@
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file wad_static.h
|
||||
/// \brief Static header for internal libwad operations.
|
||||
/// \file
|
||||
/// \brief Support to show ENDOOM text
|
||||
|
||||
#ifndef __WAD_STATIC_H__
|
||||
#define __WAD_STATIC_H__
|
||||
#ifndef __ENDTXT__
|
||||
#define __ENDTXT__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "../include/wad.h"
|
||||
void ShowEndTxt (void);
|
||||
|
||||
void WAD_ErrorSet(const char *text);
|
||||
|
||||
inline void WAD_FreeMemory(FILE *file, wadheader_t *header, void *lumpdir, lump_t *lumps, wad_t *wad);
|
||||
|
||||
#endif // __WAD_STATIC_H__
|
||||
#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;
|
||||
}
|
||||
+2
-2
@@ -113,8 +113,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v8"
|
||||
#define VERSIONSTRINGW L"Saturn v8"
|
||||
#define VERSIONSTRING "Saturn v8.2"
|
||||
#define VERSIONSTRINGW L"Saturn v8.2"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||
// AND appveyor.yml, for the build bots!
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#include "../doomdef.h"
|
||||
#include "../d_main.h"
|
||||
#include "../m_argv.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
myargc = argc;
|
||||
myargv = argv; /// \todo pull out path to exe from this string
|
||||
|
||||
// startup SRB2
|
||||
CONS_Printf("Setting up SRB2...\n");
|
||||
D_SRB2Main();
|
||||
CONS_Printf("Entering main game loop...\n");
|
||||
// never return
|
||||
D_SRB2Loop();
|
||||
|
||||
// return to OS
|
||||
#ifndef __GNUC__
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "../i_net.h"
|
||||
|
||||
boolean I_InitNetwork(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
#include "../i_sound.h"
|
||||
|
||||
UINT8 sound_started = 0;
|
||||
|
||||
void *I_GetSfx(sfxinfo_t *sfx)
|
||||
{
|
||||
(void)sfx;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_FreeSfx(sfxinfo_t *sfx)
|
||||
{
|
||||
(void)sfx;
|
||||
}
|
||||
|
||||
void I_StartupSound(void){}
|
||||
|
||||
void I_ShutdownSound(void){}
|
||||
|
||||
void I_UpdateSound(void){};
|
||||
|
||||
//
|
||||
// SFX I/O
|
||||
//
|
||||
|
||||
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 -1;
|
||||
}
|
||||
|
||||
void I_StopSound(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
boolean I_SoundIsPlaying(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
|
||||
{
|
||||
(void)handle;
|
||||
(void)vol;
|
||||
(void)sep;
|
||||
(void)pitch;
|
||||
}
|
||||
|
||||
void I_SetSfxVolume(UINT8 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
// MUSIC SYSTEM
|
||||
/// ------------------------
|
||||
|
||||
void I_InitMusic(void){}
|
||||
|
||||
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
|
||||
/// ------------------------
|
||||
|
||||
boolean I_LoadSong(char *data, size_t len)
|
||||
{
|
||||
(void)data;
|
||||
(void)len;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void I_UnloadSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
boolean I_PlaySong(boolean looping)
|
||||
{
|
||||
(void)handle;
|
||||
(void)looping;
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_StopSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
void I_PauseSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void));
|
||||
{
|
||||
(void)target_volume;
|
||||
(void)ms;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_FadeOutStopSong(UINT32 ms)
|
||||
{
|
||||
(void)ms;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
|
||||
{
|
||||
(void)ms;
|
||||
(void)looping;
|
||||
return false;
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
#include "../doomdef.h"
|
||||
#include "../i_system.h"
|
||||
|
||||
UINT8 graphics_started = 0;
|
||||
|
||||
UINT8 keyboard_started = 0;
|
||||
|
||||
size_t I_GetFreeMem(size_t *total)
|
||||
{
|
||||
*total = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_Sleep(UINT32 ms){}
|
||||
|
||||
precise_t I_GetPreciseTime(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT64 I_GetPrecisePrecision(void) {
|
||||
return 1000000;
|
||||
}
|
||||
|
||||
void I_GetEvent(void){}
|
||||
|
||||
void I_OsPolling(void){}
|
||||
|
||||
ticcmd_t *I_BaseTiccmd(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ticcmd_t *I_BaseTiccmd2(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_Quit(void)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void I_Error(const char *error, ...)
|
||||
{
|
||||
(void)error;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
void I_Tactile(FFType Type, const JoyFF_t *Effect)
|
||||
{
|
||||
(void)Type;
|
||||
(void)Effect;
|
||||
}
|
||||
|
||||
void I_Tactile2(FFType Type, const JoyFF_t *Effect)
|
||||
{
|
||||
(void)Type;
|
||||
(void)Effect;
|
||||
}
|
||||
|
||||
void I_JoyScale(void){}
|
||||
|
||||
void I_JoyScale2(void){}
|
||||
|
||||
void I_InitJoystick(void){}
|
||||
|
||||
void I_InitJoystick2(void){}
|
||||
|
||||
INT32 I_NumJoys(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *I_GetJoyName(INT32 joyindex)
|
||||
{
|
||||
(void)joyindex;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NOMUMBLE
|
||||
void I_UpdateMumble(const mobj_t *mobj, const listener_t listener)
|
||||
{
|
||||
(void)mobj;
|
||||
(void)listener;
|
||||
}
|
||||
#endif
|
||||
|
||||
void I_OutputMsg(const char *error, ...)
|
||||
{
|
||||
(void)error;
|
||||
}
|
||||
|
||||
void I_StartupMouse(void){}
|
||||
|
||||
void I_StartupKeyboard(void){}
|
||||
|
||||
INT32 I_GetKey(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void I_StartupTimer(void){}
|
||||
|
||||
void I_AddExitFunc(void (*func)())
|
||||
{
|
||||
(void)func;
|
||||
}
|
||||
|
||||
void I_RemoveExitFunc(void (*func)())
|
||||
{
|
||||
(void)func;
|
||||
}
|
||||
|
||||
INT32 I_StartupSystem(void)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void I_ShutdownSystem(void){}
|
||||
|
||||
void I_GetDiskFreeSpace(INT64* freespace)
|
||||
{
|
||||
*freespace = 0;
|
||||
}
|
||||
|
||||
char *I_GetUserName(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INT32 I_mkdir(const char *dirname, INT32 unixright)
|
||||
{
|
||||
(void)dirname;
|
||||
(void)unixright;
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *I_LocateWad(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_GetJoystickEvents(void){}
|
||||
|
||||
void I_GetJoystick2Events(void){}
|
||||
|
||||
char *I_GetEnv(const char *name)
|
||||
{
|
||||
(void)name;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INT32 I_PutEnv(char *variable)
|
||||
{
|
||||
(void)variable;
|
||||
return -1;
|
||||
}
|
||||
|
||||
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *I_ClipboardPaste(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_RegisterSysCommands(void) {}
|
||||
|
||||
#include "../sdl/dosstr.c"
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#include "../doomdef.h"
|
||||
#include "../command.h"
|
||||
#include "../i_video.h"
|
||||
|
||||
rendermode_t rendermode = render_none;
|
||||
|
||||
boolean highcolor = false;
|
||||
|
||||
boolean allow_fullscreen = false;
|
||||
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
void I_StartupGraphics(void){}
|
||||
|
||||
void I_ShutdownGraphics(void){}
|
||||
|
||||
void I_SetPalette(RGBA_t *palette)
|
||||
{
|
||||
(void)palette;
|
||||
}
|
||||
|
||||
INT32 VID_NumModes(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 VID_GetModeForSize(INT32 w, INT32 h)
|
||||
{
|
||||
(void)w;
|
||||
(void)h;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void VID_PrepareModeList(void){}
|
||||
|
||||
INT32 VID_SetMode(INT32 modenum)
|
||||
{
|
||||
(void)modenum;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *VID_GetModeName(INT32 modenum)
|
||||
{
|
||||
(void)modenum;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_UpdateNoBlit(void){}
|
||||
|
||||
void I_FinishUpdate(void){}
|
||||
|
||||
void I_UpdateNoVsync(void) {}
|
||||
|
||||
void I_WaitVBL(INT32 count)
|
||||
{
|
||||
(void)count;
|
||||
}
|
||||
|
||||
void I_ReadScreen(UINT8 *scr)
|
||||
{
|
||||
(void)scr;
|
||||
}
|
||||
|
||||
void I_BeginRead(void){}
|
||||
|
||||
void I_EndRead(void){}
|
||||
|
||||
+73
-146
@@ -396,7 +396,6 @@ consvar_t cv_growmusic = {"growmusic", "On", CV_SAVE, powermusic_cons_t, NULL,
|
||||
consvar_t cv_supermusic = {"supermusic", "On", CV_SAVE, powermusic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
//consvar_t cv_mousemove = {"mousemove", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
||||
{1, "Left X"}, {2, "Left Y"}, {-1, "Left X-"}, {-2, "Left Y-"},
|
||||
@@ -417,105 +416,105 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
||||
static CV_PossibleValue_t deadzone_cons_t[] = {{FRACUNIT/16, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_turnaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_moveaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_camstrafeaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_camstrafe", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_camstrafe", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_camstrafe", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_camstrafe", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_camstrafe", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_camturnaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_camturn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_camturn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_camturn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_camturn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_camturn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_brakeaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_aimaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_aim", "Left Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_aim", "Left Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_aim", "Left Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_aim", "Left Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_aim", "Left Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_lookaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_fireaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_fire", "L Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_fire", "L Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_fire", "L Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_fire", "L Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_fire", "L Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_driftaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_drift", "R Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_drift", "R Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_drift", "R Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_drift", "R Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_drift", "R Trigger", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_lookbackaxis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_lookback", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_lookback", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_lookback", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_lookback", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_lookback", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_custom1axis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_custom1", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_custom1", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_custom1", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_custom1", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_custom1", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_custom2axis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_custom2", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_custom2", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_custom2", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_custom2", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_custom2", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_custom3axis[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joyaxis_custom3", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis_custom3", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis2_custom3", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis3_custom3", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joyaxis4_custom3", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_xdeadzone[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joy_xdeadzone", "0.3", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy_xdeadzone", "0.3", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy2_xdeadzone", "0.3", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy3_xdeadzone", "0.3", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy4_xdeadzone", "0.3", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_ydeadzone[MAXSPLITSCREENPLAYERS] = {
|
||||
{"joy_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy2_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy3_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"joy4_ydeadzone", "0.5", CV_FLOAT|CV_SAVE, deadzone_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
@@ -626,6 +625,17 @@ static void G_SetSaveGameModified(void)
|
||||
strcatbf(savegamename, srb2home, PATHSEP);
|
||||
|
||||
G_LoadGameData();
|
||||
|
||||
// unlock EVERYTHING.
|
||||
for (UINT8 i = 0; i < MAXUNLOCKABLES; i++)
|
||||
{
|
||||
if (!unlockables[i].conditionset)
|
||||
continue;
|
||||
if (!unlockables[i].unlocked)
|
||||
{
|
||||
unlockables[i].unlocked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for consistency among messages: this modifies the game and removes savemoddata.
|
||||
@@ -1280,7 +1290,7 @@ static void G_DoLoadLevel(boolean resetplayer)
|
||||
|
||||
for (i = 0; i < JOYAXISSET; i++)
|
||||
{
|
||||
joyxmove[i] = joyymove[i] = 0;
|
||||
joyxmove[i] = joyymove[i] = 0;
|
||||
joy2xmove[i] = joy2ymove[i] = 0;
|
||||
joy3xmove[i] = joy3ymove[i] = 0;
|
||||
joy4xmove[i] = joy4ymove[i] = 0;
|
||||
@@ -1572,10 +1582,7 @@ boolean G_CouldView(INT32 playernum)
|
||||
return false;
|
||||
|
||||
// SRB2Kart: Only go through players who are actually playing
|
||||
if (player->exiting)
|
||||
return false;
|
||||
|
||||
if (player->pflags & PF_TIMEOVER)
|
||||
if (player->exiting || (player->pflags & PF_TIMEOVER))
|
||||
return false;
|
||||
|
||||
// I don't know if we want this actually, but I'll humor the suggestion anyway
|
||||
@@ -1837,11 +1844,11 @@ void G_Ticker(boolean run)
|
||||
{
|
||||
switch (gameaction)
|
||||
{
|
||||
case ga_completed: G_DoCompleted(); break;
|
||||
case ga_completed: G_DoCompleted(); break;
|
||||
case ga_startcont: G_DoStartContinue(); break;
|
||||
case ga_continued: G_DoContinued(); break;
|
||||
case ga_worlddone: G_DoWorldDone(); break;
|
||||
case ga_startvote: G_DoStartVote(); break;
|
||||
case ga_continued: G_DoContinued(); break;
|
||||
case ga_worlddone: G_DoWorldDone(); break;
|
||||
case ga_startvote: G_DoStartVote(); break;
|
||||
case ga_nothing: break;
|
||||
default: I_Error("gameaction = %d\n", gameaction);
|
||||
}
|
||||
@@ -1943,6 +1950,7 @@ void G_Ticker(boolean run)
|
||||
|
||||
case GS_TITLESCREEN:
|
||||
F_TitleScreenTicker(run);
|
||||
HU_TickSongCredits();
|
||||
break;
|
||||
case GS_WAITINGPLAYERS:
|
||||
if (netgame)
|
||||
@@ -2560,10 +2568,10 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||
{
|
||||
if (!playeringame[j] || players[j].spectator)
|
||||
continue;
|
||||
if (j == playernum)
|
||||
continue;
|
||||
if (j == i)
|
||||
|
||||
if ((j == playernum) || (j == i))
|
||||
continue;
|
||||
|
||||
if (players[j].score == players[i].score)
|
||||
num++;
|
||||
}
|
||||
@@ -2661,6 +2669,7 @@ void G_DoReborn(INT32 playernum)
|
||||
}
|
||||
|
||||
B_RespawnBot(playernum);
|
||||
|
||||
if (oldmo)
|
||||
G_ChangePlayerReferences(oldmo, players[playernum].mo);
|
||||
}
|
||||
@@ -2683,6 +2692,7 @@ void G_DoReborn(INT32 playernum)
|
||||
}
|
||||
|
||||
G_SpawnPlayer(playernum, starpost);
|
||||
|
||||
if (oldmo)
|
||||
G_ChangePlayerReferences(oldmo, players[playernum].mo);
|
||||
|
||||
@@ -2751,62 +2761,6 @@ INT32 G_GetGametypeByName(const char *gametypestr)
|
||||
return -1; // unknown gametype
|
||||
}
|
||||
|
||||
//
|
||||
// G_IsSpecialStage
|
||||
//
|
||||
// Returns TRUE if
|
||||
// the given map is a special stage.
|
||||
//
|
||||
boolean G_IsSpecialStage(INT32 mapnum)
|
||||
{
|
||||
(void)mapnum;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// G_GametypeUsesLives
|
||||
//
|
||||
// Returns true if the current gametype uses
|
||||
// the lives system. False otherwise.
|
||||
//
|
||||
boolean G_GametypeUsesLives(void)
|
||||
{
|
||||
// SRB2kart NEEDS no lives
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// G_GametypeHasTeams
|
||||
//
|
||||
// Returns true if the current gametype uses
|
||||
// Red/Blue teams. False otherwise.
|
||||
//
|
||||
boolean G_GametypeHasTeams(void)
|
||||
{
|
||||
return (gametype == GT_TEAMMATCH || gametype == GT_CTF);
|
||||
}
|
||||
|
||||
//
|
||||
// G_GametypeHasSpectators
|
||||
//
|
||||
// Returns true if the current gametype supports
|
||||
// spectators. False otherwise.
|
||||
//
|
||||
boolean G_GametypeHasSpectators(void)
|
||||
{
|
||||
return (netgame || (multiplayer && demo.playback)); //true
|
||||
}
|
||||
|
||||
//
|
||||
// G_BattleGametype
|
||||
//
|
||||
// Returns true in Battle gamemodes, previously was G_RingSlingerGametype.
|
||||
//
|
||||
boolean G_BattleGametype(void)
|
||||
{
|
||||
return (gametype == GT_MATCH);
|
||||
}
|
||||
|
||||
//
|
||||
// G_SometimesGetDifferentGametype
|
||||
//
|
||||
@@ -2838,6 +2792,7 @@ UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (encoreactual != (boolean)cv_kartencore.value)
|
||||
encoremodifier = 0x80;
|
||||
}
|
||||
@@ -2871,6 +2826,7 @@ UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype)
|
||||
return (GT_RACE|0x80);
|
||||
return (GT_RACE);
|
||||
}
|
||||
|
||||
// This might appear wrong HERE, but the game will display the Encore possibility on the second voting choice instead.
|
||||
return (GT_MATCH|encoremodifier);
|
||||
}
|
||||
@@ -2893,27 +2849,6 @@ UINT8 G_GetGametypeColor(INT16 gt)
|
||||
return 247; // FALLBACK
|
||||
}
|
||||
|
||||
//
|
||||
// G_RaceGametype
|
||||
//
|
||||
// Returns true in Race gamemodes, previously was G_PlatformGametype.
|
||||
//
|
||||
boolean G_RaceGametype(void)
|
||||
{
|
||||
return (gametype == GT_RACE);
|
||||
}
|
||||
|
||||
//
|
||||
// G_TagGametype
|
||||
//
|
||||
// For Jazz's Tag/HnS modes that have a lot of special cases...
|
||||
// SRB2Kart: do we actually want to add Kart tag later? :V
|
||||
//
|
||||
boolean G_TagGametype(void)
|
||||
{
|
||||
return (gametype == GT_TAG || gametype == GT_HIDEANDSEEK);
|
||||
}
|
||||
|
||||
/** Get the typeoflevel flag needed to indicate support of a gametype.
|
||||
* In single-player, this always returns TOL_SP.
|
||||
* \param gametype The gametype for which support is desired.
|
||||
@@ -2977,7 +2912,8 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean ignorebuffer, UINT8 maph
|
||||
if (extbuffer != NULL)
|
||||
{
|
||||
bufx = 0;
|
||||
while (extbuffer[bufx]) {
|
||||
while (extbuffer[bufx])
|
||||
{
|
||||
extbufsize++; bufx++;
|
||||
}
|
||||
}
|
||||
@@ -3106,7 +3042,6 @@ void G_AddMapToBuffer(INT16 map)
|
||||
static void G_DoCompleted(void)
|
||||
{
|
||||
INT32 i, j = 0;
|
||||
boolean gottoken = false;
|
||||
|
||||
tokenlist = 0; // Reset the list
|
||||
|
||||
@@ -3155,15 +3090,13 @@ static void G_DoCompleted(void)
|
||||
nextmap = (INT16)(mapheaderinfo[gamemap-1]->nextlevel-1);
|
||||
|
||||
// Remember last map for when you come out of the special stage.
|
||||
if (!G_IsSpecialStage(gamemap))
|
||||
lastmap = nextmap;
|
||||
lastmap = nextmap;
|
||||
|
||||
// If nextmap is actually going to get used, make sure it points to
|
||||
// a map of the proper gametype -- skip levels that don't support
|
||||
// the current gametype. (Helps avoid playing boss levels in Race,
|
||||
// for instance).
|
||||
if (!token && !G_IsSpecialStage(gamemap) && !modeattacking
|
||||
&& (nextmap >= 0 && nextmap < NUMMAPS))
|
||||
if (!token && !modeattacking && (nextmap >= 0 && nextmap < NUMMAPS))
|
||||
{
|
||||
register INT16 cm = nextmap;
|
||||
INT16 tolflag = G_TOLFlag(gametype);
|
||||
@@ -3217,12 +3150,11 @@ static void G_DoCompleted(void)
|
||||
if (gametype == GT_COOP && token)
|
||||
{
|
||||
token--;
|
||||
gottoken = true;
|
||||
|
||||
if (!(emeralds & EMERALD1))
|
||||
nextmap = (INT16)(sstage_start - 1); // Special Stage 1
|
||||
else if (!(emeralds & EMERALD2))
|
||||
nextmap = (INT16)(sstage_start); // Special Stage 2
|
||||
nextmap = (INT16)(sstage_start); // Special Stage 2
|
||||
else if (!(emeralds & EMERALD3))
|
||||
nextmap = (INT16)(sstage_start + 1); // Special Stage 3
|
||||
else if (!(emeralds & EMERALD4))
|
||||
@@ -3233,13 +3165,8 @@ static void G_DoCompleted(void)
|
||||
nextmap = (INT16)(sstage_start + 4); // Special Stage 6
|
||||
else if (!(emeralds & EMERALD7))
|
||||
nextmap = (INT16)(sstage_start + 5); // Special Stage 7
|
||||
else
|
||||
gottoken = false;
|
||||
}
|
||||
|
||||
if (G_IsSpecialStage(gamemap) && !gottoken)
|
||||
nextmap = lastmap; // Exiting from a special stage? Go back to the game. Tails 08-11-2001
|
||||
|
||||
automapactive = false;
|
||||
|
||||
if (gametype != GT_COOP)
|
||||
@@ -3270,7 +3197,6 @@ demointermission:
|
||||
void G_AfterIntermission(void)
|
||||
{
|
||||
HU_ClearCEcho();
|
||||
//G_NextLevel();
|
||||
|
||||
if (demo.playback)
|
||||
{
|
||||
@@ -3827,9 +3753,6 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
||||
if (demo.playback) // reset game engine
|
||||
G_StopDemo();
|
||||
|
||||
// paused = false;
|
||||
// automapactive = false;
|
||||
|
||||
// dearchive all the modifications
|
||||
if (!P_LoadGame(&save, mapoverride))
|
||||
{
|
||||
@@ -4939,6 +4862,13 @@ void G_WriteAllGhostTics(void)
|
||||
if (multiplayer && ((counter % cv_netdemosyncquality.value) != 0)) // Only write 1 in this many ghost datas per tic to cut down on multiplayer replay size.
|
||||
continue;
|
||||
|
||||
if (((ghostext[i].flags && (ghostext[i].flags & EZT_HIT)) || ghostext[i].hits)
|
||||
&& !ghostext[i].hitlist) // hitlist might be freed during resynch, beware PU_LEVEL!
|
||||
{
|
||||
ghostext[i].hits = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
CHECKSPACE(1);
|
||||
|
||||
WRITEUINT8(demobuf.p, i);
|
||||
@@ -5005,9 +4935,9 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
ziptic |= GZT_XYZ;
|
||||
|
||||
CHECKSPACE(sizeof(fixed_t)*3);
|
||||
WRITEFIXED(demobuf.p,oldghost[playernum].x);
|
||||
WRITEFIXED(demobuf.p,oldghost[playernum].y);
|
||||
WRITEFIXED(demobuf.p,oldghost[playernum].z);
|
||||
WRITEFIXED(demobuf.p, oldghost[playernum].x);
|
||||
WRITEFIXED(demobuf.p, oldghost[playernum].y);
|
||||
WRITEFIXED(demobuf.p, oldghost[playernum].z);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5025,8 +4955,8 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
|
||||
CHECKSPACE(4);
|
||||
|
||||
WRITEINT16(demobuf.p,momx);
|
||||
WRITEINT16(demobuf.p,momy);
|
||||
WRITEINT16(demobuf.p, momx);
|
||||
WRITEINT16(demobuf.p, momy);
|
||||
}
|
||||
|
||||
momx = (INT16)((ghost->z-oldghost[playernum].z + (1<<4))>>8);
|
||||
@@ -5038,7 +4968,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
|
||||
CHECKSPACE(2);
|
||||
|
||||
WRITEINT16(demobuf.p,momx);
|
||||
WRITEINT16(demobuf.p, momx);
|
||||
}
|
||||
|
||||
// This SHOULD set oldghost.x/y/z to match ghost->x/y/z
|
||||
@@ -5061,7 +4991,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
|
||||
CHECKSPACE(1);
|
||||
|
||||
WRITEUINT8(demobuf.p,oldghost[playernum].angle);
|
||||
WRITEUINT8(demobuf.p, oldghost[playernum].angle);
|
||||
}
|
||||
|
||||
// Store the sprite frame.
|
||||
@@ -5073,7 +5003,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
|
||||
CHECKSPACE(1);
|
||||
|
||||
WRITEUINT8(demobuf.p,oldghost[playernum].frame);
|
||||
WRITEUINT8(demobuf.p, oldghost[playernum].frame);
|
||||
}
|
||||
|
||||
// Check for sprite set changes
|
||||
@@ -5109,26 +5039,26 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
if (ghostext[playernum].flags)
|
||||
{
|
||||
ziptic |= GZT_EXTRA;
|
||||
WRITEUINT8(demobuf.p,ghostext[playernum].flags);
|
||||
WRITEUINT8(demobuf.p, ghostext[playernum].flags);
|
||||
|
||||
if (ghostext[playernum].flags & EZT_COLOR)
|
||||
{
|
||||
CHECKSPACE(1);
|
||||
WRITEUINT8(demobuf.p,ghostext[playernum].color);
|
||||
WRITEUINT8(demobuf.p, ghostext[playernum].color);
|
||||
ghostext[playernum].lastcolor = ghostext[playernum].color;
|
||||
}
|
||||
|
||||
if (ghostext[playernum].flags & EZT_SCALE)
|
||||
{
|
||||
CHECKSPACE(sizeof(fixed_t));
|
||||
WRITEFIXED(demobuf.p,ghostext[playernum].scale);
|
||||
WRITEFIXED(demobuf.p, ghostext[playernum].scale);
|
||||
ghostext[playernum].lastscale = ghostext[playernum].scale;
|
||||
}
|
||||
|
||||
if (ghostext[playernum].flags & EZT_HIT)
|
||||
{
|
||||
CHECKSPACE(2);
|
||||
WRITEUINT16(demobuf.p,ghostext[playernum].hits);
|
||||
WRITEUINT16(demobuf.p, ghostext[playernum].hits);
|
||||
|
||||
for (i = 0; i < ghostext[playernum].hits; i++)
|
||||
{
|
||||
@@ -5136,13 +5066,13 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
|
||||
CHECKSPACE(4+4+2+sizeof(fixed_t)*3+sizeof(angle_t));
|
||||
|
||||
WRITEUINT32(demobuf.p,UINT32_MAX); // reserved for some method of determining exactly which mobj this is. (mobjnum doesn't work here.)
|
||||
WRITEUINT32(demobuf.p,mo->type);
|
||||
WRITEUINT16(demobuf.p,(UINT16)mo->health);
|
||||
WRITEFIXED(demobuf.p,mo->x);
|
||||
WRITEFIXED(demobuf.p,mo->y);
|
||||
WRITEFIXED(demobuf.p,mo->z);
|
||||
WRITEANGLE(demobuf.p,mo->angle);
|
||||
WRITEUINT32(demobuf.p, UINT32_MAX); // reserved for some method of determining exactly which mobj this is. (mobjnum doesn't work here.)
|
||||
WRITEUINT32(demobuf.p, mo->type);
|
||||
WRITEUINT16(demobuf.p, (UINT16)mo->health);
|
||||
WRITEFIXED(demobuf.p, mo->x);
|
||||
WRITEFIXED(demobuf.p, mo->y);
|
||||
WRITEFIXED(demobuf.p, mo->z);
|
||||
WRITEANGLE(demobuf.p, mo->angle);
|
||||
P_SetTarget(ghostext[playernum].hitlist+i, NULL);
|
||||
}
|
||||
|
||||
@@ -5152,7 +5082,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||
if (ghostext[playernum].flags & EZT_SPRITE)
|
||||
{
|
||||
CHECKSPACE(1);
|
||||
WRITEUINT8(demobuf.p,sprite);
|
||||
WRITEUINT8(demobuf.p, sprite);
|
||||
}
|
||||
|
||||
if (ghostext[playernum].flags & EZT_KART)
|
||||
@@ -8187,9 +8117,6 @@ void G_SaveDemo(void)
|
||||
|
||||
UINT8 *p = demobuf.buffer+16; // after version
|
||||
UINT32 length;
|
||||
#ifdef NOMD5
|
||||
UINT8 i;
|
||||
#endif
|
||||
|
||||
// Ensure extrainfo pointer is always available, even if no info is present.
|
||||
if (demoinfo_p && *(UINT32 *)demoinfo_p == 0)
|
||||
@@ -8244,7 +8171,7 @@ void G_SaveDemo(void)
|
||||
length = *(UINT32 *)demoinfo_p;
|
||||
WRITEUINT32(demoinfo_p, length);
|
||||
#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.
|
||||
#else
|
||||
// Make a checksum of everything after the checksum in the file up to the end of the standard data. Extrainfo is freely modifiable.
|
||||
|
||||
+15
-8
@@ -388,16 +388,24 @@ boolean G_CheckDemoStatus(void);
|
||||
void G_SaveDemo(void);
|
||||
boolean G_DemoTitleResponder(event_t *ev);
|
||||
|
||||
#define G_GametypeHasTeams() (G_IsGameType(GT_TEAMMATCH) || G_IsGameType(GT_CTF))
|
||||
#define G_BattleGametype() (G_IsGameType(GT_MATCH))
|
||||
#define G_RaceGametype() (G_IsGameType(GT_RACE))
|
||||
#define G_TagGametype() (G_IsGameType(GT_TAG) || G_IsGameType(GT_HIDEANDSEEK))
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean G_IsGameType(int type)
|
||||
{
|
||||
return (gametype == type);
|
||||
}
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean G_GametypeHasSpectators(void)
|
||||
{
|
||||
return (netgame || (multiplayer && demo.playback));
|
||||
}
|
||||
|
||||
INT32 G_GetGametypeByName(const char *gametypestr);
|
||||
boolean G_IsSpecialStage(INT32 mapnum);
|
||||
boolean G_GametypeUsesLives(void);
|
||||
boolean G_GametypeHasTeams(void);
|
||||
boolean G_GametypeHasSpectators(void);
|
||||
boolean G_BattleGametype(void);
|
||||
UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype);
|
||||
UINT8 G_GetGametypeColor(INT16 gt);
|
||||
boolean G_RaceGametype(void);
|
||||
boolean G_TagGametype(void);
|
||||
void G_ExitLevel(void);
|
||||
void G_NextLevel(void);
|
||||
void G_Continue(void);
|
||||
@@ -427,7 +435,6 @@ void G_SetRetryFlag(void);
|
||||
void G_ClearRetryFlag(void);
|
||||
boolean G_GetRetryFlag(void);
|
||||
|
||||
|
||||
void G_LoadGameData(void);
|
||||
void G_LoadGameSettings(void);
|
||||
|
||||
|
||||
+20
-32
@@ -58,44 +58,35 @@ consvar_t cv_rumble[MAXSPLITSCREENPLAYERS] = {
|
||||
{"rumble4", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, rumble_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static CV_PossibleValue_t gamepadled_cons_t[] = {{0, "Off"}, {1, "Skincolor"}, {2, "Mobjcolor"}, {0, NULL}};
|
||||
consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS] = {
|
||||
{"gamepadled", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled2", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled3", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled4", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_ledpowerup[MAXSPLITSCREENPLAYERS] = {
|
||||
{"ledpowerup", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"ledpowerup2", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"ledpowerup3", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"ledpowerup4", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
{"gamepadled", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled2", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle2, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled3", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle3, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"gamepadled4", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static void rumble_off_handle(void)
|
||||
{
|
||||
if (cv_rumble[0].value == 0)
|
||||
if (!cv_rumble[0].value)
|
||||
G_ResetPlayerDeviceRumble(0);
|
||||
}
|
||||
|
||||
|
||||
static void rumble_off_handle2(void)
|
||||
{
|
||||
if (cv_rumble[1].value == 0)
|
||||
if (!cv_rumble[1].value)
|
||||
G_ResetPlayerDeviceRumble(1);
|
||||
}
|
||||
|
||||
|
||||
static void rumble_off_handle3(void)
|
||||
{
|
||||
if (cv_rumble[2].value == 0)
|
||||
if (!cv_rumble[2].value)
|
||||
G_ResetPlayerDeviceRumble(2);
|
||||
}
|
||||
|
||||
|
||||
static void rumble_off_handle4(void)
|
||||
{
|
||||
if (cv_rumble[3].value == 0)
|
||||
if (!cv_rumble[3].value)
|
||||
G_ResetPlayerDeviceRumble(3);
|
||||
}
|
||||
|
||||
@@ -104,19 +95,16 @@ static void led_off_handle(void)
|
||||
G_ResetPlayerGamepadIndicatorColor(0);
|
||||
}
|
||||
|
||||
|
||||
static void led_off_handle2(void)
|
||||
{
|
||||
G_ResetPlayerGamepadIndicatorColor(1);
|
||||
}
|
||||
|
||||
|
||||
static void led_off_handle3(void)
|
||||
{
|
||||
G_ResetPlayerGamepadIndicatorColor(2);
|
||||
}
|
||||
|
||||
|
||||
static void led_off_handle4(void)
|
||||
{
|
||||
G_ResetPlayerGamepadIndicatorColor(3);
|
||||
@@ -900,13 +888,16 @@ UINT16 G_GetSkinColor(INT32 playernum)
|
||||
{
|
||||
player_t *player = &players[displayplayers[playernum]];
|
||||
|
||||
// make rgb rainbow vomit when invul or flash blue when grow
|
||||
if (cv_ledpowerup[playernum].value && player->mo && (player->kartstuff[k_invincibilitytimer] || player->kartstuff[k_growshrinktimer] || player->powers[pw_invulnerability]))
|
||||
return player->mo->color;
|
||||
if (player)
|
||||
{
|
||||
// make rgb rainbow vomit when invul or flash blue when grow
|
||||
if ((cv_gamepadled[playernum].value == 2) && player->mo && player->mo->color)
|
||||
return player->mo->color;
|
||||
|
||||
// take actual player skincolour when ingame
|
||||
if (player->skincolor)
|
||||
return player->skincolor;
|
||||
// take actual player skincolour when ingame
|
||||
if (player->skincolor)
|
||||
return player->skincolor;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise just fallback to whatever the cvar is
|
||||
@@ -963,13 +954,10 @@ static void G_ResetPlayerDeviceRumble(INT32 playernum)
|
||||
void G_ResetAllDeviceRumbles(void)
|
||||
{
|
||||
int i;
|
||||
int devices;
|
||||
|
||||
devices = I_NumJoys();
|
||||
|
||||
for (i = 0; i < devices; i++)
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
I_GamepadRumble(devices, 0, 0, 0);
|
||||
I_GamepadRumble(i, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ extern consvar_t cv_mousesens, cv_mouseysens;
|
||||
extern consvar_t cv_controlperkey, cv_turnsmooth;
|
||||
extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_ledpowerup[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
|
||||
@@ -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
|
||||
@@ -88,7 +88,10 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
if (currently_batching)
|
||||
{
|
||||
if (!pSurf)
|
||||
{
|
||||
I_Error("Got a null FSurfaceInfo in batching");// nulls should not come in the stuff that batching currently applies to
|
||||
}
|
||||
|
||||
if (polygonArraySize == polygonArrayAllocSize)
|
||||
{
|
||||
PolygonArrayEntry* new_array;
|
||||
@@ -228,7 +231,9 @@ void HWR_RenderBatches(void)
|
||||
int i;
|
||||
|
||||
if (!currently_batching)
|
||||
{
|
||||
I_Error("HWR_RenderBatches called without starting batching");
|
||||
}
|
||||
|
||||
nextSurfaceInfo.LightInfo.fade_end = 0;
|
||||
nextSurfaceInfo.LightInfo.fade_start = 0;
|
||||
@@ -236,6 +241,7 @@ void HWR_RenderBatches(void)
|
||||
nextSurfaceInfo.LightInfo.directional = false;
|
||||
|
||||
currently_batching = false;// no longer collecting batches
|
||||
|
||||
if (!polygonArraySize)
|
||||
{
|
||||
ps_hw_numpolys.value.i = ps_hw_numcalls.value.i = ps_hw_numshaders.value.i
|
||||
@@ -243,6 +249,7 @@ void HWR_RenderBatches(void)
|
||||
= ps_hw_numcolors.value.i = 0;
|
||||
return;// nothing to draw
|
||||
}
|
||||
|
||||
// init stats vars
|
||||
ps_hw_numpolys.value.i = polygonArraySize;
|
||||
ps_hw_numcalls.value.i = ps_hw_numverts.value.i = 0;
|
||||
@@ -291,7 +298,7 @@ void HWR_RenderBatches(void)
|
||||
else
|
||||
GL_SetTexture(currentTexture);
|
||||
|
||||
while (1)// note: remember handling notexture polyflag as having texture number 0 (also in comparePolygons)
|
||||
while (1) // note: remember handling notexture polyflag as having texture number 0 (also in comparePolygons)
|
||||
{
|
||||
int firstIndex;
|
||||
int lastIndex;
|
||||
@@ -361,23 +368,28 @@ void HWR_RenderBatches(void)
|
||||
nextTexture = nextEntry->texture;
|
||||
nextPolyFlags = nextEntry->polyFlags;
|
||||
nextSurfaceInfo = nextEntry->surf;
|
||||
|
||||
if (nextPolyFlags & PF_NoTexture)
|
||||
nextTexture = 0;
|
||||
|
||||
if (currentShader != nextShader && cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
changeState = true;
|
||||
changeShader = true;
|
||||
}
|
||||
|
||||
if (currentTexture != nextTexture)
|
||||
{
|
||||
changeState = true;
|
||||
changeTexture = true;
|
||||
}
|
||||
|
||||
if (currentPolyFlags != nextPolyFlags)
|
||||
{
|
||||
changeState = true;
|
||||
changePolyFlags = true;
|
||||
}
|
||||
|
||||
if (cv_glshaders.value && gl_shadersavailable)
|
||||
{
|
||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||
@@ -413,10 +425,12 @@ void HWR_RenderBatches(void)
|
||||
finalVertexWritePos = 0;
|
||||
finalIndexWritePos = 0;
|
||||
}
|
||||
else continue;
|
||||
else
|
||||
continue;
|
||||
|
||||
// if we're here then either its time to stop or time to change state
|
||||
if (stopFlag) break;
|
||||
if (stopFlag)
|
||||
break;
|
||||
|
||||
// change state according to change bools and next vars, update current vars and reset bools
|
||||
if (changeState)
|
||||
@@ -429,6 +443,7 @@ void HWR_RenderBatches(void)
|
||||
|
||||
ps_hw_numshaders.value.i++;
|
||||
}
|
||||
|
||||
if (changeTexture)
|
||||
{
|
||||
// texture should be already ready for use from calls to GL_SetTexture during batch collection
|
||||
@@ -438,6 +453,7 @@ void HWR_RenderBatches(void)
|
||||
|
||||
ps_hw_numtextures.value.i++;
|
||||
}
|
||||
|
||||
if (changePolyFlags)
|
||||
{
|
||||
currentPolyFlags = nextPolyFlags;
|
||||
@@ -445,6 +461,7 @@ void HWR_RenderBatches(void)
|
||||
|
||||
ps_hw_numpolyflags.value.i++;
|
||||
}
|
||||
|
||||
if (changeSurfaceInfo)
|
||||
{
|
||||
currentSurfaceInfo = nextSurfaceInfo;
|
||||
|
||||
@@ -75,7 +75,6 @@ struct GLPatch_s
|
||||
{
|
||||
GLMipmap_t *mipmap;
|
||||
float max_s,max_t;
|
||||
boolean notfound; // if the texture file was not found, mark it here (used in model texture loading)
|
||||
};
|
||||
typedef struct GLPatch_s GLPatch_t;
|
||||
|
||||
|
||||
@@ -131,17 +131,23 @@ typedef struct
|
||||
FLOAT scalex, scaley, scalez;
|
||||
FLOAT fovangle;
|
||||
UINT8 splitscreen;
|
||||
boolean flip; // screenflip
|
||||
boolean roll;
|
||||
FLOAT rollangle;
|
||||
FLOAT centerx, centery;
|
||||
FLOAT rollx, rollz;
|
||||
boolean mirror; // SRB2Kart: Encore Mode
|
||||
boolean mirrorflip; // Encore Mode with Flipcam
|
||||
UINT8 fliptype;
|
||||
boolean shearing; // 14042019
|
||||
float viewaiming; // 17052019
|
||||
} FTransform;
|
||||
|
||||
enum
|
||||
{
|
||||
TRANSFORM_NONE = 0,
|
||||
TRANSFORM_FLIP = 1 << 0, // screenflip
|
||||
TRANSFORM_MIRROR = 1 << 1, // SRB2Kart: Encore Mode
|
||||
TRANSFORM_MIRRORFLIP = TRANSFORM_FLIP|TRANSFORM_MIRROR // SRB2Kart: Encore Mode with Flipcam
|
||||
};
|
||||
|
||||
// Transformed vector, as passed to HWR API
|
||||
typedef struct
|
||||
{
|
||||
|
||||
+59
-54
@@ -481,11 +481,11 @@ static UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap) // Let's
|
||||
return surfcolor.s.alpha;
|
||||
}
|
||||
|
||||
static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg)
|
||||
static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colormap)
|
||||
{
|
||||
INT16 finallight = lightnum;
|
||||
|
||||
if (cv_glfakecontrast.value == 0)
|
||||
if (cv_glfakecontrast.value == 0 || (HWR_ShouldUsePaletteRendering() && colormap))
|
||||
return (FUINT)finallight;
|
||||
|
||||
if (seg != NULL && P_ApplyLightOffsetFine(lightnum, seg->frontsector))
|
||||
@@ -698,8 +698,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
for (i = 0, v3d = planeVerts; i < (INT32)nrPlaneVerts; i++,v3d++,pv++)
|
||||
SETUP3DVERT(v3d, pv->x, pv->y);
|
||||
|
||||
if (slope)
|
||||
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
|
||||
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
|
||||
|
||||
HWR_Lighting(&Surf, lightlevel, planecolormap, P_SectorUsesDirectionalLighting(gl_frontsector));
|
||||
|
||||
@@ -1008,7 +1007,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
fixed_t v2y = FloatToFixed(wallVerts[1].z);
|
||||
|
||||
const UINT8 alpha = Surf->PolyColor.s.alpha;
|
||||
FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, gl_curline);
|
||||
FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, gl_curline, NULL);
|
||||
extracolormap_t *colormap = NULL;
|
||||
|
||||
realtop = top = wallVerts[3].y;
|
||||
@@ -1051,14 +1050,14 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
{
|
||||
lightnum = pfloor->master->frontsector->lightlevel;
|
||||
colormap = pfloor->master->frontsector->extra_colormap;
|
||||
lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline);
|
||||
}
|
||||
else
|
||||
{
|
||||
lightnum = *list[i].lightlevel;
|
||||
colormap = list[i].extra_colormap;
|
||||
lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline);
|
||||
}
|
||||
|
||||
lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap);
|
||||
}
|
||||
|
||||
boolean solid = false;
|
||||
@@ -1388,7 +1387,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
FUINT lightnum = gl_frontsector->lightlevel;
|
||||
extracolormap_t *colormap = gl_frontsector->extra_colormap;
|
||||
lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline);
|
||||
lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap);
|
||||
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
@@ -2015,7 +2014,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(lightnum, colormap);
|
||||
|
||||
lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline);
|
||||
lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap);
|
||||
|
||||
if (gl_frontsector->numlights)
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, 0, false, &Surf, roverflags, rover, blendmode);
|
||||
@@ -2132,7 +2131,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(lightnum, colormap);
|
||||
|
||||
lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline);
|
||||
lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap);
|
||||
|
||||
if (gl_backsector->numlights)
|
||||
HWR_SplitWall(gl_backsector, wallVerts, 0, false, &Surf, roverflags, rover, blendmode);
|
||||
@@ -2166,6 +2165,11 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
//Hurdler: end of 3d-floors test
|
||||
}
|
||||
|
||||
static inline boolean HWR_UsePortals(void)
|
||||
{
|
||||
return cv_glportals.value && gl_maphasportals;
|
||||
}
|
||||
|
||||
// From PrBoom:
|
||||
//
|
||||
// e6y: Check whether the player can look beyond this line, returns true if we can't
|
||||
@@ -2226,7 +2230,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector)
|
||||
}
|
||||
|
||||
// using this check with portals causes weird culling issues on ante-station
|
||||
if (LIKELY(!portalclipline) && (afrontsector == viewsector || abacksector == viewsector))
|
||||
if (LIKELY(!portalclipline) &&
|
||||
(afrontsector == viewsector || abacksector == viewsector))
|
||||
{
|
||||
fixed_t viewf1, viewf2, viewc1, viewc2;
|
||||
if (afrontsector == viewsector)
|
||||
@@ -2292,7 +2297,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector)
|
||||
|
||||
// Window.
|
||||
// We know it's a window when the above isn't true and the back and front sectors don't match
|
||||
if (backc1 != frontc1 || backc2 != frontc2 || backf1 != frontf1 || backf2 != frontf2)
|
||||
if (backc1 != frontc1 || backc2 != frontc2
|
||||
|| backf1 != frontf1 || backf2 != frontf2)
|
||||
{
|
||||
checkforemptylines = false;
|
||||
return false;
|
||||
@@ -2359,7 +2365,7 @@ static void HWR_AddLine(seg_t *line)
|
||||
|
||||
gl_backsector = line->backsector;
|
||||
|
||||
if (!cv_glportals.value || LIKELY(!gl_maphasportals))
|
||||
if (LIKELY(!HWR_UsePortals()))
|
||||
{
|
||||
doaddline:
|
||||
if (!line->backsector)
|
||||
@@ -4365,44 +4371,45 @@ static void HWR_RenderDrawNodes(void)
|
||||
switch (drawnode->type)
|
||||
{
|
||||
case DRAWNODE_PLANE:
|
||||
{
|
||||
planeinfo_t *plane = &drawnode->u.plane;
|
||||
{
|
||||
planeinfo_t *plane = &drawnode->u.plane;
|
||||
|
||||
// We aren't traversing the BSP tree, so make gl_frontsector null to avoid crashes.
|
||||
gl_frontsector = NULL;
|
||||
// We aren't traversing the BSP tree, so make gl_frontsector null to avoid crashes.
|
||||
gl_frontsector = NULL;
|
||||
|
||||
if (!(plane->blend & PF_NoTexture))
|
||||
HWR_GetFlat(plane->lumpnum, R_NoEncore(plane->FOFSector, plane->isceiling));
|
||||
if (!(plane->blend & PF_NoTexture))
|
||||
HWR_GetFlat(plane->lumpnum, R_NoEncore(plane->FOFSector, plane->isceiling));
|
||||
|
||||
HWR_RenderPlane(NULL, plane->xsub, plane->isceiling, plane->fixedheight, plane->blend, plane->lightlevel,
|
||||
plane->lumpnum, plane->FOFSector, plane->alpha, plane->planecolormap);
|
||||
HWR_RenderPlane(NULL, plane->xsub, plane->isceiling, plane->fixedheight, plane->blend, plane->lightlevel,
|
||||
plane->lumpnum, plane->FOFSector, plane->alpha, plane->planecolormap);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DRAWNODE_POLYOBJECT_PLANE:
|
||||
{
|
||||
polyplaneinfo_t *polyplane = &drawnode->u.polyplane;
|
||||
{
|
||||
polyplaneinfo_t *polyplane = &drawnode->u.polyplane;
|
||||
|
||||
// We aren't traversing the BSP tree, so make gl_frontsector null to avoid crashes.
|
||||
gl_frontsector = NULL;
|
||||
// We aren't traversing the BSP tree, so make gl_frontsector null to avoid crashes.
|
||||
gl_frontsector = NULL;
|
||||
|
||||
if (!(polyplane->blend & PF_NoTexture))
|
||||
HWR_GetFlat(polyplane->lumpnum, R_NoEncore(polyplane->FOFSector, polyplane->isceiling));
|
||||
if (!(polyplane->blend & PF_NoTexture))
|
||||
HWR_GetFlat(polyplane->lumpnum, R_NoEncore(polyplane->FOFSector, polyplane->isceiling));
|
||||
|
||||
HWR_RenderPolyObjectPlane(polyplane->polysector, polyplane->isceiling, polyplane->fixedheight, polyplane->blend, polyplane->lightlevel,
|
||||
polyplane->lumpnum, polyplane->FOFSector, polyplane->alpha, polyplane->planecolormap);
|
||||
HWR_RenderPolyObjectPlane(polyplane->polysector, polyplane->isceiling, polyplane->fixedheight, polyplane->blend, polyplane->lightlevel,
|
||||
polyplane->lumpnum, polyplane->FOFSector, polyplane->alpha, polyplane->planecolormap);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DRAWNODE_WALL:
|
||||
{
|
||||
wallinfo_t *wall = &drawnode->u.wall;
|
||||
{
|
||||
wallinfo_t *wall = &drawnode->u.wall;
|
||||
|
||||
if (!(wall->blend & PF_NoTexture))
|
||||
HWR_GetTexture(wall->texnum, wall->noencore);
|
||||
if (!(wall->blend & PF_NoTexture))
|
||||
HWR_GetTexture(wall->texnum, wall->noencore);
|
||||
|
||||
HWR_RenderWall(wall->wallVerts, &wall->Surf, wall->blend, wall->fogwall,
|
||||
wall->lightlevel, wall->wallcolormap);
|
||||
HWR_RenderWall(wall->wallVerts, &wall->Surf, wall->blend, wall->fogwall,
|
||||
wall->lightlevel, wall->wallcolormap);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -4666,7 +4673,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
const boolean vflip = (thing->eflags & MFE_VERTICALFLIP);
|
||||
const boolean hflip = (!(thing->frame & FF_HORIZONTALFLIP) != !mirrored);
|
||||
|
||||
this_scale = FixedToFloat(interp.scale);
|
||||
this_scale = FixedToFloat(interp.scale);
|
||||
spritexscale = FixedToFloat(interp.spritexscale);
|
||||
spriteyscale = FixedToFloat(interp.spriteyscale);
|
||||
|
||||
@@ -5336,9 +5343,6 @@ static void HWR_SetTransformAiming(FTransform *trans)
|
||||
|
||||
void HWR_SetTransform(float fpov)
|
||||
{
|
||||
UINT8 viewnum = R_GetViewNumber();
|
||||
camera_t *thiscam = &camera[viewnum];
|
||||
|
||||
gl_viewx = FixedToFloat(viewx);
|
||||
gl_viewy = FixedToFloat(viewy);
|
||||
gl_viewz = FixedToFloat(viewz);
|
||||
@@ -5366,17 +5370,17 @@ void HWR_SetTransform(float fpov)
|
||||
HWR_RollTransform(&atransform, viewroll);
|
||||
atransform.splitscreen = splitscreen;
|
||||
|
||||
atransform.flip = false;
|
||||
if ((thiscam->postimg & POSTIMG_FLIP) && !(thiscam->postimg & POSTIMG_MIRROR))
|
||||
atransform.flip = true;
|
||||
const UINT8 postimg = camera[R_GetViewNumber()].postimg;
|
||||
|
||||
atransform.mirror = false;
|
||||
if ((thiscam->postimg & POSTIMG_MIRROR) && !(thiscam->postimg & POSTIMG_FLIP))
|
||||
atransform.mirror = true;
|
||||
|
||||
atransform.mirrorflip = false;
|
||||
if ((thiscam->postimg & POSTIMG_FLIP) && (thiscam->postimg & POSTIMG_MIRROR))
|
||||
atransform.mirrorflip = true;
|
||||
if (postimg & POSTIMG_FLIP)
|
||||
{
|
||||
if (postimg & POSTIMG_MIRROR)
|
||||
atransform.fliptype = TRANSFORM_MIRRORFLIP;
|
||||
else
|
||||
atransform.fliptype = TRANSFORM_FLIP;
|
||||
}
|
||||
else if (postimg & POSTIMG_MIRROR)
|
||||
atransform.fliptype = TRANSFORM_MIRROR;
|
||||
|
||||
// Set transform.
|
||||
GL_SetTransform(&atransform);
|
||||
@@ -5408,7 +5412,7 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
||||
gl_portallist_t portallist;
|
||||
|
||||
const boolean skybox = (skyboxmo[0] && cv_skybox.value);
|
||||
const boolean useportals = cv_glportals.value && gl_maphasportals && allow_portals;
|
||||
const boolean useportals = HWR_UsePortals() && allow_portals;
|
||||
bspfunc bspFunc = (useportals && portalclipline) ? HWR_RenderPortalBSPNode : HWR_RenderBSPNode;
|
||||
|
||||
portallist.base = portallist.cap = NULL;
|
||||
@@ -5644,6 +5648,7 @@ void HWR_RenderPlayerView(void)
|
||||
{
|
||||
if (cv_ripplewater.value)
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LEVELTIME, (INT32)leveltime); // The water surface shader needs the leveltime.
|
||||
|
||||
const angle_t light_angle = maplighting.angle - viewangle + ANGLE_90; // I fucking hate OGL's coordinate system
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_X, FINECOSINE(light_angle >> ANGLETOFINESHIFT));
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Y, 0);
|
||||
@@ -6015,7 +6020,7 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
if (thiscam->postimg & POSTIMG_WATER)
|
||||
{
|
||||
WAVELENGTH = 5;
|
||||
AMPLITUDE = 20;
|
||||
AMPLITUDE = 40;
|
||||
FREQUENCY = 8;
|
||||
}
|
||||
else
|
||||
|
||||
+16
-28
@@ -397,7 +397,7 @@ static void md2_loadTexture(md2_t *model)
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
{
|
||||
glPatch->notfound = true;// mark it so its not searched for again repeatedly
|
||||
model->notexturefile = true; // mark it so its not searched for again repeatedly
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ static void md2_loadBlendTexture(md2_t *model)
|
||||
glPatch->mipmap->format = PCX_Load(filename, &w, &h, glPatch);
|
||||
if (glPatch->mipmap->format == 0)
|
||||
{
|
||||
glPatch->notfound = true;// mark it so its not searched for again repeatedly
|
||||
model->noblendfile = true; // mark it so its not searched for again repeatedly
|
||||
Z_Free(filename);
|
||||
return;
|
||||
}
|
||||
@@ -505,6 +505,8 @@ void HWR_InitMD2(void)
|
||||
md2_playermodels[s].model = NULL;
|
||||
md2_playermodels[s].glpatch = NULL;
|
||||
md2_playermodels[s].skin = -1;
|
||||
md2_playermodels[s].notexturefile = false;
|
||||
md2_playermodels[s].noblendfile = false;
|
||||
md2_playermodels[s].notfound = true;
|
||||
md2_playermodels[s].error = false;
|
||||
}
|
||||
@@ -514,6 +516,8 @@ void HWR_InitMD2(void)
|
||||
md2_localplayermodels[s].model = NULL;
|
||||
md2_localplayermodels[s].glpatch = NULL;
|
||||
md2_localplayermodels[s].skin = -1;
|
||||
md2_localplayermodels[s].notexturefile = false;
|
||||
md2_localplayermodels[s].noblendfile = false;
|
||||
md2_localplayermodels[s].notfound = true;
|
||||
md2_localplayermodels[s].error = false;
|
||||
}
|
||||
@@ -523,6 +527,8 @@ void HWR_InitMD2(void)
|
||||
md2_models[i].model = NULL;
|
||||
md2_models[i].glpatch = NULL;
|
||||
md2_models[i].skin = -1;
|
||||
md2_models[s].notexturefile = false;
|
||||
md2_models[s].noblendfile = false;
|
||||
md2_models[i].notfound = true;
|
||||
md2_models[i].error = false;
|
||||
}
|
||||
@@ -543,21 +549,10 @@ void HWR_InitMD2(void)
|
||||
}
|
||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||
{
|
||||
/*if (stricmp(name, "PLAY") == 0)
|
||||
{
|
||||
CONS_Printf("MD2 for sprite PLAY detected in mdls.dat, use a player skin instead!\n");
|
||||
continue;
|
||||
}*/
|
||||
// 8/1/19: Allow PLAY to load for default MD2.
|
||||
|
||||
for (i = 0; i < NUMSPRITES; i++)
|
||||
{
|
||||
if (stricmp(name, sprnames[i]) == 0)
|
||||
{
|
||||
//if (stricmp(name, "PLAY") == 0)
|
||||
//continue;
|
||||
|
||||
//CONS_Debug(DBG_RENDER, " Found: %s %s %f %f\n", name, filename, scale, offset);
|
||||
md2_models[i].scale = scale;
|
||||
md2_models[i].offset = offset;
|
||||
md2_models[i].notfound = false;
|
||||
@@ -570,7 +565,6 @@ void HWR_InitMD2(void)
|
||||
{
|
||||
if (stricmp(name, skins[s].name) == 0)
|
||||
{
|
||||
//CONS_Printf(" Found: %s %s %f %f\n", name, filename, scale, offset);
|
||||
md2_playermodels[s].skin = s;
|
||||
md2_playermodels[s].scale = scale;
|
||||
md2_playermodels[s].offset = offset;
|
||||
@@ -1060,7 +1054,6 @@ static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendgpatch, INT32 sk
|
||||
{
|
||||
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
|
||||
GLPatch_t *glPatch = patch->hardware;
|
||||
GLPatch_t *glBlendPatch = NULL;
|
||||
GLMipmap_t *glMipmap, *newMipmap;
|
||||
|
||||
|
||||
@@ -1071,14 +1064,6 @@ static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendgpatch, INT32 sk
|
||||
return;
|
||||
}
|
||||
|
||||
if ((blendgpatch && (glBlendPatch = blendgpatch->hardware) && glBlendPatch->mipmap->format)
|
||||
&& (patch->width != blendgpatch->width || patch->height != blendgpatch->height))
|
||||
{
|
||||
// Blend image exists, but it's bad.
|
||||
GL_SetTexture(glPatch->mipmap);
|
||||
return;
|
||||
}
|
||||
|
||||
// search for the Mipmap
|
||||
// skip the first (no colormap translated)
|
||||
for (glMipmap = glPatch->mipmap; glMipmap->nextcolormap; )
|
||||
@@ -1305,7 +1290,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
if (!gpatch || !hwrPatch
|
||||
|| ((!hwrPatch->mipmap->format || !hwrPatch->mipmap->downloaded) && !hwrPatch->notfound))
|
||||
|| ((!hwrPatch->mipmap->format || !hwrPatch->mipmap->downloaded) && !md2->notexturefile))
|
||||
md2_loadTexture(md2);
|
||||
|
||||
// Load it again, because it isn't being loaded into gpatch after md2_loadtexture...
|
||||
@@ -1320,7 +1305,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
if ((gpatch && hwrPatch && hwrPatch->mipmap->format) // don't load the blend texture if the base texture isn't available
|
||||
&& (!blendgpatch || !hwrBlendPatch
|
||||
|| ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !hwrPatch->notfound)))
|
||||
|| ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile)))
|
||||
md2_loadBlendTexture(md2);
|
||||
|
||||
// Load it again, because it isn't being loaded into blendgpatch after md2_loadblendtexture...
|
||||
@@ -1330,7 +1315,9 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
if (gpatch && hwrPatch && hwrPatch->mipmap->format) // else if meant that if a texture couldn't be loaded, it would just end up using something else's texture
|
||||
{
|
||||
if ((skincolors_t)spr->mobj->color != SKINCOLOR_NONE)
|
||||
if ((skincolors_t)spr->mobj->color != SKINCOLOR_NONE &&
|
||||
blendgpatch && hwrBlendPatch->mipmap->format
|
||||
&& gpatch->width == blendgpatch->width && gpatch->height == blendgpatch->height)
|
||||
{
|
||||
INT32 tcskinnum = TC_DEFAULT;
|
||||
if ((spr->mobj->flags & MF_BOSS) && (spr->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
|
||||
@@ -1444,6 +1431,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
? (spr->mobj->rollangle) + (sliptideroll * spr->mobj->player->kartstuff[k_aizdriftstrat])
|
||||
: (spr->mobj->rollangle);
|
||||
|
||||
rollang *= flipfactor;
|
||||
|
||||
fixed_t anglef = AngleFixed(rollang);
|
||||
|
||||
p.rollangle = 0.0f;
|
||||
@@ -1481,8 +1470,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
p.anglex += flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.roll));
|
||||
p.anglez -= flipfactor*FIXED_TO_FLOAT(AngleFixed(interp.pitch));
|
||||
|
||||
p.flip = atransform.flip;
|
||||
p.mirror = atransform.mirror; // from Kart
|
||||
p.fliptype = atransform.fliptype;
|
||||
|
||||
GL_SetShader(SHADER_MODEL); // model shader
|
||||
{
|
||||
|
||||
@@ -29,7 +29,9 @@ typedef struct
|
||||
float offset;
|
||||
model_t *model;
|
||||
void *glpatch;
|
||||
boolean notexturefile; // true if texture file was not found
|
||||
void *blendglpatch;
|
||||
boolean noblendfile; // true if blend texture file was not found
|
||||
boolean notfound;
|
||||
INT32 skin;
|
||||
boolean error;
|
||||
|
||||
@@ -102,6 +102,8 @@ RGBA_t myPaletteData[256]; // the palette for converting textures to RGBA
|
||||
static GLint gltexformat = GL_RGB5_A1;
|
||||
GLint screen_width = 0; // used by Draw2DLine()
|
||||
GLint screen_height = 0;
|
||||
GLint screen_texsizew = 512; // Power-of-two screen texture render resolution
|
||||
GLint screen_texsizeh = 512; // Power-of-two screen texture render resolution
|
||||
GLbyte screen_depth = 0;
|
||||
GLint maximumAnisotropy = 0;
|
||||
static GLboolean MipMap = GL_FALSE;
|
||||
@@ -129,6 +131,8 @@ GLuint FramebufferObject, FramebufferTexture, RenderbufferObject;
|
||||
|
||||
boolean supportFBO = false;
|
||||
static boolean fboinit = false;
|
||||
|
||||
static void GL_Framebuffer_DeleteAttachments(void);
|
||||
#endif
|
||||
|
||||
// Sryder: NextTexAvail is broken for these because palette changes or changes to the texture filter or antialiasing
|
||||
@@ -948,7 +952,7 @@ void GL_UnSetShader(void)
|
||||
static void GL_SetNoTexture(void)
|
||||
{
|
||||
// Disable texture.
|
||||
if (tex_downloaded != NOTEXTURE_NUM && !currently_batching)
|
||||
if (tex_downloaded != NOTEXTURE_NUM)
|
||||
{
|
||||
if (NOTEXTURE_NUM == 0)
|
||||
pglGenTextures(1, &NOTEXTURE_NUM);
|
||||
@@ -991,8 +995,43 @@ static void GL_Perspective(GLfloat fovy, GLfloat aspect)
|
||||
// -----------------+
|
||||
void GL_SetModelView(GLint w, GLint h)
|
||||
{
|
||||
GLint maxtexsize = 0;
|
||||
//GL_DBG_Printf("SetModelView(): %dx%d\n", (int)w, (int)h);
|
||||
|
||||
// The screen textures need to be flushed if the width or height change so that they be remade for the correct size
|
||||
if (screen_width != w || screen_height != h)
|
||||
{
|
||||
GL_FlushScreenTextures();
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
GL_Framebuffer_DeleteAttachments();
|
||||
#endif
|
||||
}
|
||||
|
||||
screen_width = (GLint)w;
|
||||
screen_height = (GLint)h;
|
||||
|
||||
screen_texsizew = screen_texsizeh = 512;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (screen_texsizew < w)
|
||||
screen_texsizew <<= 1;
|
||||
|
||||
while (screen_texsizeh < h)
|
||||
screen_texsizeh <<= 1;
|
||||
|
||||
pglGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxtexsize); // Get the maximum supported texture size
|
||||
if ((screen_texsizew > maxtexsize || screen_texsizeh > maxtexsize) && maxtexsize > 0)
|
||||
{
|
||||
// The desired screen texture resolution is too big for the player's GPU!
|
||||
CONS_Alert(CONS_WARNING, "Tried to make a screen texture for a %dx%d game resolution, but your GPU only supports up to %dx%d! Please switch to the software renderer or lower your game resolution.\n", w, h, maxtexsize, maxtexsize);
|
||||
|
||||
// For now, let's just pray that clamping it to the maximum supported size "works"
|
||||
// There'll be a stretchy "border" artefact, but it's better than failing to make the screen textures
|
||||
screen_texsizew = min(screen_texsizew, maxtexsize);
|
||||
screen_texsizeh = min(screen_texsizeh, maxtexsize);
|
||||
}
|
||||
|
||||
pglViewport(0, 0, w, h);
|
||||
|
||||
pglMatrixMode(GL_PROJECTION);
|
||||
@@ -1038,6 +1077,8 @@ void GL_SetStates(void)
|
||||
|
||||
pglPolygonOffset(-1.0f, -1.0f);
|
||||
|
||||
pglDisable(GL_FOG);
|
||||
|
||||
// bp : when no t&l :)
|
||||
pglLoadIdentity();
|
||||
pglScalef(1.0f, 1.0f, -1.0f);
|
||||
@@ -1122,7 +1163,7 @@ static void GL_Framebuffer_GenerateAttachments(void)
|
||||
fboinit = true;
|
||||
}
|
||||
|
||||
void GL_Framebuffer_DeleteAttachments(void)
|
||||
static void GL_Framebuffer_DeleteAttachments(void)
|
||||
{
|
||||
if (!supportFBO || fboinit == false)
|
||||
return;
|
||||
@@ -2689,8 +2730,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
// pos->mirror is if the screen is flipped horizontally
|
||||
// XOR all the flips together to figure out what culling to use!
|
||||
{
|
||||
boolean reversecull = (flipped ^ hflipped ^ pos->flip ^ pos->mirror);
|
||||
if (reversecull)
|
||||
if ((flipped ^ hflipped ^ !!(pos->fliptype & TRANSFORM_FLIP) ^ !!(pos->fliptype & TRANSFORM_MIRROR)))
|
||||
pglCullFace(GL_FRONT);
|
||||
else
|
||||
pglCullFace(GL_BACK);
|
||||
@@ -2836,14 +2876,21 @@ void GL_SetTransform(FTransform *stransform)
|
||||
used_fov = stransform->fovangle;
|
||||
shearing = stransform->shearing;
|
||||
|
||||
if (stransform->mirror)
|
||||
pglScalef(-stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
else if (stransform->mirrorflip)
|
||||
pglScalef(-stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
else if (stransform->flip)
|
||||
pglScalef(stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
else
|
||||
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
switch (stransform->fliptype)
|
||||
{
|
||||
case TRANSFORM_MIRROR:
|
||||
pglScalef(-stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
case TRANSFORM_MIRRORFLIP:
|
||||
pglScalef(-stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
case TRANSFORM_FLIP:
|
||||
pglScalef(stransform->scalex, -stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
default: // TRANSFORM_NONE
|
||||
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||
break;
|
||||
}
|
||||
|
||||
if (stransform->roll)
|
||||
pglRotatef(stransform->rollangle, 0.0f, 0.0f, 1.0f);
|
||||
@@ -2869,7 +2916,7 @@ void GL_SetTransform(FTransform *stransform)
|
||||
if (shearing)
|
||||
{
|
||||
float dy = stransform->viewaiming * 2;
|
||||
if (stransform->flip || stransform->mirrorflip)
|
||||
if (stransform->fliptype == TRANSFORM_FLIP || stransform->fliptype == TRANSFORM_MIRRORFLIP)
|
||||
dy *= -1.0f;
|
||||
pglTranslatef(0.0f, -dy/BASEVIDHEIGHT, 0.0f);
|
||||
}
|
||||
@@ -2918,7 +2965,6 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
INT32 x, y;
|
||||
float float_x, float_y, float_nextx, float_nexty;
|
||||
float xfix, yfix;
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
|
||||
const float blackBack[16] =
|
||||
{
|
||||
@@ -2931,16 +2977,9 @@ void GL_PostImgRedraw(float points[SCREENVERTS][SCREENVERTS][2])
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
// X/Y stretch fix for all resolutions(!)
|
||||
xfix = (float)(texsizew)/((float)((screen_width)/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)(texsizey)/((float)((screen_height)/(float)(SCREENVERTS-1)));
|
||||
xfix = (float)(screen_texsizew)/((float)((screen_width)/(float)(SCREENVERTS-1)));
|
||||
yfix = (float)(screen_texsizeh)/((float)((screen_height)/(float)(SCREENVERTS-1)));
|
||||
|
||||
pglDisable(GL_DEPTH_TEST);
|
||||
pglDisable(GL_BLEND);
|
||||
@@ -3014,7 +3053,6 @@ void GL_FlushScreenTextures(void)
|
||||
void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
{
|
||||
float xfix, yfix;
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
|
||||
const float screenVerts[12] =
|
||||
{
|
||||
@@ -3029,15 +3067,8 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
@@ -3070,7 +3101,6 @@ void GL_DrawScreenTexture(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
|
||||
// Do screen fades!
|
||||
void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
{
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
float xfix, yfix;
|
||||
|
||||
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
||||
@@ -3096,15 +3126,8 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
// const float screenVerts[12]
|
||||
|
||||
@@ -3162,7 +3185,6 @@ void GL_DoScreenWipe(int wipeStart, int wipeEnd)
|
||||
|
||||
void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize)
|
||||
{
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
int tex = HWD_SCREENTEXTURE_VHS;
|
||||
float xfix, yfix;
|
||||
float fix[8];
|
||||
@@ -3180,15 +3202,8 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
// Slight fuzziness
|
||||
GL_MakeScreenTexture(tex);
|
||||
@@ -3272,19 +3287,11 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8
|
||||
// Create a texture from the screen.
|
||||
void GL_MakeScreenTexture(int tex)
|
||||
{
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
boolean firstTime = (screenTextures[tex] == 0);
|
||||
|
||||
if (!gl_enable_screen_textures)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
// Create screen texture
|
||||
if (firstTime)
|
||||
pglGenTextures(1, &screenTextures[tex]);
|
||||
@@ -3296,10 +3303,10 @@ void GL_MakeScreenTexture(int tex)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
Clamp2D(GL_TEXTURE_WRAP_S);
|
||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsizew, texsizey, 0);
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, screen_texsizew, screen_texsizeh, 0);
|
||||
}
|
||||
else
|
||||
pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texsizew, texsizey);
|
||||
pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, screen_texsizew, screen_texsizeh);
|
||||
|
||||
tex_downloaded = screenTextures[tex];
|
||||
}
|
||||
@@ -3310,7 +3317,6 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
float origaspect, newaspect;
|
||||
float xoff = 1, yoff = 1; // xoffset and yoffset for the polygon to have black bars around the screen
|
||||
FRGBAFloat clearColour;
|
||||
INT32 texsizew = 512, texsizey = 512;
|
||||
|
||||
float off[12];
|
||||
float fix[8];
|
||||
@@ -3318,15 +3324,8 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean usesh
|
||||
if (gl_enable_screen_textures != 2)
|
||||
return;
|
||||
|
||||
// look for power of two that is large enough for the screen
|
||||
while (texsizew < screen_width)
|
||||
texsizew <<= 1;
|
||||
|
||||
while (texsizey < screen_height)
|
||||
texsizey <<= 1;
|
||||
|
||||
xfix = 1/((float)(texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsizey)/((float)((screen_height))));
|
||||
xfix = 1/((float)(screen_texsizew)/((float)((screen_width))));
|
||||
yfix = 1/((float)(screen_texsizeh)/((float)((screen_height))));
|
||||
|
||||
origaspect = (float)screen_width / screen_height;
|
||||
newaspect = (float)width / height;
|
||||
|
||||
@@ -103,8 +103,6 @@ extern PFNglGetString pglGetString;
|
||||
#endif
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
void GL_Framebuffer_DeleteAttachments(void);
|
||||
|
||||
void GL_Framebuffer_Unbind(void);
|
||||
void GL_Framebuffer_Enable(void);
|
||||
void GL_Framebuffer_Disable(void);
|
||||
|
||||
+4
-4
@@ -2203,6 +2203,10 @@ void HU_Drawer(void)
|
||||
if (cechotimer)
|
||||
HU_DrawCEcho();
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value)
|
||||
HU_DrawSongCredits();
|
||||
|
||||
if (!( Playing() || demo.playback )
|
||||
|| gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE
|
||||
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|
||||
@@ -2236,10 +2240,6 @@ void HU_Drawer(void)
|
||||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value)
|
||||
HU_DrawSongCredits();
|
||||
|
||||
// draw desynch text
|
||||
if (hu_resynching
|
||||
#ifdef SATURNPAK
|
||||
|
||||
@@ -112,77 +112,6 @@ ticcmd_t *I_BaseTiccmd4(void);
|
||||
*/
|
||||
void I_Quit(void) FUNCNORETURN;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EvilForce = -1,
|
||||
//Constant
|
||||
ConstantForce = 0,
|
||||
//Ramp
|
||||
RampForce,
|
||||
//Periodics
|
||||
SquareForce,
|
||||
SineForce,
|
||||
TriangleForce,
|
||||
SawtoothUpForce,
|
||||
SawtoothDownForce,
|
||||
//MAX
|
||||
NumberofForces,
|
||||
} FFType;
|
||||
|
||||
typedef struct JoyFF_s
|
||||
{
|
||||
INT32 ForceX; ///< The X of the Force's Vel
|
||||
INT32 ForceY; ///< The Y of the Force's Vel
|
||||
//All
|
||||
UINT32 Duration; ///< The total duration of the effect, in microseconds
|
||||
INT32 Gain; //< /The gain to be applied to the effect, in the range from 0 through 10,000.
|
||||
//All, CONSTANTFORCE -10,000 to 10,000
|
||||
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
|
||||
//RAMPFORCE
|
||||
INT32 Start; ///< Magnitude at the start of the effect, in the range from -10,000 through 10,000.
|
||||
INT32 End; ///< Magnitude at the end of the effect, in the range from -10,000 through 10,000.
|
||||
//PERIODIC
|
||||
INT32 Offset; ///< Offset of the effect.
|
||||
UINT32 Phase; ///< Position in the cycle of the periodic effect at which playback begins, in the range from 0 through 35,999
|
||||
UINT32 Period; ///< Period of the effect, in microseconds.
|
||||
} JoyFF_t;
|
||||
|
||||
/** \brief Forcefeedback for the first joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
|
||||
void I_Tactile(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief Forcefeedback for the second joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_Tactile2(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief Forcefeedback for the third joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_Tactile3(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief Forcefeedback for the fourth joystick
|
||||
|
||||
\param Type what kind of Effect
|
||||
\param Effect Effect Info
|
||||
|
||||
\return void
|
||||
*/
|
||||
void I_Tactile4(FFType Type, const JoyFF_t *Effect);
|
||||
|
||||
/** \brief to set up the first joystick scale
|
||||
*/
|
||||
|
||||
+14
-5
@@ -5617,9 +5617,13 @@ static boolean K_SpeedLinesShouldBlend(player_t *player)
|
||||
static UINT8 K_GetSpeedLineColor(player_t *player, boolean colorSpeed)
|
||||
{
|
||||
UINT8 speedcolor = SKINCOLOR_NONE;
|
||||
const UINT8 playercolor = player->mo->color;
|
||||
|
||||
if (colorSpeed)
|
||||
{
|
||||
if (cv_coloredspeedlines.value != 3)
|
||||
speedcolor = playercolor;
|
||||
|
||||
if (cv_coloredspeedlines.value >= 2 && player->kartstuff[k_driftboost])
|
||||
{
|
||||
if (player->kartstuff[k_driftboost] <= 20)
|
||||
@@ -5628,9 +5632,10 @@ static UINT8 K_GetSpeedLineColor(player_t *player, boolean colorSpeed)
|
||||
speedcolor = SKINCOLOR_RASPBERRY;
|
||||
else if (player->kartstuff[k_driftboost] <= 125)
|
||||
speedcolor = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
}
|
||||
|
||||
speedcolor = (leveltime & 1) ? ((cv_coloredspeedlines.value == 3) ? SKINCOLOR_NONE : player->mo->color) : speedcolor;
|
||||
if (cv_coloredspeedlines.value == 2)
|
||||
speedcolor = (leveltime & 1) ? playercolor : speedcolor;
|
||||
}
|
||||
}
|
||||
|
||||
if (cv_coloredspeedlines.value != 3)
|
||||
@@ -5642,7 +5647,7 @@ static UINT8 K_GetSpeedLineColor(player_t *player, boolean colorSpeed)
|
||||
}
|
||||
else if (player->kartstuff[k_invincibilitytimer])
|
||||
{
|
||||
speedcolor = player->mo->color;
|
||||
speedcolor = playercolor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10658,6 +10663,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
|
||||
const skin_t *skin;
|
||||
player_t *player = mo->player;
|
||||
const boolean skinlocal = mo->skinlocal;
|
||||
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos, wntdamxpos, wntdamypos;
|
||||
@@ -10670,7 +10676,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
#endif
|
||||
|
||||
skin = K_GetMobjSkin(mo);
|
||||
minimaphead = R_GetSkinFaceMini(player);
|
||||
minimaphead = (skinlocal ? localfacemmapprefix : facemmapprefix)[K_GetMobjSkinNum(skin, skinlocal)];
|
||||
|
||||
amnumxpos = (FixedMul(lerp(mo->old_x, mo->x), minimapinfo.zoom) - minimapinfo.offs_x);
|
||||
amnumypos = -(FixedMul(lerp(mo->old_y, mo->y), minimapinfo.zoom) - minimapinfo.offs_y);
|
||||
@@ -10720,7 +10726,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
if (mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetLocalTranslationColormap(mo->skin, mo->localskin, mo->color, GTC_CACHE, mo->skinlocal);
|
||||
colormap = R_GetLocalTranslationColormap(mo->skin, mo->localskin, mo->color, GTC_CACHE, skinlocal);
|
||||
|
||||
V_DrawFixedPatch(amxpos, amypos, scale, flags, minimaphead, colormap);
|
||||
|
||||
@@ -10878,6 +10884,9 @@ static void K_drawKartMinimap(void)
|
||||
|
||||
angle_t ang = R_InterpolateAngle(mobj->old_angle, mobj->angle);
|
||||
|
||||
if (encoremode)
|
||||
ang = ANGLE_180 - ang;
|
||||
|
||||
if (mobj->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, mobj->color, GTC_CACHE);
|
||||
else
|
||||
|
||||
+2
-5
@@ -1396,11 +1396,9 @@ static int lib_pSetMobjStateNF(lua_State *L)
|
||||
static int lib_pDoSuperTransformation(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
boolean giverings = lua_optboolean(L, 2);
|
||||
NOHUD
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_DoSuperTransformation(player, giverings);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2452,16 +2450,15 @@ static int lib_gExitLevel(lua_State *L)
|
||||
|
||||
static int lib_gIsSpecialStage(lua_State *L)
|
||||
{
|
||||
INT32 mapnum = luaL_optinteger(L, 1, gamemap);
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_IsSpecialStage(mapnum));
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_gGametypeUsesLives(lua_State *L)
|
||||
{
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_GametypeUsesLives());
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -629,7 +629,7 @@ static int cvar_get(lua_State *L)
|
||||
break;
|
||||
default:
|
||||
if (devparm)
|
||||
return luaL_error(L, LUA_QL("consvar_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("consvar_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -385,7 +385,7 @@ static int state_get(lua_State *L)
|
||||
default:
|
||||
{
|
||||
if (devparm)
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -462,7 +462,7 @@ static int state_set(lua_State *L)
|
||||
break;
|
||||
|
||||
default:
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("state_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+2
-2
@@ -877,7 +877,7 @@ static int mapthing_get(lua_State *L)
|
||||
break;
|
||||
default:
|
||||
if (devparm)
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -931,7 +931,7 @@ static int mapthing_set(lua_State *L)
|
||||
mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
||||
break;
|
||||
default:
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, field);
|
||||
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+2
-2
@@ -707,8 +707,8 @@ static int kartstuff_len(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define NOFIELD luaL_error(L, LUA_QL("ticcmd_t") " has no field named " LUA_QS, field)
|
||||
#define NOSET luaL_error(L, LUA_QL("ticcmd_t") " field " LUA_QS " should not be set directly.", field)
|
||||
#define NOFIELD luaL_error(L, LUA_QL("ticcmd_t") " has no field named " LUA_QS, lua_tostring(L, 2))
|
||||
#define NOSET luaL_error(L, LUA_QL("ticcmd_t") " field " LUA_QS " should not be set directly.", lua_tostring(L, 2))
|
||||
|
||||
enum ticcmd_e
|
||||
{
|
||||
|
||||
+1
-190
@@ -57,29 +57,11 @@ typedef struct
|
||||
// CHEAT Structures
|
||||
// ==========================================================================
|
||||
|
||||
// Cheat responders
|
||||
/*static UINT8 cheatf_ultimate(void)
|
||||
{
|
||||
if (menuactive && (currentMenu != &MainDef && currentMenu != &SP_LoadDef))
|
||||
return 0; // Only on the main menu, or the save select!
|
||||
|
||||
S_StartSound(0, sfx_itemup);
|
||||
ultimate_selectable = (!ultimate_selectable);
|
||||
|
||||
// If on the save select, move to what is now Ultimate Mode!
|
||||
if (currentMenu == &SP_LoadDef)
|
||||
M_ForceSaveSlotSelected(NOSAVESLOT);
|
||||
return 1;
|
||||
}*/
|
||||
|
||||
static UINT8 cheatf_warp(void)
|
||||
{
|
||||
UINT8 i;
|
||||
boolean success = false;
|
||||
|
||||
/*if (modifiedgame)
|
||||
return 0;*/
|
||||
|
||||
if (menuactive && currentMenu != &MainDef)
|
||||
return 0; // Only on the main menu!
|
||||
|
||||
@@ -134,18 +116,6 @@ static UINT8 cheatf_devmode(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*static cheatseq_t cheat_ultimate = {
|
||||
0, cheatf_ultimate,
|
||||
{ SCRAMBLE('u'), SCRAMBLE('l'), SCRAMBLE('t'), SCRAMBLE('i'), SCRAMBLE('m'), SCRAMBLE('a'), SCRAMBLE('t'), SCRAMBLE('e'), 0xff }
|
||||
};*/
|
||||
|
||||
/*static cheatseq_t cheat_ultimate_joy = {
|
||||
0, cheatf_ultimate,
|
||||
{ SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_DOWNARROW),
|
||||
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||
SCRAMBLE(KEY_ENTER), 0xff }
|
||||
};*/
|
||||
|
||||
static cheatseq_t cheat_warp = {
|
||||
0, cheatf_warp,
|
||||
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
|
||||
@@ -376,70 +346,6 @@ void Command_Hurtme_f(void)
|
||||
P_DamageMobj(players[consoleplayer].mo, NULL, NULL, atoi(COM_Argv(1)));
|
||||
}
|
||||
|
||||
// Moves the NiGHTS player to another axis within the current mare
|
||||
/*void Command_JumpToAxis_f(void)
|
||||
{
|
||||
REQUIRE_DEVMODE;
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
|
||||
if (COM_Argc() != 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("jumptoaxis <axisnum>: Jump to axis within current mare.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
P_TransferToAxis(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||
}
|
||||
|
||||
void Command_Charability_f(void)
|
||||
{
|
||||
REQUIRE_DEVMODE;
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
|
||||
if (COM_Argc() < 3)
|
||||
{
|
||||
CONS_Printf(M_GetText("charability <1/2> <value>: change character abilities\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (atoi(COM_Argv(1)) == 1)
|
||||
players[consoleplayer].charability = (UINT8)atoi(COM_Argv(2));
|
||||
else if (atoi(COM_Argv(1)) == 2)
|
||||
players[consoleplayer].charability2 = (UINT8)atoi(COM_Argv(2));
|
||||
else
|
||||
CONS_Printf(M_GetText("charability <1/2> <value>: change character abilities\n"));
|
||||
}
|
||||
|
||||
void Command_Charspeed_f(void)
|
||||
{
|
||||
REQUIRE_DEVMODE;
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
|
||||
if (COM_Argc() < 3)
|
||||
{
|
||||
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcasecmp(COM_Argv(1), "normalspeed"))
|
||||
players[consoleplayer].normalspeed = atoi(COM_Argv(2))<<FRACBITS;
|
||||
else if (!strcasecmp(COM_Argv(1), "runspeed"))
|
||||
players[consoleplayer].runspeed = atoi(COM_Argv(2))<<FRACBITS;
|
||||
else if (!strcasecmp(COM_Argv(1), "thrustfactor"))
|
||||
players[consoleplayer].thrustfactor = atoi(COM_Argv(2));
|
||||
else if (!strcasecmp(COM_Argv(1), "accelstart"))
|
||||
players[consoleplayer].accelstart = atoi(COM_Argv(2));
|
||||
else if (!strcasecmp(COM_Argv(1), "acceleration"))
|
||||
players[consoleplayer].acceleration = atoi(COM_Argv(2));
|
||||
else if (!strcasecmp(COM_Argv(1), "actionspd"))
|
||||
players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS;
|
||||
else
|
||||
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
|
||||
}*/
|
||||
|
||||
void Command_RTeleport_f(void)
|
||||
{
|
||||
fixed_t intx, inty, intz;
|
||||
@@ -682,28 +588,6 @@ void Command_Savecheckpoint_f(void)
|
||||
CONS_Printf(M_GetText("Temporary checkpoint created at %d, %d, %d\n"), players[consoleplayer].starpostx, players[consoleplayer].starposty, players[consoleplayer].starpostz);
|
||||
}
|
||||
|
||||
// Like M_GetAllEmeralds() but for console devmode junkies.
|
||||
/*void Command_Getallemeralds_f(void)
|
||||
{
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
emeralds = ((EMERALD7)*2)-1;
|
||||
|
||||
CONS_Printf(M_GetText("You now have all 7 emeralds.\n"));
|
||||
}
|
||||
|
||||
void Command_Resetemeralds_f(void)
|
||||
{
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
emeralds = 0;
|
||||
|
||||
CONS_Printf(M_GetText("Emeralds reset to zero.\n"));
|
||||
}*/
|
||||
|
||||
void Command_Devmode_f(void)
|
||||
{
|
||||
#ifndef _DEBUG
|
||||
@@ -730,63 +614,6 @@ void Command_Devmode_f(void)
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
/*void Command_Setrings_f(void)
|
||||
{
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
{
|
||||
// P_GivePlayerRings does value clamping
|
||||
players[consoleplayer].health = players[consoleplayer].mo->health = 1;
|
||||
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||
if (!G_IsSpecialStage(gamemap) || !useNightsSS)
|
||||
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
}
|
||||
|
||||
void Command_Setlives_f(void)
|
||||
{
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
{
|
||||
// P_GivePlayerLives does value clamping
|
||||
players[consoleplayer].lives = 0;
|
||||
P_GivePlayerLives(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
}
|
||||
|
||||
void Command_Setcontinues_f(void)
|
||||
{
|
||||
REQUIRE_INLEVEL;
|
||||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
REQUIRE_PANDORA;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
{
|
||||
INT32 numcontinues = atoi(COM_Argv(1));
|
||||
if (numcontinues > 99)
|
||||
numcontinues = 99;
|
||||
else if (numcontinues < 0)
|
||||
numcontinues = 0;
|
||||
|
||||
players[consoleplayer].continues = numcontinues;
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
}
|
||||
}*/
|
||||
|
||||
//
|
||||
// OBJECTPLACE (and related variables)
|
||||
//
|
||||
@@ -1006,17 +833,6 @@ void OP_NightsObjectplace(player_t *player)
|
||||
P_SpawnHoopsAndRings(mt);
|
||||
}
|
||||
|
||||
// This places a bumper!
|
||||
/*if (cmd->buttons & BT_SPECTATE)
|
||||
{
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
if (!OP_HeightOkay(player, false))
|
||||
return;
|
||||
|
||||
mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSBUMPER].doomednum, false);
|
||||
P_SpawnMapThing(mt);
|
||||
}*/
|
||||
|
||||
// This places a ring!
|
||||
if (cmd->buttons & BT_BACKWARD)
|
||||
{
|
||||
@@ -1163,12 +979,7 @@ void OP_ObjectplaceMovement(player_t *player)
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (cmd->buttons & BT_FORWARD)
|
||||
{
|
||||
OP_CycleThings(-1);
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
}
|
||||
else*/ if (cmd->buttons & BT_DRIFT)
|
||||
if (cmd->buttons & BT_DRIFT)
|
||||
{
|
||||
OP_CycleThings(1);
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
|
||||
Loaded 100 of 204 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user