Merge branch SRB2:next into nonightsever

This commit is contained in:
Logan Aerl Arias 2024-02-18 19:58:36 +00:00
commit ae88c01f6e
55 changed files with 12201 additions and 1636 deletions

3
.gitignore vendored
View file

@ -24,4 +24,5 @@ Win32_LIB_ASM_Release
/build
/build/*
/CMakeUserPresets.json
/out
/out
/objs/VC10

View file

@ -153,8 +153,8 @@ default:
- - |
# ccache_stats
echo -e "\e[0Ksection_start:`date +%s`:ccache_stats[collapsed=true]\r\e[0Kccache statistics:"
- ccache --show-stats --verbose
- ccache --show-log-stats --verbose
- ccache --show-stats
- ccache --show-log-stats || true
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
@ -283,6 +283,47 @@ Debian stable:amd64:
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian oldstable:amd64:
extends: Debian stable:amd64
when: manual
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian old amd64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-x86-64"
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-x86-64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:amd64 libpng-dev:amd64 libcurl4-openssl-dev:amd64 libopenmpt-dev:amd64 libminiupnpc-dev:amd64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NOGME=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian stable:i386:
stage: build
@ -370,6 +411,86 @@ Debian stable:arm64:
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Debian oldstable:arm64:
extends: Debian stable:arm64
when: manual
image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:oldstable
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian old arm64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-old-aarch64"
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-aarch64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 ERRORMODE=1 NONX86=1 ARM64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1 NOGME=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
batocera:arm64:
extends: Debian stable:arm64
when: manual
allow_failure: true
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Debian old arm64"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-batocera-aarch64"
script:
- - |
# apt_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apt_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apt-get install gcc-aarch64-linux-gnu || apt-get install gcc
- |
# apt_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apt_toolchain\r\e[0K"
- - |
# apt_development
echo -e "\e[0Ksection_start:`date +%s`:apt_development[collapsed=true]\r\e[0KInstalling development packages"
- apt-get install libsdl2-mixer-dev:arm64 libpng-dev:arm64 libcurl4-openssl-dev:arm64 libopenmpt-dev:arm64 libminiupnpc-dev:arm64
- |
# apt_development
echo -e "\e[0Ksection_end:`date +%s`:apt_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 ERRORMODE=1 NONX86=1 ARM64=1 NOGME=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 LINUX64=1 NONX86=1 ARM64=1 NOGME=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
Windows x64:
stage: build
@ -596,3 +717,38 @@ Alpine 3 GCC:
- |
# ccahe_stats
echo -e "\e[0Ksection_end:`date +%s`:ccache_stats\r\e[0K"
Alpine 3 GCC Dedicated:
extends: Alpine 3 GCC
artifacts:
paths:
- "bin/"
- "src/comptime.h"
expose_as: "Apline-3-Dedicated"
name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3-Dedicated"
script:
- - |
# apk_toolchain
echo -e "\e[0Ksection_start:`date +%s`:apk_toolchain[collapsed=true]\r\e[0KInstalling toolchain packages"
- apk add gcc
- |
# apk_toolchain
echo -e "\e[0Ksection_end:`date +%s`:apk_toolchain\r\e[0K"
- - |
# apk_development
echo -e "\e[0Ksection_start:`date +%s`:apk_development[collapsed=true]\r\e[0KInstalling development packages"
- apk add musl-dev libpng-dev curl-dev
- |
# apk_development
echo -e "\e[0Ksection_end:`date +%s`:apk_development\r\e[0K"
- - |
# make
echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2"
- make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 NOEXECINFO=1 DEDICATED=1 || make --directory=src --keep-going CCACHE=1 ERRORMODE=1 NONX86=1 NOEXECINFO=1 DEDICATED=1
- |
# make
echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"

View file

@ -40,7 +40,9 @@ common
defaultflatscale = 1.0f;
scaledtextureoffsets = true;
// Colormap/fade related options
maxcolormapalpha = 25;
// TODO: change to 255;
// Thing number for start position in 3D Mode
start3dmode = 3328;
@ -100,11 +102,23 @@ mapformat_udmf
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = false;
// Enables support for individual offsets of upper/middle/lower sidedef textures
localsidedeftextureoffsets = true;
distinctfloorandceilingbrightness = true;
// Enables support for plane equation slopes
planeequationsupport = true;
// Enables support for vertex heights
vertexheightsupport = true;
// Enables setting distinct brightness for floor, ceiling, and walls
distinctfloorandceilingbrightness = true;
distinctwallbrightness = false;
// Enables setting distinct brightness for upper, middle, and lower sidedef parts
distinctsidedefpartbrightness = false;
// Special linedefs
include("SRB222_misc.cfg", "speciallinedefs_udmf");

View file

@ -9,7 +9,7 @@ udmf
title = "None";
prefix = "(0)";
}
6
{
title = "Sector Set Portal";
@ -97,6 +97,7 @@ udmf
41
{
title = "Horizon Effect";
id = "srb2_horizonline";
prefix = "(41)";
}
@ -147,10 +148,12 @@ udmf
arg0
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg1
{
title = "Sequence";
title = "Waypoint sequence";
tooltip = "The sequence number of (zoom tube) waypoints to use.";
}
arg2
{
@ -167,6 +170,7 @@ udmf
arg0
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg1
{
@ -182,6 +186,7 @@ udmf
{
title = "Sound";
type = 2;
tooltip = "Takes a DS constant.\nExample: DSTHOK";
}
}
@ -203,10 +208,12 @@ udmf
arg0
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg1
{
title = "Sequence";
title = "Waypoint sequence";
tooltip = "The sequence number of (zoom tube) waypoints to use.";
}
arg2
{
@ -226,7 +233,7 @@ udmf
}
arg1
{
title = "Debris lifetime";
title = "Debris lifetime (tics)";
}
arg2
{
@ -237,6 +244,7 @@ udmf
stringarg0
{
title = "Debris object type";
tooltip = "Uses a MT_ constant.\nExample: MT_ROCKCRUMBLE16\nDefaults to MT_ROCKCRUMBLE1.";
type = 2;
}
}
@ -298,21 +306,22 @@ udmf
20
{
title = "First Line";
title = "PolyObject First Line";
prefix = "(20)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Parent ID";
title = "Parent PolyObject tag";
type = 14;
}
arg2
{
title = "Translucency";
title = "Translucency level";
tooltip = "Ranges from 0 (fully opaque) to 10 (fully transparent).";
}
arg3
{
@ -338,45 +347,48 @@ udmf
30
{
title = "Waving Flag";
title = "Waving PolyObject Flag";
prefix = "(30)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
title = "Distance";
tooltip = "How far to move in either direction, in fracunits.";
}
}
31
{
title = "Displacement by Front Sector";
title = "Move PolyObject by Front Sector Displacement";
prefix = "(31)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Base speed";
tooltip = "How much the front sector displacement translates.\nA value of 256 amounts to a 1:1 translation.";
}
}
32
{
title = "Angular Displacement by Front Sector";
title = "Rotate PolyObject by Front Sector Displacement";
prefix = "(32)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
@ -413,6 +425,7 @@ udmf
arg0
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg1
{
@ -444,10 +457,12 @@ udmf
arg2
{
title = "Forward speed";
tooltip = "In fracunits per tic.";
}
arg3
{
title = "Return speed";
tooltip = "In fracunits per tic.";
}
arg4
{
@ -477,10 +492,12 @@ udmf
arg2
{
title = "Forward speed";
tooltip = "In fracunits per tic.";
}
arg3
{
title = "Return speed";
tooltip = "In fracunits per tic.";
}
arg4
{
@ -504,10 +521,11 @@ udmf
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
title = "Starting delay";
title = "Starting delay (tics)";
}
arg3
{
@ -543,16 +561,18 @@ udmf
arg2
{
title = "Crush speed";
tooltip = "In fracunits per tic.";
}
arg3
{
title = "Retract speed";
tooltip = "In fracunits per tic.";
}
}
66
{
title = "Move Planes by Displacement";
title = "Move Planes by Front Sector Displacement";
prefix = "(66)";
arg0
{
@ -589,6 +609,7 @@ udmf
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
@ -640,14 +661,17 @@ udmf
arg1
{
title = "Falling speed";
tooltip = "In fracunits per tic.";
}
arg2
{
title = "Rising speed";
tooltip = "In fracunits per tic.";
}
stringarg0
{
title = "Crushing sound";
tooltip = "Takes a DS constant.\nExample: DSTHOK";
type = 2;
}
}
@ -720,6 +744,7 @@ udmf
arg1
{
title = "Sinking speed";
tooltip = "In fracunits per tic.";
}
arg2
{
@ -761,6 +786,7 @@ udmf
{
title = "Alpha";
default = 255;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -804,6 +830,7 @@ udmf
{
title = "Alpha";
default = 128;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -880,6 +907,7 @@ udmf
{
title = "Alpha";
default = 255;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -922,6 +950,7 @@ udmf
{
title = "Alpha";
default = 255;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -952,6 +981,7 @@ udmf
arg5
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg6
{
@ -1009,6 +1039,7 @@ udmf
{
title = "Alpha";
default = 255;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -1079,14 +1110,17 @@ udmf
arg1
{
title = "Falling speed";
tooltip = "In fracunits per tic.";
}
arg2
{
title = "Rising speed";
tooltip = "In fracunits per tic.";
}
stringarg0
{
title = "Crushing sound";
tooltip = "Takes a DS constant.\nExample: DSTHOK";
type = 2;
}
}
@ -1105,6 +1139,7 @@ udmf
{
title = "Alpha";
default = 255;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -1162,6 +1197,7 @@ udmf
arg2
{
title = "Sinking speed";
tooltip = "In fracunits per tic.";
}
arg3
{
@ -1183,6 +1219,7 @@ udmf
{
title = "Alpha";
default = 128;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -1216,6 +1253,7 @@ udmf
{
title = "Alpha";
default = 255;
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg2
{
@ -2155,6 +2193,7 @@ udmf
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
}
@ -2260,6 +2299,7 @@ udmf
arg2
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg3
{
@ -2276,7 +2316,7 @@ udmf
405
{
title = "Move Planes by Distance";
title = "Move Planes by Set Distance";
prefix = "(405)";
arg0
{
@ -2296,6 +2336,7 @@ udmf
arg3
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg4
{
@ -2328,14 +2369,15 @@ udmf
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
title = "Starting delay";
title = "Starting delay (tics)";
}
arg3
{
title = "Delay before flip";
title = "Delay before flip (tics)";
}
arg4
{
@ -2367,10 +2409,12 @@ udmf
arg2
{
title = "Crush speed";
tooltip = "In fracunits per tic.";
}
arg3
{
title = "Retract speed";
tooltip = "In fracunits per tic.";
}
}
}
@ -2385,7 +2429,7 @@ udmf
prefix = "(412)";
arg0
{
title = "Destination tag";
title = "Destination thing tag";
type = 14;
}
arg1
@ -2771,6 +2815,7 @@ udmf
stringarg0
{
title = "Music name";
tooltip = "Takes a music lump name, without the O_ or D_ prefix. Use - to disable music.\nExample: GFZ1";
type = 2;
}
}
@ -2810,6 +2855,7 @@ udmf
stringarg0
{
title = "Sound name";
tooltip = "Takes a DS constant.\nExample: DSTHOK";
type = 2;
}
}
@ -3065,11 +3111,11 @@ udmf
prefix = "(448)";
arg0
{
title = "Viewpoint ID";
title = "Viewpoint thing tag";
}
arg1
{
title = "Centerpoint ID";
title = "Centerpoint thing tag";
}
arg2
{
@ -3154,6 +3200,7 @@ udmf
arg2
{
title = "Alpha";
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg3
{
@ -3184,10 +3231,11 @@ udmf
arg2
{
title = "Alpha";
tooltip = "Ranges from 0 (fully transparent) to 255 (fully opaque).";
}
arg3
{
title = "Fading speed";
title = "Fading speed (tics)";
}
arg4
{
@ -3373,16 +3421,17 @@ udmf
480
{
title = "Door Slide";
title = "PolyObject Door Slide";
prefix = "(480)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
@ -3390,22 +3439,23 @@ udmf
}
arg3
{
title = "Return delay";
title = "Return delay (tics)";
}
}
481
{
title = "Door Swing";
title = "PolyObject Door Swing";
prefix = "(481)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
@ -3414,22 +3464,23 @@ udmf
}
arg3
{
title = "Return delay";
title = "Return delay (tics)";
}
}
482
{
title = "Move";
title = "Move PolyObject";
prefix = "(482)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
@ -3445,20 +3496,22 @@ udmf
484
{
title = "Rotate";
title = "Rotate PolyObject";
prefix = "(484)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Speed";
tooltip = "In degrees per tic.";
}
arg2
{
title = "Rotation";
tooltip = "How many degrees the PolyObject will rotate.";
type = 8;
}
arg3
@ -3477,20 +3530,22 @@ udmf
488
{
title = "Move by Waypoints";
title = "Move PolyObject by Waypoints";
prefix = "(488)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Speed";
tooltip = "In fracunits per tic.";
}
arg2
{
title = "Waypoint sequence";
tooltip = "The sequence number of (zoom tube) waypoints to use.";
}
arg3
{
@ -3517,11 +3572,11 @@ udmf
489
{
title = "Set Visibility, Tangibility";
title = "Set PolyObject Visibility/Tangibility";
prefix = "(489)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
@ -3550,16 +3605,17 @@ udmf
491
{
title = "Set Translucency";
title = "Set PolyObject Translucency";
prefix = "(491)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Translucency level";
tooltip = "Ranges from 0 (fully opaque) to 10 (fully transparent).";
}
arg2
{
@ -3571,16 +3627,17 @@ udmf
492
{
title = "Fade Translucency";
title = "Fade PolyObject Translucency";
prefix = "(492)";
arg0
{
title = "PolyObject ID";
title = "PolyObject tag";
type = 14;
}
arg1
{
title = "Translucency level";
tooltip = "Ranges from 0 (fully opaque) to 10 (fully transparent).";
}
arg2
{
@ -3608,7 +3665,7 @@ udmf
500
{
title = "Scroll Walls";
title = "Scroll Wall";
prefix = "(500)";
arg0
{
@ -3628,7 +3685,7 @@ udmf
502
{
title = "Scroll Walls Remotely";
title = "Scroll Tagged Walls";
prefix = "(502)";
arg0
{
@ -3665,6 +3722,7 @@ udmf
{
title = "Sector tag";
type = 13;
tooltip = "A tag of 0 will scroll the planes of this line's front sector.";
}
arg1
{
@ -3702,6 +3760,7 @@ udmf
{
title = "Sector tag";
type = 13;
tooltip = "A tag of 0 will apply the effect to this line's front sector.";
}
arg1
{
@ -3725,7 +3784,7 @@ udmf
{
title = "Flags";
type = 12;
flags
enum
{
1 = "Slide";
2 = "Non-exclusive";

View file

@ -229,20 +229,363 @@ Field data types:
*/
universalfields
{
sector
{
}
linedef
{
alpha
{
type = 1;
default = 1.0;
}
comment
{
type = 2;
default = "";
}
renderstyle
{
type = 2;
default = "";
}
stringarg0
{
type = 2;
default = "";
}
stringarg1
{
type = 2;
default = "";
}
executordelay
{
type = 0;
default = 0;
}
}
sidedef
{
comment
{
type = 2;
default = "";
}
//light
//{
// type = 0;
// default = 0;
//}
//
//lightabsolute
//{
// type = 3;
// default = false;
//}
//
//light_top
//{
// type = 0;
// default = 0;
//}
//
//lightabsolute_top
//{
// type = 3;
// default = false;
//}
//
//light_mid
//{
// type = 0;
// default = 0;
//}
//
//lightabsolute_mid
//{
// type = 3;
// default = false;
//}
//
//light_bottom
//{
// type = 0;
// default = 0;
//}
//
//lightabsolute_bottom
//{
// type = 3;
// default = false;
//}
offsetx_bottom
{
type = 1;
default = 0.0;
}
offsetx_mid
{
type = 1;
default = 0.0;
}
offsetx_top
{
type = 1;
default = 0.0;
}
offsety_bottom
{
type = 1;
default = 0.0;
}
offsety_mid
{
type = 1;
default = 0.0;
}
offsety_top
{
type = 1;
default = 0.0;
}
scalex_bottom
{
type = 1;
default = 1.0;
}
scalex_mid
{
type = 1;
default = 1.0;
}
scalex_top
{
type = 1;
default = 1.0;
}
scaley_bottom
{
type = 1;
default = 1.0;
}
scaley_mid
{
type = 1;
default = 1.0;
}
scaley_top
{
type = 1;
default = 1.0;
}
}
thing
{
comment
{
type = 2;
default = "";
}
pitch
{
type = 0;
}
roll
{
type = 0;
}
scalex
{
type = 1;
default = 1.0;
}
scaley
{
type = 1;
default = 1.0;
}
stringarg0
{
type = 2;
default = "";
}
stringarg1
{
type = 2;
default = "";
}
mobjscale
{
type = 1;
default = 1.0;
managed = false;
}
}
sector
{
comment
{
type = 2;
default = "";
}
damagetype
{
type = 2;
default = "";
}
gravity
{
type = 1;
default = 1.0;
}
lightcolor
{
type = 0;
default = 0;
}
fadecolor
{
type = 0;
default = 0;
}
lightalpha
{
type = 0;
default = 25;
}
fadealpha
{
type = 0;
default = 25;
}
fadestart
{
type = 0;
default = 0;
}
fadeend
{
type = 0;
default = 31;
}
xpanningfloor
{
type = 1;
default = 0.0;
}
ypanningfloor
{
type = 1;
default = 0.0;
}
rotationfloor
{
type = 1;
default = 0.0;
}
xscalefloor
{
type = 1;
default = 1.0;
}
yscalefloor
{
type = 1;
default = 1.0;
}
lightfloor
{
type = 0;
default = 0;
}
lightfloorabsolute
{
type = 3;
default = false;
}
xpanningceiling
{
type = 1;
default = 0.0;
}
ypanningceiling
{
type = 1;
default = 0.0;
}
rotationceiling
{
type = 1;
default = 0.0;
}
xscaleceiling
{
type = 1;
default = 1.0;
}
yscaleceiling
{
type = 1;
default = 1.0;
}
lightceiling
{
type = 0;
default = 0;
}
lightceilingabsolute
{
type = 3;
default = false;
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,24 @@
makedir:=$(makedir)/Dedicated
sources+=$(call List,dedicated/Sourcefile)
opts+=-DDEDICATED
ifdef FREEBSD
# on FreeBSD, we have to link to libpthread explicitly
libs+=-lpthread
endif
ifdef MINGW
libs+=-mconsole
endif
ifndef NOTHREADS
opts+=-DHAVE_THREADS
sources+=dedicated/i_threads.c
endif
NOOPENMPT=1
NOGME=1
NOHW=1
NOUPNP=1

View file

@ -2,8 +2,6 @@
# Makefile options for unices (linux, bsd...)
#
EXENAME?=lsdl2srb2
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
# Use -rdynamic so a backtrace log shows function names
# instead of addresses
@ -14,7 +12,20 @@ opts+=-I/usr/X11R6/include
libs+=-L/usr/X11R6/lib
endif
ifndef DEDICATED
ifndef DUMMY
SDL?=1
DEDICATED?=0
endif
endif
ifeq (${SDL},1)
EXENAME?=lsdl2srb2
endif
ifeq (${DEDICATED},1)
EXENAME?=lsrb2d
endif
# In common usage.
ifdef LINUX

View file

@ -65,6 +65,8 @@ endif
ifeq ($(SDL), 1)
include Makefile.d/sdl.mk
else ifeq ($(DEDICATED), 1)
include Makefile.d/dedicated.mk
else
include Makefile.d/dummy.mk
endif

View file

@ -17,7 +17,11 @@ sources+=win32/Srb2win.rc
opts+=-DSTDC_HEADERS
libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
ifndef DEDICATED
ifndef DUMMY
SDL?=1
endif
endif
ifndef NOHW
opts+=-DUSE_WGL_SWAP

View file

@ -31,6 +31,26 @@ LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
/* Compiler-specific attributes and other macros */
#ifdef __GNUC__ // __attribute__ ((X))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__) // MinGW, >= GCC 4.1
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCREPORT __attribute__ ((format(gnu_printf, 2, 3)))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#define FUNCREPORT __attribute__ ((format(ms_printf, 2, 3)))
#else
#define FUNCREPORT __attribute__ ((format(printf, 2, 3)))
#endif
#else
#define FUNCREPORT __attribute__ ((format(printf, 2, 3)))
#endif
#endif
#ifndef FUNCREPORT
#define FUNCREPORT
#endif
typedef struct luaL_Reg {
const char *name;
@ -65,7 +85,7 @@ LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API FUNCREPORT int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
const char *const lst[]);

View file

@ -120,7 +120,7 @@ static void CONS_backcolor_Change(void);
#ifdef macintosh
#define CON_BUFFERSIZE 4096 // my compiler can't handle local vars >32k
#else
#define CON_BUFFERSIZE 16384
#define CON_BUFFERSIZE 32768
#endif
static char con_buffer[CON_BUFFERSIZE];
@ -220,7 +220,7 @@ static char *bindtable[NUMINPUTS];
static void CONS_Bind_f(void)
{
size_t na;
char *newcmd;
char *newcmd = NULL;
//size_t newlen = 0;
unsigned int i;
INT32 key;
@ -1339,6 +1339,8 @@ boolean CON_Responder(event_t *ev)
if (input_sel != input_cur)
CON_InputDelSelection();
if (ev->type == ev_console)
CON_InputAddChar(key);
return true;
}

View file

@ -1295,7 +1295,7 @@ void D_SRB2Main(void)
#endif
// for dedicated server
#if !defined (_WINDOWS) //already check in win_main.c
#if !defined (_WINDOWS) && !defined (DEDICATED) //already check in win_main.c
dedicated = M_CheckParm("-dedicated") != 0;
#endif

5
src/dedicated/Sourcefile Normal file
View file

@ -0,0 +1,5 @@
i_net.c
i_system.c
i_main.c
i_video.c
i_sound.c

189
src/dedicated/i_main.c Normal file
View file

@ -0,0 +1,189 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2023 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file d_main.c
/// \brief Main program, simply calls D_SRB2Main and D_SRB2Loop, the high level loop.
#include "../doomdef.h"
#include "../m_argv.h"
#include "../d_main.h"
#include "../m_misc.h"/* path shit */
#include "../i_system.h"
#include "../netcode/d_clisrv.h"
#if defined (__GNUC__) || defined (__unix__)
#include <unistd.h>
#endif
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#include <errno.h>
#endif
#include "time.h" // For log timestamps
#ifdef LOGMESSAGES
FILE *logstream = NULL;
char logfilename[1024];
#endif
#ifndef DOXYGEN
#ifndef O_TEXT
#define O_TEXT 0
#endif
#ifndef O_SEQUENTIAL
#define O_SEQUENTIAL 0
#endif
#endif
#if defined (_WIN32)
#include "../win32/win_dbg.h"
typedef BOOL (WINAPI *p_IsDebuggerPresent)(VOID);
#endif
#ifdef LOGMESSAGES
static void InitLogging(void)
{
const char *logdir = NULL;
time_t my_time;
struct tm * timeinfo;
const char *format;
const char *reldir;
int left;
boolean fileabs;
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
const char *link;
#endif
logdir = D_Home();
my_time = time(NULL);
timeinfo = localtime(&my_time);
if (M_CheckParm("-logfile") && M_IsNextParm())
{
format = M_GetNextParm();
fileabs = M_IsPathAbsolute(format);
}
else
{
format = "log-%Y-%m-%d_%H-%M-%S.txt";
fileabs = false;
}
if (fileabs)
{
strftime(logfilename, sizeof logfilename, format, timeinfo);
}
else
{
if (M_CheckParm("-logdir") && M_IsNextParm())
reldir = M_GetNextParm();
else
reldir = "logs";
if (M_IsPathAbsolute(reldir))
{
left = snprintf(logfilename, sizeof logfilename,
"%s"PATHSEP, reldir);
}
else
#ifdef DEFAULTDIR
if (logdir)
{
left = snprintf(logfilename, sizeof logfilename,
"%s"PATHSEP DEFAULTDIR PATHSEP"%s"PATHSEP, logdir, reldir);
}
else
#endif/*DEFAULTDIR*/
{
left = snprintf(logfilename, sizeof logfilename,
"."PATHSEP"%s"PATHSEP, reldir);
}
strftime(&logfilename[left], sizeof logfilename - left,
format, timeinfo);
}
M_MkdirEachUntil(logfilename,
M_PathParts(logdir) - 1,
M_PathParts(logfilename) - 1, 0755);
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
logstream = fopen(logfilename, "w");
#ifdef DEFAULTDIR
if (logdir)
link = va("%s/"DEFAULTDIR"/latest-log.txt", logdir);
else
#endif/*DEFAULTDIR*/
link = "latest-log.txt";
unlink(link);
if (symlink(logfilename, link) == -1)
{
I_OutputMsg("Error symlinking latest-log.txt: %s\n", strerror(errno));
}
#else/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
logstream = fopen("latest-log.txt", "wt+");
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
}
#endif
/** \brief The main function
\param argc number of arg
\param *argv string table
\return int
*/
#if defined (__GNUC__) && (__GNUC__ >= 4)
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#endif
int main(int argc, char **argv)
{
myargc = argc;
myargv = argv; /// \todo pull out path to exe from this string
dedicated = true;
#ifdef LOGMESSAGES
if (!M_CheckParm("-nolog"))
InitLogging();
#endif/*LOGMESSAGES*/
//I_OutputMsg("I_StartupSystem() ...\n");
I_StartupSystem();
#if defined (_WIN32)
LoadLibraryA("exchndl.dll");
#ifndef __MINGW32__
prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo);
#endif
#endif
// startup SRB2
CONS_Printf("Setting up SRB2...\n");
D_SRB2Main();
#ifdef LOGMESSAGES
if (!M_CheckParm("-nolog"))
CONS_Printf("Logfile: %s\n", logfilename);
#endif
CONS_Printf("Entering main game loop...\n");
// never return
D_SRB2Loop();
#ifdef BUGTRAP
// This is safe even if BT didn't start.
ShutdownBugTrap();
#endif
// return to OS
return 0;
}

7
src/dedicated/i_net.c Normal file
View file

@ -0,0 +1,7 @@
#include "../netcode/i_net.h"
boolean I_InitNetwork(void)
{
// NOTE: this is no longer used.
return false;
}

214
src/dedicated/i_sound.c Normal file
View file

@ -0,0 +1,214 @@
#include "../i_sound.h"
UINT8 sound_started = 0;
void *I_GetSfx(sfxinfo_t *sfx)
{
(void)sfx;
return NULL;
}
void I_FreeSfx(sfxinfo_t *sfx)
{
(void)sfx;
}
void I_StartupSound(void){}
void I_ShutdownSound(void){}
void I_UpdateSound(void){};
//
// SFX I/O
//
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{
(void)id;
(void)vol;
(void)sep;
(void)pitch;
(void)priority;
(void)channel;
return -1;
}
void I_StopSound(INT32 handle)
{
(void)handle;
}
boolean I_SoundIsPlaying(INT32 handle)
{
(void)handle;
return false;
}
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
{
(void)handle;
(void)vol;
(void)sep;
(void)pitch;
}
void I_SetSfxVolume(UINT8 volume)
{
(void)volume;
}
/// ------------------------
// MUSIC SYSTEM
/// ------------------------
void I_InitMusic(void){}
void I_ShutdownMusic(void){}
/// ------------------------
// MUSIC PROPERTIES
/// ------------------------
musictype_t I_SongType(void)
{
return MU_NONE;
}
boolean I_SongPlaying(void)
{
return false;
}
boolean I_SongPaused(void)
{
return false;
}
/// ------------------------
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
{
(void)speed;
return false;
}
/// ------------------------
// MUSIC SEEKING
/// ------------------------
UINT32 I_GetSongLength(void)
{
return 0;
}
boolean I_SetSongLoopPoint(UINT32 looppoint)
{
(void)looppoint;
return false;
}
UINT32 I_GetSongLoopPoint(void)
{
return 0;
}
boolean I_SetSongPosition(UINT32 position)
{
(void)position;
return false;
}
UINT32 I_GetSongPosition(void)
{
return 0;
}
/// ------------------------
// MUSIC PLAYBACK
/// ------------------------
boolean I_LoadSong(char *data, size_t len)
{
(void)data;
(void)len;
return -1;
}
void I_UnloadSong(void)
{
}
boolean I_PlaySong(boolean looping)
{
(void)looping;
return false;
}
void I_StopSong(void)
{
}
void I_PauseSong(void)
{
}
void I_ResumeSong(void)
{
}
void I_SetMusicVolume(UINT8 volume)
{
(void)volume;
}
boolean I_SetSongTrack(INT32 track)
{
(void)track;
return false;
}
/// ------------------------
// MUSIC FADING
/// ------------------------
void I_SetInternalMusicVolume(UINT8 volume)
{
(void)volume;
}
void I_StopFadingSong(void)
{
}
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void))
{
(void)target_volume;
(void)source_volume;
(void)ms;
(void)callback;
return false;
}
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void))
{
(void)target_volume;
(void)ms;
(void)callback;
return false;
}
boolean I_FadeOutStopSong(UINT32 ms)
{
(void)ms;
return false;
}
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
{
(void)ms;
(void)looping;
return false;
}

