From ec8f64100eef29843c85488faa9bd3983e3955d8 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 6 Jul 2019 00:31:02 -0400 Subject: [PATCH 1/4] Hardcode brick debris --- src/dehacked.c | 2 ++ src/hardware/hw_light.c | 3 +++ src/info.c | 32 ++++++++++++++++++++++++++++++++ src/info.h | 6 ++++++ 4 files changed, 43 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index d86161390..f851f4963 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7167,6 +7167,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ROCKCRUMBLEN", "S_ROCKCRUMBLEO", "S_ROCKCRUMBLEP", + "S_BRICKDEBRIS", #ifdef SEENAMES "S_NAMECHECK", @@ -7881,6 +7882,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ROCKCRUMBLE14", "MT_ROCKCRUMBLE15", "MT_ROCKCRUMBLE16", + "MT_BRICKDEBRIS", #ifdef SEENAMES "MT_NAMECHECK", diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 949f38064..2feda1f1f 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -580,6 +580,9 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_ROIO &lspr[NOLIGHT], // SPR_ROIP + // Bricks + &lspr[NOLIGHT], // SPR_BRIC + // Gravity Well Objects &lspr[NOLIGHT], // SPR_GWLG &lspr[NOLIGHT], // SPR_GWLR diff --git a/src/info.c b/src/info.c index 074e31ba2..0dee208f8 100644 --- a/src/info.c +++ b/src/info.c @@ -475,6 +475,9 @@ char sprnames[NUMSPRITES + 1][5] = "ROIO", "ROIP", + // Bricks + "BRIC", + // Gravity Well Objects "GWLG", "GWLR", @@ -3861,6 +3864,8 @@ state_t states[NUMSTATES] = {SPR_ROIO, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEO {SPR_ROIP, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEP + {SPR_BRIC, FF_ANIMATE, -1, {A_DebrisRandom}, 7, 2, S_NULL}, // S_BRICKDEBRIS + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif @@ -19970,6 +19975,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_BRICKDEBRIS + -1, // doomednum + S_BRICKDEBRIS, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 0, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 255, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 16*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_RUNSPAWNFUNC|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + S_NULL // raisestate + }, + #ifdef SEENAMES { // MT_NAMECHECK -1, // doomednum diff --git a/src/info.h b/src/info.h index 13abfa5f6..75cb00906 100644 --- a/src/info.h +++ b/src/info.h @@ -720,6 +720,9 @@ typedef enum sprite SPR_ROIO, SPR_ROIP, + // Bricks + SPR_BRIC, + // Gravity Well Objects SPR_GWLG, SPR_GWLR, @@ -3923,6 +3926,9 @@ typedef enum state S_ROCKCRUMBLEO, S_ROCKCRUMBLEP, + // Bricks + S_BRICKDEBRIS, + #ifdef SEENAMES S_NAMECHECK, #endif From ef05d81a4c7efcf4bec0eddbc7aa366bc9e8b2d3 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 6 Jul 2019 00:39:36 -0400 Subject: [PATCH 2/4] Change this, not that it really matters but --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 0dee208f8..49f6d4c8f 100644 --- a/src/info.c +++ b/src/info.c @@ -19984,7 +19984,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 255, // painchance + 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate From d2adb5e829cce48fad6952aa4f7ff6784568e224 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 6 Jul 2019 18:11:49 -0400 Subject: [PATCH 3/4] Update info.h Also add a case for MT_BRICKDEBRIS to P_MobjThinker --- src/info.h | 3 +++ src/p_mobj.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/info.h b/src/info.h index 75cb00906..4af76907f 100644 --- a/src/info.h +++ b/src/info.h @@ -4663,6 +4663,9 @@ typedef enum mobj_type MT_ROCKCRUMBLE15, MT_ROCKCRUMBLE16, + // Bricks + MT_BRICKDEBRIS, + #ifdef SEENAMES MT_NAMECHECK, #endif diff --git a/src/p_mobj.c b/src/p_mobj.c index 69550fa73..46f3ef49f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7309,6 +7309,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_ROCKCRUMBLE15: case MT_ROCKCRUMBLE16: case MT_WOODDEBRIS: + case MT_BRICKDEBRIS: if (mobj->z <= P_FloorzAtPos(mobj->x, mobj->y, mobj->z, mobj->height) && mobj->state != &states[mobj->info->deathstate]) { From 4da108748b4823b458104388953f5ea99f800b7d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 8 Jul 2019 21:17:40 +0100 Subject: [PATCH 4/4] Use M_SetupNextMenu to actually set up the Sound Options menu "properly" instead of the old hacks. If you wanted the game to reset the item selected to the top option like before though, I left a line commented out that would do that for you. Unlike the old item = 0 way, it would automatically be corrected for headers and other spaces (thus kind of future-proofing this code) --- src/m_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index cebdd1bbd..dca2e552d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2953,8 +2953,9 @@ boolean M_Responder(event_t *ev) return true; M_StartControlPanel(); M_Options(0); - currentMenu = &OP_SoundOptionsDef; - itemOn = 0; + // Uncomment the below if you want the menu to reset to the top each time like before. M_SetupNextMenu will fix it automatically. + //OP_SoundOptionsDef.lastOn = 0; + M_SetupNextMenu(&OP_SoundOptionsDef); return true; case KEY_F5: // Video Mode