From 4244480d6345148cd8d0e330e50494f9bf4114b8 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 22 Feb 2020 14:43:41 -0800 Subject: [PATCH 01/34] Add patch_music.pk3 --- src/d_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_main.c b/src/d_main.c index 904ab3bf1..2792122e6 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -963,6 +963,7 @@ static void IdentifyVersion(void) } MUSICTEST("music.dta") + MUSICTEST("patch_music.pk3") #ifdef DEVELOP // remove when music_new.dta is merged into music.dta MUSICTEST("music_new.dta") #endif From da122ca2fd195b6defdf4cc108f3e59e9fd313e4 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 24 Feb 2020 17:56:00 -0600 Subject: [PATCH 02/34] Fix missing menuname entries --- src/dehacked.c | 5 +++++ src/m_menu.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index dea0289b9..55a531347 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9209,6 +9209,7 @@ static const char *const MENUTYPES_LIST[] = { "MP_CONNECT", "MP_ROOM", "MP_PLAYERSETUP", // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET + "MP_SERVER_OPTIONS", // Options "OP_MAIN", @@ -9218,10 +9219,14 @@ static const char *const MENUTYPES_LIST[] = { "OP_P1MOUSE", "OP_P1JOYSTICK", "OP_JOYSTICKSET", // OP_JoystickSetDef shared with P2 + "OP_P1CAMERA", "OP_P2CONTROLS", "OP_P2MOUSE", "OP_P2JOYSTICK", + "OP_P2CAMERA", + + "OP_PLAYSTYLE", "OP_VIDEO", "OP_VIDEOMODE", diff --git a/src/m_menu.h b/src/m_menu.h index 18b681ff0..6cfa9ef71 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -30,6 +30,9 @@ #define MENUBITS 6 // Menu IDs sectioned by numeric places to signify hierarchy +/** + * IF YOU MODIFY THIS, MODIFY MENUTYPES_LIST[] IN dehacked.c TO MATCH. + */ typedef enum { MN_NONE, From 141df606c2109e97e14aa47f52dd381dba622192 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 24 Feb 2020 18:00:17 -0600 Subject: [PATCH 03/34] Use a named macro for menu hierarchy This _really_ needs to be a UINT8 array instead of all this bit-shifting nonsense that saves no space, but at least this way reading the menu structs doesn't make me want to die. --- src/m_menu.c | 126 +++++++++++++++++++++++++-------------------------- src/m_menu.h | 3 ++ 2 files changed, 66 insertions(+), 63 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 945ce3de0..53ad6b12c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1687,7 +1687,7 @@ static INT32 highlightflags, recommendedflags, warningflags; // Sky Room menu_t SR_PandoraDef = { - MN_SR_MAIN + (MN_SR_PANDORA << 6), + MTREE2(MN_SR_MAIN, MN_SR_PANDORA), "M_PANDRA", sizeof (SR_PandorasBox)/sizeof (menuitem_t), &SPauseDef, @@ -1701,12 +1701,12 @@ menu_t SR_PandoraDef = menu_t SR_MainDef = DEFAULTMENUSTYLE(MN_SR_MAIN, "M_SECRET", SR_MainMenu, &MainDef, 60, 40); menu_t SR_LevelSelectDef = MAPPLATTERMENUSTYLE( - MN_SR_MAIN + (MN_SR_LEVELSELECT << 6), + MTREE2(MN_SR_MAIN, MN_SR_LEVELSELECT), NULL, SR_LevelSelectMenu); menu_t SR_UnlockChecklistDef = { - MN_SR_MAIN + (MN_SR_UNLOCKCHECKLIST << 6), + MTREE2(MN_SR_MAIN, MN_SR_UNLOCKCHECKLIST), "M_SECRET", 1, &SR_MainDef, @@ -1719,7 +1719,7 @@ menu_t SR_UnlockChecklistDef = menu_t SR_SoundTestDef = { - MN_SR_MAIN + (MN_SR_SOUNDTEST << 6), + MTREE2(MN_SR_MAIN, MN_SR_SOUNDTEST), NULL, sizeof (SR_SoundTestMenu)/sizeof (menuitem_t), &SR_MainDef, @@ -1732,7 +1732,7 @@ menu_t SR_SoundTestDef = menu_t SR_EmblemHintDef = { - MN_SR_MAIN + (MN_SR_EMBLEMHINT << 6), + MTREE2(MN_SR_MAIN, MN_SR_EMBLEMHINT), NULL, sizeof (SR_EmblemHintMenu)/sizeof (menuitem_t), &SPauseDef, @@ -1759,7 +1759,7 @@ menu_t SP_MainDef = //CENTERMENUSTYLE(NULL, SP_MainMenu, &MainDef, 72); menu_t SP_LoadDef = { - MN_SP_MAIN + (MN_SP_LOAD << 6), + MTREE2(MN_SP_MAIN, MN_SP_LOAD), "M_PICKG", 1, &SP_MainDef, @@ -1771,12 +1771,12 @@ menu_t SP_LoadDef = }; menu_t SP_LevelSelectDef = MAPPLATTERMENUSTYLE( - MN_SP_MAIN + (MN_SP_LOAD << 6) + (MN_SP_PLAYER << 12) + (MN_SP_LEVELSELECT << 18), + MTREE4(MN_SP_MAIN, MN_SP_LOAD, MN_SP_PLAYER, MN_SP_LEVELSELECT), NULL, SP_LevelSelectMenu); menu_t SP_LevelStatsDef = { - MN_SP_MAIN + (MN_SP_LEVELSTATS << 6), + MTREE2(MN_SP_MAIN, MN_SP_LEVELSTATS), "M_STATS", 1, &SP_MainDef, @@ -1788,12 +1788,12 @@ menu_t SP_LevelStatsDef = }; menu_t SP_TimeAttackLevelSelectDef = MAPPLATTERMENUSTYLE( - MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_TIMEATTACK_LEVELSELECT << 12), + MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_TIMEATTACK_LEVELSELECT), "M_ATTACK", SP_TimeAttackLevelSelectMenu); static menu_t SP_TimeAttackDef = { - MN_SP_MAIN + (MN_SP_TIMEATTACK << 6), + MTREE2(MN_SP_MAIN, MN_SP_TIMEATTACK), "M_ATTACK", sizeof (SP_TimeAttackMenu)/sizeof (menuitem_t), &MainDef, // Doesn't matter. @@ -1805,7 +1805,7 @@ static menu_t SP_TimeAttackDef = }; static menu_t SP_ReplayDef = { - MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_REPLAY << 12), + MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_REPLAY), "M_ATTACK", sizeof(SP_ReplayMenu)/sizeof(menuitem_t), &SP_TimeAttackDef, @@ -1817,7 +1817,7 @@ static menu_t SP_ReplayDef = }; static menu_t SP_GuestReplayDef = { - MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_GUESTREPLAY << 12), + MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_GUESTREPLAY), "M_ATTACK", sizeof(SP_GuestReplayMenu)/sizeof(menuitem_t), &SP_TimeAttackDef, @@ -1829,7 +1829,7 @@ static menu_t SP_GuestReplayDef = }; static menu_t SP_GhostDef = { - MN_SP_MAIN + (MN_SP_TIMEATTACK << 6) + (MN_SP_GHOST << 12), + MTREE3(MN_SP_MAIN, MN_SP_TIMEATTACK, MN_SP_GHOST), "M_ATTACK", sizeof(SP_GhostMenu)/sizeof(menuitem_t), &SP_TimeAttackDef, @@ -1841,12 +1841,12 @@ static menu_t SP_GhostDef = }; menu_t SP_NightsAttackLevelSelectDef = MAPPLATTERMENUSTYLE( - MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_LEVELSELECT << 12), + MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_LEVELSELECT), "M_NIGHTS", SP_NightsAttackLevelSelectMenu); static menu_t SP_NightsAttackDef = { - MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6), + MTREE2(MN_SP_MAIN, MN_SP_NIGHTSATTACK), "M_NIGHTS", sizeof (SP_NightsAttackMenu)/sizeof (menuitem_t), &MainDef, // Doesn't matter. @@ -1858,7 +1858,7 @@ static menu_t SP_NightsAttackDef = }; static menu_t SP_NightsReplayDef = { - MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_REPLAY << 12), + MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_REPLAY), "M_NIGHTS", sizeof(SP_NightsReplayMenu)/sizeof(menuitem_t), &SP_NightsAttackDef, @@ -1870,7 +1870,7 @@ static menu_t SP_NightsReplayDef = }; static menu_t SP_NightsGuestReplayDef = { - MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_GUESTREPLAY << 12), + MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_GUESTREPLAY), "M_NIGHTS", sizeof(SP_NightsGuestReplayMenu)/sizeof(menuitem_t), &SP_NightsAttackDef, @@ -1882,7 +1882,7 @@ static menu_t SP_NightsGuestReplayDef = }; static menu_t SP_NightsGhostDef = { - MN_SP_MAIN + (MN_SP_NIGHTSATTACK << 6) + (MN_SP_NIGHTS_GHOST << 12), + MTREE3(MN_SP_MAIN, MN_SP_NIGHTSATTACK, MN_SP_NIGHTS_GHOST), "M_NIGHTS", sizeof(SP_NightsGhostMenu)/sizeof(menuitem_t), &SP_NightsAttackDef, @@ -1896,7 +1896,7 @@ static menu_t SP_NightsGhostDef = menu_t SP_PlayerDef = { - MN_SP_MAIN + (MN_SP_LOAD << 6) + (MN_SP_PLAYER << 12), + MTREE3(MN_SP_MAIN, MN_SP_LOAD, MN_SP_PLAYER), "M_PICKP", sizeof (SP_PlayerMenu)/sizeof (menuitem_t), &SP_MainDef, @@ -1911,7 +1911,7 @@ menu_t SP_PlayerDef = menu_t MP_SplitServerDef = { - MN_MP_MAIN + (MN_MP_SPLITSCREEN << 6), + MTREE2(MN_MP_MAIN, MN_MP_SPLITSCREEN), "M_MULTI", sizeof (MP_SplitServerMenu)/sizeof (menuitem_t), #ifndef NONET @@ -1943,7 +1943,7 @@ menu_t MP_MainDef = menu_t MP_ServerDef = { - MN_MP_MAIN + (MN_MP_SERVER << 6), + MTREE2(MN_MP_MAIN, MN_MP_SERVER), "M_MULTI", sizeof (MP_ServerMenu)/sizeof (menuitem_t), &MP_MainDef, @@ -1956,7 +1956,7 @@ menu_t MP_ServerDef = menu_t MP_ConnectDef = { - MN_MP_MAIN + (MN_MP_CONNECT << 6), + MTREE2(MN_MP_MAIN, MN_MP_CONNECT), "M_MULTI", sizeof (MP_ConnectMenu)/sizeof (menuitem_t), &MP_MainDef, @@ -1969,7 +1969,7 @@ menu_t MP_ConnectDef = menu_t MP_RoomDef = { - MN_MP_MAIN + (MN_MP_ROOM << 6), + MTREE2(MN_MP_MAIN, MN_MP_ROOM), "M_MULTI", sizeof (MP_RoomMenu)/sizeof (menuitem_t), &MP_ConnectDef, @@ -1984,9 +1984,9 @@ menu_t MP_RoomDef = menu_t MP_PlayerSetupDef = { #ifdef NONET - MN_MP_MAIN + (MN_MP_PLAYERSETUP << 6), + MTREE2(MN_MP_MAIN, MN_MP_PLAYERSETUP), #else - MN_MP_MAIN + (MN_MP_SPLITSCREEN << 6) + (MN_MP_PLAYERSETUP << 12), + MTREE3(MN_MP_MAIN, MN_MP_SPLITSCREEN, MN_MP_PLAYERSETUP), #endif "M_SPLAYR", sizeof (MP_PlayerSetupMenu)/sizeof (menuitem_t), @@ -2002,12 +2002,13 @@ menu_t MP_PlayerSetupDef = menu_t OP_MainDef = DEFAULTMENUSTYLE( MN_OP_MAIN, "M_OPTTTL", OP_MainMenu, &MainDef, 50, 30); + menu_t OP_ChangeControlsDef = CONTROLMENUSTYLE( - MN_OP_MAIN + (MN_OP_CHANGECONTROLS << 12), // second level (<<6) set on runtime + MTREE3(MN_OP_MAIN, 0, MN_OP_CHANGECONTROLS), // second level set on runtime OP_ChangeControlsMenu, &OP_MainDef); menu_t OP_P1ControlsDef = { - MN_OP_MAIN + (MN_OP_P1CONTROLS << 6), + MTREE2(MN_OP_MAIN, MN_OP_P1CONTROLS), "M_CONTRO", sizeof(OP_P1ControlsMenu)/sizeof(menuitem_t), &OP_MainDef, @@ -2015,7 +2016,7 @@ menu_t OP_P1ControlsDef = { M_DrawControlsDefMenu, 50, 30, 0, NULL}; menu_t OP_P2ControlsDef = { - MN_OP_MAIN + (MN_OP_P2CONTROLS << 6), + MTREE2(MN_OP_MAIN, MN_OP_P2CONTROLS), "M_CONTRO", sizeof(OP_P2ControlsMenu)/sizeof(menuitem_t), &OP_MainDef, @@ -2024,20 +2025,22 @@ menu_t OP_P2ControlsDef = { 50, 30, 0, NULL}; menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1MOUSE << 12), + MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_P1MOUSE), "M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 35, 30); menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2MOUSE << 12), + MTREE3(MN_OP_MAIN, MN_OP_P2CONTROLS, MN_OP_P2MOUSE), "M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 35, 30); + menu_t OP_Joystick1Def = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1JOYSTICK << 12), + MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_P1JOYSTICK), "M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 50, 30); menu_t OP_Joystick2Def = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2JOYSTICK << 12), + MTREE3(MN_OP_MAIN, MN_OP_P2CONTROLS, MN_OP_P2JOYSTICK), "M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 50, 30); + menu_t OP_JoystickSetDef = { - MN_OP_MAIN + (MN_OP_JOYSTICKSET << MENUBITS*3), // second (<<6) and third level (<<12) set on runtime + MTREE4(MN_OP_MAIN, 0, 0, MN_OP_JOYSTICKSET), // second and third level set on runtime "M_CONTRO", sizeof (OP_JoystickSetMenu)/sizeof (menuitem_t), &OP_Joystick1Def, @@ -2049,7 +2052,7 @@ menu_t OP_JoystickSetDef = }; menu_t OP_CameraOptionsDef = { - MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1CAMERA << 12), + MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_P1CAMERA), "M_CONTRO", sizeof (OP_CameraOptionsMenu)/sizeof (menuitem_t), &OP_P1ControlsDef, @@ -2060,7 +2063,7 @@ menu_t OP_CameraOptionsDef = { NULL }; menu_t OP_Camera2OptionsDef = { - MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2CAMERA << 12), + MTREE3(MN_OP_MAIN, MN_OP_P2CONTROLS, MN_OP_P2CAMERA), "M_CONTRO", sizeof (OP_Camera2OptionsMenu)/sizeof (menuitem_t), &OP_P2ControlsDef, @@ -2074,7 +2077,7 @@ menu_t OP_Camera2OptionsDef = { static menuitem_t OP_PlaystyleMenu[] = {{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandlePlaystyleMenu, 0}}; menu_t OP_PlaystyleDef = { - MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_PLAYSTYLE << 12), + MTREE3(MN_OP_MAIN, MN_OP_P1CONTROLS, MN_OP_PLAYSTYLE), ///@TODO the second level should be set in runtime NULL, 1, &OP_P1ControlsDef, @@ -2086,7 +2089,7 @@ menu_t OP_PlaystyleDef = { menu_t OP_VideoOptionsDef = { - MN_OP_MAIN + (MN_OP_VIDEO << 6), + MTREE2(MN_OP_MAIN, MN_OP_VIDEO), "M_VIDEO", sizeof (OP_VideoOptionsMenu)/sizeof (menuitem_t), &OP_MainDef, @@ -2098,7 +2101,7 @@ menu_t OP_VideoOptionsDef = }; menu_t OP_VideoModeDef = { - MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_VIDEOMODE << 12), + MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_VIDEOMODE), "M_VIDEO", 1, &OP_VideoOptionsDef, @@ -2110,7 +2113,7 @@ menu_t OP_VideoModeDef = }; menu_t OP_ColorOptionsDef = { - MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_COLOR << 12), + MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_COLOR), "M_VIDEO", sizeof (OP_ColorOptionsMenu)/sizeof (menuitem_t), &OP_VideoOptionsDef, @@ -2121,17 +2124,19 @@ menu_t OP_ColorOptionsDef = NULL }; menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_SOUND << 6), + MTREE2(MN_OP_MAIN, MN_OP_SOUND), "M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 30, 30); -menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); +menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE( + MTREE2(MN_OP_MAIN, MN_OP_SOUND), + "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); menu_t OP_ServerOptionsDef = DEFAULTSCROLLMENUSTYLE( - MN_OP_MAIN + (MN_OP_SERVER << 6), + MTREE2(MN_OP_MAIN, MN_OP_SERVER), "M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_MonitorToggleDef = { - MN_OP_MAIN + (MN_OP_SERVER << 6) + (MN_OP_MONITORTOGGLE << 12), + MTREE3(MN_OP_MAIN, MN_OP_SOUND, MN_OP_MONITORTOGGLE), "M_SERVER", sizeof (OP_MonitorToggleMenu)/sizeof (menuitem_t), &OP_ServerOptionsDef, @@ -2152,16 +2157,16 @@ static void M_OpenGLOptionsMenu(void) } menu_t OP_OpenGLOptionsDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12), + MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENGL), "M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30); #ifdef ALAM_LIGHTING menu_t OP_OpenGLLightingDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12) + (MN_OP_OPENGL_LIGHTING << 18), + MTREE4(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENGL, MN_OP_OPENGL_LIGHTING), "M_VIDEO", OP_OpenGLLightingMenu, &OP_OpenGLOptionsDef, 60, 40); #endif menu_t OP_OpenGLFogDef = { - MN_OP_MAIN + (MN_OP_VIDEO << 6) + (MN_OP_OPENGL << 12) + (MN_OP_OPENGL_FOG << 18), + MTREE4(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENGL, MN_OP_OPENGL_FOG), "M_VIDEO", sizeof (OP_OpenGLFogMenu)/sizeof (menuitem_t), &OP_OpenGLOptionsDef, @@ -2173,12 +2178,12 @@ menu_t OP_OpenGLFogDef = }; #endif menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_DATA << 6), + MTREE2(MN_OP_MAIN, MN_OP_DATA), "M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30); menu_t OP_ScreenshotOptionsDef = { - MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_SCREENSHOTS << 12), + MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_SCREENSHOTS), "M_DATA", sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t), &OP_DataOptionsDef, @@ -2190,11 +2195,11 @@ menu_t OP_ScreenshotOptionsDef = }; menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_ADDONS << 12), + MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ADDONS), "M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30); menu_t OP_EraseDataDef = DEFAULTMENUSTYLE( - MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_ERASEDATA << 12), + MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ERASEDATA), "M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 60, 30); // ========================================================================== @@ -8844,16 +8849,11 @@ static void M_SetupChoosePlayer(INT32 choice) /* the menus suck -James */ if (currentMenu == &SP_LoadDef)/* from save states */ { - SP_PlayerDef.menuid = - MN_SP_MAIN + - ( MN_SP_LOAD << 6 ) + - ( MN_SP_PLAYER << 12 ); + SP_PlayerDef.menuid = MTREE3(MN_SP_MAIN, MN_SP_LOAD, MN_SP_PLAYER); } else/* from Secret level select */ { - SP_PlayerDef.menuid = - MN_SR_MAIN + - ( MN_SR_PLAYER << 6 ); + SP_PlayerDef.menuid = MTREE2(MN_SR_MAIN, MN_SR_PLAYER); } SP_PlayerDef.prevMenu = currentMenu; @@ -10747,9 +10747,9 @@ static void M_ServerOptions(INT32 choice) /* Disable fading because of different menu head. */ if (currentMenu == &OP_MainDef)/* from Options menu */ - OP_ServerOptionsDef.menuid = MN_OP_MAIN + ( MN_OP_SERVER << 6 ); + OP_ServerOptionsDef.menuid = MTREE2(MN_OP_MAIN, MN_OP_SERVER); else/* from Multiplayer menu */ - OP_ServerOptionsDef.menuid = MN_MP_MAIN + ( MN_MP_SERVER_OPTIONS << 6 ); + OP_ServerOptionsDef.menuid = MTREE2(MN_MP_MAIN, MN_MP_SERVER_OPTIONS); OP_ServerOptionsDef.prevMenu = currentMenu; M_SetupNextMenu(&OP_ServerOptionsDef); @@ -11666,8 +11666,8 @@ static void M_Setup1PControlsMenu(INT32 choice) OP_ChangeControlsMenu[27+3].status = IT_CALL|IT_STRING2; OP_ChangeControlsDef.prevMenu = &OP_P1ControlsDef; - OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove first level (<< 6) - OP_ChangeControlsDef.menuid |= MN_OP_P1CONTROLS << MENUBITS; // combine first level (<< 6) + OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove second level + OP_ChangeControlsDef.menuid |= MN_OP_P1CONTROLS << MENUBITS; // combine second level M_SetupNextMenu(&OP_ChangeControlsDef); } @@ -11697,8 +11697,8 @@ static void M_Setup2PControlsMenu(INT32 choice) OP_ChangeControlsMenu[27+3].status = IT_GRAYEDOUT2; OP_ChangeControlsDef.prevMenu = &OP_P2ControlsDef; - OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove first level (<< 6) - OP_ChangeControlsDef.menuid |= MN_OP_P2CONTROLS << MENUBITS; // combine first level (<< 6) + OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove second level + OP_ChangeControlsDef.menuid |= MN_OP_P2CONTROLS << MENUBITS; // combine second level M_SetupNextMenu(&OP_ChangeControlsDef); } diff --git a/src/m_menu.h b/src/m_menu.h index 6cfa9ef71..47540acee 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -131,6 +131,9 @@ typedef enum MN_SPECIAL, NUMMENUTYPES, } menutype_t; // up to 63; MN_SPECIAL = 53 +#define MTREE2(a,b) (a | (b< Date: Mon, 24 Feb 2020 18:00:52 -0600 Subject: [PATCH 04/34] Fix menu enterwipes being overridden? --- src/d_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 904ab3bf1..a991bdbe3 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -312,7 +312,9 @@ static void D_Display(void) F_WipeStartScreen(); // Check for Mega Genesis fade wipestyleflags = WSF_FADEOUT; - if (F_TryColormapFade(31)) + if (wipegamestate == (gamestate_t)FORCEWIPE) + F_WipeColorFill(31); + else if (F_TryColormapFade(31)) wipetypepost = -1; // Don't run the fade below this one F_WipeEndScreen(); F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); From 2e3c110534c4a3fe655d05bce4897c39dc3a7521 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Tue, 28 Apr 2020 22:19:44 +0200 Subject: [PATCH 05/34] Optimise string archiving and allow for longer strings --- src/lua_script.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index 7adf62fcc..d8dee37f6 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -732,7 +732,8 @@ enum ARCH_NULL=0, ARCH_BOOLEAN, ARCH_SIGNED, - ARCH_STRING, + ARCH_SMALLSTRING, + ARCH_LARGESTRING, ARCH_TABLE, ARCH_MOBJINFO, @@ -829,10 +830,9 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } case LUA_TSTRING: { - UINT16 len = (UINT16)lua_objlen(gL, myindex); // get length of string, including embedded zeros + UINT32 len = (UINT32)lua_objlen(gL, myindex); // get length of string, including embedded zeros const char *s = lua_tostring(gL, myindex); - UINT16 i = 0; - WRITEUINT8(save_p, ARCH_STRING); + UINT32 i = 0; // if you're wondering why we're writing a string to save_p this way, // it turns out that Lua can have embedded zeros ('\0') in the strings, // so we can't use WRITESTRING as that cuts off when it finds a '\0'. @@ -840,7 +840,16 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) // fixing the awful crashes previously encountered for reading strings longer than 1024 // (yes I know that's kind of a stupid thing to care about, but it'd be evil to trim or ignore them?) // -- Monster Iestyn 05/08/18 - WRITEUINT16(save_p, len); // save size of string + if (len < 255) + { + WRITEUINT8(save_p, ARCH_SMALLSTRING); + WRITEUINT8(save_p, len); // save size of string + } + else + { + WRITEUINT8(save_p, ARCH_LARGESTRING); + WRITEUINT32(save_p, len); // save size of string + } while (i < len) WRITECHAR(save_p, s[i++]); // write chars individually, including the embedded zeros break; @@ -1184,15 +1193,21 @@ static UINT8 UnArchiveValue(int TABLESINDEX) case ARCH_SIGNED: lua_pushinteger(gL, READFIXED(save_p)); break; - case ARCH_STRING: + case ARCH_SMALLSTRING: + case ARCH_LARGESTRING: { - UINT16 len = READUINT16(save_p); // length of string, including embedded zeros + UINT32 len; char *value; - UINT16 i = 0; + UINT32 i = 0; + // See my comments in the ArchiveValue function; // it's much the same for reading strings as writing them! // (i.e. we can't use READSTRING either) // -- Monster Iestyn 05/08/18 + if (type == ARCH_SMALLSTRING) + len = READUINT8(save_p); // length of string, including embedded zeros + else + len = READUINT32(save_p); // length of string, including embedded zeros value = malloc(len); // make temp buffer of size len // now read the actual string while (i < len) From 3e8fb8db25c022ba2c3b4d887c26e05844f9c0c9 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Tue, 28 Apr 2020 23:11:28 +0200 Subject: [PATCH 06/34] Optimise boolean archiving --- src/lua_script.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index d8dee37f6..05ad4700f 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -730,7 +730,8 @@ void LUA_InvalidatePlayer(player_t *player) enum { ARCH_NULL=0, - ARCH_BOOLEAN, + ARCH_TRUE, + ARCH_FALSE, ARCH_SIGNED, ARCH_SMALLSTRING, ARCH_LARGESTRING, @@ -818,8 +819,7 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) WRITEUINT8(save_p, ARCH_NULL); return 2; case LUA_TBOOLEAN: - WRITEUINT8(save_p, ARCH_BOOLEAN); - WRITEUINT8(save_p, lua_toboolean(gL, myindex)); + WRITEUINT8(save_p, lua_toboolean(gL, myindex) ? ARCH_TRUE : ARCH_FALSE); break; case LUA_TNUMBER: { @@ -1187,8 +1187,12 @@ static UINT8 UnArchiveValue(int TABLESINDEX) case ARCH_NULL: lua_pushnil(gL); break; - case ARCH_BOOLEAN: - lua_pushboolean(gL, READUINT8(save_p)); + case ARCH_TRUE: + lua_pushboolean(gL, true); + break; + case ARCH_FALSE: + lua_pushboolean(gL, false); + break; break; case ARCH_SIGNED: lua_pushinteger(gL, READFIXED(save_p)); From ae05f11c458601fe6c279ae5abcd2197518e3c28 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Tue, 28 Apr 2020 23:12:02 +0200 Subject: [PATCH 07/34] Optimise number archiving --- src/lua_script.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index 05ad4700f..98c35e91f 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -732,7 +732,9 @@ enum ARCH_NULL=0, ARCH_TRUE, ARCH_FALSE, - ARCH_SIGNED, + ARCH_INT8, + ARCH_INT16, + ARCH_INT32, ARCH_SMALLSTRING, ARCH_LARGESTRING, ARCH_TABLE, @@ -824,8 +826,21 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) case LUA_TNUMBER: { lua_Integer number = lua_tointeger(gL, myindex); - WRITEUINT8(save_p, ARCH_SIGNED); - WRITEFIXED(save_p, number); + if (number >= INT8_MIN && number <= INT8_MAX) + { + WRITEUINT8(save_p, ARCH_INT8); + WRITESINT8(save_p, number); + } + else if (number >= INT16_MIN && number <= INT16_MAX) + { + WRITEUINT8(save_p, ARCH_INT16); + WRITEINT16(save_p, number); + } + else + { + WRITEUINT8(save_p, ARCH_INT32); + WRITEFIXED(save_p, number); + } break; } case LUA_TSTRING: @@ -1193,8 +1208,13 @@ static UINT8 UnArchiveValue(int TABLESINDEX) case ARCH_FALSE: lua_pushboolean(gL, false); break; + case ARCH_INT8: + lua_pushinteger(gL, READSINT8(save_p)); break; - case ARCH_SIGNED: + case ARCH_INT16: + lua_pushinteger(gL, READINT16(save_p)); + break; + case ARCH_INT32: lua_pushinteger(gL, READFIXED(save_p)); break; case ARCH_SMALLSTRING: From 1528f2aef8814e3841cf9e20d63d3fe9a7894008 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 2 May 2020 17:13:16 +0100 Subject: [PATCH 08/34] Fix drop shadow and rotsprite code to use SHORT() --- src/hardware/hw_main.c | 14 +++++++------- src/r_patch.c | 14 ++++++++++---- src/r_things.c | 30 +++++++++++++++--------------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index be03ba083..927bad34c 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4158,7 +4158,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale HWR_GetPatch(gpatch); scalemul = FixedMul(FRACUNIT - floordiff/640, scale); - scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height); + scalemul = FixedMul(scalemul, (thing->radius*2) / SHORT(gpatch->height)); fscale = FIXED_TO_FLOAT(scalemul); fx = FIXED_TO_FLOAT(thing->x); @@ -4170,9 +4170,9 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale // 0--1 if (thing && fabsf(fscale - 1.0f) > 1.0E-36f) - offset = (gpatch->height/2) * fscale; + offset = (SHORT(gpatch->height)/2) * fscale; else - offset = (float)(gpatch->height/2); + offset = (float)(SHORT(gpatch->height)/2); shadowVerts[0].x = shadowVerts[3].x = fx - offset; shadowVerts[2].x = shadowVerts[1].x = fx + offset; @@ -5551,10 +5551,10 @@ static void HWR_ProjectSprite(mobj_t *thing) rotsprite = sprframe->rotsprite.patch[rot][rollangle]; if (rotsprite != NULL) { - spr_width = rotsprite->width << FRACBITS; - spr_height = rotsprite->height << FRACBITS; - spr_offset = rotsprite->leftoffset << FRACBITS; - spr_topoffset = rotsprite->topoffset << FRACBITS; + spr_width = SHORT(rotsprite->width) << FRACBITS; + spr_height = SHORT(rotsprite->height) << FRACBITS; + spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS; + spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS; // flip -> rotate, not rotate -> flip flip = 0; } diff --git a/src/r_patch.c b/src/r_patch.c index 9e31d4d19..ad4b3329a 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -1231,9 +1231,9 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp if (!R_CheckIfPatch(lump)) return; - width = patch->width; - height = patch->height; - leftoffset = patch->leftoffset; + width = SHORT(patch->width); + height = SHORT(patch->height); + leftoffset = SHORT(patch->leftoffset); // rotation pivot px = SPRITE_XCENTER; @@ -1348,7 +1348,7 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp newpatch = R_MaskedFlatToPatch(rawdst, newwidth, newheight, 0, 0, &size); { newpatch->leftoffset = (newpatch->width / 2) + (leftoffset - px); - newpatch->topoffset = (newpatch->height / 2) + (patch->topoffset - py); + newpatch->topoffset = (newpatch->height / 2) + (SHORT(patch->topoffset) - py); } //BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer @@ -1358,6 +1358,12 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp // P_PrecacheLevel if (devparm) spritememory += size; + // convert everything to little-endian, for big-endian support + newpatch->width = SHORT(newpatch->width); + newpatch->height = SHORT(newpatch->height); + newpatch->leftoffset = SHORT(newpatch->leftoffset); + newpatch->topoffset = SHORT(newpatch->topoffset); + #ifdef HWRENDER if (rendermode == render_opengl) { diff --git a/src/r_things.c b/src/r_things.c index d2f3b4902..1956e1e7d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -890,7 +890,7 @@ static void R_DrawVisSprite(vissprite_t *vis) vis->x2 = vid.width-1; localcolfunc = (vis->cut & SC_VFLIP) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn; - lengthcol = patch->height; + lengthcol = SHORT(patch->height); // Split drawing loops for paper and non-paper to reduce conditional checks per sprite if (vis->scalestep) @@ -1235,8 +1235,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, yscale = FixedDiv(projectiony, tz); shadowxscale = FixedMul(thing->radius*2, scalemul); shadowyscale = FixedMul(FixedMul(thing->radius*2, scalemul), FixedDiv(abs(floorz - viewz), tz)); - shadowyscale = min(shadowyscale, shadowxscale) / patch->height; - shadowxscale /= patch->width; + shadowyscale = min(shadowyscale, shadowxscale) / SHORT(patch->height); + shadowxscale /= SHORT(patch->width); shadowskew = 0; if (floorslope) @@ -1251,24 +1251,24 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, //CONS_Printf("Shadow is sloped by %d %d\n", xslope, zslope); if (viewz < floorz) - shadowyscale += FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope); + shadowyscale += FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope); else - shadowyscale -= FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope); + shadowyscale -= FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope); shadowyscale = abs(shadowyscale); shadowskew = xslope; } - tx -= patch->width * shadowxscale/2; + tx -= SHORT(patch->width) * shadowxscale/2; x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS; if (x1 >= viewwidth) return; - tx += patch->width * shadowxscale; + tx += SHORT(patch->width) * shadowxscale; x2 = ((centerxfrac + FixedMul(tx,xscale))>>FRACBITS); x2--; if (x2 < 0 || x2 <= x1) return; - if (shadowyscale < FRACUNIT/patch->height) return; // fix some crashes? + if (shadowyscale < FRACUNIT/SHORT(patch->height)) return; // fix some crashes? shadow = R_NewVisSprite(); shadow->patch = patch; @@ -1283,8 +1283,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, shadow->dispoffset = vis->dispoffset - 5; shadow->gx = thing->x; shadow->gy = thing->y; - shadow->gzt = shadow->pz + shadow->patch->height * shadowyscale / 2; - shadow->gz = shadow->gzt - shadow->patch->height * shadowyscale; + shadow->gzt = shadow->pz + SHORT(patch->height) * shadowyscale / 2; + shadow->gz = shadow->gzt - SHORT(patch->height) * shadowyscale; shadow->texturemid = FixedMul(thing->scale, FixedDiv(shadow->gzt - viewz, shadowyscale)); if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES) shadow->texturemid = FixedMul(shadow->texturemid, ((skin_t *)thing->skin)->highresscale); @@ -1305,7 +1305,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale, shadow->startfrac = 0; //shadow->xiscale = 0x7ffffff0 / (shadow->xscale/2); - shadow->xiscale = (patch->width<xiscale = (SHORT(patch->width)<x1 > x1) shadow->startfrac += shadow->xiscale*(shadow->x1-x1); @@ -1534,10 +1534,10 @@ static void R_ProjectSprite(mobj_t *thing) rotsprite = sprframe->rotsprite.patch[rot][rollangle]; if (rotsprite != NULL) { - spr_width = rotsprite->width << FRACBITS; - spr_height = rotsprite->height << FRACBITS; - spr_offset = rotsprite->leftoffset << FRACBITS; - spr_topoffset = rotsprite->topoffset << FRACBITS; + spr_width = SHORT(rotsprite->width) << FRACBITS; + spr_height = SHORT(rotsprite->height) << FRACBITS; + spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS; + spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS; // flip -> rotate, not rotate -> flip flip = 0; } From 5282f01a533fcb084e2e4ff6d176b6179c52377c Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 5 May 2020 08:40:59 +0200 Subject: [PATCH 09/34] Fix PolyObject flags not being applied when there is no parameter line --- src/p_polyobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_polyobj.c b/src/p_polyobj.c index 13f7decf9..cd63f4509 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -210,6 +210,8 @@ static void Polyobj_GetInfo(polyobj_t *po) { INT32 i = P_FindSpecialLineFromTag(POLYINFO_SPECIALNUM, po->id, -1); + po->flags = POF_SOLID|POF_TESTHEIGHT|POF_RENDERSIDES; + if (i == -1) return; // no extra settings to apply, let's leave it @@ -223,8 +225,6 @@ static void Polyobj_GetInfo(polyobj_t *po) po->translucency = max(min(po->translucency, NUMTRANSMAPS), 0); - po->flags = POF_SOLID|POF_TESTHEIGHT|POF_RENDERSIDES; - if (lines[i].flags & ML_EFFECT1) po->flags |= POF_ONESIDE; From 2d6c9a94f43bba89bf7843ab1ff743fa5f7952a5 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Tue, 5 May 2020 14:05:19 +0200 Subject: [PATCH 10/34] Fix compiler warning --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f7755c148..43321d92d 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5062,7 +5062,7 @@ void NetUpdate(void) // In case the cvar value was lowered if (joindelay) - joindelay = min(joindelay - 1, 3 * cv_joindelay.value * TICRATE); + joindelay = min(joindelay - 1, 3 * (tic_t)cv_joindelay.value * TICRATE); } nowtime /= NEWTICRATERATIO; From 92c900f28468e058fbcd17701ff88967b6c0a83b Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 4 May 2020 00:35:57 +0800 Subject: [PATCH 11/34] New GFZ3 laser --- src/dehacked.c | 5 ++++- src/info.c | 13 ++++++++----- src/info.h | 5 ++++- src/p_enemy.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index e9d029be0..daf578007 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6224,7 +6224,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ROCKET", - "S_LASER", + "S_LASER1", + "S_LASER2", + "S_LASERFLASH", + "S_LASERSPARK", "S_TORPEDO", diff --git a/src/info.c b/src/info.c index bd6ccb527..2944c53b1 100644 --- a/src/info.c +++ b/src/info.c @@ -2058,7 +2058,10 @@ state_t states[NUMSTATES] = {SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET - {SPR_MISL, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LASER + {SPR_MISL, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_NULL}, // S_LASER1 + {SPR_MISL, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_NULL}, // S_LASER2 + {SPR_MISL, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_NULL}, // S_LASERFLASH + {SPR_MISL, FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_LASERSPARK}, // S_LASERSPARK {SPR_TORP, 0, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_TORPEDO}, // S_TORPEDO @@ -9628,17 +9631,17 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_LASER -1, // doomednum - S_LASER, // spawnstate + S_LASER1, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_rlaunc, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_LASERSPARK, // painstate 0, // painchance sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate + S_LASERFLASH, // meleestate + S_LASER2, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound diff --git a/src/info.h b/src/info.h index 586209ff9..1d1400aba 100644 --- a/src/info.h +++ b/src/info.h @@ -2219,7 +2219,10 @@ typedef enum state S_ROCKET, - S_LASER, + S_LASER1, + S_LASER2, + S_LASERFLASH, + S_LASERSPARK, S_TORPEDO, diff --git a/src/p_enemy.c b/src/p_enemy.c index 2341be6d3..ec7445f9f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2990,6 +2990,19 @@ void A_Boss1Laser(mobj_t *actor) angle_t angle; mobj_t *point; tic_t dur; + static const UINT8 LASERCOLORS[] = + { + SKINCOLOR_SUPERRED3, + SKINCOLOR_SUPERRED4, + SKINCOLOR_SUPERRED5, + SKINCOLOR_FLAME, + SKINCOLOR_RED, + SKINCOLOR_RED, + SKINCOLOR_FLAME, + SKINCOLOR_SUPERRED5, + SKINCOLOR_SUPERRED4, + SKINCOLOR_SUPERRED3, + }; if (LUA_CallAction("A_Boss1Laser", actor)) return; @@ -3064,7 +3077,7 @@ void A_Boss1Laser(mobj_t *actor) point = P_SpawnMobj(x, y, z, locvar1); P_SetTarget(&point->target, actor); point->angle = actor->angle; - speed = point->radius*2; + speed = point->radius; point->momz = FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT), speed); point->momx = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(point->angle>>ANGLETOFINESHIFT), speed)); point->momy = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINESINE(point->angle>>ANGLETOFINESHIFT), speed)); @@ -3073,10 +3086,26 @@ void A_Boss1Laser(mobj_t *actor) { mobj_t *mo = P_SpawnMobj(point->x, point->y, point->z, point->type); mo->angle = point->angle; + mo->color = LASERCOLORS[((UINT8)(i - 3*leveltime) >> 2) % sizeof(LASERCOLORS)]; // codeing P_UnsetThingPosition(mo); mo->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY; P_SetThingPosition(mo); + if (leveltime & 1 && mo->info->missilestate) + { + P_SetMobjState(mo, mo->info->missilestate); + if (mo->info->meleestate) + { + mobk_t *mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_PARTICLE); + mo2->flags2 |= MF2_LINKDRAW; + P_SetTarget(&mo2->tracer, actor); + P_SetMobjState(mo2, mo->info->meleestate); + } + } + + if (leveltime % 4 == 0) + P_SpawnGhostMobj(mo); + x = point->x, y = point->y, z = point->z; if (P_RailThinker(point)) break; @@ -3085,6 +3114,20 @@ void A_Boss1Laser(mobj_t *actor) floorz = P_FloorzAtPos(x, y, z, mobjinfo[MT_EGGMOBILE_FIRE].height); if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1) { + for (i = 0; point->info->painstate && i < 3; i++) + { + mobj_t *spark = P_SpawnMobj(x, y, floorz+1, MT_PARTICLE); + spark->flags &= ~MF_NOGRAVITY; + spark->angle = FixedAngle(P_RandomKey(360)*FRACUNIT); + spark->rollangle = FixedAngle(P_RandomKey(360)*FRACUNIT); + spark->color = LASERCOLORS[P_RandomKey(sizeof(LASERCOLORS)/sizeof(UINT8))]; + spark->colorized = true; + spark->fuse = 12; + spark->destscale = point->scale >> 3; + P_SetObjectMomZ(spark, 8*FRACUNIT, true); + P_InstaThrust(spark, spark->angle, 6*FRACUNIT); + P_SetMobjState(spark, point->info->painstate); + } point = P_SpawnMobj(x, y, floorz+1, MT_EGGMOBILE_FIRE); P_SetTarget(&point->target, actor); point->destscale = 3*FRACUNIT; From 63cb58a10a97c9a68e17781122027dcd58f82ec9 Mon Sep 17 00:00:00 2001 From: lachwright Date: Wed, 6 May 2020 09:03:03 +0800 Subject: [PATCH 12/34] Update new GFZ3 laser --- src/dehacked.c | 10 ++++- src/hardware/hw_light.c | 2 + src/info.c | 27 ++++++++----- src/info.h | 12 +++++- src/p_enemy.c | 89 +++++++++++++++++++++++++++++++---------- src/p_mobj.c | 7 +--- src/sounds.c | 2 +- 7 files changed, 106 insertions(+), 43 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index daf578007..32339fe87 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3027,6 +3027,7 @@ static actionpointer_t actionpointers[] = {{A_DragonbomberSpawn}, "A_DRAGONBOMERSPAWN"}, {{A_DragonWing}, "A_DRAGONWING"}, {{A_DragonSegment}, "A_DRAGONSEGMENT"}, + {{A_ChangeHeight}, "A_CHANGEHEIGHT"}, {{NULL}, "NONE"}, // This NULL entry must be the last in the list @@ -6224,10 +6225,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ROCKET", - "S_LASER1", + "S_LASER", "S_LASER2", "S_LASERFLASH", - "S_LASERSPARK", + + "S_LASERFLAME1", + "S_LASERFLAME2", + "S_LASERFLAME3", + "S_LASERFLAME4", + "S_LASERFLAME5", "S_TORPEDO", diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index c5af8d6d3..3d1316a2f 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -298,6 +298,8 @@ light_t *t_lspr[NUMSPRITES] = // Projectiles &lspr[NOLIGHT], // SPR_MISL + &lspr[SMALLREDBALL_L], // SPR_LASR + &lspr[REDSHINE_L], // SPR_LASF &lspr[NOLIGHT], // SPR_TORP &lspr[NOLIGHT], // SPR_ENRG &lspr[NOLIGHT], // SPR_MINE diff --git a/src/info.c b/src/info.c index 2944c53b1..ccb03ab1a 100644 --- a/src/info.c +++ b/src/info.c @@ -187,6 +187,8 @@ char sprnames[NUMSPRITES + 1][5] = // Projectiles "MISL", + "LASR", // GFZ3 laser + "LASF", // GFZ3 laser flames "TORP", // Torpedo "ENRG", // Energy ball "MINE", // Skim mine @@ -2058,10 +2060,15 @@ state_t states[NUMSTATES] = {SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET - {SPR_MISL, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_NULL}, // S_LASER1 - {SPR_MISL, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_NULL}, // S_LASER2 - {SPR_MISL, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_NULL}, // S_LASERFLASH - {SPR_MISL, FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_LASERSPARK}, // S_LASERSPARK + {SPR_LASR, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_NULL}, // S_LASER + {SPR_LASR, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_NULL}, // S_LASER2 + {SPR_LASR, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_NULL}, // S_LASERFLASH + + {SPR_LASF, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_LASERFLAME2}, // S_LASERFLAME1 + {SPR_LASF, FF_FULLBRIGHT|1, 1, {A_ChangeHeight}, 52*FRACUNIT, 3, S_LASERFLAME3}, // S_LASERFLAME2 + {SPR_LASF, FF_FULLBRIGHT|2, 0, {A_ChangeHeight}, 12*FRACUNIT, 3, S_LASERFLAME4}, // S_LASERFLAME3 + {SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|2, 4, {NULL}, 1, 2, S_LASERFLAME5}, // S_LASERFLAME4 + {SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|4, 28, {NULL}, 2, 2, S_NULL}, // S_LASERFLAME5 {SPR_TORP, 0, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_TORPEDO}, // S_TORPEDO @@ -5668,15 +5675,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_EGGMOBILE_FIRE -1, // doomednum - S_SPINFIRE1, // spawnstate + S_LASERFLAME1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_None, // seesound + sfx_s3kc2s, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_None, // painsound + sfx_s3k8d, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate @@ -5684,7 +5691,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // deathsound 0, // speed 8*FRACUNIT, // radius - 14*FRACUNIT, // height + 28*FRACUNIT, // height 0, // display offset DMG_FIRE, // mass 1, // damage @@ -9631,13 +9638,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_LASER -1, // doomednum - S_LASER1, // spawnstate + S_LASER, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_rlaunc, // seesound 8, // reactiontime sfx_None, // attacksound - S_LASERSPARK, // painstate + S_NULL, // painstate 0, // painchance sfx_None, // painsound S_LASERFLASH, // meleestate diff --git a/src/info.h b/src/info.h index 1d1400aba..79af9bbbb 100644 --- a/src/info.h +++ b/src/info.h @@ -284,6 +284,7 @@ void A_RolloutRock(); void A_DragonbomberSpawn(); void A_DragonWing(); void A_DragonSegment(); +void A_ChangeHeight(); // ratio of states to sprites to mobj types is roughly 6 : 1 : 1 #define NUMMOBJFREESLOTS 512 @@ -451,6 +452,8 @@ typedef enum sprite // Projectiles SPR_MISL, + SPR_LASR, // GFZ3 laser + SPR_LASF, // GFZ3 laser flames SPR_TORP, // Torpedo SPR_ENRG, // Energy ball SPR_MINE, // Skim mine @@ -2219,10 +2222,15 @@ typedef enum state S_ROCKET, - S_LASER1, + S_LASER, S_LASER2, S_LASERFLASH, - S_LASERSPARK, + + S_LASERFLAME1, + S_LASERFLAME2, + S_LASERFLAME3, + S_LASERFLAME4, + S_LASERFLAME5, S_TORPEDO, diff --git a/src/p_enemy.c b/src/p_enemy.c index ec7445f9f..9fc7734d6 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -312,6 +312,7 @@ void A_RolloutRock(mobj_t *actor); void A_DragonbomberSpawn(mobj_t *actor); void A_DragonWing(mobj_t *actor); void A_DragonSegment(mobj_t *actor); +void A_ChangeHeight(mobj_t *actor); //for p_enemy.c @@ -3086,24 +3087,24 @@ void A_Boss1Laser(mobj_t *actor) { mobj_t *mo = P_SpawnMobj(point->x, point->y, point->z, point->type); mo->angle = point->angle; - mo->color = LASERCOLORS[((UINT8)(i - 3*leveltime) >> 2) % sizeof(LASERCOLORS)]; // codeing + mo->color = LASERCOLORS[((UINT8)(i + 3*dur) >> 2) % sizeof(LASERCOLORS)]; // codeing P_UnsetThingPosition(mo); mo->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY; P_SetThingPosition(mo); - if (leveltime & 1 && mo->info->missilestate) + if (dur & 1 && mo->info->missilestate) { P_SetMobjState(mo, mo->info->missilestate); if (mo->info->meleestate) { - mobk_t *mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_PARTICLE); + mobj_t *mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_PARTICLE); mo2->flags2 |= MF2_LINKDRAW; P_SetTarget(&mo2->tracer, actor); P_SetMobjState(mo2, mo->info->meleestate); } } - if (leveltime % 4 == 0) + if (dur == 1) P_SpawnGhostMobj(mo); x = point->x, y = point->y, z = point->z; @@ -3111,28 +3112,32 @@ void A_Boss1Laser(mobj_t *actor) break; } + x += point->momx; + y += point->momy; floorz = P_FloorzAtPos(x, y, z, mobjinfo[MT_EGGMOBILE_FIRE].height); - if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1) + if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1 && dur & 1) { - for (i = 0; point->info->painstate && i < 3; i++) - { - mobj_t *spark = P_SpawnMobj(x, y, floorz+1, MT_PARTICLE); - spark->flags &= ~MF_NOGRAVITY; - spark->angle = FixedAngle(P_RandomKey(360)*FRACUNIT); - spark->rollangle = FixedAngle(P_RandomKey(360)*FRACUNIT); - spark->color = LASERCOLORS[P_RandomKey(sizeof(LASERCOLORS)/sizeof(UINT8))]; - spark->colorized = true; - spark->fuse = 12; - spark->destscale = point->scale >> 3; - P_SetObjectMomZ(spark, 8*FRACUNIT, true); - P_InstaThrust(spark, spark->angle, 6*FRACUNIT); - P_SetMobjState(spark, point->info->painstate); - } point = P_SpawnMobj(x, y, floorz+1, MT_EGGMOBILE_FIRE); + point->angle = actor->angle; + point->destscale = actor->scale*3; + P_SetScale(point, point->destscale); P_SetTarget(&point->target, actor); - point->destscale = 3*FRACUNIT; - point->scalespeed = FRACUNIT>>2; - point->fuse = TICRATE; + P_MobjCheckWater(point); + if (point->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) + { + for (i = 0; i < 2; i++) + { + UINT8 size = 3; + mobj_t *steam = P_SpawnMobj(x, y, point->watertop - size*mobjinfo[MT_DUST].height, MT_DUST); + P_SetScale(steam, size*actor->scale); + P_SetObjectMomZ(steam, FRACUNIT + 2*P_RandomFixed(), true); + P_InstaThrust(steam, FixedAngle(P_RandomKey(360)*FRACUNIT), 2*P_RandomFixed()); + if (point->info->painsound) + S_StartSound(steam, point->info->painsound); + } + } + else if (point->info->seesound) + S_StartSound(point, point->info->seesound); } if (dur > 1) @@ -14452,3 +14457,43 @@ void A_DragonSegment(mobj_t *actor) actor->angle = hangle; P_TeleportMove(actor, target->x + xdist, target->y + ydist, target->z + zdist); } + +// Function: A_ChangeHeight +// +// Description: Changes the actor's height by var1 +// +// var1 = height +// var2 = +// &1: height is absolute +// &2: scale with actor's scale +// +void A_ChangeHeight(mobj_t *actor) +{ + INT32 locvar1 = var1; + INT32 locvar2 = var2; + fixed_t height = locvar1; + boolean reverse; + + if (LUA_CallAction("A_ChangeHeight", actor)) + return; + + reverse = (actor->eflags & MFE_VERTICALFLIP) || (actor->flags2 & MF2_OBJECTFLIP); + + if (locvar2 & 2) + height = FixedMul(height, actor->scale); + + P_UnsetThingPosition(actor); + if (locvar2 & 1) + { + if (reverse) + actor->z += actor->height - locvar1; + actor->height = locvar1; + } + else + { + if (reverse) + actor->z -= locvar1; + actor->height += locvar1; + } + P_SetThingPosition(actor); +} \ No newline at end of file diff --git a/src/p_mobj.c b/src/p_mobj.c index c78ec4a53..02be9dcef 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7056,8 +7056,7 @@ static void P_MobjScaleThink(mobj_t *mobj) fixed_t oldheight = mobj->height; UINT8 correctionType = 0; // Don't correct Z position, just gain height - if ((mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz)) - && mobj->type != MT_EGGMOBILE_FIRE) + if (mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz)) correctionType = 1; // Correct Z position by centering else if (mobj->eflags & MFE_VERTICALFLIP) correctionType = 2; // Correct Z position by moving down @@ -7078,10 +7077,6 @@ static void P_MobjScaleThink(mobj_t *mobj) /// \todo Lua hook for "reached destscale"? switch (mobj->type) { - case MT_EGGMOBILE_FIRE: - mobj->destscale = FRACUNIT; - mobj->scalespeed = FRACUNIT>>4; - break; default: break; } diff --git a/src/sounds.c b/src/sounds.c index ca943c2d0..9894fd13e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -527,7 +527,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boing"}, {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful hit"}, {"s3k8c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Humming power"}, - {"s3k8d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k8d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"}, {"s3k8e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Accelerating"}, {"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Opening"}, {"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Impact"}, From 38232ce07ec09e44058bdc74d6d7dd4e122cdf88 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 6 May 2020 18:35:54 -0400 Subject: [PATCH 13/34] fix build errors in public master --- src/s_sound.c | 2 +- src/w_wad.c | 4 ++++ src/win32/win_sys.c | 4 +++- src/win32/win_vid.c | 6 +++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 8e9461d78..7cd025786 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1672,7 +1672,7 @@ void S_LoadMusicDefs(UINT16 wadnum) char *lf; char *stoken; - size_t nlf; + size_t nlf = 0xFFFFFFFF; size_t ncr; musicdef_t *def = NULL; diff --git a/src/w_wad.c b/src/w_wad.c index 797f286d5..ea0a82fe9 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -76,6 +76,10 @@ int snprintf(char *str, size_t n, const char *fmt, ...); //int vsnprintf(char *str, size_t n, const char *fmt, va_list ap); #endif +#ifdef _DEBUG +#include "console.h" +#endif + #ifndef O_BINARY #define O_BINARY 0 #endif diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c index 42733c309..f9d66be7f 100644 --- a/src/win32/win_sys.c +++ b/src/win32/win_sys.c @@ -3199,7 +3199,7 @@ INT32 I_GetKey(void) // ----------------- #define DI_KEYBOARD_BUFFERSIZE 32 // number of data elements in keyboard buffer -void I_StartupKeyboard(void) +static void I_StartupKeyboard(void) { DIPROPDWORD dip; @@ -3435,6 +3435,8 @@ INT32 I_StartupSystem(void) // some 'more global than globals' things to initialize here ? graphics_started = keyboard_started = sound_started = cdaudio_started = false; + I_StartupKeyboard(); + #ifdef NDEBUG #ifdef BUGTRAP diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 4e7bab569..5fa219586 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -56,6 +56,7 @@ static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; boolean highcolor; +int vid_opengl_state = 0; static BOOL bDIBMode; // means we are using DIB instead of DirectDraw surfaces static LPBITMAPINFO bmiMain = NULL; @@ -949,7 +950,10 @@ INT32 VID_SetMode(INT32 modenum) } void VID_CheckRenderer(void) {} -void VID_CheckGLLoaded(rendermode_t oldrender) {} +void VID_CheckGLLoaded(rendermode_t oldrender) +{ + (void)oldrender; +} // ======================================================================== // Free the video buffer of the last video mode, From 3a1988fc014449d6870e6bf32220472107c78867 Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 7 May 2020 22:47:34 +0800 Subject: [PATCH 14/34] Fix knockback scaling --- src/info.c | 8 ++++---- src/p_enemy.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index ccb03ab1a..98cdce44d 100644 --- a/src/info.c +++ b/src/info.c @@ -2065,8 +2065,8 @@ state_t states[NUMSTATES] = {SPR_LASR, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_NULL}, // S_LASERFLASH {SPR_LASF, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_LASERFLAME2}, // S_LASERFLAME1 - {SPR_LASF, FF_FULLBRIGHT|1, 1, {A_ChangeHeight}, 52*FRACUNIT, 3, S_LASERFLAME3}, // S_LASERFLAME2 - {SPR_LASF, FF_FULLBRIGHT|2, 0, {A_ChangeHeight}, 12*FRACUNIT, 3, S_LASERFLAME4}, // S_LASERFLAME3 + {SPR_LASF, FF_FULLBRIGHT|1, 1, {A_ChangeHeight}, 156*FRACUNIT, 3, S_LASERFLAME3}, // S_LASERFLAME2 + {SPR_LASF, FF_FULLBRIGHT|2, 0, {A_ChangeHeight}, 32*FRACUNIT, 3, S_LASERFLAME4}, // S_LASERFLAME3 {SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|2, 4, {NULL}, 1, 2, S_LASERFLAME5}, // S_LASERFLAME4 {SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|4, 28, {NULL}, 2, 2, S_NULL}, // S_LASERFLAME5 @@ -5690,8 +5690,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 8*FRACUNIT, // radius - 28*FRACUNIT, // height + 24*FRACUNIT, // radius + 84*FRACUNIT, // height 0, // display offset DMG_FIRE, // mass 1, // damage diff --git a/src/p_enemy.c b/src/p_enemy.c index 9fc7734d6..ba162fba6 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3119,7 +3119,7 @@ void A_Boss1Laser(mobj_t *actor) { point = P_SpawnMobj(x, y, floorz+1, MT_EGGMOBILE_FIRE); point->angle = actor->angle; - point->destscale = actor->scale*3; + point->destscale = actor->scale; P_SetScale(point, point->destscale); P_SetTarget(&point->target, actor); P_MobjCheckWater(point); From 36b400387e8c2b67c0d3a0c764cadb8e65a2424e Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 7 May 2020 23:24:33 +0800 Subject: [PATCH 15/34] Remove MF_NOBLOCKMAP from MT_LASER so Silver can find it --- src/info.c | 2 +- src/p_enemy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 98cdce44d..c64f669ee 100644 --- a/src/info.c +++ b/src/info.c @@ -9659,7 +9659,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 20, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY, // flags + MF_MISSILE|MF_NOGRAVITY, // flags S_NULL // raisestate }, diff --git a/src/p_enemy.c b/src/p_enemy.c index ba162fba6..a6dff3b59 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3089,7 +3089,7 @@ void A_Boss1Laser(mobj_t *actor) mo->angle = point->angle; mo->color = LASERCOLORS[((UINT8)(i + 3*dur) >> 2) % sizeof(LASERCOLORS)]; // codeing P_UnsetThingPosition(mo); - mo->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY; + mo->flags = MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY; P_SetThingPosition(mo); if (dur & 1 && mo->info->missilestate) From 9d21d790a4d741af02c793a0140b22754154246a Mon Sep 17 00:00:00 2001 From: lachwright Date: Fri, 8 May 2020 02:58:56 +0800 Subject: [PATCH 16/34] Prevent laser sprites clipping into walls/off ledges --- src/info.c | 2 +- src/p_enemy.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/info.c b/src/info.c index c64f669ee..d443e035d 100644 --- a/src/info.c +++ b/src/info.c @@ -5696,7 +5696,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = DMG_FIRE, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags + MF_NOGRAVITY|MF_FIRE|MF_PAIN, // flags S_NULL // raisestate }, diff --git a/src/p_enemy.c b/src/p_enemy.c index a6dff3b59..6b092fb61 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3117,7 +3117,7 @@ void A_Boss1Laser(mobj_t *actor) floorz = P_FloorzAtPos(x, y, z, mobjinfo[MT_EGGMOBILE_FIRE].height); if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1 && dur & 1) { - point = P_SpawnMobj(x, y, floorz+1, MT_EGGMOBILE_FIRE); + point = P_SpawnMobj(x, y, floorz, MT_EGGMOBILE_FIRE); point->angle = actor->angle; point->destscale = actor->scale; P_SetScale(point, point->destscale); @@ -3136,8 +3136,20 @@ void A_Boss1Laser(mobj_t *actor) S_StartSound(steam, point->info->painsound); } } - else if (point->info->seesound) - S_StartSound(point, point->info->seesound); + else + { + fixed_t distx = P_ReturnThrustX(point, point->angle, point->radius); + fixed_t disty = P_ReturnThrustY(point, point->angle, point->radius); + if (P_TryMove(point, point->x + distx, point->y + disty, false) // prevents the sprite from clipping into the wall or dangling off ledges + && P_TryMove(point, point->x - 2*distx, point->y - 2*disty, false) + && P_TryMove(point, point->x + distx, point->y + disty, false)) + { + if (point->info->seesound) + S_StartSound(point, point->info->seesound); + } + else + P_RemoveMobj(point); + } } if (dur > 1) From 650f44566f5e8e2298b331cd5c14fcd252d11250 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Thu, 7 May 2020 21:59:39 +0200 Subject: [PATCH 17/34] Fixed a typo --- src/p_spec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index ac72eec15..feac4dea0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7710,7 +7710,7 @@ static void P_SpawnScrollers(void) // scroll wall according to linedef // (same direction and speed as scrolling floors) case 502: - for (s = -1; (s = P_FindSectorFromTag(l->tag, s)) >= 0 ;) + for (s = -1; (s = P_FindLineFromTag(l->tag, s)) >= 0 ;) if (s != (INT32)i) Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0); break; From 426925c5fce4ddcebc300d7a42b88a89d96fa9a0 Mon Sep 17 00:00:00 2001 From: Lachlan Date: Fri, 8 May 2020 04:07:00 +0800 Subject: [PATCH 18/34] Play the 1-up sound when 1upsound is set to sound --- src/p_user.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index c34d37264..22379d469 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -395,7 +395,7 @@ void P_GiveFinishFlags(player_t *player) mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); flag->angle = angle; angle += FixedAngle(120*FRACUNIT); - + P_SetTarget(&flag->target, player->mo); } } @@ -1492,17 +1492,10 @@ void P_PlayLivesJingle(player_t *player) if (player && !P_IsLocalPlayer(player)) return; - if (use1upSound) + if (use1upSound || cv_1upsound.value) S_StartSound(NULL, sfx_oneup); else if (mariomode) S_StartSound(NULL, sfx_marioa); - else if (cv_1upsound.value) - { - if (S_sfx[sfx_oneup].lumpnum != LUMPERROR) - S_StartSound(NULL, sfx_oneup); - else - S_StartSound(NULL, sfx_chchng);/* at least play something! */ - } else { P_PlayJingle(player, JT_1UP); From c55d6dbc9f856706af3d9969f5238492ea5ad25e Mon Sep 17 00:00:00 2001 From: sphere Date: Fri, 8 May 2020 15:40:50 +0200 Subject: [PATCH 19/34] Make showfps save to config, and add a compact option. --- src/screen.c | 14 ++++++++++---- src/v_video.c | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/screen.c b/src/screen.c index 6e5fd54cd..73c6b9ba0 100644 --- a/src/screen.c +++ b/src/screen.c @@ -538,10 +538,16 @@ void SCR_DisplayTicRate(void) if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP; else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP; - V_DrawString(vid.width-(72*vid.dupx), h, - V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:"); - V_DrawString(vid.width-(40*vid.dupx), h, - ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d/%02u", totaltics, TICRATE)); + if (cv_ticrate.value == 2) // compact counter + V_DrawString(vid.width-(16*vid.dupx), h, + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d", totaltics)); + else if (cv_ticrate.value == 1) // full counter + { + V_DrawString(vid.width-(72*vid.dupx), h, + V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:"); + V_DrawString(vid.width-(40*vid.dupx), h, + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d/%02u", totaltics, TICRATE)); + } lasttic = ontic; } diff --git a/src/v_video.c b/src/v_video.c index 2d1014c23..3ce0e79f5 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -42,7 +42,8 @@ UINT8 *screens[5]; // screens[3] = fade screen start // screens[4] = fade screen end, postimage tempoarary buffer -consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t ticrate_cons_t[] = {{0, "No"}, {1, "Full"}, {2, "Compact"}, {0, NULL}}; +consvar_t cv_ticrate = {"showfps", "No", CV_SAVE, ticrate_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static void CV_palette_OnChange(void); From baee6a1d57cafddb7d6a4a839507ca8d469e7661 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 10 May 2020 16:02:23 +0100 Subject: [PATCH 20/34] Update version number to 2.2.3 in all the usual files, also updated MODVERSION --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- src/doomdef.h | 8 ++++---- src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abec11087..85f469a9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # Version change is fine. project(SRB2 - VERSION 2.2.2 + VERSION 2.2.3 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index a28935f63..8d370301d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.2.2.{branch}-{build} +version: 2.2.3.{branch}-{build} os: MinGW environment: diff --git a/src/doomdef.h b/src/doomdef.h index a91142e9d..16f3d4783 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -143,9 +143,9 @@ extern char logfilename[1024]; // we use comprevision and compbranch instead. #else #define VERSION 202 // Game version -#define SUBVERSION 2 // more precise version number -#define VERSIONSTRING "v2.2.2" -#define VERSIONSTRINGW L"v2.2.2" +#define SUBVERSION 3 // more precise version number +#define VERSIONSTRING "v2.2.3" +#define VERSIONSTRINGW L"v2.2.3" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -213,7 +213,7 @@ extern char logfilename[1024]; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1". -#define MODVERSION 42 +#define MODVERSION 43 // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // Increment MINOREXECVERSION whenever a config change is needed that does not correspond diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 182220265..1ed28bd14 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1219,7 +1219,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.2; + CURRENT_PROJECT_VERSION = 2.2.3; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1231,7 +1231,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.2; + CURRENT_PROJECT_VERSION = 2.2.3; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From 3ce4c1b789bfde579d3cc911d527a4afb231f191 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 10 May 2020 16:47:01 +0100 Subject: [PATCH 21/34] Fix logging on Mac These fixes were suggested by Sveciaost on #mac-users on Discord --- src/sdl/i_main.c | 10 +++++----- src/sdl/i_system.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 5d0009927..3eded734f 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -27,7 +27,7 @@ #include #endif -#ifdef __unix__ +#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) #include #endif @@ -142,7 +142,7 @@ int main(int argc, char **argv) const char *reldir; int left; boolean fileabs; -#ifdef __unix__ +#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) const char *link; #endif @@ -201,7 +201,7 @@ int main(int argc, char **argv) M_PathParts(logdir) - 1, M_PathParts(logfilename) - 1, 0755); -#ifdef __unix__ +#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) logstream = fopen(logfilename, "w"); #ifdef DEFAULTDIR if (logdir) @@ -214,9 +214,9 @@ int main(int argc, char **argv) { I_OutputMsg("Error symlinking latest-log.txt: %s\n", strerror(errno)); } -#else/*__unix__*/ +#else/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/ logstream = fopen("latest-log.txt", "wt+"); -#endif/*__unix__*/ +#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/ } //I_OutputMsg("I_StartupSystem() ...\n"); diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index a86af316e..d2ed62516 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -2484,7 +2484,7 @@ void I_RemoveExitFunc(void (*func)()) } } -#ifndef __unix__ +#if !(defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)) static void Shittycopyerror(const char *name) { I_OutputMsg( @@ -2524,7 +2524,7 @@ static void Shittylogcopy(void) Shittycopyerror(logfilename); } } -#endif/*__unix__*/ +#endif/*!(defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON))*/ // // Closes down everything. This includes restoring the initial @@ -2548,7 +2548,7 @@ void I_ShutdownSystem(void) if (logstream) { I_OutputMsg("I_ShutdownSystem(): end of logstream.\n"); -#ifndef __unix__ +#if !(defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)) Shittylogcopy(); #endif fclose(logstream); From b7af502ed46df9a3adbc2b2a992b7bd17689256c Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 11 May 2020 00:16:01 +0800 Subject: [PATCH 22/34] Update MD5 hashes for player.dta and patch.pk3 --- src/config.h.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 4926f9a06..18320f96b 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -28,12 +28,13 @@ /* Manually defined asset hashes for non-CMake builds * Last updated 2020 / 02 / 15 - v2.2.1 - main assets * Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3 + * Last updated 2020 / 05 / 10 - v2.2.3 - player.dta & patch.pk3 */ #define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28" #define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead" -#define ASSET_HASH_PLAYER_DTA "ad49e07b17cc662f1ad70c454910b4ae" +#define ASSET_HASH_PLAYER_DTA "8a4507ddf9bc0682c09174400f26ad65" #ifdef USE_PATCH_DTA -#define ASSET_HASH_PATCH_PK3 "ee54330ecb743314c5f962af4db731ff" +#define ASSET_HASH_PATCH_PK3 "d56064ff33a0a4a17d38512cbcb5613d" #endif #endif From 197da95a232da92e61f88ee27c754e8671a6624f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 10 May 2020 20:09:08 +0100 Subject: [PATCH 23/34] Last minute OpenGL fix: don't check flippedness in HWR_RotateSpritePolyToAim if the mobj is actually a precipmobj! precipmobj_t does not have eflags, so P_MobjFlip checking it would actually be accessing memory addresses beyond the end of the struct --- src/hardware/hw_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 565076b95..69da6655a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4019,7 +4019,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale } // This is expecting a pointer to an array containing 4 wallVerts for a sprite -static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts) +static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts, const boolean precip) { if (cv_grspritebillboarding.value && spr && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE) @@ -4027,7 +4027,7 @@ static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts { float basey = FIXED_TO_FLOAT(spr->mobj->z); float lowy = wallVerts[0].y; - if (P_MobjFlip(spr->mobj) == -1) + if (!precip && P_MobjFlip(spr->mobj) == -1) // precip doesn't have eflags so they can't flip { basey = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height); } @@ -4140,7 +4140,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) } // Let dispoffset work first since this adjust each vertex - HWR_RotateSpritePolyToAim(spr, baseWallVerts); + HWR_RotateSpritePolyToAim(spr, baseWallVerts, false); realtop = top = baseWallVerts[3].y; realbot = bot = baseWallVerts[0].y; @@ -4419,7 +4419,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr) } // Let dispoffset work first since this adjust each vertex - HWR_RotateSpritePolyToAim(spr, wallVerts); + HWR_RotateSpritePolyToAim(spr, wallVerts, false); // This needs to be AFTER the shadows so that the regular sprites aren't drawn completely black. // sprite lighting by modulating the RGB components @@ -4503,7 +4503,7 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr) wallVerts[1].z = wallVerts[2].z = spr->z2; // Let dispoffset work first since this adjust each vertex - HWR_RotateSpritePolyToAim(spr, wallVerts); + HWR_RotateSpritePolyToAim(spr, wallVerts, true); wallVerts[0].sow = wallVerts[3].sow = 0; wallVerts[2].sow = wallVerts[1].sow = gpatch->max_s; From 61dfee7e133cfb9d4f3748ab1a02a79267bea6ff Mon Sep 17 00:00:00 2001 From: sphere Date: Mon, 11 May 2020 01:33:34 +0200 Subject: [PATCH 24/34] Don't show the FPS counter during startup. --- src/screen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/screen.c b/src/screen.c index 73c6b9ba0..e01d1a81a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -526,6 +526,9 @@ void SCR_DisplayTicRate(void) INT32 ticcntcolor = 0; const INT32 h = vid.height-(8*vid.dupy); + if (gamestate == GS_NULL) + return; + for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i) fpsgraph[i % TICRATE] = false; From 6b4ee94e383fa77d17849233280c11d98693bf0a Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 10 May 2020 19:40:28 -0700 Subject: [PATCH 25/34] Use camera angle, not mobj angle, when comparing Angle Anchor --- src/p_mobj.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 02be9dcef..78e0ccd41 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8252,6 +8252,7 @@ static boolean P_MobjDeadThink(mobj_t *mobj) // See Linedef Exec 457 (Track mobj angle to point) static void P_TracerAngleThink(mobj_t *mobj) { + angle_t looking; angle_t ang; if (!mobj->tracer) @@ -8266,7 +8267,12 @@ static void P_TracerAngleThink(mobj_t *mobj) // mobj->cvval - Allowable failure delay // mobj->cvmem - Failure timer - ang = mobj->angle - R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y); + if (mobj->player) + looking = ( mobj->player->cmd.angleturn << 16 );/* fixes CS_LMAOGALOG */ + else + looking = mobj->angle; + + ang = looking - R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y); // \todo account for distance between mobj and tracer // Because closer mobjs can be facing beyond the angle tolerance From 7257fc730a5658e8d5409ae2a4f78d76d6adf6bf Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 10 May 2020 19:59:56 -0700 Subject: [PATCH 26/34] Remove instances of HAVE_BLUA that actually disable Lua now --- src/b_bot.c | 2 -- src/p_enemy.c | 4 +--- src/p_user.c | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 9a4c20c17..4397938c1 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -459,7 +459,6 @@ boolean B_CheckRespawn(player_t *player) if (!sonic || sonic->health <= 0) return false; -#ifdef HAVE_BLUA // B_RespawnBot doesn't do anything if the condition above this isn't met { UINT8 shouldForce = LUAh_BotRespawn(sonic, tails); @@ -472,7 +471,6 @@ boolean B_CheckRespawn(player_t *player) else if (shouldForce == 2) return false; } -#endif // Check if Sonic is busy first. // If he's doing any of these things, he probably doesn't want to see us. diff --git a/src/p_enemy.c b/src/p_enemy.c index 6b092fb61..246ca1321 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8848,10 +8848,8 @@ void A_Dye(mobj_t *actor) mobj_t *target = ((locvar1 && actor->target) ? actor->target : actor); UINT8 color = (UINT8)locvar2; -#ifdef HAVE_BLUA if (LUA_CallAction("A_Dye", actor)) return; -#endif if (color >= MAXTRANSLATIONS) return; @@ -14508,4 +14506,4 @@ void A_ChangeHeight(mobj_t *actor) actor->height += locvar1; } P_SetThingPosition(actor); -} \ No newline at end of file +} diff --git a/src/p_user.c b/src/p_user.c index 63103f3c2..02417ccff 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1541,10 +1541,6 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname) int i; boolean result = false; -#ifndef HAVE_BLUA - (void)musname; -#endif - for (i = 0; i < MAXPLAYERS; i++) { if (!P_IsLocalPlayer(&players[i])) From 334ad93c56f7d3d2a0a93e03643d84b267f6cda8 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Mon, 11 May 2020 19:57:20 +0200 Subject: [PATCH 27/34] Fix splitscreen Title Card act name regression This fixes act names not being shown on player 2's view --- src/st_stuff.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 6e365dc68..b6226d085 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1333,13 +1333,12 @@ void ST_drawTitleCard(void) patch_t *actpat, *zigzag, *zztext; UINT8 colornum; const UINT8 *colormap; - stplyr = &players[consoleplayer]; - - if (stplyr->skincolor) - colornum = stplyr->skincolor; + + if (players[consoleplayer].skincolor) + colornum = players[consoleplayer].skincolor; else colornum = cv_playercolor.value; - + colormap = R_GetTranslationColormap(TC_DEFAULT, colornum, GTC_CACHE); if (!G_IsTitleCardAvailable()) From c52c8e0282beda74c2d2076fb5f1471e13b21c47 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 11 May 2020 14:37:53 -0700 Subject: [PATCH 28/34] Update version names, SUBVERSION, MODVERSION --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- src/doomdef.h | 8 ++++---- src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85f469a9f..1e46f5dc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # Version change is fine. project(SRB2 - VERSION 2.2.3 + VERSION 2.2.4 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index 8d370301d..5d599a516 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.2.3.{branch}-{build} +version: 2.2.4.{branch}-{build} os: MinGW environment: diff --git a/src/doomdef.h b/src/doomdef.h index 16f3d4783..6112881fb 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -143,9 +143,9 @@ extern char logfilename[1024]; // we use comprevision and compbranch instead. #else #define VERSION 202 // Game version -#define SUBVERSION 3 // more precise version number -#define VERSIONSTRING "v2.2.3" -#define VERSIONSTRINGW L"v2.2.3" +#define SUBVERSION 4 // more precise version number +#define VERSIONSTRING "v2.2.4" +#define VERSIONSTRINGW L"v2.2.4" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -213,7 +213,7 @@ extern char logfilename[1024]; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1". -#define MODVERSION 43 +#define MODVERSION 44 // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. // Increment MINOREXECVERSION whenever a config change is needed that does not correspond diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 1ed28bd14..745513eeb 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1219,7 +1219,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.3; + CURRENT_PROJECT_VERSION = 2.2.4; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1231,7 +1231,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.2.3; + CURRENT_PROJECT_VERSION = 2.2.4; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From a645f3a44f07f177f768f33eae14def482c7be7e Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 11 May 2020 14:40:28 -0700 Subject: [PATCH 29/34] Update patch.pk3 asset hash --- src/config.h.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.h.in b/src/config.h.in index 18320f96b..3b2579965 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -29,12 +29,13 @@ * Last updated 2020 / 02 / 15 - v2.2.1 - main assets * Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3 * Last updated 2020 / 05 / 10 - v2.2.3 - player.dta & patch.pk3 + * Last updated 2020 / 05 / 11 - v2.2.4 - patch.pk3 */ #define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28" #define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead" #define ASSET_HASH_PLAYER_DTA "8a4507ddf9bc0682c09174400f26ad65" #ifdef USE_PATCH_DTA -#define ASSET_HASH_PATCH_PK3 "d56064ff33a0a4a17d38512cbcb5613d" +#define ASSET_HASH_PATCH_PK3 "bbbf6af3b20349612ee06e0b55979a76" #endif #endif From 0c4f983eb5f589087f40de0c8a3237f594fb5bba Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 11 May 2020 23:48:35 +0200 Subject: [PATCH 30/34] Fix crash with rollout rock --- src/p_user.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 02417ccff..f5c8caf72 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4429,13 +4429,16 @@ void P_DoJump(player_t *player, boolean soundandstate) else if (player->powers[pw_carry] == CR_ROLLOUT) { player->mo->momz = 9*FRACUNIT; - if (P_MobjFlip(player->mo->tracer)*player->mo->tracer->momz > 0) - player->mo->momz += player->mo->tracer->momz; - if (!P_IsObjectOnGround(player->mo->tracer)) - P_SetObjectMomZ(player->mo->tracer, -9*FRACUNIT, true); + if (player->mo->tracer) + { + if (P_MobjFlip(player->mo->tracer)*player->mo->tracer->momz > 0) + player->mo->momz += player->mo->tracer->momz; + if (!P_IsObjectOnGround(player->mo->tracer)) + P_SetObjectMomZ(player->mo->tracer, -9*FRACUNIT, true); + player->mo->tracer->flags |= MF_PUSHABLE; + P_SetTarget(&player->mo->tracer->tracer, NULL); + } player->powers[pw_carry] = CR_NONE; - player->mo->tracer->flags |= MF_PUSHABLE; - P_SetTarget(&player->mo->tracer->tracer, NULL); P_SetTarget(&player->mo->tracer, NULL); } else if (player->mo->eflags & MFE_GOOWATER) From 89cd756cd83e4a03a34d1f16da18142d8167d889 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:37:15 +0100 Subject: [PATCH 31/34] make savegamename in doomdef.h an extern, put the actual definition in d_main.c --- src/d_main.c | 2 ++ src/doomdef.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 07e15aec4..07a7ecf91 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -125,6 +125,8 @@ boolean advancedemo; INT32 debugload = 0; #endif +char savegamename[256]; + char srb2home[256] = "."; char srb2path[256] = "."; boolean usehome = true; diff --git a/src/doomdef.h b/src/doomdef.h index 6112881fb..4b425dc72 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -458,7 +458,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG; // Things that used to be in dstrings.h #define SAVEGAMENAME "srb2sav" -char savegamename[256]; +extern char savegamename[256]; // m_misc.h #ifdef GETTEXT From dab212dc56936dd92a935d0c81003ff1d35ee2ee Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:40:51 +0100 Subject: [PATCH 32/34] turn all non-extern variables in s_sound.h into externs (and put their real definitions in the .c file) --- src/s_sound.c | 5 +++++ src/s_sound.h | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index d108363eb..5ed9fd83a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -134,6 +134,7 @@ consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE, CV_Y consvar_t cv_playsoundsifunfocused = {"playsoundsifunfocused", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef HAVE_OPENMPT +openmpt_module *openmpt_mhandle = NULL; static CV_PossibleValue_t interpolationfilter_cons_t[] = {{0, "Default"}, {1, "None"}, {2, "Linear"}, {4, "Cubic"}, {8, "Windowed sinc"}, {0, NULL}}; consvar_t cv_modfilter = {"modfilter", "0", CV_SAVE|CV_CALL, interpolationfilter_cons_t, ModFilter_OnChange, 0, NULL, NULL, 0, 0, NULL}; #endif @@ -1910,6 +1911,10 @@ UINT32 S_GetMusicPosition(void) /// In this section: mazmazz doesn't know how to do dynamic arrays or struct pointers! /// ------------------------ +char music_stack_nextmusname[7]; +boolean music_stack_noposition = false; +UINT32 music_stack_fadeout = 0; +UINT32 music_stack_fadein = 0; static musicstack_t *music_stacks = NULL; static musicstack_t *last_music_stack = NULL; diff --git a/src/s_sound.h b/src/s_sound.h index 119722af4..3334fcb69 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -22,7 +22,7 @@ #ifdef HAVE_OPENMPT #include "libopenmpt/libopenmpt.h" -openmpt_module *openmpt_mhandle; +extern openmpt_module *openmpt_mhandle; #endif // mask used to indicate sound origin is player item pickup @@ -262,10 +262,10 @@ typedef struct musicstack_s struct musicstack_s *next; } musicstack_t; -char music_stack_nextmusname[7]; -boolean music_stack_noposition; -UINT32 music_stack_fadeout; -UINT32 music_stack_fadein; +extern char music_stack_nextmusname[7]; +extern boolean music_stack_noposition; +extern UINT32 music_stack_fadeout; +extern UINT32 music_stack_fadein; void S_SetStackAdjustmentStart(void); void S_AdjustMusicStackTics(void); @@ -333,7 +333,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum); #ifdef MUSICSLOT_COMPATIBILITY // For compatibility with code/scripts relying on older versions // This is a list of all the "special" slot names and their associated numbers -const char *compat_special_music_slots[16]; +extern const char *compat_special_music_slots[16]; #endif #endif From 064f4bcf349e9600552a0b99bd0fbfb3cbcf0958 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:42:16 +0100 Subject: [PATCH 33/34] added missing extern keyword for ms_RoomId in mserv.h (the definition is already in the .c file in this case) --- src/mserv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mserv.h b/src/mserv.h index 6d91da643..5f9b8da5f 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -68,7 +68,7 @@ extern consvar_t cv_masterserver, cv_servername; // < 0 to not connect (usually -1) (offline mode) // == 0 to show all rooms, not a valid hosting room // anything else is whatever room the MS assigns to that number (online mode) -INT16 ms_RoomId; +extern INT16 ms_RoomId; const char *GetMasterServerPort(void); const char *GetMasterServerIP(void); From 8c88c3dbb4479f09f65df9dec3c8ef5ef09792e3 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:43:49 +0100 Subject: [PATCH 34/34] added missing extern keyword for ntemprecords in doomstat.h (definition is in g_game.c) --- src/doomstat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomstat.h b/src/doomstat.h index 1ec03a86c..0c2f1e975 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -545,7 +545,7 @@ extern recorddata_t *mainrecords[NUMMAPS]; extern UINT8 mapvisited[NUMMAPS]; // Temporary holding place for nights data for the current map -nightsdata_t ntemprecords; +extern nightsdata_t ntemprecords; extern UINT32 token; ///< Number of tokens collected in a level extern UINT32 tokenlist; ///< List of tokens collected