1575
src/dedicated/i_system.c Normal file

File diff suppressed because it is too large Load diff

359
src/dedicated/i_threads.c Normal file
View file

@ -0,0 +1,359 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2020-2023 by James R.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file i_threads.c
/// \brief Multithreading abstraction
#if defined (__unix__) || (!defined(__APPLE__) && defined (UNIXCOMMON))
#include <pthread.h>
#include "../i_threads.h"
#include "../doomdef.h"
#include "../doomtype.h"
typedef struct thread_s thread_t;
struct thread_s
{
thread_t *next;
void *userdata;
I_thread_fn func;
pthread_t thread;
};
// we use a linked list to avoid moving memory blocks when allocating new threads.
static thread_t *thread_list;
static pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER;
static void *HandleThread(void *data)
{
thread_t *thread = data;
thread->func(thread->userdata);
pthread_mutex_lock(&thread_lock);
thread->func = NULL;
pthread_mutex_unlock(&thread_lock);
return NULL;
}
void I_spawn_thread(const char *name, I_thread_fn entry, void *userdata)
{
thread_t *thread;
(void)name;
pthread_mutex_lock(&thread_lock);
thread = thread_list;
while (thread != NULL)
{
if (thread->func == NULL)
{
// join with the exited thread to release it's resources.
pthread_join(thread->thread, NULL);
break;
}
thread = thread->next;
}
if (thread == NULL)
{
thread = malloc(sizeof(thread_t));
thread->next = thread_list;
thread_list = thread;
}
thread->func = entry;
thread->userdata = userdata;
pthread_create(&thread->thread, NULL, HandleThread, thread);
pthread_mutex_unlock(&thread_lock);
}
int I_thread_is_stopped(void)
{
thread_t *thread;
pthread_mutex_lock(&thread_lock);
thread = thread_list;
while (thread != NULL)
{
if (thread->func != NULL)
{
pthread_mutex_unlock(&thread_lock);
return false;
}
thread = thread->next;
}
pthread_mutex_unlock(&thread_lock);
return true;
}
void I_start_threads(void)
{
}
void I_stop_threads(void)
{
thread_t *thread = thread_list;
while (thread != NULL)
{
// join with all threads here, since finished threads haven't been awaited yet.
pthread_join(thread->thread, NULL);
thread = thread->next;
}
}
void I_lock_mutex(I_mutex *anchor)
{
pthread_mutex_lock(&thread_lock);
if (*anchor == NULL)
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
// SRB2 relies on lock recursion, so we need a mutex configured for that.
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
*anchor = malloc(sizeof(pthread_mutex_t));
pthread_mutex_init(*anchor, &attr);
pthread_mutexattr_destroy(&attr);
}
pthread_mutex_unlock(&thread_lock);
pthread_mutex_lock(*anchor);
}
void I_unlock_mutex(I_mutex id)
{
pthread_mutex_unlock(id);
}
void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
{
I_Assert(mutex_id != NULL);
pthread_mutex_lock(&thread_lock);
if (*cond_anchor == NULL)
{
*cond_anchor = malloc(sizeof(pthread_cond_t));
pthread_cond_init(*cond_anchor, NULL);
}
pthread_mutex_unlock(&thread_lock);
pthread_cond_wait(*cond_anchor, mutex_id);
}
void I_wake_one_cond(I_cond *anchor)
{
pthread_mutex_lock(&thread_lock);
if (*anchor == NULL)
{
*anchor = malloc(sizeof(pthread_cond_t));
pthread_cond_init(*anchor, NULL);
}
pthread_mutex_unlock(&thread_lock);
pthread_cond_signal(*anchor);
}
void I_wake_all_cond(I_cond *anchor)
{
pthread_mutex_lock(&thread_lock);
if (*anchor == NULL)
{
*anchor = malloc(sizeof(pthread_t));
pthread_cond_init(*anchor, NULL);
}
pthread_mutex_unlock(&thread_lock);
pthread_cond_broadcast(*anchor);
}
#elif defined (_WIN32)
#include <windows.h>
#include "../i_threads.h"
#include "../doomdef.h"
#include "../doomtype.h"
typedef struct thread_s thread_t;
struct thread_s
{
thread_t *next;
void *userdata;
I_thread_fn func;
HANDLE thread;
DWORD thread_id;
};
// we use a linked list to avoid moving memory blocks when allocating new threads.
static thread_t *thread_list;
static CRITICAL_SECTION thread_lock;
static DWORD __stdcall HandleThread(void *data)
{
thread_t *thread = data;
thread->func(thread->userdata);
EnterCriticalSection(&thread_lock);
thread->func = NULL;
LeaveCriticalSection(&thread_lock);
return 0;
}
void I_spawn_thread(const char *name, I_thread_fn entry, void *userdata)
{
thread_t *thread;
(void)name;
EnterCriticalSection(&thread_lock);
thread = thread_list;
while (thread != NULL)
{
if (thread->func == NULL)
{
CloseHandle(thread->thread);
break;
}
thread = thread->next;
}
if (thread == NULL)
{
thread = malloc(sizeof(thread_t));
thread->next = thread_list;
thread_list = thread;
}
thread->func = entry;
thread->userdata = userdata;
thread->thread = CreateThread(NULL, 0, HandleThread, thread, 0, &thread->thread_id);
LeaveCriticalSection(&thread_lock);
}
int I_thread_is_stopped(void)
{
thread_t *thread;
EnterCriticalSection(&thread_lock);
thread = thread_list;
while (thread != NULL)
{
if (thread->func != NULL)
{
LeaveCriticalSection(&thread_lock);
return false;
}
thread = thread->next;
}
LeaveCriticalSection(&thread_lock);
return true;
}
void I_start_threads(void)
{
InitializeCriticalSection(&thread_lock);
}
void I_stop_threads(void)
{
thread_t *thread = thread_list;
while (thread != NULL)
{
WaitForSingleObject(thread->thread, INFINITE);
CloseHandle(thread->thread);
thread = thread->next;
}
DeleteCriticalSection(&thread_lock);
}
void I_lock_mutex(I_mutex *anchor)
{
EnterCriticalSection(&thread_lock);
if (*anchor == NULL)
{
*anchor = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(*anchor);
}
LeaveCriticalSection(&thread_lock);
EnterCriticalSection(*anchor);
}
void I_unlock_mutex(I_mutex id)
{
LeaveCriticalSection(id);
}
void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
{
I_Assert(mutex_id != NULL);
EnterCriticalSection(&thread_lock);
if (*cond_anchor == NULL)
{
*cond_anchor = malloc(sizeof(CONDITION_VARIABLE));
InitializeConditionVariable(*cond_anchor);
}
LeaveCriticalSection(&thread_lock);
SleepConditionVariableCS(*cond_anchor, mutex_id, INFINITE);
}
void I_wake_one_cond(I_cond *anchor)
{
EnterCriticalSection(&thread_lock);
if (*anchor == NULL)
{
*anchor = malloc(sizeof(CONDITION_VARIABLE));
InitializeConditionVariable(*anchor);
}
LeaveCriticalSection(&thread_lock);
WakeConditionVariable(*anchor);
}
void I_wake_all_cond(I_cond *anchor)
{
EnterCriticalSection(&thread_lock);
if (*anchor == NULL)
{
*anchor = malloc(sizeof(CONDITION_VARIABLE));
InitializeConditionVariable(*anchor);
}
LeaveCriticalSection(&thread_lock);
WakeAllConditionVariable(*anchor);
}
#else
void I_spawn_thread(const char *name, I_thread_fn entry, void *userdata)
{
(void)name;
entry(userdata);
}
int I_thread_is_stopped(void)
{
}
void I_start_threads(void)
{
}
void I_stop_threads(void)
{
}
void I_lock_mutex(I_mutex *anchor)
{
(void)anchor;
}
void I_unlock_mutex(I_mutex id)
{
(void)id;
}
void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
{
(void)cond_anchor;
(void)mutex_id;
}
void I_wake_one_cond(I_cond *anchor)
{
(void)anchor;
}
void I_wake_all_cond(I_cond *anchor)
{
(void)anchor;
}
#endif

