Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • better-distance-math
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • classic-netcode-fixes
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-dedi-pthread
  • fix-enemy-target
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
  • voltybystorm/SRB2
  • ZenithNeko/srb-2-xp
  • Nep2Disk/SRB2
  • Cloudeon/SRB2
  • mushe/srb-2-ps-b
122 results
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • better-player-states
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-1258
  • fix-1277
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • gitlab-ci
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-debug-library
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • map-components-signedness-fixes
  • master
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
141 results
Show changes
Showing
with 390 additions and 200 deletions
......@@ -280,18 +280,18 @@ universalfields
default = "";
}
//light
//{
// type = 0;
// default = 0;
//}
//
//lightabsolute
//{
// type = 3;
// default = false;
//}
//
light
{
type = 0;
default = 0;
}
lightabsolute
{
type = 3;
default = false;
}
//light_top
//{
// type = 0;
......@@ -590,6 +590,12 @@ universalfields
type = 3;
default = false;
}
triggertag
{
type = 0;
default = 0;
}
}
}
......
......@@ -3938,6 +3938,7 @@ udmf
width = 30;
height = 32;
color = 17;
hangs = 1;
arg0
{
title = "Initial delay";
......
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)
#!/usr/bin/env bash
# Makes a fused macOS Universal app bundle in the arm64 release preset dir
# Only works if in master branch or in source tarball
set -e
rm -rf "build/ninja-x64_osx_vcpkg-release"
rm -rf "build/ninja-arm64_osx_vcpkg-release"
cmake --preset ninja-x64_osx_vcpkg-release -DVCPKG_OVERLAY_TRIPLETS=scripts/ -DVCPKG_TARGET_TRIPLET=x64-osx-1015 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 "-DSRB2_SDL2_EXE_NAME=srb2"
cmake --build --preset ninja-x64_osx_vcpkg-release
cmake --preset ninja-arm64_osx_vcpkg-release -DVCPKG_OVERLAY_TRIPLETS=scripts/ -DVCPKG_TARGET_TRIPLET=arm64-osx-1015 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 "-DSRB2_SDL2_EXE_NAME=srb2"
cmake --build --preset ninja-arm64_osx_vcpkg-release
mkdir -p build/dist
rm -rf "build/dist/Sonic Robo Blast 2.app" "build/dist/srb2.app"
cp -r build/ninja-arm64_osx_vcpkg-release/bin/srb2.app build/dist/
lipo -create \
-output "build/dist/srb2.app/Contents/MacOS/srb2" \
build/ninja-x64_osx_vcpkg-release/bin/srb2.app/Contents/MacOS/srb2 \
build/ninja-arm64_osx_vcpkg-release/bin/srb2.app/Contents/MacOS/srb2
mv build/dist/srb2.app "build/dist/Sonic Robo Blast 2.app"
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)
......@@ -23,6 +23,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32
i_time.c
y_inter.c
st_stuff.c
matrix.c
m_aatree.c
m_anigif.c
m_argv.c
......@@ -56,6 +57,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32
p_tick.c
p_user.c
p_slopes.c
quaternion.c
tables.c
r_bsp.c
r_data.c
......@@ -77,6 +79,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32
r_portal.c
screen.c
taglist.c
vector3d.c
v_video.c
s_sound.c
sounds.c
......@@ -104,6 +107,11 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32
lua_hudlib_drawlist.c
lua_colorlib.c
lua_inputlib.c
lua_interceptlib.c
lua_vectorlib.c
lua_matrixlib.c
lua_quaternionlib.c
lua_archive.c
)
# This updates the modification time for comptime.c at the
......@@ -143,7 +151,7 @@ if("${CMAKE_COMPILER_IS_GNUCC}" AND "${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
endif()
endif()
target_compile_features(SRB2SDL2 PRIVATE c_std_11 cxx_std_17)
target_compile_features(SRB2SDL2 PRIVATE c_std_23 cxx_std_17)
### Configuration
set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL
......@@ -172,6 +180,11 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
endif()
endif()
if("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
target_compile_definitions(SRB2SDL2 PRIVATE -DNOEXECINFO)
target_link_libraries(SRB2SDL2 PRIVATE network)
endif()
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX)
endif()
......@@ -187,9 +200,6 @@ endif()
target_compile_definitions(SRB2SDL2 PRIVATE -D_LARGEFILE64_SOURCE)
set(SRB2_HAVE_THREADS ON)
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS)
if("${SRB2_CONFIG_HWRENDER}")
target_compile_definitions(SRB2SDL2 PRIVATE -DHWRENDER)
add_subdirectory(hardware)
......@@ -229,11 +239,14 @@ endif()
# Compatibility flag with later versions of GCC
# We should really fix our code to not need this
if (NOT SRB2_CONFIG_FORCE_NO_MS_BITFIELDS)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|x64|amd64|AMD64|em64t|EM64T)")
check_cxx_compiler_flag("-mno-ms-bitfields" HAS_NO_MS_BITFIELDS)
if(HAS_NO_MS_BITFIELDS)
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
endif()
endif()
endif()
# Compiler warnings configuration
target_compile_options(SRB2SDL2 PRIVATE
......@@ -456,8 +469,13 @@ else()
endif()
if(TARGET miniupnpc::miniupnpc)
if("${VCPKG_TARGET_TRIPLET}" MATCHES "-mingw-static$")
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC -DMINIUPNP_STATICLIB)
target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc -liphlpapi)
else()
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MINIUPNPC)
target_link_libraries(SRB2SDL2 PRIVATE miniupnpc::miniupnpc)
endif()
message(STATUS "miniupnpc Found")
else()
message(STATUS "No miniupnpc Found")
......
......@@ -13,10 +13,7 @@ ifdef MINGW
libs+=-mconsole
endif
ifndef NOTHREADS
opts+=-DHAVE_THREADS
sources+=dedicated/i_threads.c
endif
NOOPENMPT=1
NOGME=1
......
......@@ -4,7 +4,6 @@
# Previously featured:\
PANDORA\
HAIKU\
DUMMY\
DJGPPDOS\
SOLARIS\
......@@ -17,6 +16,7 @@ all_systems:=\
UNIX\
LINUX\
FREEBSD\
HAIKU\
# check for user specified system
ifeq (,$(filter $(all_systems),$(.VARIABLES)))
......@@ -35,6 +35,8 @@ system:=$(shell uname -s)
ifeq ($(system),Linux)
new_system:=LINUX
else ifeq ($(system),Haiku)
new_system:=HAIKU
else
$(error \
......
#
# 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))
......@@ -35,6 +35,10 @@ 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
......
......@@ -33,6 +33,7 @@ else
opts+=-DHAVE_MIXER
sources+=sdl/mixer_sound.c
ifndef HAIKU # Haiku has a special import path
ifdef HAVE_MIXERX
opts+=-DHAVE_MIXERX
libs+=-lSDL2_mixer_ext
......@@ -40,11 +41,9 @@ sources+=sdl/mixer_sound.c
libs+=-lSDL2_mixer
endif
endif
endif
ifndef NOTHREADS
opts+=-DHAVE_THREADS
sources+=sdl/i_threads.c
endif
ifdef SDL_PKGCONFIG
$(eval $(call Use_pkg_config,SDL))
......
......@@ -17,6 +17,7 @@ hu_stuff.c
i_time.c
y_inter.c
st_stuff.c
matrix.c
m_aatree.c
m_anigif.c
m_argv.c
......@@ -50,6 +51,7 @@ p_telept.c
p_tick.c
p_user.c
p_slopes.c
quaternion.c
tables.c
r_bsp.c
r_data.c
......@@ -71,6 +73,7 @@ r_picformats.c
r_portal.c
screen.c
taglist.c
vector3d.c
v_video.c
s_sound.c
sounds.c
......@@ -98,3 +101,8 @@ lua_hudlib.c
lua_hudlib_drawlist.c
lua_inputlib.c
lua_colorlib.c
lua_interceptlib.c
lua_vectorlib.c
lua_matrixlib.c
lua_quaternionlib.c
lua_archive.c
......@@ -1076,6 +1076,9 @@ static inline void AM_drawPlayers(void)
if (!playeringame[i] || players[i].spectator)
continue;
if (!players[i].mo)
continue;
p = &players[i];
if (p->skincolor > 0)
color = R_GetTranslationColormap(TC_DEFAULT, p->skincolor, GTC_CACHE)[GREENS + 8];
......
......@@ -71,7 +71,7 @@ apng_create_info_struct (png_structp pngp)
{
apng_infop ainfop;
(void)pngp;
if (( ainfop = calloc(sizeof (apng_info),1) ))
if (( ainfop = calloc(1,sizeof (apng_info)) ))
{
apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0);
apng_set_set_acTL_fn(pngp, ainfop, 0);
......
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz.
// Copyright (C) 2011-2023 by Sonic Team Junior.
// Copyright (C) 2011-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -387,6 +387,7 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
}
// Bot AI isn't programmed in analog.
if (!dedicated)
CV_SetValue(&cv_analog[1], false);
// Let Lua scripts build ticcmds
......
......@@ -39,13 +39,26 @@
// Allow scripters to write files of these types to SRB2's folder
static const char *whitelist[] = {
".bmp",
".cfg",
".csv",
".dat",
".bin",
".bmp",
".png",
".sav2",
".obj",
".json",
".yaml",
".xml",
".csv",
".soc",
".cfg",
".ini",
".txt",
".log",
".md",
".sav2",
};
......@@ -183,7 +196,7 @@ void MakePathDirs(char *path)
}
static int CheckFileName(lua_State *L, const char *filename)
static int CheckFileName(lua_State* L, const char* filename, boolean extensioncheck)
{
int length = strlen(filename);
boolean pass = false;
......@@ -195,12 +208,20 @@ static int CheckFileName(lua_State *L, const char *filename)
return pushresult(L, 0, filename);
}
if (extensioncheck)
{
for (i = 0; i < (sizeof(whitelist) / sizeof(const char*)); i++)
if (!stricmp(&filename[length - strlen(whitelist[i])], whitelist[i]))
{
pass = true;
break;
}
}
else
{
pass = true;
}
if (strstr(filename, "./")
|| strstr(filename, "..") || strchr(filename, ':')
|| filename[0] == '/'
......@@ -218,7 +239,7 @@ static int io_open (lua_State *L) {
const char *mode = luaL_optstring(L, 2, "r");
int checkresult;
checkresult = CheckFileName(L, filename);
checkresult = CheckFileName(L, filename, false);
if (checkresult)
return checkresult;
......@@ -241,7 +262,10 @@ static int io_openlocal (lua_State *L) {
luafiletransfer_t *filetransfer;
int checkresult;
checkresult = CheckFileName(L, filename);
// Decision was made for normal reading (binary + text) to have no whitelist restrictions
boolean readcheck = (strchr(mode, 'w') != NULL) || (strchr(mode, 'a') != NULL) || (strchr(mode, '+') != NULL);
checkresult = CheckFileName(L, filename, readcheck);
if (checkresult)
return checkresult;
......
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -11,9 +11,6 @@
/// \brief Macros to read/write from/to a UINT8 *,
/// used for packet creation and such
#if defined (__alpha__) || defined (__arm__) || defined (__mips__) || defined (__ia64__) || defined (__clang__)
#define DEALIGNED
#endif
#include "endian.h"
......@@ -21,7 +18,6 @@
//
// Little-endian machines
//
#ifdef DEALIGNED
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = (void *)p; const UINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITESINT8(p,b) do { SINT8 *p_tmp = (void *)p; const SINT8 tv = ( UINT8)(b); memcpy(p, &tv, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEINT16(p,b) do { INT16 *p_tmp = (void *)p; const INT16 tv = ( INT16)(b); memcpy(p, &tv, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; } while (0)
......@@ -31,20 +27,8 @@
#define WRITECHAR(p,b) do { char *p_tmp = (void *)p; const char tv = ( char)(b); memcpy(p, &tv, sizeof( char)); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (void *)p; const fixed_t tv = (fixed_t)(b); memcpy(p, &tv, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (void *)p; const angle_t tv = (angle_t)(b); memcpy(p, &tv, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; } while (0)
#else
#define WRITEUINT8(p,b) do { UINT8 *p_tmp = ( UINT8 *)p; *p_tmp = ( UINT8)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITESINT8(p,b) do { SINT8 *p_tmp = ( SINT8 *)p; *p_tmp = ( SINT8)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEINT16(p,b) do { INT16 *p_tmp = ( INT16 *)p; *p_tmp = ( INT16)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEUINT16(p,b) do { UINT16 *p_tmp = ( UINT16 *)p; *p_tmp = ( UINT16)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEINT32(p,b) do { INT32 *p_tmp = ( INT32 *)p; *p_tmp = ( INT32)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEUINT32(p,b) do { UINT32 *p_tmp = ( UINT32 *)p; *p_tmp = ( UINT32)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITECHAR(p,b) do { char *p_tmp = ( char *)p; *p_tmp = ( char)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEFIXED(p,b) do { fixed_t *p_tmp = (fixed_t *)p; *p_tmp = (fixed_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#define WRITEANGLE(p,b) do { angle_t *p_tmp = (angle_t *)p; *p_tmp = (angle_t)(b); p_tmp++; p = (void *)p_tmp; } while (0)
#endif
#ifdef __GNUC__
#ifdef DEALIGNED
#define READUINT8(p) ({ UINT8 *p_tmp = (void *)p; UINT8 b; memcpy(&b, p, sizeof( UINT8)); p_tmp++; p = (void *)p_tmp; b; })
#define READSINT8(p) ({ SINT8 *p_tmp = (void *)p; SINT8 b; memcpy(&b, p, sizeof( SINT8)); p_tmp++; p = (void *)p_tmp; b; })
#define READINT16(p) ({ INT16 *p_tmp = (void *)p; INT16 b; memcpy(&b, p, sizeof( INT16)); p_tmp++; p = (void *)p_tmp; b; })
......@@ -55,17 +39,6 @@
#define READFIXED(p) ({ fixed_t *p_tmp = (void *)p; fixed_t b; memcpy(&b, p, sizeof(fixed_t)); p_tmp++; p = (void *)p_tmp; b; })
#define READANGLE(p) ({ angle_t *p_tmp = (void *)p; angle_t b; memcpy(&b, p, sizeof(angle_t)); p_tmp++; p = (void *)p_tmp; b; })
#else
#define READUINT8(p) ({ UINT8 *p_tmp = ( UINT8 *)p; UINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READSINT8(p) ({ SINT8 *p_tmp = ( SINT8 *)p; SINT8 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READINT16(p) ({ INT16 *p_tmp = ( INT16 *)p; INT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READUINT16(p) ({ UINT16 *p_tmp = ( UINT16 *)p; UINT16 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READINT32(p) ({ INT32 *p_tmp = ( INT32 *)p; INT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READUINT32(p) ({ UINT32 *p_tmp = ( UINT32 *)p; UINT32 b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#endif
#else
#define READUINT8(p) *(( UINT8 *)p)++
#define READSINT8(p) *(( SINT8 *)p)++
#define READINT16(p) *(( INT16 *)p)++
......@@ -148,8 +121,6 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
#endif //SRB2_BIG_ENDIAN
#undef DEALIGNED
#define WRITESTRINGN(p, s, n) { \
size_t tmp_i; \
\
......
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -16,6 +16,10 @@
///
/// code shamelessly inspired by the QuakeC sources, thanks Id :)
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
#include "doomdef.h"
#include "doomstat.h"
#include "command.h"
......@@ -277,7 +281,11 @@ void COM_BufExecute(void)
/** Executes a string immediately. Used for skirting around WAIT commands.
*/
void COM_ImmedExecute(const char *ptext)
void
#ifdef __EMSCRIPTEN__
EMSCRIPTEN_KEEPALIVE
#endif
COM_ImmedExecute(const char *ptext)
{
size_t i = 0, j = 0;
char line[1024] = "";
......@@ -648,7 +656,7 @@ static void COM_ExecuteString(char *ptext)
{
if ((com_flags & COM_LUA) && !(cmd->flags & COM_LUA))
{
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from Lua.\n", cmd->name);
CONS_Alert(CONS_WARNING, "Command '%s' cannot be run from a script.\n", cmd->name);
return;
}
......@@ -809,49 +817,60 @@ static void COM_CEchoDuration_f(void)
/** Executes a script file.
*/
static void COM_Exec_f(void)
boolean COM_ExecFile(const char *scriptname, com_flags_t flags, boolean silent)
{
UINT8 *buf = NULL;
char filename[256];
if (COM_Argc() < 2 || COM_Argc() > 3)
{
CONS_Printf(M_GetText("exec <filename>: run a script file\n"));
return;
}
if (!D_CheckPathAllowed(COM_Argv(1), "tried to exec"))
return;
if (!D_CheckPathAllowed(scriptname, "tried to exec"))
return false;
// load file
// Try with Argv passed verbatim first, for back compat
FIL_ReadFile(COM_Argv(1), &buf);
FIL_ReadFile(scriptname, &buf);
if (!buf)
{
// Now try by searching the file path
// filename is modified with the full found path
strcpy(filename, COM_Argv(1));
strlcpy(filename, scriptname, sizeof(filename));
if (findfile(filename, NULL, true) != FS_NOTFOUND)
FIL_ReadFile(filename, &buf);
if (!buf)
{
if (!COM_CheckParm("-noerror"))
CONS_Printf(M_GetText("couldn't execute file %s\n"), COM_Argv(1));
return;
}
return false;
}
if (!COM_CheckParm("-silent"))
CONS_Printf(M_GetText("executing %s\n"), COM_Argv(1));
if (!silent)
CONS_Printf(M_GetText("Executing %s\n"), scriptname);
// insert text file into the command buffer
COM_BufAddTextEx((char *)buf, com_flags);
COM_BufAddTextEx("\n", com_flags);
COM_BufAddTextEx((char *)buf, flags);
COM_BufAddTextEx("\n", flags);
// free buffer
Z_Free(buf);
return true;
}
static void COM_Exec_f(void)
{
boolean silent;
if (COM_Argc() < 2 || COM_Argc() > 3)
{
CONS_Printf(M_GetText("exec <filename>: run a script file\n"));
return;
}
silent = COM_CheckParm("-silent");
if (COM_ExecFile(COM_Argv(1), com_flags, silent))
return;
if (!COM_CheckParm("-noerror"))
CONS_Printf(M_GetText("Couldn't execute file %s\n"), COM_Argv(1));
}
/** Delays execution of the rest of the commands until the next frame.
......@@ -1722,8 +1741,7 @@ badinput:
static boolean serverloading = false;
static consvar_t *
ReadNetVar (UINT8 **p, char **return_value, boolean *return_stealth)
static consvar_t *ReadNetVar(save_t *p, char **return_value, boolean *return_stealth)
{
UINT16 netid;
char *val;
......@@ -1731,10 +1749,10 @@ ReadNetVar (UINT8 **p, char **return_value, boolean *return_stealth)
consvar_t *cvar;
netid = READUINT16 (*p);
val = (char *)*p;
SKIPSTRING (*p);
stealth = READUINT8 (*p);
netid = P_ReadUINT16(p);
val = (char *)&p->buf[p->pos];
P_SkipString(p);
stealth = P_ReadUINT8(p);
cvar = CV_FindNetVar(netid);
......@@ -1752,8 +1770,7 @@ ReadNetVar (UINT8 **p, char **return_value, boolean *return_stealth)
}
#ifdef OLD22DEMOCOMPAT
static consvar_t *
ReadOldDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
static consvar_t *ReadOldDemoVar(save_t *p, char **return_value, boolean *return_stealth)
{
UINT16 id;
char *val;
......@@ -1761,10 +1778,10 @@ ReadOldDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
old_demo_var_t *demovar;
id = READUINT16 (*p);
val = (char *)*p;
SKIPSTRING (*p);
stealth = READUINT8 (*p);
id = P_ReadUINT16(p);
val = (char *)&p->buf[p->pos];
P_SkipString(p);
stealth = P_ReadUINT8(p);
demovar = CV_FindOldDemoVar(id);
......@@ -1783,8 +1800,7 @@ ReadOldDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
}
#endif/*OLD22DEMOCOMPAT*/
static consvar_t *
ReadDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
static consvar_t *ReadDemoVar(save_t *p, char **return_value, boolean *return_stealth)
{
char *name;
char *val;
......@@ -1792,11 +1808,11 @@ ReadDemoVar (UINT8 **p, char **return_value, boolean *return_stealth)
consvar_t *cvar;
name = (char *)*p;
SKIPSTRING (*p);
val = (char *)*p;
SKIPSTRING (*p);
stealth = READUINT8 (*p);
name = (char *)&p->buf[p->pos];
P_SkipString(p);
val = (char *)&p->buf[p->pos];
P_SkipString(p);
stealth = P_ReadUINT8(p);
cvar = CV_FindVar(name);
......@@ -1826,41 +1842,46 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
return;
}
cvar = ReadNetVar(p, &svalue, &stealth);
save_t save_p;
save_p.buf = *p;
save_p.size = MAXTEXTCMD;
save_p.pos = 0;
cvar = ReadNetVar(&save_p, &svalue, &stealth);
*p = &save_p.buf[save_p.pos];
if (cvar)
Setvalue(cvar, svalue, stealth);
}
void CV_SaveVars(UINT8 **p, boolean in_demo)
void CV_SaveVars(save_t *p, boolean in_demo)
{
consvar_t *cvar;
UINT8 *count_p = *p;
UINT8 *count_p = &p->buf[p->pos];
UINT16 count = 0;
// send only changed cvars ...
// the client will reset all netvars to default before loading
WRITEUINT16(*p, 0x0000);
P_WriteUINT16(p, 0x0000);
for (cvar = consvar_vars; cvar; cvar = cvar->next)
if ((cvar->flags & CV_NETVAR) && !CV_IsSetToDefault(cvar))
{
if (in_demo)
{
WRITESTRING(*p, cvar->name);
P_WriteString(p, cvar->name);
}
else
{
WRITEUINT16(*p, cvar->netid);
P_WriteUINT16(p, cvar->netid);
}
WRITESTRING(*p, cvar->string);
WRITEUINT8(*p, false);
P_WriteString(p, cvar->string);
P_WriteUINT8(p, false);
++count;
}
WRITEUINT16(count_p, count);
}
static void CV_LoadVars(UINT8 **p,
consvar_t *(*got)(UINT8 **p, char **ret_value, boolean *ret_stealth))
static void CV_LoadVars(save_t *p,
consvar_t *(*got)(save_t *p, char **ret_value, boolean *ret_stealth))
{
const boolean store = (client || demoplayback);
......@@ -1888,7 +1909,7 @@ static void CV_LoadVars(UINT8 **p,
}
}
count = READUINT16(*p);
count = P_ReadUINT16(p);
while (count--)
{
cvar = (*got)(p, &val, &stealth);
......@@ -1921,19 +1942,19 @@ void CV_RevertNetVars(void)
}
}
void CV_LoadNetVars(UINT8 **p)
void CV_LoadNetVars(save_t *p)
{
CV_LoadVars(p, ReadNetVar);
}
#ifdef OLD22DEMOCOMPAT
void CV_LoadOldDemoVars(UINT8 **p)
void CV_LoadOldDemoVars(save_t *p)
{
CV_LoadVars(p, ReadOldDemoVar);
}
#endif
void CV_LoadDemoVars(UINT8 **p)
void CV_LoadDemoVars(save_t *p)
{
CV_LoadVars(p, ReadDemoVar);
}
......@@ -1986,13 +2007,13 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
if (!var->string)
I_Error("CV_Set: %s no string set!\n", var->name);
#endif
if (!var || !var->string || !value || !stricmp(var->string, value))
if (!var || !var->string || !value || (var->can_change == NULL && !stricmp(var->string, value)))
return; // no changes
if (var->flags & CV_NETVAR)
{
// send the value of the variable
UINT8 buf[128];
UINT8 buf[512];
UINT8 *p = buf;
// Loading from a config in a netgame? Set revert value.
......@@ -2065,10 +2086,9 @@ static void CV_SetValueMaybeStealth(consvar_t *var, INT32 value, boolean stealth
if (var == &cv_forceskin) // Special handling.
{
const char *tmpskin = NULL;
if ((value < 0) || (value >= numskins))
;
else
if (value >= 0 && value < numskins)
tmpskin = skins[value]->name;
if (tmpskin)
memcpy(val, tmpskin, SKINNAMESIZE);
}
else
......@@ -2470,6 +2490,22 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
if (!CV_FilterJoyAxisVars(v, valstr))
return false;
}
if (GETMAJOREXECVERSION(cv_execversion.value) < 57) // 57 = 2.2.16
{
if (
(!stricmp(v->name, "movebob") && atoi(valstr) == FRACUNIT) ||
(!stricmp(v->name, "playersforexit") && atoi(valstr) == 4) || // 4 = all
(!stricmp(v->name, "advancemap") && atoi(valstr) == 1) || // 1 = next
(!stricmp(v->name, "cam_speed") && !stricmp(valstr, "0.3")) ||
(!stricmp(v->name, "cam2_speed") && !stricmp(valstr, "0.3")) ||
(!stricmp(v->name, "timerres") && atoi(valstr) == 0) || // 0 = classic
(!stricmp(v->name, "gr_modelinterpolation")) || // Force reset
(!stricmp(v->name, "fov") && atoi(valstr) == 90)
)
return false;
}
return true;
}
......@@ -2492,7 +2528,7 @@ static boolean CV_Command(void)
if (CV_Immutable(v))
{
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from Lua.\n", v->name);
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from a script.\n", v->name);
return true;
}
......
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
// Copyright (C) 1999-2024 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
......@@ -15,6 +15,7 @@
#include <stdio.h>
#include "doomdef.h"
#include "p_saveg.h"
//===================================
// Command buffer & command execution
......@@ -65,6 +66,9 @@ void COM_ImmedExecute(const char *ptext);
// Execute commands in buffer, flush them
void COM_BufExecute(void);
// Executes a script from a file
boolean COM_ExecFile(const char *scriptname, com_flags_t flags, boolean silent);
// As above; and progress the wait timer.
void COM_BufTicker(void);
......@@ -121,6 +125,7 @@ typedef enum
// used on menus
CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on.
CV_ALLOWLUA = 4096,/* Let this be called from Lua */
CV_MENU = 8192, // Lua exclusive flag, to give choice to modders regarding custom options menu.
} cvflags_t;
typedef struct CV_PossibleValue_s
......@@ -129,14 +134,19 @@ typedef struct CV_PossibleValue_s
const char *strvalue;
} CV_PossibleValue_t;
typedef struct consvar_s //NULL, NULL, 0, NULL, NULL |, 0, NULL, NULL, 0, 0, NULL
typedef struct consvar_s //NULL, NULL, NULL, NULL, 0, NULL, NULL |, 0, NULL, NULL, 0, 0, NULL
{
const char *name;
const char *defaultvalue;
INT32 flags; // flags see cvflags_t above
CV_PossibleValue_t *PossibleValue; // table of possible values
void (*func)(void); // called on change, if CV_CALL set
boolean (*can_change)(const char*); // called before change, if CV_CALL set
const char* displayname;
const char* category;
INT32 value; // for INT32 and fixed_t
const char *string; // value in string
char *zstring; // Either NULL or same as string.
......@@ -159,10 +169,10 @@ typedef struct consvar_s //NULL, NULL, 0, NULL, NULL |, 0, NULL, NULL, 0, 0, NUL
/* name, defaultvalue, flags, PossibleValue, func */
#define CVAR_INIT( ... ) \
{ __VA_ARGS__, NULL, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL }
{ __VA_ARGS__, NULL, NULL, NULL, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL}
#define CVAR_INIT_WITH_CALLBACKS( ... ) \
{ __VA_ARGS__, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL }
{ __VA_ARGS__, NULL, NULL, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL}
#ifdef OLD22DEMOCOMPAT
typedef struct old_demo_var old_demo_var_t;
......@@ -218,19 +228,19 @@ void CV_AddValue(consvar_t *var, INT32 increment);
void CV_SaveVariables(FILE *f);
// load/save gamesate (load and save option and for network join in game)
void CV_SaveVars(UINT8 **p, boolean in_demo);
void CV_SaveVars(save_t *p, boolean in_demo);
#define CV_SaveNetVars(p) CV_SaveVars(p, false)
void CV_LoadNetVars(UINT8 **p);
void CV_LoadNetVars(save_t *p);
// then revert after leaving a netgame
void CV_RevertNetVars(void);
#define CV_SaveDemoVars(p) CV_SaveVars(p, true)
void CV_LoadDemoVars(UINT8 **p);
void CV_LoadDemoVars(save_t *p);
#ifdef OLD22DEMOCOMPAT
void CV_LoadOldDemoVars(UINT8 **p);
void CV_LoadOldDemoVars(save_t *p);
#endif
// reset cheat netvars after cheats is deactivated
......