Compare commits
25
Commits
menumodels
...
fixcmake2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
813ed67211 | ||
|
|
276cf0a8cb | ||
|
|
8e91c16e97 | ||
|
|
186421fe85 | ||
|
|
af952870c3 | ||
|
|
4eeb0b4b20 | ||
|
|
cb2c65e9d9 | ||
|
|
f7bbde3982 | ||
|
|
c9fc3b4820 | ||
|
|
f5195dd137 | ||
|
|
5289f13891 | ||
|
|
073b35690b | ||
|
|
43d3ac102d | ||
|
|
aa96f9ceb3 | ||
|
|
104b8260fb | ||
|
|
edebc728ef | ||
|
|
08e7ce3b5b | ||
|
|
29f187b751 | ||
|
|
ac3a1ad5eb | ||
|
|
1b8d7b1541 | ||
|
|
b812d61da2 | ||
|
|
6fd64383d3 | ||
|
|
e984e7a6c8 | ||
|
|
51aec0e012 | ||
|
|
f38ca9aa28 |
No files matched your search
+8
-1
@@ -3,7 +3,13 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# Version change is fine.
|
||||
project(SRB2
|
||||
VERSION 1.6
|
||||
LANGUAGES C)
|
||||
LANGUAGES C CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
#set(CMAKE_CXX_EXTENSIONS OFF) # optional but recommended: disables GNU extensions, forces pure ISO C++
|
||||
set(CMAKE_CXX_EXTENSIONS ON)
|
||||
set(CMAKE_C_EXTENSIONS ON)
|
||||
|
||||
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
||||
message(FATAL_ERROR "In-source builds will bring you a world of pain. Please make a separate directory to invoke CMake from.")
|
||||
@@ -73,6 +79,7 @@ endif()
|
||||
# OS macros
|
||||
if (UNIX)
|
||||
add_definitions(-DUNIXCOMMON)
|
||||
add_link_options(-rdynamic) # Use -rdynamic so a backtrace log shows function names
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
@@ -22,14 +22,14 @@ We also have a Flatpak available on [Flathub](https://flathub.org/en/apps/org.sr
|
||||
|
||||
See [SRB2 Wiki/Source code compiling](http://wiki.srb2.org/wiki/Source_code_compiling). The compiling process for SRB2Kart is largely identical to SRB2.
|
||||
|
||||
Currently only the Makefile build system with GCC or Clang compiler is supported.
|
||||
CMake is NOT supported at the moment, but will be availible again soon.
|
||||
|
||||
For Windows only the Makefile build system with GCC or Clang compiler is supported.
|
||||
Visual C++ (MSVC) is unsupported.
|
||||
|
||||
64-bit Windows builds are supported and recommended over 32-bit builds, they will build automatically when using the MSYS2 MinGW 64-bit executable (requires the mingw-w64-x86_64-gcc package), no extra flags needed!
|
||||
The specific DLLs can be found under /libs/dll-binaries/(i686 for 32bit/x86_64 for 64-bit)/ or in the Release packages
|
||||
|
||||
MacOS and Linux can be build with CMake, but it is recommended to use the Makefile for Linux over CMake
|
||||
|
||||
Alternatively the [srb2bld](https://github.com/Bijman/srb2bld) script by Bijman can be used aswell!
|
||||
|
||||
## Disclaimer
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
## Assets Target Configuration ##
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES Linux)
|
||||
# Asset installation isn't part of the Linux target
|
||||
return()
|
||||
endif()
|
||||
|
||||
# For prepending the current source path, later
|
||||
FUNCTION(PREPEND var prefix)
|
||||
SET(listVar "")
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(LIBBACKTRACE_PKGCONF LIBBACKTRACE)
|
||||
|
||||
find_path(LIBBACKTRACE_INCLUDE_DIR
|
||||
NAMES backtrace.h
|
||||
PATHS
|
||||
${LIBBACKTRACE_PKGCONF_INCLUDE_DIRS}
|
||||
"/usr/include"
|
||||
"/usr/local/include"
|
||||
)
|
||||
|
||||
find_library(LIBBACKTRACE_LIBRARY
|
||||
NAMES backtrace
|
||||
PATHS
|
||||
${LIBBACKTRACE_PKGCONF_LIBRARY_DIRS}
|
||||
"/usr/lib"
|
||||
"/usr/local/lib"
|
||||
)
|
||||
|
||||
set(LIBBACKTRACE_PROCESS_INCLUDES LIBBACKTRACE_INCLUDE_DIR)
|
||||
set(LIBBACKTRACE_PROCESS_LIBS LIBBACKTRACE_LIBRARY)
|
||||
libfind_process(LIBBACKTRACE)
|
||||
|
||||
if(LIBBACKTRACE_FOUND AND NOT TARGET libbacktrace)
|
||||
add_library(libbacktrace UNKNOWN IMPORTED)
|
||||
set_target_properties(
|
||||
libbacktrace
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${LIBBACKTRACE_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBBACKTRACE_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
+76
-31
@@ -2,6 +2,8 @@
|
||||
|
||||
# Core sources
|
||||
set(SRB2_CORE_SOURCES
|
||||
core/memory.cpp
|
||||
core/thread_pool.cpp
|
||||
am_map.c
|
||||
b_bot.c
|
||||
command.c
|
||||
@@ -18,17 +20,21 @@ set(SRB2_CORE_SOURCES
|
||||
f_wipe.c
|
||||
filesrch.c
|
||||
g_game.c
|
||||
g_demo.c
|
||||
g_input.c
|
||||
hu_stuff.c
|
||||
i_tcp.c
|
||||
info.c
|
||||
k_hud.c
|
||||
lzf.c
|
||||
m_aatree.c
|
||||
m_anigif.c
|
||||
m_argv.c
|
||||
m_bbox.c
|
||||
m_cheat.c
|
||||
m_curl.c
|
||||
m_cond.c
|
||||
m_emotes.cpp
|
||||
m_fixed.c
|
||||
m_menu.c
|
||||
m_textinput.c
|
||||
@@ -40,19 +46,25 @@ set(SRB2_CORE_SOURCES
|
||||
mserv.c
|
||||
http-mserv.c
|
||||
qs22j.c
|
||||
r_skins.c
|
||||
s_sound.c
|
||||
screen.c
|
||||
sounds.c
|
||||
st_stuff.c
|
||||
#string.c
|
||||
string.c
|
||||
tables.c
|
||||
v_video.c
|
||||
w_wad.c
|
||||
y_inter.c
|
||||
z_zone.c
|
||||
z_zone.cpp
|
||||
)
|
||||
|
||||
set(SRB2_CORE_HEADERS
|
||||
core/memory.h
|
||||
core/thread_pool.h
|
||||
m_curl.h
|
||||
m_emotes.h
|
||||
k_hud.h
|
||||
am_map.h
|
||||
b_bot.h
|
||||
byteptr.h
|
||||
@@ -78,6 +90,7 @@ set(SRB2_CORE_HEADERS
|
||||
fastcmp.h
|
||||
filesrch.h
|
||||
g_game.h
|
||||
g_demo.h
|
||||
g_input.h
|
||||
g_state.h
|
||||
hu_stuff.h
|
||||
@@ -109,6 +122,7 @@ set(SRB2_CORE_HEADERS
|
||||
md5.h
|
||||
mserv.h
|
||||
qs22j.h
|
||||
r_skins.h
|
||||
s_sound.h
|
||||
screen.h
|
||||
sounds.h
|
||||
@@ -123,18 +137,18 @@ set(SRB2_CORE_HEADERS
|
||||
)
|
||||
|
||||
set(SRB2_CORE_RENDER_SOURCES
|
||||
r_bsp.c
|
||||
r_bsp.cpp
|
||||
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_draw.cpp
|
||||
r_fps.cpp
|
||||
r_main.cpp
|
||||
r_patch.cpp
|
||||
r_patchrotation.cpp
|
||||
r_plane.cpp
|
||||
r_segs.cpp
|
||||
r_sky.c
|
||||
r_splats.c
|
||||
r_things.c
|
||||
r_things.cpp
|
||||
r_portal.c
|
||||
|
||||
r_bsp.h
|
||||
@@ -162,7 +176,7 @@ set(SRB2_CORE_GAME_SOURCES
|
||||
p_inter.c
|
||||
p_lights.c
|
||||
p_map.c
|
||||
p_maputl.c
|
||||
p_maputl.cpp
|
||||
p_mobj.c
|
||||
p_polyobj.c
|
||||
p_saveg.c
|
||||
@@ -193,10 +207,6 @@ set(SRB2_CORE_GAME_SOURCES
|
||||
k_stats.h
|
||||
)
|
||||
|
||||
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
set(SRB2_CORE_SOURCES ${SRB2_CORE_SOURCES} string.c)
|
||||
endif()
|
||||
|
||||
prepend_sources(SRB2_CORE_SOURCES)
|
||||
prepend_sources(SRB2_CORE_HEADERS)
|
||||
prepend_sources(SRB2_CORE_RENDER_SOURCES)
|
||||
@@ -226,11 +236,19 @@ set(SRB2_CONFIG_HWRENDER ON CACHE BOOL
|
||||
"Enable hardware rendering through OpenGL.")
|
||||
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_SCREENFBO ON CACHE BOOL
|
||||
"Enable hardware renderer (OpenGL) FBO downsampling support")
|
||||
set(SRB2_CONFIG_DEDICATED OFF CACHE BOOL
|
||||
"Build a dedicated server.")
|
||||
|
||||
set(SRB2_CONFIG_SATURNPAK ON CACHE BOOL
|
||||
"Enable Saturn specific special packet. Required for using the newer resynch system")
|
||||
set(SRB2_CONFIG_SATURNJOIN ON CACHE BOOL
|
||||
"Enable Saturn specific allowjoin toggle.")
|
||||
|
||||
set(SRB2_CONFIG_LIBBACKTRACE ON CACHE BOOL
|
||||
"Enable using libbacktrace for crashlogs")
|
||||
|
||||
if(${SRB2_CONFIG_DEDICATED})
|
||||
set(SRB2_CONFIG_HAVE_GME NO)
|
||||
set(SRB2_CONFIG_HAVE_OPENMPT NO)
|
||||
@@ -469,16 +487,37 @@ if(${SRB2_CONFIG_HAVE_CURL})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_LIBBACKTRACE})
|
||||
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
|
||||
if(${SRB2_SYSTEM_BITS} EQUAL 64)
|
||||
set(LIBBACKTRACE_FOUND ON)
|
||||
set(LIBBACKTRACE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/libbacktrace/include)
|
||||
set(LIBBACKTRACE_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/libbacktrace/lib/x86_64 -lbacktrace")
|
||||
else() # 32-bit
|
||||
message(WARNING "libbacktrace is unsupported on 32-bit builds.")
|
||||
endif()
|
||||
else()
|
||||
find_package(libbacktrace)
|
||||
endif()
|
||||
if(${LIBBACKTRACE_FOUND})
|
||||
set(SRB2_HAVE_LIBBACKTRACE ON)
|
||||
add_definitions(-DHAVE_LIBBACKTRACE)
|
||||
add_compile_options(-g)
|
||||
else()
|
||||
message(WARNING "You have specified that libbacktrace is available but it was not found.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_HWRENDER})
|
||||
add_definitions(-DHWRENDER)
|
||||
set(SRB2_HWRENDER_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_batching.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_shaders.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_bsp.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_cache.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_cache.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_clip.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_draw.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_portal.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md2.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_md2load.c
|
||||
@@ -493,7 +532,6 @@ if(${SRB2_CONFIG_HWRENDER})
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_clip.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_data.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_defs.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_dll.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_gl.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_glob.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.h
|
||||
@@ -525,24 +563,31 @@ if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_HWRENDER})
|
||||
if(${SRB2_CONFIG_USE_FBO_OGL})
|
||||
set(SRB2_USE_FBO_OGL ON)
|
||||
add_definitions(-DUSE_FBO_OGL)
|
||||
endif()
|
||||
if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_SCREENFBO})
|
||||
add_definitions(-DUSE_FBO_OGL)
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_SATURNPAK})
|
||||
add_definitions(-DDOSATURNPAK)
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_SATURNJOIN})
|
||||
add_definitions(-DDOSATURNJOIN)
|
||||
endif()
|
||||
|
||||
# Targets
|
||||
|
||||
# Compatibility flag with later versions of GCC
|
||||
# We should really fix our code to not need this
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -mno-ms-bitfields)
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|x64|amd64|AMD64|em64t|EM64T)")
|
||||
add_compile_options(-mno-ms-bitfields)
|
||||
endif()
|
||||
add_compile_options(-Wno-trigraphs)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value)
|
||||
endif()
|
||||
# TODO: fix prng and P_CreateBlockmap overflow at some point
|
||||
add_compile_options(-fwrapv)
|
||||
|
||||
add_definitions(-DCMAKECONFIG)
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ endif
|
||||
gcc_versions:=\
|
||||
152 151 150 15\
|
||||
142 141 140 14\
|
||||
132 131 130 13\
|
||||
133 132 131 130 13\
|
||||
123 122 121 120 12\
|
||||
114 113 112 111 110 11\
|
||||
105 104 103 102 101 100 10\
|
||||
|
||||
+3
-3
@@ -13,13 +13,13 @@
|
||||
#ifndef __COMMAND_H__
|
||||
#define __COMMAND_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include "doomdef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "doomdef.h"
|
||||
|
||||
//===================================
|
||||
// Command buffer & command execution
|
||||
//===================================
|
||||
|
||||
+3
-38
@@ -11,21 +11,6 @@
|
||||
|
||||
#ifdef CMAKECONFIG
|
||||
|
||||
// Base SRB2 hashes
|
||||
#define ASSET_HASH_SRB2_SRB "${SRB2_ASSET_srb2.srb_HASH}"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}"
|
||||
#endif
|
||||
|
||||
// SRB2Kart-specific hashes
|
||||
#define ASSET_HASH_GFX_KART "${SRB2_ASSET_gfx.kart_HASH}"
|
||||
#define ASSET_HASH_TEXTURES_KART "${SRB2_ASSET_textures.kart_HASH}"
|
||||
#define ASSET_HASH_CHARS_KART "${SRB2_ASSET_chars.kart_HASH}"
|
||||
#define ASSET_HASH_MAPS_KART "${SRB2_ASSET_maps.kart_HASH}"
|
||||
#ifdef USE_PATCH_KART
|
||||
#define ASSET_HASH_PATCH_KART "00000000000000000000000000000000"
|
||||
#endif
|
||||
|
||||
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
|
||||
#define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}"
|
||||
|
||||
@@ -33,30 +18,10 @@
|
||||
|
||||
#else
|
||||
|
||||
/* Manually defined asset hashes for non-CMake builds
|
||||
* Last updated 2015 / 05 / 03 - SRB2 v2.1.15 - srb2.srb
|
||||
* Last updated 2018 / 12 / 23 - SRB2 v2.1.22 - patch.dta
|
||||
* Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets
|
||||
* Last updated 2020 / 08 / 30 - Kart v1.3 - patch.kart
|
||||
* Last updated 2022 / 08 / 16 - Kart v1.4 - Main assets
|
||||
* Last updated 2022 / 08 / 19 - Kart v1.5 - gfx.kart
|
||||
* Last updated 2022 / 11 / 01 - Kart v1.6 - gfx.kart, maps.kart
|
||||
*/
|
||||
#define SRB2_COMP_REVISION ""
|
||||
#define SRB2_COMP_BRANCH ""
|
||||
|
||||
// Base SRB2 hashes
|
||||
#define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_DTA "b04fd9624bfd94dc96dcf4f400f7deb4"
|
||||
#endif
|
||||
|
||||
// SRB2Kart-specific hashes
|
||||
#define ASSET_HASH_GFX_KART "06f86ee16136eb8a7043b15001797034"
|
||||
#define ASSET_HASH_TEXTURES_KART "abb53d56aba47c3a8cb0f764da1c8b80"
|
||||
#define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964"
|
||||
#define ASSET_HASH_MAPS_KART "d051e55141ba736582228c456953cd98"
|
||||
#ifdef USE_PATCH_KART
|
||||
#define ASSET_HASH_PATCH_KART "00000000000000000000000000000000"
|
||||
#endif
|
||||
#define CMAKE_ASSETS_DIR ""
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -80,6 +80,31 @@
|
||||
|
||||
#include "lua_script.h"
|
||||
|
||||
/* Manually defined asset hashes for non-CMake builds
|
||||
* Last updated 2015 / 05 / 03 - SRB2 v2.1.15 - srb2.srb
|
||||
* Last updated 2018 / 12 / 23 - SRB2 v2.1.22 - patch.dta
|
||||
* Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets
|
||||
* Last updated 2020 / 08 / 30 - Kart v1.3 - patch.kart
|
||||
* Last updated 2022 / 08 / 16 - Kart v1.4 - Main assets
|
||||
* Last updated 2022 / 08 / 19 - Kart v1.5 - gfx.kart
|
||||
* Last updated 2022 / 11 / 01 - Kart v1.6 - gfx.kart, maps.kart
|
||||
*/
|
||||
|
||||
// Base SRB2 hashes
|
||||
#define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_DTA "b04fd9624bfd94dc96dcf4f400f7deb4"
|
||||
#endif
|
||||
|
||||
// SRB2Kart-specific hashes
|
||||
#define ASSET_HASH_GFX_KART "06f86ee16136eb8a7043b15001797034"
|
||||
#define ASSET_HASH_TEXTURES_KART "abb53d56aba47c3a8cb0f764da1c8b80"
|
||||
#define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964"
|
||||
#define ASSET_HASH_MAPS_KART "d051e55141ba736582228c456953cd98"
|
||||
#ifdef USE_PATCH_KART
|
||||
#define ASSET_HASH_PATCH_KART "00000000000000000000000000000000"
|
||||
#endif
|
||||
|
||||
#ifdef CMAKECONFIG
|
||||
#include "config.h"
|
||||
#else
|
||||
@@ -946,6 +971,9 @@ void D_ClearState(void)
|
||||
//
|
||||
void D_StartTitle(void)
|
||||
{
|
||||
if (dedicated)
|
||||
I_Error("D_StartTitle is called on dedicated server");
|
||||
|
||||
D_ClearState();
|
||||
multiplayer = netgame = false; // title menu shouldnt be a netgame or multiplayer lmao
|
||||
F_StartTitleScreen();
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
#include "fastcmp.h"
|
||||
#include "m_perfstats.h"
|
||||
|
||||
#include "r_data.h"
|
||||
#include "r_skins.h"
|
||||
|
||||
#ifdef NETGAME_DEVMODE
|
||||
#define CV_RESTRICT CV_NETVAR
|
||||
#else
|
||||
|
||||
@@ -180,10 +180,6 @@ static char returnWadPath[256];
|
||||
|
||||
#include "../m_argv.h"
|
||||
|
||||
#ifdef MAC_ALERT
|
||||
#include "macosx/mac_alert.h"
|
||||
#endif
|
||||
|
||||
#include "../d_main.h"
|
||||
|
||||
#if !defined(NOMUMBLE) && defined(HAVE_MUMBLE)
|
||||
|
||||
+32
-9
@@ -40,22 +40,45 @@
|
||||
#define ASMCALL
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
#ifdef __cplusplus /* Only when compiled as C++ */
|
||||
#include <algorithm> /* std::min, std::max, std::sort, … */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Force libc++ to expose std::min/std::max even when <cmath> is included first (Apple clang quirk)
|
||||
#ifndef _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
|
||||
#define _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
|
||||
#endif
|
||||
#ifndef _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
|
||||
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
|
||||
#endif
|
||||
|
||||
// Optional: only try <version> if it actually exists (newer Xcode)
|
||||
#if __has_include(<version>)
|
||||
#include <version>
|
||||
#endif
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <climits>
|
||||
|
||||
extern "C" {
|
||||
#else
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define _USE_MATH_DEFINES // fixes M_PI errors in r_plane.c for Visual Studio
|
||||
#ifdef __cplusplus
|
||||
#include <cmath>
|
||||
#else
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+3
-5
@@ -945,6 +945,8 @@ void G_SetPlayerGamepadIndicatorColor(INT32 playernum, UINT8 color)
|
||||
|
||||
static void G_ResetPlayerGamepadIndicatorColor(INT32 playernum)
|
||||
{
|
||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||
|
||||
if (cv_gamepadled[playernum].value == 0)
|
||||
{
|
||||
I_SetGamepadIndicatorColor(playernum, 0, 0, 255);
|
||||
@@ -973,13 +975,8 @@ void G_DeviceLEDTick(void)
|
||||
|
||||
newcolor = G_GetSkinColorForGamepad(i);
|
||||
|
||||
// compiler be absolutely tripping
|
||||
// delet this if this gets fixed within gcc
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
if (curcolor[i] == newcolor) // dont update if same colour
|
||||
continue;
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
G_SetPlayerGamepadIndicatorColor(i, newcolor);
|
||||
curcolor[i] = newcolor;
|
||||
@@ -994,6 +991,7 @@ void G_ResetDeviceLED(void)
|
||||
|
||||
static void G_ResetPlayerDeviceRumble(INT32 playernum)
|
||||
{
|
||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||
I_GamepadRumble(playernum, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
+21
-24
@@ -101,7 +101,8 @@ sector_t *gl_backsector = NULL;
|
||||
static constexpr float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f};
|
||||
// values for bsp culling
|
||||
// slightly higher than the far clipping plane to compensate for impreciseness
|
||||
static constexpr INT32 bsp_culling_distances[] = {(1024+512)*FRACUNIT, (2048+512)*FRACUNIT, (4096+512)*FRACUNIT,
|
||||
static constexpr INT32 bsp_culling_distances[] = {
|
||||
(1024+512)*FRACUNIT, (2048+512)*FRACUNIT, (4096+512)*FRACUNIT,
|
||||
(6144+512)*FRACUNIT, (8192+512)*FRACUNIT, (12288+512)*FRACUNIT, (16384+512)*FRACUNIT};
|
||||
|
||||
// Performance stats
|
||||
@@ -587,15 +588,11 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
const sector_t *sec = FOFsector ? FOFsector : gl_frontsector;
|
||||
|
||||
// Get the slope pointer to simplify future code
|
||||
if (sec->f_slope && !isceiling)
|
||||
if (!isceiling && sec->f_slope)
|
||||
slope = sec->f_slope;
|
||||
else if (sec->c_slope && isceiling)
|
||||
else if (isceiling && sec->c_slope)
|
||||
slope = sec->c_slope;
|
||||
|
||||
// Set fixedheight to the slope's height from our viewpoint, if we have a slope
|
||||
if (slope)
|
||||
fixedheight = P_GetSlopeZAt(slope, viewx, viewy);
|
||||
|
||||
height = FixedToFloat(fixedheight);
|
||||
|
||||
// Allocate plane-vertex buffer if we need to
|
||||
@@ -687,18 +684,19 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
vert->s = (tempxsow * cosangf) - (tempytow * sinangf);\
|
||||
vert->t = (tempxsow * sinangf) + (tempytow * cosangf);\
|
||||
}\
|
||||
\
|
||||
if (slope)\
|
||||
{\
|
||||
fixedheight = P_GetSlopeZAt(slope, FloatToFixed((vx)), FloatToFixed((vy)));\
|
||||
height = FixedToFloat(fixedheight);\
|
||||
}\
|
||||
\
|
||||
vert->x = (vx);\
|
||||
vert->y = height;\
|
||||
vert->z = (vy);\
|
||||
\
|
||||
if (slope)\
|
||||
{\
|
||||
fixedheight = P_GetSlopeZAt(slope, FloatToFixed((vx)), FloatToFixed((vy)));\
|
||||
vert->y = FixedToFloat(fixedheight);\
|
||||
}\
|
||||
}
|
||||
for (i = 0, v3d = planeVerts; i < (INT32)nrPlaneVerts; i++,v3d++,pv++)
|
||||
for (i = 0, v3d = planeVerts; i < (INT32)nrPlaneVerts; i++,v3d++, pv++)
|
||||
SETUP3DVERT(v3d, pv->x, pv->y);
|
||||
|
||||
if (slope)
|
||||
@@ -1785,10 +1783,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
// Single sided line... Deal only with the middletexture (if one exists)
|
||||
if (gl_midtexture && gl_linedef->special != HORIZONSPECIAL) // Ignore horizon line for OGL
|
||||
{
|
||||
glTex = HWR_GetTexture(gl_midtexture, noencore);
|
||||
|
||||
fixed_t texturevpeg;
|
||||
|
||||
glTex = HWR_GetTexture(gl_midtexture, noencore);
|
||||
|
||||
// PEGGING
|
||||
if ((gl_linedef->flags & (ML_DONTPEGBOTTOM|ML_EFFECT2)) == (ML_DONTPEGBOTTOM|ML_EFFECT2))
|
||||
texturevpeg = gl_frontsector->floorheight + textureheight[gl_sidedef->midtexture] - gl_frontsector->ceilingheight + gl_sidedef->rowoffset;
|
||||
@@ -1875,8 +1873,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
//Hurdler: 3d-floors test
|
||||
if (!gl_drawing_stencil && gl_backsector && gl_frontsector->tag != gl_backsector->tag && (gl_backsector->ffloors || gl_frontsector->ffloors))
|
||||
{
|
||||
ffloor_t * rover;
|
||||
fixed_t highcut = 0, lowcut = 0;
|
||||
ffloor_t *rover;
|
||||
fixed_t highcut = 0, lowcut = 0;
|
||||
fixed_t lowcutslope = 0, highcutslope = 0;
|
||||
|
||||
// Used for height comparisons and etc across FOFs and slopes
|
||||
@@ -2947,7 +2945,7 @@ static void HWR_Subsector(size_t num)
|
||||
static sector_t tempsec; //SoM: 4/7/2000
|
||||
INT32 floorlightlevel;
|
||||
INT32 ceilinglightlevel;
|
||||
INT32 locFloorHeight, locCeilingHeight;
|
||||
INT32 locFloorHeight = 0, locCeilingHeight = 0;
|
||||
INT32 cullFloorHeight, cullCeilingHeight;
|
||||
INT32 light = 0;
|
||||
extracolormap_t *floorcolormap;
|
||||
@@ -2993,11 +2991,12 @@ static void HWR_Subsector(size_t num)
|
||||
|
||||
cullFloorHeight = P_GetSectorFloorZAt (gl_frontsector, viewx, viewy);
|
||||
cullCeilingHeight = P_GetSectorCeilingZAt(gl_frontsector, viewx, viewy);
|
||||
locFloorHeight = P_GetSectorFloorZAt (gl_frontsector, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y);
|
||||
locCeilingHeight = P_GetSectorCeilingZAt(gl_frontsector, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y);
|
||||
|
||||
if (gl_frontsector->ffloors)
|
||||
{
|
||||
locFloorHeight = P_GetSectorFloorZAt (gl_frontsector, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y);
|
||||
locCeilingHeight = P_GetSectorCeilingZAt(gl_frontsector, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y);
|
||||
|
||||
boolean anyMoved = gl_frontsector->moved;
|
||||
|
||||
if (anyMoved == false)
|
||||
@@ -3052,8 +3051,7 @@ static void HWR_Subsector(size_t num)
|
||||
{
|
||||
HWR_GetFlat(levelflats[gl_frontsector->floorpic].lumpnum, R_NoEncore(gl_frontsector, false));
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], false,
|
||||
// Hack to make things continue to work around slopes.
|
||||
locFloorHeight == cullFloorHeight ? locFloorHeight : gl_frontsector->floorheight,
|
||||
gl_frontsector->floorheight,
|
||||
// We now return you to your regularly scheduled rendering.
|
||||
PF_Occlude, floorlightlevel, levelflats[gl_frontsector->floorpic].lumpnum, NULL, 255, floorcolormap);
|
||||
}
|
||||
@@ -3068,8 +3066,7 @@ static void HWR_Subsector(size_t num)
|
||||
{
|
||||
HWR_GetFlat(levelflats[gl_frontsector->ceilingpic].lumpnum, R_NoEncore(gl_frontsector, true));
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], true,
|
||||
// Hack to make things continue to work around slopes.
|
||||
locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gl_frontsector->ceilingheight,
|
||||
gl_frontsector->ceilingheight,
|
||||
// We now return you to your regularly scheduled rendering.
|
||||
PF_Occlude, ceilinglightlevel, levelflats[gl_frontsector->ceilingpic].lumpnum, NULL, 255, ceilingcolormap);
|
||||
}
|
||||
|
||||
@@ -1508,7 +1508,7 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
else
|
||||
frame = 0;
|
||||
|
||||
gpatch = static_cast<patch_t *>(md2->glpatch);
|
||||
gpatch = (patch_t *)(md2->glpatch);
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
@@ -1516,11 +1516,11 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
((!hwrPatch->mipmap->format || !hwrPatch->mipmap->downloaded) && !md2->notexturefile))
|
||||
md2_loadTexture(md2);
|
||||
|
||||
gpatch = static_cast<patch_t *>(md2->glpatch);
|
||||
gpatch = (patch_t*)(md2->glpatch);
|
||||
if (gpatch)
|
||||
hwrPatch = ((GLPatch_t *)gpatch->hardware);
|
||||
|
||||
blendgpatch = static_cast<patch_t *>(md2->blendglpatch);
|
||||
blendgpatch = (patch_t*)(md2->blendglpatch);
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
@@ -1529,7 +1529,7 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile)))
|
||||
md2_loadBlendTexture(md2);
|
||||
|
||||
blendgpatch = static_cast<patch_t *>(md2->blendglpatch);
|
||||
blendgpatch = (patch_t*)(md2->blendglpatch);
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
|
||||
+4
-4
@@ -12,14 +12,14 @@
|
||||
#ifndef __M_EMOTES__
|
||||
#define __M_EMOTES__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "m_fixed.h"
|
||||
#include "command.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_emotes;
|
||||
|
||||
#define MAXEMOTENAME 32
|
||||
|
||||
+57
-57
@@ -7902,7 +7902,7 @@ static void M_HandleConnectIP(INT32 choice)
|
||||
if (exitmenu)
|
||||
{
|
||||
if (currentMenu->prevMenu)
|
||||
M_SetupNextMenu (currentMenu->prevMenu);
|
||||
M_SetupNextMenu(currentMenu->prevMenu);
|
||||
else
|
||||
M_ClearMenus(true);
|
||||
}
|
||||
@@ -8271,10 +8271,9 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
INT32 curx = (((setupm_skinselect % SKINGRIDNEWWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDNEWWIDTH/2)) + SKINXSHIFT) + 20;
|
||||
INT32 cury = (((setupm_skinselect / SKINGRIDNEWWIDTH) - setupm_skinypos) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDNEWWIDTH/2))+ gridyoffset);
|
||||
|
||||
UINT8 cursorframe = (I_GetTime() / 4) % 7;
|
||||
|
||||
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
|
||||
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
|
||||
UINT8 cursorframe = (I_GetTime() / 4) % 7;
|
||||
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
|
||||
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -8313,14 +8312,12 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
if (setupm_skinselect < numskins)
|
||||
{
|
||||
UINT8 *cmap = R_GetTranslationColormap(setupm_skinselect, setupm_fakecolor, GTC_MENUCACHE);
|
||||
|
||||
cursor = facewantprefix[skinsorted[setupm_skinselect]];
|
||||
V_DrawFixedPatch(((curx-8) << FRACBITS), ((cury-8) << FRACBITS), FRACUNIT, 0, cursor, cmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 cursorframe = (I_GetTime() / 4) % 7;
|
||||
|
||||
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
|
||||
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
|
||||
}
|
||||
@@ -8384,7 +8381,6 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
else
|
||||
{
|
||||
UINT8 cursorframe = (I_GetTime() / 4) % 7;
|
||||
|
||||
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
|
||||
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
|
||||
}
|
||||
@@ -8509,7 +8505,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
switch (cv_skinselectmenu.value)
|
||||
{
|
||||
case SKINMENUTYPE_2D:
|
||||
skintodisplay = setupm_fakeskin;
|
||||
skintodisplay = (UINT8)setupm_fakeskin;
|
||||
if (setupm_skinlockedselect) // show the skin we are trying to select
|
||||
skintodisplay = skinstats[setupm_skinxpos][setupm_skinypos][setupm_skinselect];
|
||||
else if (skinstatscount[setupm_skinxpos][setupm_skinypos] && itemOn == 1)
|
||||
@@ -8517,13 +8513,16 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
break;
|
||||
case SKINMENUTYPE_EXTENDED:
|
||||
case SKINMENUTYPE_GRID:
|
||||
skintodisplay = (itemOn == 1 && setupm_skinselect < numskins ? skinsorted[setupm_skinselect] : setupm_fakeskin);
|
||||
skintodisplay = ((itemOn == 1 && (setupm_skinselect < numskins)) ? skinsorted[setupm_skinselect] : (UINT8)setupm_fakeskin);
|
||||
break;
|
||||
default:
|
||||
skintodisplay = setupm_fakeskin;
|
||||
skintodisplay = (UINT8)setupm_fakeskin;
|
||||
break;
|
||||
}
|
||||
|
||||
if (skintodisplay >= MAXSKINS)
|
||||
skintodisplay = 0;
|
||||
|
||||
skinnum = R_SkinAvailable(skins[skintodisplay].name);
|
||||
|
||||
if (skinnum < 0 || skinnum >= MAXSKINS)
|
||||
@@ -8538,18 +8537,6 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
if (frame >= sprdef->numframes) // Walking animation missing
|
||||
frame = 0; // Try to use standing frame
|
||||
|
||||
sprframe = &sprdef->spriteframes[frame];
|
||||
|
||||
// minenice's speen css, it's a piece of shit but hey
|
||||
speenframe = (I_GetTime()*cv_skinselectspin.value/TICRATE + 1)%8;
|
||||
|
||||
// this is a very shitty solution for checking if a sprite needs flipping
|
||||
// but it works
|
||||
if ((speenframe > 4) && (sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe]))
|
||||
flags = V_FLIP; // This sprite is left/right flipped!
|
||||
|
||||
patch = (patch_t *)W_CachePatchNum(sprframe->lumppat[speenframe], PU_PATCH);
|
||||
|
||||
// draw box around guy
|
||||
V_DrawFill(mx + 36 - (charw/2), my+65, charw, 84, 239);
|
||||
#undef charw
|
||||
@@ -8560,33 +8547,47 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
UINT8 *colormap = R_GetTranslationColormap(skintodisplay, setupm_fakecolor, GTC_MENUCACHE);
|
||||
#ifdef HWRENDER
|
||||
md2_t *md2 = &md2_playermodels[skinnum];
|
||||
|
||||
#endif
|
||||
mx += 36;
|
||||
my += 131;
|
||||
#ifdef HWRENDER
|
||||
// if we have 3d models enabled and a model exists
|
||||
// try to show it instead of the sprite
|
||||
if (rendermode == render_opengl && cv_glmdls.value
|
||||
&& !md2->error && !md2->notfound)
|
||||
{
|
||||
mx += 36;
|
||||
my += 131;
|
||||
|
||||
const angle_t ROTATE_PER_TIC = (UINT64)ANGLE_45 * cv_skinselectspin.value / TICRATE;
|
||||
|
||||
angle_t angle = I_GetTime()*ROTATE_PER_TIC + FixedMul(cv_uncappedhud.value ? renderdeltatics : FRACUNIT, ROTATE_PER_TIC);
|
||||
|
||||
HWR_Draw2DModel(md2, mx, my, skinnum, (skincolors_t)setupm_fakecolor, colormap, 8*FRACUNIT/3, frame, angle);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sprframe = &sprdef->spriteframes[frame];
|
||||
|
||||
// minenice's speen css, it's a piece of shit but hey
|
||||
speenframe = (I_GetTime()*cv_skinselectspin.value/TICRATE + 1)%8;
|
||||
|
||||
// this is a very shitty solution for checking if a sprite needs flipping
|
||||
// but it works
|
||||
if ((speenframe > 4) && (sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe]))
|
||||
{
|
||||
flags = V_FLIP; // This sprite is left/right flipped!
|
||||
}
|
||||
|
||||
patch = (patch_t *)W_CachePatchNum(sprframe->lumppat[speenframe], PU_PATCH);
|
||||
|
||||
if (skins[skintodisplay].flags & SF_HIRES)
|
||||
{
|
||||
V_DrawFixedPatch((mx+36)<<FRACBITS,
|
||||
(my+131)<<FRACBITS,
|
||||
skins[skintodisplay].highresscale,
|
||||
flags, patch, colormap);
|
||||
V_DrawFixedPatch(mx<<FRACBITS,
|
||||
my<<FRACBITS,
|
||||
skins[skintodisplay].highresscale,
|
||||
flags, patch, colormap);
|
||||
}
|
||||
else
|
||||
V_DrawMappedPatch(mx+36, my+131, flags, patch, colormap);
|
||||
{
|
||||
V_DrawMappedPatch(mx, my, flags, patch, colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9889,7 +9890,7 @@ static void M_DrawLocalSkinMenu(void)
|
||||
spriteframe_t *sprframe;
|
||||
patch_t *patch;
|
||||
UINT8 frame;
|
||||
INT16 skintodisplay;
|
||||
INT32 skintodisplay = 0;
|
||||
UINT32 speenframe;
|
||||
skin_t displayskin;
|
||||
|
||||
@@ -9942,25 +9943,10 @@ static void M_DrawLocalSkinMenu(void)
|
||||
if (frame >= sprdef->numframes) // Walking animation missing
|
||||
frame = 0; // Try to use standing frame
|
||||
|
||||
sprframe = &sprdef->spriteframes[frame];
|
||||
|
||||
//minenice's speen css, it's a piece of shit but hey
|
||||
//patch = (patch_t *)W_CachePatchNum(sprframe->lumppat[1], PU_PATCH);
|
||||
speenframe = (I_GetTime()*cv_skinselectspin.value/TICRATE + 1)%8;
|
||||
|
||||
//this is a very shitty solution for checking if a sprite needs flipping
|
||||
//but it works
|
||||
if ((speenframe > 4) && (sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe]))
|
||||
{
|
||||
flags = V_FLIP; // This sprite is left/right flipped!
|
||||
}
|
||||
patch = (patch_t *)W_CachePatchNum(sprframe->lumppat[speenframe], PU_PATCH);
|
||||
|
||||
// draw box around guy
|
||||
V_DrawFill(mx + 220 - (charw/2), my+54, charw, 84, 239);
|
||||
#undef charw
|
||||
|
||||
// draw player sprite
|
||||
UINT8 *colormap = R_GetLocalTranslationColormap(&skins[displayskin.localnum], (displayskin.localskin ? &localskins[displayskin.localnum] : NULL), cv_playercolor.value, GTC_MENUCACHE, displayskin.localskin);
|
||||
|
||||
V_DrawMappedPatch(mx, my+50, 0, (patch_t *)W_CachePatchName(displayskin.facewant, PU_PATCH), colormap);
|
||||
@@ -9974,6 +9960,9 @@ static void M_DrawLocalSkinMenu(void)
|
||||
V_DrawString(mx+20, my+118, V_ALLOWLOWERCASE|highlightflags, displayskin.realname);
|
||||
|
||||
// draw player sprite
|
||||
mx += 220;
|
||||
my += 120;
|
||||
|
||||
#ifdef HWRENDER
|
||||
md2_t *md2 = (displayskin.localskin ? &md2_localplayermodels[skintodisplay] : &md2_playermodels[skintodisplay]);
|
||||
|
||||
@@ -9982,24 +9971,35 @@ static void M_DrawLocalSkinMenu(void)
|
||||
if (rendermode == render_opengl && cv_glmdls.value
|
||||
&& !md2->error && !md2->notfound)
|
||||
{
|
||||
mx += 220;
|
||||
my += 120;
|
||||
|
||||
const angle_t ROTATE_PER_TIC = (UINT64)ANGLE_45 * cv_skinselectspin.value / TICRATE;
|
||||
|
||||
angle_t angle = I_GetTime()*ROTATE_PER_TIC + FixedMul(cv_uncappedhud.value ? renderdeltatics : FRACUNIT, ROTATE_PER_TIC);
|
||||
|
||||
HWR_Draw2DModel(md2, mx, my, skintodisplay, (skincolors_t)cv_playercolor.value, colormap, 8*FRACUNIT/3, frame, angle);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sprframe = &sprdef->spriteframes[frame];
|
||||
|
||||
// minenice's speen css, it's a piece of shit but hey
|
||||
speenframe = (I_GetTime()*cv_skinselectspin.value/TICRATE + 1)%8;
|
||||
|
||||
// this is a very shitty solution for checking if a sprite needs flipping
|
||||
// but it works
|
||||
if ((speenframe > 4) && (sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe]))
|
||||
{
|
||||
flags = V_FLIP; // This sprite is left/right flipped!
|
||||
}
|
||||
|
||||
patch = (patch_t *)W_CachePatchNum(sprframe->lumppat[speenframe], PU_PATCH);
|
||||
|
||||
if (displayskin.flags & SF_HIRES)
|
||||
{
|
||||
V_DrawFixedPatch((mx+220)<<FRACBITS, (my+120)<<FRACBITS, displayskin.highresscale, flags, patch, colormap);
|
||||
V_DrawFixedPatch(mx<<FRACBITS, my<<FRACBITS, displayskin.highresscale, flags, patch, colormap);
|
||||
}
|
||||
else
|
||||
V_DrawMappedPatch(mx+220, my+120, flags, patch, colormap);
|
||||
{
|
||||
V_DrawMappedPatch(mx, my, flags, patch, colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-16
@@ -1633,33 +1633,34 @@ static menuitem_t OP_AccessibilityMenu[] =
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Saturation", &cv_globalsaturation, 25},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Video Color Settings...", &OP_ColorOptionsDef, 30},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Midnight Channel Flicker", &cv_lessflicker, 35},
|
||||
{IT_STRING|IT_CVAR, NULL, "Reduce Effects", &cv_reducevfx, 35},
|
||||
{IT_STRING|IT_CVAR, NULL, "Midnight Channel Flicker", &cv_lessflicker, 40}, // obsolete now? or still better be a seperate toggle?
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Minimum Sector Brightness", &cv_secbright, 40},
|
||||
{IT_STRING|IT_CVAR, NULL, "Minimum Sector Brightness", &cv_secbright, 45},
|
||||
|
||||
#ifdef HWRENDER
|
||||
{IT_STRING|IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 45},
|
||||
{IT_STRING|IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 50},
|
||||
#endif
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Water Surface Ripples", &cv_ripplewater, 50},
|
||||
{IT_STRING|IT_CVAR, NULL, "Water Surface Ripples", &cv_ripplewater, 55},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Fade Players near Camera", &cv_playerfade, 55},
|
||||
{IT_STRING|IT_CVAR, NULL, "Fade Players near Camera", &cv_playerfade, 60},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Quake Screenshakes", &cv_screenquake, 60},
|
||||
{IT_STRING|IT_CVAR, NULL, "Quake Screenshakes", &cv_screenquake, 65},
|
||||
|
||||
{IT_CALL|IT_STRING, NULL, "Camera Options...", M_CameraMenu, 65},
|
||||
{IT_CALL|IT_STRING, NULL, "Camera Options...", M_CameraMenu, 70},
|
||||
|
||||
{IT_HEADER, NULL, "Audio", NULL, 75},
|
||||
{IT_HEADER, NULL, "Audio", NULL, 80},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 85},
|
||||
{IT_STRING|IT_CVAR, NULL, "Same Sound Limit", &cv_samesoundlimit, 90},
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 90},
|
||||
{IT_STRING|IT_CVAR, NULL, "Same Sound Limit", &cv_samesoundlimit, 95},
|
||||
|
||||
{IT_HEADER, NULL, "Controls", NULL, 100},
|
||||
{IT_HEADER, NULL, "Controls", NULL, 105},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P1)", &cv_autoaccel[0], 110},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P2)", &cv_autoaccel[1], 115},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P3)", &cv_autoaccel[2], 120},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P4)", &cv_autoaccel[3], 125},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P1)", &cv_autoaccel[0], 115},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P2)", &cv_autoaccel[1], 120},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P3)", &cv_autoaccel[2], 125},
|
||||
{IT_STRING|IT_CVAR, NULL, "Automatic Acceleration (P4)", &cv_autoaccel[3], 130},
|
||||
};
|
||||
|
||||
static const char* OP_AccessibilityTooltips[] =
|
||||
@@ -1669,10 +1670,11 @@ static const char* OP_AccessibilityTooltips[] =
|
||||
"Gamma (brightness) of the game.",
|
||||
"Saturation of the game.",
|
||||
"Advanced color settings of the game.",
|
||||
"Reduces or disables certain effects players might be sensitive to\nSuch as flashing, flickering, certain screen effects and more.",
|
||||
"Disables the flicker effect on Midnight Channel.",
|
||||
"Sets minimum sector brightness, useful for dark areas",
|
||||
#ifdef HWRENDER
|
||||
"Should the game do Screen Textures? Provides a good boost to frames\nat the cost of some visual effects not working when disabled.",
|
||||
"Disabling Screen Textures will disable the Underwater and Heat screen effects.",
|
||||
#endif
|
||||
"Toggles the ripple effect on water surfaces",
|
||||
"Fades other Players that are close to the camera in and out",
|
||||
|
||||
+4
-4
@@ -14,10 +14,6 @@
|
||||
#ifndef __P_LOCAL__
|
||||
#define __P_LOCAL__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "command.h"
|
||||
#include "d_player.h"
|
||||
#include "d_think.h"
|
||||
@@ -28,6 +24,10 @@ extern "C" {
|
||||
#include "p_maputl.h"
|
||||
#include "doomstat.h" // MAXSPLITSCREENPLAYERS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FLOATSPEED (FRACUNIT*4)
|
||||
|
||||
//#define VIEWHEIGHTS "41"
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern tic_t leveltime;
|
||||
|
||||
// Called by G_Ticker. Carries out all thinking of enemies and players.
|
||||
@@ -38,6 +42,10 @@ mobj_t *P_SetTarget2(mobj_t **mo, mobj_t *target
|
||||
#endif
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PARANOIA
|
||||
#define P_SetTarget(...) P_SetTarget2(__VA_ARGS__, __FILE__, __LINE__)
|
||||
#else
|
||||
|
||||
+4
-4
@@ -15,16 +15,16 @@
|
||||
#ifndef __R_FPS_H__
|
||||
#define __R_FPS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "m_fixed.h"
|
||||
#include "p_local.h"
|
||||
#include "r_state.h"
|
||||
#include "r_things.h"
|
||||
#include "m_perfstats.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_fpscap, cv_fpscapbg;
|
||||
|
||||
extern ps_metric_t ps_interp_frac;
|
||||
|
||||
+4
-4
@@ -14,14 +14,14 @@
|
||||
#ifndef __R_MAIN__
|
||||
#define __R_MAIN__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "d_player.h"
|
||||
#include "r_data.h"
|
||||
#include "m_perfstats.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// POV related.
|
||||
//
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "r_local.h"
|
||||
#include "r_sky.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "r_portal.h"
|
||||
#include "r_splats.h"
|
||||
#include "r_fps.h" // newview
|
||||
|
||||
@@ -32,7 +32,7 @@ set(SRB2_SDL2_SOURCES
|
||||
hwsym_sdl.c
|
||||
i_main.c
|
||||
i_net.c
|
||||
i_system.c
|
||||
i_system.cpp
|
||||
i_ttf.c
|
||||
i_video.c
|
||||
i_threads.c
|
||||
@@ -123,8 +123,6 @@ if(${SDL2_FOUND})
|
||||
set(MACOSX_BUNDLE_ICON_FILE Srb2mac.icns)
|
||||
set_source_files_properties(macosx/Srb2mac.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set(SRB2_SDL2_MAC_SOURCES
|
||||
macosx/mac_alert.c
|
||||
macosx/mac_alert.h
|
||||
macosx/mac_resources.c
|
||||
macosx/mac_resources.h
|
||||
macosx/Srb2mac.icns
|
||||
@@ -167,10 +165,16 @@ if(${SDL2_FOUND})
|
||||
${DISCORDRPC_LIBRARIES}
|
||||
)
|
||||
|
||||
if(${SRB2_HAVE_LIBBACKTRACE})
|
||||
target_link_libraries(SRB2SDL2 PRIVATE ${LIBBACKTRACE_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES Linux)
|
||||
target_link_libraries(SRB2SDL2 PRIVATE
|
||||
m
|
||||
rt
|
||||
pthread
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
+111
-69
@@ -31,6 +31,10 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
@@ -201,10 +205,6 @@ static char returnWadPath[256];
|
||||
|
||||
#include "../s_sound.h"
|
||||
|
||||
#ifdef MAC_ALERT
|
||||
#include "macosx/mac_alert.h"
|
||||
#endif
|
||||
|
||||
#include "../d_main.h"
|
||||
|
||||
#if !defined(NOMUMBLE) && defined(HAVE_MUMBLE)
|
||||
@@ -727,12 +727,11 @@ static void JoyReset(SDLJoyInfo_t *JoySet)
|
||||
JoySet->dev = NULL;
|
||||
JoySet->oldjoy = -1;
|
||||
JoySet->id = -1;
|
||||
JoySet->axises = JoySet->buttons = JoySet->hats = JoySet->balls = 0;
|
||||
}
|
||||
|
||||
/** \brief SDL info about joystick
|
||||
*/
|
||||
SDLJoyInfo_t JoyInfo[MAXSPLITSCREENPLAYERS];
|
||||
SDLJoyInfo_t JoyInfo[MAXSPLITSCREENPLAYERS] = {};
|
||||
INT32 numcontrollers = 0;
|
||||
|
||||
//
|
||||
@@ -740,26 +739,26 @@ INT32 numcontrollers = 0;
|
||||
//
|
||||
void I_JoyScale(void)
|
||||
{
|
||||
Joystick[0].bGamepadStyle = cv_joyscale[0].value==0;
|
||||
JoyInfo[0].scale = Joystick[0].bGamepadStyle?1:cv_joyscale[0].value;
|
||||
Joystick[0].bGamepadStyle = cv_joyscale[0].value == 0;
|
||||
JoyInfo[0].scale = Joystick[0].bGamepadStyle ? 1 : cv_joyscale[0].value;
|
||||
}
|
||||
|
||||
void I_JoyScale2(void)
|
||||
{
|
||||
Joystick[1].bGamepadStyle = cv_joyscale[1].value==0;
|
||||
JoyInfo[1].scale = Joystick[1].bGamepadStyle?1:cv_joyscale[1].value;
|
||||
Joystick[1].bGamepadStyle = cv_joyscale[1].value == 0;
|
||||
JoyInfo[1].scale = Joystick[1].bGamepadStyle ? 1 : cv_joyscale[1].value;
|
||||
}
|
||||
|
||||
void I_JoyScale3(void)
|
||||
{
|
||||
Joystick[2].bGamepadStyle = cv_joyscale[2].value==0;
|
||||
JoyInfo[2].scale = Joystick[2].bGamepadStyle?1:cv_joyscale[2].value;
|
||||
Joystick[2].bGamepadStyle = cv_joyscale[2].value == 0;
|
||||
JoyInfo[2].scale = Joystick[2].bGamepadStyle ? 1 : cv_joyscale[2].value;
|
||||
}
|
||||
|
||||
void I_JoyScale4(void)
|
||||
{
|
||||
Joystick[3].bGamepadStyle = cv_joyscale[3].value==0;
|
||||
JoyInfo[3].scale = Joystick[3].bGamepadStyle?1:cv_joyscale[3].value;
|
||||
Joystick[3].bGamepadStyle = cv_joyscale[3].value == 0;
|
||||
JoyInfo[3].scale = Joystick[3].bGamepadStyle ? 1 : cv_joyscale[3].value;
|
||||
}
|
||||
|
||||
// Cheat to get the device index for a joystick handle
|
||||
@@ -931,33 +930,18 @@ static int joy_open(int playerIndex, int joyIndex)
|
||||
}
|
||||
|
||||
JoyInfo[playerIndex].dev = newdev;
|
||||
JoyInfo[playerIndex].id = I_GetJoystickDeviceIndex(JoyInfo[playerIndex].dev);
|
||||
|
||||
if (JoyInfo[playerIndex].dev == NULL)
|
||||
{
|
||||
CONS_Debug(DBG_GAMELOGIC, M_GetText("Joystick1: Couldn't open device - %s\n"), SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Debug(DBG_GAMELOGIC, M_GetText("Joystick1: %s\n"), SDL_GameControllerName(JoyInfo[playerIndex].dev));
|
||||
JoyInfo[playerIndex].axises = SDL_CONTROLLER_AXIS_MAX;
|
||||
|
||||
if (JoyInfo[playerIndex].axises > JOYAXISSET*2)
|
||||
JoyInfo[playerIndex].axises = JOYAXISSET*2;
|
||||
CONS_Debug(DBG_GAMELOGIC, M_GetText("Joystick1: %s\n"), SDL_GameControllerName(JoyInfo[playerIndex].dev));
|
||||
|
||||
JoyInfo[playerIndex].buttons = SDL_CONTROLLER_BUTTON_MAX ; // dpad is 4 buttons
|
||||
if (JoyInfo[playerIndex].buttons > JOYBUTTONS)
|
||||
JoyInfo[playerIndex].buttons = JOYBUTTONS;
|
||||
JoyInfo[playerIndex].id = I_GetJoystickDeviceIndex(JoyInfo[playerIndex].dev);
|
||||
|
||||
JoyInfo[playerIndex].hats = 4;
|
||||
if (JoyInfo[playerIndex].hats > JOYHATS)
|
||||
JoyInfo[playerIndex].hats = JOYHATS;
|
||||
|
||||
JoyInfo[playerIndex].balls = 0;
|
||||
|
||||
return JoyInfo[playerIndex].axises;
|
||||
}
|
||||
return SDL_CONTROLLER_AXIS_MAX;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1002,7 +986,6 @@ void I_InitJoystick(UINT8 index)
|
||||
JoyInfo[index].dev = NULL;
|
||||
JoyInfo[index].oldjoy = -1;
|
||||
JoyInfo[index].id = -1;
|
||||
JoyInfo[index].axises = JoyInfo[index].buttons = JoyInfo[index].hats = JoyInfo[index].balls = 0;
|
||||
|
||||
if (cv_usejoystick[index].value)
|
||||
newcontroller = SDL_GameControllerOpen(cv_usejoystick[index].value-1);
|
||||
@@ -1386,7 +1369,7 @@ void I_SleepDuration(precise_t duration)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg);
|
||||
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg, char *signal_ttl);
|
||||
|
||||
#ifdef HAVE_LIBBACKTRACE
|
||||
#include <backtrace.h>
|
||||
@@ -1482,6 +1465,7 @@ static void bt_error_cb(void *data, const char *msg, int errnum)
|
||||
static void write_backtrace(bt_crash_reason_t reason)
|
||||
{
|
||||
char sig_msg[512];
|
||||
char sig_name[128];
|
||||
const char *filename = va("%s" PATHSEP CRASH_LOGFILE_NAME, srb2home);
|
||||
FILE *out = fopen(filename, "a+");
|
||||
|
||||
@@ -1538,8 +1522,8 @@ static void write_backtrace(bt_crash_reason_t reason)
|
||||
switch (reason.type)
|
||||
{
|
||||
case BTCRASH_SIGNAL:
|
||||
I_PrintSignal(reason.value.signal, false, sig_msg);
|
||||
fprintf(out, "%s", sig_msg);
|
||||
I_PrintSignal(reason.value.signal, false, sig_msg, sig_name);
|
||||
fprintf(out, "%s - %s", sig_name, sig_msg);
|
||||
break;
|
||||
|
||||
case BTCRASH_ERRORMSG:
|
||||
@@ -1575,42 +1559,49 @@ static std::thread::id g_main_thread_id;
|
||||
|
||||
boolean g_in_exiting_signal_handler = false;
|
||||
|
||||
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg)
|
||||
static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_msg, char *signal_name)
|
||||
{
|
||||
const char *sigmsg;
|
||||
const char *sigmsg, *signame;
|
||||
|
||||
switch (signal_num)
|
||||
{
|
||||
#ifdef SIGINT
|
||||
case SIGINT:
|
||||
sigmsg = ("SIGINT - SRB2Kart-Saturn was interrupted prematurely by the user.");
|
||||
sigmsg = ("SRB2Kart-Saturn was interrupted prematurely by the user.");
|
||||
signame = "SIGINT";
|
||||
break;
|
||||
#endif
|
||||
case SIGILL: // illegal instruction - invalid function image
|
||||
sigmsg = ("SIGILL - SRB2Kart-Saturn has attempted to execute an illegal instruction and needs to close.");
|
||||
sigmsg = ("SRB2Kart-Saturn has attempted to execute an illegal instruction and needs to close.");
|
||||
signame = "SIGILL";
|
||||
break;
|
||||
case SIGFPE: // mathematical exception
|
||||
sigmsg = ("SIGFPE - SRB2Kart-Saturn has encountered a mathematical exception and needs to close.");
|
||||
sigmsg = ("SRB2Kart-Saturn has encountered a mathematical exception and needs to close.");
|
||||
signame = "SIGFPE";
|
||||
break;
|
||||
case SIGSEGV: // segment violation
|
||||
sigmsg = ("SIGSEGV - SRB2Kart-Saturn has attempted to access a memory location that it shouldn't and needs to close.");
|
||||
sigmsg = ("SRB2Kart-Saturn has attempted to access a memory location that it shouldn't and needs to close.");
|
||||
signame = "SIGSEGV";
|
||||
break;
|
||||
#ifdef SIGTERM
|
||||
case SIGTERM: // Software termination signal from kill
|
||||
sigmsg = ("SIGTERM - SRB2Kart-Saturn was terminated by a kill signal.");
|
||||
sigmsg = ("SRB2Kart-Saturn was terminated by a kill signal.");
|
||||
signame = "SIGTERM";
|
||||
break;
|
||||
#endif
|
||||
#ifdef SIGBREAK
|
||||
case SIGBREAK: // Ctrl-Break sequence
|
||||
sigmsg =("SIGBREAK - SRB2Kart-Saturn was terminated by a Ctrl-Break sequence.");
|
||||
signame = "SIGBREAK";
|
||||
break;
|
||||
#endif
|
||||
case SIGABRT: // abnormal termination triggered by abort call
|
||||
sigmsg = ("SIGABRT - SRB2Kart-Saturn was terminated by an abort signal.");
|
||||
sigmsg = ("SRB2Kart-Saturn was terminated by an abort signal.");
|
||||
signame = "SIGABRT";
|
||||
break;
|
||||
default:
|
||||
sprintf(signal_msg, "Signal number %d", signal_num);
|
||||
sigmsg = (core_dumped ? "Unknown signal" : signal_msg);
|
||||
sigmsg = "SRB2Kart-Saturn was terminated by an unknown signal.";
|
||||
signame = core_dumped ? "Unknown signal" : va("Signal number %d", signal_num);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1625,18 +1616,80 @@ static void I_PrintSignal(INT32 signal_num, boolean core_dumped, char *signal_ms
|
||||
{
|
||||
sprintf(signal_msg, "%s", sigmsg);
|
||||
}
|
||||
|
||||
sprintf(signal_name, "%s", signame);
|
||||
}
|
||||
|
||||
static int I_OpenURL(const char *url)
|
||||
{
|
||||
#if SDL_VERSION_ATLEAST(2,0,14)
|
||||
return SDL_OpenURL(va("%s", url));
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void I_ShowErrorBox(const char *title, const char *msg)
|
||||
{
|
||||
if (M_CheckParm("-dedicated"))
|
||||
return;
|
||||
|
||||
const char *reportmsg = "\n\n\nTo help us figure out the cause, please report the issue to our github page with " CRASH_LOGFILE_NAME " attached.\n\nSorry for the inconvenience!";
|
||||
|
||||
const SDL_MessageBoxButtonData buttons[] = {
|
||||
{ SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 0, "OK" },
|
||||
{ 0, 1, "Report Issue" },
|
||||
};
|
||||
|
||||
const SDL_MessageBoxData messageboxdata = {
|
||||
SDL_MESSAGEBOX_ERROR, /* .flags */
|
||||
NULL, /* .window */
|
||||
title, /* .title */
|
||||
va("%s %s", msg, reportmsg), /* .message */
|
||||
SDL_arraysize(buttons), /* .numbuttons */
|
||||
buttons, /* .buttons */
|
||||
NULL /* .colorScheme */
|
||||
};
|
||||
|
||||
int buttonid;
|
||||
|
||||
SDL_ShowMessageBox(&messageboxdata, &buttonid);
|
||||
|
||||
if (buttonid == 1)
|
||||
I_OpenURL("https://github.com/Indev450/SRB2Kart-Saturn/issues");
|
||||
}
|
||||
|
||||
static void I_ShowSimpleErrorBox(const char *title, char *msg)
|
||||
{
|
||||
if (M_CheckParm("-dedicated"))
|
||||
return;
|
||||
|
||||
// Implement message box with SDL_ShowSimpleMessageBox,
|
||||
// which should fail gracefully if it can't put a message box up
|
||||
// on the target system
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, msg, NULL);
|
||||
// Note that SDL_ShowSimpleMessageBox does *not* require SDL to be
|
||||
// initialized at the time, so calling it after SDL_Quit() is
|
||||
// perfectly okay! In addition, we do this on purpose so the
|
||||
// fullscreen window is closed before displaying the error message
|
||||
// in case the fullscreen window blocks it for some absurd reason.
|
||||
}
|
||||
|
||||
static void I_ReportSignal(int num, int coredumped)
|
||||
{
|
||||
char sigmsg[512];
|
||||
char signame[128];
|
||||
char sigttl[512] = "Process killed by signal: ";
|
||||
|
||||
I_PrintSignal(num, coredumped, sigmsg);
|
||||
I_PrintSignal(num, coredumped, sigmsg, signame);
|
||||
|
||||
size_t len = strlen(sigmsg);
|
||||
snprintf(sigmsg + len, sizeof(sigmsg) - len, "\n\nCrash report has been saved into %s", CRASH_LOGFILE_NAME);
|
||||
I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Process killed by signal", sigmsg, NULL);
|
||||
|
||||
strcat(sigttl, signame);
|
||||
I_OutputMsg("\n%s\n\n", sigttl);
|
||||
//I_ShowSimpleErrorBox(sigttl, sigmsg);
|
||||
I_ShowErrorBox(sigttl, sigmsg);
|
||||
}
|
||||
|
||||
#ifndef NEWSIGNALHANDLER
|
||||
@@ -1744,10 +1797,7 @@ FUNCNORETURN static ATTRNORETURN void newsignalhandler_Warn(const char *pr)
|
||||
);
|
||||
|
||||
I_OutputMsg("%s\n", text);
|
||||
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
|
||||
"Startup error",
|
||||
text, NULL);
|
||||
I_ShowSimpleErrorBox("Startup error", text);
|
||||
|
||||
I_ShutdownConsole();
|
||||
exit(-1);
|
||||
@@ -1909,6 +1959,7 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char buffer[8192];
|
||||
const char *sigttl = "";
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
if (std::this_thread::get_id() != g_main_thread_id)
|
||||
@@ -1945,12 +1996,9 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
va_start(argptr, error);
|
||||
vsnprintf(buffer, 8192, error, argptr);
|
||||
va_end(argptr);
|
||||
// Implement message box with SDL_ShowSimpleMessageBox,
|
||||
// which should fail gracefully if it can't put a message box up
|
||||
// on the target system
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
|
||||
"SRB2Kart " VERSIONSTRING " Recursive Error",
|
||||
buffer, NULL);
|
||||
|
||||
sigttl = "SRB2Kart " VERSIONSTRING " Recursive Error";
|
||||
I_ShowSimpleErrorBox(sigttl, buffer);
|
||||
|
||||
W_Shutdown();
|
||||
exit(-1); // recursive errors detected
|
||||
@@ -1990,15 +2038,9 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
I_ShutdownSystem();
|
||||
SDL_Quit();
|
||||
|
||||
// Implement message box with SDL_ShowSimpleMessageBox,
|
||||
// which should fail gracefully if it can't put a message box up
|
||||
// on the target system
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "SRB2Kart " VERSIONSTRING " Error", buffer, NULL);
|
||||
// Note that SDL_ShowSimpleMessageBox does *not* require SDL to be
|
||||
// initialized at the time, so calling it after SDL_Quit() is
|
||||
// perfectly okay! In addition, we do this on purpose so the
|
||||
// fullscreen window is closed before displaying the error message
|
||||
// in case the fullscreen window blocks it for some absurd reason.
|
||||
sigttl = "SRB2Kart " VERSIONSTRING " Error";
|
||||
//I_ShowSimpleErrorBox(sigttl, buffer);
|
||||
I_ShowErrorBox(sigttl, buffer);
|
||||
|
||||
W_Shutdown();
|
||||
|
||||
@@ -2424,7 +2466,7 @@ static const char *locateWad(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *I_LocateWad(void)
|
||||
extern "C" const char *I_LocateWad(void)
|
||||
{
|
||||
const char *waddir = NULL;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
/// \file i_threads.c
|
||||
/// \brief Multithreading abstraction
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
|
||||
#include "../doomdef.h"
|
||||
#include "../i_threads.h"
|
||||
|
||||
@@ -354,3 +356,5 @@ I_wake_all_cond (
|
||||
if (SDL_CondBroadcast(cond) == -1)
|
||||
abort();
|
||||
}
|
||||
|
||||
#endif // HAVE_THREADS
|
||||
+1
-1
@@ -467,7 +467,7 @@ static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which)
|
||||
}
|
||||
else
|
||||
{
|
||||
raxis = JoyInfo[pid].scale!=1?((raxis/JoyInfo[pid].scale)*JoyInfo[pid].scale):raxis;
|
||||
raxis = JoyInfo[pid].scale != 1 ? ((raxis/JoyInfo[pid].scale)*JoyInfo[pid].scale) : raxis;
|
||||
|
||||
#ifdef SDL_JDEADZONE
|
||||
if (-SDL_JDEADZONE <= raxis && raxis <= SDL_JDEADZONE)
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Portions 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 Graphical Alerts for MacOSX
|
||||
///
|
||||
/// Shows alerts, since we can't just print these to the screen when
|
||||
/// launched graphically on a mac.
|
||||
|
||||
#ifdef __APPLE_CC__
|
||||
|
||||
#include "mac_alert.h"
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#define CFSTRINGIFY(x) CFStringCreateWithCString(NULL, x, kCFStringEncodingASCII)
|
||||
|
||||
int MacShowAlert(const char *title, const char *message, const char *button1, const char *button2, const char *button3)
|
||||
{
|
||||
CFOptionFlags results;
|
||||
|
||||
CFStringRef cf_title = CFSTRINGIFY(title);
|
||||
CFStringRef cf_message = CFSTRINGIFY(message);
|
||||
CFStringRef cf_button1 = NULL;
|
||||
CFStringRef cf_button2 = NULL;
|
||||
CFStringRef cf_button3 = NULL;
|
||||
|
||||
if (button1 != NULL)
|
||||
cf_button1 = CFSTRINGIFY(button1);
|
||||
if (button2 != NULL)
|
||||
cf_button2 = CFSTRINGIFY(button2);
|
||||
if (button3 != NULL)
|
||||
cf_button3 = CFSTRINGIFY(button3);
|
||||
|
||||
CFOptionFlags alert_flags = kCFUserNotificationStopAlertLevel | kCFUserNotificationNoDefaultButtonFlag;
|
||||
|
||||
CFUserNotificationDisplayAlert(0, alert_flags, NULL, NULL, NULL, cf_title, cf_message,
|
||||
cf_button1, cf_button2, cf_button3, &results);
|
||||
|
||||
if (cf_button1 != NULL)
|
||||
CFRelease(cf_button1);
|
||||
if (cf_button2 != NULL)
|
||||
CFRelease(cf_button2);
|
||||
if (cf_button3 != NULL)
|
||||
CFRelease(cf_button3);
|
||||
CFRelease(cf_message);
|
||||
CFRelease(cf_title);
|
||||
|
||||
return (int)results;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Portions 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 Graphical Alerts for MacOSX
|
||||
///
|
||||
/// Shows alerts, since we can't just print these to the screen when
|
||||
/// launched graphically on a mac.
|
||||
|
||||
#ifdef __APPLE_CC__
|
||||
|
||||
extern int MacShowAlert(const char *title, const char *message, const char *button1, const char *button2, const char *button3);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,11 @@
|
||||
#ifndef __MAC_RESOURCES_H__
|
||||
#define __MAC_RESOURCES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void OSX_GetResourcesPath(char * buffer);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
+4
-4
@@ -44,15 +44,15 @@ typedef struct SDLJoyInfo_s
|
||||
/// number of old joystick
|
||||
int oldjoy;
|
||||
/// number of axies
|
||||
int axises;
|
||||
//int axises;
|
||||
/// scale of axises
|
||||
INT32 scale;
|
||||
/// number of buttons
|
||||
int buttons;
|
||||
//int buttons;
|
||||
/// number of hats
|
||||
int hats;
|
||||
//int hats;
|
||||
/// number of balls
|
||||
int balls;
|
||||
//int balls;
|
||||
} SDLJoyInfo_t;
|
||||
|
||||
/** \brief SDL info about controller 1
|
||||
|
||||
@@ -23,6 +23,10 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
|
||||
static inline int
|
||||
trycmp (char **pp, char *cp,
|
||||
const char *q, size_t qn)
|
||||
|
||||
+11
-4
@@ -1742,6 +1742,7 @@ void V_DrawHorizontallyScaledFullScreenPatch(patch_t *patch)
|
||||
void V_DrawVhsEffect(boolean rewind)
|
||||
{
|
||||
fixed_t uby, dby;
|
||||
// upbary is the bar going from top to bottom for some reason
|
||||
static fixed_t upbary = 100*FRACUNIT, downbary = 150*FRACUNIT;
|
||||
|
||||
UINT8 barsize, updistort, downdistort;
|
||||
@@ -1759,20 +1760,26 @@ void V_DrawVhsEffect(boolean rewind)
|
||||
if (cv_reducevfx.value)
|
||||
return;
|
||||
|
||||
barsize = vid.dup << 5;
|
||||
updistort = vid.dup << (rewind ? 5 : 3);
|
||||
const INT32 dup = min(vid.width / BASEVIDWIDTH, vid.height / BASEVIDHEIGHT);
|
||||
|
||||
barsize = dup << 5;
|
||||
updistort = dup << (rewind ? 5 : 3);
|
||||
downdistort = updistort >> 1;
|
||||
|
||||
if (rewind)
|
||||
V_DrawVhsEffect(false); // experimentation
|
||||
|
||||
upbary -= renderdeltatics * (vid.dup * (rewind ? 3 : 1.8f));
|
||||
downbary += renderdeltatics * (vid.dup * (rewind ? 2 : 1));
|
||||
upbary -= renderdeltatics * (fixed_t)(dup * (rewind ? 3 : 1.8f));
|
||||
downbary += renderdeltatics * (dup * (rewind ? 2 : 1));
|
||||
|
||||
if (upbary < -barsize*FRACUNIT)
|
||||
upbary = vid.height << FRACBITS;
|
||||
if (upbary > vid.height << FRACBITS)
|
||||
upbary = -barsize*FRACUNIT;
|
||||
if (downbary > vid.height << FRACBITS)
|
||||
downbary = -barsize*FRACUNIT;
|
||||
if (downbary < -barsize*FRACUNIT)
|
||||
downbary = vid.height << FRACBITS;
|
||||
|
||||
uby = upbary >> FRACBITS;
|
||||
dby = downbary >> FRACBITS;
|
||||
|
||||
+6
-6
@@ -187,13 +187,13 @@ static VOID ShowModuleInfo(HANDLE LogFile, HMODULE ModuleHandle)
|
||||
// Open the code module file so that we can get its file date
|
||||
// and size.
|
||||
ModuleFile = CreateFileA(ModName, GENERIC_READ,
|
||||
FILE_SHARE_READ, 0, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, 0);
|
||||
FILE_SHARE_READ, NULL, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (ModuleFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
FILETIME LastWriteTime;
|
||||
FileSize = GetFileSize(ModuleFile, 0);
|
||||
if (GetFileTime(ModuleFile, 0, 0, &LastWriteTime))
|
||||
FileSize = GetFileSize(ModuleFile, NULL);
|
||||
if (GetFileTime(ModuleFile, NULL, NULL, &LastWriteTime))
|
||||
{
|
||||
wsprintfA(TimeBuffer, " - file date is ");
|
||||
PrintTime(TimeBuffer + strlen(TimeBuffer), LastWriteTime);
|
||||
@@ -227,7 +227,7 @@ static VOID RecordModuleList(HANDLE LogFile)
|
||||
size_t PageSize;
|
||||
size_t NumPages;
|
||||
size_t pageNum = 0;
|
||||
LPVOID LastAllocationBase = 0;
|
||||
LPVOID LastAllocationBase = NULL;
|
||||
|
||||
FPrintf(LogFile, "\r\n"
|
||||
"\tModule list: names, addresses, sizes, time stamps "
|
||||
@@ -385,7 +385,7 @@ LONG WINAPI RecordExceptionInfo(PEXCEPTION_POINTERS data/*, LPCSTR Message, LPST
|
||||
}
|
||||
|
||||
// Append to the error log.
|
||||
SetFilePointer(fileHandle, 0, 0, FILE_END);
|
||||
SetFilePointer(fileHandle, 0, NULL, FILE_END);
|
||||
|
||||
// Print out some blank lines to separate this error log from any previous ones.
|
||||
FPrintf(fileHandle, "Email Sonic Team Junior so we can fix the bugs\r\n"); // Tails
|
||||
|
||||
Reference in new issue
Block a user