81
src/dedicated/i_video.c Normal file
View file

@ -0,0 +1,81 @@
#include "../doomdef.h"
#include "../command.h"
#include "../i_video.h"
rendermode_t rendermode = render_none;
rendermode_t chosenrendermode = render_none;
boolean highcolor = false;
boolean allow_fullscreen = false;
consvar_t cv_vidwait = CVAR_INIT ("vid_wait", "On", CV_SAVE, CV_OnOff, NULL);
void I_StartupGraphics(void){}
void I_ShutdownGraphics(void){}
void VID_StartupOpenGL(void){}
void I_SetPalette(RGBA_t *palette)
{
(void)palette;
}
INT32 VID_NumModes(void)
{
return 0;
}
INT32 VID_GetModeForSize(INT32 w, INT32 h)
{
(void)w;
(void)h;
return 0;
}
void VID_PrepareModeList(void){}
INT32 VID_SetMode(INT32 modenum)
{
(void)modenum;
return 0;
}
boolean VID_CheckRenderer(void)
{
return false;
}
void VID_CheckGLLoaded(rendermode_t oldrender)
{
(void)oldrender;
}
const char *VID_GetModeName(INT32 modenum)
{
(void)modenum;
return NULL;
}
UINT32 I_GetRefreshRate(void) { return 35; }
void I_UpdateNoBlit(void){}
void I_FinishUpdate(void){}
void I_UpdateNoVsync(void) {}
void I_WaitVBL(INT32 count)
{
(void)count;
}
void I_ReadScreen(UINT8 *scr)
{
(void)scr;
}
void I_BeginRead(void){}
void I_EndRead(void){}

