From 50ac745ed1209dfd341bf84b89da3fb01c53b76e Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 13 Oct 2022 22:59:26 +0000 Subject: [PATCH 01/13] Merge branch 'dummy-revival' into 'next' Revive the dummy interface See merge request STJr/SRB2!1831 (cherry picked from commit 3b8cb3982a3308edaf4a5a0d913ab55c3a8cc6de) ba55947e Make dummy compile again, if SDL is explicitly set to 0 --- src/Makefile | 4 ++-- src/Makefile.d/detect.mk | 1 - src/Makefile.d/nix.mk | 2 +- src/Makefile.d/platform.mk | 4 +++- src/Makefile.d/win32.mk | 4 +++- src/doomtype.h | 2 -- src/dummy/Sourcefile | 5 +++++ src/dummy/i_sound.c | 11 ++++------- src/dummy/i_system.c | 21 +++++++++++++++++---- 9 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 src/dummy/Sourcefile diff --git a/src/Makefile b/src/Makefile index c1aa35742..9cab3e487 100644 --- a/src/Makefile +++ b/src/Makefile @@ -31,8 +31,8 @@ # MINGW=1, MINGW64=1 - Windows (MinGW toolchain) # UNIX=1 - Generic Unix like system # FREEBSD=1 -# SDL=1 - Use SDL backend. SDL is the only backend though -# and thus, always enabled. +# SDL=1 - Use SDL backend. SDL is the only implemented backend though. +# If disabled, a dummy backend will be used. # # A list of supported GCC versions can be found in # Makefile.d/detect.mk -- search 'gcc_versions'. diff --git a/src/Makefile.d/detect.mk b/src/Makefile.d/detect.mk index f458b044c..aca498721 100644 --- a/src/Makefile.d/detect.mk +++ b/src/Makefile.d/detect.mk @@ -17,7 +17,6 @@ all_systems:=\ UNIX\ LINUX\ FREEBSD\ - SDL\ # check for user specified system ifeq (,$(filter $(all_systems),$(.VARIABLES))) diff --git a/src/Makefile.d/nix.mk b/src/Makefile.d/nix.mk index 6642a6bcc..767b64c12 100644 --- a/src/Makefile.d/nix.mk +++ b/src/Makefile.d/nix.mk @@ -18,7 +18,7 @@ opts+=-I/usr/X11R6/include libs+=-L/usr/X11R6/lib endif -SDL=1 +SDL?=1 # In common usage. ifdef LINUX diff --git a/src/Makefile.d/platform.mk b/src/Makefile.d/platform.mk index fad4be191..c5ac71a20 100644 --- a/src/Makefile.d/platform.mk +++ b/src/Makefile.d/platform.mk @@ -64,6 +64,8 @@ ifdef UNIX include Makefile.d/nix.mk endif -ifdef SDL +ifeq ($(SDL), 1) include Makefile.d/sdl.mk +else +include Makefile.d/dummy.mk endif diff --git a/src/Makefile.d/win32.mk b/src/Makefile.d/win32.mk index 768133c15..25d3ea9f4 100644 --- a/src/Makefile.d/win32.mk +++ b/src/Makefile.d/win32.mk @@ -19,7 +19,7 @@ libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32 nasm_format:=win32 -SDL=1 +SDL?=1 ifndef NOHW opts+=-DUSE_WGL_SWAP @@ -76,6 +76,7 @@ else lib:=../libs/SDL2_mixer/$(mingw) endif +ifdef SDL2 mixer_opts:=-I$(lib)/include/SDL2 mixer_libs:=-L$(lib)/lib @@ -85,6 +86,7 @@ SDL_opts:=-I$(lib)/include/SDL2\ SDL_libs:=-L$(lib)/lib $(mixer_libs)\ -lmingw32 -lSDL2main -lSDL2 -mwindows $(eval $(call _set,SDL)) +endif lib:=../libs/zlib ZLIB_opts:=-I$(lib) diff --git a/src/doomtype.h b/src/doomtype.h index 5ddd9ae44..b8f602c64 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -392,8 +392,6 @@ unset_bit_array (bitarray_t * const array, const int value) array[value >> 3] &= ~(1<<(value & 7)); } -#ifdef HAVE_SDL typedef UINT64 precise_t; -#endif #endif //__DOOMTYPE__ diff --git a/src/dummy/Sourcefile b/src/dummy/Sourcefile new file mode 100644 index 000000000..2f5dd1a59 --- /dev/null +++ b/src/dummy/Sourcefile @@ -0,0 +1,5 @@ +i_net.c +i_system.c +i_main.c +i_video.c +i_sound.c diff --git a/src/dummy/i_sound.c b/src/dummy/i_sound.c index f09158e01..ba0fc6423 100644 --- a/src/dummy/i_sound.c +++ b/src/dummy/i_sound.c @@ -139,29 +139,24 @@ boolean I_LoadSong(char *data, size_t len) void I_UnloadSong(void) { - (void)handle; } boolean I_PlaySong(boolean looping) { - (void)handle; (void)looping; return false; } void I_StopSong(void) { - (void)handle; } void I_PauseSong(void) { - (void)handle; } void I_ResumeSong(void) { - (void)handle; } void I_SetMusicVolume(UINT8 volume) @@ -188,18 +183,20 @@ void I_StopFadingSong(void) { } -boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(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)); +boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void)) { (void)target_volume; (void)ms; + (void)callback; return false; } diff --git a/src/dummy/i_system.c b/src/dummy/i_system.c index 4a657ed19..a1d757204 100644 --- a/src/dummy/i_system.c +++ b/src/dummy/i_system.c @@ -1,6 +1,9 @@ #include "../doomdef.h" +#include "../doomtype.h" #include "../i_system.h" +FILE *logstream = NULL; + UINT8 graphics_started = 0; UINT8 keyboard_started = 0; @@ -16,11 +19,17 @@ tic_t I_GetTime(void) return 0; } -int I_GetTimeMicros(void) +precise_t I_GetPreciseTime(void) { return 0; } +int I_PreciseToMicros(precise_t d) +{ + (void)d; + return 0; +} + void I_Sleep(void){} void I_GetEvent(void){} @@ -96,8 +105,6 @@ void I_StartupMouse(void){} void I_StartupMouse2(void){} -void I_StartupKeyboard(void){} - INT32 I_GetKey(void) { return 0; @@ -176,12 +183,18 @@ INT32 I_ClipboardCopy(const char *data, size_t size) return -1; } -char *I_ClipboardPaste(void) +const char *I_ClipboardPaste(void) { return NULL; } void I_RegisterSysCommands(void) {} +void I_GetCursorPosition(INT32 *x, INT32 *y) +{ + (void)x; + (void)y; +} + #include "../sdl/dosstr.c" From ef2b9551d2efcff427a0e9511e3b22e7a006d23f Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 13 Oct 2022 18:18:18 -0500 Subject: [PATCH 02/13] Add missing .mk for dummy target (cherry picked from commit d46c2013329c219e62ae19c819eee293671b3293) --- src/Makefile.d/dummy.mk | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/Makefile.d/dummy.mk diff --git a/src/Makefile.d/dummy.mk b/src/Makefile.d/dummy.mk new file mode 100644 index 000000000..6908de84a --- /dev/null +++ b/src/Makefile.d/dummy.mk @@ -0,0 +1,5 @@ +makedir:=$(makedir)/Dummy + +sources+=$(call List,dummy/Sourcefile) + +NOHW=1 From 89a6d81f539831f0d6fd62cd57a0d83cb685ab55 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 18 Oct 2022 22:47:51 +0000 Subject: [PATCH 03/13] Merge branch 'win32-dpi-awareness' into 'next' win32: Add dpi aware manifest config See merge request STJr/SRB2!1835 (cherry picked from commit e37918ebb0a8b0766fd2c598a0cb7ad7bad4ddee) bc44e792 win32: Add dpi aware manifest config --- src/win32/Srb2win.rc | 1 + src/win32/srb2win.exe.manifest | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/win32/Srb2win.rc b/src/win32/Srb2win.rc index 83948ac81..2236beca1 100644 --- a/src/win32/Srb2win.rc +++ b/src/win32/Srb2win.rc @@ -2,6 +2,7 @@ // #include "resource.h" #include "winver.h" +#include "winuser.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/src/win32/srb2win.exe.manifest b/src/win32/srb2win.exe.manifest index d3b8355cb..f9ba6c814 100644 --- a/src/win32/srb2win.exe.manifest +++ b/src/win32/srb2win.exe.manifest @@ -1,5 +1,11 @@ + + + true/pm + PerMonitorV2 + + From 56e48f1f5f31a2bc3435dcae75cca442587b5760 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 20 Oct 2022 21:10:21 -0500 Subject: [PATCH 04/13] make: Fix ifdef check from dummy target changes --- src/Makefile.d/win32.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.d/win32.mk b/src/Makefile.d/win32.mk index 25d3ea9f4..0e48ed683 100644 --- a/src/Makefile.d/win32.mk +++ b/src/Makefile.d/win32.mk @@ -76,7 +76,7 @@ else lib:=../libs/SDL2_mixer/$(mingw) endif -ifdef SDL2 +ifdef SDL mixer_opts:=-I$(lib)/include/SDL2 mixer_libs:=-L$(lib)/lib From 647f8c81e4a9dd2d05f2d286d1748ec84ba9ca12 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 10 Nov 2022 15:12:45 +0000 Subject: [PATCH 05/13] CircleCi: update buildbot config --- .circleci/config.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67a3b66b7..a2f6ef9d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,7 @@ jobs: # CCACHE_COMPRESS: true # WFLAGS: -Wno-unsuffixed-float-constants # GCC48: true + resource_class: large steps: - run: name: Add i386 arch @@ -32,6 +33,12 @@ jobs: apt-get -qq -y install dirmngr apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0B1702D71499D9C25F986507F240F4449D3B0EC6 echo "deb http://ppa.launchpad.net/stjr/srb2/ubuntu trusty main" >> /etc/apt/sources.list + - run: + name: Make APT cache folder + command: mkdir -p /root/.cache/apt/archives/partial + - run: + name: Make APT cache usage by _apt + command: chown -Rv _apt:root /root/.cache/apt/archives/partial - run: name: Update APT listing command: apt-get -qq update @@ -43,32 +50,37 @@ jobs: - v1-SRB2-APT - run: name: Install SDK - command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client - + command: apt-get -o Dir::Cache="/root/.cache/apt" -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client + - run: + name: make md5sum + command: find /root/.cache/apt/archives -type f -print0 | sort -z | xargs -r0 md5sum > /root/.cache/apt_archives.md5 - save_cache: - key: v1-SRB2-APT + key: v1-SRB2-APT-{{ checksum "/root/.cache/apt_archives.md5" }} paths: - - /var/cache/apt/archives + - /root/.cache/apt - checkout - run: name: Compile without network support - command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 + command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 -j4 - run: name: wipe build command: make -C src LINUX=1 cleandep - run: name: rebuild depend command: make -C src LINUX=1 clean + - run: + name: make master depend file + command: find make/linux/SDL/deps/ -type f -print0 | sort -z | xargs -r0 cat > make/linux/SDL.deps - restore_cache: keys: - - v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} + - v1-SRB2-{{ .Branch }}-{{ checksum "make/linux/SDL.deps" }} - run: name: Compile - command: make -C src LINUX=1 ERRORMODE=1 -k + command: make -C src LINUX=1 ERRORMODE=1 -k -j4 - store_artifacts: - path: /root/SRB2/bin/Linux/Release/ + path: /root/SRB2/bin/ destination: bin - save_cache: - key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} + key: v1-SRB2-{{ .Branch }}-{{ checksum "make/linux/SDL.deps" }} paths: - /root/.ccache From 6445ef3b70ec558b1782254fd7441a96788ecfbb Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 20:21:49 -0500 Subject: [PATCH 06/13] Update .gitignore Ignore CMake's build folders --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7023aaa80..cd828dc11 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ Win32_LIB_ASM_Release /assets/debian /make /bin +/build +/build.* From 7e0fa2d34c3449e21b907e78bbcc59f13ceca943 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 20:38:52 -0500 Subject: [PATCH 07/13] Cleanup whitespace changes from SRB2_release_2.2.9 --- extras/conf/SRB2-22.cfg | 2 +- src/b_bot.c | 10 +++++----- src/d_player.h | 4 ++-- src/hardware/hw_main.c | 4 ++-- src/p_mobj.c | 2 +- src/p_saveg.c | 6 +++--- src/r_skins.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 558014073..bf1d45f9d 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -6884,7 +6884,7 @@ thingtypes { color = 10; // Green title = "Tutorial"; - + 799 { title = "Tutorial Plant"; diff --git a/src/b_bot.c b/src/b_bot.c index 775a13e29..a12aedcf5 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -30,7 +30,7 @@ void B_UpdateBotleader(player_t *player) { if (players[i].bot || players[i].playerstate != PST_LIVE || players[i].spectator || !players[i].mo) continue; - + if (!player->botleader) { player->botleader = &players[i]; // set default @@ -85,7 +85,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) boolean stalled = (bmom < scale >> 1) && dist > followthres; // Helps to see if the AI is having trouble catching up boolean samepos = (sonic->x == tails->x && sonic->y == tails->y); boolean blocked = bot->blocked; - + if (!samepos) ang = R_PointToAngle2(tails->x, tails->y, sonic->x, sonic->y); @@ -448,10 +448,10 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward cmd->forwardmove += MAXPLMOVE<>16; if (backward) cmd->forwardmove -= MAXPLMOVE<>16; - if (left) + if (left) cmd->angleturn += 1280; if (right) - cmd->angleturn -= 1280; + cmd->angleturn -= 1280; if (strafeleft) cmd->sidemove -= MAXPLMOVE<>16; if (straferight) @@ -486,7 +486,7 @@ boolean B_CheckRespawn(player_t *player) //We don't have a main player to spawn to! if (!player->botleader) return false; - + sonic = player->botleader->mo; // We can't follow Sonic if he's not around! if (!sonic || sonic->health <= 0) diff --git a/src/d_player.h b/src/d_player.h index 755926480..c5c637d37 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -344,7 +344,7 @@ typedef struct botmem_s { boolean lastForward; boolean lastBlocked; - boolean blocked; + boolean blocked; UINT8 catchup_tics; UINT8 thinkstate; } botmem_t; @@ -565,7 +565,7 @@ typedef struct player_s UINT16 lastbuttons; botmem_t botmem; boolean blocked; - + tic_t jointime; // Timer when player joins game to change skin/color tic_t quittime; // Time elapsed since user disconnected, zero if connected #ifdef HWRENDER diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 92076e644..2bd7c5071 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -16,7 +16,7 @@ #ifdef HWRENDER #include "hw_glob.h" -#include "hw_light.h" +#include "hw_light.h #include "hw_drv.h" #include "hw_batching.h" @@ -3222,7 +3222,7 @@ static void HWR_Subsector(size_t num) *rover->topheight, *gl_frontsector->lightlist[light].lightlevel, rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, - HWR_RippleBlend(gl_frontsector, rover, false) | (rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent), + HWR_RippleBlend(gl_frontsector, rover, false) | (rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent), false, *gl_frontsector->lightlist[light].extra_colormap); } else diff --git a/src/p_mobj.c b/src/p_mobj.c index 17be0300a..fb3edfa43 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10477,7 +10477,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) if (type == MT_NULL) { -#if 0 +#if 0 #ifdef PARANOIA I_Error("Tried to spawn MT_NULL\n"); #endif diff --git a/src/p_saveg.c b/src/p_saveg.c index 99ec58bb9..ab7cf2347 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -202,7 +202,7 @@ static void P_NetArchivePlayers(void) WRITEUINT8(save_p, players[i].botmem.catchup_tics); WRITEUINT8(save_p, players[i].botmem.thinkstate); WRITEUINT8(save_p, players[i].removing); - + WRITEUINT8(save_p, players[i].blocked); WRITEUINT16(save_p, players[i].lastbuttons); @@ -424,7 +424,7 @@ static void P_NetUnArchivePlayers(void) // Bots // ////////// players[i].bot = READUINT8(save_p); - + players[i].botmem.lastForward = READUINT8(save_p); players[i].botmem.lastBlocked = READUINT8(save_p); players[i].botmem.catchup_tics = READUINT8(save_p); @@ -433,7 +433,7 @@ static void P_NetUnArchivePlayers(void) players[i].blocked = READUINT8(save_p); players[i].lastbuttons = READUINT16(save_p); - + //////////////////////////// // Conveyor Belt Movement // //////////////////////////// diff --git a/src/r_skins.c b/src/r_skins.c index cd53128d2..92fd6cfae 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -236,7 +236,7 @@ boolean R_SkinUsable(INT32 playernum, INT32 skinnum) // Force 2. return true; } - + if (metalrecording && skinnum == 5) { // Force 3. From 0c006dccdf22910a156bfcf7e0bb0becc536f49f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 20:46:28 -0500 Subject: [PATCH 08/13] Cleanup whitespace changes from SRB2_release_2.2.6 --- tools/masterserver/structure.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/masterserver/structure.sql b/tools/masterserver/structure.sql index 013c22383..d431419aa 100644 --- a/tools/masterserver/structure.sql +++ b/tools/masterserver/structure.sql @@ -90,7 +90,7 @@ CREATE TABLE `ms_versions` ( `mod_vstring` varchar(45) NOT NULL DEFAULT 'v1.0', `mod_codebase` int(10) unsigned NOT NULL DEFAULT 205, `mod_name` varchar(255) NOT NULL DEFAULT 'Default MOD Name', - `mod_url` text NOT NULL + `mod_url` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- @@ -118,4 +118,4 @@ COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; From 46186d763244b8ff0edae7899168173a4b543614 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 20:47:41 -0500 Subject: [PATCH 09/13] Cleanup whitespace changes from SRB2_release_2.2.2 --- src/blua/liolib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index 5eec97fb4..e029650c0 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -641,4 +641,3 @@ LUALIB_API int luaopen_io (lua_State *L) { lua_pop(L, 1); /* pop environment for default files */ return 1; } - From ebf70a6f0c98bd89b410fb74e7ec1a4d1209dfe9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 20:56:27 -0500 Subject: [PATCH 10/13] cleanup whitespace in CircleCI build config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a2f6ef9d1..711be39d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,7 @@ jobs: name: Install SDK command: apt-get -o Dir::Cache="/root/.cache/apt" -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client - run: - name: make md5sum + name: make md5sum command: find /root/.cache/apt/archives -type f -print0 | sort -z | xargs -r0 md5sum > /root/.cache/apt_archives.md5 - save_cache: key: v1-SRB2-APT-{{ checksum "/root/.cache/apt_archives.md5" }} From 4e1976839ba6350021f464f01258f26a52067047 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 21:07:24 -0500 Subject: [PATCH 11/13] Cleanup whitespace changes from SRB2_release_2.1.25 --- src/p_enemy.c | 2 +- src/p_user.c | 11 ++++++----- src/sdl/i_video.c | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 26682ee32..987e83c5e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -11827,7 +11827,7 @@ void A_FlickyCenter(mobj_t *actor) if (actor->target && P_AproxDistance(actor->target->x - originx, actor->target->y - originy) < actor->extravalue1) { actor->extravalue2 = 1; - P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z); + P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z); } else if(actor->extravalue2) { diff --git a/src/p_user.c b/src/p_user.c index 1f14d96c1..0765d3e26 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1,3 +1,4 @@ + // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. @@ -1518,8 +1519,8 @@ void P_PlayJingle(player_t *player, jingletype_t jingletype) char newmusic[7]; strncpy(newmusic, musname, 7); #ifdef HAVE_LUA_MUSICPLUS - if(LUAh_MusicJingle(jingletype, newmusic, &musflags, &looping)) - return; + if(LUAh_MusicJingle(jingletype, newmusic, &musflags, &looping)) + return; #endif newmusic[6] = 0; @@ -1609,7 +1610,7 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname) if (result) break; - } + } return result; } @@ -1666,8 +1667,8 @@ void P_RestoreMusic(player_t *player) else if (!S_RecallMusic(JT_NONE, false)) // go down the stack { CONS_Debug(DBG_BASIC, "Cannot find any music in resume stack!\n"); - S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); - } + S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); + } } // diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index a27a5ebd2..ae661761c 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1,3 +1,4 @@ + // Emacs style mode select -*- C++ -*- // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- @@ -1068,7 +1069,7 @@ void I_GetEvent(void) // update the menu if (currentMenu == &OP_JoystickSetDef) M_SetupJoystickMenu(0); - break; + break; case SDL_QUIT: LUA_HookBool(true, HOOK(GameQuit)); I_Quit(); From e1fd0dfca3918c4a1c4a1117620cc593733429a5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 21:11:44 -0500 Subject: [PATCH 12/13] Cleanup whitespace changes from SRB2_release_2.1.23 --- src/p_setup.c | 2 +- src/s_sound.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index a1c96bed3..8ec5672d2 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1250,7 +1250,7 @@ static void P_LoadSidedefs(UINT8 *data) sd->midtexture = get_number(process); } - sd->text = Z_Malloc(7, PU_LEVEL, NULL); + sd->text = Z_Malloc(7, PU_LEVEL, NULL); if (isfrontside && !(msd->toptexture[0] == '-' && msd->toptexture[1] == '\0')) { M_Memcpy(process,msd->toptexture,8); diff --git a/src/s_sound.c b/src/s_sound.c index 7e61e8a55..fc5f51da7 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2259,9 +2259,9 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 return; newmusic[6] = 0; - // No Music (empty string) + // No Music (empty string) if (newmusic[0] == 0) - { + { if (prefadems) I_FadeSong(0, prefadems, &S_StopMusic); else @@ -2279,7 +2279,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 } else if (strnicmp(music_name, newmusic, 6) || (mflags & MUSIC_FORCERESET) || (midipref != currentmidi && S_PrefAvailable(midipref, newmusic))) - { + { CONS_Debug(DBG_DETAILED, "Now playing song %s\n", newmusic); S_StopMusic(); @@ -2302,7 +2302,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 { I_SetSongPosition(position); I_FadeSong(100, fadeinms, NULL); - } +} else // reset volume to 100 with same music { I_StopFadingSong(); From 9b4d6a21096258479645364bc45b545968ea4145 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 11 Nov 2022 21:46:28 -0500 Subject: [PATCH 13/13] Fix Typo --- src/hardware/hw_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2bd7c5071..cda353d76 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -16,7 +16,7 @@ #ifdef HWRENDER #include "hw_glob.h" -#include "hw_light.h +#include "hw_light.h" #include "hw_drv.h" #include "hw_batching.h"