diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa5948ded..a1f752ed7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -232,7 +232,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) @@ -458,7 +458,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 @@ -552,6 +552,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 8ad7ecf5a..da918e205 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 diff --git a/src/dehacked.c b/src/dehacked.c index ae22e19d5..df0fe6f50 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -39,6 +39,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" @@ -5179,6 +5180,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", @@ -10122,6 +10124,22 @@ struct { {"MU_MOD_EX", MU_MOD_EX}, {"MU_MID_EX", MU_MID_EX}, + // 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/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/info.c b/src/info.c index cb5fb0889..29a79b1d6 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_TAL6, // 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..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 @@ -997,6 +998,7 @@ typedef enum state S_TAILSOVERLAY_PAIN, S_TAILSOVERLAY_GASP, S_TAILSOVERLAY_EDGE, + S_TAILSOVERLAY_DASH, // [: S_JETFUMEFLASH, 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; } diff --git a/src/m_cheat.c b/src/m_cheat.c index 349f00c48..8e9cd9f51 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); 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; 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. 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; diff --git a/src/p_user.c b/src/p_user.c index 0d7331293..f9593158f 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; @@ -11206,6 +11207,8 @@ 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_DASH) + chosenstate = S_TAILSOVERLAY_DASH; else if (player->panim == PA_RUN) chosenstate = S_TAILSOVERLAY_RUN; else if (player->panim == PA_WALK) 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.