View file

@ -206,5 +206,10 @@ void I_GetCursorPosition(INT32 *x, INT32 *y)
(void)y;
}
const char *I_GetSysName(void)
{
return NULL;
}
#include "../sdl/dosstr.c"

View file

@ -3339,7 +3339,7 @@ void G_AddPlayer(INT32 playernum)
p->lives = cv_startinglives.value;
if ((countplayers && !notexiting) || G_IsSpecialStage(gamemap))
P_DoPlayerExit(p);
P_DoPlayerExit(p, false);
}
boolean G_EnoughPlayersFinished(void)
@ -3872,12 +3872,13 @@ static INT16 RandMap(UINT32 tolflags, INT16 pprevmap)
//
// G_UpdateVisited
//
static void G_UpdateVisited(gamedata_t *data, player_t *player, boolean silent)
static void G_UpdateVisited(gamedata_t *data, player_t *player, boolean global)
{
// Update visitation flags?
if (!demoplayback
&& G_CoopGametype() // Campaign mode
&& !stagefailed) // Did not fail the stage
&& !stagefailed // Did not fail the stage
&& (global || player->pflags & PF_FINISHED)) // Actually beat the stage
{
UINT8 earnedEmblems;
UINT16 totalrings = 0;
@ -3915,12 +3916,12 @@ static void G_UpdateVisited(gamedata_t *data, player_t *player, boolean silent)
data->mapvisited[gamemap-1] |= MV_ALLEMERALDS;
}
if ((earnedEmblems = M_CompletionEmblems(data)) && !silent)
if ((earnedEmblems = M_CompletionEmblems(data)) && !global)
{
CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : "");
}
if (silent)
if (global)
{
M_CheckLevelEmblems(data);
}
@ -4620,6 +4621,9 @@ void G_SaveGameData(gamedata_t *data)
INT32 curmare;
if (!data)
return; // data struct not valid
if (!data->loaded)
return; // If never loaded (-nodata), don't save

