From a4459b6693b969088ae307020d664910ae2aee95 Mon Sep 17 00:00:00 2001 From: Zippy_Zolton Date: Fri, 23 Oct 2020 00:47:47 -0500 Subject: [PATCH 01/14] Dash state for Tails overlay --- src/dehacked.c | 1 + src/info.c | 3 +++ src/info.h | 1 + src/p_user.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index ca013a25d..34fe58362 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5178,6 +5178,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_TAILSOVERLAY_PAIN", "S_TAILSOVERLAY_GASP", "S_TAILSOVERLAY_EDGE", + "S_TAILSOVERLAY_DASH", // [: "S_JETFUMEFLASH", diff --git a/src/info.c b/src/info.c index cb5fb0889..8cdfaa8a0 100644 --- a/src/info.c +++ b/src/info.c @@ -584,6 +584,7 @@ char spr2names[NUMPLAYERSPRITES][5] = "TAL9", "TALA", "TALB", + "TALC", "CNT1", "CNT2", @@ -661,6 +662,7 @@ playersprite_t spr2defaults[NUMPLAYERSPRITES] = { SPR2_TAL0, // SPR2_TAL9, SPR2_TAL9, // SPR2_TALA, SPR2_TAL0, // SPR2_TALB, + SPR2_TAL0, // SPR2_TALC, SPR2_WAIT, // SPR2_CNT1, SPR2_FALL, // SPR2_CNT2, @@ -801,6 +803,7 @@ state_t states[NUMSTATES] = {SPR_PLAY, SPR2_TAL9|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_PAIN}, // S_TAILSOVERLAY_PAIN {SPR_PLAY, SPR2_TALA|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_GASP}, // S_TAILSOVERLAY_GASP {SPR_PLAY, SPR2_TALB , 35, {NULL}, 0, 0, S_TAILSOVERLAY_EDGE}, // S_TAILSOVERLAY_EDGE + {SPR_PLAY, SPR2_TALC|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_DASH}, // S_TAILSOVERLAY_DASH // [: {SPR_JETF, 3|FF_ANIMATE|FF_FULLBRIGHT, 2, {NULL}, 1, 1, S_JETFUME1}, // S_JETFUMEFLASH diff --git a/src/info.h b/src/info.h index 721ebf7f2..8130cf948 100644 --- a/src/info.h +++ b/src/info.h @@ -997,6 +997,7 @@ typedef enum state S_TAILSOVERLAY_PAIN, S_TAILSOVERLAY_GASP, S_TAILSOVERLAY_EDGE, + S_TAILSOVERLAY_DASH, // [: S_JETFUMEFLASH, diff --git a/src/p_user.c b/src/p_user.c index 0d7331293..da33f1dbb 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11208,6 +11208,8 @@ static void P_DoTailsOverlay(player_t *player, mobj_t *tails) chosenstate = S_TAILSOVERLAY_EDGE; else if (player->panim == PA_RUN) chosenstate = S_TAILSOVERLAY_RUN; + else if (player->panim == PA_DASH) + chosenstate = S_TAILSOVERLAY_DASH; else if (player->panim == PA_WALK) { if (!smilesonground || player->mo->state-states == S_PLAY_SKID) From c0571b5fbf41918842f8b6fecf5854572ed7635b Mon Sep 17 00:00:00 2001 From: Zippy_Zolton Date: Fri, 23 Oct 2020 01:09:12 -0500 Subject: [PATCH 02/14] g --- src/info.h | 1 + src/p_user.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/info.h b/src/info.h index 8130cf948..d84461617 100644 --- a/src/info.h +++ b/src/info.h @@ -856,6 +856,7 @@ typedef enum playersprite SPR2_TAL9, SPR2_TALA, SPR2_TALB, + SPR2_TALC, SPR2_CNT1, // continue disappointment SPR2_CNT2, // continue lift diff --git a/src/p_user.c b/src/p_user.c index da33f1dbb..051965eb5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11206,10 +11206,10 @@ static void P_DoTailsOverlay(player_t *player, mobj_t *tails) chosenstate = S_TAILSOVERLAY_GASP; else if (player->mo->state-states == S_PLAY_EDGE) chosenstate = S_TAILSOVERLAY_EDGE; - else if (player->panim == PA_RUN) - chosenstate = S_TAILSOVERLAY_RUN; else if (player->panim == PA_DASH) chosenstate = S_TAILSOVERLAY_DASH; + else if (player->panim == PA_RUN) + chosenstate = S_TAILSOVERLAY_RUN; else if (player->panim == PA_WALK) { if (!smilesonground || player->mo->state-states == S_PLAY_SKID) From 85692ac4090c68dc4bc519f230b7d69226b47263 Mon Sep 17 00:00:00 2001 From: Zolton Auburn Date: Fri, 23 Oct 2020 14:04:02 -0400 Subject: [PATCH 03/14] Update info.c --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 8cdfaa8a0..29a79b1d6 100644 --- a/src/info.c +++ b/src/info.c @@ -662,7 +662,7 @@ playersprite_t spr2defaults[NUMPLAYERSPRITES] = { SPR2_TAL0, // SPR2_TAL9, SPR2_TAL9, // SPR2_TALA, SPR2_TAL0, // SPR2_TALB, - SPR2_TAL0, // SPR2_TALC, + SPR2_TAL6, // SPR2_TALC, SPR2_WAIT, // SPR2_CNT1, SPR2_FALL, // SPR2_CNT2, From 5d4032fd0067426a6cb7caf1bbeaf4b8ec2ac093 Mon Sep 17 00:00:00 2001 From: Zippy_Zolton Date: Sat, 24 Oct 2020 12:38:30 -0500 Subject: [PATCH 04/14] Ghost mobj matches rollangle --- src/p_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_user.c b/src/p_user.c index 0d7331293..02b807bf2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2029,6 +2029,7 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj) ghost->colorized = mobj->colorized; // alternatively, "true" for sonic advance style colourisation ghost->angle = (mobj->player ? mobj->player->drawangle : mobj->angle); + ghost->rollangle = mobj->rollangle; ghost->sprite = mobj->sprite; ghost->sprite2 = mobj->sprite2; ghost->frame = mobj->frame; From 244c76250f1f88e9a4ada14a4671a1770d938d5a Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Sat, 24 Oct 2020 20:52:54 +0300 Subject: [PATCH 05/14] Use SSE3 in 32-bit x86 binaries --- src/CMakeLists.txt | 1 + src/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3409c49d3..3514fb477 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -549,6 +549,7 @@ if(${SRB2_CONFIG_USEASM}) endif() set(SRB2_USEASM ON) add_definitions(-DUSEASM) + set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -msse3 -mfpmath=sse) else() set(SRB2_USEASM OFF) add_definitions(-DNONX86 -DNORUSEASM) diff --git a/src/Makefile b/src/Makefile index 2fe0b26cd..5d5db056f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -277,7 +277,7 @@ OPTS += -DCOMPVERSION ifndef NONX86 ifndef GCC29 - ARCHOPTS?=-march=pentium + ARCHOPTS?=-msse3 -mfpmath=sse else ARCHOPTS?=-mpentium endif From 305f58077d13b39ba9e9fca91b69f6aecf6cb8ed Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 24 Oct 2020 15:29:31 -0700 Subject: [PATCH 06/14] Fix objectplace -silent --- src/m_cheat.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 349f00c48..88f6aaf4a 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1440,14 +1440,21 @@ void Command_Writethings_f(void) void Command_ObjectPlace_f(void) { + size_t thingarg; + size_t silent; + REQUIRE_INLEVEL; REQUIRE_SINGLEPLAYER; REQUIRE_NOULTIMATE; G_SetGameModified(multiplayer); + silent = COM_CheckParm("-silent"); + + thingarg = 2 - ( silent > 1 ); + // Entering objectplace? - if (!objectplacing || COM_Argc() > 1) + if (!objectplacing || thingarg < COM_Argc()) { if (!objectplacing) { @@ -1456,7 +1463,7 @@ void Command_ObjectPlace_f(void) if (players[0].powers[pw_carry] == CR_NIGHTSMODE) return; - if (!COM_CheckParm("-silent")) + if (! silent) { HU_SetCEchoFlags(V_RETURN8|V_MONOSPACE|V_AUTOFADEOUT); HU_SetCEchoDuration(10); @@ -1507,9 +1514,9 @@ void Command_ObjectPlace_f(void) op_oldstate = (statenum_t)(players[0].mo->state-states); } - if (COM_Argc() > 1) + if (thingarg < COM_Argc()) { - UINT16 mapthingnum = atoi(COM_Argv(1)); + UINT16 mapthingnum = atoi(COM_Argv(thingarg)); mobjtype_t type = P_GetMobjtype(mapthingnum); if (type == MT_UNKNOWN) CONS_Printf(M_GetText("No mobj type delegated to thing type %d.\n"), mapthingnum); From afb8e6e1815c75c089a4bd1c684fc4c6bcc7f2d5 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 24 Oct 2020 20:44:42 -0700 Subject: [PATCH 07/14] Whoops --- src/m_cheat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 88f6aaf4a..8e9cd9f51 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1451,7 +1451,7 @@ void Command_ObjectPlace_f(void) silent = COM_CheckParm("-silent"); - thingarg = 2 - ( silent > 1 ); + thingarg = 2 - ( silent != 1 ); // Entering objectplace? if (!objectplacing || thingarg < COM_Argc()) From 5241b83f979da3525c6b6929b0253eceea6fa7ce Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 28 Oct 2020 19:36:03 +0000 Subject: [PATCH 08/14] Fix seg->length and flength not being set at all for UDMF maps --- src/p_setup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_setup.c b/src/p_setup.c index 7747f6462..8e09c34df 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2401,6 +2401,10 @@ static boolean P_LoadExtendedSubsectorsAndSegs(UINT8 **data, nodetype_t nodetype seg->angle = R_PointToAngle2(v1->x, v1->y, v2->x, v2->y); if (seg->linedef) segs[i].offset = FixedHypot(v1->x - seg->linedef->v1->x, v1->y - seg->linedef->v1->y); + seg->length = P_SegLength(seg); +#ifdef HWRENDER + seg->flength = (rendermode == render_opengl) ? P_SegLengthFloat(seg) : 0; +#endif } return true; From c44120eb8756b5acfb6e8b9feb25be89dab3ef43 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Thu, 29 Oct 2020 16:04:25 +0200 Subject: [PATCH 09/14] Fix some copyright statements in new files --- src/hardware/hw_batching.c | 3 +-- src/hardware/hw_batching.h | 3 +-- src/m_perfstats.c | 3 +-- src/m_perfstats.h | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_batching.c b/src/hardware/hw_batching.c index a63be3a72..5ea9f55d4 100644 --- a/src/hardware/hw_batching.c +++ b/src/hardware/hw_batching.c @@ -1,7 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2020 by Sonic Team Junior. +// Copyright (C) 2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/hardware/hw_batching.h b/src/hardware/hw_batching.h index 7c108a4bd..3d22324ac 100644 --- a/src/hardware/hw_batching.h +++ b/src/hardware/hw_batching.h @@ -1,7 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2020 by Sonic Team Junior. +// Copyright (C) 2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_perfstats.c b/src/m_perfstats.c index df1e31b5e..085adda80 100644 --- a/src/m_perfstats.c +++ b/src/m_perfstats.c @@ -1,7 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2020 by Sonic Team Junior. +// Copyright (C) 2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. diff --git a/src/m_perfstats.h b/src/m_perfstats.h index 1db46025e..01a818c1c 100644 --- a/src/m_perfstats.h +++ b/src/m_perfstats.h @@ -1,7 +1,6 @@ // SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2020 by Sonic Team Junior. +// Copyright (C) 2020 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. From d406340b5dd4f2768354aa2833fa613b426c281e Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 30 Oct 2020 23:37:34 -0400 Subject: [PATCH 10/14] Fix compiling using cmake if internal libs is used --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3409c49d3..4ee586f36 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -230,7 +230,7 @@ set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL set(SRB2_CONFIG_HAVE_OPENMPT ON CACHE BOOL "Enable OpenMPT support.") set(SRB2_CONFIG_HAVE_CURL ON CACHE BOOL - "Enable curl support, used for downloading files via HTTP.") + "Enable curl support.") set(SRB2_CONFIG_HAVE_THREADS ON CACHE BOOL "Enable multithreading support.") if(${CMAKE_SYSTEM} MATCHES Windows) @@ -455,7 +455,7 @@ endif() if(${SRB2_CONFIG_HAVE_CURL}) if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) set(CURL_FOUND ON) - set(CURL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/curl) + set(CURL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/curl/include) if(${SRB2_SYSTEM_BITS} EQUAL 64) set(CURL_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/curl/lib64 -lcurl") else() # 32-bit From 62b5b86ed449f88659f45424f82f7b158611ae02 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 31 Oct 2020 00:59:51 -0400 Subject: [PATCH 11/14] CMake: Fix fullscreen toggle not working All because of a typo --- src/sdl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index bb5edf817..a7f015c86 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -272,7 +272,7 @@ if(${SDL2_FOUND}) endif() target_compile_definitions(SRB2SDL2 PRIVATE - -DDDIRECTFULLSCREEN -DHAVE_SDL + -DDIRECTFULLSCREEN -DHAVE_SDL ) ## strip debug symbols into separate file when using gcc. From bfbcc6910847166b90a8e9f5cc61ec28aee03540 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sat, 31 Oct 2020 18:21:14 +1100 Subject: [PATCH 12/14] Draw save files from outwards in --- src/m_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6e0d520ae..5860f00ca 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8246,7 +8246,7 @@ static void M_CacheLoadGameData(void) static void M_DrawLoadGameData(void) { - INT32 i, savetodraw, x, y, hsep = 90; + INT32 i, prev_i = 1, savetodraw, x, y, hsep = 90; skin_t *charskin = NULL; if (vid.width != BASEVIDWIDTH*vid.dupx) @@ -8255,8 +8255,9 @@ static void M_DrawLoadGameData(void) if (needpatchrecache) M_CacheLoadGameData(); - for (i = -2; i <= 2; i++) + for (i = 2; prev_i; i = -(i + ((UINT32)i >> 31))) // draws from outwards in; 2, -2, 1, -1, 0 { + prev_i = i; savetodraw = (saveSlotSelected + i + numsaves)%numsaves; x = (BASEVIDWIDTH/2 - 42 + loadgamescroll) + (i*hsep); y = 33 + 9; From 54cc9db7a5de4bda6b0b01883009b8340e8f2d92 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Sat, 31 Oct 2020 18:04:44 +0200 Subject: [PATCH 13/14] Fix CMake SSE3 flag --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3514fb477..f201e43ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -549,7 +549,7 @@ if(${SRB2_CONFIG_USEASM}) endif() set(SRB2_USEASM ON) add_definitions(-DUSEASM) - set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -msse3 -mfpmath=sse) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -mfpmath=sse") else() set(SRB2_USEASM OFF) add_definitions(-DNONX86 -DNORUSEASM) From 41d8210fd5ff71db25741fc2e481d4a70dd5dcec Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 31 Oct 2020 16:36:15 -0400 Subject: [PATCH 14/14] Expose gamestate to Lua --- src/dehacked.c | 17 +++++++++++++++++ src/lua_script.c | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index ca013a25d..a3f78edd4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -38,6 +38,7 @@ #include "lua_script.h" #include "lua_hook.h" #include "d_clisrv.h" +#include "g_state.h" // gamestate_t (for lua) #include "m_cond.h" @@ -10106,6 +10107,22 @@ struct { {"MA_NOCUTSCENES",MA_NOCUTSCENES}, {"MA_INGAME",MA_INGAME}, + // gamestates + {"GS_NULL",GS_NULL}, + {"GS_LEVEL",GS_LEVEL}, + {"GS_INTERMISSION",GS_INTERMISSION}, + {"GS_CONTINUING",GS_CONTINUING}, + {"GS_TITLESCREEN",GS_TITLESCREEN}, + {"GS_TIMEATTACK",GS_TIMEATTACK}, + {"GS_CREDITS",GS_CREDITS}, + {"GS_EVALUATION",GS_EVALUATION}, + {"GS_GAMEEND",GS_GAMEEND}, + {"GS_INTRO",GS_INTRO}, + {"GS_ENDING",GS_ENDING}, + {"GS_CUTSCENE",GS_CUTSCENE}, + {"GS_DEDICATEDSERVER",GS_DEDICATEDSERVER}, + {"GS_WAITINGPLAYERS",GS_WAITINGPLAYERS}, + {NULL,0} }; diff --git a/src/lua_script.c b/src/lua_script.c index ae7f479f6..6e40cb785 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -34,6 +34,7 @@ #include "lua_hook.h" #include "doomstat.h" +#include "g_state.h" lua_State *gL = NULL; @@ -361,6 +362,9 @@ int LUA_PushGlobals(lua_State *L, const char *word) } else if (fastcmp(word, "token")) { lua_pushinteger(L, token); return 1; + } else if (fastcmp(word, "gamestate")) { + lua_pushinteger(L, gamestate); + return 1; } return 0; }