From b77a66d8bb7d1c4645c522fb3864c03b20b2dd1f Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Mon, 17 Mar 2025 00:30:06 +0100 Subject: [PATCH] Fix Spelunky --- src/p_floor.c | 2 +- src/p_setup.c | 12 +++++++++++- src/r_textures.c | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index db6cf162e..8e7ce513c 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1093,7 +1093,7 @@ void T_ThwompSector(thwomp_t *thwomp) INT32 secnum; fixed_t speed; - if (thwompsactive == false) + if (mapnamespace == MNS_RINGRACERS && thwompsactive == false) { // Ring Racers: Rest until Lap 2 return; diff --git a/src/p_setup.c b/src/p_setup.c index 207379574..8aeb9fd97 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -4813,7 +4813,17 @@ static line_t *P_FindPointPushLine(taglist_t *list) static void P_SetBinaryFOFAlpha(line_t *line) { - if (sides[line->sidenum[0]].toptexture > 0) + // fun fact: in Kart, transparent FOFs with a missing top texture have their toptexture set to 1, + // because that's the ID of REDWALL. this makes the FOF invisible. + // in BlanKart, toptexture is set to 7478, which is a nonsensical alpha value that makes the FOF opaque. + // so now we have to check for MISSTEX and set alpha to 1 in that case! + // have fun with the time bomb in R_TextureNumForName :^) + if (mapnamespace == MNS_SRB2KART && sides[line->sidenum[0]].toptexture == R_TextureNumForName(MISSING_TEXTURE)) + { + line->args[1] = 1; + line->args[2] = TMB_TRANSLUCENT; + } + else if (sides[line->sidenum[0]].toptexture > 0) { line->args[1] = sides[line->sidenum[0]].toptexture; diff --git a/src/r_textures.c b/src/r_textures.c index 42729e5d1..7232216d9 100644 --- a/src/r_textures.c +++ b/src/r_textures.c @@ -2158,7 +2158,12 @@ INT32 R_TextureNumForName(const char *name) static INT32 redwall = -2; CONS_Debug(DBG_SETUP, "WARNING: R_TextureNumForName: %.8s not found\n", name); if (redwall == -2) + { redwall = R_CheckTextureNumForName(MISSING_TEXTURE); + if (redwall <= 256) + // see P_SetBinaryFOFAlpha + I_Error(MISSING_TEXTURE " resolved to ID <= 256. Shit's fucked man"); + } if (redwall != -1) return redwall; return 1;