View file

@ -823,18 +823,13 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum)
void HWR_GetLevelFlat(levelflat_t *levelflat)
{
if (levelflat->type == LEVELFLAT_NONE)
if (levelflat->type == LEVELFLAT_NONE || levelflat->texture_id < 0)
{
HWR_SetCurrentTexture(NULL);
return;
}
INT32 texturenum = texturetranslation[levelflat->texture_id];
if (texturenum <= 0)
{
HWR_SetCurrentTexture(NULL);
return;
}
GLMapTexture_t *grtex = &gl_flats[texturenum];
GLMipmap_t *grMipmap = &grtex->mipmap;

View file

@ -6488,7 +6488,6 @@ static CV_PossibleValue_t glfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSA
CV_PossibleValue_t glanisotropicmode_cons_t[] = {{1, "MIN"}, {16, "MAX"}, {0, NULL}};
consvar_t cv_glshaders = CVAR_INIT ("gr_shaders", "On", CV_SAVE, glshaders_cons_t, NULL);
consvar_t cv_glallowshaders = CVAR_INIT ("gr_allowclientshaders", "On", CV_NETVAR, CV_OnOff, NULL);
#ifdef ALAM_LIGHTING
consvar_t cv_gldynamiclighting = CVAR_INIT ("gr_dynamiclighting", "On", CV_SAVE, CV_OnOff, NULL);
@ -6547,7 +6546,6 @@ void HWR_AddCommands(void)
CV_RegisterVar(&cv_glfakecontrast);
CV_RegisterVar(&cv_glshearing);
CV_RegisterVar(&cv_glshaders);
CV_RegisterVar(&cv_glallowshaders);
CV_RegisterVar(&cv_glfiltermode);
CV_RegisterVar(&cv_glanisotropicmode);

View file

@ -620,7 +620,7 @@ static void Command_CSay_f(void)
DoSayCommand(0, 1, HU_CSAY);
}
static tic_t spam_tokens[MAXPLAYERS];
static tic_t spam_tokens[MAXPLAYERS] = { 1 }; // fill the buffer with 1 so the motd can be sent.
static tic_t spam_tics[MAXPLAYERS];
/** Receives a message, processing an ::XD_SAY command.

View file

@ -335,4 +335,8 @@ void I_GetCursorPosition(INT32 *x, INT32 *y);
*/
void I_SetMouseGrab(boolean grab);
/** \brief Returns the system name.
*/
const char *I_GetSysName(void);
#endif

View file

@ -21791,7 +21791,7 @@ void P_PatchInfoTables(void)
INT32 i;
char *tempname;
#if NUMSPRITEFREESLOTS > 1000
#if NUMSPRITEFREESLOTS > 9999 //tempname numbering actually starts at SPR_FIRSTFREESLOT, so the limit is actually 9999 + SPR_FIRSTFREESLOT-1, but the preprocessor doesn't understand enums, so its left at 9999 for safety
"Update P_PatchInfoTables, you big dumb head"
#endif
@ -21799,8 +21799,8 @@ void P_PatchInfoTables(void)
for (i = SPR_FIRSTFREESLOT; i <= SPR_LASTFREESLOT; i++)
{
tempname = sprnames[i];
tempname[0] = 'F';
tempname[1] = (char)('0' + (char)((i-SPR_FIRSTFREESLOT+1)/100));
tempname[0] = (char)('0' + (char)((i-SPR_FIRSTFREESLOT+1)/1000));
tempname[1] = (char)('0' + (char)(((i-SPR_FIRSTFREESLOT+1)/100)%10));
tempname[2] = (char)('0' + (char)(((i-SPR_FIRSTFREESLOT+1)/10)%10));
tempname[3] = (char)('0' + (char)((i-SPR_FIRSTFREESLOT+1)%10));
tempname[4] = '\0';

View file

@ -572,7 +572,7 @@ void A_ChangeHeight();
extern int actionsoverridden[NUMACTIONS][MAX_ACTION_RECURSION];
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
#define NUMMOBJFREESLOTS 512
#define NUMMOBJFREESLOTS 1024
#define NUMSPRITEFREESLOTS NUMMOBJFREESLOTS
#define NUMSTATEFREESLOTS (NUMMOBJFREESLOTS*8)

View file

@ -1584,11 +1584,12 @@ static int lib_pDoPlayerFinish(lua_State *L)
static int lib_pDoPlayerExit(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean finishedflag = lua_opttrueboolean(L, 2);
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoPlayerExit(player);
P_DoPlayerExit(player, finishedflag);
return 0;
}

View file

@ -312,17 +312,12 @@ static int lib_searchBlockmap(lua_State *L)
continue; // our thing just found itself, so move on
funcret = lib_searchBlockmap_Objects(L, mobj, itmobj);
if (funcret == 2) {
lua_pushboolean(L, false);
return 1;
}
else if (funcret == 1)
retval = false;
if (P_MobjWasRemoved(mobj)) {
if (funcret == 2 || P_MobjWasRemoved(mobj)) {
retval = false;
break;
}
else if (funcret == 1)
retval = false;
}
}
while (itmobj != NULL);

View file

@ -483,7 +483,7 @@ static int spriteinfo_set(lua_State *L)
}
}
else
return luaL_error(L, va("Field %s does not exist in spriteinfo_t", field));
return luaL_error(L, "Field %s does not exist in spriteinfo_t", field);
return 0;
}
@ -577,7 +577,7 @@ static int framepivot_get(lua_State *L)
lua_pushinteger(L, 0);
}
else
return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field));
return luaL_error(L, "Field %s does not exist in spriteframepivot_t", field);
return 1;
}
@ -604,7 +604,7 @@ static int framepivot_set(lua_State *L)
else if (fastcmp("rotaxis", field))
LUA_UsageWarning(L, "\"rotaxis\" is deprecated and will be removed.")
else
return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field));
return luaL_error(L, "Field %s does not exist in spriteframepivot_t", field);
return 0;
}
@ -1663,7 +1663,7 @@ static void setRamp(lua_State *L, skincolor_t* c) {
lua_pushnil(L);
for (i=0; i<COLORRAMPSIZE; i++) {
if (lua_objlen(L,-2)!=COLORRAMPSIZE) {
luaL_error(L, LUA_QL("skincolor_t") " field 'ramp' must be %d entries long; got %d.", COLORRAMPSIZE, lua_objlen(L,-2));
luaL_error(L, LUA_QL("skincolor_t") " field 'ramp' must be %d entries long; got %d.", COLORRAMPSIZE, luaL_getn(L,-2));
break;
}
if (lua_next(L, -2) != 0) {

View file

@ -1003,6 +1003,9 @@ static int mapthing_get(lua_State *L)
return 0;
}
if (field == (enum mapthing_e)-1)
return LUA_ErrInvalid(L, "fields");
switch (field)
{
case mapthing_valid:
@ -1061,7 +1064,7 @@ static int mapthing_get(lua_State *L)
break;
default:
if (devparm)
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, field);
return luaL_error(L, "%s %s", LUA_QL("mapthing_t"), va("has no field named: %ui", field));
else
return 0;
}
@ -1078,6 +1081,9 @@ static int mapthing_set(lua_State *L)
if (!mt)
return luaL_error(L, "accessed mapthing_t doesn't exist anymore.");
if (field == (enum mapthing_e)-1)
return LUA_ErrInvalid(L, "fields");
if (hud_running)
return luaL_error(L, "Do not alter mapthing_t in HUD rendering code!");
if (hook_cmd_running)
@ -1135,7 +1141,7 @@ static int mapthing_set(lua_State *L)
mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
break;
default:
return luaL_error(L, LUA_QL("mapthing_t") " has no field named " LUA_QS, field);
return luaL_error(L, "%s %s", LUA_QL("mapthing_t"), va("has no field named: %ui", field));
}
return 0;

View file

@ -1423,8 +1423,8 @@ static int power_len(lua_State *L)
return 1;
}
#define NOFIELD luaL_error(L, LUA_QL("ticcmd_t") " has no field named " LUA_QS, field)
#define NOSET luaL_error(L, LUA_QL("ticcmd_t") " field " LUA_QS " should not be set directly.", ticcmd_opt[field])
#define NOFIELD luaL_error(L, "%s %s", LUA_QL("ticcmd_t"), va("has no field named %ui", field))
#define NOSET luaL_error(L, LUA_QL("ticcmd_t") " field %s should not be set directly.", ticcmd_opt[field])
enum ticcmd_e
{
@ -1455,6 +1455,9 @@ static int ticcmd_get(lua_State *L)
if (!cmd)
return LUA_ErrInvalid(L, "player_t");
if (field == (enum ticcmd_e)-1)
return LUA_ErrInvalid(L, "fields");
switch (field)
{
case ticcmd_forwardmove:
@ -1489,6 +1492,9 @@ static int ticcmd_set(lua_State *L)
if (!cmd)
return LUA_ErrInvalid(L, "ticcmd_t");
if (field == (enum ticcmd_e)-1)
return LUA_ErrInvalid(L, "fields");
if (hud_running)
return luaL_error(L, "Do not alter player_t in HUD rendering code!");

View file

@ -1098,15 +1098,23 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
fixed_t fheight = P_GetSectorFloorZAt(sec, mt->x << FRACBITS, mt->y << FRACBITS);
mt->z = (UINT16)((player->mo->z - fheight)>>FRACBITS);
}
mt->angle = (INT16)(FixedInt(AngleFixed(player->mo->angle)));
mt->options = (mt->z << ZSHIFT) | (UINT16)cv_opflags.value;
mt->options = (UINT16)cv_opflags.value;
mt->scale = player->mo->scale;
mt->spritexscale = player->mo->spritexscale;
mt->spriteyscale = player->mo->spriteyscale;
memset(mt->args, 0, NUMMAPTHINGARGS*sizeof(*mt->args));
memset(mt->stringargs, 0x00, NUMMAPTHINGSTRINGARGS*sizeof(*mt->stringargs));
mt->pitch = mt->roll = 0;
// Ignore offsets
if (mt->type == MT_EMBLEM)
mt->args[1] = 1;
else
mt->args[0] = 1;
return mt;
}

View file

@ -10535,7 +10535,7 @@ static void M_StartTimeAttackReplay(INT32 choice)
// Player has selected the "REPLAY" from the time attack screen
static void M_ReplayTimeAttack(INT32 choice)
{
const char *which;
const char *which = NULL;
UINT8 error = DFILE_ERROR_NONE;
if (currentMenu == &SP_ReplayDef)

View file

@ -393,6 +393,9 @@ consvar_t cv_ps_descriptor = CVAR_INIT ("ps_descriptor", "Average", 0, ps_descri
consvar_t cv_freedemocamera = CVAR_INIT("freedemocamera", "Off", CV_SAVE, CV_OnOff, NULL);
// NOTE: this should be in hw_main.c, but we can't put it there as it breaks dedicated build
consvar_t cv_glallowshaders = CVAR_INIT ("gr_allowcustomshaders", "On", CV_NETVAR, CV_OnOff, NULL);
char timedemo_name[256];
boolean timedemo_csv;
char timedemo_csv_id[256];
@ -526,6 +529,8 @@ void D_RegisterServerCommands(void)
// for master server connection
AddMServCommands();
CV_RegisterVar(&cv_glallowshaders);
// p_mobj.c
CV_RegisterVar(&cv_itemrespawntime);
CV_RegisterVar(&cv_itemrespawn);
@ -3812,18 +3817,7 @@ static void Command_Version_f(void)
#endif
// OS
// Would be nice to use SDL_GetPlatform for this
#if defined (_WIN32) || defined (_WIN64)
CONS_Printf("Windows ");
#elif defined(__linux__)
CONS_Printf("Linux ");
#elif defined(MACOSX)
CONS_Printf("macOS ");
#elif defined(UNIXCOMMON)
CONS_Printf("Unix (Common) ");
#else
CONS_Printf("Other OS ");
#endif
CONS_Printf("%s ", I_GetSysName());
// Bitness
if (sizeof(void*) == 4)
@ -4069,7 +4063,7 @@ static void ExitMove_OnChange(void)
if (players[i].mo->target && players[i].mo->target->type == MT_SIGN)
P_SetTarget(&players[i].mo->target, NULL);
if (players[i].pflags & PF_FINISHED)
if (players[i].pflags & PF_FINISHED && !(players[i].exiting))
P_GiveFinishFlags(&players[i]);
}
@ -4669,15 +4663,28 @@ static void Command_Cheats_f(void)
CV_ResetCheatNetVars();
return;
}
else if (COM_CheckParm("on"))
{
if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else
G_SetUsedCheats(false);
return;
}
if (usedCheats)
CONS_Printf(M_GetText("Cheats are enabled, the game cannot be saved.\n"));
else
CONS_Printf(M_GetText("Cheats are disabled, the game can be saved.\n"));
if (CV_CheatsEnabled())
{
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n"));
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed.\n"));
if (server || (IsPlayerAdmin(consoleplayer)))
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
}
else
CONS_Printf(M_GetText("No CHEAT-marked variables are changed -- Cheats are disabled.\n"));
CONS_Printf(M_GetText("No CHEAT-marked variables are changed.\n"));
}
#ifdef _DEBUG

View file

@ -1640,7 +1640,7 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
#endif
// Set user agent, as some servers won't accept invalid user agents.
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("Sonic Robo Blast 2/v%d.%d", VERSION, SUBVERSION));
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("Sonic Robo Blast 2/%s", VERSIONSTRING));
// Authenticate if the user so wishes
login = CURLGetLogin(url, NULL);

View file

@ -300,6 +300,10 @@ init_upnpc_once(struct upnpdata *upnpuserdata)
int upnp_error = -2;
int scope_id = 0;
int status_code = 0;
memset(&urls, 0, sizeof(struct UPNPUrls));
memset(&data, 0, sizeof(struct IGDdatas));
CONS_Printf(M_GetText("Looking for UPnP Internet Gateway Device\n"));
devlist = upnpDiscoverDevices(deviceTypes, 500, NULL, NULL, 0, false, 2, &upnp_error, 0);
if (devlist)
@ -327,8 +331,6 @@ init_upnpc_once(struct upnpdata *upnpuserdata)
parserootdesc(descXML, descXMLsize, &data);
free(descXML);
descXML = NULL;
memset(&urls, 0, sizeof(struct UPNPUrls));
memset(&data, 0, sizeof(struct IGDdatas));
GetUPNPUrls(&urls, &data, dev->descURL, status_code);
I_AddExitFunc(I_ShutdownUPnP);
}

View file

@ -4017,7 +4017,7 @@ static void P_DoBossVictory(mobj_t *mo)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
P_DoPlayerExit(&players[i], true);
}
}
else
@ -11004,7 +11004,7 @@ void A_ForceWin(mobj_t *actor)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
P_DoPlayerExit(&players[i], true);
}
}

View file

@ -2530,8 +2530,14 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
{
P_SetTarget(&target->target, source);
source->player->numboxes++;
if (cv_itemrespawn.value && gametype != GT_COOP && (modifiedgame || netgame || multiplayer))
target->fuse = cv_itemrespawntime.value*TICRATE + 2; // Random box generation
// Set respawn
if (!(target->flags2 & MF2_DONTRESPAWN))
{
if (!(netgame || multiplayer))
target->fuse = atoi(cv_itemrespawntime.defaultvalue)*TICRATE + 2;
else if (cv_itemrespawn.value)
target->fuse = cv_itemrespawntime.value*TICRATE + 2;
}
}
// Award Score Tails

View file

@ -189,7 +189,7 @@ void P_DoPityCheck(player_t *player);
void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player);
void P_DoPlayerFinish(player_t *player);
void P_DoPlayerExit(player_t *player);
void P_DoPlayerExit(player_t *player, boolean finishedflag);
void P_NightserizePlayer(player_t *player, INT32 ptime);
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);

View file

@ -1095,8 +1095,6 @@ bthingit_t *P_NewBlockThingsIterator(int x1, int y1, int x2, int y2)
return NULL;
block = GetBlockmapBlock(x1, y1);
if (!block)
return NULL;
if (freeiters != NULL)
{
@ -1188,12 +1186,12 @@ mobj_t *P_BlockThingsIteratorNext(bthingit_t *it, boolean centeronly)
if (!it->dynhash)
{
it->dynhashcapacity = 50;
Z_Calloc(it->dynhashcapacity * sizeof(it->dynhashcapacity), PU_LEVEL, &it->dynhash);
Z_Calloc(it->dynhashcapacity * sizeof(*it->dynhash), PU_LEVEL, &it->dynhash);
}
if (it->dynhashcount == it->dynhashcapacity)
{
it->dynhashcapacity *= 2;
it->dynhash = Z_Realloc(it->dynhash, it->dynhashcapacity * sizeof(it->dynhashcapacity), PU_LEVEL, &it->dynhash);
it->dynhash = Z_Realloc(it->dynhash, it->dynhashcapacity * sizeof(*it->dynhash), PU_LEVEL, &it->dynhash);
}
i = (int)it->dynhashcount;
it->dynhashcount++;

View file

@ -10063,9 +10063,10 @@ static void P_MonitorFuseThink(mobj_t *mobj)
{
mobj_t *newmobj;
// Special case for ALL monitors.
// Special case for ALL monitors outside of co-op.
// If a box's speed is nonzero, it's allowed to respawn as a WRM/SRM.
if (mobj->info->speed != 0 && (mobj->flags2 & (MF2_AMBUSH|MF2_STRONGBOX)))
if (!G_CoopGametype() && mobj->info->speed != 0
&& (mobj->flags2 & (MF2_AMBUSH|MF2_STRONGBOX)))
{
mobjtype_t spawnchance[64];
INT32 numchoices = 0, i = 0;
@ -10293,6 +10294,8 @@ void P_MobjThinker(mobj_t *mobj)
P_SetTarget(&mobj->hnext, NULL);
if (mobj->hprev && P_MobjWasRemoved(mobj->hprev))
P_SetTarget(&mobj->hprev, NULL);
if (mobj->dontdrawforviewmobj && P_MobjWasRemoved(mobj->dontdrawforviewmobj))
P_SetTarget(&mobj->dontdrawforviewmobj, NULL);
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG);
@ -10855,10 +10858,16 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type, ...)
// Set shadowscale here, before spawn hook so that Lua can change it
mobj->shadowscale = P_DefaultMobjShadowScale(mobj);
if (!(mobj->flags & MF_NOTHINK))
P_AddThinker(THINK_MOBJ, &mobj->thinker);
// A monitor can't respawn if we're not in multiplayer,
// or if we're in co-op and it's score or a 1up
if (mobj->flags & MF_MONITOR && (!(netgame || multiplayer)
|| (G_CoopGametype()
&& (mobj->type == MT_1UP_BOX
|| mobj->type == MT_SCORE1K_BOX
|| mobj->type == MT_SCORE10K_BOX)
)))
mobj->flags2 |= MF2_DONTRESPAWN;
if (type == MT_PLAYER)
{
@ -10869,6 +10878,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type, ...)
va_end(args);
}
if (!(mobj->flags & MF_NOTHINK) || (titlemapinaction && mobj->type == MT_ALTVIEWMAN))
P_AddThinker(THINK_MOBJ, &mobj->thinker);
// increment mobj reference, so we don't get a dangling reference in case MobjSpawn calls P_RemoveMobj
mobj->thinker.references++;
@ -11889,7 +11901,7 @@ void P_AfterPlayerSpawn(INT32 playernum)
if (CheckForReverseGravity)
P_CheckGravity(mobj, false);
if (p->pflags & PF_FINISHED)
if (p->pflags & PF_FINISHED && !(p->exiting))
P_GiveFinishFlags(p);
}

View file

@ -585,17 +585,17 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
// Look for a flat
int texturenum = R_CheckFlatNumForName(levelflat->name);
if (texturenum <= 0)
if (texturenum < 0)
{
// If we can't find a flat, try looking for a texture!
texturenum = R_CheckTextureNumForName(levelflat->name);
if (texturenum <= 0)
if (texturenum < 0)
{
// Use "not found" texture
texturenum = R_CheckTextureNumForName("REDWALL");
// Give up?
if (texturenum <= 0)
if (texturenum < 0)
{
levelflat->type = LEVELFLAT_NONE;
texturenum = -1;

View file

@ -3605,7 +3605,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
P_DoPlayerExit(&players[i], true);
}
}
}
@ -3659,7 +3659,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
P_DoPlayerExit(&players[i], true);
}
}
}
@ -4421,7 +4421,7 @@ static void P_ProcessEggCapsule(player_t *player, sector_t *sector)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
P_DoPlayerExit(&players[i], true);
}
}
@ -4731,7 +4731,7 @@ static void P_ProcessFinishLine(player_t *player)
HU_DoCEcho("FINISHED!");
}
P_DoPlayerExit(player);
P_DoPlayerExit(player, true);
}
}

View file

@ -893,7 +893,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
players[i].marescore = 0;
players[i].spheres = players[i].rings = 0;
P_DoPlayerExit(&players[i]);
P_DoPlayerExit(&players[i], true);
}
}
else if (oldmare != player->mare)
@ -2264,7 +2264,7 @@ void P_DoPlayerFinish(player_t *player)
// P_DoPlayerExit
//
// Player exits the map via sector trigger
void P_DoPlayerExit(player_t *player)
void P_DoPlayerExit(player_t *player, boolean finishedflag)
{
if (player->exiting)
return;
@ -2285,7 +2285,11 @@ void P_DoPlayerExit(player_t *player)
player->exiting = (14*TICRATE)/5 + 1;
}
else
{
player->exiting = (14*TICRATE)/5 + 2; // Accidental death safeguard???
if (finishedflag)
player->pflags |= PF_FINISHED; // Give PF_FINISHED as proof of a true finish
}
//player->pflags &= ~PF_GLIDING;
if (player->climbing)
@ -11906,7 +11910,7 @@ void P_PlayerThink(player_t *player)
if (((gametyperules & GTR_FRIENDLY) && cv_exitmove.value) && !G_EnoughPlayersFinished())
player->exiting = 0;
else
P_DoPlayerExit(player);
P_DoPlayerExit(player, false);
}
// check water content, set stuff in mobj
@ -11955,7 +11959,7 @@ void P_PlayerThink(player_t *player)
}
// Synchronizes the "real" amount of time spent in the level.
if (!player->exiting && !stoppedclock)
if (!player->exiting && !(player->pflags & PF_FINISHED) && !stoppedclock)
{
if (gametyperules & GTR_RACE)
{

View file

@ -376,7 +376,7 @@ void *Picture_PatchConvert(
// Write columns
for (INT32 x = 0; x < inwidth; x++)
{
post_t *post;
post_t *post = NULL;
size_t post_data_offset = 0;
boolean was_opaque = false;

View file

@ -441,7 +441,7 @@ static void R_DrawRepeatMaskedColumn(column_t *col, unsigned lengthcol)
{
while (sprtopscreen < sprbotscreen) {
R_DrawMaskedColumn(col, lengthcol);
if ((INT64)sprtopscreen + dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
if ((INT64)sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
sprtopscreen = INT32_MAX;
else
sprtopscreen += dc_texheight*spryscale;

View file

@ -147,7 +147,7 @@ static void R_DrawFlippedColumnInCache(column_t *column, UINT8 *cache, texpatch_
if (count > 0)
{
for (; dest < cache + position + count; --source)
for (; dest < cache + position + count; --source, is_opaque++)
{
*dest++ = *source;
*is_opaque = true;
@ -191,7 +191,7 @@ static void R_DrawBlendColumnInCache(column_t *column, UINT8 *cache, texpatch_t
if (count > 0)
{
for (; dest < cache + position + count; source++, dest++)
for (; dest < cache + position + count; source++, dest++, is_opaque++)
{
*dest = ASTBlendPaletteIndexes(*dest, *source, originPatch->style, originPatch->alpha);
*is_opaque = true;
@ -235,7 +235,7 @@ static void R_DrawBlendFlippedColumnInCache(column_t *column, UINT8 *cache, texp
if (count > 0)
{
for (; dest < cache + position + count; --source, dest++)
for (; dest < cache + position + count; --source, dest++, is_opaque++)
{
*dest = ASTBlendPaletteIndexes(*dest, *source, originPatch->style, originPatch->alpha);
*is_opaque = true;
@ -472,7 +472,7 @@ UINT8 *R_GenerateTexture(size_t texnum)
for (x = 0; x < texture->width; x++)
{
post_t *post;
post_t *post = NULL;
boolean was_opaque = false;
column_t *column = &temp_columns[x];

View file

@ -165,7 +165,22 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<PreprocessorDefinitions>HAVE_CURL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\libs\curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<CustomBuild>
<Command />
</CustomBuild>
<CustomBuild>
<Message />
</CustomBuild>
<CustomBuild>
<Outputs />
</CustomBuild>
<Link>
<AdditionalDependencies>libcurl.dll.a;libz32.a;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\libs\zlib\win32;..\..\libs\curl\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -175,7 +190,50 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<DisableSpecificWarnings>4244;4267;4146;4003</DisableSpecificWarnings>
<PreprocessorDefinitions>HAVE_CURL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\libs\curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<CustomBuild>
<Command />
</CustomBuild>
<CustomBuild>
<Message />
</CustomBuild>
<CustomBuild>
<Outputs />
</CustomBuild>
<Link>
<AdditionalDependencies>libcurl.dll.a;libz32.a;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\libs\zlib\win32;..\libs\curl\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<DisableSpecificWarnings>4244;4267;4146</DisableSpecificWarnings>
<PreprocessorDefinitions>HAVE_CURL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\libs\curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalModuleDependencies>..\libs\curl\lib64;%(AdditionalModuleDependencies)</AdditionalModuleDependencies>
</ClCompile>
<Link>
<AdditionalDependencies>libcurl.a;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\libs\curl\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>HAVE_CURL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>libcurl.a;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\libs\curl\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\libs\libpng-src\projects\visualc10\libpng.vcxproj">
@ -314,7 +372,6 @@
<ClInclude Include="..\netcode\server_connection.h" />
<ClInclude Include="..\netcode\tic_command.h" />
<ClInclude Include="..\p5prof.h" />
<ClInclude Include="..\p_haptic.h" />
<ClInclude Include="..\p_local.h" />
<ClInclude Include="..\p_maputl.h" />
<ClInclude Include="..\p_mobj.h" />
@ -400,6 +457,7 @@
<ClCompile Include="..\blua\lmem.c" />
<ClCompile Include="..\blua\lobject.c" />
<ClCompile Include="..\blua\lopcodes.c" />
<ClCompile Include="..\blua\loslib.c" />
<ClCompile Include="..\blua\lparser.c" />
<ClCompile Include="..\blua\lstate.c" />
<ClCompile Include="..\blua\lstring.c" />
@ -438,6 +496,8 @@
<ClCompile Include="..\hardware\hw_md3load.c" />
<ClCompile Include="..\hardware\hw_model.c" />
<ClCompile Include="..\hardware\r_opengl\r_opengl.c" />
<ClCompile Include="..\lua_colorlib.c" />
<ClCompile Include="..\r_bbox.c" />
<ClCompile Include="..\u_list.c" />
<ClCompile Include="..\hu_stuff.c" />
<ClCompile Include="..\info.c" />
@ -495,7 +555,6 @@
<ClCompile Include="..\p_ceilng.c" />
<ClCompile Include="..\p_enemy.c" />
<ClCompile Include="..\p_floor.c" />
<ClCompile Include="..\p_haptic.c" />
<ClCompile Include="..\p_inter.c" />
<ClCompile Include="..\p_lights.c" />
<ClCompile Include="..\p_map.c" />
@ -567,7 +626,6 @@
<ClCompile Include="IMG_xpm.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="i_gamepad.c" />
<ClCompile Include="i_main.c" />
<ClCompile Include="i_net.c" />
<ClCompile Include="i_system.c" />
@ -584,4 +642,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -255,9 +255,6 @@
<ClInclude Include="..\hardware\hw_model.h">
<Filter>Hw_Hardware</Filter>
</ClInclude>
<ClInclude Include="..\hardware\u_list.h">
<Filter>Hw_Hardware</Filter>
</ClInclude>
<ClInclude Include="..\byteptr.h">
<Filter>I_Interface</Filter>
</ClInclude>
@ -378,9 +375,6 @@
<ClInclude Include="..\netcode\gamestate.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\netcode\http-mserv.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\netcode\i_addrinfo.h">
<Filter>I_Interface</Filter>
</ClInclude>
@ -558,12 +552,16 @@
<ClInclude Include="..\r_fps.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\p_haptic.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\m_easing.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\d_clisrv.h" />
<ClInclude Include="..\d_net.h" />
<ClInclude Include="..\d_netcmd.h" />
<ClInclude Include="..\d_netfil.h" />
<ClInclude Include="..\u_list.h" />
<ClInclude Include="..\mserv.h" />
<ClInclude Include="..\http-mserv.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\tmap.nas">
@ -753,15 +751,9 @@
<ClCompile Include="..\hardware\hw_model.c">
<Filter>Hw_Hardware</Filter>
</ClCompile>
<ClCompile Include="..\hardware\u_list.c">
<Filter>Hw_Hardware</Filter>
</ClCompile>
<ClCompile Include="..\filesrch.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\i_tcp.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\lua_baselib.c">
<Filter>LUA</Filter>
</ClCompile>
@ -1105,21 +1097,25 @@
<ClCompile Include="..\lua_hudlib_drawlist.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="i_gamepad.c">
<Filter>SDLApp</Filter>
</ClCompile>
<ClCompile Include="..\i_time.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\r_fps.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\p_haptic.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\m_easing.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\u_list.c" />
<ClCompile Include="..\blua\loslib.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_colorlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\r_bbox.c">
<Filter>R_Rend</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="Srb2SDL.ico">

View file

@ -652,7 +652,6 @@ void I_GetConsoleEvents(void)
else if (tty_con.cursor < sizeof (tty_con.buffer))
{
// push regular character
ev.type = ev_text;
ev.key = tty_con.buffer[tty_con.cursor] = key;
tty_con.cursor++;
// print the current line (this is differential)
@ -3256,4 +3255,10 @@ const CPUInfoFlags *I_CPUInfo(void)
// note CPUAFFINITY code used to reside here
void I_RegisterSysCommands(void) {}
const char *I_GetSysName(void)
{
return SDL_GetPlatform();
}
#endif

View file

@ -134,6 +134,7 @@ static patch_t *minicaps;
static patch_t *gotrflag;
static patch_t *gotbflag;
static patch_t *fnshico;
static patch_t *fireflower;
hudinfo_t hudinfo[NUMHUDITEMS] =
{
@ -315,6 +316,8 @@ void ST_LoadGraphics(void)
sneakers = W_CachePatchName("TVSSICON", PU_HUDGFX);
gravboots = W_CachePatchName("TVGVICON", PU_HUDGFX);
fireflower = W_CachePatchName("GOTFFLOW", PU_HUDGFX);
tagico = W_CachePatchName("TAGICO", PU_HUDGFX);
gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX);
gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX);
@ -1508,7 +1511,7 @@ static void ST_drawPowerupHUD(void)
UINT16 invulntime = 0;
INT32 offs = hudinfo[HUD_POWERUPS].x;
const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0);
static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}, finishoffs[2] = {0, 0};
static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}, finishoffs[2] = {0, 0}, stackoffs[2] = {0,0};
if (F_GetPromptHideHud(hudinfo[HUD_POWERUPS].y))
return;
@ -1583,6 +1586,22 @@ static void ST_drawPowerupHUD(void)
offs -= shieldoffs[q];
//Fire Flower "shield"
if ((stplyr->powers[pw_shield] & SH_FIREFLOWER) == SH_FIREFLOWER)
{
stackoffs[q] = ICONSEP;
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, fireflower);
}
else if (stackoffs[q])
{
if (stackoffs[q] > 1)
stackoffs[q] = 2*stackoffs[q]/3;
else
stackoffs[q] = 0;
}
offs -= stackoffs[q];
// ---------
// CTF flags
// ---------

View file

@ -2043,7 +2043,7 @@ static void Y_AwardCoopBonuses(void)
y_bonus_t localbonuses[4];
// set score/total first
data.coop.total = players[consoleplayer].recordscore;
data.coop.total = (players[consoleplayer].pflags & PF_FINISHED) ? players[consoleplayer].recordscore : 0;
data.coop.score = players[consoleplayer].score;
data.coop.gotperfbonus = -1;
memset(data.coop.bonuses, 0, sizeof(data.coop.bonuses));
@ -2060,7 +2060,12 @@ static void Y_AwardCoopBonuses(void)
for (j = 0; j < 4; ++j) // Set bonuses
{
(bonuses_list[bonusnum][j])(&players[i], &localbonuses[j]);
//Set the bonus, but only if we actually finished
if (players[i].pflags & PF_FINISHED)
(bonuses_list[bonusnum][j])(&players[i], &localbonuses[j]);
else
Y_SetNullBonus(&players[i], &localbonuses[j]);
players[i].score += localbonuses[j].points;
if (players[i].score > MAXSCORE)
players[i].score = MAXSCORE;