From 2d50dd1fd1ad65923acb271717027316c802d4bd Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 00:02:38 +0000 Subject: [PATCH 001/181] A bunch of fixes that allow for proper handling of triggerspecial_touch. Not perfect, but I don't have any more time to spend tonight. --- src/p_floor.c | 39 +++++++++++++++++++++++++++++--- src/p_spec.c | 61 +++++++++++++++++++++++++++++---------------------- 2 files changed, 71 insertions(+), 29 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 911213014..1f3873d9f 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2073,6 +2073,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime) boolean inAndOut = false; boolean floortouch = false; fixed_t bottomheight, topheight; + msecnode_t *node; for (i = 0; i < MAXPLAYERS; i++) { @@ -2134,8 +2135,22 @@ void T_EachTimeThinker(levelspecthink_t *eachtime) if ((netgame || multiplayer) && players[j].spectator) continue; - if (players[j].mo->subsector->sector != targetsec) - continue; + if (players[j].mo->subsector->sector == targetsec) + ; + else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH) + { + boolean insector = false; + for (node = players[j].mo->touching_sectorlist; node; node = node->m_sectorlist_next) + { + if (node->m_sector == targetsec) + { + insector = true; + break; + } + } + if (!insector) + continue; + } topheight = P_GetSpecialTopZ(players[j].mo, sec, targetsec); bottomheight = P_GetSpecialBottomZ(players[j].mo, sec, targetsec); @@ -2184,7 +2199,25 @@ void T_EachTimeThinker(levelspecthink_t *eachtime) if ((netgame || multiplayer) && players[i].spectator) continue; - if (players[i].mo->subsector->sector != sec) + if (players[i].mo->subsector->sector == targetsec) + ; + else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH) + { + boolean insector = false; + for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) + { + if (node->m_sector == targetsec) + { + insector = true; + break; + } + } + if (!insector) + continue; + } + + if (!(players[i].mo->subsector->sector == sec + || P_PlayerTouchingSectorSpecial(&players[i], 2, (GETSECSPECIAL(sec->special, 2))) == sec)) continue; if (floortouch == true && P_IsObjectOnGroundIn(players[i].mo, sec)) diff --git a/src/p_spec.c b/src/p_spec.c index b04c55881..10a8f7313 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3606,14 +3606,16 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers { if (roversector) { - if (players[i].mo->subsector->sector != roversector) + if (!(players[i].mo->subsector->sector == roversector + || sector->flags & SF_TRIGGERSPECIAL_TOUCH)) goto DoneSection2; if (!P_ThingIsOnThe3DFloor(players[i].mo, sector, roversector)) goto DoneSection2; } else { - if (players[i].mo->subsector->sector != sector) + if (!(players[i].mo->subsector->sector == sector + || sector->flags & SF_TRIGGERSPECIAL_TOUCH)) goto DoneSection2; if (special == 3 && !P_MobjReadyToTrigger(players[i].mo, sector)) @@ -4364,6 +4366,7 @@ sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) { sector_t *sector; ffloor_t *rover; + fixed_t topheight, bottomheight; sector = mo->subsector->sector; if (!sector->ffloors) @@ -4371,8 +4374,6 @@ sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) for (rover = sector->ffloors; rover; rover = rover->next) { - fixed_t topheight, bottomheight; - if (!rover->master->frontsector->special) continue; @@ -4420,20 +4421,21 @@ sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) return NULL; } +#define TELEPORTED (player->mo->subsector->sector != originalsector) + /** Checks if a player is standing on or is inside a 3D floor (e.g. water) and * applies any specials. * * \param player Player to check. * \sa P_ThingOnSpecial3DFloor, P_PlayerInSpecialSector */ -static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) +static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector, sector_t *originalsector) { ffloor_t *rover; + fixed_t topheight, bottomheight; for (rover = sector->ffloors; rover; rover = rover->next) { - fixed_t topheight, bottomheight; - if (!rover->master->frontsector->special) continue; @@ -4477,7 +4479,10 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) // This FOF has the special we're looking for, but are we allowed to touch it? if (sector == player->mo->subsector->sector || (rover->master->frontsector->flags & SF_TRIGGERSPECIAL_TOUCH)) + { P_ProcessSpecialSector(player, rover->master->frontsector, sector); + if TELEPORTED return; + } } // Allow sector specials to be applied to polyobjects! @@ -4488,7 +4493,7 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) boolean touching = false; boolean inside = false; - while(po) + while (po) { if (po->flags & POF_NOSPECIALS) { @@ -4564,6 +4569,7 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) } P_ProcessSpecialSector(player, polysec, sector); + if TELEPORTED return; po = (polyobj_t *)(po->link.next); } @@ -4668,40 +4674,43 @@ static void P_RunSpecialSectorCheck(player_t *player, sector_t *sector) */ void P_PlayerInSpecialSector(player_t *player) { - sector_t *sector; + sector_t *originalsector; + sector_t *loopsector; msecnode_t *node; if (!player->mo) return; - // Do your ->subsector->sector first - sector = player->mo->subsector->sector; - P_PlayerOnSpecial3DFloor(player, sector); - // After P_PlayerOnSpecial3DFloor, recheck if the player is in that sector, - // because the player can be teleported in between these times. - if (sector == player->mo->subsector->sector) - P_RunSpecialSectorCheck(player, sector); + originalsector = player->mo->subsector->sector; - // Iterate through touching_sectorlist + P_PlayerOnSpecial3DFloor(player, originalsector, originalsector); // Handle FOFs first. + if TELEPORTED return; + + P_RunSpecialSectorCheck(player, originalsector); + if TELEPORTED return; + + // Iterate through touching_sectorlist for SF_TRIGGERSPECIAL_TOUCH for (node = player->mo->touching_sectorlist; node; node = node->m_sectorlist_next) { - sector = node->m_sector; + loopsector = node->m_sector; - if (sector == player->mo->subsector->sector) // Don't duplicate + if (loopsector == originalsector) // Don't duplicate continue; // Check 3D floors... - P_PlayerOnSpecial3DFloor(player, sector); + P_PlayerOnSpecial3DFloor(player, loopsector, originalsector); + if TELEPORTED return; - if (!(sector->flags & SF_TRIGGERSPECIAL_TOUCH)) - return; - // After P_PlayerOnSpecial3DFloor, recheck if the player is in that sector, - // because the player can be teleported in between these times. - if (sector == player->mo->subsector->sector) - P_RunSpecialSectorCheck(player, sector); + if (!(loopsector->flags & SF_TRIGGERSPECIAL_TOUCH)) + continue; + + P_RunSpecialSectorCheck(player, loopsector); + if TELEPORTED return; } } +#undef TELEPORTED + /** Animate planes, scroll walls, etc. and keeps track of level timelimit and exits if time is up. * * \sa P_CheckTimeLimit, P_CheckPointLimit From 6a2e101ebe0589c228ba0bdf990d8169250fd4ec Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 00:03:07 +0000 Subject: [PATCH 002/181] Forcing on triggerspecial_touch for slopes, because pain slopes and it would be a pain to handle this manually. --- src/p_slopes.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_slopes.c b/src/p_slopes.c index d939fee98..c127001cd 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -281,6 +281,7 @@ void P_SpawnSlope_Line(int linenum) if(frontfloor || frontceil) { line->frontsector->hasslope = true; // Tell the software renderer that we're sloped + line->frontsector->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact origin.z = line->backsector->floorheight; direction.x = nx; @@ -407,6 +408,7 @@ void P_SpawnSlope_Line(int linenum) if(backfloor || backceil) { line->backsector->hasslope = true; // Tell the software renderer that we're sloped + line->backsector->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact origin.z = line->frontsector->floorheight; // Backsector @@ -599,6 +601,7 @@ void P_CopySectorSlope(line_t *line) } fsec->hasslope = true; + fsec->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef } @@ -718,6 +721,7 @@ void P_ResetDynamicSlopes(void) { *slopetoset = P_NewVertexSlope(lines[i].tag, lines[i].tag, lines[i].tag, flags); sides[lines[i].sidenum[which]].sector->hasslope = true; + sides[lines[i].sidenum[which]].sector->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact } break; From 1e1a6c32f0b8c0ee0d93b4f1008fe6ae0e956cf8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 09:34:24 +0000 Subject: [PATCH 003/181] Corrected non-complete set of cases. --- src/p_floor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_floor.c b/src/p_floor.c index 1f3873d9f..b2c07bce7 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2151,6 +2151,8 @@ void T_EachTimeThinker(levelspecthink_t *eachtime) if (!insector) continue; } + else + continue; topheight = P_GetSpecialTopZ(players[j].mo, sec, targetsec); bottomheight = P_GetSpecialBottomZ(players[j].mo, sec, targetsec); @@ -2215,6 +2217,8 @@ void T_EachTimeThinker(levelspecthink_t *eachtime) if (!insector) continue; } + else + continue; if (!(players[i].mo->subsector->sector == sec || P_PlayerTouchingSectorSpecial(&players[i], 2, (GETSECSPECIAL(sec->special, 2))) == sec)) From 1bbbe15ee52600b1404cd65bb9b95591a0728938 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 13:53:52 +0000 Subject: [PATCH 004/181] Fixed a bug with being able to go under the lava because P_CheckSolidLava doesn't take slopes into account. (neither does P_CanRunOnWater, but I don't think it's necessary to make that check more complicated as you probably shouldn't be able to waterrun up steep surfaces anyways) --- src/lua_baselib.c | 5 ++++- src/p_local.h | 2 +- src/p_map.c | 2 +- src/p_maputl.c | 4 ++-- src/p_mobj.c | 6 +++--- src/p_user.c | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index e8e8fd020..00a519272 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -560,12 +560,15 @@ static int lib_pCheckSolidLava(lua_State *L) { mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); ffloor_t *rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR)); + sector_t *bound = *((sector_t **)luaL_checkudata(L, 3, META_SECTOR)); //HUDSAFE if (!mo) return LUA_ErrInvalid(L, "mobj_t"); if (!rover) return LUA_ErrInvalid(L, "ffloor_t"); - lua_pushboolean(L, P_CheckSolidLava(mo, rover)); + if (!bound) + return LUA_ErrInvalid(L, "sector_t"); + lua_pushboolean(L, P_CheckSolidLava(mo, rover, bound)); return 1; } diff --git a/src/p_local.h b/src/p_local.h index 1fd7ada04..ce6aed028 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -238,7 +238,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover); boolean P_CheckDeathPitCollide(mobj_t *mo); -boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover); +boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover, sector_t *bound); mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type); mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z); diff --git a/src/p_map.c b/src/p_map.c index 6a555953e..7b5426605 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1323,7 +1323,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) continue; } - if (thing->player && (P_CheckSolidLava(thing, rover) || P_CanRunOnWater(thing->player, rover))) + if (thing->player && (P_CheckSolidLava(thing, rover, newsubsec->sector) || P_CanRunOnWater(thing->player, rover))) ; else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)) ; diff --git a/src/p_maputl.c b/src/p_maputl.c index fea8530a1..3aa9a994f 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -646,7 +646,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) + if (mobj->player && (P_CheckSolidLava(mobj, rover, front) || P_CanRunOnWater(mobj->player, rover))) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) @@ -690,7 +690,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) + if (mobj->player && (P_CheckSolidLava(mobj, rover, back) || P_CanRunOnWater(mobj->player, rover))) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) diff --git a/src/p_mobj.c b/src/p_mobj.c index e7ec2f8b8..4f0c84033 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1983,7 +1983,7 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL); bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL); - if (mo->player && (P_CheckSolidLava(mo, rover) || P_CanRunOnWater(mo->player, rover))) // only the player should be affected + if (mo->player && (P_CheckSolidLava(mo, rover, sector) || P_CanRunOnWater(mo->player, rover))) // only the player should be affected ; else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only continue; @@ -2133,14 +2133,14 @@ boolean P_CheckDeathPitCollide(mobj_t *mo) return false; } -boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover) +boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover, sector_t *bound) { I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3 && !(rover->master->flags & ML_BLOCKMONSTERS) - && ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > *rover->topheight - FixedMul(16*FRACUNIT, mo->scale))) + && ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > P_GetSpecialTopZ(mo, rover->master->frontsector, bound) - FixedMul(16*FRACUNIT, mo->scale))) return true; return false; diff --git a/src/p_user.c b/src/p_user.c index f8dc942c0..801eb5951 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2908,7 +2908,7 @@ static void P_DoTeeter(player_t *player) bottomheight = P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y); #endif - if (P_CheckSolidLava(player->mo, rover)) + if (P_CheckSolidLava(player->mo, rover, sec)) ; else if (!(rover->flags & FF_BLOCKPLAYER || rover->flags & FF_QUICKSAND)) continue; // intangible 3d floor From a2dabd70413ab9085d9b3af113e8aa0d86d1d27c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 14:03:53 +0000 Subject: [PATCH 005/181] Fixed a bunch of things MI pointed out. --- src/p_floor.c | 4 ++-- src/p_spec.c | 48 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index b2c07bce7..0af81efee 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2201,14 +2201,14 @@ void T_EachTimeThinker(levelspecthink_t *eachtime) if ((netgame || multiplayer) && players[i].spectator) continue; - if (players[i].mo->subsector->sector == targetsec) + if (players[i].mo->subsector->sector == sec) ; else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH) { boolean insector = false; for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) { - if (node->m_sector == targetsec) + if (node->m_sector == sec) { insector = true; break; diff --git a/src/p_spec.c b/src/p_spec.c index 10a8f7313..1fd94b2e8 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3606,16 +3606,49 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers { if (roversector) { - if (!(players[i].mo->subsector->sector == roversector - || sector->flags & SF_TRIGGERSPECIAL_TOUCH)) + if (players[i].mo->subsector->sector == roversector) + ; + else if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) + { + boolean insector = false; + msecnode_t *node; + for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) + { + if (node->m_sector == roversector) + { + insector = true; + break; + } + } + if (!insector) + goto DoneSection2; + } + else goto DoneSection2; + if (!P_ThingIsOnThe3DFloor(players[i].mo, sector, roversector)) goto DoneSection2; } else { - if (!(players[i].mo->subsector->sector == sector - || sector->flags & SF_TRIGGERSPECIAL_TOUCH)) + if (players[i].mo->subsector->sector == sector) + ; + else if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) + { + boolean insector = false; + msecnode_t *node; + for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) + { + if (node->m_sector == sector) + { + insector = true; + break; + } + } + if (!insector) + goto DoneSection2; + } + else goto DoneSection2; if (special == 3 && !P_MobjReadyToTrigger(players[i].mo, sector)) @@ -4429,8 +4462,9 @@ sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) * \param player Player to check. * \sa P_ThingOnSpecial3DFloor, P_PlayerInSpecialSector */ -static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector, sector_t *originalsector) +static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) { + sector_t *originalsector = player->mo->subsector->sector; ffloor_t *rover; fixed_t topheight, bottomheight; @@ -4683,7 +4717,7 @@ void P_PlayerInSpecialSector(player_t *player) originalsector = player->mo->subsector->sector; - P_PlayerOnSpecial3DFloor(player, originalsector, originalsector); // Handle FOFs first. + P_PlayerOnSpecial3DFloor(player, originalsector); // Handle FOFs first. if TELEPORTED return; P_RunSpecialSectorCheck(player, originalsector); @@ -4698,7 +4732,7 @@ void P_PlayerInSpecialSector(player_t *player) continue; // Check 3D floors... - P_PlayerOnSpecial3DFloor(player, loopsector, originalsector); + P_PlayerOnSpecial3DFloor(player, loopsector); if TELEPORTED return; if (!(loopsector->flags & SF_TRIGGERSPECIAL_TOUCH)) From 04a38a683bc436ad2e00ebebcc223b1acc059a28 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 20:15:11 +0000 Subject: [PATCH 006/181] Okay, this is a biggun. Pay attention, everyone. Moved the handling of P_PlayerInSpecialSector to P_PlayerAfterThink from P_PlayerThink. * This allows the player to get hurt on sloped lava surfaces that are moving downwards. * Also prevents the player from standing on death pits for 1 tic. * Prevents the player moving 1 extra tic's worth of movement of pain when hit by sector. * Thankfully, no consequences re conveyors. * Like, the only consequences I've found have been positive. However, this DOES need to be thoroughly investigated before it can be allowed anywhere near Next itself. --- src/doomdef.h | 4 ++++ src/p_user.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/doomdef.h b/src/doomdef.h index fb8ab1ca2..7d883849d 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -495,4 +495,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note You should leave this enabled unless you're working with a future SRB2 version. #define MUSICSLOT_COMPATIBILITY +/// Handle touching sector specials in P_PlayerAfterThink instead of P_PlayerThink. +/// \note Required for proper collision with moving sloped surfaces that have sector specials on them. +#define SECTORSPECIALSAFTERTHINK + #endif // __DOOMDEF__ diff --git a/src/p_user.c b/src/p_user.c index 801eb5951..921f1240d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8779,6 +8779,7 @@ void P_PlayerThink(player_t *player) // check water content, set stuff in mobj P_MobjCheckWater(player->mo); +#ifndef SECTORSPECIALSAFTERTHINK #ifdef POLYOBJECTS if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo)) #endif @@ -8787,6 +8788,7 @@ void P_PlayerThink(player_t *player) if (!player->spectator) P_PlayerInSpecialSector(player); +#endif if (player->playerstate == PST_DEAD) { @@ -9148,6 +9150,17 @@ void P_PlayerAfterThink(player_t *player) cmd = &player->cmd; +#ifdef SECTORSPECIALSAFTERTHINK +#ifdef POLYOBJECTS + if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo)) +#endif + player->onconveyor = 0; + // check special sectors : damage & secrets + + if (!player->spectator) + P_PlayerInSpecialSector(player); +#endif + if (splitscreen && player == &players[secondarydisplayplayer]) thiscam = &camera2; else if (player == &players[displayplayer]) From d13ca362d66360c87dc6f53a08b68f3d6501cb01 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 21:34:43 +0000 Subject: [PATCH 007/181] Quicksand now supports slopes and also reverse gravity. --- src/p_user.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 921f1240d..f2f0cb777 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1940,6 +1940,7 @@ static void P_CheckQuicksand(player_t *player) { ffloor_t *rover; fixed_t sinkspeed, friction; + fixed_t topheight, bottomheight; if (!(player->mo->subsector->sector->ffloors && player->mo->momz <= 0)) return; @@ -1951,16 +1952,33 @@ static void P_CheckQuicksand(player_t *player) if (!(rover->flags & FF_QUICKSAND)) continue; - if (*rover->topheight >= player->mo->z && *rover->bottomheight < player->mo->z + player->mo->height) + topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); + bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); + + if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height) { sinkspeed = abs(rover->master->v1->x - rover->master->v2->x)>>1; sinkspeed = FixedDiv(sinkspeed,TICRATE*FRACUNIT); - player->mo->z -= sinkspeed; + if (player->mo->eflags & MFE_VERTICALFLIP) + { + fixed_t ceilingheight = P_GetCeilingZ(player->mo, player->mo->subsector->sector, player->mo->x, player->mo->y, NULL); - if (player->mo->z <= player->mo->subsector->sector->floorheight) - player->mo->z = player->mo->subsector->sector->floorheight; + player->mo->z += sinkspeed; + + if (player->mo->z + player->mo->height >= ceilingheight) + player->mo->z = ceilingheight - player->mo->height; + } + else + { + fixed_t floorheight = P_GetFloorZ(player->mo, player->mo->subsector->sector, player->mo->x, player->mo->y, NULL); + + player->mo->z -= sinkspeed; + + if (player->mo->z <= floorheight) + player->mo->z = floorheight; + } friction = abs(rover->master->v1->y - rover->master->v2->y)>>6; From d21b091b967d2d76d259347e8f6da6dab620fc03 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 22:14:34 +0000 Subject: [PATCH 008/181] * Slope/gravity support for quicksand complete. * Space sector support complete, bounds of drowning now altered slightly. * Knuckles climb now has symmetrical slope support for both normal and reverse gravity. * All slope-determining topheight and bottomheight code is now identical in form. * Camera postimages now support slopes properly. --- src/p_user.c | 89 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 67 insertions(+), 22 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index f2f0cb777..621122e2e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1607,9 +1607,8 @@ void P_DoPlayerExit(player_t *player) #define SPACESPECIAL 12 boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space { - sector_t *sector; - - sector = mo->subsector->sector; + sector_t *sector = mo->subsector->sector; + fixed_t topheight, bottomheight; if (GETSECSPECIAL(sector->special, 1) == SPACESPECIAL) return true; @@ -1622,11 +1621,18 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space { if (GETSECSPECIAL(rover->master->frontsector->special, 1) != SPACESPECIAL) continue; +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; +#else + topheight = *rover->topheight; + bottomheight = *rover->bottomheight; +#endif - if (mo->z > *rover->topheight) + if (mo->z + (mo->height/2) > topheight) continue; - if (mo->z + (mo->height/2) < *rover->bottomheight) + if (mo->z + (mo->height/2) < bottomheight) continue; return true; @@ -1638,9 +1644,10 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand { - sector_t *sector; + sector_t *sector = mo->subsector->sector; + fixed_t topheight, bottomheight; - sector = mo->subsector->sector; + fixed_t flipoffset = ((mo->eflags & MFE_VERTICALFLIP) ? (mo->height/2) : 0); if (sector->ffloors) { @@ -1654,10 +1661,18 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand if (!(rover->flags & FF_QUICKSAND)) continue; - if (mo->z > *rover->topheight) +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight; +#else + topheight = *rover->topheight; + bottomheight = *rover->bottomheight; +#endif + + if (mo->z + flipoffset > topheight) continue; - if (mo->z + (mo->height/2) < *rover->bottomheight) + if (mo->z + (mo->height/2) + flipoffset < bottomheight) continue; return true; @@ -1952,8 +1967,13 @@ static void P_CheckQuicksand(player_t *player) if (!(rover->flags & FF_QUICKSAND)) continue; - topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); - bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; +#else + topheight = *rover->topheight; + bottomheight = *rover->bottomheight; +#endif if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height) { @@ -2339,11 +2359,11 @@ static void P_DoClimbing(player_t *player) floorclimb = true; #ifdef ESLOPE - bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; #else - bottomheight = *rover->bottomheight; topheight = *rover->topheight; + bottomheight = *rover->bottomheight; #endif // Only supports rovers that are moving like an 'elevator', not just the top or bottom. @@ -2532,13 +2552,20 @@ static void P_DoClimbing(player_t *player) // Is there a FOF directly below that we can move onto? if (glidesector->sector->ffloors) { + fixed_t topheight; ffloor_t *rover; for (rover = glidesector->sector->ffloors; rover; rover = rover->next) { if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP)) continue; - if (*rover->topheight > ceilingheight - FixedMul(16*FRACUNIT, player->mo->scale)) +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; +#else + topheight = *rover->topheight; +#endif + + if (topheight > ceilingheight - FixedMul(16*FRACUNIT, player->mo->scale)) { foundfof = true; break; @@ -2916,14 +2943,12 @@ static void P_DoTeeter(player_t *player) { if (!(rover->flags & FF_EXISTS)) continue; +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; +#else topheight = *rover->topheight; bottomheight = *rover->bottomheight; - -#ifdef ESLOPE - if (*rover->t_slope) - topheight = P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y); - if (*rover->b_slope) - bottomheight = P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y); #endif if (P_CheckSolidLava(player->mo, rover, sec)) @@ -8549,13 +8574,23 @@ static void P_CalcPostImg(player_t *player) else if (sector->ffloors) { ffloor_t *rover; + fixed_t topheight; + fixed_t bottomheight; for (rover = sector->ffloors; rover; rover = rover->next) { if (!(rover->flags & FF_EXISTS)) continue; - if (pviewheight >= *rover->topheight || pviewheight <= *rover->bottomheight) +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; +#else + topheight = *rover->topheight; + bottomheight = *rover->bottomheight; +#endif + + if (pviewheight >= topheight || pviewheight <= bottomheight) continue; if (P_FindSpecialLineFromTag(13, rover->master->frontsector->tag, -1) != -1) @@ -8567,13 +8602,23 @@ static void P_CalcPostImg(player_t *player) if (sector->ffloors) { ffloor_t *rover; + fixed_t topheight; + fixed_t bottomheight; for (rover = sector->ffloors; rover; rover = rover->next) { if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER) continue; - if (pviewheight >= *rover->topheight || pviewheight <= *rover->bottomheight) +#ifdef ESLOPE + topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight; + bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight; +#else + topheight = *rover->topheight; + bottomheight = *rover->bottomheight; +#endif + + if (pviewheight >= topheight || pviewheight <= bottomheight) continue; *type = postimg_water; From 7b12820c8298a2abfeb11e3c3f7c3e09839e5840 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 2 Nov 2016 20:32:36 +0000 Subject: [PATCH 009/181] Tweaked P_CheckSolidLava to avoid changing its function signature, and P_CanRunOnWater now supports slopes too. --- src/lua_baselib.c | 5 +---- src/p_local.h | 2 +- src/p_mobj.c | 30 ++++++++++++++++++++++-------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 00a519272..e8e8fd020 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -560,15 +560,12 @@ static int lib_pCheckSolidLava(lua_State *L) { mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); ffloor_t *rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR)); - sector_t *bound = *((sector_t **)luaL_checkudata(L, 3, META_SECTOR)); //HUDSAFE if (!mo) return LUA_ErrInvalid(L, "mobj_t"); if (!rover) return LUA_ErrInvalid(L, "ffloor_t"); - if (!bound) - return LUA_ErrInvalid(L, "sector_t"); - lua_pushboolean(L, P_CheckSolidLava(mo, rover, bound)); + lua_pushboolean(L, P_CheckSolidLava(mo, rover)); return 1; } diff --git a/src/p_local.h b/src/p_local.h index ce6aed028..1fd7ada04 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -238,7 +238,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover); boolean P_CheckDeathPitCollide(mobj_t *mo); -boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover, sector_t *bound); +boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover); mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type); mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z); diff --git a/src/p_mobj.c b/src/p_mobj.c index 4f0c84033..6ad84de34 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1983,7 +1983,7 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL); bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL); - if (mo->player && (P_CheckSolidLava(mo, rover, sector) || P_CanRunOnWater(mo->player, rover))) // only the player should be affected + if (mo->player && (P_CheckSolidLava(mo, rover) || P_CanRunOnWater(mo->player, rover))) // only the player should be affected ; else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only continue; @@ -2133,15 +2133,23 @@ boolean P_CheckDeathPitCollide(mobj_t *mo) return false; } -boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover, sector_t *bound) +boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover) { I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); - if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3 - && !(rover->master->flags & ML_BLOCKMONSTERS) - && ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > P_GetSpecialTopZ(mo, rover->master->frontsector, bound) - FixedMul(16*FRACUNIT, mo->scale))) - return true; + { + fixed_t topheight = + #ifdef ESLOPE + *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : + #endif + *rover->topheight; + + if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3 + && !(rover->master->flags & ML_BLOCKMONSTERS) + && ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > topheight - FixedMul(16*FRACUNIT, mo->scale))) + return true; + } return false; } @@ -3076,11 +3084,17 @@ static boolean P_SceneryZMovement(mobj_t *mo) // boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) { + fixed_t topheight = +#ifdef ESLOPE + *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : +#endif + *rover->topheight; + if (!(player->pflags & PF_NIGHTSMODE) && !player->homing - && (((player->charability == CA_SWIM) || player->powers[pw_super] || player->charflags & SF_RUNONWATER) && player->mo->ceilingz-*rover->topheight >= player->mo->height) + && (((player->charability == CA_SWIM) || player->powers[pw_super] || player->charflags & SF_RUNONWATER) && player->mo->ceilingz-topheight >= player->mo->height) && (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale) && !(player->pflags & PF_SLIDING) - && abs(player->mo->z - *rover->topheight) < FixedMul(30*FRACUNIT, player->mo->scale)) + && abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale)) return true; return false; From e67f48df83cd82bc67a0d24fc00333e5d2bba62f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 2 Nov 2016 20:35:53 +0000 Subject: [PATCH 010/181] Forgot to revert the other files. --- src/p_map.c | 2 +- src/p_maputl.c | 4 ++-- src/p_user.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 7b5426605..6a555953e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1323,7 +1323,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) continue; } - if (thing->player && (P_CheckSolidLava(thing, rover, newsubsec->sector) || P_CanRunOnWater(thing->player, rover))) + if (thing->player && (P_CheckSolidLava(thing, rover) || P_CanRunOnWater(thing->player, rover))) ; else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)) ; diff --git a/src/p_maputl.c b/src/p_maputl.c index 3aa9a994f..fea8530a1 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -646,7 +646,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && (P_CheckSolidLava(mobj, rover, front) || P_CanRunOnWater(mobj->player, rover))) + if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) @@ -690,7 +690,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && (P_CheckSolidLava(mobj, rover, back) || P_CanRunOnWater(mobj->player, rover))) + if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) diff --git a/src/p_user.c b/src/p_user.c index 621122e2e..56ecdf804 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2951,7 +2951,7 @@ static void P_DoTeeter(player_t *player) bottomheight = *rover->bottomheight; #endif - if (P_CheckSolidLava(player->mo, rover, sec)) + if (P_CheckSolidLava(player->mo, rover)) ; else if (!(rover->flags & FF_BLOCKPLAYER || rover->flags & FF_QUICKSAND)) continue; // intangible 3d floor From 77399b8fb97711ca9fce68a093a247e9834a5579 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 6 Dec 2016 21:49:59 +0000 Subject: [PATCH 011/181] * Disabled #define SECTORSPECIALSAFTERTHINK. This did not need to be done in next, since it could have subtle consequences which we'd rather not deal with in the hyperextended patch cycle as-is. * Removed the adding of SF_TRIGGERSPECIAL_TOUCH for sectors with slopes in them. Too many undesired consequences, I'll handle them another way. --- src/doomdef.h | 2 +- src/p_slopes.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index f993dadf8..bccf433b2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -500,6 +500,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Handle touching sector specials in P_PlayerAfterThink instead of P_PlayerThink. /// \note Required for proper collision with moving sloped surfaces that have sector specials on them. -#define SECTORSPECIALSAFTERTHINK +//#define SECTORSPECIALSAFTERTHINK #endif // __DOOMDEF__ diff --git a/src/p_slopes.c b/src/p_slopes.c index c127001cd..d939fee98 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -281,7 +281,6 @@ void P_SpawnSlope_Line(int linenum) if(frontfloor || frontceil) { line->frontsector->hasslope = true; // Tell the software renderer that we're sloped - line->frontsector->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact origin.z = line->backsector->floorheight; direction.x = nx; @@ -408,7 +407,6 @@ void P_SpawnSlope_Line(int linenum) if(backfloor || backceil) { line->backsector->hasslope = true; // Tell the software renderer that we're sloped - line->backsector->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact origin.z = line->frontsector->floorheight; // Backsector @@ -601,7 +599,6 @@ void P_CopySectorSlope(line_t *line) } fsec->hasslope = true; - fsec->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef } @@ -721,7 +718,6 @@ void P_ResetDynamicSlopes(void) { *slopetoset = P_NewVertexSlope(lines[i].tag, lines[i].tag, lines[i].tag, flags); sides[lines[i].sidenum[which]].sector->hasslope = true; - sides[lines[i].sidenum[which]].sector->flags |= SF_TRIGGERSPECIAL_TOUCH; // you're gonna want to get specials on contact } break; From fca88d2e98da1c73c04d460b372ae4e336084ffe Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 8 Jan 2017 13:54:52 -0500 Subject: [PATCH 012/181] Mingw: disable GetText support --- src/Makefile.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 72404becc..3630c6367 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -328,7 +328,7 @@ ifdef MINGW INTERFACE=win32 NASMFORMAT=win32 ifndef NOGETTEXT - GETTEXT=1 + #GETTEXT=1 endif OBJDIR:=$(OBJDIR)/Mingw BIN:=$(BIN)/Mingw From 55925cabe829156847a27cb3a77d0d3609fa7dc5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 8 Jan 2017 14:06:30 -0500 Subject: [PATCH 013/181] win32: fixup printf warnings --- src/win32/win_cd.c | 4 ++-- src/win32/win_main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win32/win_cd.c b/src/win32/win_cd.c index d73b95523..ae13d3e57 100644 --- a/src/win32/win_cd.c +++ b/src/win32/win_cd.c @@ -180,9 +180,9 @@ static LPSTR hms(UINT seconds) hours = minutes / 60; minutes %= 60; if (hours > 0) - sprintf (s, "%lu:%02lu:%02lu", hours, minutes, seconds); + sprintf (s, "%lu:%02lu:%02lu", (long unsigned int)hours, (long unsigned int)minutes, (long unsigned int)seconds); else - sprintf (s, "%2lu:%02lu", minutes, seconds); + sprintf (s, "%2lu:%02lu", (long unsigned int)minutes, (long unsigned int)seconds); return s; } diff --git a/src/win32/win_main.c b/src/win32/win_main.c index 663eddbd4..563466dc2 100644 --- a/src/win32/win_main.c +++ b/src/win32/win_main.c @@ -470,7 +470,7 @@ static inline BOOL tlErrorMessage(const TCHAR *err) // // warn user if there is one // - printf("Error %Ts..\n", err); + printf("Error %s..\n", err); fflush(stdout); MessageBox(hWndMain, err, TEXT("ERROR"), MB_OK); From 8a421a05d9e9365d5bbfac54459794a497a2c4d5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 10 Feb 2017 20:31:58 +0000 Subject: [PATCH 014/181] admin bans with custom ban messages should now be recognised by the server properly --- 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 f47f6637c..1b23ce95e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2696,7 +2696,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) // If a verified admin banned someone, the server needs to know about it. // If the playernum isn't zero (the server) then the server needs to record the ban. - if (server && playernum && msg == KICK_MSG_BANNED) + if (server && playernum && (msg == KICK_MSG_BANNED || msg == KICK_MSG_CUSTOM_BAN)) { if (I_Ban && !I_Ban(playernode[(INT32)pnum])) { From 7424df8180e4f7e69a79200e244bea7c902eaf92 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 20 Feb 2017 19:58:29 +0000 Subject: [PATCH 015/181] Make sure I_Ban and Ban_Add are only used by the server Also make sure the server actually uses Ban_Add if an admin banned someone --- src/d_clisrv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1b23ce95e..41c3ac342 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2531,7 +2531,7 @@ static void Command_Ban(void) return; else WRITEUINT8(p, pn); - if (I_Ban && !I_Ban(node)) + if (server && I_Ban && !I_Ban(node)) // only the server is allowed to do this right now { CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n")); WRITEUINT8(p, KICK_MSG_GO_AWAY); @@ -2539,7 +2539,8 @@ static void Command_Ban(void) } else { - Ban_Add(COM_Argv(2)); + if (server) // only the server is allowed to do this right now + Ban_Add(COM_Argv(2)); if (COM_Argc() == 2) { @@ -2699,9 +2700,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) if (server && playernum && (msg == KICK_MSG_BANNED || msg == KICK_MSG_CUSTOM_BAN)) { if (I_Ban && !I_Ban(playernode[(INT32)pnum])) - { CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n")); - } + else + Ban_Add(reason); } switch (msg) From 6efb15c6e8a9c48e2f0c739ecf166bf43558943a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 20 Feb 2017 21:36:05 +0000 Subject: [PATCH 016/181] Fix Ban_Add usage for NONET --- src/d_clisrv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 41c3ac342..939d53dec 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2701,8 +2701,10 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) { if (I_Ban && !I_Ban(playernode[(INT32)pnum])) CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n")); +#ifndef NONET else Ban_Add(reason); +#endif } switch (msg) From b837d5b23d51b1674738106112e91dedbe9f6324 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 2 Mar 2017 14:25:46 +0000 Subject: [PATCH 017/181] Fix teamchange/teamchange2 to block changing FROM spectator rather than changing TO spectator This way they're consistent with Got_Teamchange, which is the cause of the "illegal team change" desyncs --- src/d_netcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f61c80cb2..2afadcc2e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2116,7 +2116,7 @@ static void Command_Teamchange_f(void) return; } - if (!cv_allowteamchange.value && !NetPacket.packet.newteam) // allow swapping to spectator even in locked teams. + if (!cv_allowteamchange.value && NetPacket.packet.newteam) // allow swapping to spectator even in locked teams. { CONS_Alert(CONS_NOTICE, M_GetText("The server is not allowing team changes at the moment.\n")); return; @@ -2213,7 +2213,7 @@ static void Command_Teamchange2_f(void) return; } - if (!cv_allowteamchange.value && !NetPacket.packet.newteam) // allow swapping to spectator even in locked teams. + if (!cv_allowteamchange.value && NetPacket.packet.newteam) // allow swapping to spectator even in locked teams. { CONS_Alert(CONS_NOTICE, M_GetText("The server is not allowing team changes at the moment.\n")); return; From c43b41815fede02f64420aac4f65f11c98e170e5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 2 Mar 2017 14:28:52 +0000 Subject: [PATCH 018/181] Make "Enter Game" option use the big blue window notice if you cannot switch teams, instead of falling back on changeteam's own console notice --- src/m_menu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index d7b4d9080..45b3d7e57 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3849,6 +3849,7 @@ static void M_ChangeLevel(INT32 choice) static void M_ConfirmSpectate(INT32 choice) { (void)choice; + // We allow switching to spectator even if team changing is not allowed M_ClearMenus(true); COM_ImmedExecute("changeteam spectator"); } @@ -3856,6 +3857,11 @@ static void M_ConfirmSpectate(INT32 choice) static void M_ConfirmEnterGame(INT32 choice) { (void)choice; + if (!cv_allowteamchange.value) + { + M_StartMessage(M_GetText("The server is not allowing\nteam changes at this time.\nPress a key.\n"), NULL, MM_NOTHING); + return; + } M_ClearMenus(true); COM_ImmedExecute("changeteam playing"); } From 99a04cca9cbce19ef0d51e47cbec29a1b86e0470 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 14 Apr 2017 20:29:08 +0100 Subject: [PATCH 019/181] First part of revamp: Removing Camera Rotate L/R keys, and giving the two situations where they had any unique functionality (Analog mode and NiGHTS objectplace) suitable replacements. --- src/g_game.c | 44 +++++++++++++++++++++----------------------- src/g_input.c | 6 ------ src/g_input.h | 2 -- src/m_cheat.c | 6 +++--- src/m_menu.c | 2 -- src/p_user.c | 36 +++++++----------------------------- 6 files changed, 31 insertions(+), 65 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 8bd71d123..64f84d544 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1011,13 +1011,13 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) if (turnleft) cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]); } - if (cv_analog.value || twodlevel + if (twodlevel || (player->mo && (player->mo->flags2 & MF2_TWOD)) || (!demoplayback && (player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || (player->pflags & (PF_SLIDING|PF_FORCESTRAFE))))) // Analog forcestrafe = true; - if (forcestrafe) // Analog + if (forcestrafe) { if (turnright) side += sidemove[speed]; @@ -1030,6 +1030,13 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) side += ((axis * sidemove[1]) >> 10); } } + else if (cv_analog.value) // Analog + { + if (turnright) + cmd->buttons |= BT_CAMRIGHT; + if (turnleft) + cmd->buttons |= BT_CAMLEFT; + } else { if (turnright) @@ -1117,15 +1124,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) if (PLAYER1INPUTDOWN(gc_use)) cmd->buttons |= BT_USE; - // Camera Controls - if (cv_debug || cv_analog.value || demoplayback || objectplacing || player->powers[pw_carry] == CR_NIGHTSMODE) - { - if (PLAYER1INPUTDOWN(gc_camleft)) - cmd->buttons |= BT_CAMLEFT; - if (PLAYER1INPUTDOWN(gc_camright)) - cmd->buttons |= BT_CAMRIGHT; - } - if (PLAYER1INPUTDOWN(gc_camreset)) { if (camera.chase && !resetdown) @@ -1225,9 +1223,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) cmd->sidemove = (SINT8)(cmd->sidemove + side); if (cv_analog.value) { - cmd->angleturn = (INT16)(thiscam->angle >> 16); if (player->awayviewtics) cmd->angleturn = (INT16)(player->awayviewmobj->angle >> 16); + else + cmd->angleturn = (INT16)(thiscam->angle >> 16); } else { @@ -1301,7 +1300,7 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) if (turnleft) cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]); } - if (cv_analog2.value || twodlevel + if (twodlevel || (player->mo && (player->mo->flags2 & MF2_TWOD)) || player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) @@ -1320,6 +1319,13 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) side += ((axis * sidemove[1]) >> 10); } } + else if (cv_analog2.value) // Analog + { + if (turnright) + cmd->buttons |= BT_CAMRIGHT; + if (turnleft) + cmd->buttons |= BT_CAMLEFT; + } else { if (turnright) @@ -1404,15 +1410,6 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) if (PLAYER2INPUTDOWN(gc_use)) cmd->buttons |= BT_USE; - // Camera Controls - if (cv_debug || cv_analog2.value || player->powers[pw_carry] == CR_NIGHTSMODE) - { - if (PLAYER2INPUTDOWN(gc_camleft)) - cmd->buttons |= BT_CAMLEFT; - if (PLAYER2INPUTDOWN(gc_camright)) - cmd->buttons |= BT_CAMRIGHT; - } - if (PLAYER2INPUTDOWN(gc_camreset)) { if (camera2.chase && !resetdown) @@ -1524,9 +1521,10 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) } if (cv_analog2.value) { - cmd->angleturn = (INT16)(thiscam->angle >> 16); if (player->awayviewtics) cmd->angleturn = (INT16)(player->awayviewmobj->angle >> 16); + else + cmd->angleturn = (INT16)(thiscam->angle >> 16); } else { diff --git a/src/g_input.c b/src/g_input.c index a538df06c..36b8373aa 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -977,8 +977,6 @@ static const char *gamecontrolname[num_gamecontrols] = "tossflag", "use", "camtoggle", - "camleft", - "camright", "camreset", "lookup", "lookdown", @@ -1074,8 +1072,6 @@ void G_Controldefault(void) gamecontrol[gc_use ][0] = KEY_JOY1+1; //B gamecontrol[gc_use ][1] = '.'; gamecontrol[gc_camtoggle ][1] = ','; - gamecontrol[gc_camleft ][0] = 'o'; - gamecontrol[gc_camright ][0] = 'p'; gamecontrol[gc_camreset ][0] = 'c'; gamecontrol[gc_lookup ][0] = KEY_PGUP; gamecontrol[gc_lookdown ][0] = KEY_PGDN; @@ -1178,8 +1174,6 @@ void G_Controldefault(void) gamecontrol[gc_tossflag ][0] = '\''; gamecontrol[gc_use ][0] = KEY_LSHIFT; gamecontrol[gc_camtoggle ][0] = 'v'; - gamecontrol[gc_camleft ][0] = '['; - gamecontrol[gc_camright ][0] = ']'; gamecontrol[gc_camreset ][0] = 'r'; gamecontrol[gc_lookup ][0] = KEY_UPARROW; gamecontrol[gc_lookdown ][0] = KEY_DOWNARROW; diff --git a/src/g_input.h b/src/g_input.h index d65339321..f52376b71 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -105,8 +105,6 @@ typedef enum gc_tossflag, gc_use, gc_camtoggle, - gc_camleft, - gc_camright, gc_camreset, gc_lookup, gc_lookdown, diff --git a/src/m_cheat.c b/src/m_cheat.c index 8ae670662..f988c0fd5 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -968,7 +968,7 @@ void OP_NightsObjectplace(player_t *player) if (player->pflags & PF_ATTACKDOWN) { // Are ANY objectplace buttons pressed? If no, remove flag. - if (!(cmd->buttons & (BT_ATTACK|BT_TOSSFLAG|BT_USE|BT_CAMRIGHT|BT_CAMLEFT))) + if (!(cmd->buttons & (BT_ATTACK|BT_TOSSFLAG|BT_USE|BT_WEAPONNEXT|BT_WEAPONPREV))) player->pflags &= ~PF_ATTACKDOWN; // Do nothing. @@ -1019,7 +1019,7 @@ void OP_NightsObjectplace(player_t *player) } // This places a ring! - if (cmd->buttons & BT_CAMRIGHT) + if (cmd->buttons & BT_WEAPONNEXT) { player->pflags |= PF_ATTACKDOWN; if (!OP_HeightOkay(player, false)) @@ -1030,7 +1030,7 @@ void OP_NightsObjectplace(player_t *player) } // This places a wing item! - if (cmd->buttons & BT_CAMLEFT) + if (cmd->buttons & BT_WEAPONPREV) { player->pflags |= PF_ATTACKDOWN; if (!OP_HeightOkay(player, false)) diff --git a/src/m_menu.c b/src/m_menu.c index fb8aeedad..e7926207f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1101,8 +1101,6 @@ static menuitem_t OP_CameraControlsMenu[] = { {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup }, {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown }, - {IT_CALL | IT_STRING2, NULL, "Rotate Camera L", M_ChangeControl, gc_camleft }, - {IT_CALL | IT_STRING2, NULL, "Rotate Camera R", M_ChangeControl, gc_camright }, {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview }, {IT_CALL | IT_STRING2, NULL, "Mouselook", M_ChangeControl, gc_mouseaiming }, {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, diff --git a/src/p_user.c b/src/p_user.c index d46f5130e..7062ebee4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8451,46 +8451,24 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->angle = angle; } - if (!objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && (player->powers[pw_carry] != CR_NIGHTSMODE) && displayplayer == consoleplayer) + if ((((thiscam == &camera) && cv_analog.value) || ((thiscam != &camera) && cv_analog2.value) || demoplayback) && !objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && (player->powers[pw_carry] != CR_NIGHTSMODE) && displayplayer == consoleplayer) { #ifdef REDSANALOG if ((player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)); else #endif - if (player->cmd.buttons & BT_CAMLEFT) + if (player->cmd.buttons & BT_CAMRIGHT) { if (thiscam == &camera) - { - if (cv_analog.value || demoplayback) - angle -= FixedAngle(cv_cam_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam_rotate, camrotate == 0 ? 358 - : camrotate - 2); - } + angle -= FixedAngle(cv_cam_rotspeed.value*FRACUNIT); else - { - if (cv_analog2.value) - angle -= FixedAngle(cv_cam2_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam2_rotate, camrotate == 0 ? 358 - : camrotate - 2); - } + angle -= FixedAngle(cv_cam2_rotspeed.value*FRACUNIT); } - else if (player->cmd.buttons & BT_CAMRIGHT) + else if (player->cmd.buttons & BT_CAMLEFT) { if (thiscam == &camera) - { - if (cv_analog.value || demoplayback) - angle += FixedAngle(cv_cam_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam_rotate, camrotate + 2); - } + angle += FixedAngle(cv_cam_rotspeed.value*FRACUNIT); else - { - if (cv_analog2.value) - angle += FixedAngle(cv_cam2_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam2_rotate, camrotate + 2); - } + angle += FixedAngle(cv_cam2_rotspeed.value*FRACUNIT); } } From 95d89078f5bb7a9d8ce52cff129e54a7ec2e4744 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 14 Apr 2017 20:43:30 +0100 Subject: [PATCH 020/181] Removal of cv_allcaps for console stuff. --- src/console.c | 20 ++++++++++---------- src/hu_stuff.c | 6 +++--- src/m_menu.c | 6 +----- src/v_video.c | 2 -- src/v_video.h | 2 +- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/console.c b/src/console.c index 3702dd560..fff9ba96c 100644 --- a/src/console.c +++ b/src/console.c @@ -1394,32 +1394,32 @@ static void CON_DrawInput(void) if (input_sel < c) V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 77 | V_NOSCALESTART); for (i = 0; i < 3; ++i, x += charwidth) - V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, true); } else - V_DrawCharacter(x-charwidth, y, CON_PROMPTCHAR | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x-charwidth, y, CON_PROMPTCHAR | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, true); for (cend = c + clen; c < cend; ++c, x += charwidth) { if ((input_sel > c && input_cur <= c) || (input_sel <= c && input_cur > c)) { V_DrawFill(x, y, charwidth, (10 * con_scalefactor), 77 | V_NOSCALESTART); - V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_YELLOWMAP | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_YELLOWMAP | V_NOSCALESTART, true); } else - V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_NOSCALESTART, true); if (c == input_cur && con_tick >= 4) - V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, true); } if (cend == input_cur && con_tick >= 4) - V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, true); if (rellip) { if (input_sel > cend) V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 77 | V_NOSCALESTART); for (i = 0; i < 3; ++i, x += charwidth) - V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, true); } } @@ -1465,11 +1465,11 @@ static void CON_DrawHudlines(void) else { //charwidth = SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor; - V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } } - //V_DrawCharacter(x, y, (p[c]&0xff) | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + //V_DrawCharacter(x, y, (p[c]&0xff) | cv_constextsize.value | V_NOSCALESTART, true); y += charheight; } @@ -1607,7 +1607,7 @@ static void CON_DrawConsole(void) charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; p++; } - V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } } diff --git a/src/hu_stuff.c b/src/hu_stuff.c index f6275631c..30b2a1263 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -840,7 +840,7 @@ static void HU_DrawChat(void) else { //charwidth = SHORT(hu_font[talk[i]-HU_FONTSTART]->width) * con_scalefactor; - V_DrawCharacter(HU_INPUTX + c, y, talk[i++] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value); + V_DrawCharacter(HU_INPUTX + c, y, talk[i++] | cv_constextsize.value | V_NOSCALESTART, true); } c += charwidth; } @@ -857,7 +857,7 @@ static void HU_DrawChat(void) else { //charwidth = SHORT(hu_font[w_chat[i]-HU_FONTSTART]->width) * con_scalefactor; - V_DrawCharacter(HU_INPUTX + c, y, w_chat[i++] | cv_constextsize.value | V_NOSCALESTART | t, !cv_allcaps.value); + V_DrawCharacter(HU_INPUTX + c, y, w_chat[i++] | cv_constextsize.value | V_NOSCALESTART | t, true); } c += charwidth; @@ -869,7 +869,7 @@ static void HU_DrawChat(void) } if (hu_tick < 4) - V_DrawCharacter(HU_INPUTX + c, y, '_' | cv_constextsize.value |V_NOSCALESTART|t, !cv_allcaps.value); + V_DrawCharacter(HU_INPUTX + c, y, '_' | cv_constextsize.value |V_NOSCALESTART|t, true); } diff --git a/src/m_menu.c b/src/m_menu.c index e7926207f..70388d40b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1333,9 +1333,8 @@ static menuitem_t OP_GameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Console Back Color", &cons_backcolor, 100}, {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize,110}, - {IT_STRING | IT_CVAR, NULL, "Uppercase Console", &cv_allcaps, 120}, - {IT_STRING | IT_CVAR, NULL, "Title Screen Demos", &cv_rollingdemos, 140}, + {IT_STRING | IT_CVAR, NULL, "Title Screen Demos", &cv_rollingdemos, 130}, }; static menuitem_t OP_ServerOptionsMenu[] = @@ -2826,9 +2825,6 @@ void M_Init(void) #ifndef NONET CV_RegisterVar(&cv_serversort); #endif - - //todo put this somewhere better... - CV_RegisterVar(&cv_allcaps); } // ========================================================================== diff --git a/src/v_video.c b/src/v_video.c index fb02dfc96..a906c43c2 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -44,8 +44,6 @@ static void CV_usegamma_OnChange(void); consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_usegamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_allcaps = {"allcaps", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; - static CV_PossibleValue_t constextsize_cons_t[] = { {V_NOSCALEPATCH, "Small"}, {V_SMALLSCALEPATCH, "Medium"}, {V_MEDSCALEPATCH, "Large"}, {0, "Huge"}, {0, NULL}}; diff --git a/src/v_video.h b/src/v_video.h index ca1f58a30..0c9e289d0 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -28,7 +28,7 @@ extern UINT8 *screens[5]; extern const UINT8 gammatable[5][256]; -extern consvar_t cv_ticrate, cv_usegamma, cv_allcaps, cv_constextsize; +extern consvar_t cv_ticrate, cv_usegamma, cv_constextsize; // Allocates buffer screens, call before R_Init. void V_Init(void); From 174921c1e1b897d3474434018c923de65a67b7ce Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 14 Apr 2017 20:46:48 +0100 Subject: [PATCH 021/181] End to sudden death. --- src/d_netcmd.c | 1 - src/d_netcmd.h | 1 - src/m_menu.c | 1 - src/p_inter.c | 8 -------- src/p_mobj.c | 1 - 5 files changed, 12 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 43f04bae3..4c7f78225 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -485,7 +485,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_itemrespawntime); CV_RegisterVar(&cv_itemrespawn); CV_RegisterVar(&cv_flagtime); - CV_RegisterVar(&cv_suddendeath); // misc CV_RegisterVar(&cv_friendlyfire); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 08fc8b831..fc72c8bf1 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -51,7 +51,6 @@ extern consvar_t cv_itemrespawntime; extern consvar_t cv_itemrespawn; extern consvar_t cv_flagtime; -extern consvar_t cv_suddendeath; extern consvar_t cv_skin; diff --git a/src/m_menu.c b/src/m_menu.c index 70388d40b..d7e3b6229 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1371,7 +1371,6 @@ static menuitem_t OP_NetgameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 66}, {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 74}, - {IT_STRING | IT_CVAR, NULL, "Sudden Death", &cv_suddendeath, 90}, {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 98}, {IT_STRING | IT_CVAR, NULL, "Force Skin", &cv_forceskin, 114}, diff --git a/src/p_inter.c b/src/p_inter.c index f5255a2f7..04118a378 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3120,14 +3120,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Don't get hurt by fire generated from friends. } - // Sudden-Death mode - if (source && source->type == MT_PLAYER) - { - if ((gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) && cv_suddendeath.value - && !player->powers[pw_flashing] && !player->powers[pw_invulnerability]) - damagetype = DMG_INSTAKILL; - } - // Player hits another player if (!force && source && source->player) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 520f9ad07..9216bc7d0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8763,7 +8763,6 @@ consvar_t cv_itemrespawntime = {"respawnitemtime", "30", CV_NETVAR|CV_CHEAT, res consvar_t cv_itemrespawn = {"respawnitem", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}}; consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT, flagtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_suddendeath = {"suddendeath", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void P_SpawnPrecipitation(void) { From 85b71aa6858d79d3dcd405ead255108cf5288eee Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 14 Apr 2017 20:51:25 +0100 Subject: [PATCH 022/181] End to old match scoring toggle. --- src/d_netcmd.c | 3 --- src/d_netcmd.h | 1 - src/m_menu.c | 11 ++++------- src/p_inter.c | 4 ++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 4c7f78225..6af6fa6e2 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -196,7 +196,6 @@ static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, { {3, "None"}, {0, NULL}}; static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}}; -static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}}; static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}}; static CV_PossibleValue_t timetic_cons_t[] = {{0, "Normal"}, {1, "Tics"}, {2, "Centiseconds"}, {0, NULL}}; @@ -311,7 +310,6 @@ consvar_t cv_friendlyfire = {"friendlyfire", "Off", CV_NETVAR, CV_OnOff, NULL, 0 consvar_t cv_itemfinder = {"itemfinder", "Off", CV_CALL, CV_OnOff, ItemFinder_OnChange, 0, NULL, NULL, 0, 0, NULL}; // Scoring type options -consvar_t cv_match_scoring = {"matchscoring", "Normal", CV_NETVAR|CV_CHEAT, match_scoring_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_overtime = {"overtime", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_rollingdemos = {"rollingdemos", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -532,7 +530,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_startinglives); CV_RegisterVar(&cv_countdowntime); CV_RegisterVar(&cv_runscripts); - CV_RegisterVar(&cv_match_scoring); CV_RegisterVar(&cv_overtime); CV_RegisterVar(&cv_pause); CV_RegisterVar(&cv_mute); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index fc72c8bf1..9b148ce5f 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -100,7 +100,6 @@ extern consvar_t cv_recycler; extern consvar_t cv_itemfinder; extern consvar_t cv_inttime, cv_advancemap, cv_playersforexit; -extern consvar_t cv_match_scoring; extern consvar_t cv_overtime; extern consvar_t cv_startinglives; diff --git a/src/m_menu.c b/src/m_menu.c index d7e3b6229..8a9d2327b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1394,14 +1394,11 @@ static menuitem_t OP_GametypeOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 74}, {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 82}, - {IT_HEADER, NULL, "MATCH", NULL, 98}, - {IT_STRING | IT_CVAR, NULL, "Scoring Type", &cv_match_scoring, 106}, + {IT_HEADER, NULL, "TAG", NULL, 98}, + {IT_STRING | IT_CVAR, NULL, "Hide Time", &cv_hidetime, 106}, - {IT_HEADER, NULL, "TAG", NULL, 122}, - {IT_STRING | IT_CVAR, NULL, "Hide Time", &cv_hidetime, 130}, - - {IT_HEADER, NULL, "CTF", NULL, 146}, - {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 154}, + {IT_HEADER, NULL, "CTF", NULL, 122}, + {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 130}, }; static menuitem_t OP_MonitorToggleMenu[] = diff --git a/src/p_inter.c b/src/p_inter.c index 04118a378..ff3718e67 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2097,7 +2097,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget { if (metalrecording) // Ack! Metal Sonic shouldn't die! Cut the tape, end recording! G_StopMetalRecording(); - if (gametype == GT_MATCH && cv_match_scoring.value == 0 // note, no team match suicide penalty + if (gametype == GT_MATCH // note, no team match suicide penalty && ((target == source) || (source == NULL && inflictor == NULL) || (source && !source->player))) { // Suicide penalty if (target->player->score >= 50) @@ -2887,7 +2887,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, { // Award no points when players shoot each other when cv_friendlyfire is on. if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) - P_AddPlayerScore(source->player, cv_match_scoring.value == 1 ? 25 : 50); + P_AddPlayerScore(source->player, 50); } } From 30b10b05d33f1227650bcad0e70456da02f06264 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 14 Apr 2017 21:01:45 +0100 Subject: [PATCH 023/181] Change analog mouse to apply turning buttons, because aa. --- src/g_game.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 64f84d544..858cf9c3f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1185,10 +1185,19 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) if (!mouseaiming && cv_mousemove.value) forward += mousey; - if (cv_analog.value || - (!demoplayback && (player->climbing + if ((!demoplayback && (player->climbing || (player->pflags & PF_SLIDING)))) // Analog for mouse side += mousex*2; + else if (cv_analog.value) + { + if (mousex) + { + if (mousex > 0) + cmd->buttons |= BT_CAMRIGHT; + else + cmd->buttons |= BT_CAMLEFT; + } + } else cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8)); @@ -1471,9 +1480,19 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) if (!mouseaiming && cv_mousemove2.value) forward += mouse2y; - if (cv_analog2.value || player->climbing + if (player->climbing || (player->pflags & PF_SLIDING)) // Analog for mouse side += mouse2x*2; + else if (cv_analog2.value) + { + if (mouse2x) + { + if (mouse2x > 0) + cmd->buttons |= BT_CAMRIGHT; + else + cmd->buttons |= BT_CAMLEFT; + } + } else cmd->angleturn = (INT16)(cmd->angleturn - (mouse2x*8)); From 37bd729fe88016e5371db61dd31d53a50babb2bb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 00:15:09 +0100 Subject: [PATCH 024/181] Scrolling, monolithic control configuration page. Relies on sphere's patch.dta update for arrow symbols. --- src/hu_stuff.h | 2 +- src/m_menu.c | 265 +++++++++++++++++++++++++++---------------------- 2 files changed, 145 insertions(+), 122 deletions(-) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 7b22f33f1..635e89682 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -21,7 +21,7 @@ //------------------------------------ // heads up font //------------------------------------ -#define HU_FONTSTART '\x1F' // the first font character +#define HU_FONTSTART '\x19' // the first font character #define HU_FONTEND '~' #define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) diff --git a/src/m_menu.c b/src/m_menu.c index 8a9d2327b..991d59ab8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -301,7 +301,7 @@ static void M_SetupMultiPlayer2(INT32 choice); // Options // Split into multiple parts due to size // Controls -menu_t OP_ControlsDef, OP_ControlListDef, OP_MoveControlsDef; +menu_t OP_ChangeControlsDef; menu_t OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef; menu_t OP_P1ControlsDef, OP_P2ControlsDef, OP_MouseOptionsDef; menu_t OP_Mouse2OptionsDef, OP_Joystick1Def, OP_Joystick2Def; @@ -1015,23 +1015,19 @@ static menuitem_t MP_PlayerSetupMenu[] = // ------------------------------------ // Prefix: OP_ static menuitem_t OP_MainMenu[] = -{ - {IT_SUBMENU | IT_STRING, NULL, "Setup Controls...", &OP_ControlsDef, 10}, - - {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 40}, - {IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 50}, - - {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 70}, - {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, -}; - -static menuitem_t OP_ControlsMenu[] = { {IT_SUBMENU | IT_STRING, NULL, "Player 1 Controls...", &OP_P1ControlsDef, 10}, {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, + {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 30}, - {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 40}, + {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 50}, + {IT_SUBMENU | IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 60}, + + {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, + + {IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 100}, + + {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 120}, }; static menuitem_t OP_P1ControlsMenu[] = @@ -1058,63 +1054,47 @@ static menuitem_t OP_P2ControlsMenu[] = {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 80}, }; -static menuitem_t OP_ControlListMenu[] = +static menuitem_t OP_ChangeControlsMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "Movement Controls...", &OP_MoveControlsDef, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Multiplayer Controls...", &OP_MPControlsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Camera Controls...", &OP_CameraControlsDef, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Miscellaneous Controls...", &OP_MiscControlsDef, 40}, -}; - -static menuitem_t OP_MoveControlsMenu[] = -{ - {IT_CALL | IT_STRING2, NULL, "Forward", M_ChangeControl, gc_forward }, - {IT_CALL | IT_STRING2, NULL, "Reverse", M_ChangeControl, gc_backward }, - {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, - {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright }, - {IT_CALL | IT_STRING2, NULL, "Jump", M_ChangeControl, gc_jump }, - {IT_CALL | IT_STRING2, NULL, "Spin", M_ChangeControl, gc_use }, - {IT_CALL | IT_STRING2, NULL, "Strafe Left", M_ChangeControl, gc_strafeleft }, - {IT_CALL | IT_STRING2, NULL, "Strafe Right", M_ChangeControl, gc_straferight}, -}; - -static menuitem_t OP_MPControlsMenu[] = -{ - {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, - {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, - {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, - {IT_CALL | IT_STRING2, NULL, "Toss Flag", M_ChangeControl, gc_tossflag }, - {IT_CALL | IT_STRING2, NULL, "Next Weapon", M_ChangeControl, gc_weaponnext }, - {IT_CALL | IT_STRING2, NULL, "Prev Weapon", M_ChangeControl, gc_weaponprev }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 1", M_ChangeControl, gc_wepslot1 }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 2", M_ChangeControl, gc_wepslot2 }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 3", M_ChangeControl, gc_wepslot3 }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 4", M_ChangeControl, gc_wepslot4 }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 5", M_ChangeControl, gc_wepslot5 }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 6", M_ChangeControl, gc_wepslot6 }, - {IT_CALL | IT_STRING2, NULL, "Weapon Slot 7", M_ChangeControl, gc_wepslot7 }, - {IT_CALL | IT_STRING2, NULL, "Ring Toss", M_ChangeControl, gc_fire }, - {IT_CALL | IT_STRING2, NULL, "Ring Toss Normal", M_ChangeControl, gc_firenormal }, -}; - -static menuitem_t OP_CameraControlsMenu[] = -{ - {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup }, - {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown }, - {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview }, - {IT_CALL | IT_STRING2, NULL, "Mouselook", M_ChangeControl, gc_mouseaiming }, - {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, - {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, -}; - -static menuitem_t OP_MiscControlsMenu[] = -{ - {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 }, - {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, - {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, - - {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, + {IT_CALL | IT_STRING2, NULL, "Move Forward", M_ChangeControl, gc_forward }, + {IT_CALL | IT_STRING2, NULL, "Move Backward", M_ChangeControl, gc_backward }, + {IT_CALL | IT_STRING2, NULL, "Move Left", M_ChangeControl, gc_strafeleft }, + {IT_CALL | IT_STRING2, NULL, "Move Right", M_ChangeControl, gc_straferight }, + {IT_CALL | IT_STRING2, NULL, "Jump / Main Action", M_ChangeControl, gc_jump }, + {IT_CALL | IT_STRING2, NULL, "Spin / Shield Action", M_ChangeControl, gc_use }, + {IT_DISABLED, NULL, "", NULL, 0}, + {IT_CALL | IT_STRING2, NULL, "Camera Up", M_ChangeControl, gc_lookup }, + {IT_CALL | IT_STRING2, NULL, "Camera Down", M_ChangeControl, gc_lookdown }, + {IT_CALL | IT_STRING2, NULL, "Camera Left", M_ChangeControl, gc_turnleft }, + {IT_CALL | IT_STRING2, NULL, "Camera Right", M_ChangeControl, gc_turnright }, + {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview }, + {IT_CALL | IT_STRING2, NULL, "Toggle Mouselook", M_ChangeControl, gc_mouseaiming }, + {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, + {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, + {IT_DISABLED, NULL, "", NULL, 0}, + {IT_CALL | IT_STRING2, NULL, "Talk", M_ChangeControl, gc_talkkey }, + {IT_CALL | IT_STRING2, NULL, "Talk (Team only)", M_ChangeControl, gc_teamkey }, + {IT_CALL | IT_STRING2, NULL, "Game Status", M_ChangeControl, gc_scores }, + {IT_DISABLED, NULL, "", NULL, 0}, + {IT_CALL | IT_STRING2, NULL, "Fire", M_ChangeControl, gc_fire }, + {IT_CALL | IT_STRING2, NULL, "Fire Normal", M_ChangeControl, gc_firenormal }, + {IT_CALL | IT_STRING2, NULL, "Toss Flag", M_ChangeControl, gc_tossflag }, + {IT_CALL | IT_STRING2, NULL, "Next Weapon", M_ChangeControl, gc_weaponnext }, + {IT_CALL | IT_STRING2, NULL, "Prev Weapon", M_ChangeControl, gc_weaponprev }, + {IT_CALL | IT_STRING2, NULL, "Red / Infinity", M_ChangeControl, gc_wepslot1 }, + {IT_CALL | IT_STRING2, NULL, "Automatic", M_ChangeControl, gc_wepslot2 }, + {IT_CALL | IT_STRING2, NULL, "Bounce", M_ChangeControl, gc_wepslot3 }, + {IT_CALL | IT_STRING2, NULL, "Scatter", M_ChangeControl, gc_wepslot4 }, + {IT_CALL | IT_STRING2, NULL, "Grenade", M_ChangeControl, gc_wepslot5 }, + {IT_CALL | IT_STRING2, NULL, "Explosion", M_ChangeControl, gc_wepslot6 }, + {IT_CALL | IT_STRING2, NULL, "Rail", M_ChangeControl, gc_wepslot7 }, + {IT_DISABLED, NULL, "", NULL, 0}, + {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 }, + {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, + {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, + {IT_DISABLED, NULL, "", NULL, 0}, + {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, + {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, }; static menuitem_t OP_Joystick1Menu[] = @@ -1735,14 +1715,9 @@ menu_t MP_PlayerSetupDef = // Options menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30); -menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30); -menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30); -menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlListDef); -menu_t OP_MPControlsDef = CONTROLMENUSTYLE(OP_MPControlsMenu, &OP_ControlListDef); -menu_t OP_CameraControlsDef = CONTROLMENUSTYLE(OP_CameraControlsMenu, &OP_ControlListDef); -menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef); -menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30); -menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30); +menu_t OP_ChangeControlsDef = CONTROLMENUSTYLE(OP_ChangeControlsMenu, &OP_MainDef); +menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_MainDef, 60, 30); +menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_MainDef, 60, 30); menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30); menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30); menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 60, 30); @@ -7484,15 +7459,17 @@ static void M_Setup1PControlsMenu(INT32 choice) currentMenu->lastOn = itemOn; // Unhide the three non-P2 controls - OP_MPControlsMenu[0].status = IT_CALL|IT_STRING2; - OP_MPControlsMenu[1].status = IT_CALL|IT_STRING2; - OP_MPControlsMenu[2].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[15].status = IT_DISABLED; + OP_ChangeControlsMenu[15+1].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[15+2].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[15+3].status = IT_CALL|IT_STRING2; // Unide the pause/console controls too - OP_MiscControlsMenu[3].status = IT_CALL|IT_STRING2; - OP_MiscControlsMenu[4].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[36].status = IT_DISABLED; + OP_ChangeControlsMenu[36+1].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[36+2].status = IT_CALL|IT_STRING2; - OP_ControlListDef.prevMenu = &OP_P1ControlsDef; - M_SetupNextMenu(&OP_ControlListDef); + OP_ChangeControlsDef.prevMenu = &OP_P1ControlsDef; + M_SetupNextMenu(&OP_ChangeControlsDef); } static void M_Setup2PControlsMenu(INT32 choice) @@ -7503,61 +7480,107 @@ static void M_Setup2PControlsMenu(INT32 choice) currentMenu->lastOn = itemOn; // Hide the three non-P2 controls - OP_MPControlsMenu[0].status = IT_GRAYEDOUT2; - OP_MPControlsMenu[1].status = IT_GRAYEDOUT2; - OP_MPControlsMenu[2].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[15].status = IT_DISABLED; + OP_ChangeControlsMenu[15+1].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[15+2].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[15+3].status = IT_GRAYEDOUT2; // Hide the pause/console controls too - OP_MiscControlsMenu[3].status = IT_GRAYEDOUT2; - OP_MiscControlsMenu[4].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[36].status = IT_DISABLED; + OP_ChangeControlsMenu[36+1].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[36+2].status = IT_GRAYEDOUT2; - OP_ControlListDef.prevMenu = &OP_P2ControlsDef; - M_SetupNextMenu(&OP_ControlListDef); + OP_ChangeControlsDef.prevMenu = &OP_P2ControlsDef; + M_SetupNextMenu(&OP_ChangeControlsDef); } +#define controlheight 18 + // Draws the Customise Controls menu static void M_DrawControl(void) { char tmp[50]; - INT32 i; + INT32 x, y, i, max, cursory = 0; INT32 keys[2]; - // draw title, strings and submenu - M_DrawGenericMenu(); + x = currentMenu->x; + y = currentMenu->y; + + i = itemOn - (controlheight/2); + if (i < 0) + i = 0; + + max = i + controlheight; + if (max > currentMenu->numitems) + { + max = currentMenu->numitems; + if (max < controlheight) + i = 0; + else + i = max - controlheight; + } + + // draw title (or big pic) + M_DrawMenuTitle(); M_CentreText(30, (setupcontrols_secondaryplayer ? "SET CONTROLS FOR SECONDARY PLAYER" : "PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR")); - for (i = 0;i < currentMenu->numitems;i++) + if (i) { - if (currentMenu->menuitems[i].status != IT_CONTROL) - continue; - - keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; - keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; - - tmp[0] ='\0'; - if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) - { - strcpy(tmp, "---"); - } - else - { - if (keys[0] != KEY_NULL) - strcat (tmp, G_KeynumToString (keys[0])); - - if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) - strcat(tmp," or "); - - if (keys[1] != KEY_NULL) - strcat (tmp, G_KeynumToString (keys[1])); - - - } - V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, currentMenu->y + i*8, V_YELLOWMAP, tmp); + i++; + V_DrawCenteredString(BASEVIDWIDTH/2, y, V_YELLOWMAP, "\x1A"); // up arrow + y += SMALLLINEHEIGHT; } + if (max != currentMenu->numitems) + { + max--; + V_DrawCenteredString(BASEVIDWIDTH/2, y+(SMALLLINEHEIGHT*(max-i)), V_YELLOWMAP, "\x1B"); // down arrow + } + + for (; i < max; i++) + { + if (i == itemOn) + cursory = y; + + if (currentMenu->menuitems[i].status == IT_CONTROL) + { + V_DrawString(x, y, ((i == itemOn) ? V_YELLOWMAP : 0), currentMenu->menuitems[i].text); + keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; + keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; + + tmp[0] ='\0'; + if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) + { + strcpy(tmp, "---"); + } + else + { + if (keys[0] != KEY_NULL) + strcat (tmp, G_KeynumToString (keys[0])); + + if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) + strcat(tmp," or "); + + if (keys[1] != KEY_NULL) + strcat (tmp, G_KeynumToString (keys[1])); + + + } + V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, V_YELLOWMAP, tmp); + } + else if (currentMenu->menuitems[i].text) + V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + + y += SMALLLINEHEIGHT; + } + + V_DrawScaledPatch(currentMenu->x - 24, cursory, 0, + W_CachePatchName("M_CURSOR", PU_CACHE)); } +#undef controlbuffer + static INT32 controltochange; static void M_ChangecontrolResponse(event_t *ev) From df8078d9a59305764ce9e448c99f6bb6456d6e38 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 00:18:56 +0100 Subject: [PATCH 025/181] Move Game Status up so it shows up on first opening the menu, considering it has an effect in singleplayer but talk doesn't. --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 991d59ab8..a5cfd7974 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1072,9 +1072,9 @@ static menuitem_t OP_ChangeControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, {IT_DISABLED, NULL, "", NULL, 0}, + {IT_CALL | IT_STRING2, NULL, "Game Status", M_ChangeControl, gc_scores }, {IT_CALL | IT_STRING2, NULL, "Talk", M_ChangeControl, gc_talkkey }, {IT_CALL | IT_STRING2, NULL, "Talk (Team only)", M_ChangeControl, gc_teamkey }, - {IT_CALL | IT_STRING2, NULL, "Game Status", M_ChangeControl, gc_scores }, {IT_DISABLED, NULL, "", NULL, 0}, {IT_CALL | IT_STRING2, NULL, "Fire", M_ChangeControl, gc_fire }, {IT_CALL | IT_STRING2, NULL, "Fire Normal", M_ChangeControl, gc_firenormal }, From cafb54cc378779402a289617bdd0b82cbe9ce809 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 01:08:26 +0100 Subject: [PATCH 026/181] * Tweak pre-key control menu. Not exactly as desired, but exposes flipcam and is functional enough for now. * Change names of axes. * Seriously defuck joystick selection for the default number of joysticks available. * Renames a few other options. --- src/m_menu.c | 77 ++++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index a5cfd7974..c74455799 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1036,10 +1036,11 @@ static menuitem_t OP_P1ControlsMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 30}, - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 50}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair , 60}, + {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 50}, + {IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam , 60}, + {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 70}, - {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 80}, + {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 90}, }; static menuitem_t OP_P2ControlsMenu[] = @@ -1049,9 +1050,10 @@ static menuitem_t OP_P2ControlsMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 30}, {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 50}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 60}, + {IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 60}, + {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 70}, - {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 80}, + {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 90}, }; static menuitem_t OP_ChangeControlsMenu[] = @@ -1100,23 +1102,23 @@ static menuitem_t OP_ChangeControlsMenu[] = static menuitem_t OP_Joystick1Menu[] = { {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup1PJoystickMenu, 10}, - {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis , 30}, - {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis , 40}, - {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis , 50}, - {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis , 60}, - {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis , 70}, - {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis , 80}, + {IT_STRING | IT_CVAR, NULL, "Move \x1A \x1B Axis" , &cv_moveaxis , 30}, + {IT_STRING | IT_CVAR, NULL, "Move \x1C \x1D Axis" , &cv_sideaxis , 40}, + {IT_STRING | IT_CVAR, NULL, "Camera \x1A \x1B Axis" , &cv_lookaxis , 50}, + {IT_STRING | IT_CVAR, NULL, "Camera \x1C \x1D Axis" , &cv_turnaxis , 60}, + {IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis , 70}, + {IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis , 80}, }; static menuitem_t OP_Joystick2Menu[] = { {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup2PJoystickMenu, 10}, - {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis2 , 30}, - {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis2 , 40}, - {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis2 , 50}, - {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis2 , 60}, - {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis2 , 70}, - {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis2 , 80}, + {IT_STRING | IT_CVAR, NULL, "Move \x1A \x1B Axis" , &cv_moveaxis2 , 30}, + {IT_STRING | IT_CVAR, NULL, "Move \x1C \x1D Axis" , &cv_sideaxis2 , 40}, + {IT_STRING | IT_CVAR, NULL, "Camera \x1A \x1B Axis" , &cv_lookaxis2 , 50}, + {IT_STRING | IT_CVAR, NULL, "Camera \x1C \x1D Axis" , &cv_turnaxis2 , 60}, + {IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis2 , 70}, + {IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis2 , 80}, }; static menuitem_t OP_JoystickSetMenu[] = @@ -1126,8 +1128,6 @@ static menuitem_t OP_JoystickSetMenu[] = {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '2'}, {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '3'}, {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '4'}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '5'}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '6'}, }; static menuitem_t OP_MouseOptionsMenu[] = @@ -1135,13 +1135,13 @@ static menuitem_t OP_MouseOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10}, - {IT_STRING | IT_CVAR, NULL, "Always MouseLook", &cv_alwaysfreelook, 30}, + {IT_STRING | IT_CVAR, NULL, "Always Mouselook", &cv_alwaysfreelook, 30}, {IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove, 40}, - {IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse, 50}, + {IT_STRING | IT_CVAR, NULL, "Invert Y Axis", &cv_invertmouse, 50}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Mouse X Speed", &cv_mousesens, 60}, + NULL, "Mouse X Sensitivity", &cv_mousesens, 60}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Mouse Y Speed", &cv_mouseysens, 70}, + NULL, "Mouse Y Sensitivity", &cv_mouseysens, 70}, }; static menuitem_t OP_Mouse2OptionsMenu[] = @@ -1149,13 +1149,13 @@ static menuitem_t OP_Mouse2OptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Use Mouse 2", &cv_usemouse2, 10}, {IT_STRING | IT_CVAR, NULL, "Second Mouse Serial Port", &cv_mouse2port, 20}, - {IT_STRING | IT_CVAR, NULL, "Always MouseLook", &cv_alwaysfreelook2, 30}, + {IT_STRING | IT_CVAR, NULL, "Always Mouselook", &cv_alwaysfreelook2, 30}, {IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove2, 40}, - {IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse2, 50}, + {IT_STRING | IT_CVAR, NULL, "Invert Y Axis", &cv_invertmouse2, 50}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Mouse X Speed", &cv_mousesens2, 60}, + NULL, "Mouse X Sensitivity", &cv_mousesens2, 60}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Mouse Y Speed", &cv_mouseysens2, 70}, + NULL, "Mouse Y Sensitivity", &cv_mouseysens2, 70}, }; static menuitem_t OP_VideoOptionsMenu[] = @@ -1716,10 +1716,10 @@ menu_t MP_PlayerSetupDef = // Options menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30); menu_t OP_ChangeControlsDef = CONTROLMENUSTYLE(OP_ChangeControlsMenu, &OP_MainDef); -menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_MainDef, 60, 30); -menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_MainDef, 60, 30); -menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30); -menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30); +menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_MainDef, 50, 30); +menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_MainDef, 50, 30); +menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 35, 30); +menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 35, 30); menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 60, 30); menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 60, 30); menu_t OP_JoystickSetDef = @@ -1729,7 +1729,7 @@ menu_t OP_JoystickSetDef = &OP_Joystick1Def, OP_JoystickSetMenu, M_DrawJoystick, - 50, 40, + 60, 40, 0, NULL }; @@ -7387,17 +7387,24 @@ static void M_DrawJoystick(void) { INT32 i; - M_DrawGenericMenu(); + // draw title (or big pic) + M_DrawMenuTitle(); - for (i = 0;i < 8; i++) + for (i = 0; i <= 4; i++) // See MAX_JOYSTICKS { - M_DrawSaveLoadBorder(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i); + M_DrawSaveLoadBorder(OP_JoystickSetDef.x+4, OP_JoystickSetDef.y+1+LINEHEIGHT*i); if ((setupcontrols_secondaryplayer && (i == cv_usejoystick2.value)) || (!setupcontrols_secondaryplayer && (i == cv_usejoystick.value))) V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i,V_GREENMAP,joystickInfo[i]); else V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i,0,joystickInfo[i]); + + if (i == itemOn) + { + V_DrawScaledPatch(currentMenu->x - 24, OP_JoystickSetDef.y+LINEHEIGHT*i, 0, + W_CachePatchName("M_CURSOR", PU_CACHE)); + } } } From e2b063b2a853f80671e8aab434a790edfde65b4f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 13:36:40 +0100 Subject: [PATCH 027/181] Scrolling menu option now available! * Revamped Netgame Options Menu to scroll and also be less suck. * Renamed a few other options here and there. --- src/m_menu.c | 228 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 161 insertions(+), 67 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index c74455799..a22ef455d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -326,13 +326,15 @@ static void M_ToggleMIDI(void); //Misc menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef; menu_t OP_GameOptionsDef, OP_ServerOptionsDef; -menu_t OP_NetgameOptionsDef, OP_GametypeOptionsDef; menu_t OP_MonitorToggleDef; static void M_ScreenshotOptions(INT32 choice); static void M_EraseData(INT32 choice); +static void M_DrawLevelPlatterHeader(INT32 y, const char *header, boolean headerhighlight); + // Drawing functions static void M_DrawGenericMenu(void); +static void M_DrawGenericScrollMenu(void); static void M_DrawCenteredMenu(void); static void M_DrawSkyRoom(void); static void M_DrawChecklist(void); @@ -1036,7 +1038,7 @@ static menuitem_t OP_P1ControlsMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 30}, - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 50}, + {IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam , 50}, {IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam , 60}, {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 70}, @@ -1049,7 +1051,7 @@ static menuitem_t OP_P2ControlsMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20}, {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 30}, - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 50}, + {IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam2 , 50}, {IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 60}, {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 70}, @@ -1319,66 +1321,45 @@ static menuitem_t OP_GameOptionsMenu[] = static menuitem_t OP_ServerOptionsMenu[] = { - {IT_STRING | IT_SUBMENU, NULL, "General netgame options...", &OP_NetgameOptionsDef, 10}, - {IT_STRING | IT_SUBMENU, NULL, "Gametype options...", &OP_GametypeOptionsDef, 20}, - {IT_STRING | IT_SUBMENU, NULL, "Random Monitor Toggles...", &OP_MonitorToggleDef, 30}, - + {IT_HEADER, NULL, "General", NULL, 0}, #ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Server name", &cv_servername, 50}, + NULL, "Server name", &cv_servername, 7}, + + {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 22}, + {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 27}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 32}, + {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 37}, #endif + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 42}, - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80}, - {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 90}, + {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 52}, + {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 57}, -#ifndef NONET - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 110}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 120}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 130}, - {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 140}, -#endif -}; + {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 67}, + {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 72}, + {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 77}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 82}, -static menuitem_t OP_NetgameOptionsMenu[] = -{ - {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 10}, - {IT_STRING | IT_CVAR, NULL, "Point Limit", &cv_pointlimit, 18}, - {IT_STRING | IT_CVAR, NULL, "Overtime Tie-Breaker", &cv_overtime, 26}, + {IT_HEADER, NULL, "Cooperative, Race, Competition", NULL, 90}, + {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 97}, + {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 102}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 107}, - {IT_STRING | IT_CVAR, NULL, "Special Ring Weapons", &cv_specialrings, 42}, - {IT_STRING | IT_CVAR, NULL, "Emeralds", &cv_powerstones, 50}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 58}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 66}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 74}, + {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag)", NULL, 115}, + {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 122}, + {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 127}, + {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 132}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 98}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 142}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 147}, - {IT_STRING | IT_CVAR, NULL, "Force Skin", &cv_forceskin, 114}, - {IT_STRING | IT_CVAR, NULL, "Restrict skin changes", &cv_restrictskinchange, 122}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 157}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 162}, + {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 167}, - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 138}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 146}, -}; - -static menuitem_t OP_GametypeOptionsMenu[] = -{ - {IT_HEADER, NULL, "CO-OP", NULL, 2}, - {IT_STRING | IT_CVAR, NULL, "Players for exit", &cv_playersforexit, 10}, - {IT_STRING | IT_CVAR, NULL, "Starting Lives", &cv_startinglives, 18}, - - {IT_HEADER, NULL, "COMPETITION", NULL, 34}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 42}, - {IT_STRING | IT_CVAR, NULL, "Countdown Time", &cv_countdowntime, 50}, - - {IT_HEADER, NULL, "RACE", NULL, 66}, - {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 74}, - {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 82}, - - {IT_HEADER, NULL, "TAG", NULL, 98}, - {IT_STRING | IT_CVAR, NULL, "Hide Time", &cv_hidetime, 106}, - - {IT_HEADER, NULL, "CTF", NULL, 122}, - {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 130}, + {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 177}, + {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 182}, }; static menuitem_t OP_MonitorToggleMenu[] = @@ -1748,10 +1729,19 @@ menu_t OP_VideoModeDef = }; menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE("M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 60, 30); menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 30); -menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 30, 30); -menu_t OP_NetgameOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_NetgameOptionsMenu, &OP_ServerOptionsDef, 30, 30); -menu_t OP_GametypeOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_GametypeOptionsMenu, &OP_ServerOptionsDef, 30, 30); +menu_t OP_ServerOptionsDef = +{ + "M_SERVER", + sizeof (OP_ServerOptionsMenu)/sizeof (menuitem_t), + &OP_MainDef, + OP_ServerOptionsMenu, + M_DrawGenericScrollMenu, + 30, 30, + 0, + NULL +}; + menu_t OP_MonitorToggleDef = { "M_SERVER", @@ -3174,6 +3164,117 @@ static void M_DrawGenericMenu(void) } } +#define scrollareaheight 72 + +// note that alphakey is multiplied by 2 for scrolling menus to allow greater usage in UINT8 range. +static void M_DrawGenericScrollMenu(void) +{ + INT32 x, y, i, max, tempcentery, cursory = 0; + + // DRAW MENU + x = currentMenu->x; + y = currentMenu->y; + + if ((currentMenu->menuitems[itemOn].alphaKey*2 - currentMenu->menuitems[0].alphaKey*2) <= scrollareaheight) + tempcentery = currentMenu->y - currentMenu->menuitems[0].alphaKey*2; + else if ((currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 - currentMenu->menuitems[itemOn].alphaKey*2) <= scrollareaheight) + tempcentery = currentMenu->y - currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 + 2*scrollareaheight; + else + tempcentery = currentMenu->y - currentMenu->menuitems[itemOn].alphaKey*2 + scrollareaheight; + + for (i = 0; i < currentMenu->numitems; i++) + { + if (currentMenu->menuitems[i].alphaKey*2 + tempcentery >= currentMenu->y) + break; + } + + for (max = currentMenu->numitems; max > 0; max--) + { + if (currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) + break; + } + + if (i) + V_DrawString(currentMenu->x - 20, currentMenu->y, V_YELLOWMAP, "\x1A"); // up arrow + if (max != currentMenu->numitems) + V_DrawString(currentMenu->x - 20, currentMenu->y + 2*scrollareaheight, V_YELLOWMAP, "\x1B"); // down arrow + + // draw title (or big pic) + M_DrawMenuTitle(); + + for (; i < max; i++) + { + y = currentMenu->menuitems[i].alphaKey*2 + tempcentery; + if (i == itemOn) + cursory = y; + switch (currentMenu->menuitems[i].status & IT_DISPLAY) + { + case IT_PATCH: + case IT_DYBIGSPACE: + case IT_BIGSLIDER: + case IT_STRING2: + case IT_DYLITLSPACE: + case IT_GRAYPATCH: + case IT_TRANSTEXT2: + // unsupported + break; + case IT_NOTHING: + break; + case IT_STRING: + case IT_WHITESTRING: + if (i == itemOn || (currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) + V_DrawString(x, y, 0, currentMenu->menuitems[i].text); + else + V_DrawString(x, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + + // Cvar specific handling + switch (currentMenu->menuitems[i].status & IT_TYPE) + case IT_CVAR: + { + consvar_t *cv = (consvar_t *)currentMenu->menuitems[i].itemaction; + switch (currentMenu->menuitems[i].status & IT_CVARTYPE) + { + case IT_CV_SLIDER: + M_DrawSlider(x, y, cv); + case IT_CV_NOPRINT: // color use this + case IT_CV_INVISSLIDER: // monitor toggles use this + break; + case IT_CV_STRING: + M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); + V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string); + if (skullAnimCounter < 4 && i == itemOn) + V_DrawCharacter(x + 8 + V_StringWidth(cv->string, 0), y + 12, + '_' | 0x80, false); + y += 16; + break; + default: + V_DrawString(BASEVIDWIDTH - x - V_StringWidth(cv->string, 0), y, + ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : V_YELLOWMAP), cv->string); + break; + } + break; + } + break; + case IT_TRANSTEXT: + V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + break; + case IT_QUESTIONMARKS: + V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); + break; + case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text + //V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + M_DrawLevelPlatterHeader(y - (lsheadingheight - 12),currentMenu->menuitems[i].text, true); + break; + } + } + + // DRAW THE SKULL CURSOR + V_DrawScaledPatch(currentMenu->x - 24, cursory, 0, + W_CachePatchName("M_CURSOR", PU_CACHE)); +} + +#undef scrollareaheight + static void M_DrawPauseMenu(void) { if (!netgame && !multiplayer && (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)) @@ -3929,7 +4030,7 @@ static void M_HandleLevelPlatter(INT32 choice) } } -static void M_DrawLevelPlatterHeader(INT32 y, const char *header, boolean headerhighlight) +void M_DrawLevelPlatterHeader(INT32 y, const char *header, boolean headerhighlight) { y += lsheadingheight - 12; V_DrawString(19, y, (headerhighlight ? V_YELLOWMAP : 0), header); @@ -7534,16 +7635,9 @@ static void M_DrawControl(void) "PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR")); if (i) - { - i++; - V_DrawCenteredString(BASEVIDWIDTH/2, y, V_YELLOWMAP, "\x1A"); // up arrow - y += SMALLLINEHEIGHT; - } + V_DrawString(currentMenu->x - 16, y, V_YELLOWMAP, "\x1A"); // up arrow if (max != currentMenu->numitems) - { - max--; - V_DrawCenteredString(BASEVIDWIDTH/2, y+(SMALLLINEHEIGHT*(max-i)), V_YELLOWMAP, "\x1B"); // down arrow - } + V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(max-i-1)), V_YELLOWMAP, "\x1B"); // down arrow for (; i < max; i++) { @@ -7582,7 +7676,7 @@ static void M_DrawControl(void) y += SMALLLINEHEIGHT; } - V_DrawScaledPatch(currentMenu->x - 24, cursory, 0, + V_DrawScaledPatch(currentMenu->x - 20, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); } From 47bcc2747cf28cca4da0e31d5bdf3dc0f2a927c3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 14:05:51 +0100 Subject: [PATCH 028/181] * Fixed highlighting text on scrollable menus. * Revamped base video menu and moved all the relevant stuff from the Game Options Menu onto it. Still mulling on where to put the Master Server reference. --- src/m_menu.c | 77 +++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index a22ef455d..d699aedec 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1160,28 +1160,48 @@ static menuitem_t OP_Mouse2OptionsMenu[] = NULL, "Mouse Y Sensitivity", &cv_mouseysens2, 70}, }; +static menuitem_t OP_GameOptionsMenu[] = +{ +#ifndef NONET + {IT_STRING | IT_CVAR | IT_CV_STRING, + NULL, "Master server", &cv_masterserver, 10}, +#endif +}; + static menuitem_t OP_VideoOptionsMenu[] = { - {IT_STRING | IT_CALL, NULL, "Video Modes...", M_VideoModeMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 0}, #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 20}, + {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 5}, #endif #if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 30}, + {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 10}, #endif {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Brightness", &cv_usegamma, 50}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 60}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 70}, - {IT_STRING | IT_CVAR, NULL, "Precip Draw Dist", &cv_drawdist_precip, 80}, - {IT_STRING | IT_CVAR, NULL, "Precip Density", &cv_precipdensity, 90}, + NULL, "Brightness", &cv_usegamma, 15}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 110}, - {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 120}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 130}, + {IT_STRING | IT_CVAR, NULL, "Display HUD", &cv_showhud, 25}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, + NULL, "HUD Transparency", &cv_translucenthud, 30}, + {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 35}, +#ifdef SEENAMES + {IT_STRING | IT_CVAR, NULL, "Show HUD player names", &cv_seenames, 40}, +#endif + + {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 50}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 55}, + + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 65}, + {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 70}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 75}, + {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 80}, + + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90}, + {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw",&cv_homremoval, 95}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100}, }; static menuitem_t OP_VideoModeMenu[] = @@ -1298,27 +1318,6 @@ static menuitem_t OP_EraseDataMenu[] = {IT_STRING | IT_CALL, NULL, "\x85" "Erase ALL Data", M_EraseData, 40}, }; -static menuitem_t OP_GameOptionsMenu[] = -{ -#ifndef NONET - {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Master server", &cv_masterserver, 10}, -#endif - {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 40}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "HUD Visibility", &cv_translucenthud, 50}, - {IT_STRING | IT_CVAR, NULL, "Timer Display", &cv_timetic, 60}, -#ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "HUD Player Names", &cv_seenames, 80}, -#endif - {IT_STRING | IT_CVAR, NULL, "Log Hazard Damage", &cv_hazardlog, 90}, - - {IT_STRING | IT_CVAR, NULL, "Console Back Color", &cons_backcolor, 100}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize,110}, - - {IT_STRING | IT_CVAR, NULL, "Title Screen Demos", &cv_rollingdemos, 130}, -}; - static menuitem_t OP_ServerOptionsMenu[] = { {IT_HEADER, NULL, "General", NULL, 0}, @@ -1715,7 +1714,17 @@ menu_t OP_JoystickSetDef = NULL }; -menu_t OP_VideoOptionsDef = DEFAULTMENUSTYLE("M_VIDEO", OP_VideoOptionsMenu, &OP_MainDef, 60, 30); +menu_t OP_VideoOptionsDef = +{ + "M_VIDEO", + sizeof (OP_VideoOptionsMenu)/sizeof (menuitem_t), + &OP_MainDef, + OP_VideoOptionsMenu, + M_DrawGenericScrollMenu, + 30, 30, + 0, + NULL +}; menu_t OP_VideoModeDef = { "M_VIDEO", @@ -3222,7 +3231,7 @@ static void M_DrawGenericScrollMenu(void) break; case IT_STRING: case IT_WHITESTRING: - if (i == itemOn || (currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) + if (i != itemOn && (currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) V_DrawString(x, y, 0, currentMenu->menuitems[i].text); else V_DrawString(x, y, V_YELLOWMAP, currentMenu->menuitems[i].text); From fd5c72d4c0eb704d915fb183339d509cc4e276c0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 15:36:19 +0100 Subject: [PATCH 029/181] * Revamp sounds menu to show you the current status of the different kinds of sounds and musics, and basically behave like a cvar without being a cvar. * Show resolution on main Video page. * Optimise by using V_RightAlignedString instead of V_DrawString with V_StringWidth. * Revamp sliders. (Requires a new patch.dta I'll upload in a little bit in order to be perfect, but does pretty well w/o replacement graphics too.) --- src/m_menu.c | 188 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 149 insertions(+), 39 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index d699aedec..bad72a3e2 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -72,8 +72,8 @@ int snprintf(char *str, size_t n, const char *fmt, ...); #define STRINGHEIGHT 8 #define FONTBHEIGHT 20 #define SMALLLINEHEIGHT 8 -#define SLIDER_RANGE 10 -#define SLIDER_WIDTH (8*SLIDER_RANGE+6) +#define SLIDER_RANGE 9 +#define SLIDER_WIDTH 78 #define MAXSTRINGLENGTH 32 #define SERVERS_PER_PAGE 11 @@ -319,9 +319,9 @@ menu_t OP_VideoOptionsDef, OP_VideoModeDef; menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef; #endif menu_t OP_SoundOptionsDef; -static void M_ToggleSFX(void); -static void M_ToggleDigital(void); -static void M_ToggleMIDI(void); +static void M_ToggleSFX(INT32 choice); +static void M_ToggleDigital(INT32 choice); +static void M_ToggleMIDI(INT32 choice); //Misc menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef; @@ -351,7 +351,9 @@ static void M_DrawTimeAttackMenu(void); static void M_DrawNightsAttackMenu(void); static void M_DrawSetupChoosePlayerMenu(void); static void M_DrawControl(void); +static void M_DrawMainVideoMenu(void); static void M_DrawVideoMode(void); +static void M_DrawSoundMenu(void); static void M_DrawMonitorToggles(void); #ifdef HWRENDER static void M_OGL_DrawFogMenu(void); @@ -1254,20 +1256,14 @@ static menuitem_t OP_OpenGLColorMenu[] = static menuitem_t OP_SoundOptionsMenu[] = { - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Sound Volume" , &cv_soundvolume, 10}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Music Volume" , &cv_digmusicvolume, 20}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "MIDI Volume" , &cv_midimusicvolume, 30}, -#ifdef PC_DOS - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "CD Volume" , &cd_volume, 40}, -#endif + {IT_STRING | IT_KEYHANDLER, NULL, "Sound Effects", M_ToggleSFX, 10}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Sound Volume", &cv_soundvolume, 20}, - {IT_STRING | IT_CALL, NULL, "Toggle SFX" , M_ToggleSFX, 50}, - {IT_STRING | IT_CALL, NULL, "Toggle Digital Music", M_ToggleDigital, 60}, - {IT_STRING | IT_CALL, NULL, "Toggle MIDI Music", M_ToggleMIDI, 70}, + {IT_STRING | IT_KEYHANDLER, NULL, "Digital Music", M_ToggleDigital, 40}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 50}, + + {IT_STRING | IT_KEYHANDLER, NULL, "MIDI Music", M_ToggleMIDI, 70}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 80}, }; static menuitem_t OP_DataOptionsMenu[] = @@ -1720,7 +1716,7 @@ menu_t OP_VideoOptionsDef = sizeof (OP_VideoOptionsMenu)/sizeof (menuitem_t), &OP_MainDef, OP_VideoOptionsMenu, - M_DrawGenericScrollMenu, + M_DrawMainVideoMenu, 30, 30, 0, NULL @@ -1736,7 +1732,17 @@ menu_t OP_VideoModeDef = 0, NULL }; -menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE("M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 60, 30); +menu_t OP_SoundOptionsDef = +{ + "M_SOUND", + sizeof (OP_SoundOptionsMenu)/sizeof (menuitem_t), + &OP_MainDef, + OP_SoundOptionsMenu, + M_DrawSoundMenu, + 30, 30, + 0, + NULL +}; menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_ServerOptionsDef = @@ -2871,18 +2877,18 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) x = BASEVIDWIDTH - x - SLIDER_WIDTH; - V_DrawScaledPatch(x - 8, y, 0, W_CachePatchName("M_SLIDEL", PU_CACHE)); + V_DrawScaledPatch(x, y, 0, W_CachePatchName("M_SLIDEL", PU_CACHE)); p = W_CachePatchName("M_SLIDEM", PU_CACHE); - for (i = 0; i < SLIDER_RANGE; i++) + for (i = 1; i < SLIDER_RANGE; i++) V_DrawScaledPatch (x+i*8, y, 0,p); p = W_CachePatchName("M_SLIDER", PU_CACHE); - V_DrawScaledPatch(x+SLIDER_RANGE*8, y, 0, p); + V_DrawScaledPatch(x+i*8, y, 0, p); // draw the slider cursor p = W_CachePatchName("M_SLIDEC", PU_CACHE); - V_DrawMappedPatch(x + ((SLIDER_RANGE-1)*8*range)/100, y, 0, p, yellowmap); + V_DrawMappedPatch(x + 2 + (SLIDER_RANGE*8*range)/100, y, 0, p, yellowmap); } // @@ -3115,7 +3121,7 @@ static void M_DrawGenericMenu(void) y += 16; break; default: - V_DrawString(BASEVIDWIDTH - x - V_StringWidth(cv->string, 0), y, + V_DrawRightAlignedString(BASEVIDWIDTH - x, y, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : V_YELLOWMAP), cv->string); break; } @@ -3257,7 +3263,7 @@ static void M_DrawGenericScrollMenu(void) y += 16; break; default: - V_DrawString(BASEVIDWIDTH - x - V_StringWidth(cv->string, 0), y, + V_DrawRightAlignedString(BASEVIDWIDTH - x, y, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : V_YELLOWMAP), cv->string); break; } @@ -7780,35 +7786,105 @@ static void M_ChangeControl(INT32 choice) // SOUND // ===== -// Toggles sound systems in-game. -static void M_ToggleSFX(void) +void M_DrawSoundMenu(void) { + const char* onstring = "ON"; + const char* offstring = "OFF"; + M_DrawGenericMenu(); + + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, + currentMenu->y+currentMenu->menuitems[0].alphaKey, + (nosound ? V_REDMAP : V_YELLOWMAP), + ((nosound || sound_disabled) ? offstring : onstring)); + + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, + currentMenu->y+currentMenu->menuitems[2].alphaKey, + (nodigimusic ? V_REDMAP : V_YELLOWMAP), + ((nodigimusic || digital_disabled) ? offstring : onstring)); + + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, + currentMenu->y+currentMenu->menuitems[4].alphaKey, + (nomidimusic ? V_REDMAP : V_YELLOWMAP), + ((nomidimusic || music_disabled) ? offstring : onstring)); +} + +// Toggles sound systems in-game. +static void M_ToggleSFX(INT32 choice) +{ + switch (choice) + { + case KEY_DOWNARROW: + S_StartSound(NULL, sfx_menu1); + itemOn++; + return; + + case KEY_UPARROW: + S_StartSound(NULL, sfx_menu1); + itemOn--; + return; + + case KEY_ESCAPE: + S_StartSound(NULL, sfx_menu1); + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + return; + default: + break; + } + if (nosound) { nosound = false; I_StartupSound(); if (nosound) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); - M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING); + S_StartSound(NULL, sfx_strpst); + //M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING); } else { if (sound_disabled) { sound_disabled = false; - M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING); + S_StartSound(NULL, sfx_strpst); + //M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING); } else { sound_disabled = true; S_StopSounds(); - M_StartMessage(M_GetText("SFX Disabled\n"), NULL, MM_NOTHING); + //M_StartMessage(M_GetText("SFX Disabled\n"), NULL, MM_NOTHING); } } } -static void M_ToggleDigital(void) +static void M_ToggleDigital(INT32 choice) { + switch (choice) + { + case KEY_DOWNARROW: + S_StartSound(NULL, sfx_menu1); + itemOn++; + return; + + case KEY_UPARROW: + S_StartSound(NULL, sfx_menu1); + itemOn--; + return; + + case KEY_ESCAPE: + S_StartSound(NULL, sfx_menu1); + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + return; + default: + break; + } + if (nodigimusic) { nodigimusic = false; @@ -7817,26 +7893,50 @@ static void M_ToggleDigital(void) S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); S_StopMusic(); S_ChangeMusicInternal("_clear", false); - M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); + //M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); } else { if (digital_disabled) { digital_disabled = false; - M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); + S_ChangeMusicInternal("_clear", false); + //M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); } else { digital_disabled = true; S_StopMusic(); - M_StartMessage(M_GetText("Digital Music Disabled\n"), NULL, MM_NOTHING); + //M_StartMessage(M_GetText("Digital Music Disabled\n"), NULL, MM_NOTHING); } } } -static void M_ToggleMIDI(void) +static void M_ToggleMIDI(INT32 choice) { + switch (choice) + { + case KEY_DOWNARROW: + S_StartSound(NULL, sfx_menu1); + itemOn++; + return; + + case KEY_UPARROW: + S_StartSound(NULL, sfx_menu1); + itemOn--; + return; + + case KEY_ESCAPE: + S_StartSound(NULL, sfx_menu1); + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + return; + default: + break; + } + if (nomidimusic) { nomidimusic = false; @@ -7844,20 +7944,21 @@ static void M_ToggleMIDI(void) if (nomidimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); S_ChangeMusicInternal("_clear", false); - M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); + //M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); } else { if (music_disabled) { music_disabled = false; - M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); + S_ChangeMusicInternal("_clear", false); + //M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); } else { music_disabled = true; S_StopMusic(); - M_StartMessage(M_GetText("MIDI Music Disabled\n"), NULL, MM_NOTHING); + //M_StartMessage(M_GetText("MIDI Music Disabled\n"), NULL, MM_NOTHING); } } } @@ -7952,6 +8053,15 @@ static void M_VideoModeMenu(INT32 choice) M_SetupNextMenu(&OP_VideoModeDef); } +static void M_DrawMainVideoMenu(void) +{ + M_DrawGenericScrollMenu(); + if (itemOn < 7) // where it starts to go offscreen; change this number if you change the layout of the video menu + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y+currentMenu->menuitems[0].alphaKey, + (SCR_IsAspectCorrect(vid.width, vid.height) ? V_GREENMAP : V_YELLOWMAP), + va("%dx%d", vid.width, vid.height)); +} + // Draw the video modes list, a-la-Quake static void M_DrawVideoMode(void) { From 2a40804ea2d01c6294c85f722a8e96d7564ffc3f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 15:42:03 +0100 Subject: [PATCH 030/181] Offset tweak so "General" on the netgame settings menu doesn't go only SLIGHTLY off the screen and stop appearing when you scroll down. --- src/m_menu.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index bad72a3e2..b55b9feda 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1321,40 +1321,40 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Server name", &cv_servername, 7}, - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 22}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 27}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 32}, - {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 37}, + {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 21}, + {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 26}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 31}, + {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 36}, #endif - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 42}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 41}, - {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 52}, - {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 57}, + {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 51}, + {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 56}, - {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 67}, - {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 72}, - {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 77}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 82}, + {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 66}, + {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 71}, + {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 76}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 81}, {IT_HEADER, NULL, "Cooperative, Race, Competition", NULL, 90}, - {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 97}, - {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 102}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 107}, + {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 96}, + {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 101}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 106}, {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag)", NULL, 115}, - {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 122}, - {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 127}, - {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 132}, + {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 121}, + {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 126}, + {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 131}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 142}, - {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 147}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 141}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 146}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 157}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 162}, - {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 167}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 156}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 161}, + {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 166}, - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 177}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 182}, + {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 176}, + {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 181}, }; static menuitem_t OP_MonitorToggleMenu[] = From 68f5460387d80923a33341610341bedcec17912d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 15:42:03 +0100 Subject: [PATCH 031/181] * Added little arrows to the statistics pages. * Made it possible to switch statistics pages using left and right arrows. Their previous functionality has been given to Page Up and Page Down. * Swap over header style to the new version for everything. * Move Master Server into Data Options, since it needs to be exposed somewhere. --- src/m_cond.c | 4 ++-- src/m_menu.c | 62 +++++++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index 7f977c15d..f12e677dc 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -579,12 +579,12 @@ unlockable_t unlockables[MAXUNLOCKABLES] = /* 03 */ {"Play Credits", "Complete 1P Mode", 30, 10, SECRET_CREDITS, 0, true, true, 0}, /* 04 */ {"Sound Test", "Complete 1P Mode", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0}, - /* 05 */ {"EXTRA LEVELS", "", 60, 0, SECRET_HEADER, 0, true, true, 0}, + /* 05 */ {"EXTRA LEVELS", "", 58, 0, SECRET_HEADER, 0, true, true, 0}, /* 06 */ {"Aerial Garden Zone", "Complete 1P Mode w/ all emeralds", 70, 11, SECRET_WARP, 40, false, false, 0}, /* 07 */ {"Azure Temple Zone", "Complete Aerial Garden Zone", 80, 20, SECRET_WARP, 41, false, false, 0}, - /* 08 */ {"BONUS LEVELS", "", 100, 0, SECRET_HEADER, 0, true, true, 0}, + /* 08 */ {"BONUS LEVELS", "", 98, 0, SECRET_HEADER, 0, true, true, 0}, /* 09 */ {"PLACEHOLDER", "PLACEHOLDER", 0, 0, SECRET_NONE, 0, true, true, 0}, /* 10 */ {"Mario Koopa Blast", "Collect 60 Emblems", 110, 42, SECRET_WARP, 30, false, false, 0}, diff --git a/src/m_menu.c b/src/m_menu.c index b55b9feda..0b99b821e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -325,7 +325,7 @@ static void M_ToggleMIDI(INT32 choice); //Misc menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef; -menu_t OP_GameOptionsDef, OP_ServerOptionsDef; +menu_t OP_ServerOptionsDef; menu_t OP_MonitorToggleDef; static void M_ScreenshotOptions(INT32 choice); static void M_EraseData(INT32 choice); @@ -1030,8 +1030,6 @@ static menuitem_t OP_MainMenu[] = {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, {IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 100}, - - {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 120}, }; static menuitem_t OP_P1ControlsMenu[] = @@ -1075,7 +1073,7 @@ static menuitem_t OP_ChangeControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Camera Right", M_ChangeControl, gc_turnright }, {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview }, {IT_CALL | IT_STRING2, NULL, "Toggle Mouselook", M_ChangeControl, gc_mouseaiming }, - {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, + {IT_CALL | IT_STRING2, NULL, "Toggle Third-Person", M_ChangeControl, gc_camtoggle}, {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, {IT_DISABLED, NULL, "", NULL, 0}, {IT_CALL | IT_STRING2, NULL, "Game Status", M_ChangeControl, gc_scores }, @@ -1162,14 +1160,6 @@ static menuitem_t OP_Mouse2OptionsMenu[] = NULL, "Mouse Y Sensitivity", &cv_mouseysens2, 70}, }; -static menuitem_t OP_GameOptionsMenu[] = -{ -#ifndef NONET - {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Master server", &cv_masterserver, 10}, -#endif -}; - static menuitem_t OP_VideoOptionsMenu[] = { {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 0}, @@ -1270,7 +1260,11 @@ static menuitem_t OP_DataOptionsMenu[] = { {IT_STRING | IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 10}, - {IT_STRING | IT_SUBMENU, NULL, "Erase Data...", &OP_EraseDataDef, 30}, + {IT_STRING | IT_SUBMENU, NULL, "\x85" "Erase Data...", &OP_EraseDataDef, 20}, + +#ifndef NONET + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 40}, +#endif }; static menuitem_t OP_ScreenshotOptionsMenu[] = @@ -1278,13 +1272,13 @@ static menuitem_t OP_ScreenshotOptionsMenu[] = {IT_STRING|IT_CVAR, NULL, "Storage Location", &cv_screenshot_option, 10}, {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Custom Folder", &cv_screenshot_folder, 20}, - {IT_HEADER, NULL, "Screenshots (F8)", NULL, 50}, + {IT_HEADER, NULL, "Screenshots (F8)", NULL, 48}, {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memory, 60}, {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_level, 70}, {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategy, 80}, {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bits, 90}, - {IT_HEADER, NULL, "Movie Mode (F9)", NULL, 105}, + {IT_HEADER, NULL, "Movie Mode (F9)", NULL, 103}, {IT_STRING|IT_CVAR, NULL, "Capture Mode", &cv_moviemode, 115}, {IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 125}, @@ -1743,7 +1737,6 @@ menu_t OP_SoundOptionsDef = 0, NULL }; -menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_ServerOptionsDef = { @@ -1797,7 +1790,7 @@ menu_t OP_OpenGLColorDef = NULL }; #endif -menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30); +menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30); menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 60, 30); @@ -2480,6 +2473,7 @@ boolean M_Responder(event_t *ev) { // detach any keys associated with the game control G_ClearControlKeys(setupcontrols, currentMenu->menuitems[itemOn].alphaKey); + S_StartSound(NULL, sfx_shldls); return true; } // Why _does_ backspace go back anyway? @@ -3158,7 +3152,8 @@ static void M_DrawGenericMenu(void) if (currentMenu->menuitems[i].alphaKey) y = currentMenu->y+currentMenu->menuitems[i].alphaKey; - V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + //V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + M_DrawLevelPlatterHeader(y - (lsheadingheight - 12), currentMenu->menuitems[i].text, true); y += SMALLLINEHEIGHT; break; } @@ -3276,9 +3271,9 @@ static void M_DrawGenericScrollMenu(void) case IT_QUESTIONMARKS: V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); break; - case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text + case IT_HEADERTEXT: //V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); - M_DrawLevelPlatterHeader(y - (lsheadingheight - 12),currentMenu->menuitems[i].text, true); + M_DrawLevelPlatterHeader(y - (lsheadingheight - 12), currentMenu->menuitems[i].text, true); break; } } @@ -5735,10 +5730,14 @@ static void M_DrawStatsMaps(int location) INT32 y = 76, i = -1; INT16 mnum; extraemblem_t *exemblem; + boolean dobottomarrow = (location < statsMax); V_DrawString(20, y-12, 0, "LEVEL NAME"); V_DrawString(248, y-12, 0, "EMBLEMS"); + if (location) + V_DrawString(10, y, V_YELLOWMAP, "\x1A"); + while (statsMapList[++i] != -1) { if (location) @@ -5758,7 +5757,7 @@ static void M_DrawStatsMaps(int location) y += 8; if (y >= BASEVIDHEIGHT-8) - return; + goto bottomarrow; } // Extra Emblems @@ -5788,14 +5787,17 @@ static void M_DrawStatsMaps(int location) y += 8; if (y >= BASEVIDHEIGHT-8) - return; + goto bottomarrow; } +bottomarrow: + if (dobottomarrow) + V_DrawString(10, y-8, V_YELLOWMAP, "\x1B"); } static void M_DrawLevelStats(void) { M_DrawMenuTitle(); - V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "PAGE 2 OF 2"); + V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "\x1C PAGE 2 OF 2 \x1D"); V_DrawString(72, 48, 0, va("x %d/%d", M_CountEmblems(), numemblems+numextraemblems)); V_DrawScaledPatch(40, 48-4, 0, W_CachePatchName("EMBLICON", PU_STATIC)); @@ -5822,12 +5824,12 @@ static void M_HandleLevelStats(INT32 choice) --statsLocation; break; - case KEY_RIGHTARROW: + case KEY_PGUP: S_StartSound(NULL, sfx_menu1); statsLocation += (statsLocation+15 >= statsMax) ? statsMax-statsLocation : 15; break; - case KEY_LEFTARROW: + case KEY_PGDN: S_StartSound(NULL, sfx_menu1); statsLocation -= (statsLocation < 15) ? statsLocation : 15; break; @@ -5836,6 +5838,8 @@ static void M_HandleLevelStats(INT32 choice) exitmenu = true; break; + case KEY_LEFTARROW: + case KEY_RIGHTARROW: case KEY_ENTER: S_StartSound(NULL, sfx_menu1); M_SetupNextMenu(&SP_GameStatsDef); @@ -5863,7 +5867,7 @@ static void M_DrawGameStats(void) INT32 mapsunfinished[3] = {0, 0, 0}; M_DrawMenuTitle(); - V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "PAGE 1 OF 2"); + V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "\x1C PAGE 1 OF 2 \x1D"); V_DrawString(32, 60, V_YELLOWMAP, "Total Play Time:"); V_DrawRightAlignedString(BASEVIDWIDTH-32, 70, 0, va("%i hours, %i minutes, %i seconds", @@ -5932,6 +5936,8 @@ static void M_HandleGameStats(INT32 choice) exitmenu = true; break; + case KEY_LEFTARROW: + case KEY_RIGHTARROW: case KEY_ENTER: S_StartSound(NULL, sfx_menu1); M_SetupNextMenu(&SP_LevelStatsDef); @@ -7765,8 +7771,10 @@ static void M_ChangecontrolResponse(event_t *ev) G_CheckDoubleUsage(ch); setupcontrols[control][found] = ch; } - + S_StartSound(NULL, sfx_strpst); } + else + S_StartSound(NULL, sfx_skid); M_StopMessage(0); } From f35cac3b55abc5aafc9fd9b5c278a8da0bbaa466 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 20:25:53 +0100 Subject: [PATCH 032/181] Rejigger Server menu a smidgen to encourage scrolling down, clean up, and reinstitute hidetime. --- src/m_menu.c | 56 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 0b99b821e..efc5b979d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1313,42 +1313,42 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_HEADER, NULL, "General", NULL, 0}, #ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Server name", &cv_servername, 7}, - - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 21}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 26}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 31}, - {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 36}, + NULL, "Server name", &cv_servername, 7}, + {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 21}, + {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 26}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 31}, #endif - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 41}, - {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 51}, - {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 56}, + {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 41}, + {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 46}, + {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 51}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 56}, - {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 66}, - {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 71}, - {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 76}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 81}, + {IT_HEADER, NULL, "Platform (Coop, Race, Competition)", NULL, 65}, + {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 71}, + {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 76}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 81}, - {IT_HEADER, NULL, "Cooperative, Race, Competition", NULL, 90}, - {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 96}, - {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 101}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 106}, + {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 90}, + {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 96}, + {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 101}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 106}, - {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag)", NULL, 115}, - {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 121}, - {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 126}, - {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 131}, + {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 116}, + {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 121}, + {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 126}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 141}, - {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 146}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 136}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 141}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 156}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 161}, - {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 166}, + {IT_STRING | IT_CVAR, NULL, "Item respawn", &cv_itemrespawn, 151}, + {IT_STRING | IT_CVAR, NULL, "Item respawn time", &cv_itemrespawntime, 156}, - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 176}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 181}, + {IT_STRING | IT_CVAR, NULL, "Flag respawn time", &cv_flagtime, 166}, + {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 171}, + + {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 181}, + {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 186}, }; static menuitem_t OP_MonitorToggleMenu[] = From b0ebb40913884ec0d058abcbf3303cdc5eb31403 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 15 Apr 2017 21:40:30 +0100 Subject: [PATCH 033/181] Headers for the controls menu. --- src/m_menu.c | 64 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index efc5b979d..86462cb82 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1060,13 +1060,16 @@ static menuitem_t OP_P2ControlsMenu[] = static menuitem_t OP_ChangeControlsMenu[] = { + {IT_HEADER, NULL, "Movement", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, // padding {IT_CALL | IT_STRING2, NULL, "Move Forward", M_ChangeControl, gc_forward }, {IT_CALL | IT_STRING2, NULL, "Move Backward", M_ChangeControl, gc_backward }, {IT_CALL | IT_STRING2, NULL, "Move Left", M_ChangeControl, gc_strafeleft }, {IT_CALL | IT_STRING2, NULL, "Move Right", M_ChangeControl, gc_straferight }, {IT_CALL | IT_STRING2, NULL, "Jump / Main Action", M_ChangeControl, gc_jump }, {IT_CALL | IT_STRING2, NULL, "Spin / Shield Action", M_ChangeControl, gc_use }, - {IT_DISABLED, NULL, "", NULL, 0}, + {IT_HEADER, NULL, "Camera", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, // padding {IT_CALL | IT_STRING2, NULL, "Camera Up", M_ChangeControl, gc_lookup }, {IT_CALL | IT_STRING2, NULL, "Camera Down", M_ChangeControl, gc_lookdown }, {IT_CALL | IT_STRING2, NULL, "Camera Left", M_ChangeControl, gc_turnleft }, @@ -1075,30 +1078,35 @@ static menuitem_t OP_ChangeControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Toggle Mouselook", M_ChangeControl, gc_mouseaiming }, {IT_CALL | IT_STRING2, NULL, "Toggle Third-Person", M_ChangeControl, gc_camtoggle}, {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, - {IT_DISABLED, NULL, "", NULL, 0}, - {IT_CALL | IT_STRING2, NULL, "Game Status", M_ChangeControl, gc_scores }, + {IT_HEADER, NULL, "Meta", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, // padding + {IT_CALL | IT_STRING2, NULL, "Game Status", + M_ChangeControl, gc_scores }, + {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, + {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, + {IT_HEADER, NULL, "Multiplayer", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, // padding {IT_CALL | IT_STRING2, NULL, "Talk", M_ChangeControl, gc_talkkey }, {IT_CALL | IT_STRING2, NULL, "Talk (Team only)", M_ChangeControl, gc_teamkey }, - {IT_DISABLED, NULL, "", NULL, 0}, + {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, // padding {IT_CALL | IT_STRING2, NULL, "Fire", M_ChangeControl, gc_fire }, {IT_CALL | IT_STRING2, NULL, "Fire Normal", M_ChangeControl, gc_firenormal }, {IT_CALL | IT_STRING2, NULL, "Toss Flag", M_ChangeControl, gc_tossflag }, {IT_CALL | IT_STRING2, NULL, "Next Weapon", M_ChangeControl, gc_weaponnext }, {IT_CALL | IT_STRING2, NULL, "Prev Weapon", M_ChangeControl, gc_weaponprev }, - {IT_CALL | IT_STRING2, NULL, "Red / Infinity", M_ChangeControl, gc_wepslot1 }, + {IT_CALL | IT_STRING2, NULL, "Normal / Infinity", M_ChangeControl, gc_wepslot1 }, {IT_CALL | IT_STRING2, NULL, "Automatic", M_ChangeControl, gc_wepslot2 }, {IT_CALL | IT_STRING2, NULL, "Bounce", M_ChangeControl, gc_wepslot3 }, {IT_CALL | IT_STRING2, NULL, "Scatter", M_ChangeControl, gc_wepslot4 }, {IT_CALL | IT_STRING2, NULL, "Grenade", M_ChangeControl, gc_wepslot5 }, {IT_CALL | IT_STRING2, NULL, "Explosion", M_ChangeControl, gc_wepslot6 }, {IT_CALL | IT_STRING2, NULL, "Rail", M_ChangeControl, gc_wepslot7 }, - {IT_DISABLED, NULL, "", NULL, 0}, + {IT_HEADER, NULL, "Modifications", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, // padding {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 }, {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, - {IT_DISABLED, NULL, "", NULL, 0}, - {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, }; static menuitem_t OP_Joystick1Menu[] = @@ -7588,14 +7596,16 @@ static void M_Setup1PControlsMenu(INT32 choice) currentMenu->lastOn = itemOn; // Unhide the three non-P2 controls - OP_ChangeControlsMenu[15].status = IT_DISABLED; - OP_ChangeControlsMenu[15+1].status = IT_CALL|IT_STRING2; - OP_ChangeControlsMenu[15+2].status = IT_CALL|IT_STRING2; - OP_ChangeControlsMenu[15+3].status = IT_CALL|IT_STRING2; - // Unide the pause/console controls too - OP_ChangeControlsMenu[36].status = IT_DISABLED; - OP_ChangeControlsMenu[36+1].status = IT_CALL|IT_STRING2; - OP_ChangeControlsMenu[36+2].status = IT_CALL|IT_STRING2; + //OP_ChangeControlsMenu[18+0].status = IT_HEADER; + //OP_ChangeControlsMenu[18+1].status = IT_SPACE; + OP_ChangeControlsMenu[18+2].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[18+3].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[18+4].status = IT_CALL|IT_STRING2; + // Unhide the pause/console controls too + //OP_ChangeControlsMenu[23+0].status = IT_HEADER; + //OP_ChangeControlsMenu[23+1].status = IT_SPACE; + OP_ChangeControlsMenu[23+2].status = IT_CALL|IT_STRING2; + OP_ChangeControlsMenu[23+3].status = IT_CALL|IT_STRING2; OP_ChangeControlsDef.prevMenu = &OP_P1ControlsDef; M_SetupNextMenu(&OP_ChangeControlsDef); @@ -7609,14 +7619,16 @@ static void M_Setup2PControlsMenu(INT32 choice) currentMenu->lastOn = itemOn; // Hide the three non-P2 controls - OP_ChangeControlsMenu[15].status = IT_DISABLED; - OP_ChangeControlsMenu[15+1].status = IT_GRAYEDOUT2; - OP_ChangeControlsMenu[15+2].status = IT_GRAYEDOUT2; - OP_ChangeControlsMenu[15+3].status = IT_GRAYEDOUT2; + //OP_ChangeControlsMenu[18+0].status = IT_DISABLED; + //OP_ChangeControlsMenu[18+1].status = IT_DISABLED; + OP_ChangeControlsMenu[18+2].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[18+3].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[18+4].status = IT_GRAYEDOUT2; // Hide the pause/console controls too - OP_ChangeControlsMenu[36].status = IT_DISABLED; - OP_ChangeControlsMenu[36+1].status = IT_GRAYEDOUT2; - OP_ChangeControlsMenu[36+2].status = IT_GRAYEDOUT2; + //OP_ChangeControlsMenu[23+0].status = IT_DISABLED; + //OP_ChangeControlsMenu[23+1].status = IT_DISABLED; + OP_ChangeControlsMenu[23+2].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[23+3].status = IT_GRAYEDOUT2; OP_ChangeControlsDef.prevMenu = &OP_P2ControlsDef; M_SetupNextMenu(&OP_ChangeControlsDef); @@ -7691,8 +7703,10 @@ static void M_DrawControl(void) } V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, V_YELLOWMAP, tmp); } - else if (currentMenu->menuitems[i].text) + else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + else if (currentMenu->menuitems[i].status == IT_HEADER) + M_DrawLevelPlatterHeader(y, currentMenu->menuitems[i].text, true); y += SMALLLINEHEIGHT; } From 24192f54d15afb98f86943a1c9f7a2364c5f09c0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 16 Apr 2017 00:12:37 +0100 Subject: [PATCH 034/181] Revamp statistics screen to put everything on the same page. http://imgur.com/a/kZrfm * Also, inverted the direction of PGUP and PGDN. --- src/m_menu.c | 251 ++++++++++++++++++++++----------------------------- 1 file changed, 107 insertions(+), 144 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 86462cb82..7007e7250 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -277,7 +277,7 @@ static void M_ModeAttackEndGame(INT32 choice); static void M_SetGuestReplay(INT32 choice); static void M_HandleChoosePlayerMenu(INT32 choice); static void M_ChoosePlayer(INT32 choice); -menu_t SP_GameStatsDef, SP_LevelStatsDef; +menu_t SP_LevelStatsDef; static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef; static menu_t SP_NightsAttackDef, SP_NightsReplayDef, SP_NightsGuestReplayDef, SP_NightsGhostDef; @@ -346,7 +346,6 @@ static void M_DrawLevelPlatterMenu(void); static void M_DrawImageDef(void); static void M_DrawLoad(void); static void M_DrawLevelStats(void); -static void M_DrawGameStats(void); static void M_DrawTimeAttackMenu(void); static void M_DrawNightsAttackMenu(void); static void M_DrawSetupChoosePlayerMenu(void); @@ -377,7 +376,6 @@ static void M_HandleLevelPlatter(INT32 choice); static void M_HandleSoundTest(INT32 choice); static void M_HandleImageDef(INT32 choice); static void M_HandleLoadSave(INT32 choice); -static void M_HandleGameStats(INT32 choice); static void M_HandleLevelStats(INT32 choice); #ifndef NONET static void M_HandleConnectIP(INT32 choice); @@ -880,11 +878,6 @@ enum }; // Statistics -static menuitem_t SP_GameStatsMenu[] = -{ - {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleGameStats, 0}, // dummy menuitem for the control func -}; - static menuitem_t SP_LevelStatsMenu[] = { {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelStats, 0}, // dummy menuitem for the control func @@ -1482,17 +1475,6 @@ menu_t SP_LoadDef = menu_t SP_LevelSelectDef = MAPPLATTERMENUSTYLE(NULL, SP_LevelSelectMenu); -menu_t SP_GameStatsDef = -{ - "M_STATS", - 1, - &SP_MainDef, - SP_GameStatsMenu, - M_DrawGameStats, - 280, 185, - 0, - NULL -}; menu_t SP_LevelStatsDef = { "M_STATS", @@ -5724,24 +5706,21 @@ static void M_Statistics(INT32 choice) statsMapList[j++] = i; } statsMapList[j] = -1; - statsMax = j - 13 + numextraemblems; + statsMax = j - 11 + numextraemblems; statsLocation = 0; if (statsMax < 0) statsMax = 0; - M_SetupNextMenu(&SP_GameStatsDef); + M_SetupNextMenu(&SP_LevelStatsDef); } static void M_DrawStatsMaps(int location) { - INT32 y = 76, i = -1; + INT32 y = 80, i = -1; INT16 mnum; extraemblem_t *exemblem; - boolean dobottomarrow = (location < statsMax); - - V_DrawString(20, y-12, 0, "LEVEL NAME"); - V_DrawString(248, y-12, 0, "EMBLEMS"); + boolean dotopname = true, dobottomarrow = (location < statsMax); if (location) V_DrawString(10, y, V_YELLOWMAP, "\x1A"); @@ -5753,6 +5732,13 @@ static void M_DrawStatsMaps(int location) --location; continue; } + else if (dotopname) + { + V_DrawString(20, y, V_GREENMAP, "LEVEL NAME"); + V_DrawString(248, y, V_GREENMAP, "EMBLEMS"); + y += 8; + dotopname = false; + } mnum = statsMapList[i]; M_DrawMapEmblems(mnum+1, 292, y); @@ -5767,19 +5753,34 @@ static void M_DrawStatsMaps(int location) if (y >= BASEVIDHEIGHT-8) goto bottomarrow; } + if (dotopname && !location) + { + V_DrawString(20, y, V_GREENMAP, "LEVEL NAME"); + V_DrawString(248, y, V_GREENMAP, "EMBLEMS"); + y += 8; + } + else if (location) + --location; // Extra Emblems for (i = -2; i < numextraemblems; ++i) { + if (i == -1) + { + V_DrawString(20, y, V_GREENMAP, "EXTRA EMBLEMS"); + if (location) + { + y += 8; + location++; + } + } if (location) { --location; continue; } - if (i == -1) - V_DrawString(20, y, V_GREENMAP, "EXTRA EMBLEMS"); - else if (i >= 0) + if (i >= 0) { exemblem = &extraemblems[i]; @@ -5804,11 +5805,78 @@ bottomarrow: static void M_DrawLevelStats(void) { - M_DrawMenuTitle(); - V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "\x1C PAGE 2 OF 2 \x1D"); + char beststr[40]; - V_DrawString(72, 48, 0, va("x %d/%d", M_CountEmblems(), numemblems+numextraemblems)); - V_DrawScaledPatch(40, 48-4, 0, W_CachePatchName("EMBLICON", PU_STATIC)); + tic_t besttime = 0; + UINT32 bestscore = 0; + UINT32 bestrings = 0; + + INT32 i; + INT32 mapsunfinished = 0; + boolean bestunfinished[3] = {false, false, false}; + + M_DrawMenuTitle(); + + V_DrawString(20, 24, V_YELLOWMAP, "Total Play Time:"); + V_DrawCenteredString(BASEVIDWIDTH/2, 32, 0, va("%i hours, %i minutes, %i seconds", + G_TicsToHours(totalplaytime), + G_TicsToMinutes(totalplaytime, false), + G_TicsToSeconds(totalplaytime))); + + for (i = 0; i < NUMMAPS; i++) + { + boolean mapunfinished = false; + + if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK)) + continue; + + if (!mainrecords[i]) + { + mapsunfinished++; + bestunfinished[0] = bestunfinished[1] = bestunfinished[2] = true; + continue; + } + + if (mainrecords[i]->score > 0) + bestscore += mainrecords[i]->score; + else + mapunfinished = bestunfinished[0] = true; + + if (mainrecords[i]->time > 0) + besttime += mainrecords[i]->time; + else + mapunfinished = bestunfinished[1] = true; + + if (mainrecords[i]->rings > 0) + bestrings += mainrecords[i]->rings; + else + mapunfinished = bestunfinished[2] = true; + + if (mapunfinished) + mapsunfinished++; + } + + V_DrawString(20, 48, 0, "Combined records:"); + + if (mapsunfinished) + V_DrawString(20, 56, V_REDMAP, va("(%d unfinished)", mapsunfinished)); + else + V_DrawString(20, 56, V_GREENMAP, "(complete)"); + + V_DrawString(36, 64, 0, va("x %d/%d", M_CountEmblems(), numemblems+numextraemblems)); + V_DrawSmallScaledPatch(20, 64, 0, W_CachePatchName("EMBLICON", PU_STATIC)); + + sprintf(beststr, "%u", bestscore); + V_DrawString(BASEVIDWIDTH/2, 48, V_YELLOWMAP, "SCORE:"); + V_DrawRightAlignedString(BASEVIDWIDTH-16, 48, (bestunfinished[0] ? V_REDMAP : 0), beststr); + + sprintf(beststr, "%i:%02i:%02i.%02i", G_TicsToHours(besttime), G_TicsToMinutes(besttime, false), G_TicsToSeconds(besttime), G_TicsToCentiseconds(besttime)); + V_DrawString(BASEVIDWIDTH/2, 56, V_YELLOWMAP, "TIME:"); + V_DrawRightAlignedString(BASEVIDWIDTH-16, 56, (bestunfinished[1] ? V_REDMAP : 0), beststr); + + sprintf(beststr, "%u", bestrings); + V_DrawString(BASEVIDWIDTH/2, 64, V_YELLOWMAP, "RINGS:"); + V_DrawRightAlignedString(BASEVIDWIDTH-16, 64, (bestunfinished[2] ? V_REDMAP : 0), beststr); M_DrawStatsMaps(statsLocation); } @@ -5832,124 +5900,19 @@ static void M_HandleLevelStats(INT32 choice) --statsLocation; break; - case KEY_PGUP: - S_StartSound(NULL, sfx_menu1); - statsLocation += (statsLocation+15 >= statsMax) ? statsMax-statsLocation : 15; - break; - case KEY_PGDN: S_StartSound(NULL, sfx_menu1); - statsLocation -= (statsLocation < 15) ? statsLocation : 15; + statsLocation += (statsLocation+13 >= statsMax) ? statsMax-statsLocation : 13; + break; + + case KEY_PGUP: + S_StartSound(NULL, sfx_menu1); + statsLocation -= (statsLocation < 13) ? statsLocation : 13; break; case KEY_ESCAPE: exitmenu = true; break; - - case KEY_LEFTARROW: - case KEY_RIGHTARROW: - case KEY_ENTER: - S_StartSound(NULL, sfx_menu1); - M_SetupNextMenu(&SP_GameStatsDef); - break; - } - if (exitmenu) - { - if (currentMenu->prevMenu) - M_SetupNextMenu(currentMenu->prevMenu); - else - M_ClearMenus(true); - } -} - -// Handle GAME statistics. -static void M_DrawGameStats(void) -{ - char beststr[40]; - - tic_t besttime = 0; - UINT32 bestscore = 0; - UINT32 bestrings = 0; - - INT32 i; - INT32 mapsunfinished[3] = {0, 0, 0}; - - M_DrawMenuTitle(); - V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "\x1C PAGE 1 OF 2 \x1D"); - - V_DrawString(32, 60, V_YELLOWMAP, "Total Play Time:"); - V_DrawRightAlignedString(BASEVIDWIDTH-32, 70, 0, va("%i hours, %i minutes, %i seconds", - G_TicsToHours(totalplaytime), - G_TicsToMinutes(totalplaytime, false), - G_TicsToSeconds(totalplaytime))); - - for (i = 0; i < NUMMAPS; i++) - { - if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK)) - continue; - - if (!mainrecords[i]) - { - mapsunfinished[0]++; - mapsunfinished[1]++; - mapsunfinished[2]++; - continue; - } - - if (mainrecords[i]->score > 0) - bestscore += mainrecords[i]->score; - else - mapsunfinished[0]++; - - if (mainrecords[i]->time > 0) - besttime += mainrecords[i]->time; - else - mapsunfinished[1]++; - - if (mainrecords[i]->rings > 0) - bestrings += mainrecords[i]->rings; - else - mapsunfinished[2]++; - - } - - V_DrawCenteredString(BASEVIDWIDTH/2, 90, 0, "* COMBINED RECORDS *"); - - sprintf(beststr, "%u", bestscore); - V_DrawString(32, 100, V_YELLOWMAP, "SCORE:"); - V_DrawRightAlignedString(BASEVIDWIDTH-32, 100, 0, beststr); - if (mapsunfinished[0]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 108, V_REDMAP, va("(%d unfinished)", mapsunfinished[0])); - - sprintf(beststr, "%i:%02i:%02i.%02i", G_TicsToHours(besttime), G_TicsToMinutes(besttime, false), G_TicsToSeconds(besttime), G_TicsToCentiseconds(besttime)); - V_DrawString(32, 120, V_YELLOWMAP, "TIME:"); - V_DrawRightAlignedString(BASEVIDWIDTH-32, 120, 0, beststr); - if (mapsunfinished[1]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 128, V_REDMAP, va("(%d unfinished)", mapsunfinished[1])); - - sprintf(beststr, "%u", bestrings); - V_DrawString(32, 140, V_YELLOWMAP, "RINGS:"); - V_DrawRightAlignedString(BASEVIDWIDTH-32, 140, 0, beststr); - if (mapsunfinished[2]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 148, V_REDMAP, va("(%d unfinished)", mapsunfinished[2])); -} - -static void M_HandleGameStats(INT32 choice) -{ - boolean exitmenu = false; // exit to previous menu - - switch (choice) - { - case KEY_ESCAPE: - exitmenu = true; - break; - - case KEY_LEFTARROW: - case KEY_RIGHTARROW: - case KEY_ENTER: - S_StartSound(NULL, sfx_menu1); - M_SetupNextMenu(&SP_LevelStatsDef); - break; } if (exitmenu) { From dff95bc30af308cf10e9a69cba44b66d0ac796ca Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 16 Apr 2017 14:20:38 +0100 Subject: [PATCH 035/181] Further tweak to server options menu, returning resynchattempts to the menu alongside taking Master Server out of data options because that doesn't make sense at all --- src/m_menu.c | 60 +++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 7007e7250..12d09275b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1262,10 +1262,6 @@ static menuitem_t OP_DataOptionsMenu[] = {IT_STRING | IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 10}, {IT_STRING | IT_SUBMENU, NULL, "\x85" "Erase Data...", &OP_EraseDataDef, 20}, - -#ifndef NONET - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 40}, -#endif }; static menuitem_t OP_ScreenshotOptionsMenu[] = @@ -1314,42 +1310,46 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_HEADER, NULL, "General", NULL, 0}, #ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Server name", &cv_servername, 7}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 21}, - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 26}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 31}, + NULL, "Server name", &cv_servername, 7}, + {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 21}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 26}, + {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 31}, #endif - {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 41}, - {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 46}, - {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 51}, - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 56}, + {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 41}, + {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 46}, + {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 51}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 56}, {IT_HEADER, NULL, "Platform (Coop, Race, Competition)", NULL, 65}, - {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 71}, - {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 76}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 81}, + {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 71}, + {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 76}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 81}, {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 90}, - {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 96}, - {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 101}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 106}, + {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 96}, + {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 101}, + {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 106}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 111}, - {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 116}, - {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 121}, - {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 126}, + {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 121}, + {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 126}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 136}, - {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 141}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 136}, + {IT_STRING | IT_CVAR, NULL, "Item respawn delay", &cv_itemrespawntime, 141}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 146}, - {IT_STRING | IT_CVAR, NULL, "Item respawn", &cv_itemrespawn, 151}, - {IT_STRING | IT_CVAR, NULL, "Item respawn time", &cv_itemrespawntime, 156}, + {IT_STRING | IT_CVAR, NULL, "Flag respawn delay", &cv_flagtime, 156}, + {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 161}, - {IT_STRING | IT_CVAR, NULL, "Flag respawn time", &cv_flagtime, 166}, - {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 171}, + {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 171}, + {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 176}, - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 181}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 186}, +#ifndef NONET + {IT_HEADER, NULL, "Advanced", NULL, 185}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 191}, + {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 205}, +#endif }; static menuitem_t OP_MonitorToggleMenu[] = @@ -3240,6 +3240,8 @@ static void M_DrawGenericScrollMenu(void) case IT_CV_INVISSLIDER: // monitor toggles use this break; case IT_CV_STRING: + if (y + 12 > (currentMenu->y + 2*scrollareaheight)) + break; M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string); if (skullAnimCounter < 4 && i == itemOn) From 7c079782774c2d276b3e5e5a034f01329220e054 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 16 Apr 2017 15:00:58 +0100 Subject: [PATCH 036/181] Disable irrelevant/dangerous-to-tweak options on the server menu under cetain conditions. --- src/m_menu.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 12d09275b..1e1fe9ac4 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7018,6 +7018,30 @@ static void M_ServerOptions(INT32 choice) { (void)choice; +#ifndef NONET + if ((splitscreen && !netgame) || currentMenu == &MP_SplitServerDef) + { + OP_ServerOptionsMenu[ 1].status = IT_GRAYEDOUT; // Server name + OP_ServerOptionsMenu[ 2].status = IT_GRAYEDOUT; // Max players + OP_ServerOptionsMenu[ 3].status = IT_GRAYEDOUT; // Allow WAD downloading + OP_ServerOptionsMenu[ 4].status = IT_GRAYEDOUT; // Allow players to join + OP_ServerOptionsMenu[28].status = IT_GRAYEDOUT; // Master server + OP_ServerOptionsMenu[29].status = IT_GRAYEDOUT; // Attempts to resynchronise + } + else + { + OP_ServerOptionsMenu[ 1].status = IT_STRING | IT_CVAR | IT_CV_STRING; + OP_ServerOptionsMenu[ 2].status = IT_STRING | IT_CVAR; + OP_ServerOptionsMenu[ 3].status = IT_STRING | IT_CVAR; + OP_ServerOptionsMenu[ 4].status = IT_STRING | IT_CVAR; + if (netgame) + OP_ServerOptionsMenu[28].status = IT_GRAYEDOUT; + else + OP_ServerOptionsMenu[28].status = IT_STRING | IT_CVAR | IT_CV_STRING; + OP_ServerOptionsMenu[29].status = IT_STRING | IT_CVAR; + } +#endif + OP_ServerOptionsDef.prevMenu = currentMenu; M_SetupNextMenu(&OP_ServerOptionsDef); } From 3e29ee3f0169ab081802ec943e607119bcbd4d7e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 01:09:47 +0100 Subject: [PATCH 037/181] Closed captioning! * Provides a helpful description for the hearing impaired, whether permanent, temporary or situational. * Consvar "closedcaptioning", with on/off values available. * Only works if sounds are on. This is frustrating. I will see what I can do to allow it to work with sounds off in future, but for now it's dependent in order to properly accept or decline sounds. * Thanks to MI for making that wiki page a lot more comprehensive a few days ago. * Weapon ring is now a seperate sfx_wepfir instead of doubling up on sfx_thok. * Also, made V_StringWidth work with V_NOSCALESTART. --- src/d_netcmd.c | 1 + src/dehacked.c | 19 +- src/djgppdos/i_video.c | 4 + src/info.c | 10 +- src/m_menu.c | 29 +- src/s_sound.c | 70 +++- src/s_sound.h | 25 +- src/screen.c | 58 +++ src/screen.h | 1 + src/sdl/i_video.c | 4 + src/sdl12/i_video.c | 4 + src/sounds.c | 839 +++++++++++++++++++++-------------------- src/sounds.h | 5 +- src/v_video.c | 3 + src/win32/win_vid.c | 4 + src/win32ce/win_vid.c | 4 + 16 files changed, 632 insertions(+), 448 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 6af6fa6e2..e328e90e0 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -727,6 +727,7 @@ void D_RegisterClientCommands(void) // s_sound.c CV_RegisterVar(&cv_soundvolume); + CV_RegisterVar(&cv_closedcaptioning); CV_RegisterVar(&cv_digmusicvolume); CV_RegisterVar(&cv_midimusicvolume); CV_RegisterVar(&cv_numChannels); diff --git a/src/dehacked.c b/src/dehacked.c index 32b1c1ca3..d3a9ff3f6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2110,6 +2110,7 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[]) { char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL); char *word; + char *word2; char *tmp; INT32 value; @@ -2123,8 +2124,8 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[]) tmp = strchr(s, '#'); if (tmp) *tmp = '\0'; - - value = searchvalue(s); + if (s == tmp) + continue; // Skip comment lines, but don't break. word = strtok(s, " "); if (word) @@ -2132,6 +2133,15 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[]) else break; + word2 = strtok(NULL, " "); + if (word2) + value = atoi(word2); + else + { + deh_warning("No value for token %s", word); + continue; + } + /* if (fastcmp(word, "OFFSET")) { value -= 150360; @@ -2161,6 +2171,11 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[]) DEH_WriteUndoline(word, va("%d", S_sfx[num].pitch), UNDO_NONE); S_sfx[num].pitch = value; } + else if (fastcmp(word, "CAPTION") || fastcmp(word, "DESCRIPTION")) + { + deh_strlcpy(S_sfx[num].caption, word2, + sizeof(S_sfx[num].caption), va("Sound effect %d: caption", num)); + } else deh_warning("Sound %d : unknown word '%s'",num,word); } diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 612c72215..6a7641174 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -90,6 +90,10 @@ static unsigned long nombre = NEWTICRATE*10; static void I_BlitScreenVesa1(void); //see later void I_FinishUpdate (void) { + // draw captions if enabled + if (cv_closedcaptioning.value) + SCR_ClosedCaptions(); + // draw FPS if enabled if (cv_ticrate.value) SCR_DisplayTicRate(); diff --git a/src/info.c b/src/info.c index 7d6e1fede..3fd6f76d5 100644 --- a/src/info.c +++ b/src/info.c @@ -12457,7 +12457,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_RRNG1, // spawnstate 1000, // spawnhealth S_NULL, // seestate - sfx_thok, // seesound + sfx_wepfir, // seesound 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -12864,7 +12864,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_THROWNINFINITY1, // spawnstate 1000, // spawnhealth S_NULL, // seestate - sfx_thok, // seesound + sfx_wepfir, // seesound 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -12891,7 +12891,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_THROWNAUTOMATIC1, // spawnstate 1000, // spawnhealth S_NULL, // seestate - sfx_thok, // seesound + sfx_wepfir, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -12972,7 +12972,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_THROWNGRENADE1, // spawnstate 1000, // spawnhealth S_NULL, // seestate - sfx_thok, // seesound + sfx_wepfir, // seesound 8, // reactiontime sfx_gbeep, // attacksound S_NULL, // painstate @@ -13759,7 +13759,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_itemup, // painsound + sfx_s3k33, // painsound S_RING, // meleestate S_NULL, // missilestate S_SPRK1, // deathstate diff --git a/src/m_menu.c b/src/m_menu.c index 1e1fe9ac4..8e49247f1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -306,6 +306,7 @@ menu_t OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef; menu_t OP_P1ControlsDef, OP_P2ControlsDef, OP_MouseOptionsDef; menu_t OP_Mouse2OptionsDef, OP_Joystick1Def, OP_Joystick2Def; static void M_VideoModeMenu(INT32 choice); +static void M_SoundMenu(INT32 choice); static void M_Setup1PControlsMenu(INT32 choice); static void M_Setup2PControlsMenu(INT32 choice); static void M_Setup1PJoystickMenu(INT32 choice); @@ -1013,16 +1014,16 @@ static menuitem_t MP_PlayerSetupMenu[] = // Prefix: OP_ static menuitem_t OP_MainMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "Player 1 Controls...", &OP_P1ControlsDef, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, - {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 30}, + {IT_SUBMENU | IT_STRING, NULL, "Player 1 Controls...", &OP_P1ControlsDef, 10}, + {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, + {IT_CVAR | IT_STRING, NULL, "Controls per key", &cv_controlperkey, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 50}, - {IT_SUBMENU | IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 60}, + {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 50}, + {IT_CALL | IT_STRING, NULL, "Sound Options...", M_SoundMenu, 60}, - {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, + {IT_CALL | IT_STRING, NULL, "Server Options...", M_ServerOptions, 80}, - {IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 100}, + {IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 100}, }; static menuitem_t OP_P1ControlsMenu[] = @@ -1255,6 +1256,8 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING | IT_KEYHANDLER, NULL, "MIDI Music", M_ToggleMIDI, 70}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 80}, + + {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 100}, }; static menuitem_t OP_DataOptionsMenu[] = @@ -7797,6 +7800,14 @@ static void M_ChangeControl(INT32 choice) // SOUND // ===== +static void M_SoundMenu(INT32 choice) +{ + (void)choice; + + OP_SoundOptionsMenu[6].status = ((nosound || sound_disabled) ? IT_GRAYEDOUT : (IT_STRING | IT_CVAR)); + M_SetupNextMenu(&OP_SoundOptionsDef); +} + void M_DrawSoundMenu(void) { const char* onstring = "ON"; @@ -7852,6 +7863,7 @@ static void M_ToggleSFX(INT32 choice) if (nosound) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); S_StartSound(NULL, sfx_strpst); + OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR; //M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING); } else @@ -7860,12 +7872,15 @@ static void M_ToggleSFX(INT32 choice) { sound_disabled = false; S_StartSound(NULL, sfx_strpst); + OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR; //M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING); } else { sound_disabled = true; S_StopSounds(); + OP_SoundOptionsMenu[6].status = IT_GRAYEDOUT; + ResetCaptions(); //M_StartMessage(M_GetText("SFX Disabled\n"), NULL, MM_NOTHING); } } diff --git a/src/s_sound.c b/src/s_sound.c index d3189d7b4..1f68cc392 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -79,6 +79,7 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL // actual general (maximum) sound & music volume, saved into the config consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, ResetCaptions, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // number of channels available @@ -124,23 +125,32 @@ static consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL // percent attenuation from front to back #define S_IFRACVOL 30 -typedef struct -{ - // sound information (if null, channel avail.) - sfxinfo_t *sfxinfo; - - // origin of sound - const void *origin; - - // handle of the sound being played - INT32 handle; - -} channel_t; - // the set of channels available static channel_t *channels = NULL; static INT32 numofchannels = 0; +caption_t closedcaptions[8] = { + {NULL, NULL, 0}, + {NULL, NULL, 0}, + {NULL, NULL, 0}, + {NULL, NULL, 0}, + {NULL, NULL, 0}, + {NULL, NULL, 0}, + {NULL, NULL, 0}, + {NULL, NULL, 0} +}; + +void ResetCaptions(void) +{ + UINT8 i; + for (i = 0; i < 8; i++) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + } +} + // // Internals. // @@ -297,6 +307,8 @@ static void SetChannelsNum(void) // Free all channels for use for (i = 0; i < numofchannels; i++) channels[i].sfxinfo = 0; + + ResetCaptions(); } @@ -577,6 +589,37 @@ dontplay: sep = (~sep) & 255; #endif + // Handle closed caption input. + if (cv_closedcaptioning.value && sfx->caption[0] != '/') + { + UINT8 i, set = 7; + + for (i = 0; i < set; i++) + { + if ((sfx == closedcaptions[i].s) + || !(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) + { + set = i; + break; + } + } + if (sfx != closedcaptions[set].s) + { + for (i = 7; i > set; i--) + { + if (sfx == closedcaptions[i].s) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + } + } + } + closedcaptions[set].c = &channels[cnum]; + closedcaptions[set].s = sfx; + closedcaptions[set].t = TICRATE+2; + } + // Assigns the handle to one of the channels in the // mix/output buffer. channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); @@ -598,6 +641,7 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id) // sfx_id = sfx_mario8; // break; case sfx_thok: + case sfx_wepfir: sfx_id = sfx_mario7; break; case sfx_pop: diff --git a/src/s_sound.h b/src/s_sound.h index 39ec769a6..7e72d80e5 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -22,8 +22,10 @@ // mask used to indicate sound origin is player item pickup #define PICKUP_SOUND 0x8000 +void ResetCaptions(void); + extern consvar_t stereoreverse; -extern consvar_t cv_soundvolume, cv_digmusicvolume, cv_midimusicvolume; +extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume, cv_midimusicvolume; extern consvar_t cv_numChannels; #ifdef SNDSERV @@ -64,6 +66,27 @@ typedef struct { angle_t angle; } listener_t; +typedef struct +{ + // sound information (if null, channel avail.) + sfxinfo_t *sfxinfo; + + // origin of sound + const void *origin; + + // handle of the sound being played + INT32 handle; + +} channel_t; + +typedef struct { + channel_t *c; + sfxinfo_t *s; + UINT8 t; +} caption_t; + +extern caption_t closedcaptions[8]; + // register sound vars and commands at game startup void S_RegisterSoundStuff(void); diff --git a/src/screen.c b/src/screen.c index 7fdef4b19..c2352283d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -28,6 +28,9 @@ #include "d_main.h" #include "d_clisrv.h" #include "f_finale.h" +#include "i_sound.h" // closed captions +#include "s_sound.h" // ditto +#include "g_game.h" // ditto #if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200)) @@ -434,3 +437,58 @@ void SCR_DisplayTicRate(void) lasttic = ontic; } + +void SCR_ClosedCaptions(void) +{ + UINT8 i; + + for (i = 0; i < 8; i++) + { + boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); + + if (closedcaptions[i].t <= TICRATE) + closedcaptions[i].t--; + if (cond || (closedcaptions[i].s && closedcaptions[i].t)) + { + if (!cond) + closedcaptions[i].c = NULL; + } + + if (!closedcaptions[i].t) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + } + } + + for (i = 0; i < 8; i++) + { + if (closedcaptions[i].s) + { + INT32 flags = V_NOSCALESTART|V_ALLOWLOWERCASE; + INT32 y = vid.height-((i + 2)*10*vid.dupy); + char dir = ' '; + if (closedcaptions[i].t < 20) + flags |= (((20-closedcaptions[i].t)/2)*V_10TRANS); + else if (closedcaptions[i].t > TICRATE) + y -= (closedcaptions[i].t-- - TICRATE)*vid.dupy; + if (closedcaptions[i].c) + { + const mobj_t *o = (const mobj_t *)closedcaptions[i].c->origin; + if (o) + { + angle_t angle = R_PointToAngle(o->x, o->y) - localangle; + if (angle > ANGLE_45 && angle < ANGLE_135) + dir = '\x1C'; + else if (angle > ANGLE_225 && angle < ANGLE_315) + dir = '\x1D'; + else + dir = '\x1E'; + } + } + V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, + flags, va("%c %s", dir, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); + } + } +} diff --git a/src/screen.h b/src/screen.h index a61de7f92..d2d0e87ab 100644 --- a/src/screen.h +++ b/src/screen.h @@ -180,5 +180,6 @@ FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height); // move out to main code for consistency void SCR_DisplayTicRate(void); +void SCR_ClosedCaptions(void); #undef DNWH #endif //__SCREEN_H__ diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 7d33f2554..47a15cab6 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -928,6 +928,10 @@ void I_FinishUpdate(void) if (I_SkipFrame()) return; + // draw captions if enabled + if (cv_closedcaptioning.value) + SCR_ClosedCaptions(); + if (cv_ticrate.value) SCR_DisplayTicRate(); diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 1fa80e7d4..0063fc095 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -1341,6 +1341,10 @@ void I_FinishUpdate(void) if (I_SkipFrame()) return; + // draw captions if enabled + if (cv_closedcaptioning.value) + SCR_ClosedCaptions(); + if (cv_ticrate.value) SCR_DisplayTicRate(); diff --git a/src/sounds.c b/src/sounds.c index 395015296..e2ee03df1 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -32,448 +32,448 @@ sfxinfo_t S_sfx[NUMSFX] = various flags. See soundflags_t. *****/ // S_sfx[0] needs to be a dummy for odd reasons. (don't modify this comment) -// name, singularity, priority, pitch, volume, data, length, skinsound, usefulness, lumpnum - {"none" , false, 0, 0, -1, NULL, 0, -1, -1, LUMPERROR}, +// name, singularity, priority, pitch, volume, data, length, skinsound, usefulness, lumpnum, caption + {"none" , false, 0, 0, -1, NULL, 0, -1, -1, LUMPERROR, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, // maximum length // Skin Sounds - {"altdi1", false, 192, 16, -1, NULL, 0, SKSPLDET1, -1, LUMPERROR}, - {"altdi2", false, 192, 16, -1, NULL, 0, SKSPLDET2, -1, LUMPERROR}, - {"altdi3", false, 192, 16, -1, NULL, 0, SKSPLDET3, -1, LUMPERROR}, - {"altdi4", false, 192, 16, -1, NULL, 0, SKSPLDET4, -1, LUMPERROR}, - {"altow1", false, 192, 16, -1, NULL, 0, SKSPLPAN1, -1, LUMPERROR}, - {"altow2", false, 192, 16, -1, NULL, 0, SKSPLPAN2, -1, LUMPERROR}, - {"altow3", false, 192, 16, -1, NULL, 0, SKSPLPAN3, -1, LUMPERROR}, - {"altow4", false, 192, 16, -1, NULL, 0, SKSPLPAN4, -1, LUMPERROR}, - {"victr1", false, 64, 16, -1, NULL, 0, SKSPLVCT1, -1, LUMPERROR}, - {"victr2", false, 64, 16, -1, NULL, 0, SKSPLVCT2, -1, LUMPERROR}, - {"victr3", false, 64, 16, -1, NULL, 0, SKSPLVCT3, -1, LUMPERROR}, - {"victr4", false, 64, 16, -1, NULL, 0, SKSPLVCT4, -1, LUMPERROR}, - {"gasp" , false, 64, 0, -1, NULL, 0, SKSGASP, -1, LUMPERROR}, - {"jump" , false, 140, 0, -1, NULL, 0, SKSJUMP, -1, LUMPERROR}, - {"pudpud", false, 64, 0, -1, NULL, 0, SKSPUDPUD, -1, LUMPERROR}, - {"putput", false, 64, 0, -1, NULL, 0, SKSPUTPUT, -1, LUMPERROR}, // not as high a priority - {"spin" , false, 100, 0, -1, NULL, 0, SKSSPIN, -1, LUMPERROR}, - {"spndsh", false, 64, 1, -1, NULL, 0, SKSSPNDSH, -1, LUMPERROR}, - {"thok" , false, 96, 0, -1, NULL, 0, SKSTHOK, -1, LUMPERROR}, - {"zoom" , false, 120, 1, -1, NULL, 0, SKSZOOM, -1, LUMPERROR}, - {"skid", false, 64, 32, -1, NULL, 0, SKSSKID, -1, LUMPERROR}, + {"altdi1", false, 192, 16, -1, NULL, 0, SKSPLDET1, -1, LUMPERROR, "Dying"}, + {"altdi2", false, 192, 16, -1, NULL, 0, SKSPLDET2, -1, LUMPERROR, "Dying"}, + {"altdi3", false, 192, 16, -1, NULL, 0, SKSPLDET3, -1, LUMPERROR, "Dying"}, + {"altdi4", false, 192, 16, -1, NULL, 0, SKSPLDET4, -1, LUMPERROR, "Dying"}, + {"altow1", false, 192, 16, -1, NULL, 0, SKSPLPAN1, -1, LUMPERROR, "Spilled rings"}, + {"altow2", false, 192, 16, -1, NULL, 0, SKSPLPAN2, -1, LUMPERROR, "Spilled rings"}, + {"altow3", false, 192, 16, -1, NULL, 0, SKSPLPAN3, -1, LUMPERROR, "Spilled rings"}, + {"altow4", false, 192, 16, -1, NULL, 0, SKSPLPAN4, -1, LUMPERROR, "Spilled rings"}, + {"victr1", false, 64, 16, -1, NULL, 0, SKSPLVCT1, -1, LUMPERROR, "/"}, + {"victr2", false, 64, 16, -1, NULL, 0, SKSPLVCT2, -1, LUMPERROR, "/"}, + {"victr3", false, 64, 16, -1, NULL, 0, SKSPLVCT3, -1, LUMPERROR, "/"}, + {"victr4", false, 64, 16, -1, NULL, 0, SKSPLVCT4, -1, LUMPERROR, "/"}, + {"gasp" , false, 64, 0, -1, NULL, 0, SKSGASP, -1, LUMPERROR, "Bubble gasp"}, + {"jump" , false, 140, 0, -1, NULL, 0, SKSJUMP, -1, LUMPERROR, "Jump"}, + {"pudpud", false, 64, 0, -1, NULL, 0, SKSPUDPUD, -1, LUMPERROR, "Tired flight"}, + {"putput", false, 64, 0, -1, NULL, 0, SKSPUTPUT, -1, LUMPERROR, "Flight"}, // not as high a priority + {"spin" , false, 100, 0, -1, NULL, 0, SKSSPIN, -1, LUMPERROR, "Spin"}, + {"spndsh", false, 64, 1, -1, NULL, 0, SKSSPNDSH, -1, LUMPERROR, "Spindash charge"}, + {"thok" , false, 96, 0, -1, NULL, 0, SKSTHOK, -1, LUMPERROR, "Thok"}, + {"zoom" , false, 120, 1, -1, NULL, 0, SKSZOOM, -1, LUMPERROR, "Spindash launch"}, + {"skid", false, 64, 32, -1, NULL, 0, SKSSKID, -1, LUMPERROR, "Skid"}, // Ambience/background objects/etc - {"ambint", true, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ambint", true, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Obnoxious disco music"}, - {"alarm", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"buzz1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"buzz2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"buzz3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"buzz4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"crumbl", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Platform Crumble Tails 03-16-2001 - {"fire", false, 8, 32, -1, NULL, 0, -1, -1, LUMPERROR}, - {"grind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"laser", true, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mswing", false, 16, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"pstart", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"pstop", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"steam1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Tails 06-19-2001 - {"steam2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Tails 06-19-2001 - {"wbreak", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"alarm", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Alarm"}, + {"buzz1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric zap"}, + {"buzz2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric zap"}, + {"buzz3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric zap"}, + {"buzz4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Buzz"}, + {"crumbl", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crumbling"}, // Platform Crumble Tails 03-16-2001 + {"fire", false, 8, 32, -1, NULL, 0, -1, -1, LUMPERROR, "Flamethrower"}, + {"grind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic grinding"}, + {"laser", true, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Laser hum"}, + {"mswing", false, 16, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Swinging mace"}, + {"pstart", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"}, + {"pstop", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"}, + {"steam1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Steam jet"}, // Tails 06-19-2001 + {"steam2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Steam jet"}, // Tails 06-19-2001 + {"wbreak", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wood breaking"}, - {"rainin", true, 24, 4, -1, NULL, 0, -1, -1, LUMPERROR}, - {"litng1", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"litng2", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"litng3", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"litng4", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"athun1", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"athun2", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR}, + {"rainin", true, 24, 4, -1, NULL, 0, -1, -1, LUMPERROR, "Rain"}, + {"litng1", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning"}, + {"litng2", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning"}, + {"litng3", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning"}, + {"litng4", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning"}, + {"athun1", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Thunder"}, + {"athun2", false, 16, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Thunder"}, - {"amwtr1", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr2", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr3", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr4", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr5", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr6", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr7", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"amwtr8", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bubbl1", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bubbl2", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bubbl3", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bubbl4", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bubbl5", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"floush", false, 16, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"splash", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"splish", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Splish Tails 12-08-2000 - {"wdrip1", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip2", false, 8 , 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip3", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip5", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip6", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip7", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdrip8", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wslap", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Water Slap Tails 12-13-2000 + {"amwtr1", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr2", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr3", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr4", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr5", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr6", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr7", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"amwtr8", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, + {"bubbl1", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, + {"bubbl2", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, + {"bubbl3", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, + {"bubbl4", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, + {"bubbl5", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, + {"floush", false, 16, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Shallow water"}, + {"splash", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, + {"splish", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, // Splish Tails 12-08-2000 + {"wdrip1", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip2", false, 8 , 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip3", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip5", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip6", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip7", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wdrip8", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, + {"wslap", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water slap"}, // Water Slap Tails 12-13-2000 - {"doora1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"doorb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"doorc1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"doorc2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"doord1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"doord2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"eleva1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"eleva2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"eleva3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"elevb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"elevb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"elevb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"doora1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sliding open"}, + {"doorb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sliding open"}, + {"doorc1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wooden door opening"}, + {"doorc2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Slamming shut"}, + {"doord1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Creaking open"}, + {"doord2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Slamming shut"}, + {"eleva1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Starting elevator"}, + {"eleva2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Moving elevator"}, + {"eleva3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stopping elevator"}, + {"elevb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Starting elevator"}, + {"elevb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Moving elevator"}, + {"elevb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Stopping elevator"}, - {"ambin2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"lavbub", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rocks1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rocks2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rocks3", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rocks4", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rumbam", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rumble", false, 64, 24, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ambin2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Natural vibrations"}, + {"lavbub", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Bubbling lava"}, + {"rocks1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, + {"rocks2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, + {"rocks3", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, + {"rocks4", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, + {"rumbam", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Violent rumbling"}, + {"rumble", false, 64, 24, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, // Game objects, etc - {"appear", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bkpoof", false, 70, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bnce1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Boing! - {"bnce2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Boing! - {"cannon", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"cgot" , true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Got Emerald! Tails 09-02-2001 - {"cybdth", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"deton", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"ding", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"dmpain", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"drown", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grenade beep - {"gclose", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"gravch", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"itemup", true, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"jet", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"jshard", true, 167, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"lose" , false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"lvpass", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mindig", false, 8, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mixup", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"monton", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"pogo" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"pop" , false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // generic GET! - {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Whirlwind GET! - {"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Force GET! - {"elemsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Elemental GET! - {"armasg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Armaggeddon GET! - {"attrsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Attract GET! - {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // You LOSE! - {"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"statu1", true, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"statu2", true, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"strpst", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Starpost Sound Tails 07-04-2002 - {"supert", true, 127, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"telept", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"tink" , false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"token" , true, 224, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SS token - {"trfire", true, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"trpowr", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"turhit", false, 40, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"corkp", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"corkh", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"appear", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Appearing platform"}, + {"bkpoof", false, 70, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Armageddon explosion"}, + {"bnce1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, // Boing! + {"bnce2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ricochet"}, // Boing! + {"cannon", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful shot"}, + {"cgot" , true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Chaos Emerald"}, // Got Emerald! Tails 09-02-2001 + {"cybdth", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, + {"deton", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous beeping"}, + {"ding", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Ding"}, + {"dmpain", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Machine damage"}, + {"drown", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drowning"}, + {"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Electric fizzle"}, + {"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous beeping"}, // Grenade beep + {"wepfir", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon firing"}, // defaults to thok + {"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goo splash"}, + {"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, + {"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goop sling"}, + {"gravch", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Recycler"}, + {"itemup", true, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sparkle"}, + {"jet", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying jet"}, + {"jshard", true, 167, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got shard"}, + {"lose" , false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Failure"}, + {"lvpass", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning signpost"}, + {"mindig", false, 8, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Tunnelling"}, + {"mixup", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Teleport"}, + {"monton", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Golden Monitor activated"}, + {"pogo" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical pogo"}, + {"pop" , false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, + {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rail weapon fired"}, + {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rail weapon crash"}, + {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Missile fired"}, + {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pity Shield"}, // generic GET! + {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Whirlwind Shield"}, // Whirlwind GET! + {"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Force Shield"}, // Force GET! + {"elemsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Elemental Shield"}, // Elemental GET! + {"armasg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Armageddon Shield"}, // Armaggeddon GET! + {"attrsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction Shield"}, // Attract GET! + {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Shield loss"}, // You LOSE! + {"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Speedpad"}, + {"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spiked"}, + {"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spring"}, + {"statu1", true, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Pushing a statue"}, + {"statu2", true, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Pushing a statue"}, + {"strpst", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Starpost"}, // Starpost Sound Tails 07-04-2002 + {"supert", true, 127, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, + {"telept", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dash"}, + {"tink" , false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tink"}, + {"token" , true, 224, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Token"}, // SS token + {"trfire", true, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Laser fired"}, + {"trpowr", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Charging"}, + {"turhit", false, 40, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Laser hit"}, + {"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Whirlwind jump"}, + {"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning out"}, + {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Crunch"}, + {"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bouncing"}, + {"corkp", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork fired"}, + {"corkh", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork hit"}, // Menu, interface - {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"dwnind", false, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"emfind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"menu1", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Point tally is identical to menu for now - {"radio", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"wepchg", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Weapon switch is identical to menu for now - {"wtrdng", true, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // make sure you can hear the DING DING! Tails 03-08-2000 - {"zelda", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, + {"dwnind", false, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, + {"emfind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Radar beep"}, + {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flag capture"}, + {"menu1", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, + {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, + {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally"}, // Point tally is identical to menu for now + {"radio", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Chatter"}, + {"wepchg", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon change"}, // Weapon switch is identical to menu for now + {"wtrdng", true, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thinking about air"}, // make sure you can hear the DING DING! Tails 03-08-2000 + {"zelda", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Discovery"}, // NiGHTS - {"ideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"xideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Xmas - {"nbmper", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"nxbump", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Xmas - {"ncitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"nxitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Xmas - {"ngdone", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"nxdone", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Xmas - {"drill1", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"drill2", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"ncspec", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Tails 12-15-2003 - {"nghurt", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"ngskid", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"hoop1", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"hoop2", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"hoop3", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"hidden", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"prloop", false, 104, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"timeup", true, 256, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Finishing the stage"}, + {"xideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Finishing the stage"}, // Xmas + {"nbmper", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper"}, + {"nxbump", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper"}, // Xmas + {"ncitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got logo"}, + {"nxitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got logo"}, // Xmas + {"ngdone", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bonus time start"}, + {"nxdone", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bonus time start"}, // Xmas + {"drill1", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drill start"}, + {"drill2", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drill"}, + {"ncspec", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Power-up"}, // Tails 12-15-2003 + {"nghurt", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"}, + {"ngskid", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Force stop"}, + {"hoop1", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop"}, + {"hoop2", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop+"}, + {"hoop3", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop++"}, + {"hidden", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Power-up discovery"}, + {"prloop", false, 104, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Paraloop"}, + {"timeup", true, 256, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Countdown"}, // Mario - {"koopfr" , true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario1", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario2", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario3", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario4", true, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario5", false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario6", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario7", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario8", false, 48, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"marioa", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"koopfr" , true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Fire"}, + {"mario1", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hitting a ceiling"}, + {"mario2", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Koopa shell"}, + {"mario3", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Power-up"}, + {"mario4", true, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got coin"}, + {"mario5", false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goomba stomp"}, + {"mario6", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Jump"}, + {"mario7", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire"}, + {"mario8", false, 48, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"}, + {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collecting power-up"}, + {"marioa", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, + {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp stomp"}, // Black Eggman - {"bebomb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bechrg", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"becrsh", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bedeen", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bedie1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bedie2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"beeyow", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"befall", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"befire", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"beflap", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"begoop", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"begrnd", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"behurt", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bejet1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"belnch", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"beoutb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"beragh", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"beshot", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bestep", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bestp2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bewar1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bewar2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bewar3", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bewar4", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bexpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"bgxpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"bebomb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Bomb explosion"}, + {"bechrg", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Charging"}, + {"becrsh", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Crash"}, + {"bedeen", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic crash"}, + {"bedie1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, + {"bedie2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, + {"beeyow", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, + {"befall", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic slam"}, + {"befire", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing goop"}, + {"beflap", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical jump"}, + {"begoop", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful shot"}, + {"begrnd", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic hit"}, + {"behurt", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic crash"}, + {"bejet1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Jetpack charge"}, + {"belnch", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical jump"}, + {"beoutb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Empty chamber"}, + {"beragh", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman screaming"}, + {"beshot", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing missile"}, + {"bestep", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical stomp"}, + {"bestp2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical stomp"}, + {"bewar1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, + {"bewar2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, + {"bewar3", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, + {"bewar4", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, + {"bexpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Missile explosion"}, + {"bgxpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, // Cybrakdemon - {"beelec", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"brakrl", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"brakrx", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"beelec", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Electricity"}, + {"brakrl", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Rocket launch"}, + {"brakrx", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Rocket explosion"}, // S3&K sounds - {"s3k33", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k34", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k35", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k36", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k4a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k4b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k4c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k4d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k4e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k4f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k50", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k51", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k52", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k53", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k54", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // MetalSonic shot fire - {"s3k55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k60", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k61", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k62", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k63", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k64", false, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k65", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Blue Spheres - {"s3k66", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k6f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k72", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k73", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k74", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k75", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k76", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k77", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k78", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k79", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k80", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k85", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k86", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k87", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k8c", 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}, - {"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k91", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k92", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k95", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k9a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k9b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k9c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kaf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kb9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kba", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbcs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbcl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbds", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbdl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbes", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbel", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbfs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kbfl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc0s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc0l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc1s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc1l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc2s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc2l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc3s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc3l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc4s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc4l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc5s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc5l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc6s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc6l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc8s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kccs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kccl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcds", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcdl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kces", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcel", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcfs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcfl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd0s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd0l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd1s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd1l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd2s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd2l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd3s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd3l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd4s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd4l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd5s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd5l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd6s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd6l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd7s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd7l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd8s", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Sharp Spin (maybe use the long/L version?) - {"s3kd8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kd9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kdas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kdal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kdbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kdbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k33", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sparkle"}, // stereo in original game, identical to latter + {"s3k34", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sparkle"}, // mono in original game, identical to previous + {"s3k35", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"}, + {"s3k36", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Skid"}, + {"s3k37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spiked"}, + {"s3k38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bubble gasp"}, + {"s3k39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, + {"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k3b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drowning"}, + {"s3k3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning"}, + {"s3k3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, + {"s3k3e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire Shield"}, + {"s3k3f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water Shield"}, + {"s3k40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction zoom"}, + {"s3k41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning shield"}, + {"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Twinspin"}, + {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire burst"}, + {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, + {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning zap"}, + {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, + {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising sand"}, + {"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, + {"s3k49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rock"}, + {"s3k4a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Grab"}, + {"s3k4b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, + {"s3k4c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Heavy landing"}, + {"s3k4d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing bullet"}, + {"s3k4e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bomb explosion"}, + {"s3k4f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flamethrower"}, + {"s3k50", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Siren"}, + {"s3k51", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling bomb"}, + {"s3k52", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spike"}, + {"s3k53", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Charging"}, + {"s3k54", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing"}, // MetalSonic shot fire + {"s3k55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Moving on track"}, + {"s3k56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water"}, + {"s3k58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical movement"}, + {"s3k59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing platform"}, + {"s3k5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aiming"}, + {"s3k5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, + {"s3k5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric spark"}, + {"s3k5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bouncing missile"}, + {"s3k5e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing laser"}, + {"s3k5f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"}, + {"s3k60", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying away"}, + {"s3k61", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drilling"}, + {"s3k62", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Jump"}, + {"s3k63", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Starpost"}, + {"s3k64", false, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, + {"s3k65", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got blue sphere"}, // Blue Spheres + {"s3k66", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Special stage clear"}, + {"s3k67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing missile"}, + {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super possibilities"}, + {"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Switch click"}, + {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Special stage clear"}, + {"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting from the ground"}, + {"s3k6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k6e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical damage"}, + {"s3k6f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, + {"s3k70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Seperation"}, + {"s3k71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k72", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, + {"s3k73", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Warp"}, + {"s3k74", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical clink"}, + {"s3k75", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising"}, + {"s3k76", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Click"}, + {"s3k77", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Balloon pop"}, + {"s3k78", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"}, + {"s3k79", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric charge"}, + {"s3k7a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising from lava"}, + {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper bounce"}, + {"s3k7c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"}, + {"s3k7d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Eating dirt"}, + {"s3k7f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Freeze"}, + {"s3k80", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ice spike burst"}, + {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing large object"}, + {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting from the ground"}, + {"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing bridge"}, + {"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k85", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k86", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Alarm"}, + {"s3k87", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, + {"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, + {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sufficiently advanced tech."}, + {"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boing"}, + {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Chop"}, + {"s3k8c", 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, ""}, + {"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Opening"}, + {"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Closing"}, + {"s3k91", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Closed"}, + {"s3k92", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ghost"}, + {"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rebuilding"}, + {"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spike"}, + {"s3k95", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising from lava"}, + {"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling"}, + {"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind"}, + {"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling spike"}, + {"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, + {"s3k9a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k9b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"}, + {"s3k9c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Super Emerald"}, + {"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Targetting"}, + {"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, + {"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, + {"s3ka0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"}, + {"s3ka1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3ka2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"}, + {"s3ka3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lift"}, + {"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Robotic power up"}, + {"s3ka5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Countdown beep"}, + {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, + {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, + {"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper bounce"}, + {"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash charge"}, + {"s3kac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Continue"}, + {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "GO!"}, + {"s3kae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pinball flipper"}, + {"s3kaf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "To Special Stage"}, + {"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, + {"s3kb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spring"}, + {"s3kb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Failure"}, + {"s3kb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Big ring warp"}, + {"s3kb4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, + {"s3kb5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kb6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash launch"}, + {"s3kb7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rolling tumbler"}, + {"s3kb8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling signpost"}, + {"s3kb9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spilled rings"}, + {"s3kba", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flight"}, + {"s3kbb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tired flight"}, + {"s3kbcs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kbcl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // long version of previous + {"s3kbds", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying fortress"}, + {"s3kbdl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying fortress"}, // ditto + {"s3kbes", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying away"}, + {"s3kbel", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying away"}, // ditto + {"s3kbfs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Turbine"}, + {"s3kbfl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Turbine"}, // ditto + {"s3kc0s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Turbine"}, + {"s3kc0l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Turbine"}, // ditto + {"s3kc1s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fan"}, + {"s3kc1l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fan"}, // ditto + {"s3kc2s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flamethrower"}, + {"s3kc2l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flamethrower"}, // ditto + {"s3kc3s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Levitation"}, + {"s3kc3l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Levitation"}, // ditto + {"s3kc4s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing laser"}, + {"s3kc4l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing laser"}, // ditto + {"s3kc5s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kc5l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kc6s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Orbiting"}, + {"s3kc6l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Orbiting"}, // ditto + {"s3kc7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aiming"}, + {"s3kc8s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sliding"}, + {"s3kc8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sliding"}, // ditto + {"s3kc9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Swinging"}, + {"s3kc9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Swinging"}, // ditto + {"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, + {"s3kcal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, // ditto + {"s3kcbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kcbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kccs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, + {"s3kccl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, // ditto + {"s3kcds", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, + {"s3kcdl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, // ditto + {"s3kces", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind tunnel"}, + {"s3kcel", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind tunnel"}, // ditto + {"s3kcfs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kcfl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kd0s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising"}, + {"s3kd0l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising"}, // ditto + {"s3kd1s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kd1l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kd2s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Turning"}, + {"s3kd2l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Turning"}, // ditto + {"s3kd3s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kd3l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kd4s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Engine"}, + {"s3kd4l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Engine"}, // ditto + {"s3kd5s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling lava"}, + {"s3kd5l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling lava"}, // ditto + {"s3kd6s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kd6l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kd7s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, + {"s3kd7l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, // ditto + {"s3kd8s", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Acceleration"}, // Sharp Spin (maybe use the long/L version?) + {"s3kd8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Acceleration"}, // ditto + {"s3kd9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnetism"}, + {"s3kd9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnetism"}, // ditto + {"s3kdas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Click"}, + {"s3kdal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Click"}, // ditto + {"s3kdbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running on water"}, + {"s3kdbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running on water"}, // ditto // skin sounds free slots to add sounds at run time (Boris HACK!!!) // initialized to NULL @@ -513,6 +513,7 @@ void S_InitRuntimeSounds (void) S_sfx[i].skinsound = -1; S_sfx[i].usefulness = -1; S_sfx[i].lumpnum = LUMPERROR; + strlcpy(S_sfx[i].caption, "", 9); } } diff --git a/src/sounds.h b/src/sounds.h index 0442ebb05..60451b6ea 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -84,6 +84,9 @@ struct sfxinfo_struct // lump number of sfx lumpnum_t lumpnum; + + // closed caption info/wiki table bait + char caption[32]; }; // the complete set of sound effects @@ -210,7 +213,7 @@ typedef enum sfx_drown, sfx_fizzle, sfx_gbeep, - sfx_gclose, + sfx_wepfir, sfx_ghit, sfx_gloop, sfx_gspray, diff --git a/src/v_video.c b/src/v_video.c index a906c43c2..e4d079c73 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1781,6 +1781,9 @@ INT32 V_StringWidth(const char *string, INT32 option) w += (charwidth ? charwidth : SHORT(hu_font[c]->width)); } + if (option & V_NOSCALESTART) + w *= vid.dupx; + return w; } diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 31d1b8120..5560751de 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -362,6 +362,10 @@ void I_FinishUpdate(void) if (I_SkipFrame()) return; + // draw captions if enabled + if (cv_closedcaptioning.value) + SCR_ClosedCaptions(); + // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index b9c2e131f..4724ca40d 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -194,6 +194,10 @@ void I_FinishUpdate(void) if (rendermode == render_none) return; + // draw captions if enabled + if (cv_closedcaptioning.value) + SCR_ClosedCaptions(); + // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); From db282caefe4e6222d73485101eba13c6d7e05b5f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 02:03:44 +0100 Subject: [PATCH 038/181] * Fix a bug with sounds overlapping. * Make sounds with identical names (as opposed to just identical sfx's) stack together. * Corrected a few names. --- src/s_sound.c | 25 +++++++++++++++++++++++-- src/sounds.c | 4 ++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 1f68cc392..829ff0a98 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -36,6 +36,7 @@ extern INT32 msg_id; #include "d_main.h" #include "r_sky.h" // skyflatnum #include "p_local.h" // camera info +#include "fastcmp.h" #ifdef HW3SOUND // 3D Sound Interface @@ -592,17 +593,21 @@ dontplay: // Handle closed caption input. if (cv_closedcaptioning.value && sfx->caption[0] != '/') { - UINT8 i, set = 7; + UINT8 i, set = 7, moveup = 255; for (i = 0; i < set; i++) { - if ((sfx == closedcaptions[i].s) + boolean same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); + if (same || !(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) { set = i; + if (closedcaptions[i].s && !same && (sfx->priority >= closedcaptions[i].s->priority)) + moveup = i; break; } } + if (sfx != closedcaptions[set].s) { for (i = 7; i > set; i--) @@ -615,6 +620,22 @@ dontplay: } } } + + if (moveup != 255) + { + for (i = moveup; i < 7; i++) + { + if (!(closedcaptions[i].c || closedcaptions[i].s)) + break; + } + for (; i > set; i--) + { + closedcaptions[i].c = closedcaptions[i-1].c; + closedcaptions[i].s = closedcaptions[i-1].s; + closedcaptions[i].t = closedcaptions[i-1].t; + } + } + closedcaptions[set].c = &channels[cnum]; closedcaptions[set].s = sfx; closedcaptions[set].t = TICRATE+2; diff --git a/src/sounds.c b/src/sounds.c index e2ee03df1..3a4c9cd5e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -377,10 +377,10 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind"}, {"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling spike"}, {"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, - {"s3k9a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k9a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Click"}, {"s3k9b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"}, {"s3k9c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Super Emerald"}, - {"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Targetting"}, + {"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Targeting"}, {"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, {"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, {"s3ka0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"}, From 3551509ed8226a1d467c9923ffb351bb385ad741 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 14:38:56 +0100 Subject: [PATCH 039/181] * Remaster the sound stacking methodology such that the same sound effect updates its previous position rather than heading to the bottom. * Put brackets around the sound names on the reccomendation of a friend who works with disability in gaming. * Update a bunch of sound names to better match what they actually do in SRB2. --- src/s_sound.c | 21 ++++--- src/screen.c | 2 +- src/sounds.c | 170 +++++++++++++++++++++++++------------------------- 3 files changed, 100 insertions(+), 93 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 829ff0a98..2add1cf94 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -594,22 +594,29 @@ dontplay: if (cv_closedcaptioning.value && sfx->caption[0] != '/') { UINT8 i, set = 7, moveup = 255; - + boolean same = false; for (i = 0; i < set; i++) { - boolean same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); - if (same - || !(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) + same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); + if (same) { set = i; - if (closedcaptions[i].s && !same && (sfx->priority >= closedcaptions[i].s->priority)) - moveup = i; break; } } - if (sfx != closedcaptions[set].s) + if (!same) { + for (i = 0; i < set; i++) + { + if (!(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) + { + set = i; + if (closedcaptions[i].s && (sfx->priority >= closedcaptions[i].s->priority)) + moveup = i; + break; + } + } for (i = 7; i > set; i--) { if (sfx == closedcaptions[i].s) diff --git a/src/screen.c b/src/screen.c index c2352283d..223f0a494 100644 --- a/src/screen.c +++ b/src/screen.c @@ -488,7 +488,7 @@ void SCR_ClosedCaptions(void) } } V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, - flags, va("%c %s", dir, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); + flags, va("%c [%s]", dir, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); } } } diff --git a/src/sounds.c b/src/sounds.c index 3a4c9cd5e..2edb2c204 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -40,10 +40,10 @@ sfxinfo_t S_sfx[NUMSFX] = {"altdi2", false, 192, 16, -1, NULL, 0, SKSPLDET2, -1, LUMPERROR, "Dying"}, {"altdi3", false, 192, 16, -1, NULL, 0, SKSPLDET3, -1, LUMPERROR, "Dying"}, {"altdi4", false, 192, 16, -1, NULL, 0, SKSPLDET4, -1, LUMPERROR, "Dying"}, - {"altow1", false, 192, 16, -1, NULL, 0, SKSPLPAN1, -1, LUMPERROR, "Spilled rings"}, - {"altow2", false, 192, 16, -1, NULL, 0, SKSPLPAN2, -1, LUMPERROR, "Spilled rings"}, - {"altow3", false, 192, 16, -1, NULL, 0, SKSPLPAN3, -1, LUMPERROR, "Spilled rings"}, - {"altow4", false, 192, 16, -1, NULL, 0, SKSPLPAN4, -1, LUMPERROR, "Spilled rings"}, + {"altow1", false, 192, 16, -1, NULL, 0, SKSPLPAN1, -1, LUMPERROR, "Ring loss"}, + {"altow2", false, 192, 16, -1, NULL, 0, SKSPLPAN2, -1, LUMPERROR, "Ring loss"}, + {"altow3", false, 192, 16, -1, NULL, 0, SKSPLPAN3, -1, LUMPERROR, "Ring loss"}, + {"altow4", false, 192, 16, -1, NULL, 0, SKSPLPAN4, -1, LUMPERROR, "Ring loss"}, {"victr1", false, 64, 16, -1, NULL, 0, SKSPLVCT1, -1, LUMPERROR, "/"}, {"victr2", false, 64, 16, -1, NULL, 0, SKSPLVCT2, -1, LUMPERROR, "/"}, {"victr3", false, 64, 16, -1, NULL, 0, SKSPLVCT3, -1, LUMPERROR, "/"}, @@ -93,23 +93,23 @@ sfxinfo_t S_sfx[NUMSFX] = {"amwtr6", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, {"amwtr7", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, {"amwtr8", false, 12, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Running water"}, - {"bubbl1", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, - {"bubbl2", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, - {"bubbl3", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, - {"bubbl4", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, - {"bubbl5", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Small bubble"}, - {"floush", false, 16, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Shallow water"}, - {"splash", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, - {"splish", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, // Splish Tails 12-08-2000 - {"wdrip1", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip2", false, 8 , 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip3", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip5", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip6", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip7", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wdrip8", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dripping water"}, - {"wslap", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water slap"}, // Water Slap Tails 12-13-2000 + {"bubbl1", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, + {"bubbl2", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, + {"bubbl3", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, + {"bubbl4", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, + {"bubbl5", false, 11, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, + {"floush", false, 16, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, + {"splash", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Glub"}, // labeling sfx_splash as "glub" and sfx_splish as "splash" seems wrong but isn't + {"splish", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Splash"}, // Splish Tails 12-08-2000 + {"wdrip1", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip2", false, 8 , 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip3", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip5", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip6", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip7", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wdrip8", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drip"}, + {"wslap", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Splash"}, // Water Slap Tails 12-13-2000 {"doora1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sliding open"}, {"doorb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sliding open"}, @@ -130,7 +130,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"rocks2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, {"rocks3", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, {"rocks4", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rocks"}, - {"rumbam", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Violent rumbling"}, + {"rumbam", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, {"rumble", false, 64, 24, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, // Game objects, etc @@ -148,8 +148,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Electric fizzle"}, {"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous beeping"}, // Grenade beep {"wepfir", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon firing"}, // defaults to thok - {"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goo splash"}, - {"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, + {"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goop splash"}, + {"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Splash"}, {"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goop sling"}, {"gravch", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Recycler"}, {"itemup", true, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sparkle"}, @@ -162,8 +162,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"monton", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Golden Monitor activated"}, {"pogo" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical pogo"}, {"pop" , false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, - {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rail weapon fired"}, - {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rail weapon crash"}, + {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Railgun fired"}, + {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Railgun crash"}, {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Missile fired"}, {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pity Shield"}, // generic GET! {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Whirlwind Shield"}, // Whirlwind GET! @@ -171,47 +171,47 @@ sfxinfo_t S_sfx[NUMSFX] = {"elemsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Elemental Shield"}, // Elemental GET! {"armasg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Armageddon Shield"}, // Armaggeddon GET! {"attrsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction Shield"}, // Attract GET! - {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Shield loss"}, // You LOSE! + {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"}, // You LOSE! {"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Speedpad"}, {"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spiked"}, {"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spring"}, {"statu1", true, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Pushing a statue"}, {"statu2", true, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Pushing a statue"}, {"strpst", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Starpost"}, // Starpost Sound Tails 07-04-2002 - {"supert", true, 127, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, + {"supert", true, 127, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Transformation"}, {"telept", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Dash"}, {"tink" , false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tink"}, {"token" , true, 224, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Token"}, // SS token {"trfire", true, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Laser fired"}, - {"trpowr", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Charging"}, + {"trpowr", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, {"turhit", false, 40, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Laser hit"}, {"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Whirlwind jump"}, {"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning out"}, - {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Crunch"}, + {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Breaking through"}, {"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bouncing"}, {"corkp", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork fired"}, {"corkh", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork hit"}, // Menu, interface {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, - {"dwnind", false, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, + {"dwnind", false, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thinking about air"}, {"emfind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Radar beep"}, {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flag capture"}, {"menu1", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally"}, // Point tally is identical to menu for now - {"radio", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Chatter"}, + {"radio", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Notification"}, {"wepchg", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon change"}, // Weapon switch is identical to menu for now - {"wtrdng", true, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thinking about air"}, // make sure you can hear the DING DING! Tails 03-08-2000 + {"wtrdng", true, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, // make sure you can hear the DING DING! Tails 03-08-2000 {"zelda", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Discovery"}, // NiGHTS - {"ideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Finishing the stage"}, - {"xideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Finishing the stage"}, // Xmas + {"ideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Success"}, + {"xideya", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Success"}, // Xmas {"nbmper", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper"}, {"nxbump", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper"}, // Xmas - {"ncitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got logo"}, - {"nxitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got logo"}, // Xmas + {"ncitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got special"}, + {"nxitem", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got special"}, // Xmas {"ngdone", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bonus time start"}, {"nxdone", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bonus time start"}, // Xmas {"drill1", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drill start"}, @@ -222,9 +222,9 @@ sfxinfo_t S_sfx[NUMSFX] = {"hoop1", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop"}, {"hoop2", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop+"}, {"hoop3", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop++"}, - {"hidden", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Power-up discovery"}, + {"hidden", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Discovery"}, {"prloop", false, 104, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Paraloop"}, - {"timeup", true, 256, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Countdown"}, + {"timeup", true, 256, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous Countdown"}, // Mario {"koopfr" , true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Fire"}, @@ -232,17 +232,17 @@ sfxinfo_t S_sfx[NUMSFX] = {"mario2", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Koopa shell"}, {"mario3", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Power-up"}, {"mario4", true, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got coin"}, - {"mario5", false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goomba stomp"}, + {"mario5", false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boot"}, {"mario6", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Jump"}, {"mario7", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire"}, {"mario8", false, 48, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"}, - {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collecting power-up"}, + {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Emerging"}, {"marioa", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, - {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp stomp"}, + {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp"}, // Black Eggman - {"bebomb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Bomb explosion"}, - {"bechrg", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Charging"}, + {"bebomb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Big explosion"}, + {"bechrg", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, {"becrsh", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Crash"}, {"bedeen", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic crash"}, {"bedie1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, @@ -252,11 +252,11 @@ sfxinfo_t S_sfx[NUMSFX] = {"befire", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing goop"}, {"beflap", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical jump"}, {"begoop", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful shot"}, - {"begrnd", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic hit"}, - {"behurt", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic crash"}, + {"begrnd", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic grinding"}, + {"behurt", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman shocked"}, {"bejet1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Jetpack charge"}, {"belnch", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical jump"}, - {"beoutb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Empty chamber"}, + {"beoutb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Failed shot"}, {"beragh", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman screaming"}, {"beshot", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing missile"}, {"bestep", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical stomp"}, @@ -265,7 +265,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"bewar2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, {"bewar3", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, {"bewar4", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman laughing"}, - {"bexpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Missile explosion"}, + {"bexpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, {"bgxpld", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, // Cybrakdemon @@ -280,20 +280,20 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k36", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Skid"}, {"s3k37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spiked"}, {"s3k38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bubble gasp"}, - {"s3k39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"}, - {"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Splash"}, + {"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Shield"}, {"s3k3b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drowning"}, - {"s3k3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning"}, + {"s3k3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spin"}, {"s3k3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, - {"s3k3e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire Shield"}, - {"s3k3f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water Shield"}, + {"s3k3e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flame Shield"}, + {"s3k3f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bubble Shield"}, {"s3k40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction zoom"}, - {"s3k41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning shield"}, + {"s3k41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning Shield"}, {"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Twinspin"}, {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire burst"}, {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning zap"}, - {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, + {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Transformation"}, {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising sand"}, {"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, {"s3k49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rock"}, @@ -306,13 +306,13 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k50", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Siren"}, {"s3k51", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling bomb"}, {"s3k52", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spike"}, - {"s3k53", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Charging"}, + {"s3k53", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, {"s3k54", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing"}, // MetalSonic shot fire - {"s3k55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Moving on track"}, - {"s3k56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3k57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water"}, + {"s3k55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical movement"}, + {"s3k56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Heavy landing"}, + {"s3k57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Splash"}, {"s3k58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical movement"}, - {"s3k59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing platform"}, + {"s3k59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crumbling"}, {"s3k5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aiming"}, {"s3k5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, {"s3k5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric spark"}, @@ -323,46 +323,46 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k61", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drilling"}, {"s3k62", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Jump"}, {"s3k63", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Starpost"}, - {"s3k64", false, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, + {"s3k64", false, 64, 2, -1, NULL, 0, -1, -1, LUMPERROR, "Clatter"}, {"s3k65", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got blue sphere"}, // Blue Spheres {"s3k66", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Special stage clear"}, {"s3k67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing missile"}, - {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super possibilities"}, + {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Unknown possibilities"}, {"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Switch click"}, {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Special stage clear"}, {"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting from the ground"}, + {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, {"s3k6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"s3k6e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical damage"}, {"s3k6f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, - {"s3k70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Seperation"}, - {"s3k71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, + {"s3k71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Basic Shield"}, {"s3k72", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, {"s3k73", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Warp"}, - {"s3k74", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical clink"}, + {"s3k74", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Gong"}, {"s3k75", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising"}, {"s3k76", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Click"}, {"s3k77", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Balloon pop"}, {"s3k78", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"}, {"s3k79", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric charge"}, {"s3k7a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising from lava"}, - {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper bounce"}, + {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, {"s3k7c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"}, {"s3k7d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Eating dirt"}, {"s3k7f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Freeze"}, {"s3k80", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ice spike burst"}, - {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing large object"}, - {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting from the ground"}, - {"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing bridge"}, - {"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3k85", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Releasing"}, + {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, + {"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, + {"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, + {"s3k85", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering down"}, {"s3k86", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Alarm"}, {"s3k87", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, - {"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, - {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sufficiently advanced tech."}, + {"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic squeak"}, + {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Advanced technology"}, {"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boing"}, - {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Chop"}, + {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thwack"}, {"s3k8c", 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, ""}, @@ -381,15 +381,15 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k9b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"}, {"s3k9c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Super Emerald"}, {"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Targeting"}, - {"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, - {"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"}, + {"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wham"}, + {"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Transformation"}, {"s3ka0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"}, {"s3ka1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"s3ka2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"}, {"s3ka3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lift"}, - {"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Robotic power up"}, + {"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, {"s3ka5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction failure"}, {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Countdown beep"}, {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, @@ -402,13 +402,13 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, {"s3kb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spring"}, {"s3kb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Failure"}, - {"s3kb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Big ring warp"}, + {"s3kb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Warp"}, {"s3kb4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, - {"s3kb5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"s3kb5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Clink"}, {"s3kb6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash launch"}, - {"s3kb7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rolling tumbler"}, + {"s3kb7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tumbler"}, {"s3kb8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling signpost"}, - {"s3kb9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spilled rings"}, + {"s3kb9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ring loss"}, {"s3kba", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flight"}, {"s3kbb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tired flight"}, {"s3kbcs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, @@ -440,8 +440,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kc9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Swinging"}, // ditto {"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, {"s3kcal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, // ditto - {"s3kcbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3kcbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // ditto + {"s3kcbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, + {"s3kcbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominuous rumbling"}, // ditto {"s3kccs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, {"s3kccl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, // ditto {"s3kcds", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, From ff97b3aed4d1c9e3e0cc830e77bb3973cf2b0c0a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 15:42:01 +0100 Subject: [PATCH 040/181] Alter offsets of HUD numbers a little bit to satisfy OCD (have discussed with Mystic, he offered a solution similar but not identical to what I am committing) --- src/st_stuff.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 4af3199a1..72655ed69 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -136,26 +136,26 @@ hudinfo_t hudinfo[NUMHUDITEMS] = { 38, 186}, // HUD_LIVESX { 16, 42}, // HUD_RINGS - { 220, 10}, // HUD_RINGSSPLIT - { 112, 42}, // HUD_RINGSNUM - { 288, 10}, // HUD_RINGSNUMSPLIT + { 228, 10}, // HUD_RINGSSPLIT + { 120, 42}, // HUD_RINGSNUM + { 296, 10}, // HUD_RINGSNUMSPLIT { 16, 10}, // HUD_SCORE - { 128, 10}, // HUD_SCORENUM + { 120, 10}, // HUD_SCORENUM { 16, 26}, // HUD_TIME - { 136, 10}, // HUD_TIMESPLIT - { 88, 26}, // HUD_MINUTES - { 188, 10}, // HUD_MINUTESSPLIT - { 88, 26}, // HUD_TIMECOLON - { 188, 10}, // HUD_TIMECOLONSPLIT - { 112, 26}, // HUD_SECONDS - { 212, 10}, // HUD_SECONDSSPLIT - { 112, 26}, // HUD_TIMETICCOLON - { 136, 26}, // HUD_TICS + { 144, 10}, // HUD_TIMESPLIT + { 96, 26}, // HUD_MINUTES + { 196, 10}, // HUD_MINUTESSPLIT + { 96, 26}, // HUD_TIMECOLON + { 196, 10}, // HUD_TIMECOLONSPLIT + { 120, 26}, // HUD_SECONDS + { 220, 10}, // HUD_SECONDSSPLIT + { 120, 26}, // HUD_TIMETICCOLON + { 144, 26}, // HUD_TICS - { 112, 56}, // HUD_SS_TOTALRINGS - { 288, 40}, // HUD_SS_TOTALRINGS_SPLIT + { 120, 56}, // HUD_SS_TOTALRINGS + { 296, 40}, // HUD_SS_TOTALRINGS_SPLIT { 110, 93}, // HUD_GETRINGS { 160, 93}, // HUD_GETRINGSNUM From 74169529fb99629b788ae006274f4afedfe4bf07 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 15:53:54 +0100 Subject: [PATCH 041/181] Correcting a ridiculous crash-causing oversight. --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 8e49247f1..133b4a08a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7842,7 +7842,7 @@ static void M_ToggleSFX(INT32 choice) case KEY_UPARROW: S_StartSound(NULL, sfx_menu1); - itemOn--; + itemOn = currentMenu->numitems-1; return; case KEY_ESCAPE: From c95fcab831e570cb1a091d05636103efa633819e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 15:55:07 +0100 Subject: [PATCH 042/181] Slight table update. --- src/sounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sounds.c b/src/sounds.c index 2edb2c204..2fb3f091d 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -393,7 +393,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Countdown beep"}, {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, - {"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper bounce"}, + {"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper"}, {"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash charge"}, {"s3kac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Continue"}, {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "GO!"}, From bec7a184f15722ac1b1f31a12b506bb222be4eee Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 17:16:21 +0100 Subject: [PATCH 043/181] Bweh heh heh. --- src/m_menu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/m_menu.c b/src/m_menu.c index 133b4a08a..85cd79638 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7470,6 +7470,7 @@ static void M_EraseDataResponse(INT32 ch) totalplaytime = 0; F_StartIntro(); } + S_StartSound(NULL, sfx_bewar1+M_RandomKey(3)); M_ClearMenus(true); } From 08e7a7cb4da522ac5db6de750771e2d1f3e78f99 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 18:15:42 +0100 Subject: [PATCH 044/181] Clean up captions code to allow for different numbers defined at compile time. --- src/s_sound.c | 19 +++++-------------- src/s_sound.h | 4 +++- src/screen.c | 4 ++-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 2add1cf94..181ca5a67 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -130,21 +130,12 @@ static consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL static channel_t *channels = NULL; static INT32 numofchannels = 0; -caption_t closedcaptions[8] = { - {NULL, NULL, 0}, - {NULL, NULL, 0}, - {NULL, NULL, 0}, - {NULL, NULL, 0}, - {NULL, NULL, 0}, - {NULL, NULL, 0}, - {NULL, NULL, 0}, - {NULL, NULL, 0} -}; +caption_t closedcaptions[NUMCAPTIONS]; void ResetCaptions(void) { UINT8 i; - for (i = 0; i < 8; i++) + for (i = 0; i < NUMCAPTIONS; i++) { closedcaptions[i].c = NULL; closedcaptions[i].s = NULL; @@ -593,7 +584,7 @@ dontplay: // Handle closed caption input. if (cv_closedcaptioning.value && sfx->caption[0] != '/') { - UINT8 i, set = 7, moveup = 255; + UINT8 i, set = NUMCAPTIONS-1, moveup = 255; boolean same = false; for (i = 0; i < set; i++) { @@ -617,7 +608,7 @@ dontplay: break; } } - for (i = 7; i > set; i--) + for (i = NUMCAPTIONS-1; i > set; i--) { if (sfx == closedcaptions[i].s) { @@ -630,7 +621,7 @@ dontplay: if (moveup != 255) { - for (i = moveup; i < 7; i++) + for (i = moveup; i < NUMCAPTIONS-1; i++) { if (!(closedcaptions[i].c || closedcaptions[i].s)) break; diff --git a/src/s_sound.h b/src/s_sound.h index 7e72d80e5..dc0dfaf69 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -85,7 +85,9 @@ typedef struct { UINT8 t; } caption_t; -extern caption_t closedcaptions[8]; +#define NUMCAPTIONS 8 + +extern caption_t closedcaptions[NUMCAPTIONS]; // register sound vars and commands at game startup void S_RegisterSoundStuff(void); diff --git a/src/screen.c b/src/screen.c index 223f0a494..12bb9c4bd 100644 --- a/src/screen.c +++ b/src/screen.c @@ -442,7 +442,7 @@ void SCR_ClosedCaptions(void) { UINT8 i; - for (i = 0; i < 8; i++) + for (i = 0; i < NUMCAPTIONS; i++) { boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); @@ -462,7 +462,7 @@ void SCR_ClosedCaptions(void) } } - for (i = 0; i < 8; i++) + for (i = 0; i < NUMCAPTIONS; i++) { if (closedcaptions[i].s) { From dd566b77b977620a8360d54f80588ad8931f37d0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 19:52:44 +0100 Subject: [PATCH 045/181] More improved sound names. --- src/sounds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index 2fb3f091d..3c19f0c23 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -153,7 +153,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goop sling"}, {"gravch", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Recycler"}, {"itemup", true, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Sparkle"}, - {"jet", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying jet"}, + {"jet", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Jet engine"}, {"jshard", true, 167, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got shard"}, {"lose" , false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Failure"}, {"lvpass", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning signpost"}, @@ -287,7 +287,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, {"s3k3e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flame Shield"}, {"s3k3f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bubble Shield"}, - {"s3k40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction zoom"}, + {"s3k40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction shot"}, {"s3k41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning Shield"}, {"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Twinspin"}, {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire burst"}, From 314870bdc28068579a5d82c90e9373f3a1ed413a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 22:21:16 +0100 Subject: [PATCH 046/181] Support captions for player 2 in 2-player. (You can't tell which screen the sounds are coming from without visual cues normally, so there isn't two seperate caption lists.) --- src/s_sound.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/screen.c | 15 ++++++++----- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 181ca5a67..3993d7f98 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -531,6 +531,64 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) sep = (~sep) & 255; #endif + // Handle closed caption input. + if (cv_closedcaptioning.value && sfx->caption[0] != '/') + { + UINT8 i, set = NUMCAPTIONS-1, moveup = 255; + boolean same = false; + for (i = 0; i < set; i++) + { + same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); + if (same) + { + set = i; + break; + } + } + + if (!same) + { + for (i = 0; i < set; i++) + { + if (!(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) + { + set = i; + if (closedcaptions[i].s && (sfx->priority >= closedcaptions[i].s->priority)) + moveup = i; + break; + } + } + for (i = NUMCAPTIONS-1; i > set; i--) + { + if (sfx == closedcaptions[i].s) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + } + } + } + + if (moveup != 255) + { + for (i = moveup; i < NUMCAPTIONS-1; i++) + { + if (!(closedcaptions[i].c || closedcaptions[i].s)) + break; + } + for (; i > set; i--) + { + closedcaptions[i].c = closedcaptions[i-1].c; + closedcaptions[i].s = closedcaptions[i-1].s; + closedcaptions[i].t = closedcaptions[i-1].t; + } + } + + closedcaptions[set].c = &channels[cnum]; + closedcaptions[set].s = sfx; + closedcaptions[set].t = TICRATE+2; + } + // Assigns the handle to one of the channels in the // mix/output buffer. channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); diff --git a/src/screen.c b/src/screen.c index 12bb9c4bd..ca1e6b659 100644 --- a/src/screen.c +++ b/src/screen.c @@ -478,11 +478,16 @@ void SCR_ClosedCaptions(void) const mobj_t *o = (const mobj_t *)closedcaptions[i].c->origin; if (o) { - angle_t angle = R_PointToAngle(o->x, o->y) - localangle; - if (angle > ANGLE_45 && angle < ANGLE_135) - dir = '\x1C'; - else if (angle > ANGLE_225 && angle < ANGLE_315) - dir = '\x1D'; + if (!splitscreen) + { + angle_t angle = R_PointToAngle(o->x, o->y) - localangle; + if (angle > ANGLE_45 && angle < ANGLE_135) + dir = '\x1C'; + else if (angle > ANGLE_225 && angle < ANGLE_315) + dir = '\x1D'; + else + dir = '\x1E'; + } else dir = '\x1E'; } From c8186644e73eb15b615421119734224f4355316e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 22:34:38 +0100 Subject: [PATCH 047/181] Improved splitscreen offsets. --- src/st_stuff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 72655ed69..80d963329 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -136,7 +136,7 @@ hudinfo_t hudinfo[NUMHUDITEMS] = { 38, 186}, // HUD_LIVESX { 16, 42}, // HUD_RINGS - { 228, 10}, // HUD_RINGSSPLIT + { 220, 10}, // HUD_RINGSSPLIT { 120, 42}, // HUD_RINGSNUM { 296, 10}, // HUD_RINGSNUMSPLIT @@ -144,13 +144,13 @@ hudinfo_t hudinfo[NUMHUDITEMS] = { 120, 10}, // HUD_SCORENUM { 16, 26}, // HUD_TIME - { 144, 10}, // HUD_TIMESPLIT + { 128, 10}, // HUD_TIMESPLIT { 96, 26}, // HUD_MINUTES - { 196, 10}, // HUD_MINUTESSPLIT + { 188, 10}, // HUD_MINUTESSPLIT { 96, 26}, // HUD_TIMECOLON - { 196, 10}, // HUD_TIMECOLONSPLIT + { 188, 10}, // HUD_TIMECOLONSPLIT { 120, 26}, // HUD_SECONDS - { 220, 10}, // HUD_SECONDSSPLIT + { 212, 10}, // HUD_SECONDSSPLIT { 120, 26}, // HUD_TIMETICCOLON { 144, 26}, // HUD_TICS From fbdc8d3d9eb95984fd534de56555a210f0b662b2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Apr 2017 22:41:23 +0100 Subject: [PATCH 048/181] MP pause menu text for Player setup loses the 1 if you're not in splitscreen --- src/m_menu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 85cd79638..04598adc8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -903,8 +903,8 @@ static menuitem_t MP_MainMenu[] = #endif {IT_CALL | IT_STRING, NULL, "TWO PLAYER GAME", M_StartSplitServerMenu, 60}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 1", M_SetupMultiPlayer, 80}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 2", M_SetupMultiPlayer2, 90}, + {IT_CALL | IT_STRING, NULL, "PLAYER 1 SETUP", M_SetupMultiPlayer, 80}, + {IT_CALL | IT_STRING, NULL, "PLAYER 2 SETUP", M_SetupMultiPlayer2, 90}, }; static menuitem_t MP_ServerMenu[] = @@ -2630,10 +2630,14 @@ void M_StartControlPanel(void) } if (splitscreen) + { MPauseMenu[mpause_psetupsplit].status = MPauseMenu[mpause_psetupsplit2].status = IT_STRING | IT_CALL; + MPauseMenu[mpause_psetup].text = "Player 1 Setup"; + } else { MPauseMenu[mpause_psetup].status = IT_STRING | IT_CALL; + MPauseMenu[mpause_psetup].text = "Player Setup"; if (G_GametypeHasTeams()) MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU; From 528132ad6d9e9edc8dd3f47b843160a5107d04e8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 12:32:06 +0100 Subject: [PATCH 049/181] Sound always happens on SoundOptions menu now. It was weird not having those. --- src/m_menu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 04598adc8..2e126e070 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2403,8 +2403,7 @@ boolean M_Responder(event_t *ev) if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS || (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR)) { - if (currentMenu != &OP_SoundOptionsDef) - S_StartSound(NULL, sfx_menu1); + S_StartSound(NULL, sfx_menu1); routine(0); } return true; @@ -2413,8 +2412,7 @@ boolean M_Responder(event_t *ev) if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS || (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR)) { - if (currentMenu != &OP_SoundOptionsDef) - S_StartSound(NULL, sfx_menu1); + S_StartSound(NULL, sfx_menu1); routine(1); } return true; @@ -7702,7 +7700,7 @@ static void M_DrawControl(void) } else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); - else if (currentMenu->menuitems[i].status == IT_HEADER) + else if ((currentMenu->menuitems[i].status == IT_HEADER) && (i != max-1)) M_DrawLevelPlatterHeader(y, currentMenu->menuitems[i].text, true); y += SMALLLINEHEIGHT; From e93e5176c03e7197b331b609930154f53705d49a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 12:32:30 +0100 Subject: [PATCH 050/181] Consistency in firing sound naming. --- src/sounds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index 3c19f0c23..e61aa3383 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -147,7 +147,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"drown", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Drowning"}, {"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Electric fizzle"}, {"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous beeping"}, // Grenade beep - {"wepfir", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon firing"}, // defaults to thok + {"wepfir", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing weapon"}, // defaults to thok {"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goop splash"}, {"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Splash"}, {"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Goop sling"}, @@ -162,9 +162,9 @@ sfxinfo_t S_sfx[NUMSFX] = {"monton", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Golden Monitor activated"}, {"pogo" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical pogo"}, {"pop" , false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, - {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Railgun fired"}, - {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Railgun crash"}, - {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Missile fired"}, + {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing rail"}, + {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crashing rail"}, + {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing laser"}, {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pity Shield"}, // generic GET! {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Whirlwind Shield"}, // Whirlwind GET! {"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Force Shield"}, // Force GET! From cf82ef1f79d779a2f74cb39341a38e359f172379 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 12:33:19 +0100 Subject: [PATCH 051/181] As requested by Mystic in That Topic, made the end-of-act time bonus for 30 seconds halved and removed the 45 seconds bonus option. --- src/y_inter.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index c4f425beb..ee7755bc9 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1556,8 +1556,7 @@ static void Y_SetTimeBonus(player_t *player, y_bonus_t *bstruct) // calculate time bonus secs = player->realtime / TICRATE; - if (secs < 30) /* :30 */ bonus = 100000; - else if (secs < 45) /* :45 */ bonus = 50000; + if (secs < 30) /* :30 */ bonus = 50000; else if (secs < 60) /* 1:00 */ bonus = 10000; else if (secs < 90) /* 1:30 */ bonus = 5000; else if (secs < 120) /* 2:00 */ bonus = 4000; From 8aa3928458f48a78bdec6320becf65a40ac8ccd3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 12:53:16 +0100 Subject: [PATCH 052/181] A consistency error I should've caught earlier, considering this sound is used for DSZ3's missiles as well as GFZ3's laser. --- src/sounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sounds.c b/src/sounds.c index e61aa3383..792e3650e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -164,7 +164,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"pop" , false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop"}, {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing rail"}, {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crashing rail"}, - {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing laser"}, + {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing"}, {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pity Shield"}, // generic GET! {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Whirlwind Shield"}, // Whirlwind GET! {"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Force Shield"}, // Force GET! From 39fa4fea4abae574296423379fc0148779f20832 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 15:57:52 +0100 Subject: [PATCH 053/181] * Update some sound names. * Make the continue and the flag capture use different sound numbers. * Make the fancy new race countdown go beep. --- src/p_user.c | 4 ++-- src/sounds.c | 8 ++++---- src/st_stuff.c | 8 ++++++++ src/y_inter.c | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7062ebee4..67adcdce2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1030,7 +1030,7 @@ void P_AddPlayerScore(player_t *player, UINT32 amount) players[i].continues += 1; players[i].gotcontinue = true; if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_flgcap); + S_StartSound(NULL, sfx_s3kac); } */ } } @@ -1050,7 +1050,7 @@ void P_AddPlayerScore(player_t *player, UINT32 amount) player->continues += 1; player->gotcontinue = true; if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_flgcap); + S_StartSound(NULL, sfx_s3kac); } } diff --git a/src/sounds.c b/src/sounds.c index 792e3650e..d9c65b603 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -64,7 +64,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"alarm", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Alarm"}, {"buzz1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric zap"}, {"buzz2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric zap"}, - {"buzz3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric zap"}, + {"buzz3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wacky worksurface"}, {"buzz4", false, 8, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Buzz"}, {"crumbl", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crumbling"}, // Platform Crumble Tails 03-16-2001 {"fire", false, 8, 32, -1, NULL, 0, -1, -1, LUMPERROR, "Flamethrower"}, @@ -137,7 +137,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"appear", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Appearing platform"}, {"bkpoof", false, 70, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Armageddon explosion"}, {"bnce1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, // Boing! - {"bnce2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ricochet"}, // Boing! + {"bnce2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Scatter"}, // Boing! {"cannon", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful shot"}, {"cgot" , true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Chaos Emerald"}, // Got Emerald! Tails 09-02-2001 {"cybdth", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, @@ -196,7 +196,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, {"dwnind", false, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thinking about air"}, {"emfind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Radar beep"}, - {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flag capture"}, + {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flag captured"}, {"menu1", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally"}, // Point tally is identical to menu for now @@ -223,7 +223,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"hoop2", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop+"}, {"hoop3", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hoop++"}, {"hidden", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Discovery"}, - {"prloop", false, 104, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Paraloop"}, + {"prloop", false, 104, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Gust of wind"}, {"timeup", true, 256, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous Countdown"}, // Mario diff --git a/src/st_stuff.c b/src/st_stuff.c index 80d963329..595b9e764 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1495,15 +1495,23 @@ static inline void ST_drawRaceHUD(void) { case 1: racenum = race3; + if (!bounce) + S_StartSound(0, sfx_s3ka7); break; case 2: racenum = race2; + if (!bounce) + S_StartSound(0, sfx_s3ka7); break; case 3: racenum = race1; + if (!bounce) + S_StartSound(0, sfx_s3ka7); break; default: racenum = racego; + if (!bounce) + S_StartSound(0, sfx_s3kad); break; } if (bounce < 3) diff --git a/src/y_inter.c b/src/y_inter.c index ee7755bc9..c730745d5 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -756,7 +756,7 @@ void Y_Ticker(void) if (intertic > tallydonetic) { endtic = intertic + 4*TICRATE; // 4 second pause after end of tally - S_StartSound(NULL, sfx_flgcap); // cha-ching! + S_StartSound(NULL, sfx_s3kac); // cha-ching! } return; } From 8e3a3e792e5d0c9ae4012f893bf51fc1715815fe Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 16:42:42 +0100 Subject: [PATCH 054/181] Moved the Race HUD down a little bit, and improved the sound selection. --- src/st_stuff.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 595b9e764..89902fdb9 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1488,34 +1488,30 @@ static inline void ST_drawRaceHUD(void) { if (leveltime >= TICRATE && leveltime < 5*TICRATE) { - INT32 height = (BASEVIDHEIGHT/2); + INT32 height = ((3*BASEVIDHEIGHT)>>2) - 8; INT32 bounce = (leveltime % TICRATE); patch_t *racenum; switch (leveltime/TICRATE) { case 1: racenum = race3; - if (!bounce) - S_StartSound(0, sfx_s3ka7); break; case 2: racenum = race2; - if (!bounce) - S_StartSound(0, sfx_s3ka7); break; case 3: racenum = race1; - if (!bounce) - S_StartSound(0, sfx_s3ka7); break; default: racenum = racego; - if (!bounce) - S_StartSound(0, sfx_s3kad); break; } if (bounce < 3) + { height -= (2 - bounce); + if (!bounce) + S_StartSound(0, ((racenum == racego) ? sfx_s3kad : sfx_s3ka7)); + } V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(racenum->width))/2), (INT32)(SCY(height)), V_NOSCALESTART, racenum); } From 6d7355e9af996e10cf68342f50a5c6186d3a0a20 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 17:45:23 +0100 Subject: [PATCH 055/181] Add score on Emerald Token pickup (and make the all-emerald bonus a continue in SP) as requested. --- src/p_inter.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index ff3718e67..6800a7d1f 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -571,10 +571,17 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; tokenlist += special->health; + P_AddPlayerScore(player, 1000); + if (ALL7EMERALDS(emeralds)) // Got all 7 { - P_GivePlayerRings(player, 50); - nummaprings += 50; // no cheating towards Perfect! + if (!(netgame || multiplayer)) + { + player->continues += 1; + players->gotcontinue = true; + if (P_IsLocalPlayer(player)) + S_StartSound(NULL, sfx_s3kac); + } } else token++; From e34e8f85e2fd875bfc960c44fa444e7a497a2e34 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 17:45:43 +0100 Subject: [PATCH 056/181] Including a statement about performance on the resolution menu. --- src/m_menu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 2e126e070..ba01ceaef 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8138,6 +8138,9 @@ static void M_DrawVideoMode(void) } else { + V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 104, + V_YELLOWMAP, "Larger modes may have performance issues."); + M_CentreText(OP_VideoModeDef.y + 116, va("Current mode is %c%dx%d", (SCR_IsAspectCorrect(vid.width, vid.height)) ? 0x83 : 0x80, From 83e16da83bb1a2e3be7ee8a5fd4a779797294fc8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 23:21:10 +0100 Subject: [PATCH 057/181] Introducing the Colour Cube! https://cdn.discordapp.com/attachments/293238104096112641/304015171385294850/aa.png Basically in preperation of supporting colourblindness modes I implemented the following link when loading palettes. http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter24.html This basically means I can do whatever the hell I want to the colour profile of incoming paletties, and nobody can stop me. Muahahahaha etc. Also, I added a saturation feature to show off its full potential, converted gamma from a table to a factor of the calculation, tweaked some menus and made the default value of cvars show up on sliders. Because that's how I roll. --- src/d_netcmd.c | 1 + src/m_menu.c | 74 +++++++++------ src/v_video.c | 251 +++++++++++++++++++++++++++++++------------------ src/v_video.h | 3 +- 4 files changed, 209 insertions(+), 120 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e328e90e0..5f0c82784 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -670,6 +670,7 @@ void D_RegisterClientCommands(void) // FIXME: not to be here.. but needs be done for config loading CV_RegisterVar(&cv_usegamma); + CV_RegisterVar(&cv_usesaturation); // m_menu.c CV_RegisterVar(&cv_crosshair); diff --git a/src/m_menu.c b/src/m_menu.c index ba01ceaef..283b76b88 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1166,36 +1166,38 @@ static menuitem_t OP_VideoOptionsMenu[] = { {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 0}, -#ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 5}, +#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) + {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 5}, #endif -#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 10}, +#ifdef HWRENDER + {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 10}, #endif {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_usegamma, 15}, - - {IT_STRING | IT_CVAR, NULL, "Display HUD", &cv_showhud, 25}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "HUD Transparency", &cv_translucenthud, 30}, - {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 35}, + NULL, "Saturation", &cv_usesaturation, 20}, + + {IT_STRING | IT_CVAR, NULL, "Display HUD", &cv_showhud, 30}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, + NULL, "HUD Transparency", &cv_translucenthud, 35}, + {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 40}, #ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "Show HUD player names", &cv_seenames, 40}, + {IT_STRING | IT_CVAR, NULL, "Show HUD player names", &cv_seenames, 45}, #endif - {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 50}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 55}, + {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 55}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 60}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 65}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 70}, - {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 75}, - {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 80}, + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 70}, + {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 75}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 80}, + {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 85}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90}, - {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw",&cv_homremoval, 95}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 95}, + {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw",&cv_homremoval, 100}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 105}, }; static menuitem_t OP_VideoModeMenu[] = @@ -2784,7 +2786,7 @@ void M_Init(void) #ifdef HWRENDER // Permanently hide some options based on render mode if (rendermode == render_soft) - OP_VideoOptionsMenu[1].status = IT_DISABLED; + OP_VideoOptionsMenu[2].status = IT_DISABLED; #endif #ifndef NONET @@ -2854,16 +2856,6 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) INT32 range; patch_t *p; - for (i = 0; cv->PossibleValue[i+1].strvalue; i++); - - range = ((cv->value - cv->PossibleValue[0].value) * 100 / - (cv->PossibleValue[i].value - cv->PossibleValue[0].value)); - - if (range < 0) - range = 0; - if (range > 100) - range = 100; - x = BASEVIDWIDTH - x - SLIDER_WIDTH; V_DrawScaledPatch(x, y, 0, W_CachePatchName("M_SLIDEL", PU_CACHE)); @@ -2877,6 +2869,30 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) // draw the slider cursor p = W_CachePatchName("M_SLIDEC", PU_CACHE); + + for (i = 0; cv->PossibleValue[i+1].strvalue; i++); + + if ((range = atoi(cv->defaultvalue)) != cv->value) + { + range = ((range - cv->PossibleValue[0].value) * 100 / + (cv->PossibleValue[i].value - cv->PossibleValue[0].value)); + + if (range < 0) + range = 0; + else if (range > 100) + range = 100; + + V_DrawMappedPatch(x + 2 + (SLIDER_RANGE*8*range)/100, y, V_TRANSLUCENT, p, yellowmap); + } + + range = ((cv->value - cv->PossibleValue[0].value) * 100 / + (cv->PossibleValue[i].value - cv->PossibleValue[0].value)); + + if (range < 0) + range = 0; + else if (range > 100) + range = 100; + V_DrawMappedPatch(x + 2 + (SLIDER_RANGE*8*range)/100, y, 0, p, yellowmap); } diff --git a/src/v_video.c b/src/v_video.c index e4d079c73..931ec711f 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -38,12 +38,15 @@ UINT8 *screens[5]; // screens[3] = fade screen start // screens[4] = fade screen end, postimage tempoarary buffer -static CV_PossibleValue_t gamma_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}}; +static CV_PossibleValue_t gamma_cons_t[] = {{-5, "MIN"}, {5, "MAX"}, {0, NULL}}; static void CV_usegamma_OnChange(void); consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_usegamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t saturation_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; +consvar_t cv_usesaturation = {"saturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL}; + static CV_PossibleValue_t constextsize_cons_t[] = { {V_NOSCALEPATCH, "Small"}, {V_SMALLSCALEPATCH, "Medium"}, {V_MEDSCALEPATCH, "Large"}, {0, "Huge"}, {0, NULL}}; @@ -81,97 +84,123 @@ static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NUL consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif -const UINT8 gammatable[5][256] = -{ - {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, - 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, - 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48, - 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64, - 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80, - 81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96, - 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112, - 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}, - - {2,4,5,7,8,10,11,12,14,15,16,18,19,20,21,23,24,25,26,27,29,30,31, - 32,33,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,54,55, - 56,57,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,77, - 78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98, - 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114, - 115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,129, - 130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145, - 146,147,148,148,149,150,151,152,153,154,155,156,157,158,159,160, - 161,162,163,163,164,165,166,167,168,169,170,171,172,173,174,175, - 175,176,177,178,179,180,181,182,183,184,185,186,186,187,188,189, - 190,191,192,193,194,195,196,196,197,198,199,200,201,202,203,204, - 205,205,206,207,208,209,210,211,212,213,214,214,215,216,217,218, - 219,220,221,222,222,223,224,225,226,227,228,229,230,230,231,232, - 233,234,235,236,237,237,238,239,240,241,242,243,244,245,245,246, - 247,248,249,250,251,252,252,253,254,255}, - - {4,7,9,11,13,15,17,19,21,22,24,26,27,29,30,32,33,35,36,38,39,40,42, - 43,45,46,47,48,50,51,52,54,55,56,57,59,60,61,62,63,65,66,67,68,69, - 70,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93, - 94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,112, - 113,114,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128, - 129,130,131,132,133,133,134,135,136,137,138,139,140,141,142,143,144, - 144,145,146,147,148,149,150,151,152,153,153,154,155,156,157,158,159, - 160,160,161,162,163,164,165,166,166,167,168,169,170,171,172,172,173, - 174,175,176,177,178,178,179,180,181,182,183,183,184,185,186,187,188, - 188,189,190,191,192,193,193,194,195,196,197,197,198,199,200,201,201, - 202,203,204,205,206,206,207,208,209,210,210,211,212,213,213,214,215, - 216,217,217,218,219,220,221,221,222,223,224,224,225,226,227,228,228, - 229,230,231,231,232,233,234,235,235,236,237,238,238,239,240,241,241, - 242,243,244,244,245,246,247,247,248,249,250,251,251,252,253,254,254, - 255}, - - {8,12,16,19,22,24,27,29,31,34,36,38,40,41,43,45,47,49,50,52,53,55, - 57,58,60,61,63,64,65,67,68,70,71,72,74,75,76,77,79,80,81,82,84,85, - 86,87,88,90,91,92,93,94,95,96,98,99,100,101,102,103,104,105,106,107, - 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124, - 125,126,127,128,129,130,131,132,133,134,135,135,136,137,138,139,140, - 141,142,143,143,144,145,146,147,148,149,150,150,151,152,153,154,155, - 155,156,157,158,159,160,160,161,162,163,164,165,165,166,167,168,169, - 169,170,171,172,173,173,174,175,176,176,177,178,179,180,180,181,182, - 183,183,184,185,186,186,187,188,189,189,190,191,192,192,193,194,195, - 195,196,197,197,198,199,200,200,201,202,202,203,204,205,205,206,207, - 207,208,209,210,210,211,212,212,213,214,214,215,216,216,217,218,219, - 219,220,221,221,222,223,223,224,225,225,226,227,227,228,229,229,230, - 231,231,232,233,233,234,235,235,236,237,237,238,238,239,240,240,241, - 242,242,243,244,244,245,246,246,247,247,248,249,249,250,251,251,252, - 253,253,254,254,255}, - - {16,23,28,32,36,39,42,45,48,50,53,55,57,60,62,64,66,68,69,71,73,75,76, - 78,80,81,83,84,86,87,89,90,92,93,94,96,97,98,100,101,102,103,105,106, - 107,108,109,110,112,113,114,115,116,117,118,119,120,121,122,123,124, - 125,126,128,128,129,130,131,132,133,134,135,136,137,138,139,140,141, - 142,143,143,144,145,146,147,148,149,150,150,151,152,153,154,155,155, - 156,157,158,159,159,160,161,162,163,163,164,165,166,166,167,168,169, - 169,170,171,172,172,173,174,175,175,176,177,177,178,179,180,180,181, - 182,182,183,184,184,185,186,187,187,188,189,189,190,191,191,192,193, - 193,194,195,195,196,196,197,198,198,199,200,200,201,202,202,203,203, - 204,205,205,206,207,207,208,208,209,210,210,211,211,212,213,213,214, - 214,215,216,216,217,217,218,219,219,220,220,221,221,222,223,223,224, - 224,225,225,226,227,227,228,228,229,229,230,230,231,232,232,233,233, - 234,234,235,235,236,236,237,237,238,239,239,240,240,241,241,242,242, - 243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,251, - 251,252,252,253,254,254,255,255} -}; - // local copy of the palette for V_GetColor() RGBA_t *pLocalPalette = NULL; +/* +The following was an extremely helpful resource when developing my Colour Cube LUT. +http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter24.html +Please check it out if you're trying to maintain this. +toast 18/04/17 +*/ + +float Cubepal[2][2][2][3]; + +// returns whether to apply cube, selectively avoiding expensive operations +static boolean InitCube(void) +{ + boolean apply = false; + UINT8 q; + float working[2][2][2][3] = // the initial positions of the corners of the colour cube! + { + { + { + {0.0, 0.0, 0.0}, // black corner + {1.0, 0.0, 0.0} // red corner + }, + { + {0.0, 1.0, 0.0}, // green corner + {1.0, 1.0, 0.0} // yellow corner + } + }, + { + { + {0.0, 0.0, 1.0}, // blue corner + {1.0, 0.0, 1.0} // magenta corner + }, + { + {0.0, 1.0, 1.0}, // cyan corner + {1.0, 1.0, 1.0} // white corner + } + } + }; + + if (cv_usegamma.value) + { +#define gammascale 8 + float gammamul = (255 - (gammascale*abs(cv_usegamma.value)))/255.0; + float gammaoffs = ((cv_usegamma.value > 0) ? ((gammascale*cv_usegamma.value)/255.0) : 0.0); +#undef gammascale + + apply = true; + + #define dogamma(i, j, k, l) \ + working[i][j][k][l]*= gammamul;\ + working[i][j][k][l] += gammaoffs + for (q = 0; q < 3; q++) + { + dogamma(0, 0, 0, q); + dogamma(1, 0, 0, q); + dogamma(0, 1, 0, q); + dogamma(1, 1, 0, q); + dogamma(0, 0, 1, q); + dogamma(1, 0, 1, q); + dogamma(0, 1, 1, q); + dogamma(1, 1, 1, q); + } +#undef dogamma + } + + if (cv_usesaturation.value != 10) + { + float desatur[3] = {0.33, 0.33, 0.33}; // grey + float work = (cv_usesaturation.value/10.0); + + apply = true; + +#define dosaturation(a, e) a = ((1 - work)*e + work*a) + for (q = 0; q < 3; q++) + { + dosaturation(working[0][0][1][q], desatur[q]); + dosaturation(working[0][1][0][q], desatur[q]); + dosaturation(working[1][0][0][q], desatur[q]); + + dosaturation(working[1][1][0][q], 2*desatur[q]); + dosaturation(working[1][0][1][q], 2*desatur[q]); + dosaturation(working[0][1][1][q], 2*desatur[q]); + } +#undef dosaturation + } + + if (!apply) + return false; + +#define dowork(i, j, k, l) \ + if (working[i][j][k][l] > 1.0)\ + working[i][j][k][l] = 1.0;\ + else if (working[i][j][k][l] < 0.0)\ + working[i][j][k][l] = 0.0;\ + Cubepal[i][j][k][l] = working[i][j][k][l] + for (q = 0; q < 3; q++) + { + dowork(0, 0, 0, q); + dowork(1, 0, 0, q); + dowork(0, 1, 0, q); + dowork(1, 1, 0, q); + dowork(0, 0, 1, q); + dowork(1, 0, 1, q); + dowork(0, 1, 1, q); + dowork(1, 1, 1, q); + } +#undef dowork + + return true; +} + // keep a copy of the palette so that we can get the RGB value for a color index at any time. static void LoadPalette(const char *lumpname) { - const UINT8 *usegamma = gammatable[cv_usegamma.value]; + boolean cube = InitCube(); lumpnum_t lumpnum = W_GetNumForName(lumpname); size_t i, palsize = W_LumpLength(lumpnum)/3; UINT8 *pal; @@ -183,10 +212,54 @@ static void LoadPalette(const char *lumpname) pal = W_CacheLumpNum(lumpnum, PU_CACHE); for (i = 0; i < palsize; i++) { - pLocalPalette[i].s.red = usegamma[*pal++]; - pLocalPalette[i].s.green = usegamma[*pal++]; - pLocalPalette[i].s.blue = usegamma[*pal++]; + pLocalPalette[i].s.red = *pal++; + pLocalPalette[i].s.green = *pal++; + pLocalPalette[i].s.blue = *pal++; pLocalPalette[i].s.alpha = 0xFF; + + // lerp of colour cubing! + if (cube) + { + float working[4][3]; + float linear; + UINT8 q; + + linear = (pLocalPalette[i].s.red/255.0); +#define dolerp(e1, e2) ((1 - linear)*e1 + linear*e2) + for (q = 0; q < 3; q++) + { + working[0][q] = dolerp(Cubepal[0][0][0][q], Cubepal[1][0][0][q]); + working[1][q] = dolerp(Cubepal[0][1][0][q], Cubepal[1][1][0][q]); + working[2][q] = dolerp(Cubepal[0][0][1][q], Cubepal[1][0][1][q]); + working[3][q] = dolerp(Cubepal[0][1][1][q], Cubepal[1][1][1][q]); + } + linear = (pLocalPalette[i].s.green/255.0); + for (q = 0; q < 3; q++) + { + working[0][q] = dolerp(working[0][q], working[1][q]); + working[1][q] = dolerp(working[2][q], working[3][q]); + } + linear = (pLocalPalette[i].s.blue/255.0); + for (q = 0; q < 3; q++) + { + working[0][q] = 255*dolerp(working[0][q], working[1][q]); + if (working[0][q] > 255.0) + working[0][q] = 255.0; + else if (working[0][q] < 0.0) + working[0][q] = 0.0; + } +#undef dowork + + /* + I don't know what I messed up such that red takes index 2 and blue takes index 0. + It should be the other way around, but I've just got this working after spending + hours on it and I'm not going to look a gift ho(rse/t)fix in the mouth. + toast 18/04/17 + */ + pLocalPalette[i].s.red = (UINT8)(working[0][2]); + pLocalPalette[i].s.green = (UINT8)(working[0][1]); + pLocalPalette[i].s.blue = (UINT8)(working[0][0]); + } } } diff --git a/src/v_video.h b/src/v_video.h index 0c9e289d0..f1761162f 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -27,8 +27,7 @@ extern UINT8 *screens[5]; -extern const UINT8 gammatable[5][256]; -extern consvar_t cv_ticrate, cv_usegamma, cv_constextsize; +extern consvar_t cv_ticrate, cv_usegamma, cv_usesaturation, cv_constextsize; // Allocates buffer screens, call before R_Init. void V_Init(void); From c2edd6224da250d251013a10495403d3af1ed074 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 23:38:38 +0100 Subject: [PATCH 058/181] Figured out what was up. I didn't quite understand my original array! --- src/v_video.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 931ec711f..b2ba0a40e 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -106,20 +106,20 @@ static boolean InitCube(void) { { {0.0, 0.0, 0.0}, // black corner - {1.0, 0.0, 0.0} // red corner + {0.0, 0.0, 1.0} // blue corner }, { - {0.0, 1.0, 0.0}, // green corner - {1.0, 1.0, 0.0} // yellow corner + {0.0, 1.0, 0.0}, // greem corner + {0.0, 1.0, 1.0} // cyan corner } }, { { - {0.0, 0.0, 1.0}, // blue corner + {1.0, 0.0, 0.0}, // red corner {1.0, 0.0, 1.0} // magenta corner }, { - {0.0, 1.0, 1.0}, // cyan corner + {1.0, 1.0, 0.0}, // yellow corner {1.0, 1.0, 1.0} // white corner } } @@ -250,15 +250,9 @@ static void LoadPalette(const char *lumpname) } #undef dowork - /* - I don't know what I messed up such that red takes index 2 and blue takes index 0. - It should be the other way around, but I've just got this working after spending - hours on it and I'm not going to look a gift ho(rse/t)fix in the mouth. - toast 18/04/17 - */ - pLocalPalette[i].s.red = (UINT8)(working[0][2]); + pLocalPalette[i].s.red = (UINT8)(working[0][0]); pLocalPalette[i].s.green = (UINT8)(working[0][1]); - pLocalPalette[i].s.blue = (UINT8)(working[0][0]); + pLocalPalette[i].s.blue = (UINT8)(working[0][2]); } } } From 9b13caccae4e298b7ee99035e679f08fec5519f2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 18 Apr 2017 23:40:57 +0100 Subject: [PATCH 059/181] greem --- src/v_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index b2ba0a40e..522f3eda9 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -109,7 +109,7 @@ static boolean InitCube(void) {0.0, 0.0, 1.0} // blue corner }, { - {0.0, 1.0, 0.0}, // greem corner + {0.0, 1.0, 0.0}, // green corner {0.0, 1.0, 1.0} // cyan corner } }, From c3840ba01d866d257434b2abdad40ef3b0cb581f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 19 Apr 2017 22:24:28 +0100 Subject: [PATCH 060/181] Colour Cube Calibration Menu! (called "Advanced Color Settings" because No Fun Allowed...) https://cdn.discordapp.com/attachments/237798387070664724/304343382073933824/aa.png Also, a "Reset all" button for the Monitor toggle menu, a ton of new cvars to match up with the colour cube calibration, and a bunch of variable renames related to colour cube operations. --- src/d_netcmd.c | 25 ++++- src/m_menu.c | 260 +++++++++++++++++++++++++++++++++++++++++-------- src/v_video.c | 181 +++++++++++++++++++++++++++------- src/v_video.h | 6 +- 4 files changed, 391 insertions(+), 81 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5f0c82784..6d9705b40 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -669,8 +669,29 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_resetmusic); // FIXME: not to be here.. but needs be done for config loading - CV_RegisterVar(&cv_usegamma); - CV_RegisterVar(&cv_usesaturation); + CV_RegisterVar(&cv_globalgamma); + CV_RegisterVar(&cv_globalsaturation); + + CV_RegisterVar(&cv_rhue); + CV_RegisterVar(&cv_yhue); + CV_RegisterVar(&cv_ghue); + CV_RegisterVar(&cv_chue); + CV_RegisterVar(&cv_bhue); + CV_RegisterVar(&cv_mhue); + + CV_RegisterVar(&cv_rgamma); + CV_RegisterVar(&cv_ygamma); + CV_RegisterVar(&cv_ggamma); + CV_RegisterVar(&cv_cgamma); + CV_RegisterVar(&cv_bgamma); + CV_RegisterVar(&cv_mgamma); + + CV_RegisterVar(&cv_rsaturation); + CV_RegisterVar(&cv_ysaturation); + CV_RegisterVar(&cv_gsaturation); + CV_RegisterVar(&cv_csaturation); + CV_RegisterVar(&cv_bsaturation); + CV_RegisterVar(&cv_msaturation); // m_menu.c CV_RegisterVar(&cv_crosshair); diff --git a/src/m_menu.c b/src/m_menu.c index 283b76b88..8dfc2ee0a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -315,7 +315,7 @@ static void M_AssignJoystick(INT32 choice); static void M_ChangeControl(INT32 choice); // Video & Sound -menu_t OP_VideoOptionsDef, OP_VideoModeDef; +menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef; #ifdef HWRENDER menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef; #endif @@ -353,6 +353,7 @@ static void M_DrawSetupChoosePlayerMenu(void); static void M_DrawControl(void); static void M_DrawMainVideoMenu(void); static void M_DrawVideoMode(void); +static void M_DrawColorMenu(void); static void M_DrawSoundMenu(void); static void M_DrawMonitorToggles(void); #ifdef HWRENDER @@ -387,6 +388,8 @@ static void M_HandleFogColor(INT32 choice); #endif static void M_HandleVideoMode(INT32 choice); +static void M_ResetCvars(void); + // Consvar onchange functions static void Newgametype_OnChange(void); static void Dummymares_OnChange(void); @@ -1164,40 +1167,39 @@ static menuitem_t OP_Mouse2OptionsMenu[] = static menuitem_t OP_VideoOptionsMenu[] = { - {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 0}, + {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 0}, #if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 5}, + {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 5}, #endif #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 10}, + {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 10}, #endif - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Brightness", &cv_usegamma, 15}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Saturation", &cv_usesaturation, 20}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_globalgamma, 15}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_globalsaturation, 20}, + {IT_SUBMENU|IT_STRING, NULL, "Advanced Color Settings...", &OP_ColorOptionsDef, 25}, - {IT_STRING | IT_CVAR, NULL, "Display HUD", &cv_showhud, 30}, + {IT_STRING | IT_CVAR, NULL, "Display HUD", &cv_showhud, 35}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "HUD Transparency", &cv_translucenthud, 35}, - {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 40}, + NULL, "HUD Transparency", &cv_translucenthud, 40}, + {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 45}, #ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "Show HUD player names", &cv_seenames, 45}, + {IT_STRING | IT_CVAR, NULL, "Show HUD player names", &cv_seenames, 50}, #endif - {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 55}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 60}, + {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 60}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 65}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 70}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 75}, - {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 80}, - {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 85}, + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 75}, + {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 80}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 85}, + {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 90}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 95}, - {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw",&cv_homremoval, 100}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 105}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 100}, + {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 105}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 110}, }; static menuitem_t OP_VideoModeMenu[] = @@ -1205,6 +1207,47 @@ static menuitem_t OP_VideoModeMenu[] = {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleVideoMode, 0}, // dummy menuitem for the control func }; +static menuitem_t OP_ColorOptionsMenu[] = +{ + {IT_STRING | IT_CALL, NULL, "Reset all", M_ResetCvars, 0}, + + {IT_HEADER, NULL, "Red", NULL, 9}, + {IT_DISABLED, NULL, NULL, NULL, 35}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Hue", &cv_rhue, 15}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_rsaturation, 20}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_rgamma, 25}, + + {IT_HEADER, NULL, "Yellow", NULL, 34}, + {IT_DISABLED, NULL, NULL, NULL, 73}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Hue", &cv_yhue, 40}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_ysaturation, 45}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_ygamma, 50}, + + {IT_HEADER, NULL, "Green", NULL, 59}, + {IT_DISABLED, NULL, NULL, NULL, 112}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Hue", &cv_ghue, 65}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_gsaturation, 70}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_ggamma, 75}, + + {IT_HEADER, NULL, "Cyan", NULL, 84}, + {IT_DISABLED, NULL, NULL, NULL, 255}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Hue", &cv_chue, 90}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_csaturation, 95}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_cgamma, 100}, + + {IT_HEADER, NULL, "Blue", NULL, 109}, + {IT_DISABLED, NULL, NULL, NULL, 152}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Hue", &cv_bhue, 115}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_bsaturation, 120}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_bgamma, 125}, + + {IT_HEADER, NULL, "Magenta", NULL, 134}, + {IT_DISABLED, NULL, NULL, NULL, 181}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Hue", &cv_mhue, 140}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_msaturation, 145}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_mgamma, 150}, +}; + #ifdef HWRENDER static menuitem_t OP_OpenGLOptionsMenu[] = { @@ -1360,18 +1403,19 @@ static menuitem_t OP_ServerOptionsMenu[] = static menuitem_t OP_MonitorToggleMenu[] = { // Printing handled by drawing function - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Recycler", &cv_recycler, 20}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Teleporters", &cv_teleporters, 30}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Ring", &cv_superring, 40}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Sneakers", &cv_supersneakers, 50}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Invincibility", &cv_invincibility, 60}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Jump Shield", &cv_jumpshield, 70}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Elemental Shield", &cv_watershield, 80}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Attraction Shield", &cv_ringshield, 90}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Force Shield", &cv_forceshield, 100}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Armageddon Shield", &cv_bombshield, 110}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "1 Up", &cv_1up, 120}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Eggman Box", &cv_eggmanbox, 130}, + {IT_STRING|IT_CALL, NULL, "Reset all", M_ResetCvars, 15}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Recycler", &cv_recycler, 30}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Teleporters", &cv_teleporters, 40}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Ring", &cv_superring, 50}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Sneakers", &cv_supersneakers, 60}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Invincibility", &cv_invincibility, 70}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Jump Shield", &cv_jumpshield, 80}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Elemental Shield", &cv_watershield, 90}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Attraction Shield", &cv_ringshield, 100}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Force Shield", &cv_forceshield, 110}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Armageddon Shield", &cv_bombshield, 120}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "1 Up", &cv_1up, 130}, + {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Eggman Box", &cv_eggmanbox, 140}, }; // ========================================================================== @@ -1721,6 +1765,17 @@ menu_t OP_VideoModeDef = 0, NULL }; +menu_t OP_ColorOptionsDef = +{ + "M_VIDEO", + sizeof (OP_ColorOptionsMenu)/sizeof (menuitem_t), + &OP_VideoOptionsDef, + OP_ColorOptionsMenu, + M_DrawColorMenu, + 30, 30, + 0, + NULL +}; menu_t OP_SoundOptionsDef = { "M_SOUND", @@ -2099,6 +2154,19 @@ static boolean M_ChangeStringCvar(INT32 choice) return false; } +// resets all cvars on a menu - assumes that all that have itemactions are cvars +static void M_ResetCvars(void) +{ + INT32 i; + consvar_t *cv; + for (i = 0; i < currentMenu->numitems; i++) + { + if (!(currentMenu->menuitems[i].status & IT_CVAR) || !(cv = (consvar_t *)currentMenu->menuitems[i].itemaction)) + continue; + CV_SetValue(cv, atoi(cv->defaultvalue)); + } +} + static void M_NextOpt(void) { INT16 oldItemOn = itemOn; // prevent infinite loop @@ -2303,7 +2371,7 @@ boolean M_Responder(event_t *ev) return true; case KEY_F11: // Gamma Level - CV_AddValue(&cv_usegamma, 1); + CV_AddValue(&cv_globalgamma, 1); return true; // Spymode on F12 handled in game logic @@ -3205,13 +3273,13 @@ static void M_DrawGenericScrollMenu(void) for (i = 0; i < currentMenu->numitems; i++) { - if (currentMenu->menuitems[i].alphaKey*2 + tempcentery >= currentMenu->y) + if (currentMenu->menuitems[i].status != IT_DISABLED && currentMenu->menuitems[i].alphaKey*2 + tempcentery >= currentMenu->y) break; } for (max = currentMenu->numitems; max > 0; max--) { - if (currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) + if (currentMenu->menuitems[max-1].status != IT_DISABLED && currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) break; } @@ -3296,8 +3364,6 @@ static void M_DrawGenericScrollMenu(void) W_CachePatchName("M_CURSOR", PU_CACHE)); } -#undef scrollareaheight - static void M_DrawPauseMenu(void) { if (!netgame && !multiplayer && (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)) @@ -4068,7 +4134,6 @@ void M_DrawLevelPlatterHeader(INT32 y, const char *header, boolean headerhighlig { V_DrawFill(19, y, 282, 1, 26); } - y += 2; } static void M_DrawLevelPlatterWideMap(UINT8 row, UINT8 col, INT32 x, INT32 y, boolean highlight) @@ -8182,6 +8247,117 @@ static void M_DrawVideoMode(void) W_CachePatchName("M_CURSOR", PU_CACHE)); } +// Just M_DrawGenericScrollMenu but showing a backing behind the headers. +static void M_DrawColorMenu(void) +{ + INT32 x, y, i, max, tempcentery, cursory = 0; + + // DRAW MENU + x = currentMenu->x; + y = currentMenu->y; + + if ((currentMenu->menuitems[itemOn].alphaKey*2 - currentMenu->menuitems[0].alphaKey*2) <= scrollareaheight) + tempcentery = currentMenu->y - currentMenu->menuitems[0].alphaKey*2; + else if ((currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 - currentMenu->menuitems[itemOn].alphaKey*2) <= scrollareaheight) + tempcentery = currentMenu->y - currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 + 2*scrollareaheight; + else + tempcentery = currentMenu->y - currentMenu->menuitems[itemOn].alphaKey*2 + scrollareaheight; + + for (i = 0; i < currentMenu->numitems; i++) + { + if (currentMenu->menuitems[i].status != IT_DISABLED && currentMenu->menuitems[i].alphaKey*2 + tempcentery >= currentMenu->y) + break; + } + + for (max = currentMenu->numitems; max > 0; max--) + { + if (currentMenu->menuitems[max].status != IT_DISABLED && currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) + break; + } + + if (i) + V_DrawString(currentMenu->x - 20, currentMenu->y, V_YELLOWMAP, "\x1A"); // up arrow + if (max != currentMenu->numitems) + V_DrawString(currentMenu->x - 20, currentMenu->y + 2*scrollareaheight, V_YELLOWMAP, "\x1B"); // down arrow + + // draw title (or big pic) + M_DrawMenuTitle(); + + for (; i < max; i++) + { + y = currentMenu->menuitems[i].alphaKey*2 + tempcentery; + if (i == itemOn) + cursory = y; + switch (currentMenu->menuitems[i].status & IT_DISPLAY) + { + case IT_PATCH: + case IT_DYBIGSPACE: + case IT_BIGSLIDER: + case IT_STRING2: + case IT_DYLITLSPACE: + case IT_GRAYPATCH: + case IT_TRANSTEXT2: + // unsupported + break; + case IT_NOTHING: + break; + case IT_STRING: + case IT_WHITESTRING: + if (i != itemOn && (currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) + V_DrawString(x, y, 0, currentMenu->menuitems[i].text); + else + V_DrawString(x, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + + // Cvar specific handling + switch (currentMenu->menuitems[i].status & IT_TYPE) + case IT_CVAR: + { + consvar_t *cv = (consvar_t *)currentMenu->menuitems[i].itemaction; + switch (currentMenu->menuitems[i].status & IT_CVARTYPE) + { + case IT_CV_SLIDER: + M_DrawSlider(x, y, cv); + case IT_CV_NOPRINT: // color use this + case IT_CV_INVISSLIDER: // monitor toggles use this + break; + case IT_CV_STRING: + if (y + 12 > (currentMenu->y + 2*scrollareaheight)) + break; + M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); + V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string); + if (skullAnimCounter < 4 && i == itemOn) + V_DrawCharacter(x + 8 + V_StringWidth(cv->string, 0), y + 12, + '_' | 0x80, false); + y += 16; + break; + default: + V_DrawRightAlignedString(BASEVIDWIDTH - x, y, + ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : V_YELLOWMAP), cv->string); + break; + } + break; + } + break; + case IT_TRANSTEXT: + V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + break; + case IT_QUESTIONMARKS: + V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); + break; + case IT_HEADERTEXT: + //V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + V_DrawFill(19, y, 281, 9, currentMenu->menuitems[i+1].alphaKey); + V_DrawFill(300, y, 1, 9, 26); + M_DrawLevelPlatterHeader(y - (lsheadingheight - 12), currentMenu->menuitems[i].text, false); + break; + } + } + + // DRAW THE SKULL CURSOR + V_DrawScaledPatch(currentMenu->x - 24, cursory, 0, + W_CachePatchName("M_CURSOR", PU_CACHE)); +} + // special menuitem key handler for video mode list static void M_HandleVideoMode(INT32 ch) { @@ -8270,7 +8446,8 @@ static void M_DrawMonitorToggles(void) // Assumes all are cvar type. for (i = 0; i < currentMenu->numitems; ++i) { - cv = (consvar_t *)currentMenu->menuitems[i].itemaction; + if (!(currentMenu->menuitems[i].status & IT_CVAR) || !(cv = (consvar_t *)currentMenu->menuitems[i].itemaction)) + continue; sum += cv->value; if (!CV_IsSetToDefault(cv)) @@ -8279,7 +8456,8 @@ static void M_DrawMonitorToggles(void) for (i = 0; i < currentMenu->numitems; ++i) { - cv = (consvar_t *)currentMenu->menuitems[i].itemaction; + if (!(currentMenu->menuitems[i].status & IT_CVAR) || !(cv = (consvar_t *)currentMenu->menuitems[i].itemaction)) + continue; y = currentMenu->y + currentMenu->menuitems[i].alphaKey; M_DrawSlider(currentMenu->x + 20, y, cv); diff --git a/src/v_video.c b/src/v_video.c index 522f3eda9..9e6a2745e 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -38,14 +38,39 @@ UINT8 *screens[5]; // screens[3] = fade screen start // screens[4] = fade screen end, postimage tempoarary buffer -static CV_PossibleValue_t gamma_cons_t[] = {{-5, "MIN"}, {5, "MAX"}, {0, NULL}}; -static void CV_usegamma_OnChange(void); - consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_usegamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL}; + +static void CV_palette_OnChange(void); + +static CV_PossibleValue_t gamma_cons_t[] = {{-15, "MIN"}, {5, "MAX"}, {0, NULL}}; +consvar_t cv_globalgamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t saturation_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; -consvar_t cv_usesaturation = {"saturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_globalsaturation = {"saturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; + +#define huecoloursteps 4 + +static CV_PossibleValue_t hue_cons_t[] = {{0, "MIN"}, {(huecoloursteps*6)-1, "MAX"}, {0, NULL}}; +consvar_t cv_rhue = {"rhue", "0", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_yhue = {"yhue", "4", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ghue = {"ghue", "8", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_chue = {"chue", "12", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_bhue = {"bhue", "16", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mhue = {"mhue", "20", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; + +consvar_t cv_rgamma = {"rgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ygamma = {"ygamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ggamma = {"ggamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cgamma = {"cgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_bgamma = {"bgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mgamma = {"mgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; + +consvar_t cv_rsaturation = {"rsaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ysaturation = {"ysaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_gsaturation = {"gsaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_csaturation = {"csaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_bsaturation = {"bsaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_msaturation = {"msaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t constextsize_cons_t[] = { {V_NOSCALEPATCH, "Small"}, {V_SMALLSCALEPATCH, "Medium"}, {V_MEDSCALEPATCH, "Large"}, {0, "Huge"}, @@ -124,54 +149,136 @@ static boolean InitCube(void) } } }; + float desatur[3]; // grey + float globalgammamul, globalgammaoffs; + boolean doinggamma; + +#define diffcons(cv) (cv.value != atoi(cv.defaultvalue)) + + doinggamma = diffcons(cv_globalgamma); - if (cv_usegamma.value) - { #define gammascale 8 - float gammamul = (255 - (gammascale*abs(cv_usegamma.value)))/255.0; - float gammaoffs = ((cv_usegamma.value > 0) ? ((gammascale*cv_usegamma.value)/255.0) : 0.0); -#undef gammascale + globalgammamul = (cv_globalgamma.value ? ((255 - (gammascale*abs(cv_globalgamma.value)))/255.0) : 1.0); + globalgammaoffs = ((cv_globalgamma.value > 0) ? ((gammascale*cv_globalgamma.value)/255.0) : 0.0); + desatur[0] = desatur[1] = desatur[2] = globalgammaoffs + (0.33*globalgammamul); - apply = true; - - #define dogamma(i, j, k, l) \ - working[i][j][k][l]*= gammamul;\ - working[i][j][k][l] += gammaoffs - for (q = 0; q < 3; q++) - { - dogamma(0, 0, 0, q); - dogamma(1, 0, 0, q); - dogamma(0, 1, 0, q); - dogamma(1, 1, 0, q); - dogamma(0, 0, 1, q); - dogamma(1, 0, 1, q); - dogamma(0, 1, 1, q); - dogamma(1, 1, 1, q); - } -#undef dogamma - } - - if (cv_usesaturation.value != 10) + if (doinggamma + || diffcons(cv_rhue) + || diffcons(cv_yhue) + || diffcons(cv_ghue) + || diffcons(cv_chue) + || diffcons(cv_bhue) + || diffcons(cv_mhue) + || diffcons(cv_rgamma) + || diffcons(cv_ygamma) + || diffcons(cv_ggamma) + || diffcons(cv_cgamma) + || diffcons(cv_bgamma) + || diffcons(cv_mgamma)) { - float desatur[3] = {0.33, 0.33, 0.33}; // grey - float work = (cv_usesaturation.value/10.0); + float mod, tempgammamul, tempgammaoffs; apply = true; + working[0][0][0][0] = working[0][0][0][1] = working[0][0][0][2] = globalgammaoffs; + working[1][1][1][0] = working[1][1][1][1] = working[1][1][1][2] = globalgammaoffs+globalgammamul; + +#define dohue(hue, gamma, loc) \ + tempgammamul = (gamma ? ((255 - (gammascale*abs(gamma)))/255.0)*globalgammamul : globalgammamul);\ + tempgammaoffs = ((gamma > 0) ? ((gammascale*gamma)/255.0) + globalgammaoffs : globalgammaoffs);\ + mod = ((hue % huecoloursteps)*(tempgammamul)/huecoloursteps);\ + switch (hue/huecoloursteps)\ + {\ + case 0:\ + default:\ + loc[0] = tempgammaoffs+tempgammamul;\ + loc[1] = tempgammaoffs+mod;\ + loc[2] = tempgammaoffs;\ + break;\ + case 1:\ + loc[0] = tempgammaoffs+tempgammamul-mod;\ + loc[1] = tempgammaoffs+tempgammamul;\ + loc[2] = tempgammaoffs;\ + break;\ + case 2:\ + loc[0] = tempgammaoffs;\ + loc[1] = tempgammaoffs+tempgammamul;\ + loc[2] = tempgammaoffs+mod;\ + break;\ + case 3:\ + loc[0] = tempgammaoffs;\ + loc[1] = tempgammaoffs+tempgammamul-mod;\ + loc[2] = tempgammaoffs+tempgammamul;\ + break;\ + case 4:\ + loc[0] = tempgammaoffs+mod;\ + loc[1] = tempgammaoffs;\ + loc[2] = tempgammaoffs+tempgammamul;\ + break;\ + case 5:\ + loc[0] = tempgammaoffs+tempgammamul;\ + loc[1] = tempgammaoffs;\ + loc[2] = tempgammaoffs+tempgammamul-mod;\ + break;\ + } + dohue(cv_rhue.value, cv_rgamma.value, working[1][0][0]); + dohue(cv_yhue.value, cv_ygamma.value, working[1][1][0]); + dohue(cv_ghue.value, cv_ggamma.value, working[0][1][0]); + dohue(cv_chue.value, cv_cgamma.value, working[0][1][1]); + dohue(cv_bhue.value, cv_bgamma.value, working[0][0][1]); + dohue(cv_mhue.value, cv_mgamma.value, working[1][0][1]); +#undef dohue + } + #define dosaturation(a, e) a = ((1 - work)*e + work*a) +#define docvsat(cv_sat, hue, gamma, r, g, b) \ + if diffcons(cv_sat)\ + {\ + float work, mod, tempgammamul, tempgammaoffs;\ + apply = true;\ + work = (cv_sat.value/10.0);\ + mod = ((hue % huecoloursteps)*(1.0)/huecoloursteps);\ + if (hue & huecoloursteps)\ + mod = 2-mod;\ + else\ + mod += 1;\ + tempgammamul = (gamma ? ((255 - (gammascale*abs(gamma)))/255.0)*globalgammamul : globalgammamul);\ + tempgammaoffs = ((gamma > 0) ? ((gammascale*gamma)/255.0) + globalgammaoffs : globalgammaoffs);\ + for (q = 0; q < 3; q++)\ + dosaturation(working[r][g][b][q], (tempgammaoffs+(desatur[q]*mod*tempgammamul)));\ + } + + docvsat(cv_rsaturation, cv_rhue.value, cv_rgamma.value, 1, 0, 0); + docvsat(cv_ysaturation, cv_yhue.value, cv_ygamma.value, 1, 1, 0); + docvsat(cv_gsaturation, cv_ghue.value, cv_ggamma.value, 0, 1, 0); + docvsat(cv_csaturation, cv_chue.value, cv_cgamma.value, 0, 1, 1); + docvsat(cv_bsaturation, cv_bhue.value, cv_bgamma.value, 0, 0, 1); + docvsat(cv_msaturation, cv_mhue.value, cv_mgamma.value, 1, 0, 1); + +#undef gammascale + + if diffcons(cv_globalsaturation) + { + float work = (cv_globalsaturation.value/10.0); + + apply = true; + for (q = 0; q < 3; q++) { - dosaturation(working[0][0][1][q], desatur[q]); - dosaturation(working[0][1][0][q], desatur[q]); dosaturation(working[1][0][0][q], desatur[q]); + dosaturation(working[0][1][0][q], desatur[q]); + dosaturation(working[0][0][1][q], desatur[q]); dosaturation(working[1][1][0][q], 2*desatur[q]); - dosaturation(working[1][0][1][q], 2*desatur[q]); dosaturation(working[0][1][1][q], 2*desatur[q]); + dosaturation(working[1][0][1][q], 2*desatur[q]); } -#undef dosaturation } +#undef dosaturation + +#undef diffcons + if (!apply) return false; @@ -315,7 +422,7 @@ void V_SetPaletteLump(const char *pal) I_SetPalette(pLocalPalette); } -static void CV_usegamma_OnChange(void) +static void CV_palette_OnChange(void) { // reload palette LoadMapPalette(); diff --git a/src/v_video.h b/src/v_video.h index f1761162f..5d4715235 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -27,7 +27,11 @@ extern UINT8 *screens[5]; -extern consvar_t cv_ticrate, cv_usegamma, cv_usesaturation, cv_constextsize; +extern consvar_t cv_ticrate, cv_constextsize,\ +cv_globalgamma, cv_globalsaturation, \ +cv_rhue, cv_yhue, cv_ghue, cv_chue, cv_bhue, cv_mhue,\ +cv_rgamma, cv_ygamma, cv_ggamma, cv_cgamma, cv_bgamma, cv_mgamma, \ +cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation, cv_msaturation; // Allocates buffer screens, call before R_Init. void V_Init(void); From 29d5af61c1f7cff83e5e59117ff6ceef00d698c1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Apr 2017 13:15:32 +0100 Subject: [PATCH 061/181] Correcting gamma to match base SRB2. --- src/v_video.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 9e6a2745e..3c025d306 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -118,7 +118,6 @@ http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter24.html Please check it out if you're trying to maintain this. toast 18/04/17 */ - float Cubepal[2][2][2][3]; // returns whether to apply cube, selectively avoiding expensive operations @@ -174,7 +173,7 @@ static boolean InitCube(void) || diffcons(cv_ggamma) || diffcons(cv_cgamma) || diffcons(cv_bgamma) - || diffcons(cv_mgamma)) + || diffcons(cv_mgamma)) // set the gamma'd/hued positions (saturation is done later) { float mod, tempgammamul, tempgammaoffs; @@ -304,6 +303,31 @@ static boolean InitCube(void) return true; } +/* +So it turns out that the way gamma was implemented previously, the default +colour profile of the game was messed up. Since this bad decision has been +around for a long time, and the intent is to keep the base game looking the +same, I'm not gonna be the one to remove this base modification. +toast 20/04/17 +*/ +const UINT8 correctiontable[256] = + {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, + 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, + 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80, + 81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96, + 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112, + 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}; + // keep a copy of the palette so that we can get the RGB value for a color index at any time. static void LoadPalette(const char *lumpname) { @@ -319,9 +343,9 @@ static void LoadPalette(const char *lumpname) pal = W_CacheLumpNum(lumpnum, PU_CACHE); for (i = 0; i < palsize; i++) { - pLocalPalette[i].s.red = *pal++; - pLocalPalette[i].s.green = *pal++; - pLocalPalette[i].s.blue = *pal++; + pLocalPalette[i].s.red = correctiontable[*pal++]; + pLocalPalette[i].s.green = correctiontable[*pal++]; + pLocalPalette[i].s.blue = correctiontable[*pal++]; pLocalPalette[i].s.alpha = 0xFF; // lerp of colour cubing! From 9d46ba281fe9ddebc9613c4e2db6792eaf46dda2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Apr 2017 13:17:11 +0100 Subject: [PATCH 062/181] Screenshots now contain the palette you're actively looking at, as opposed to the palette the game/map has! This makes sense for colorblind users being able to store their precious memories, and it matches up with how gifs palettise. --- src/hardware/hw_draw.c | 2 +- src/m_misc.c | 25 +++++++++++-------------- src/m_misc.h | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index a00bf3aeb..9c912495a 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -789,7 +789,7 @@ boolean HWR_Screenshot(const char *lbmname) HWD.pfnReadRect(0, 0, vid.width, vid.height, vid.width * 3, (void *)buf); #ifdef USE_PNG - ret = M_SavePNG(lbmname, buf, vid.width, vid.height, NULL); + ret = M_SavePNG(lbmname, buf, vid.width, vid.height, false); #else ret = saveTGA(lbmname, buf, vid.width, vid.height); #endif diff --git a/src/m_misc.c b/src/m_misc.c index f8d3213c2..851352a7e 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -610,19 +610,18 @@ static void PNG_warn(png_structp PNG, png_const_charp pngtext) CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext); } -static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_uint_32 width, PNG_CONST png_uint_32 height, PNG_CONST png_byte *palette) +static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_uint_32 width, PNG_CONST png_uint_32 height, const boolean palette) { const png_byte png_interlace = PNG_INTERLACE_NONE; //PNG_INTERLACE_ADAM7 if (palette) { png_colorp png_PLTE = png_malloc(png_ptr, sizeof(png_color)*256); //palette - const png_byte *pal = palette; png_uint_16 i; for (i = 0; i < 256; i++) { - png_PLTE[i].red = *pal; pal++; - png_PLTE[i].green = *pal; pal++; - png_PLTE[i].blue = *pal; pal++; + png_PLTE[i].red = pLocalPalette[i].s.red; + png_PLTE[i].green = pLocalPalette[i].s.green; + png_PLTE[i].blue = pLocalPalette[i].s.blue; } png_set_IHDR(png_ptr, png_info_ptr, width, height, 8, PNG_COLOR_TYPE_PALETTE, png_interlace, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); @@ -924,7 +923,7 @@ static void M_PNGfix_acTL(png_structp png_ptr, png_infop png_info_ptr) fseek(apng_FILE, oldpos, SEEK_SET); } -static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal) +static boolean M_SetupaPNG(png_const_charp filename, boolean palette) { apng_FILE = fopen(filename,"wb+"); // + mode for reading if (!apng_FILE) @@ -966,7 +965,7 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal) png_set_compression_strategy(apng_ptr, cv_zlib_strategya.value); png_set_compression_window_bits(apng_ptr, cv_zlib_window_bitsa.value); - M_PNGhdr(apng_ptr, apng_info_ptr, vid.width, vid.height, pal); + M_PNGhdr(apng_ptr, apng_info_ptr, vid.width, vid.height, palette); M_PNGText(apng_ptr, apng_info_ptr, true); @@ -1007,9 +1006,9 @@ static inline moviemode_t M_StartMovieAPNG(const char *pathname) } if (rendermode == render_soft) - ret = M_SetupaPNG(va(pandf,pathname,freename), W_CacheLumpName(GetPalette(), PU_CACHE)); + ret = M_SetupaPNG(va(pandf,pathname,freename), true); else - ret = M_SetupaPNG(va(pandf,pathname,freename), NULL); + ret = M_SetupaPNG(va(pandf,pathname,freename), false); if (!ret) { @@ -1215,11 +1214,10 @@ void M_StopMovie(void) * \param palette Palette of image data * \note if palette is NULL, BGR888 format */ -boolean M_SavePNG(const char *filename, void *data, int width, int height, const UINT8 *palette) +boolean M_SavePNG(const char *filename, void *data, int width, int height, const boolean palette) { png_structp png_ptr; png_infop png_info_ptr; - PNG_CONST png_byte *PLTE = (const png_byte *)palette; #ifdef PNG_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD jmp_buf jmpbuf; @@ -1282,7 +1280,7 @@ boolean M_SavePNG(const char *filename, void *data, int width, int height, const png_set_compression_strategy(png_ptr, cv_zlib_strategy.value); png_set_compression_window_bits(png_ptr, cv_zlib_window_bits.value); - M_PNGhdr(png_ptr, png_info_ptr, width, height, PLTE); + M_PNGhdr(png_ptr, png_info_ptr, width, height, palette); M_PNGText(png_ptr, png_info_ptr, false); @@ -1445,8 +1443,7 @@ void M_DoScreenShot(void) if (rendermode != render_none) { #ifdef USE_PNG - ret = M_SavePNG(va(pandf,pathname,freename), linear, vid.width, vid.height, - W_CacheLumpName(GetPalette(), PU_CACHE)); + ret = M_SavePNG(va(pandf,pathname,freename), linear, vid.width, vid.height, true); #else ret = WritePCXfile(va(pandf,pathname,freename), linear, vid.width, vid.height, W_CacheLumpName(GetPalette(), PU_CACHE)); diff --git a/src/m_misc.h b/src/m_misc.h index 5bd7401e1..55c4f1485 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -64,7 +64,7 @@ void FIL_ForceExtension(char *path, const char *extension); boolean FIL_CheckExtension(const char *in); #ifdef HAVE_PNG -boolean M_SavePNG(const char *filename, void *data, int width, int height, const UINT8 *palette); +boolean M_SavePNG(const char *filename, void *data, int width, int height, const boolean palette); #endif extern boolean takescreenshot; From 8b46ee76ff06d600a606e23802e024416a58b5b2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Apr 2017 18:59:27 +0100 Subject: [PATCH 063/181] Disable colour profile influence on screenshots and gifs if you want. --- src/d_netcmd.c | 1 + src/m_anigif.c | 24 +++++++++++++++----- src/m_menu.c | 59 ++++++++++++++++++++++++++++++-------------------- src/m_misc.c | 23 ++++++++++++++++---- src/m_misc.h | 2 +- 5 files changed, 75 insertions(+), 34 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 6d9705b40..3a80519ef 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -612,6 +612,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_screenshot_option); CV_RegisterVar(&cv_screenshot_folder); + CV_RegisterVar(&cv_screenshot_colorprofile); CV_RegisterVar(&cv_moviemode); // PNG variables CV_RegisterVar(&cv_zlib_level); diff --git a/src/m_anigif.c b/src/m_anigif.c index 2540665ad..2c1ceb86b 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -18,6 +18,7 @@ #include "z_zone.h" #include "v_video.h" #include "i_video.h" +#include "m_misc.h" // GIFs are always little-endian #include "byteptr.h" @@ -396,7 +397,6 @@ static void GIF_headwrite(void) { UINT8 *gifhead = Z_Malloc(800, PU_STATIC, NULL); UINT8 *p = gifhead; - RGBA_t *c; INT32 i; UINT16 rwidth, rheight; @@ -427,12 +427,24 @@ static void GIF_headwrite(void) WRITEUINT8(p, 0x00); // write color table - for (i = 0; i < 256; ++i) + if (cv_screenshot_colorprofile.value) { - c = &pLocalPalette[i]; - WRITEUINT8(p, c->s.red); - WRITEUINT8(p, c->s.green); - WRITEUINT8(p, c->s.blue); + for (i = 0; i < 256; i++) + { + WRITEUINT8(p, pLocalPalette[i].s.red); + WRITEUINT8(p, pLocalPalette[i].s.green); + WRITEUINT8(p, pLocalPalette[i].s.blue); + } + } + else + { + const UINT8 *pal = (UINT8 *)W_CacheLumpName(GetPalette(), PU_CACHE); + for (i = 0; i < 256; i++) + { + WRITEUINT8(p, *pal); pal++; + WRITEUINT8(p, *pal); pal++; + WRITEUINT8(p, *pal); pal++; + } } // write extension block diff --git a/src/m_menu.c b/src/m_menu.c index 8dfc2ee0a..d52895289 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1314,35 +1314,36 @@ static menuitem_t OP_DataOptionsMenu[] = static menuitem_t OP_ScreenshotOptionsMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Storage Location", &cv_screenshot_option, 10}, - {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Custom Folder", &cv_screenshot_folder, 20}, + {IT_STRING|IT_CVAR, NULL, "Use color profile", &cv_screenshot_colorprofile, 0}, + {IT_STRING|IT_CVAR, NULL, "Storage Location", &cv_screenshot_option, 5}, + {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Custom Folder", &cv_screenshot_folder, 10}, - {IT_HEADER, NULL, "Screenshots (F8)", NULL, 48}, - {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memory, 60}, - {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_level, 70}, - {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategy, 80}, - {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bits, 90}, + {IT_HEADER, NULL, "Screenshots (F8)", NULL, 24}, + {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memory, 30}, + {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_level, 35}, + {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategy, 40}, + {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bits, 45}, - {IT_HEADER, NULL, "Movie Mode (F9)", NULL, 103}, - {IT_STRING|IT_CVAR, NULL, "Capture Mode", &cv_moviemode, 115}, + {IT_HEADER, NULL, "Movie Mode (F9)", NULL, 54}, + {IT_STRING|IT_CVAR, NULL, "Capture Mode", &cv_moviemode, 60}, - {IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 125}, - {IT_STRING|IT_CVAR, NULL, "Downscaling", &cv_gif_downscale, 135}, + {IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 65}, + {IT_STRING|IT_CVAR, NULL, "Downscaling", &cv_gif_downscale, 70}, - {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memorya, 125}, - {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_levela, 135}, - {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategya, 145}, - {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bitsa, 155}, + {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memorya, 65}, + {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_levela, 70}, + {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategya, 75}, + {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bitsa, 80}, }; enum { - op_screenshot_folder = 1, - op_screenshot_capture = 8, - op_screenshot_gif_start = 9, - op_screenshot_gif_end = 10, - op_screenshot_apng_start = 11, - op_screenshot_apng_end = 14, + op_screenshot_folder = 2, + op_screenshot_capture = 9, + op_screenshot_gif_start = 10, + op_screenshot_gif_end = 11, + op_screenshot_apng_start = 12, + op_screenshot_apng_end = 15, }; static menuitem_t OP_EraseDataMenu[] = @@ -1841,7 +1842,19 @@ menu_t OP_OpenGLColorDef = }; #endif menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 30, 30); -menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30); + +menu_t OP_ScreenshotOptionsDef = +{ + "M_DATA", + sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t), + &OP_DataOptionsDef, + OP_ScreenshotOptionsMenu, + M_DrawGenericScrollMenu, + 30, 30, + 0, + NULL +}; + menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 60, 30); // ========================================================================== @@ -3279,7 +3292,7 @@ static void M_DrawGenericScrollMenu(void) for (max = currentMenu->numitems; max > 0; max--) { - if (currentMenu->menuitems[max-1].status != IT_DISABLED && currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) + if (currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) break; } diff --git a/src/m_misc.c b/src/m_misc.c index 851352a7e..d94df468e 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -100,6 +100,8 @@ static CV_PossibleValue_t screenshot_cons_t[] = {{0, "Default"}, {1, "HOME"}, {2 consvar_t cv_screenshot_option = {"screenshot_option", "Default", CV_SAVE|CV_CALL, screenshot_cons_t, Screenshot_option_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_screenshot_folder = {"screenshot_folder", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_screenshot_colorprofile = {"screenshot_colorprofile", "Yes", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + static CV_PossibleValue_t moviemode_cons_t[] = {{MM_GIF, "GIF"}, {MM_APNG, "aPNG"}, {MM_SCREENSHOT, "Screenshots"}, {0, NULL}}; consvar_t cv_moviemode = {"moviemode_mode", "GIF", CV_SAVE|CV_CALL, moviemode_cons_t, Moviemode_mode_Onchange, 0, NULL, NULL, 0, 0, NULL}; @@ -617,11 +619,24 @@ static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_ { png_colorp png_PLTE = png_malloc(png_ptr, sizeof(png_color)*256); //palette png_uint_16 i; - for (i = 0; i < 256; i++) + if (cv_screenshot_colorprofile.value) { - png_PLTE[i].red = pLocalPalette[i].s.red; - png_PLTE[i].green = pLocalPalette[i].s.green; - png_PLTE[i].blue = pLocalPalette[i].s.blue; + for (i = 0; i < 256; i++) + { + png_PLTE[i].red = pLocalPalette[i].s.red; + png_PLTE[i].green = pLocalPalette[i].s.green; + png_PLTE[i].blue = pLocalPalette[i].s.blue; + } + } + else + { + const png_byte *pal = (png_byte *)W_CacheLumpName(GetPalette(), PU_CACHE); + for (i = 0; i < 256; i++) + { + png_PLTE[i].red = *pal++; + png_PLTE[i].green = *pal++; + png_PLTE[i].blue = *pal++; + } } png_set_IHDR(png_ptr, png_info_ptr, width, height, 8, PNG_COLOR_TYPE_PALETTE, png_interlace, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); diff --git a/src/m_misc.h b/src/m_misc.h index 55c4f1485..85d819a3c 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -29,7 +29,7 @@ typedef enum { } moviemode_t; extern moviemode_t moviemode; -extern consvar_t cv_screenshot_option, cv_screenshot_folder; +extern consvar_t cv_screenshot_option, cv_screenshot_folder, cv_screenshot_colorprofile; extern consvar_t cv_moviemode; extern consvar_t cv_zlib_memory, cv_zlib_level, cv_zlib_strategy, cv_zlib_window_bits; extern consvar_t cv_zlib_memorya, cv_zlib_levela, cv_zlib_strategya, cv_zlib_window_bitsa; From 4f59fa35b3f713588901c41778e250b62d99b53a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Apr 2017 19:27:19 +0100 Subject: [PATCH 064/181] Add headings to Video Options menu. --- src/m_menu.c | 62 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index d52895289..4b031cc73 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1167,39 +1167,45 @@ static menuitem_t OP_Mouse2OptionsMenu[] = static menuitem_t OP_VideoOptionsMenu[] = { - {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 0}, + {IT_HEADER, NULL, "Screen", NULL, 0}, + {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 6}, #if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 5}, + {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 11}, #endif + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 16}, #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 10}, + {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 21}, #endif - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_globalgamma, 15}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_globalsaturation, 20}, - {IT_SUBMENU|IT_STRING, NULL, "Advanced Color Settings...", &OP_ColorOptionsDef, 25}, + {IT_HEADER, NULL, "Color Profile", NULL, 30}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_globalgamma, 36}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_globalsaturation, 41}, + {IT_SUBMENU|IT_STRING, NULL, "Advanced Settings...", &OP_ColorOptionsDef, 46}, - {IT_STRING | IT_CVAR, NULL, "Display HUD", &cv_showhud, 35}, + {IT_HEADER, NULL, "Heads Up Display", NULL, 55}, + {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 61}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "HUD Transparency", &cv_translucenthud, 40}, - {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 45}, + NULL, "HUD Transparency", &cv_translucenthud, 66}, + {IT_STRING | IT_CVAR, NULL, "Time Display", &cv_timetic, 71}, #ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "Show HUD player names", &cv_seenames, 50}, + {IT_STRING | IT_CVAR, NULL, "Show player names", &cv_seenames, 76}, #endif - {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 60}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 65}, + {IT_HEADER, NULL, "Console", NULL, 85}, + {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 91}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 96}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 75}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 80}, - {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 85}, - {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 90}, + {IT_HEADER, NULL, "Level", NULL, 105}, + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 111}, + {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist.", &cv_drawdist_nights, 116}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 121}, + {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 126}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 100}, - {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 105}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 110}, + {IT_HEADER, NULL, "Diagnostic", NULL, 135}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 141}, + {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 146}, }; static menuitem_t OP_VideoModeMenu[] = @@ -1209,7 +1215,7 @@ static menuitem_t OP_VideoModeMenu[] = static menuitem_t OP_ColorOptionsMenu[] = { - {IT_STRING | IT_CALL, NULL, "Reset all", M_ResetCvars, 0}, + {IT_STRING | IT_CALL, NULL, "Reset to defaults", M_ResetCvars, 0}, {IT_HEADER, NULL, "Red", NULL, 9}, {IT_DISABLED, NULL, NULL, NULL, 35}, @@ -1255,7 +1261,7 @@ static menuitem_t OP_OpenGLOptionsMenu[] = {IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 20}, {IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 30}, {IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode,40}, -#ifdef _WINDOWS +#if defined (_WINDOWS) && (!((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL))) {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 50}, #endif #ifdef ALAM_LIGHTING @@ -1404,7 +1410,7 @@ static menuitem_t OP_ServerOptionsMenu[] = static menuitem_t OP_MonitorToggleMenu[] = { // Printing handled by drawing function - {IT_STRING|IT_CALL, NULL, "Reset all", M_ResetCvars, 15}, + {IT_STRING|IT_CALL, NULL, "Reset to defaults", M_ResetCvars, 15}, {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Recycler", &cv_recycler, 30}, {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Teleporters", &cv_teleporters, 40}, {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Ring", &cv_superring, 50}, @@ -2867,7 +2873,7 @@ void M_Init(void) #ifdef HWRENDER // Permanently hide some options based on render mode if (rendermode == render_soft) - OP_VideoOptionsMenu[2].status = IT_DISABLED; + OP_VideoOptionsMenu[4].status = IT_DISABLED; #endif #ifndef NONET @@ -8178,11 +8184,17 @@ static void M_VideoModeMenu(INT32 choice) static void M_DrawMainVideoMenu(void) { + M_DrawGenericScrollMenu(); - if (itemOn < 7) // where it starts to go offscreen; change this number if you change the layout of the video menu - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y+currentMenu->menuitems[0].alphaKey, + if (itemOn < 8) // where it starts to go offscreen; change this number if you change the layout of the video menu + { + INT32 y = currentMenu->y+currentMenu->menuitems[1].alphaKey*2; + if (itemOn == 7) + y -= 10; + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, y, (SCR_IsAspectCorrect(vid.width, vid.height) ? V_GREENMAP : V_YELLOWMAP), va("%dx%d", vid.width, vid.height)); + } } // Draw the video modes list, a-la-Quake From aa475c9d266a598d413a6de754368df76185cf2c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Apr 2017 20:16:10 +0100 Subject: [PATCH 065/181] Realised color profile disabling for screenshots didn't work in GL, so updated the menu to show that. Also, made other minor menu tweaks. --- src/m_menu.c | 72 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 4b031cc73..a9f7ee528 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -361,6 +361,7 @@ static void M_OGL_DrawFogMenu(void); static void M_OGL_DrawColorMenu(void); #endif #ifndef NONET +static void M_DrawScreenshotMenu(void); static void M_DrawConnectMenu(void); static void M_DrawConnectIPMenu(void); static void M_DrawRoomMenu(void); @@ -1176,15 +1177,15 @@ static menuitem_t OP_VideoOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 16}, #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 21}, + {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 21}, #endif {IT_HEADER, NULL, "Color Profile", NULL, 30}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness", &cv_globalgamma, 36}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Brightness (F11)", &cv_globalgamma, 36}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saturation", &cv_globalsaturation, 41}, {IT_SUBMENU|IT_STRING, NULL, "Advanced Settings...", &OP_ColorOptionsDef, 46}, - {IT_HEADER, NULL, "Heads Up Display", NULL, 55}, + {IT_HEADER, NULL, "Heads-Up Display", NULL, 55}, {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 61}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "HUD Transparency", &cv_translucenthud, 66}, @@ -1320,36 +1321,38 @@ static menuitem_t OP_DataOptionsMenu[] = static menuitem_t OP_ScreenshotOptionsMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Use color profile", &cv_screenshot_colorprofile, 0}, - {IT_STRING|IT_CVAR, NULL, "Storage Location", &cv_screenshot_option, 5}, - {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Custom Folder", &cv_screenshot_folder, 10}, + {IT_HEADER, NULL, "General", NULL, 0}, + {IT_STRING|IT_CVAR, NULL, "Use color profile", &cv_screenshot_colorprofile, 6}, + {IT_STRING|IT_CVAR, NULL, "Storage Location", &cv_screenshot_option, 11}, + {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Custom Folder", &cv_screenshot_folder, 16}, - {IT_HEADER, NULL, "Screenshots (F8)", NULL, 24}, - {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memory, 30}, - {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_level, 35}, - {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategy, 40}, - {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bits, 45}, + {IT_HEADER, NULL, "Screenshots (F8)", NULL, 30}, + {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memory, 36}, + {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_level, 41}, + {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategy, 46}, + {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bits, 51}, - {IT_HEADER, NULL, "Movie Mode (F9)", NULL, 54}, - {IT_STRING|IT_CVAR, NULL, "Capture Mode", &cv_moviemode, 60}, + {IT_HEADER, NULL, "Movie Mode (F9)", NULL, 60}, + {IT_STRING|IT_CVAR, NULL, "Capture Mode", &cv_moviemode, 66}, - {IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 65}, - {IT_STRING|IT_CVAR, NULL, "Downscaling", &cv_gif_downscale, 70}, + {IT_STRING|IT_CVAR, NULL, "Region Optimizing", &cv_gif_optimize, 71}, + {IT_STRING|IT_CVAR, NULL, "Downscaling", &cv_gif_downscale, 76}, - {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memorya, 65}, - {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_levela, 70}, - {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategya, 75}, - {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bitsa, 80}, + {IT_STRING|IT_CVAR, NULL, "Memory Level", &cv_zlib_memorya, 71}, + {IT_STRING|IT_CVAR, NULL, "Compression Level", &cv_zlib_levela, 76}, + {IT_STRING|IT_CVAR, NULL, "Strategy", &cv_zlib_strategya, 81}, + {IT_STRING|IT_CVAR, NULL, "Window Size", &cv_zlib_window_bitsa, 86}, }; enum { - op_screenshot_folder = 2, - op_screenshot_capture = 9, - op_screenshot_gif_start = 10, - op_screenshot_gif_end = 11, - op_screenshot_apng_start = 12, - op_screenshot_apng_end = 15, + op_screenshot_colorprofile = 1, + op_screenshot_folder = 3, + op_screenshot_capture = 10, + op_screenshot_gif_start = 11, + op_screenshot_gif_end = 12, + op_screenshot_apng_start = 13, + op_screenshot_apng_end = 16, }; static menuitem_t OP_EraseDataMenu[] = @@ -1855,7 +1858,7 @@ menu_t OP_ScreenshotOptionsDef = sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t), &OP_DataOptionsDef, OP_ScreenshotOptionsMenu, - M_DrawGenericScrollMenu, + M_DrawScreenshotMenu, 30, 30, 0, NULL @@ -2874,6 +2877,8 @@ void M_Init(void) // Permanently hide some options based on render mode if (rendermode == render_soft) OP_VideoOptionsMenu[4].status = IT_DISABLED; + else if (rendermode == render_opengl) + OP_ScreenshotOptionsMenu[op_screenshot_colorprofile].status = IT_GRAYEDOUT; #endif #ifndef NONET @@ -8456,6 +8461,21 @@ static void M_HandleVideoMode(INT32 ch) } } +static void M_DrawScreenshotMenu(void) +{ + + M_DrawGenericScrollMenu(); +#ifdef HWRENDER + if ((rendermode == render_opengl) && (itemOn < 7)) // where it starts to go offscreen; change this number if you change the layout of the screenshot menu + { + INT32 y = currentMenu->y+currentMenu->menuitems[op_screenshot_colorprofile].alphaKey*2; + if (itemOn == 6) + y -= 10; + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, y, V_REDMAP, "ON"); + } +#endif +} + // =============== // Monitor Toggles // =============== From 3cce4956753ced4e325edc4ec61f6fe7494cc233 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Apr 2017 20:29:06 +0100 Subject: [PATCH 066/181] Made PCX use cv_screenshot_colorprofile. Also, optimised gif headwrite's palette writing. --- src/m_anigif.c | 4 +--- src/m_misc.c | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index 2c1ceb86b..4f7ed16ab 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -439,11 +439,9 @@ static void GIF_headwrite(void) else { const UINT8 *pal = (UINT8 *)W_CacheLumpName(GetPalette(), PU_CACHE); - for (i = 0; i < 256; i++) + for (i = 0; i < 256*3; i++) { WRITEUINT8(p, *pal); pal++; - WRITEUINT8(p, *pal); pal++; - WRITEUINT8(p, *pal); pal++; } } diff --git a/src/m_misc.c b/src/m_misc.c index d94df468e..87e65f6ce 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1342,7 +1342,7 @@ typedef struct * \param palette Palette of image data */ #if NUMSCREENS > 2 -static boolean WritePCXfile(const char *filename, const UINT8 *data, int width, int height, const UINT8 *palette) +static boolean WritePCXfile(const char *filename, const UINT8 *data, int width, int height) { int i; size_t length; @@ -1383,8 +1383,25 @@ static boolean WritePCXfile(const char *filename, const UINT8 *data, int width, // write the palette *pack++ = 0x0c; // palette ID byte - for (i = 0; i < 768; i++) - *pack++ = *palette++; + + // write color table + if (cv_screenshot_colorprofile.value) + { + for (i = 0; i < 256; i++) + { + *pack++ = pLocalPalette[i].s.red; + *pack++ = pLocalPalette[i].s.green; + *pack++ = pLocalPalette[i].s.blue; + } + } + else + { + const UINT8 *pal = (UINT8 *)W_CacheLumpName(GetPalette(), PU_CACHE); + for (i = 0; i < 256*3; i++) + { + *pack++ = *pal++; + } + } // write output file length = pack - (UINT8 *)pcx; @@ -1460,8 +1477,7 @@ void M_DoScreenShot(void) #ifdef USE_PNG ret = M_SavePNG(va(pandf,pathname,freename), linear, vid.width, vid.height, true); #else - ret = WritePCXfile(va(pandf,pathname,freename), linear, vid.width, vid.height, - W_CacheLumpName(GetPalette(), PU_CACHE)); + ret = WritePCXfile(va(pandf,pathname,freename), linear, vid.width, vid.height); #endif } From 37fc95ca08d56f953102c8bb86b9e98e49650acf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Apr 2017 21:54:56 +0100 Subject: [PATCH 067/181] Added modifying sound captions to Lua infolib. Also, replaced ridiculously ambiguous "impossible error" with more descriptive alternative. --- src/lua_infolib.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 4f7fdaa26..f1e6f5975 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -31,6 +31,7 @@ enum sfxinfo_read { sfxinfor_singular, sfxinfor_priority, sfxinfor_flags, // "pitch" + sfxinfor_caption, sfxinfor_skinsound }; const char *const sfxinfo_ropt[] = { @@ -38,18 +39,21 @@ const char *const sfxinfo_ropt[] = { "singular", "priority", "flags", + "caption", "skinsound", NULL}; enum sfxinfo_write { sfxinfow_singular = 0, sfxinfow_priority, - sfxinfow_flags // "pitch" + sfxinfow_flags, // "pitch" + sfxinfow_caption }; const char *const sfxinfo_wopt[] = { "singular", "priority", "flags", + "caption", NULL}; // @@ -814,6 +818,9 @@ static int lib_setSfxInfo(lua_State *L) case sfxinfow_flags: info->pitch = (INT32)luaL_checkinteger(L, 3); break; + case sfxinfow_caption: + strlcpy(info->caption, luaL_checkstring(L, 3), sizeof(info->caption)); + break; default: break; } @@ -851,11 +858,14 @@ static int sfxinfo_get(lua_State *L) case sfxinfor_flags: lua_pushinteger(L, sfx->pitch); return 1; + case sfxinfor_caption: + lua_pushstring(L, sfx->caption); + return 1; case sfxinfor_skinsound: lua_pushinteger(L, sfx->skinsound); return 1; default: - return luaL_error(L, "impossible error"); + return luaL_error(L, "Field does not exist in sfxinfo_t"); } return 0; } @@ -886,8 +896,11 @@ static int sfxinfo_set(lua_State *L) case sfxinfow_flags: sfx->pitch = luaL_checkinteger(L, 1); break; + case sfxinfow_caption: + strlcpy(sfx->caption, luaL_checkstring(L, 1), sizeof(sfx->caption)); + break; default: - return luaL_error(L, "impossible error"); + return luaL_error(L, "Field does not exist in sfxinfo_t"); } return 0; } From 7556b407b247a9bfb9420781b8fa1ac4facce07d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Apr 2017 23:37:14 +0100 Subject: [PATCH 068/181] Fix crash on loading level without a header. --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 7bf0bc0e4..bdfea10d5 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3663,6 +3663,9 @@ char *G_BuildMapTitle(INT32 mapnum) { char *title = NULL; + if (!mapheaderinfo[mapnum-1]) + P_AllocMapHeader(mapnum-1); + if (strcmp(mapheaderinfo[mapnum-1]->lvlttl, "")) { size_t len = 1; From f8c09d74757b623c73733d905851518de7aee527 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Apr 2017 23:41:31 +0100 Subject: [PATCH 069/181] More better sound names. (I'll push something good at some point, I promise!) --- src/sounds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index d9c65b603..eb2f90fb5 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -352,7 +352,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Eating dirt"}, {"s3k7f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Freeze"}, {"s3k80", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ice spike burst"}, - {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Releasing"}, + {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Burst"}, {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, {"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, {"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, @@ -362,7 +362,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic squeak"}, {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Advanced technology"}, {"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boing"}, - {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thwack"}, + {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful hit"}, {"s3k8c", 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, ""}, From c1bd4f570cf50d48023af6c8f0e1bb574f1421e4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 22 Apr 2017 12:14:15 +0100 Subject: [PATCH 070/181] The start of an unlockable checklist revamp. Require more UC_ constant acknowledgement and the ability to scroll, but I can't work on this for a while so. --- src/m_menu.c | 93 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 11 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index a9f7ee528..8be4b7ec3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1502,7 +1502,7 @@ menu_t SR_UnlockChecklistDef = &SR_MainDef, SR_UnlockChecklistMenu, M_DrawChecklist, - 280, 185, + 30, 30, 0, NULL }; @@ -4787,27 +4787,98 @@ static void M_LevelSelectWarp(INT32 choice) UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES]; -#define NUMCHECKLIST 8 static void M_DrawChecklist(void) { - INT32 i, j = 0; + INT32 i, j = 0, y = currentMenu->y; + UINT32 condnum, previd, maxcond; + condition_t *cond; - for (i = 0; i < MAXUNLOCKABLES; i++) + for (i = 0; i < MAXUNLOCKABLES;) { - if (unlockables[i].name[0] == 0 || unlockables[i].nochecklist + if (unlockables[i].name[0] == 0 //|| unlockables[i].nochecklist || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS) continue; - V_DrawString(8, 8+(24*j), V_RETURN8, unlockables[i].name); - V_DrawString(160, 8+(24*j), V_RETURN8, V_WordWrap(160, 292, 0, unlockables[i].objective)); + V_DrawString(currentMenu->x, y, ((unlockables[i].unlocked) ? V_GREENMAP : V_TRANSLUCENT), ((unlockables[i].unlocked) ? unlockables[i].name : M_CreateSecretMenuOption(unlockables[i].name))); + + for (j = i+1; j < MAXUNLOCKABLES; j++) + { + if (!(unlockables[j].name[0] == 0 //|| unlockables[j].nochecklist + || !unlockables[j].conditionset || unlockables[j].conditionset > MAXCONDITIONSETS)) + break; + } + if ((j != MAXUNLOCKABLES) && (unlockables[i].conditionset == unlockables[j].conditionset)) + y += 8; + else + { + if ((maxcond = conditionSets[unlockables[i].conditionset-1].numconditions)) + { + cond = conditionSets[unlockables[i].conditionset-1].condition; + previd = cond[0].id; + y += 2; + for (condnum = 0; condnum < maxcond; condnum++) + { + if (cond[condnum].id != previd) + { + y += 8; + V_DrawString(currentMenu->x + 4, y, V_YELLOWMAP, "OR"); + } + + y += 8; + + switch (cond[condnum].type) + { + case UC_MAPBEATEN: + case UC_MAPPERFECT: + { + char *title = G_BuildMapTitle(cond[condnum].requirement); + if (title) + { + V_DrawString(currentMenu->x + 8, y, V_ALLOWLOWERCASE, va("%s %s", + ((cond[condnum].type == UC_MAPPERFECT) ? "Get every ring in" : "Complete"), + ((M_MapLocked(cond[condnum].requirement) || (!(mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title))); + Z_Free(title); + } + } + break; + case UC_GAMECLEAR: + case UC_ALLEMERALDS: + { + const char *emeraldtext = ((cond[condnum].type == UC_ALLEMERALDS) ? " with all emeralds" : ""); + if (cond[condnum].requirement != 1) + V_DrawString(currentMenu->x + 8, y, + V_ALLOWLOWERCASE,va("Complete the game %d times%s", + cond[condnum].requirement, emeraldtext)); + else + V_DrawString(currentMenu->x + 8, y, + V_ALLOWLOWERCASE, + va("Complete the game%s", emeraldtext)); + } + break; + case UC_TOTALEMBLEMS: + V_DrawString(currentMenu->x + 8, y, + V_ALLOWLOWERCASE, + va("Collect %s%d emblems", ((M_CountEmblems() == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement)); + break; + default: + V_DrawString(currentMenu->x + 8, y, + V_ALLOWLOWERCASE, + va("id %d, type %d, req %d", cond[condnum].id, cond[condnum].type, cond[condnum].requirement)); + break; + } + previd = cond[condnum].id; + } + } + y += 12; + } + i = j; + + /*V_DrawString(160, 8+(24*j), V_RETURN8, V_WordWrap(160, 292, 0, unlockables[i].objective)); if (unlockables[i].unlocked) V_DrawString(308, 8+(24*j), V_YELLOWMAP, "Y"); else - V_DrawString(308, 8+(24*j), V_YELLOWMAP, "N"); - - if (++j >= NUMCHECKLIST) - break; + V_DrawString(308, 8+(24*j), V_YELLOWMAP, "N");*/ } } From 9a8ae7cd64c949a6168d408b9ce2598358cbe5d3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 22 Apr 2017 12:53:57 +0100 Subject: [PATCH 071/181] Okay, I lied. Here's a little bit of cleanup. --- src/m_menu.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 8be4b7ec3..ee97e9b00 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4789,17 +4789,17 @@ UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES]; static void M_DrawChecklist(void) { - INT32 i, j = 0, y = currentMenu->y; + INT32 i = 0, j = 0, y = currentMenu->y; UINT32 condnum, previd, maxcond; condition_t *cond; - for (i = 0; i < MAXUNLOCKABLES;) + while (i < MAXUNLOCKABLES) { if (unlockables[i].name[0] == 0 //|| unlockables[i].nochecklist || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS) continue; - V_DrawString(currentMenu->x, y, ((unlockables[i].unlocked) ? V_GREENMAP : V_TRANSLUCENT), ((unlockables[i].unlocked) ? unlockables[i].name : M_CreateSecretMenuOption(unlockables[i].name))); + V_DrawString(currentMenu->x, y, ((unlockables[i].unlocked) ? V_GREENMAP : V_TRANSLUCENT), ((unlockables[i].unlocked || !unlockables[i].nochecklist) ? unlockables[i].name : M_CreateSecretMenuOption(unlockables[i].name))); for (j = i+1; j < MAXUNLOCKABLES; j++) { @@ -4834,9 +4834,9 @@ static void M_DrawChecklist(void) char *title = G_BuildMapTitle(cond[condnum].requirement); if (title) { - V_DrawString(currentMenu->x + 8, y, V_ALLOWLOWERCASE, va("%s %s", + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, va("\x1E %s %s", ((cond[condnum].type == UC_MAPPERFECT) ? "Get every ring in" : "Complete"), - ((M_MapLocked(cond[condnum].requirement) || (!(mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title))); + ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title))); Z_Free(title); } } @@ -4846,24 +4846,24 @@ static void M_DrawChecklist(void) { const char *emeraldtext = ((cond[condnum].type == UC_ALLEMERALDS) ? " with all emeralds" : ""); if (cond[condnum].requirement != 1) - V_DrawString(currentMenu->x + 8, y, - V_ALLOWLOWERCASE,va("Complete the game %d times%s", + V_DrawString(currentMenu->x, y, + V_ALLOWLOWERCASE,va("\x1E Complete the game %d times%s", cond[condnum].requirement, emeraldtext)); else - V_DrawString(currentMenu->x + 8, y, + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, - va("Complete the game%s", emeraldtext)); + va("\x1E Complete the game%s", emeraldtext)); } break; case UC_TOTALEMBLEMS: - V_DrawString(currentMenu->x + 8, y, + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, - va("Collect %s%d emblems", ((M_CountEmblems() == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement)); + va("\x1E Collect %s%d emblems", ((M_CountEmblems() == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement)); break; default: - V_DrawString(currentMenu->x + 8, y, + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, - va("id %d, type %d, req %d", cond[condnum].id, cond[condnum].type, cond[condnum].requirement)); + va("\x1E id %d, type %d, req %d", cond[condnum].id, cond[condnum].type, cond[condnum].requirement)); break; } previd = cond[condnum].id; From bcf0df7cb62c09a3e112ee0eaa9fdeb34d620c9b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Apr 2017 00:16:09 +0100 Subject: [PATCH 072/181] Ended up being stressed and not getting any real work done, so figured I'd finish up the checklist system. --- src/dehacked.c | 1 + src/m_cond.c | 34 ++++----- src/m_menu.c | 194 +++++++++++++++++++++++++++++++++++-------------- 3 files changed, 158 insertions(+), 71 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8563fef95..e91f168e0 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2469,6 +2469,7 @@ static void readunlockable(MYFILE *f, INT32 num) DEH_WriteUndoline("VAR", va("%d", unlockables[num].variable), UNDO_NONE); memset(&unlockables[num], 0, sizeof(unlockable_t)); + unlockables[num].objective[0] = '/'; do { diff --git a/src/m_cond.c b/src/m_cond.c index f12e677dc..b7735d4ce 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -573,31 +573,31 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Record Attack", "Complete Greenflower Zone, Act 1", 0, 1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 02 */ {"NiGHTS Mode", "Complete Floral Field", 0, 2, SECRET_NIGHTSMODE, 0, true, true, 0}, + /* 01 */ {"Record Attack", "/", 0, 1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 02 */ {"NiGHTS Mode", "/", 0, 2, SECRET_NIGHTSMODE, 0, true, true, 0}, - /* 03 */ {"Play Credits", "Complete 1P Mode", 30, 10, SECRET_CREDITS, 0, true, true, 0}, - /* 04 */ {"Sound Test", "Complete 1P Mode", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0}, + /* 03 */ {"Play Credits", "/", 30, 10, SECRET_CREDITS, 0, true, true, 0}, + /* 04 */ {"Sound Test", "/", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0}, - /* 05 */ {"EXTRA LEVELS", "", 58, 0, SECRET_HEADER, 0, true, true, 0}, + /* 05 */ {"EXTRA LEVELS", "/", 58, 0, SECRET_HEADER, 0, true, true, 0}, - /* 06 */ {"Aerial Garden Zone", "Complete 1P Mode w/ all emeralds", 70, 11, SECRET_WARP, 40, false, false, 0}, - /* 07 */ {"Azure Temple Zone", "Complete Aerial Garden Zone", 80, 20, SECRET_WARP, 41, false, false, 0}, + /* 06 */ {"Aerial Garden Zone", "/", 70, 11, SECRET_WARP, 40, false, false, 0}, + /* 07 */ {"Azure Temple Zone", "/", 80, 20, SECRET_WARP, 41, false, false, 0}, - /* 08 */ {"BONUS LEVELS", "", 98, 0, SECRET_HEADER, 0, true, true, 0}, + /* 08 */ {"BONUS LEVELS", "/", 98, 0, SECRET_HEADER, 0, true, true, 0}, - /* 09 */ {"PLACEHOLDER", "PLACEHOLDER", 0, 0, SECRET_NONE, 0, true, true, 0}, - /* 10 */ {"Mario Koopa Blast", "Collect 60 Emblems", 110, 42, SECRET_WARP, 30, false, false, 0}, - /* 11 */ {"PLACEHOLDER", "PLACEHOLDER", 0, 0, SECRET_NONE, 0, true, true, 0}, + /* 09 */ {"PLACEHOLDER", "/", 0, 0, SECRET_NONE, 0, true, true, 0}, + /* 10 */ {"Mario Koopa Blast", "/", 110, 42, SECRET_WARP, 30, false, false, 0}, + /* 11 */ {"PLACEHOLDER", "/", 0, 0, SECRET_NONE, 0, true, true, 0}, - /* 12 */ {"Spring Hill Zone", "Collect 100 Emblems", 0, 44, SECRET_NONE, 0, false, false, 0}, - /* 13 */ {"Black Hole", "A Rank in all Special Stages", 0, 50, SECRET_NONE, 0, false, true, 0}, + /* 12 */ {"Spring Hill Zone", "/", 0, 44, SECRET_NONE, 0, false, false, 0}, + /* 13 */ {"Black Hole", "Get grade A in all Special Stages", 0, 50, SECRET_NONE, 0, false, true, 0}, - /* 14 */ {"Emblem Hints", "Collect 40 Emblems", 0, 41, SECRET_EMBLEMHINTS, 0, false, true, 0}, - /* 15 */ {"Emblem Radar", "Collect 80 Emblems", 0, 43, SECRET_ITEMFINDER, 0, false, true, 0}, + /* 14 */ {"Emblem Hints", "/", 0, 41, SECRET_EMBLEMHINTS, 0, false, true, 0}, + /* 15 */ {"Emblem Radar", "/", 0, 43, SECRET_ITEMFINDER, 0, false, true, 0}, - /* 16 */ {"Pandora's Box", "Collect All Emblems", 0, 45, SECRET_PANDORA, 0, false, false, 0}, - /* 17 */ {"Level Select", "Collect All Emblems", 20, 45, SECRET_LEVELSELECT, 1, false, true, 0}, + /* 16 */ {"Pandora's Box", "/", 0, 45, SECRET_PANDORA, 0, false, false, 0}, + /* 17 */ {"Level Select", "/", 20, 45, SECRET_LEVELSELECT, 1, false, true, 0}, }; // Default number of emblems and extra emblems diff --git a/src/m_menu.c b/src/m_menu.c index ee97e9b00..1fb35bb22 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -241,8 +241,11 @@ static void M_LevelSelectWarp(INT32 choice); static void M_Credits(INT32 choice); static void M_PandorasBox(INT32 choice); static void M_EmblemHints(INT32 choice); +static void M_HandleChecklist(INT32 choice); menu_t SR_MainDef, SR_UnlockChecklistDef; +static UINT8 check_on; + // Misc. Main Menu static void M_SinglePlayerMenu(INT32 choice); static void M_Options(INT32 choice); @@ -712,7 +715,7 @@ static menuitem_t SR_LevelSelectMenu[] = static menuitem_t SR_UnlockChecklistMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "NEXT", &SR_MainDef, 192}, + {IT_KEYHANDLER | IT_STRING, NULL, "", M_HandleChecklist, 0}, }; static menuitem_t SR_EmblemHintMenu[] = @@ -1497,7 +1500,7 @@ menu_t SR_LevelSelectDef = MAPPLATTERMENUSTYLE(NULL, SR_LevelSelectMenu); menu_t SR_UnlockChecklistDef = { - NULL, + "M_SECRET", 1, &SR_MainDef, SR_UnlockChecklistMenu, @@ -4787,12 +4790,65 @@ static void M_LevelSelectWarp(INT32 choice) UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES]; +static boolean checklist_cangodown; // uuuueeerggghhhh HACK + +static void M_HandleChecklist(INT32 choice) +{ + INT32 j; + switch (choice) + { + case KEY_DOWNARROW: + S_StartSound(NULL, sfx_menu1); + if (checklist_cangodown) + { + for (j = check_on+1; j < MAXUNLOCKABLES; j++) + { + if (!(unlockables[j].name[0] == 0 //|| unlockables[j].nochecklist + || !unlockables[j].conditionset || unlockables[j].conditionset > MAXCONDITIONSETS)) + break; + } + if (j != MAXUNLOCKABLES) + check_on = j; + } + return; + + case KEY_UPARROW: + S_StartSound(NULL, sfx_menu1); + for (j = check_on-1; j > -1; j--) + { + if (!(unlockables[j].name[0] == 0 //|| unlockables[j].nochecklist + || !unlockables[j].conditionset || unlockables[j].conditionset > MAXCONDITIONSETS)) + break; + } + if (j != -1) + check_on = j; + return; + + case KEY_ESCAPE: + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + return; + default: + break; + } +} + +#define addy(add) { y += add; if ((y - currentMenu->y) > (scrollareaheight*2)) goto finishchecklist; } + static void M_DrawChecklist(void) { - INT32 i = 0, j = 0, y = currentMenu->y; + INT32 i = check_on, j = 0, y = currentMenu->y; UINT32 condnum, previd, maxcond; condition_t *cond; + // draw title (or big pic) + M_DrawMenuTitle(); + + if (check_on) + V_DrawString(10, y, V_YELLOWMAP, "\x1A"); + while (i < MAXUNLOCKABLES) { if (unlockables[i].name[0] == 0 //|| unlockables[i].nochecklist @@ -4808,68 +4864,96 @@ static void M_DrawChecklist(void) break; } if ((j != MAXUNLOCKABLES) && (unlockables[i].conditionset == unlockables[j].conditionset)) - y += 8; + addy(8) else { if ((maxcond = conditionSets[unlockables[i].conditionset-1].numconditions)) { cond = conditionSets[unlockables[i].conditionset-1].condition; previd = cond[0].id; - y += 2; - for (condnum = 0; condnum < maxcond; condnum++) + addy(2); + + if (unlockables[i].objective[0] != '/') { - if (cond[condnum].id != previd) + addy(8); + V_DrawString(currentMenu->x, y, + V_ALLOWLOWERCASE, + va("\x1E %s", unlockables[i].objective)); + } + else + { + for (condnum = 0; condnum < maxcond; condnum++) { - y += 8; - V_DrawString(currentMenu->x + 4, y, V_YELLOWMAP, "OR"); - } + if (cond[condnum].id != previd) + { + addy(8); + V_DrawString(currentMenu->x + 4, y, V_YELLOWMAP, "OR"); + } - y += 8; + addy(8); - switch (cond[condnum].type) - { - case UC_MAPBEATEN: - case UC_MAPPERFECT: - { - char *title = G_BuildMapTitle(cond[condnum].requirement); - if (title) + switch (cond[condnum].type) + { + case UC_MAPBEATEN: + case UC_MAPPERFECT: { - V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, va("\x1E %s %s", - ((cond[condnum].type == UC_MAPPERFECT) ? "Get every ring in" : "Complete"), - ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title))); - Z_Free(title); + char *title = G_BuildMapTitle(cond[condnum].requirement); + if (title) + { + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, va("\x1E %s %s", + ((cond[condnum].type == UC_MAPPERFECT) ? "Get every ring in" : "Complete"), + ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title))); + Z_Free(title); + } } - } - break; - case UC_GAMECLEAR: - case UC_ALLEMERALDS: - { - const char *emeraldtext = ((cond[condnum].type == UC_ALLEMERALDS) ? " with all emeralds" : ""); - if (cond[condnum].requirement != 1) - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE,va("\x1E Complete the game %d times%s", - cond[condnum].requirement, emeraldtext)); - else - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE, - va("\x1E Complete the game%s", emeraldtext)); - } - break; - case UC_TOTALEMBLEMS: - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE, - va("\x1E Collect %s%d emblems", ((M_CountEmblems() == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement)); - break; - default: - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE, - va("\x1E id %d, type %d, req %d", cond[condnum].id, cond[condnum].type, cond[condnum].requirement)); - break; + break; + case UC_GAMECLEAR: + case UC_ALLEMERALDS: + { + const char *emeraldtext = ((cond[condnum].type == UC_ALLEMERALDS) ? " with all emeralds" : ""); + if (cond[condnum].requirement != 1) + V_DrawString(currentMenu->x, y, + V_ALLOWLOWERCASE,va("\x1E Beat the game %d times%s", + cond[condnum].requirement, emeraldtext)); + else + V_DrawString(currentMenu->x, y, + V_ALLOWLOWERCASE, + va("\x1E Beat the game%s", emeraldtext)); + } + break; + case UC_TOTALEMBLEMS: + V_DrawString(currentMenu->x, y, + V_ALLOWLOWERCASE, + va("\x1E Collect %s%d emblems", ((M_CountEmblems() == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement)); + break; + case UC_NIGHTSGRADE: + { + // No support for specific mare information yet. + char *title = G_BuildMapTitle(cond[condnum].extrainfo1); + char grade = ('F' - (char)cond[condnum].requirement); + if (grade < 'A') + grade = 'A'; + + if (title) + { + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, va("\x1E Get grade %c in %s", + grade, + ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title))); + Z_Free(title); + } + } + break; + default: + V_DrawString(currentMenu->x, y, + V_ALLOWLOWERCASE, + va("\x1E id %d, type %d, req %d", cond[condnum].id, cond[condnum].type, cond[condnum].requirement)); + break; + } + previd = cond[condnum].id; } - previd = cond[condnum].id; } } - y += 12; + addy(12); } i = j; @@ -4880,6 +4964,12 @@ static void M_DrawChecklist(void) else V_DrawString(308, 8+(24*j), V_YELLOWMAP, "N");*/ } + +finishchecklist: + if ((checklist_cangodown = ((y - currentMenu->y) > (scrollareaheight*2)))) // haaaaaaacks. + { + V_DrawString(10, currentMenu->y+(scrollareaheight*2), V_YELLOWMAP, "\x1B"); + } } #define NUMHINTS 5 @@ -8025,7 +8115,6 @@ static void M_ToggleSFX(INT32 choice) return; case KEY_ESCAPE: - S_StartSound(NULL, sfx_menu1); if (currentMenu->prevMenu) M_SetupNextMenu(currentMenu->prevMenu); else @@ -8080,7 +8169,6 @@ static void M_ToggleDigital(INT32 choice) return; case KEY_ESCAPE: - S_StartSound(NULL, sfx_menu1); if (currentMenu->prevMenu) M_SetupNextMenu(currentMenu->prevMenu); else @@ -8132,7 +8220,6 @@ static void M_ToggleMIDI(INT32 choice) return; case KEY_ESCAPE: - S_StartSound(NULL, sfx_menu1); if (currentMenu->prevMenu) M_SetupNextMenu(currentMenu->prevMenu); else @@ -8703,7 +8790,6 @@ static void M_HandleFogColor(INT32 choice) break; case KEY_ESCAPE: - S_StartSound(NULL, sfx_menu1); exitmenu = true; break; From 785213827b977049e531b1f94735efbfa45ebb57 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Apr 2017 00:39:20 +0100 Subject: [PATCH 073/181] Made the code easier to maintain, and added support for more UC's. --- src/m_menu.c | 60 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 1fb35bb22..c5dbd87fd 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4894,15 +4894,39 @@ static void M_DrawChecklist(void) switch (cond[condnum].type) { + case UC_MAPVISITED: case UC_MAPBEATEN: + case UC_MAPALLEMERALDS: + case UC_MAPULTIMATE: case UC_MAPPERFECT: { char *title = G_BuildMapTitle(cond[condnum].requirement); + if (title) { - V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, va("\x1E %s %s", - ((cond[condnum].type == UC_MAPPERFECT) ? "Get every ring in" : "Complete"), - ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title))); + const char *beat = "!"; + const char *level = ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title); + + switch (cond[condnum].type) + { + case UC_MAPVISITED: + beat = va("\x1E Visit %s", level); + break; + case UC_MAPALLEMERALDS: + beat = va("\x1E Complete %s with all emeralds", level); + break; + case UC_MAPULTIMATE: + beat = va("\x1E Complete %s in Ultimate mode", level); + break; + case UC_MAPPERFECT: + beat = va("\x1E Get all rings in %s", level); + break; + case UC_MAPBEATEN: + default: + beat = va("\x1E Complete %s", level); + break; + } + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, beat); Z_Free(title); } } @@ -4910,15 +4934,16 @@ static void M_DrawChecklist(void) case UC_GAMECLEAR: case UC_ALLEMERALDS: { + const char *beat = "!"; const char *emeraldtext = ((cond[condnum].type == UC_ALLEMERALDS) ? " with all emeralds" : ""); if (cond[condnum].requirement != 1) - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE,va("\x1E Beat the game %d times%s", - cond[condnum].requirement, emeraldtext)); + beat = va("\x1E Beat the game %d times%s", + cond[condnum].requirement, emeraldtext); else - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE, - va("\x1E Beat the game%s", emeraldtext)); + beat = va("\x1E Beat the game%s", + emeraldtext); + + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, beat); } break; case UC_TOTALEMBLEMS: @@ -4928,17 +4953,20 @@ static void M_DrawChecklist(void) break; case UC_NIGHTSGRADE: { - // No support for specific mare information yet. char *title = G_BuildMapTitle(cond[condnum].extrainfo1); - char grade = ('F' - (char)cond[condnum].requirement); - if (grade < 'A') - grade = 'A'; if (title) { - V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, va("\x1E Get grade %c in %s", - grade, - ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title))); + const char *beat = "!"; + const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title); + char grade = ('F' - (char)cond[condnum].requirement); + if (grade < 'A') + grade = 'A'; + if (cond[condnum].extrainfo2) + beat = va("\x1E Get grade %c in %s on mare %d", grade, level, cond[condnum].extrainfo2); + else + beat = va("\x1E Get grade %c in %s", grade, level); + V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, beat); Z_Free(title); } } From aed8b0b9fdb065f23d82241e21904f3c1969606f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Apr 2017 00:49:57 +0100 Subject: [PATCH 074/181] #moreclues (except instead of clues they're sound name fixes) --- src/sounds.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index eb2f90fb5..35f025989 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -247,7 +247,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"bedeen", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic crash"}, {"bedie1", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, {"bedie2", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, - {"beeyow", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Eggman crying"}, + {"beeyow", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Failing machinery"}, {"befall", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic slam"}, {"befire", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Firing goop"}, {"beflap", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical jump"}, @@ -331,11 +331,11 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Switch click"}, {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Special stage clear"}, {"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, + {"s3k6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Burst"}, {"s3k6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"s3k6e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Mechanical damage"}, {"s3k6f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ominous rumbling"}, - {"s3k70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, + {"s3k70", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Burst"}, {"s3k71", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Basic Shield"}, {"s3k72", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Movement"}, {"s3k73", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Warp"}, @@ -346,14 +346,14 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k78", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"}, {"s3k79", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric charge"}, {"s3k7a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising from lava"}, - {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, + {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Organic bounce"}, {"s3k7c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Magnet"}, {"s3k7d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Eating dirt"}, {"s3k7f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Freeze"}, {"s3k80", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ice spike burst"}, {"s3k81", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Burst"}, - {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bursting"}, + {"s3k82", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Burst"}, {"s3k83", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Collapsing"}, {"s3k84", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, {"s3k85", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering down"}, @@ -373,7 +373,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rebuilding"}, {"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spike"}, {"s3k95", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising from lava"}, - {"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling"}, + {"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling object"}, {"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind"}, {"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling spike"}, {"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, From 8d477aefd56153f543d07d4fbbda4bc71f6de7bc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Apr 2017 01:12:00 +0100 Subject: [PATCH 075/181] Minor improvements here and there. --- src/m_menu.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index c5dbd87fd..c73ce52e7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1198,8 +1198,8 @@ static menuitem_t OP_VideoOptionsMenu[] = #endif {IT_HEADER, NULL, "Console", NULL, 85}, - {IT_STRING | IT_CVAR, NULL, "Console Background", &cons_backcolor, 91}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 96}, + {IT_STRING | IT_CVAR, NULL, "Background color", &cons_backcolor, 91}, + {IT_STRING | IT_CVAR, NULL, "Text Size", &cv_constextsize, 96}, {IT_HEADER, NULL, "Level", NULL, 105}, {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 111}, @@ -7766,7 +7766,7 @@ static void M_EraseDataResponse(INT32 ch) totalplaytime = 0; F_StartIntro(); } - S_StartSound(NULL, sfx_bewar1+M_RandomKey(3)); + S_StartSound(NULL, sfx_bewar1+M_RandomKey(4)); // Bweh heh he M_ClearMenus(true); } @@ -8435,9 +8435,6 @@ static void M_DrawVideoMode(void) } else { - V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 104, - V_YELLOWMAP, "Larger modes may have performance issues."); - M_CentreText(OP_VideoModeDef.y + 116, va("Current mode is %c%dx%d", (SCR_IsAspectCorrect(vid.width, vid.height)) ? 0x83 : 0x80, @@ -8449,10 +8446,10 @@ static void M_DrawVideoMode(void) V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 138, V_GREENMAP, "Green modes are recommended."); - V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 150, + V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 146, V_YELLOWMAP, "Other modes may have visual errors."); V_DrawCenteredString(BASEVIDWIDTH/2, OP_VideoModeDef.y + 158, - V_YELLOWMAP, "Use at own risk."); + V_YELLOWMAP, "Larger modes may have performance issues."); } // Draw the cursor for the VidMode menu From 60b7649141ff11348f52fa0e28976b751ddc6f64 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Apr 2017 18:45:54 +0100 Subject: [PATCH 076/181] Complete the secrets checklist. --- src/m_menu.c | 164 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 137 insertions(+), 27 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index c73ce52e7..b6d2af422 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4884,6 +4884,8 @@ static void M_DrawChecklist(void) { for (condnum = 0; condnum < maxcond; condnum++) { + const char *beat = "!"; + if (cond[condnum].id != previd) { addy(8); @@ -4894,6 +4896,32 @@ static void M_DrawChecklist(void) switch (cond[condnum].type) { + case UC_PLAYTIME: + { + UINT32 hours = G_TicsToHours(cond[condnum].requirement); + UINT32 minutes = G_TicsToMinutes(cond[condnum].requirement, false); + UINT32 seconds = G_TicsToSeconds(cond[condnum].requirement); + +#define getplural(field) ((field == 1) ? "" : "s") + if (hours) + { + if (minutes) + beat = va("Play the game for %d hour%s %d minute%s", hours, getplural(hours), minutes, getplural(minutes)); + else + beat = va("Play the game for %d hour%s", hours, getplural(hours)); + } + else + { + if (minutes && seconds) + beat = va("Play the game for %d minute%s %d second%s", minutes, getplural(minutes), seconds, getplural(seconds)); + else if (minutes) + beat = va("Play the game for %d minute%s", minutes, getplural(minutes)); + else + beat = va("Play the game for %d second%s", seconds, getplural(seconds)); + } +#undef getplural + } + break; case UC_MAPVISITED: case UC_MAPBEATEN: case UC_MAPALLEMERALDS: @@ -4904,79 +4932,161 @@ static void M_DrawChecklist(void) if (title) { - const char *beat = "!"; const char *level = ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title); switch (cond[condnum].type) { case UC_MAPVISITED: - beat = va("\x1E Visit %s", level); + beat = va("Visit %s", level); break; case UC_MAPALLEMERALDS: - beat = va("\x1E Complete %s with all emeralds", level); + beat = va("Beat %s with all emeralds", level); break; case UC_MAPULTIMATE: - beat = va("\x1E Complete %s in Ultimate mode", level); + beat = va("Beat %s in Ultimate mode", level); break; case UC_MAPPERFECT: - beat = va("\x1E Get all rings in %s", level); + beat = va("Get all rings in %s", level); break; case UC_MAPBEATEN: default: - beat = va("\x1E Complete %s", level); + beat = va("Beat %s", level); break; } - V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, beat); Z_Free(title); } } break; + case UC_MAPSCORE: + case UC_MAPTIME: + case UC_MAPRINGS: + { + char *title = G_BuildMapTitle(cond[condnum].extrainfo1); + + if (title) + { + const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title); + + switch (cond[condnum].type) + { + case UC_MAPSCORE: + beat = va("Get %d points in %s", cond[condnum].requirement, level); + break; + case UC_MAPTIME: + beat = va("Beat %s in %d:%d.%d", level, + G_TicsToMinutes(cond[condnum].requirement, true), + G_TicsToSeconds(cond[condnum].requirement), + G_TicsToCentiseconds(cond[condnum].requirement)); + break; + case UC_MAPRINGS: + beat = va("Get %d rings in %s", cond[condnum].requirement, level); + break; + default: + break; + } + Z_Free(title); + } + } + break; + case UC_OVERALLSCORE: + case UC_OVERALLTIME: + case UC_OVERALLRINGS: + { + switch (cond[condnum].type) + { + case UC_OVERALLSCORE: + beat = va("Get %d points over all maps", cond[condnum].requirement); + break; + case UC_OVERALLTIME: + beat = va("Get a total time of less than %d:%d.%d", + G_TicsToMinutes(cond[condnum].requirement, true), + G_TicsToSeconds(cond[condnum].requirement), + G_TicsToCentiseconds(cond[condnum].requirement)); + break; + case UC_OVERALLRINGS: + beat = va("Get %d rings over all maps", cond[condnum].requirement); + break; + default: + break; + } + } + break; case UC_GAMECLEAR: case UC_ALLEMERALDS: { - const char *beat = "!"; const char *emeraldtext = ((cond[condnum].type == UC_ALLEMERALDS) ? " with all emeralds" : ""); if (cond[condnum].requirement != 1) - beat = va("\x1E Beat the game %d times%s", + beat = va("Beat the game %d times%s", cond[condnum].requirement, emeraldtext); else - beat = va("\x1E Beat the game%s", + beat = va("Beat the game%s", emeraldtext); - - V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, beat); } break; case UC_TOTALEMBLEMS: - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE, - va("\x1E Collect %s%d emblems", ((M_CountEmblems() == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement)); + beat = va("Collect %s%d emblems", ((numemblems+numextraemblems == cond[condnum].requirement) ? "all " : ""), cond[condnum].requirement); break; + case UC_NIGHTSTIME: + case UC_NIGHTSSCORE: case UC_NIGHTSGRADE: { char *title = G_BuildMapTitle(cond[condnum].extrainfo1); if (title) { - const char *beat = "!"; const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title); - char grade = ('F' - (char)cond[condnum].requirement); - if (grade < 'A') - grade = 'A'; - if (cond[condnum].extrainfo2) - beat = va("\x1E Get grade %c in %s on mare %d", grade, level, cond[condnum].extrainfo2); - else - beat = va("\x1E Get grade %c in %s", grade, level); - V_DrawString(currentMenu->x, y, V_ALLOWLOWERCASE, beat); + + switch (cond[condnum].type) + { + case UC_NIGHTSSCORE: + if (cond[condnum].extrainfo2) + beat = va("Get %d points in %s, mare %d", cond[condnum].requirement, level, cond[condnum].extrainfo2); + else + beat = va("Get %d points in %s", cond[condnum].requirement, level); + break; + case UC_NIGHTSTIME: + if (cond[condnum].extrainfo2) + beat = va("Beat %s, mare %d in %d:%d.%d", level, cond[condnum].extrainfo2, + G_TicsToMinutes(cond[condnum].requirement, true), + G_TicsToSeconds(cond[condnum].requirement), + G_TicsToCentiseconds(cond[condnum].requirement)); + else + beat = va("Beat %s in %d:%d.%d", + level, + G_TicsToMinutes(cond[condnum].requirement, true), + G_TicsToSeconds(cond[condnum].requirement), + G_TicsToCentiseconds(cond[condnum].requirement)); + break; + case UC_NIGHTSGRADE: + { + char grade = ('F' - (char)cond[condnum].requirement); + if (grade < 'A') + grade = 'A'; + if (cond[condnum].extrainfo2) + beat = va("Get grade %c in %s, mare %d", grade, level, cond[condnum].extrainfo2); + else + beat = va("Get grade %c in %s", grade, level); + } + break; + default: + break; + } Z_Free(title); } } break; + case UC_TRIGGER: + case UC_EMBLEM: + case UC_CONDITIONSET: default: - V_DrawString(currentMenu->x, y, - V_ALLOWLOWERCASE, - va("\x1E id %d, type %d, req %d", cond[condnum].id, cond[condnum].type, cond[condnum].requirement)); + y -= 8; // Nope, not showing this. break; } + if (beat[0] != '!') + { + V_DrawString(currentMenu->x, y, 0, "\x1E"); + V_DrawString(currentMenu->x+12, y, V_ALLOWLOWERCASE, beat); + } previd = cond[condnum].id; } } From 18ad6a3a0d96b71b4d7eadeb67fa1c3b6f05577a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Apr 2017 15:38:22 +0100 Subject: [PATCH 077/181] Minor tweak to the balance of GFZ3. --- src/info.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index e38219046..440024458 100644 --- a/src/info.c +++ b/src/info.c @@ -926,13 +926,13 @@ state_t states[NUMSTATES] = {SPR_EGGM, 20, 2, {NULL}, 0, 0, S_EGGMOBILE_STND}, // S_EGGMOBILE_RATK10 {SPR_EGGM, 3, 12, {NULL}, 0, 0, S_EGGMOBILE_PANIC2}, // S_EGGMOBILE_PANIC1 {SPR_EGGM, 4, 4, {A_Boss1Spikeballs}, 0, 4, S_EGGMOBILE_PANIC3}, // S_EGGMOBILE_PANIC2 - {SPR_EGGM, 3, 5, {NULL}, 0, 0, S_EGGMOBILE_PANIC4}, // S_EGGMOBILE_PANIC3 + {SPR_EGGM, 3, 8, {NULL}, 0, 0, S_EGGMOBILE_PANIC4}, // S_EGGMOBILE_PANIC3 {SPR_EGGM, 4, 4, {A_Boss1Spikeballs}, 1, 4, S_EGGMOBILE_PANIC5}, // S_EGGMOBILE_PANIC4 - {SPR_EGGM, 3, 5, {NULL}, 0, 0, S_EGGMOBILE_PANIC6}, // S_EGGMOBILE_PANIC5 + {SPR_EGGM, 3, 8, {NULL}, 0, 0, S_EGGMOBILE_PANIC6}, // S_EGGMOBILE_PANIC5 {SPR_EGGM, 4, 4, {A_Boss1Spikeballs}, 2, 4, S_EGGMOBILE_PANIC7}, // S_EGGMOBILE_PANIC6 - {SPR_EGGM, 3, 5, {NULL}, 0, 0, S_EGGMOBILE_PANIC8}, // S_EGGMOBILE_PANIC7 + {SPR_EGGM, 3, 8, {NULL}, 0, 0, S_EGGMOBILE_PANIC8}, // S_EGGMOBILE_PANIC7 {SPR_EGGM, 4, 4, {A_Boss1Spikeballs}, 3, 4, S_EGGMOBILE_PANIC9}, // S_EGGMOBILE_PANIC8 - {SPR_EGGM, 3, 5, {NULL}, 0, 0, S_EGGMOBILE_PANIC10},// S_EGGMOBILE_PANIC9 + {SPR_EGGM, 3, 8, {NULL}, 0, 0, S_EGGMOBILE_PANIC10},// S_EGGMOBILE_PANIC9 {SPR_EGGM, 0, 35, {A_SkullAttack}, 0, 0, S_EGGMOBILE_STND}, // S_EGGMOBILE_PANIC10 {SPR_EGGM, 21, 24, {A_Pain}, 0, 0, S_EGGMOBILE_PAIN2}, // S_EGGMOBILE_PAIN {SPR_EGGM, 21, 16, {A_SkullAttack}, 1, 1, S_EGGMOBILE_STND}, // S_EGGMOBILE_PAIN2 @@ -4097,7 +4097,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - 2*FRACUNIT, // speed + 4*FRACUNIT, // speed 13*FRACUNIT, // radius 26*FRACUNIT, // height 0, // display offset From 4e96f624e790877d1faa2ce0b570ed29c4b9352b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Apr 2017 20:33:39 +0100 Subject: [PATCH 078/181] Split off part of P_SpawnSpecials into a new function called P_InitSpecials This allows tag lists, gravity, weather, and the "CheckFor" vars to be initialised before running P_LoadThings or P_ResetDynamicSlopes, in case they could affect mobj spawning or cause a netgame desync somehow by carrying over the previous level's values --- src/p_setup.c | 6 +++-- src/p_spec.c | 62 ++++++++++++++++++++++++++++++++------------------- src/p_spec.h | 1 + 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index a0c745e60..43c152035 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2732,6 +2732,10 @@ boolean P_SetupLevel(boolean skipprecip) P_PrepareThings(lastloadedmaplumpnum + ML_THINGS); + // init gravity, tag lists, + // anything that P_ResetDynamicSlopes/P_LoadThings needs to know + P_InitSpecials(); + #ifdef ESLOPE P_ResetDynamicSlopes(); #endif @@ -2750,8 +2754,6 @@ boolean P_SetupLevel(boolean skipprecip) if (loadprecip) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame) P_SpawnPrecipitation(); - globalweather = mapheaderinfo[gamemap-1]->weather; - #ifdef HWRENDER // not win32 only 19990829 by Kin if (rendermode != render_soft && rendermode != render_none) { diff --git a/src/p_spec.c b/src/p_spec.c index db7b852f5..75eec033c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5546,6 +5546,45 @@ static void P_RunLevelLoadExecutors(void) } } +/** Before things are loaded, initialises certain stuff in case they're needed + * by P_ResetDynamicSlopes or P_LoadThings. This was split off from + * P_SpawnSpecials, in case you couldn't tell. + * + * \sa P_SpawnSpecials, P_InitTagLists + * \author Monster Iestyn + */ +void P_InitSpecials(void) +{ + // Set the default gravity. Custom gravity overrides this setting. + gravity = FRACUNIT/2; + + // Defaults in case levels don't have them set. + sstimer = 90*TICRATE + 6; + totalrings = 1; + + CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false; + + // Set curWeather + switch (mapheaderinfo[gamemap-1]->weather) + { + case PRECIP_SNOW: // snow + case PRECIP_RAIN: // rain + case PRECIP_STORM: // storm + case PRECIP_STORM_NORAIN: // storm w/o rain + case PRECIP_STORM_NOSTRIKES: // storm w/o lightning + curWeather = mapheaderinfo[gamemap-1]->weather; + break; + default: // blank/none + curWeather = PRECIP_NONE: + break; + } + + // Set globalweather + globalweather = mapheaderinfo[gamemap-1]->weather; + + P_InitTagLists(); // Create xref tables for tags +} + /** After the map has loaded, scans for specials that spawn 3Dfloors and * thinkers. * @@ -5567,15 +5606,6 @@ void P_SpawnSpecials(INT32 fromnetsave) // but currently isn't. (void)fromnetsave; - // Set the default gravity. Custom gravity overrides this setting. - gravity = FRACUNIT/2; - - // Defaults in case levels don't have them set. - sstimer = 90*TICRATE + 6; - totalrings = 1; - - CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false; - // Init special SECTORs. sector = sectors; for (i = 0; i < numsectors; i++, sector++) @@ -5624,20 +5654,6 @@ void P_SpawnSpecials(INT32 fromnetsave) } } - if (mapheaderinfo[gamemap-1]->weather == 2) // snow - curWeather = PRECIP_SNOW; - else if (mapheaderinfo[gamemap-1]->weather == 3) // rain - curWeather = PRECIP_RAIN; - else if (mapheaderinfo[gamemap-1]->weather == 1) // storm - curWeather = PRECIP_STORM; - else if (mapheaderinfo[gamemap-1]->weather == 5) // storm w/o rain - curWeather = PRECIP_STORM_NORAIN; - else if (mapheaderinfo[gamemap-1]->weather == 6) // storm w/o lightning - curWeather = PRECIP_STORM_NOSTRIKES; - else - curWeather = PRECIP_NONE; - - P_InitTagLists(); // Create xref tables for tags P_SearchForDisableLinedefs(); // Disable linedefs are now allowed to disable *any* line P_SpawnScrollers(); // Add generalized scrollers diff --git a/src/p_spec.h b/src/p_spec.h index e34b0d08e..c7c5d7031 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -32,6 +32,7 @@ void P_InitPicAnims(void); void P_SetupLevelFlatAnims(void); // at map load +void P_InitSpecials(void); void P_SpawnSpecials(INT32 fromnetsave); // every tic From 922603fbcaee1b3877e8dcc4a9f87e5a159b5305 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Apr 2017 20:39:32 +0100 Subject: [PATCH 079/181] Fix V_DrawCroppedPatch's handling of topdeltas. --- src/v_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index 3c025d306..b4bd0cd58 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -845,7 +845,7 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ dest = desttop; dest += FixedInt(FixedMul(topdelta<>FRACBITS) < column->length && (ofs>>FRACBITS) < h; ofs += rowfrac) + for (ofs = sy<>FRACBITS) < column->length && ((ofs>>FRACBITS) + topdelta) < h; ofs += rowfrac) { if (dest >= screens[scrn&V_PARAMMASK]) // don't draw off the top of the screen (CRASH PREVENTION) *dest = source[ofs>>FRACBITS]; From 13cb656f0bd10c1e9dd398f0a5217f245925de28 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Apr 2017 20:43:58 +0100 Subject: [PATCH 080/181] Whoops forgot this --- 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 75eec033c..e5f8d57ec 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5575,7 +5575,7 @@ void P_InitSpecials(void) curWeather = mapheaderinfo[gamemap-1]->weather; break; default: // blank/none - curWeather = PRECIP_NONE: + curWeather = PRECIP_NONE; break; } From f099782c912896941eb98014b4a45d1baf060fce Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Apr 2017 21:05:28 +0100 Subject: [PATCH 081/181] Spinning/swinging maces/chains and Particle generators can now use P_FindSpecialLineFromTag! --- src/p_mobj.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b7cb83881..861dac3a6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9754,20 +9754,16 @@ void P_SpawnMapThing(mapthing_t *mthing) mobjtype_t macetype = MT_SMALLMACE; boolean firsttime; mobj_t *spawnee; - size_t line; + INT32 line; const size_t mthingi = (size_t)(mthing - mapthings); - // Why does P_FindSpecialLineFromTag not work here?!? - // Monster Iestyn: tag lists haven't been initialised yet for the map, that's why - for (line = 0; line < numlines; line++) - { - if (lines[line].special == 9 && lines[line].tag == mthing->angle) - break; - } + // Find the corresponding linedef special, using angle as tag + // P_FindSpecialLineFromTag works here now =D + line = P_FindSpecialLineFromTag(9, mthing->angle, -1); - if (line == numlines) + if (line == -1) { - CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); + CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs to be tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); return; } /* @@ -9865,18 +9861,15 @@ ML_NOCLIMB : Direction not controllable fixed_t radius, speed, bottomheight, topheight; INT32 type, numdivisions, time, anglespeed; angle_t angledivision; - size_t line; + INT32 line; const size_t mthingi = (size_t)(mthing - mapthings); - for (line = 0; line < numlines; line++) - { - if (lines[line].special == 15 && lines[line].tag == mthing->angle) - break; - } + // Find the corresponding linedef special, using angle as tag + line = P_FindSpecialLineFromTag(15, mthing->angle, -1); - if (line == numlines) + if (line == -1) { - CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); + CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs to be tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); return; } From c7c908eed3a518c3c0f44d5243ce8e87f9656143 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Apr 2017 21:56:17 +0100 Subject: [PATCH 082/181] Emerald tokens being used as actual game tokens on the end-of-act screen! https://gfycat.com/PlumpShowyBream https://gfycat.com/AlarmingLoathsomeBelugawhale --- src/doomstat.h | 1 + src/g_game.c | 5 ++--- src/hu_stuff.c | 2 +- src/hu_stuff.h | 1 + src/y_inter.c | 57 +++++++++++++++++++++++++++++++++++++++++++------- 5 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 9034fd62a..a3b07c9cb 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -379,6 +379,7 @@ nightsdata_t ntemprecords; extern UINT32 token; ///< Number of tokens collected in a level extern UINT32 tokenlist; ///< List of tokens collected +extern boolean gottoken; ///< Did you get a token? Used for end of act extern INT32 tokenbits; ///< Used for setting token bits extern INT32 sstimer; ///< Time allotted in the special stage extern UINT32 bluescore; ///< Blue Team Scores diff --git a/src/g_game.c b/src/g_game.c index bdfea10d5..db06edf46 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -156,6 +156,7 @@ UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage. UINT16 emeralds; UINT32 token; // Number of tokens collected in a level UINT32 tokenlist; // List of tokens collected +boolean gottoken; // Did you get a token? Used for end of act INT32 tokenbits; // Used for setting token bits // Old Special Stage @@ -2780,7 +2781,6 @@ static INT16 RandMap(INT16 tolflags, INT16 pprevmap) static void G_DoCompleted(void) { INT32 i; - boolean gottoken = false; tokenlist = 0; // Reset the list @@ -2866,10 +2866,9 @@ static void G_DoCompleted(void) if (nextmap >= 1100-1 && nextmap <= 1102-1 && (gametype == GT_RACE || gametype == GT_COMPETITION)) nextmap = (INT16)(spstage_start-1); - if (gametype == GT_COOP && token) + if ((gottoken = (gametype == GT_COOP && token))) { token--; - gottoken = true; if (!(emeralds & EMERALD1)) nextmap = (INT16)(sstage_start - 1); // Special Stage 1 diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 30b2a1263..365ea093b 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -91,7 +91,7 @@ patch_t *tallminus; patch_t *emeraldpics[7]; patch_t *tinyemeraldpics[7]; static patch_t *emblemicon; -static patch_t *tokenicon; +patch_t *tokenicon; //------------------------------------------- // misc vars diff --git a/src/hu_stuff.h b/src/hu_stuff.h index c2654d209..9bfb42912 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -71,6 +71,7 @@ extern patch_t *rmatcico; extern patch_t *bmatcico; extern patch_t *tagico; extern patch_t *tallminus; +extern patch_t *tokenicon; // set true when entering a chat message extern boolean chat_on; diff --git a/src/y_inter.c b/src/y_inter.c index c730745d5..f639addd3 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -147,6 +147,7 @@ static boolean useinterpic; static INT32 timer; static INT32 intertic; +static INT32 tallydonetic = -1; static INT32 endtic = -1; intertype_t intertype = int_none; @@ -159,6 +160,40 @@ static void Y_CalculateMatchWinners(void); static void Y_FollowIntermission(void); static void Y_UnloadData(void); +static void Y_IntermissionTokenDrawer(void) +{ + INT32 y; + INT32 offs = 0; + UINT32 tokencount; + INT32 lowy = BASEVIDHEIGHT - 32; + INT16 temp = SHORT(tokenicon->height)/2; + INT32 calc; + + if (tallydonetic != -1) + { + offs = (intertic - tallydonetic)*2; + if (offs > 10) + offs = 8; + } + + V_DrawFill(32, lowy-1, 16, 1, 31); // slot + + y = (lowy + offs + 1) - (temp + (token + 1)*8); + + for (tokencount = token; tokencount; tokencount--) + { + if (y >= -temp) + V_DrawSmallScaledPatch(32, y, 0, tokenicon); + y += 8; + } + + y += (offs*(temp - 1)/8); + calc = (lowy - y)*2; + + if (calc > 0) + V_DrawCroppedPatch(32<width), calc); +} + // // Y_IntermissionDrawer // @@ -203,6 +238,9 @@ void Y_IntermissionDrawer(void) { INT32 bonusy; + if (gottoken) // first to be behind everything else + Y_IntermissionTokenDrawer(); + // draw score V_DrawScaledPatch(hudinfo[HUD_SCORE].x, hudinfo[HUD_SCORE].y, V_SNAPTOLEFT, sboscore); V_DrawTallNum(hudinfo[HUD_SCORENUM].x, hudinfo[HUD_SCORENUM].y, V_SNAPTOLEFT, data.coop.score); @@ -261,6 +299,9 @@ void Y_IntermissionDrawer(void) INT32 xoffset3 = 0; // Line 3 x offset UINT8 drawsection = 0; + if (gottoken) // first to be behind everything else + Y_IntermissionTokenDrawer(); + // draw the header if (intertic <= TICRATE) animatetic = 0; @@ -679,7 +720,10 @@ void Y_Ticker(void) boolean anybonuses = false; if (!intertic) // first time only + { S_ChangeMusicInternal("_clear", false); // don't loop it + tallydonetic = -1; + } if (intertic < TICRATE) // one second pause before tally begins return; @@ -709,6 +753,7 @@ void Y_Ticker(void) if (!anybonuses) { + tallydonetic = intertic; endtic = intertic + 3*TICRATE; // 3 second pause after end of tally S_StartSound(NULL, sfx_chchng); // cha-ching! @@ -736,12 +781,11 @@ void Y_Ticker(void) INT32 i; UINT32 oldscore = data.spec.score; boolean skip = false; - static INT32 tallydonetic = 0; if (!intertic) // first time only { S_ChangeMusicInternal("_clear", false); // don't loop it - tallydonetic = 0; + tallydonetic = -1; } if (intertic < TICRATE) // one second pause before tally begins @@ -751,9 +795,9 @@ void Y_Ticker(void) if (playeringame[i] && (players[i].cmd.buttons & BT_USE)) skip = true; - if (tallydonetic != 0) + if ((data.spec.continues & 0x80) && tallydonetic != -1) { - if (intertic > tallydonetic) + if ((intertic - tallydonetic) > (3*TICRATE)/2) { endtic = intertic + 4*TICRATE; // 4 second pause after end of tally S_StartSound(NULL, sfx_s3kac); // cha-ching! @@ -772,9 +816,8 @@ void Y_Ticker(void) if (!data.spec.bonus.points) { - if (data.spec.continues & 0x80) // don't set endtic yet! - tallydonetic = intertic + (3*TICRATE)/2; - else // okay we're good. + tallydonetic = intertic; + if (!(data.spec.continues & 0x80)) // don't set endtic yet! endtic = intertic + 4*TICRATE; // 4 second pause after end of tally S_StartSound(NULL, sfx_chchng); // cha-ching! From 8ae91de9db00a8570d8ce69eaca6719e8e437ac7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 25 Apr 2017 16:03:51 +0100 Subject: [PATCH 083/181] Per Inu's request, semi-broken (both game mechanically and engineering wise) directional information has been removed from the Captions. It's now "in-level" (dot) and "sourceless" (no dot) only. --- src/screen.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/screen.c b/src/screen.c index ca1e6b659..1c37f8a07 100644 --- a/src/screen.c +++ b/src/screen.c @@ -473,25 +473,8 @@ void SCR_ClosedCaptions(void) flags |= (((20-closedcaptions[i].t)/2)*V_10TRANS); else if (closedcaptions[i].t > TICRATE) y -= (closedcaptions[i].t-- - TICRATE)*vid.dupy; - if (closedcaptions[i].c) - { - const mobj_t *o = (const mobj_t *)closedcaptions[i].c->origin; - if (o) - { - if (!splitscreen) - { - angle_t angle = R_PointToAngle(o->x, o->y) - localangle; - if (angle > ANGLE_45 && angle < ANGLE_135) - dir = '\x1C'; - else if (angle > ANGLE_225 && angle < ANGLE_315) - dir = '\x1D'; - else - dir = '\x1E'; - } - else - dir = '\x1E'; - } - } + if (closedcaptions[i].c && closedcaptions[i].c->origin) + dir = '\x1E'; V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, flags, va("%c [%s]", dir, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); } From d4c330678a0a4c227d64586284840aa9dff7d12b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 25 Apr 2017 20:39:32 +0100 Subject: [PATCH 084/181] level header's "forcecharacter" parameter doesn't take skin numbers anymore, so this isn't needed! --- src/p_setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 43c152035..0bb4c5b80 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2574,8 +2574,7 @@ boolean P_SetupLevel(boolean skipprecip) postimgtype = postimgtype2 = postimg_none; - if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0' - && atoi(mapheaderinfo[gamemap-1]->forcecharacter) != 255) + if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0') P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter); // chasecam on in chaos, race, coop From 6c619af9ce5d177123ec5a1d7c3ac8127c0231ea Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 26 Apr 2017 17:12:57 +0100 Subject: [PATCH 085/181] Use the skybox mobj's actual z position, rather than using the spawnpoint angle! This means setting the skybox view angle is no longer stupid, objectplace no longer breaks skyboxes, and Lua-defined skybox mobjs can actually set a Z position more easily now. --- src/p_mobj.c | 1 - src/r_main.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 17d5d13b3..6b2d1af30 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9717,7 +9717,6 @@ void P_SpawnMapThing(mapthing_t *mthing) switch(mobj->type) { case MT_SKYBOX: - mobj->angle = 0; if (mthing->options & MTF_OBJECTSPECIAL) skyboxmo[1] = mobj; else diff --git a/src/r_main.c b/src/r_main.c index f03af9963..c998a7d93 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -798,9 +798,7 @@ void R_SkyboxFrame(player_t *player) viewx = viewmobj->x; viewy = viewmobj->y; - viewz = 0; - if (viewmobj->spawnpoint) - viewz = ((fixed_t)viewmobj->spawnpoint->angle)<z; // 26/04/17: use actual Z position instead of spawnpoint angle! if (mapheaderinfo[gamemap-1]) { From bdb3c2ea0ee677c9b225e2e6d96950d9909627e8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 26 Apr 2017 18:16:01 +0100 Subject: [PATCH 086/181] extrainfo now determines "skybox ID", a number between 0 and 16 to identify the viewpoint or centerpoint also I made that change skybox linedef exec special I guess (linedef type 448) --- src/p_mobj.c | 4 ++-- src/p_setup.c | 6 ++++++ src/p_spec.c | 36 +++++++++++++++++++++++++++++++++++- src/p_spec.h | 4 +++- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6b2d1af30..55d10b3bf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9718,9 +9718,9 @@ void P_SpawnMapThing(mapthing_t *mthing) { case MT_SKYBOX: if (mthing->options & MTF_OBJECTSPECIAL) - skyboxmo[1] = mobj; + skyboxcenterpnts[mthing->extrainfo] = mobj; else - skyboxmo[0] = mobj; + skyboxviewpnts[mthing->extrainfo] = mobj; break; case MT_FAN: if (mthing->options & MTF_OBJECTSPECIAL) diff --git a/src/p_setup.c b/src/p_setup.c index a0c745e60..981baf2e2 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2728,6 +2728,9 @@ boolean P_SetupLevel(boolean skipprecip) for (i = 0; i < 2; i++) skyboxmo[i] = NULL; + for (i = 0; i < 16; i++) + skyboxviewpnts[i] = skyboxcenterpnts[i] = NULL; + P_MapStart(); P_PrepareThings(lastloadedmaplumpnum + ML_THINGS); @@ -2737,6 +2740,9 @@ boolean P_SetupLevel(boolean skipprecip) #endif P_LoadThings(); + // skybox mobj defaults + skyboxmo[0] = skyboxviewpnts[0]; + skyboxmo[1] = skyboxcenterpnts[0]; P_SpawnSecretItems(loademblems); diff --git a/src/p_spec.c b/src/p_spec.c index db7b852f5..7be9c96ea 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -46,7 +46,9 @@ #include #endif -mobj_t *skyboxmo[2]; +mobj_t *skyboxmo[2]; // current skybox mobjs: 0 = viewpoint, 1 = centerpoint +mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs +mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs // Amount (dx, dy) vector linedef is shifted right to get scroll amount #define SCROLL_SHIFT 5 @@ -3159,6 +3161,38 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } break; + case 448: // Change skybox viewpoint/centerpoint + if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || (line->flags & ML_NOCLIMB)) + { + INT32 viewid = sides[line->sidenum[0]].textureoffset>>FRACBITS; + INT32 centerid = sides[line->sidenum[0]].rowoffset>>FRACBITS; + + // set viewpoint mobj + if (!(line->flags & ML_EFFECT4)) + { + if (viewid >= 0 && viewid < 16) + skyboxmo[0] = skyboxviewpnts[viewid]; + else + skyboxmo[0] = NULL; + } + + // set centerpoint mobj + if (line->flags & ML_BLOCKMONSTERS) + { + if (centerid >= 0 && centerid < 16) + skyboxmo[1] = skyboxcenterpnts[centerid]; + else + skyboxmo[1] = NULL; + } + + CONS_Debug(DBG_GAMELOGIC, "Line type 448 Executor: viewid = %d, centerid = %d, viewpoint? = %s, centerpoint? = %s\n", + viewid, + centerid, + ((line->flags & ML_EFFECT4) ? "no" : "yes"), + ((line->flags & ML_BLOCKMONSTERS) ? "yes" : "no")); + } + break; + case 450: // Execute Linedef Executor - for recursion P_LinedefExecute(line->tag, mo, NULL); break; diff --git a/src/p_spec.h b/src/p_spec.h index e34b0d08e..222df822d 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -17,7 +17,9 @@ #ifndef __P_SPEC__ #define __P_SPEC__ -extern mobj_t *skyboxmo[2]; +extern mobj_t *skyboxmo[2]; // current skybox mobjs: 0 = viewpoint, 1 = centerpoint +extern mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs +extern mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs // GETSECSPECIAL (specialval, section) // From 21950687edaaae07c88cdeb9776e196650356679 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 26 Apr 2017 21:34:22 +0100 Subject: [PATCH 087/181] Make sure noreload levels don't do anything weird with the skybox mobj pointers, especially if Lua was involved We can assume skyboxviewpnts/skyboxcenterpnts sort themselves out from reloading all the Things at least I guess? --- src/p_setup.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/p_setup.c b/src/p_setup.c index 981baf2e2..02a621845 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2276,6 +2276,17 @@ void P_LoadThingsOnly(void) // Search through all the thinkers. mobj_t *mo; thinker_t *think; + INT32 i, viewid = -1, centerid = -1; // for skyboxes + + // check if these are any of the normal viewpoint/centerpoint mobjs in the level or not + if (skyboxmo[0] || skyboxmo[1]) + for (i = 0; i < 16; i++) + { + if (skyboxmo[0] && skyboxmo[0] == skyboxviewpnts[i]) + viewid = i; // save id just in case + if (skyboxmo[1] && skyboxmo[1] == skyboxcenterpnts[i]) + centerid = i; // save id just in case + } for (think = thinkercap.next; think != &thinkercap; think = think->next) { @@ -2293,6 +2304,10 @@ void P_LoadThingsOnly(void) P_PrepareThings(lastloadedmaplumpnum + ML_THINGS); P_LoadThings(); + // restore skybox viewpoint/centerpoint if necessary, set them to defaults if we can't do that + skyboxmo[0] = skyboxviewpnts[(viewid >= 0) ? viewid : 0]; + skyboxmo[1] = skyboxcenterpnts[(centerid >= 0) ? centerid : 0]; + P_SpawnSecretItems(true); } From 2d9c37d800e1a921b31193c868094329cb49cfe1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 28 Apr 2017 22:45:17 +0100 Subject: [PATCH 088/181] MONITORS IS UNFUCKED A less memetic message: On permission of Mystic, rejiggered a few things such that Race uses cv_competitionboxes, allowing the menu to be nicer. Also: * disabled the doomednum for ? boxes * made A_MixUp play sfx_lose if you're in a gametype that can't use it * Removed the all-teleporters option from cv_competitionboxes. It could just be done by tweaking the random monitor toggles, anyways. --- src/d_netcmd.c | 2 +- src/info.c | 2 +- src/m_menu.c | 63 ++++++++++++++++++++++++++------------------------ src/p_enemy.c | 3 +++ src/p_mobj.c | 2 +- 5 files changed, 39 insertions(+), 33 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3a80519ef..c95c9d599 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -189,7 +189,7 @@ static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2 static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}}; static CV_PossibleValue_t sleeping_cons_t[] = {{-1, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}}; -static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"}, +static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, //{2, "Teleports"}, {3, "None"}, {0, NULL}}; static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"}, diff --git a/src/info.c b/src/info.c index 440024458..ed2693bdf 100644 --- a/src/info.c +++ b/src/info.c @@ -6453,7 +6453,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_MYSTERY_BOX - 412, // doomednum + -1, //412, // doomednum S_MYSTERY_BOX, // spawnstate 1, // spawnhealth S_NULL, // seestate diff --git a/src/m_menu.c b/src/m_menu.c index b6d2af422..b465adf55 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1377,39 +1377,42 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 31}, #endif - {IT_STRING | IT_CVAR, NULL, "Force character", &cv_forceskin, 41}, - {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 46}, - {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 51}, - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 56}, + {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 41}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 46}, - {IT_HEADER, NULL, "Platform (Coop, Race, Competition)", NULL, 65}, - {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 71}, - {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 76}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 81}, + {IT_HEADER, NULL, "Characters", NULL, 55}, + {IT_STRING | IT_CVAR, NULL, "Force a character", &cv_forceskin, 61}, + {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 66}, - {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 90}, - {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 96}, - {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 101}, - {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 106}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 111}, + {IT_HEADER, NULL, "Items", NULL, 75}, + {IT_STRING | IT_CVAR, NULL, "Item respawn delay", &cv_itemrespawntime, 81}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 86}, - {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 121}, - {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 126}, + {IT_HEADER, NULL, "Platform (Coop, Race, Competition)", NULL, 95}, + {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 101}, + {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 106}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 111}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 136}, - {IT_STRING | IT_CVAR, NULL, "Item respawn delay", &cv_itemrespawntime, 141}, - {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 146}, + {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 120}, + {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 126}, + {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 131}, + {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 136}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 141}, - {IT_STRING | IT_CVAR, NULL, "Flag respawn delay", &cv_flagtime, 156}, - {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 161}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 151}, + {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 156}, + {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 161}, - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 171}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 176}, + {IT_STRING | IT_CVAR, NULL, "Flag respawn delay", &cv_flagtime, 171}, + {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 176}, + + {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 186}, + {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 191}, #ifndef NONET - {IT_HEADER, NULL, "Advanced", NULL, 185}, - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 191}, - {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 205}, + {IT_HEADER, NULL, "Advanced", NULL, 200}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 206}, + {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 220}, #endif }; @@ -7434,8 +7437,8 @@ static void M_ServerOptions(INT32 choice) OP_ServerOptionsMenu[ 2].status = IT_GRAYEDOUT; // Max players OP_ServerOptionsMenu[ 3].status = IT_GRAYEDOUT; // Allow WAD downloading OP_ServerOptionsMenu[ 4].status = IT_GRAYEDOUT; // Allow players to join - OP_ServerOptionsMenu[28].status = IT_GRAYEDOUT; // Master server - OP_ServerOptionsMenu[29].status = IT_GRAYEDOUT; // Attempts to resynchronise + OP_ServerOptionsMenu[30].status = IT_GRAYEDOUT; // Master server + OP_ServerOptionsMenu[31].status = IT_GRAYEDOUT; // Attempts to resynchronise } else { @@ -7444,10 +7447,10 @@ static void M_ServerOptions(INT32 choice) OP_ServerOptionsMenu[ 3].status = IT_STRING | IT_CVAR; OP_ServerOptionsMenu[ 4].status = IT_STRING | IT_CVAR; if (netgame) - OP_ServerOptionsMenu[28].status = IT_GRAYEDOUT; + OP_ServerOptionsMenu[30].status = IT_GRAYEDOUT; else - OP_ServerOptionsMenu[28].status = IT_STRING | IT_CVAR | IT_CV_STRING; - OP_ServerOptionsMenu[29].status = IT_STRING | IT_CVAR; + OP_ServerOptionsMenu[30].status = IT_STRING | IT_CVAR | IT_CV_STRING; + OP_ServerOptionsMenu[31].status = IT_STRING | IT_CVAR; } #endif diff --git a/src/p_enemy.c b/src/p_enemy.c index c1c6c5ebb..88e00e95b 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -5602,7 +5602,10 @@ void A_MixUp(mobj_t *actor) // No mix-up monitors in hide and seek or time only race. // The random factor is okay for other game modes, but in these, it is cripplingly unfair. if (gametype == GT_HIDEANDSEEK || gametype == GT_RACE) + { + S_StartSound(actor, sfx_lose); return; + } numplayers = 0; memset(teleported, 0, sizeof (teleported)); diff --git a/src/p_mobj.c b/src/p_mobj.c index 58f0c2087..4ebc33034 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9509,7 +9509,7 @@ void P_SpawnMapThing(mapthing_t *mthing) // Yeah, this is a dirty hack. if ((mobjinfo[i].flags & (MF_MONITOR|MF_GRENADEBOUNCE)) == MF_MONITOR) { - if (gametype == GT_COMPETITION) + if (gametype == GT_COMPETITION || gametype == GT_RACE) { // Set powerup boxes to user settings for competition. if (cv_competitionboxes.value == 1) // Random From deba4dcf0d2a2de10c0f542f7562ef9212a835d4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 28 Apr 2017 22:46:21 +0100 Subject: [PATCH 089/181] Made updating the captions a part of S_UpdateSound(), not SCR_ClosedCaptions() (which really should have been render-only all along). --- src/s_sound.c | 29 ++++++++++++++++++++++++----- src/screen.c | 20 -------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 3993d7f98..6ac886034 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -813,6 +813,7 @@ static INT32 actualmidimusicvolume; void S_UpdateSounds(void) { INT32 audible, cnum, volume, sep, pitch; + UINT8 i; channel_t *c; listener_t listener; @@ -840,9 +841,7 @@ void S_UpdateSounds(void) I_UpdateMumble(NULL, listener); #endif - // Stop cutting FMOD out. WE'RE sick of it. - I_UpdateSound(); - return; + goto notinlevel; } if (dedicated || nosound) @@ -881,8 +880,7 @@ void S_UpdateSounds(void) if (hws_mode != HWS_DEFAULT_MODE) { HW3S_UpdateSources(); - I_UpdateSound(); - return; + goto notinlevel; } #endif @@ -970,7 +968,28 @@ void S_UpdateSounds(void) } } +notinlevel: I_UpdateSound(); + + for (i = 0; i < NUMCAPTIONS; i++) // update captions + { + boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); + + if (closedcaptions[i].t <= TICRATE) + closedcaptions[i].t--; + if (cond || (closedcaptions[i].s && closedcaptions[i].t)) + { + if (!cond) + closedcaptions[i].c = NULL; + } + + if (!closedcaptions[i].t) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + } + } } void S_SetSfxVolume(INT32 volume) diff --git a/src/screen.c b/src/screen.c index 1c37f8a07..477225869 100644 --- a/src/screen.c +++ b/src/screen.c @@ -442,26 +442,6 @@ void SCR_ClosedCaptions(void) { UINT8 i; - for (i = 0; i < NUMCAPTIONS; i++) - { - boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); - - if (closedcaptions[i].t <= TICRATE) - closedcaptions[i].t--; - if (cond || (closedcaptions[i].s && closedcaptions[i].t)) - { - if (!cond) - closedcaptions[i].c = NULL; - } - - if (!closedcaptions[i].t) - { - closedcaptions[i].c = NULL; - closedcaptions[i].s = NULL; - closedcaptions[i].t = 0; - } - } - for (i = 0; i < NUMCAPTIONS; i++) { if (closedcaptions[i].s) From bdaa0aea9bef351a129d28d6fe0f43fc0ea969cf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 28 Apr 2017 22:55:54 +0100 Subject: [PATCH 090/181] More coherent sound selection to prevent confusion of token and score boxes. --- src/info.c | 4 ++-- src/sounds.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index ed2693bdf..87b0dc586 100644 --- a/src/info.c +++ b/src/info.c @@ -7456,7 +7456,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_SCORE1K_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_token, // seesound + sfx_chchng, // seesound 1000, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7483,7 +7483,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_SCORE10K_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_token, // seesound + sfx_chchng, // seesound 10000, // reactiontime sfx_None, // attacksound S_NULL, // painstate diff --git a/src/sounds.c b/src/sounds.c index 35f025989..ee0f0d09e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -193,13 +193,13 @@ sfxinfo_t S_sfx[NUMSFX] = {"corkh", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork hit"}, // Menu, interface - {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, + {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score"}, {"dwnind", false, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Thinking about air"}, {"emfind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Radar beep"}, {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flag captured"}, {"menu1", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, - {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally"}, // Point tally is identical to menu for now + {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tally"}, // Point tally is identical to menu for now {"radio", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Notification"}, {"wepchg", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon change"}, // Weapon switch is identical to menu for now {"wtrdng", true, 212, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, // make sure you can hear the DING DING! Tails 03-08-2000 @@ -399,7 +399,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "GO!"}, {"s3kae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pinball flipper"}, {"s3kaf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "To Special Stage"}, - {"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score tally done"}, + {"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Score"}, {"s3kb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spring"}, {"s3kb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Failure"}, {"s3kb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Warp"}, From 94add11fab9951529d782a1bfbbda7fcd68ecb9a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 12:58:40 +0100 Subject: [PATCH 091/181] Updated captions to: * be more efficient * fade away early if they stop playing * make their current max stick-around time longer * make the fade time/etc easier to modify --- src/s_sound.c | 21 +++++++++++---------- src/s_sound.h | 2 ++ src/screen.c | 8 ++++---- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 6ac886034..862cf12c5 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -586,7 +586,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) closedcaptions[set].c = &channels[cnum]; closedcaptions[set].s = sfx; - closedcaptions[set].t = TICRATE+2; + closedcaptions[set].t = MAXCAPTIONTICS+2; } // Assigns the handle to one of the channels in the @@ -694,7 +694,7 @@ dontplay: closedcaptions[set].c = &channels[cnum]; closedcaptions[set].s = sfx; - closedcaptions[set].t = TICRATE+2; + closedcaptions[set].t = MAXCAPTIONTICS+2; } // Assigns the handle to one of the channels in the @@ -973,21 +973,22 @@ notinlevel: for (i = 0; i < NUMCAPTIONS; i++) // update captions { - boolean cond = (closedcaptions[i].c && I_SoundIsPlaying(closedcaptions[i].c->handle)); + if (!closedcaptions[i].s) + continue; - if (closedcaptions[i].t <= TICRATE) + if (closedcaptions[i].t <= MAXCAPTIONTICS) closedcaptions[i].t--; - if (cond || (closedcaptions[i].s && closedcaptions[i].t)) - { - if (!cond) - closedcaptions[i].c = NULL; - } if (!closedcaptions[i].t) { closedcaptions[i].c = NULL; closedcaptions[i].s = NULL; - closedcaptions[i].t = 0; + } + else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle)) + { + closedcaptions[i].c = NULL; + if (closedcaptions[i].t > CAPTIONFADETICS) + closedcaptions[i].t = CAPTIONFADETICS; } } } diff --git a/src/s_sound.h b/src/s_sound.h index dc0dfaf69..467cbf33b 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -86,6 +86,8 @@ typedef struct { } caption_t; #define NUMCAPTIONS 8 +#define MAXCAPTIONTICS (2*TICRATE) +#define CAPTIONFADETICS 20 extern caption_t closedcaptions[NUMCAPTIONS]; diff --git a/src/screen.c b/src/screen.c index 477225869..64f69fe7f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -449,10 +449,10 @@ void SCR_ClosedCaptions(void) INT32 flags = V_NOSCALESTART|V_ALLOWLOWERCASE; INT32 y = vid.height-((i + 2)*10*vid.dupy); char dir = ' '; - if (closedcaptions[i].t < 20) - flags |= (((20-closedcaptions[i].t)/2)*V_10TRANS); - else if (closedcaptions[i].t > TICRATE) - y -= (closedcaptions[i].t-- - TICRATE)*vid.dupy; + if (closedcaptions[i].t < CAPTIONFADETICS) + flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS); + else if (closedcaptions[i].t > MAXCAPTIONTICS) + y -= (closedcaptions[i].t-- - MAXCAPTIONTICS)*vid.dupy; if (closedcaptions[i].c && closedcaptions[i].c->origin) dir = '\x1E'; V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, From 73f1550242a5848a72bd313c54698670f0bc9a31 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:27:52 +0100 Subject: [PATCH 092/181] There are now captions for specific types of music! (Currently signified with an M, but I'll change that in a bit...) A whole lotta things needed to be modified for this, though. * Serious refactor of - and internal exposure of - what has become S_StartCaption(). * Renaming of a few existing captions. * The prevention of access to - or writing over - sfx_None's stuff in SOC or Lua. * The new Lua wrapper function S_StartMusicCaption(string, tics, optional player), which essentially allows custom music captions to be created. (This is best used for stuff like final lap music in SRB2 Kart or bonus time in a thokker-like game, not a comprehensive Now Playing expy. That'd be a different kettle of fish.) Also, updated all the lock-on stuff to use P_IsLocalPlayer instead of rolling my own. --- src/dehacked.c | 4 +- src/lua_baselib.c | 28 ++++++- src/lua_infolib.c | 10 +-- src/p_enemy.c | 5 ++ src/p_inter.c | 4 + src/p_user.c | 18 ++-- src/s_sound.c | 206 ++++++++++++++++++++-------------------------- src/s_sound.h | 4 +- src/screen.c | 12 +-- src/sounds.c | 13 +-- 10 files changed, 163 insertions(+), 141 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index e91f168e0..aa6f4f7f9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3631,11 +3631,11 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad) { if (i == 0 && word2[0] != '0') // If word2 isn't a number i = get_sfx(word2); // find a sound by name - if (i < NUMSFX && i >= 0) + if (i < NUMSFX && i > 0) readsound(f, i, savesfxnames); else { - deh_warning("Sound %d out of range (0 - %d)", i, NUMSFX-1); + deh_warning("Sound %d out of range (1 - %d)", i, NUMSFX-1); ignorelines(f); } DEH_WriteUndoline(word, word2, UNDO_HEADER); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 71f6a7e65..93f2979fa 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -462,7 +462,7 @@ static int lib_pSpawnLockOn(lua_State *L) return LUA_ErrInvalid(L, "mobj_t"); if (!player) return LUA_ErrInvalid(L, "player_t"); - if (player == &players[consoleplayer] || player == &players[secondarydisplayplayer] || player == &players[displayplayer]) // Only display it on your own view. + if (P_IsLocalPlayer(player)) // Only display it on your own view. { mobj_t *visual = P_SpawnMobj(lockon->x, lockon->y, lockon->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker visual->target = lockon; @@ -2181,6 +2181,31 @@ static int lib_sSoundPlaying(lua_State *L) return 1; } +// This doesn't really exist, but we're providing it as a handy netgame-safe wrapper for stuff that should be locally handled. + +static int lib_sStartMusicCaption(lua_State *L) +{ + player_t *player = NULL; + const char *caption = luaL_checkstring(L, 1); + UINT16 lifespan = (UINT16)luaL_checkinteger(L, 2); + //HUDSAFE + INLEVEL + + if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) + { + player = *((player_t **)luaL_checkudata(L, 3, META_PLAYER)); + if (!player) + return LUA_ErrInvalid(L, "player_t"); + } + + if (lifespan && (!player || P_IsLocalPlayer(player))) + { + strlcpy(S_sfx[sfx_None].caption, caption, sizeof(S_sfx[sfx_None].caption)); + S_StartCaption(sfx_None, -1, lifespan); + } + return 0; +} + // G_GAME //////////// @@ -2493,6 +2518,7 @@ static luaL_Reg lib[] = { {"S_OriginPlaying",lib_sOriginPlaying}, {"S_IdPlaying",lib_sIdPlaying}, {"S_SoundPlaying",lib_sSoundPlaying}, + {"S_StartMusicCaption", lib_sStartMusicCaption}, // g_game {"G_BuildMapName",lib_gBuildMapName}, diff --git a/src/lua_infolib.c b/src/lua_infolib.c index f1e6f5975..9361abe94 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -773,8 +773,8 @@ static int lib_getSfxInfo(lua_State *L) lua_remove(L, 1); i = luaL_checkinteger(L, 1); - if (i >= NUMSFX) - return luaL_error(L, "sfxinfo[] index %d out of range (0 - %d)", i, NUMSFX-1); + if (i == 0 || i >= NUMSFX) + return luaL_error(L, "sfxinfo[] index %d out of range (1 - %d)", i, NUMSFX-1); LUA_PushUserdata(L, &S_sfx[i], META_SFXINFO); return 1; } @@ -787,9 +787,9 @@ static int lib_setSfxInfo(lua_State *L) lua_remove(L, 1); { UINT32 i = luaL_checkinteger(L, 1); - if (i >= NUMSFX) - return luaL_error(L, "sfxinfo[] index %d out of range (0 - %d)", i, NUMSFX-1); - info = &S_sfx[i]; // get the mobjinfo to assign to. + if (i == 0 || i >= NUMSFX) + return luaL_error(L, "sfxinfo[] index %d out of range (1 - %d)", i, NUMSFX-1); + info = &S_sfx[i]; // get the sfxinfo to assign to. } luaL_checktype(L, 2, LUA_TTABLE); // check that we've been passed a table. lua_remove(L, 1); // pop mobjtype num, don't need it any more. diff --git a/src/p_enemy.c b/src/p_enemy.c index 88e00e95b..c03b03362 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3170,6 +3170,8 @@ void A_Invincibility(mobj_t *actor) S_StopMusic(); if (mariomode) G_GhostAddColor(GHC_INVINCIBLE); + strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14); + S_StartCaption(sfx_None, -1, player->powers[pw_invulnerability]); S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); } } @@ -3201,6 +3203,9 @@ void A_SuperSneakers(mobj_t *actor) if (P_IsLocalPlayer(player) && !player->powers[pw_super]) { + strlcpy(S_sfx[sfx_None].caption, "Speed shoes", 12); + S_StartCaption(sfx_None, -1, player->powers[pw_sneakers]); + if (S_SpeedMusic(0.0f) && (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC)) S_SpeedMusic(1.4f); else diff --git a/src/p_inter.c b/src/p_inter.c index 6800a7d1f..2b8006534 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -257,6 +257,8 @@ void P_DoMatchSuper(player_t *player) S_StopMusic(); if (mariomode) G_GhostAddColor(GHC_INVINCIBLE); + strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14); + S_StartCaption(sfx_None, -1, player->powers[pw_invulnerability]); S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); } @@ -278,6 +280,8 @@ void P_DoMatchSuper(player_t *player) S_StopMusic(); if (mariomode) G_GhostAddColor(GHC_INVINCIBLE); + strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14); + S_StartCaption(sfx_None, -1, player->powers[pw_invulnerability]); S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); } } diff --git a/src/p_user.c b/src/p_user.c index 93764ad19..bbcaa3708 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1134,8 +1134,10 @@ void P_PlayLivesJingle(player_t *player) else { if (player) - player->powers[pw_extralife] = extralifetics + 1; + player->powers[pw_extralife] = extralifetics+1; S_StopMusic(); // otherwise it won't restart if this is done twice in a row + strlcpy(S_sfx[sfx_None].caption, "One-up", 7); + S_StartCaption(sfx_None, -1, extralifetics+1); S_ChangeMusicInternal("_1up", false); } } @@ -1156,9 +1158,15 @@ void P_RestoreMusic(player_t *player) if (player->powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) S_ChangeMusicInternal("_super", true); else if (player->powers[pw_invulnerability] > 1) + { + strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14); + S_StartCaption(sfx_None, -1, player->powers[pw_invulnerability]); S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); + } else if (player->powers[pw_sneakers] > 1 && !player->powers[pw_super]) { + strlcpy(S_sfx[sfx_None].caption, "Speed shoes", 12); + S_StartCaption(sfx_None, -1, player->powers[pw_sneakers]); if (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC) { S_SpeedMusic(1.4f); @@ -2341,7 +2349,7 @@ static void P_DoPlayerHeadSigns(player_t *player) // If you're "IT", show a big "IT" over your head for others to see. if (player->pflags & PF_TAGIT) { - if (!(player == &players[consoleplayer] || player == &players[secondarydisplayplayer] || player == &players[displayplayer])) // Don't display it on your own view. + if (!P_IsLocalPlayer(player)) // Don't display it on your own view. { if (!(player->mo->eflags & MFE_VERTICALFLIP)) P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height, MT_TAG); @@ -3858,7 +3866,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) mobj_t *lockon = P_LookForEnemies(player, false, true); if (lockon) { - if (player == &players[consoleplayer] || player == &players[secondarydisplayplayer] || player == &players[displayplayer]) // Only display it on your own view. + if (P_IsLocalPlayer(player)) // Only display it on your own view. { mobj_t *visual = P_SpawnMobj(lockon->x, lockon->y, lockon->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker visual->target = lockon; @@ -4126,7 +4134,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if ((player->charability == CA_HOMINGTHOK) && !player->homing && (player->pflags & PF_JUMPED) && (!(player->pflags & PF_THOKKED) || (player->charflags & SF_MULTIABILITY)) && (lockon = P_LookForEnemies(player, true, false))) { - if (player == &players[consoleplayer] || player == &players[secondarydisplayplayer] || player == &players[displayplayer]) // Only display it on your own view. + if (P_IsLocalPlayer(player)) // Only display it on your own view. { mobj_t *visual = P_SpawnMobj(lockon->x, lockon->y, lockon->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker visual->target = lockon; @@ -7194,7 +7202,7 @@ static void P_MovePlayer(player_t *player) { if ((lockon = P_LookForEnemies(player, false, false))) { - if (player == &players[consoleplayer] || player == &players[secondarydisplayplayer] || player == &players[displayplayer]) // Only display it on your own view. + if (P_IsLocalPlayer(player)) // Only display it on your own view. { mobj_t *visual = P_SpawnMobj(lockon->x, lockon->y, lockon->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker visual->target = lockon; diff --git a/src/s_sound.c b/src/s_sound.c index 862cf12c5..41a229b85 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -140,6 +140,7 @@ void ResetCaptions(void) closedcaptions[i].c = NULL; closedcaptions[i].s = NULL; closedcaptions[i].t = 0; + closedcaptions[i].b = 0; } } @@ -391,6 +392,92 @@ void S_StopSoundByNum(sfxenum_t sfxnum) } } +void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan) +{ + UINT8 i, set, moveup, start; + boolean same; + sfxinfo_t *sfx; + + if (!cv_closedcaptioning.value) // no captions at all + return; + + // check for bogus sound # + I_Assert(sfx_id >= 0); // allows sfx_None; this shouldn't be allowed directly if S_StartCaption is ever exposed to Lua by itself + I_Assert(sfx_id < NUMSFX); + + sfx = &S_sfx[sfx_id]; + + if (sfx->caption[0] == '/') // no caption for this one + return; + + start = ((closedcaptions[0].s && (closedcaptions[0].s-S_sfx == sfx_None)) ? 1 : 0); + + if (sfx_id) + { + for (i = start; i < (set = NUMCAPTIONS-1); i++) + { + same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); + if (same) + { + set = i; + break; + } + } + } + else + { + set = 0; + same = (closedcaptions[0].s == sfx); + } + + moveup = 255; + + if (!same) + { + for (i = start; i < set; i++) + { + if (!(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) + { + set = i; + if (closedcaptions[i].s && (sfx->priority >= closedcaptions[i].s->priority)) + moveup = i; + break; + } + } + for (i = NUMCAPTIONS-1; i > set; i--) + { + if (sfx == closedcaptions[i].s) + { + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + closedcaptions[i].t = 0; + closedcaptions[i].b = 0; + } + } + } + + if (moveup != 255) + { + for (i = moveup; i < NUMCAPTIONS-1; i++) + { + if (!(closedcaptions[i].c || closedcaptions[i].s)) + break; + } + for (; i > set; i--) + { + closedcaptions[i].c = closedcaptions[i-1].c; + closedcaptions[i].s = closedcaptions[i-1].s; + closedcaptions[i].t = closedcaptions[i-1].t; + closedcaptions[i].b = closedcaptions[i-1].b; + } + } + + closedcaptions[set].c = ((cnum == -1) ? NULL : &channels[cnum]); + closedcaptions[set].s = sfx; + closedcaptions[set].t = lifespan; + closedcaptions[set].b = 2; // bob +} + void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) { INT32 sep, pitch, priority, cnum; @@ -532,62 +619,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) #endif // Handle closed caption input. - if (cv_closedcaptioning.value && sfx->caption[0] != '/') - { - UINT8 i, set = NUMCAPTIONS-1, moveup = 255; - boolean same = false; - for (i = 0; i < set; i++) - { - same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); - if (same) - { - set = i; - break; - } - } - - if (!same) - { - for (i = 0; i < set; i++) - { - if (!(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) - { - set = i; - if (closedcaptions[i].s && (sfx->priority >= closedcaptions[i].s->priority)) - moveup = i; - break; - } - } - for (i = NUMCAPTIONS-1; i > set; i--) - { - if (sfx == closedcaptions[i].s) - { - closedcaptions[i].c = NULL; - closedcaptions[i].s = NULL; - closedcaptions[i].t = 0; - } - } - } - - if (moveup != 255) - { - for (i = moveup; i < NUMCAPTIONS-1; i++) - { - if (!(closedcaptions[i].c || closedcaptions[i].s)) - break; - } - for (; i > set; i--) - { - closedcaptions[i].c = closedcaptions[i-1].c; - closedcaptions[i].s = closedcaptions[i-1].s; - closedcaptions[i].t = closedcaptions[i-1].t; - } - } - - closedcaptions[set].c = &channels[cnum]; - closedcaptions[set].s = sfx; - closedcaptions[set].t = MAXCAPTIONTICS+2; - } + S_StartCaption(sfx_id, cnum, MAXCAPTIONTICS); // Assigns the handle to one of the channels in the // mix/output buffer. @@ -640,62 +672,7 @@ dontplay: #endif // Handle closed caption input. - if (cv_closedcaptioning.value && sfx->caption[0] != '/') - { - UINT8 i, set = NUMCAPTIONS-1, moveup = 255; - boolean same = false; - for (i = 0; i < set; i++) - { - same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption))); - if (same) - { - set = i; - break; - } - } - - if (!same) - { - for (i = 0; i < set; i++) - { - if (!(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority)) - { - set = i; - if (closedcaptions[i].s && (sfx->priority >= closedcaptions[i].s->priority)) - moveup = i; - break; - } - } - for (i = NUMCAPTIONS-1; i > set; i--) - { - if (sfx == closedcaptions[i].s) - { - closedcaptions[i].c = NULL; - closedcaptions[i].s = NULL; - closedcaptions[i].t = 0; - } - } - } - - if (moveup != 255) - { - for (i = moveup; i < NUMCAPTIONS-1; i++) - { - if (!(closedcaptions[i].c || closedcaptions[i].s)) - break; - } - for (; i > set; i--) - { - closedcaptions[i].c = closedcaptions[i-1].c; - closedcaptions[i].s = closedcaptions[i-1].s; - closedcaptions[i].t = closedcaptions[i-1].t; - } - } - - closedcaptions[set].c = &channels[cnum]; - closedcaptions[set].s = sfx; - closedcaptions[set].t = MAXCAPTIONTICS+2; - } + S_StartCaption(sfx_id, cnum, MAXCAPTIONTICS); // Assigns the handle to one of the channels in the // mix/output buffer. @@ -976,10 +953,7 @@ notinlevel: if (!closedcaptions[i].s) continue; - if (closedcaptions[i].t <= MAXCAPTIONTICS) - closedcaptions[i].t--; - - if (!closedcaptions[i].t) + if (!(--closedcaptions[i].t)) { closedcaptions[i].c = NULL; closedcaptions[i].s = NULL; diff --git a/src/s_sound.h b/src/s_sound.h index 467cbf33b..724531072 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -82,7 +82,8 @@ typedef struct typedef struct { channel_t *c; sfxinfo_t *s; - UINT8 t; + UINT16 t; + UINT8 b; } caption_t; #define NUMCAPTIONS 8 @@ -90,6 +91,7 @@ typedef struct { #define CAPTIONFADETICS 20 extern caption_t closedcaptions[NUMCAPTIONS]; +void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan); // register sound vars and commands at game startup void S_RegisterSoundStuff(void); diff --git a/src/screen.c b/src/screen.c index 64f69fe7f..369ff703c 100644 --- a/src/screen.c +++ b/src/screen.c @@ -448,15 +448,17 @@ void SCR_ClosedCaptions(void) { INT32 flags = V_NOSCALESTART|V_ALLOWLOWERCASE; INT32 y = vid.height-((i + 2)*10*vid.dupy); - char dir = ' '; + char dot = ' '; + if (closedcaptions[i].b) + y -= (closedcaptions[i].b--)*vid.dupy; if (closedcaptions[i].t < CAPTIONFADETICS) flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS); - else if (closedcaptions[i].t > MAXCAPTIONTICS) - y -= (closedcaptions[i].t-- - MAXCAPTIONTICS)*vid.dupy; if (closedcaptions[i].c && closedcaptions[i].c->origin) - dir = '\x1E'; + dot = '\x1E'; + else if (closedcaptions[i].s-S_sfx == sfx_None) + dot = 'M'; V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, - flags, va("%c [%s]", dir, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); + flags, va("%c [%s]", dot, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); } } } diff --git a/src/sounds.c b/src/sounds.c index ee0f0d09e..ef93cff7c 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -33,7 +33,7 @@ sfxinfo_t S_sfx[NUMSFX] = *****/ // S_sfx[0] needs to be a dummy for odd reasons. (don't modify this comment) // name, singularity, priority, pitch, volume, data, length, skinsound, usefulness, lumpnum, caption - {"none" , false, 0, 0, -1, NULL, 0, -1, -1, LUMPERROR, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, // maximum length + {"none" , false, 0, 0, -1, NULL, 0, -1, -1, LUMPERROR, "///////////////////////////////"}, // maximum length // Skin Sounds {"altdi1", false, 192, 16, -1, NULL, 0, SKSPLDET1, -1, LUMPERROR, "Dying"}, @@ -198,7 +198,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"emfind", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Radar beep"}, {"flgcap", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flag captured"}, {"menu1", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"}, - {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, + {"oneup", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "One-up"}, {"ptally", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tally"}, // Point tally is identical to menu for now {"radio", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Notification"}, {"wepchg", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Weapon change"}, // Weapon switch is identical to menu for now @@ -237,7 +237,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"mario7", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire"}, {"mario8", false, 48, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Hurt"}, {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Emerging"}, - {"marioa", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Extra life"}, + {"marioa", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "One-up"}, {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp"}, // Black Eggman @@ -294,7 +294,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning zap"}, {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Transformation"}, - {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising sand"}, + {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising dust"}, {"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"}, {"s3k49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rock"}, {"s3k4a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Grab"}, @@ -389,7 +389,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3ka3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lift"}, {"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powering up"}, {"s3ka5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction failure"}, + {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction fizzle"}, {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Countdown beep"}, {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, @@ -513,7 +513,8 @@ void S_InitRuntimeSounds (void) S_sfx[i].skinsound = -1; S_sfx[i].usefulness = -1; S_sfx[i].lumpnum = LUMPERROR; - strlcpy(S_sfx[i].caption, "", 9); + //strlcpy(S_sfx[i].caption, "", 1); + S_sfx[i].caption[0] = '\0'; } } From 0af9de2ba6db81fe04dadb40a3d510e86cb15236 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 093/181] Bugfix: When you stop hearing the music, allow the caption to expire sooner rather than later. --- src/s_sound.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/s_sound.c b/src/s_sound.c index 41a229b85..e9e61078b 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1420,6 +1420,12 @@ void S_StopMusic(void) music_data = NULL; music_name[0] = 0; + + if (cv_closedcaptioning.value) + { + if (closedcaptions[0].s-S_sfx == sfx_None) + closedcaptions[0].t = CAPTIONFADETICS; + } } void S_SetDigMusicVolume(INT32 volume) From a625c4f7256ab27e8023c076d44979471a0cbdf6 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 094/181] Katana dot in hudnames, as desired. --- src/r_things.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/r_things.c b/src/r_things.c index 2f8e7c91a..d71a7e7a1 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2811,14 +2811,20 @@ void R_AddSkins(UINT16 wadnum) { STRBUFCPY(skin->realname, skin->name); for (value = skin->realname; *value; value++) + { if (*value == '_') *value = ' '; // turn _ into spaces. + else if (*value == '.') *value = '\x1E'; // turn . into katana dot. + } } if (!hudname) { HUDNAMEWRITE(skin->name); strupr(skin->hudname); for (value = skin->hudname; *value; value++) + { if (*value == '_') *value = ' '; // turn _ into spaces. + else if (*value == '.') *value = '\x1E'; // turn . into katana dot. + } } } else if (!stricmp(stoken, "realname")) @@ -2826,7 +2832,10 @@ void R_AddSkins(UINT16 wadnum) realname = true; STRBUFCPY(skin->realname, value); for (value = skin->realname; *value; value++) + { if (*value == '_') *value = ' '; // turn _ into spaces. + else if (*value == '.') *value = '\x1E'; // turn . into katana dot. + } if (!hudname) HUDNAMEWRITE(skin->realname); } @@ -2835,7 +2844,10 @@ void R_AddSkins(UINT16 wadnum) hudname = true; HUDNAMEWRITE(value); for (value = skin->hudname; *value; value++) + { if (*value == '_') *value = ' '; // turn _ into spaces. + else if (*value == '.') *value = '\x1E'; // turn . into katana dot. + } if (!realname) STRBUFCPY(skin->realname, skin->hudname); } From e0d7b1ae24f37f0177ecf578b34620ee9766f9cf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 095/181] Music symbol for music. (requires patch.dta) --- src/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 369ff703c..f043810e3 100644 --- a/src/screen.c +++ b/src/screen.c @@ -456,7 +456,7 @@ void SCR_ClosedCaptions(void) if (closedcaptions[i].c && closedcaptions[i].c->origin) dot = '\x1E'; else if (closedcaptions[i].s-S_sfx == sfx_None) - dot = 'M'; + dot = '\x19'; V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, flags, va("%c [%s]", dot, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); } From b1d5bc319036c1d3644501940c134c010a9e18e1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 096/181] Reset captions where appropriate (including in S_StopSounds(), as it should have been doing all along). --- src/m_menu.c | 3 ++- src/s_sound.c | 8 +++++--- src/s_sound.h | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index b465adf55..183031d9f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8289,7 +8289,6 @@ static void M_ToggleSFX(INT32 choice) sound_disabled = true; S_StopSounds(); OP_SoundOptionsMenu[6].status = IT_GRAYEDOUT; - ResetCaptions(); //M_StartMessage(M_GetText("SFX Disabled\n"), NULL, MM_NOTHING); } } @@ -8845,6 +8844,8 @@ void M_QuitResponse(INT32 ch) return; if (!(netgame || cv_debug)) { + S_ResetCaptions(); + mrand = M_RandomKey(sizeof(quitsounds)/sizeof(INT32)); if (quitsounds[mrand]) S_StartSound(NULL, quitsounds[mrand]); diff --git a/src/s_sound.c b/src/s_sound.c index e9e61078b..3382a5d49 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -80,7 +80,7 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL // actual general (maximum) sound & music volume, saved into the config consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, ResetCaptions, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, S_ResetCaptions, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // number of channels available @@ -132,7 +132,7 @@ static INT32 numofchannels = 0; caption_t closedcaptions[NUMCAPTIONS]; -void ResetCaptions(void) +void S_ResetCaptions(void) { UINT8 i; for (i = 0; i < NUMCAPTIONS; i++) @@ -301,7 +301,7 @@ static void SetChannelsNum(void) for (i = 0; i < numofchannels; i++) channels[i].sfxinfo = 0; - ResetCaptions(); + S_ResetCaptions(); } @@ -344,6 +344,8 @@ void S_StopSounds(void) for (cnum = 0; cnum < numofchannels; cnum++) if (channels[cnum].sfxinfo) S_StopChannel(cnum); + + S_ResetCaptions(); } void S_StopSoundByID(void *origin, sfxenum_t sfx_id) diff --git a/src/s_sound.h b/src/s_sound.h index 724531072..4b9735480 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -22,8 +22,6 @@ // mask used to indicate sound origin is player item pickup #define PICKUP_SOUND 0x8000 -void ResetCaptions(void); - extern consvar_t stereoreverse; extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume, cv_midimusicvolume; extern consvar_t cv_numChannels; @@ -92,6 +90,7 @@ typedef struct { extern caption_t closedcaptions[NUMCAPTIONS]; void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan); +void S_ResetCaptions(void); // register sound vars and commands at game startup void S_RegisterSoundStuff(void); From 22f5b67af6a913b06e93daf85db7955e2c4694c4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 097/181] Fixing a race condition forcing speed shoes captions to disappear almost instantly. --- src/p_enemy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index c03b03362..d4d6064e3 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3203,9 +3203,6 @@ void A_SuperSneakers(mobj_t *actor) if (P_IsLocalPlayer(player) && !player->powers[pw_super]) { - strlcpy(S_sfx[sfx_None].caption, "Speed shoes", 12); - S_StartCaption(sfx_None, -1, player->powers[pw_sneakers]); - if (S_SpeedMusic(0.0f) && (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC)) S_SpeedMusic(1.4f); else @@ -3213,6 +3210,8 @@ void A_SuperSneakers(mobj_t *actor) S_StopMusic(); S_ChangeMusicInternal("_shoes", false); } + strlcpy(S_sfx[sfx_None].caption, "Speed shoes", 12); + S_StartCaption(sfx_None, -1, player->powers[pw_sneakers]); } } From 82cbb3d282eb803c28e77f4d15ef69cea9a0381b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 098/181] Some final name updates for now. --- src/sounds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index ef93cff7c..390107c1f 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -53,9 +53,9 @@ sfxinfo_t S_sfx[NUMSFX] = {"pudpud", false, 64, 0, -1, NULL, 0, SKSPUDPUD, -1, LUMPERROR, "Tired flight"}, {"putput", false, 64, 0, -1, NULL, 0, SKSPUTPUT, -1, LUMPERROR, "Flight"}, // not as high a priority {"spin" , false, 100, 0, -1, NULL, 0, SKSSPIN, -1, LUMPERROR, "Spin"}, - {"spndsh", false, 64, 1, -1, NULL, 0, SKSSPNDSH, -1, LUMPERROR, "Spindash charge"}, + {"spndsh", false, 64, 1, -1, NULL, 0, SKSSPNDSH, -1, LUMPERROR, "Spindash"}, {"thok" , false, 96, 0, -1, NULL, 0, SKSTHOK, -1, LUMPERROR, "Thok"}, - {"zoom" , false, 120, 1, -1, NULL, 0, SKSZOOM, -1, LUMPERROR, "Spindash launch"}, + {"zoom" , false, 120, 1, -1, NULL, 0, SKSZOOM, -1, LUMPERROR, "Spin launch"}, {"skid", false, 64, 32, -1, NULL, 0, SKSSKID, -1, LUMPERROR, "Skid"}, // Ambience/background objects/etc @@ -394,7 +394,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Energy"}, {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aquaphobia"}, {"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bumper"}, - {"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash charge"}, + {"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash"}, {"s3kac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Continue"}, {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "GO!"}, {"s3kae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pinball flipper"}, @@ -405,7 +405,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Warp"}, {"s3kb4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Explosion"}, {"s3kb5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Clink"}, - {"s3kb6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spindash launch"}, + {"s3kb6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spin launch"}, {"s3kb7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Tumbler"}, {"s3kb8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling signpost"}, {"s3kb9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Ring loss"}, From 2f435dd85a74bbf93ccba89296153d2ba9a5c6ed Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 099/181] Make closedcaptioning's onchange give an indicator of success. --- src/s_sound.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index 3382a5d49..b8cb06075 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -80,9 +80,18 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL // actual general (maximum) sound & music volume, saved into the config consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, S_ResetCaptions, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +static void Captioning_OnChange(void) +{ + S_ResetCaptions(); + if (cv_closedcaptioning.value) + S_StartSound(NULL, sfx_menu1); +} + +consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, Captioning_OnChange, 0, NULL, NULL, 0, 0, NULL}; + // number of channels available #if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; From fb6045dd7dee1dc565d75911f0c51cf34a677854 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 100/181] Last few improvements for normal menus. --- src/m_menu.c | 83 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 33 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 183031d9f..aaada1740 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1376,43 +1376,42 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 26}, {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 31}, #endif + {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 36}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 41}, - {IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 41}, - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 46}, + {IT_HEADER, NULL, "Characters", NULL, 50}, + {IT_STRING | IT_CVAR, NULL, "Force a character", &cv_forceskin, 56}, + {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 61}, - {IT_HEADER, NULL, "Characters", NULL, 55}, - {IT_STRING | IT_CVAR, NULL, "Force a character", &cv_forceskin, 61}, - {IT_STRING | IT_CVAR, NULL, "Restrict character changes", &cv_restrictskinchange, 66}, + {IT_HEADER, NULL, "Items", NULL, 70}, + {IT_STRING | IT_CVAR, NULL, "Item respawn delay", &cv_itemrespawntime, 76}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 81}, - {IT_HEADER, NULL, "Items", NULL, 75}, - {IT_STRING | IT_CVAR, NULL, "Item respawn delay", &cv_itemrespawntime, 81}, - {IT_STRING | IT_SUBMENU, NULL, "Random Item Box Toggles...", &OP_MonitorToggleDef, 86}, + {IT_HEADER, NULL, "Platform (Coop, Race, Competition)", NULL, 90}, + {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 96}, + {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 101}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 106}, - {IT_HEADER, NULL, "Platform (Coop, Race, Competition)", NULL, 95}, - {IT_STRING | IT_CVAR, NULL, "Players required for exit", &cv_playersforexit, 101}, - {IT_STRING | IT_CVAR, NULL, "Level completion countdown", &cv_countdowntime, 106}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 111}, + {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 115}, + {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 121}, + {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 126}, + {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 131}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 136}, - {IT_HEADER, NULL, "Ringslinger (Match, CTF, Tag, H&S)", NULL, 120}, - {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 126}, - {IT_STRING | IT_CVAR, NULL, "Score Limit", &cv_pointlimit, 131}, - {IT_STRING | IT_CVAR, NULL, "Overtime on Tie", &cv_overtime, 136}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 141}, + {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 146}, + {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 151}, + {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 156}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 151}, - {IT_STRING | IT_CVAR, NULL, "Weapon Rings", &cv_specialrings, 156}, - {IT_STRING | IT_CVAR, NULL, "Power Stones", &cv_powerstones, 161}, + {IT_STRING | IT_CVAR, NULL, "Flag respawn delay", &cv_flagtime, 166}, + {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 171}, - {IT_STRING | IT_CVAR, NULL, "Flag respawn delay", &cv_flagtime, 171}, - {IT_STRING | IT_CVAR, NULL, "Hiding time", &cv_hidetime, 176}, - - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 186}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 191}, + {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 181}, + {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 186}, #ifndef NONET - {IT_HEADER, NULL, "Advanced", NULL, 200}, - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 206}, - {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 220}, + {IT_HEADER, NULL, "Advanced", NULL, 195}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 201}, + {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 215}, #endif }; @@ -3288,7 +3287,7 @@ static void M_DrawGenericMenu(void) // note that alphakey is multiplied by 2 for scrolling menus to allow greater usage in UINT8 range. static void M_DrawGenericScrollMenu(void) { - INT32 x, y, i, max, tempcentery, cursory = 0; + INT32 x, y, i, max, bottom, tempcentery, cursory = 0; // DRAW MENU x = currentMenu->x; @@ -3307,15 +3306,21 @@ static void M_DrawGenericScrollMenu(void) break; } - for (max = currentMenu->numitems; max > 0; max--) + for (bottom = currentMenu->numitems; bottom > 0; bottom--) { - if (currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) + if (currentMenu->menuitems[bottom-1].status != IT_DISABLED) + break; + } + + for (max = bottom; max > 0; max--) + { + if (currentMenu->menuitems[max-1].status != IT_DISABLED && currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight)) break; } if (i) V_DrawString(currentMenu->x - 20, currentMenu->y, V_YELLOWMAP, "\x1A"); // up arrow - if (max != currentMenu->numitems) + if (max != bottom) V_DrawString(currentMenu->x - 20, currentMenu->y + 2*scrollareaheight, V_YELLOWMAP, "\x1B"); // down arrow // draw title (or big pic) @@ -3359,6 +3364,7 @@ static void M_DrawGenericScrollMenu(void) case IT_CV_INVISSLIDER: // monitor toggles use this break; case IT_CV_STRING: +#if 1 if (y + 12 > (currentMenu->y + 2*scrollareaheight)) break; M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); @@ -3366,7 +3372,18 @@ static void M_DrawGenericScrollMenu(void) if (skullAnimCounter < 4 && i == itemOn) V_DrawCharacter(x + 8 + V_StringWidth(cv->string, 0), y + 12, '_' | 0x80, false); - y += 16; +#else // cool new string type stuff, not ready for limelight + if (i == itemOn) + { + V_DrawFill(x-2, y-1, MAXSTRINGLENGTH*8 + 4, 8+3, 159); + V_DrawString(x, y, V_ALLOWLOWERCASE, cv->string); + if (skullAnimCounter < 4) + V_DrawCharacter(x + V_StringWidth(cv->string, 0), y, '_' | 0x80, false); + } + else + V_DrawRightAlignedString(BASEVIDWIDTH - x, y, + V_YELLOWMAP|V_ALLOWLOWERCASE, cv->string); +#endif break; default: V_DrawRightAlignedString(BASEVIDWIDTH - x, y, From 3523d6ab8a24e82a6b30bcaed2939447c6248226 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 101/181] Final modifications to the control menu. * Completely hides instead of greying stuff out. * "Modifications" has been renamed to "Add-ons", since that's a more direct term. --- src/m_menu.c | 74 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index aaada1740..d43d0e9e0 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1103,7 +1103,7 @@ static menuitem_t OP_ChangeControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Grenade", M_ChangeControl, gc_wepslot5 }, {IT_CALL | IT_STRING2, NULL, "Explosion", M_ChangeControl, gc_wepslot6 }, {IT_CALL | IT_STRING2, NULL, "Rail", M_ChangeControl, gc_wepslot7 }, - {IT_HEADER, NULL, "Modifications", NULL, 0}, + {IT_HEADER, NULL, "Add-ons", NULL, 0}, {IT_SPACE, NULL, NULL, NULL, 0}, // padding {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 }, {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, @@ -8014,15 +8014,17 @@ static void M_Setup1PControlsMenu(INT32 choice) setupcontrols = gamecontrol; // was called from main Options (for console player, then) currentMenu->lastOn = itemOn; - // Unhide the three non-P2 controls - //OP_ChangeControlsMenu[18+0].status = IT_HEADER; - //OP_ChangeControlsMenu[18+1].status = IT_SPACE; + // Unhide the five non-P2 controls and their headers + OP_ChangeControlsMenu[18+0].status = IT_HEADER; + OP_ChangeControlsMenu[18+1].status = IT_SPACE; + // ... OP_ChangeControlsMenu[18+2].status = IT_CALL|IT_STRING2; OP_ChangeControlsMenu[18+3].status = IT_CALL|IT_STRING2; OP_ChangeControlsMenu[18+4].status = IT_CALL|IT_STRING2; - // Unhide the pause/console controls too - //OP_ChangeControlsMenu[23+0].status = IT_HEADER; - //OP_ChangeControlsMenu[23+1].status = IT_SPACE; + // ... + OP_ChangeControlsMenu[23+0].status = IT_HEADER; + OP_ChangeControlsMenu[23+1].status = IT_SPACE; + // ... OP_ChangeControlsMenu[23+2].status = IT_CALL|IT_STRING2; OP_ChangeControlsMenu[23+3].status = IT_CALL|IT_STRING2; @@ -8037,15 +8039,17 @@ static void M_Setup2PControlsMenu(INT32 choice) setupcontrols = gamecontrolbis; currentMenu->lastOn = itemOn; - // Hide the three non-P2 controls - //OP_ChangeControlsMenu[18+0].status = IT_DISABLED; - //OP_ChangeControlsMenu[18+1].status = IT_DISABLED; + // Hide the five non-P2 controls and their headers + OP_ChangeControlsMenu[18+0].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[18+1].status = IT_GRAYEDOUT2; + // ... OP_ChangeControlsMenu[18+2].status = IT_GRAYEDOUT2; OP_ChangeControlsMenu[18+3].status = IT_GRAYEDOUT2; OP_ChangeControlsMenu[18+4].status = IT_GRAYEDOUT2; - // Hide the pause/console controls too - //OP_ChangeControlsMenu[23+0].status = IT_DISABLED; - //OP_ChangeControlsMenu[23+1].status = IT_DISABLED; + // ... + OP_ChangeControlsMenu[23+0].status = IT_GRAYEDOUT2; + OP_ChangeControlsMenu[23+1].status = IT_GRAYEDOUT2; + // ... OP_ChangeControlsMenu[23+2].status = IT_GRAYEDOUT2; OP_ChangeControlsMenu[23+3].status = IT_GRAYEDOUT2; @@ -8059,17 +8063,44 @@ static void M_Setup2PControlsMenu(INT32 choice) static void M_DrawControl(void) { char tmp[50]; - INT32 x, y, i, max, cursory = 0; + INT32 x, y, i, max, cursory = 0, iter; INT32 keys[2]; x = currentMenu->x; y = currentMenu->y; - i = itemOn - (controlheight/2); + /*i = itemOn - (controlheight/2); if (i < 0) i = 0; + */ - max = i + controlheight; + iter = (controlheight/2); + for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) + { + if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) + iter--; + } + if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + i--; + + iter += (controlheight/2); + for (max = itemOn; (iter && max < currentMenu->numitems); max++) + { + if (currentMenu->menuitems[max].status != IT_GRAYEDOUT2) + iter--; + } + + if (iter) + { + iter += (controlheight/2); + for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) + { + if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) + iter--; + } + } + + /*max = i + controlheight; if (max > currentMenu->numitems) { max = currentMenu->numitems; @@ -8077,7 +8108,7 @@ static void M_DrawControl(void) i = 0; else i = max - controlheight; - } + }*/ // draw title (or big pic) M_DrawMenuTitle(); @@ -8089,10 +8120,13 @@ static void M_DrawControl(void) if (i) V_DrawString(currentMenu->x - 16, y, V_YELLOWMAP, "\x1A"); // up arrow if (max != currentMenu->numitems) - V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(max-i-1)), V_YELLOWMAP, "\x1B"); // down arrow + V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(controlheight-1)), V_YELLOWMAP, "\x1B"); // down arrow for (; i < max; i++) { + if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + continue; + if (i == itemOn) cursory = y; @@ -8122,8 +8156,8 @@ static void M_DrawControl(void) } V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, V_YELLOWMAP, tmp); } - else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) - V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + /*else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);*/ else if ((currentMenu->menuitems[i].status == IT_HEADER) && (i != max-1)) M_DrawLevelPlatterHeader(y, currentMenu->menuitems[i].text, true); From 52b19da00996d744fbdabdfe1dc6320c112b87bb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 102/181] Add a little header to the colour cube menu so you see the state of ALL of the colours, not just the three that fit on screen at once. https://cdn.discordapp.com/attachments/293238104096112641/307998638246723597/srb20016.png --- src/m_menu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index d43d0e9e0..4530e3f05 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8632,6 +8632,16 @@ static void M_DrawColorMenu(void) x = currentMenu->x; y = currentMenu->y; + V_DrawFill(19 , y-4, 47, 1, 35); + V_DrawFill(19+( 47), y-4, 47, 1, 73); + V_DrawFill(19+(2*47), y-4, 47, 1, 112); + V_DrawFill(19+(3*47), y-4, 47, 1, 255); + V_DrawFill(19+(4*47), y-4, 47, 1, 152); + V_DrawFill(19+(5*47), y-4, 46, 1, 181); + + V_DrawFill(300, y-4, 1, 1, 26); + V_DrawFill( 19, y-3, 282, 1, 26); + if ((currentMenu->menuitems[itemOn].alphaKey*2 - currentMenu->menuitems[0].alphaKey*2) <= scrollareaheight) tempcentery = currentMenu->y - currentMenu->menuitems[0].alphaKey*2; else if ((currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 - currentMenu->menuitems[itemOn].alphaKey*2) <= scrollareaheight) From 1e051a8893e49e02dc287879a2120bf25aa7fde7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 103/181] Improve captions code clarity, and also make music captions flash before they disappear. --- src/screen.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/src/screen.c b/src/screen.c index f043810e3..2e3d2e0f4 100644 --- a/src/screen.c +++ b/src/screen.c @@ -444,21 +444,32 @@ void SCR_ClosedCaptions(void) for (i = 0; i < NUMCAPTIONS; i++) { - if (closedcaptions[i].s) - { - INT32 flags = V_NOSCALESTART|V_ALLOWLOWERCASE; - INT32 y = vid.height-((i + 2)*10*vid.dupy); - char dot = ' '; - if (closedcaptions[i].b) - y -= (closedcaptions[i].b--)*vid.dupy; - if (closedcaptions[i].t < CAPTIONFADETICS) - flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS); - if (closedcaptions[i].c && closedcaptions[i].c->origin) - dot = '\x1E'; - else if (closedcaptions[i].s-S_sfx == sfx_None) - dot = '\x19'; - V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, - flags, va("%c [%s]", dot, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); - } + INT32 flags, y; + char dot; + boolean music; + + if (!closedcaptions[i].s) + continue; + + if ((music = (closedcaptions[i].s-S_sfx == sfx_None)) && (closedcaptions[i].t < flashingtics) && (closedcaptions[i].t & 1)) + continue; + + flags = V_NOSCALESTART|V_ALLOWLOWERCASE; + y = vid.height-((i + 2)*10*vid.dupy); + dot = ' '; + + if (closedcaptions[i].b) + y -= (closedcaptions[i].b--)*vid.dupy; + + if (closedcaptions[i].t < CAPTIONFADETICS) + flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS); + + if (music) + dot = '\x19'; + else if (closedcaptions[i].c && closedcaptions[i].c->origin) + dot = '\x1E'; + + V_DrawRightAlignedString(vid.width-(20*vid.dupx), y, + flags, va("%c [%s]", dot, (closedcaptions[i].s->caption[0] ? closedcaptions[i].s->caption : closedcaptions[i].s->name))); } } From 588ef776daac5ecdab2a2a0086e3c1e9536c2263 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 104/181] Stop the s3k shields spawning in ultimate. Whoops! (I considered it okay to modify in this branch because box spawning was already tweaked here.) --- src/p_mobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 364abfbc0..13b671091 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9594,7 +9594,8 @@ void P_SpawnMapThing(mapthing_t *mthing) if (ultimatemode) { if (i == MT_PITY_BOX || i == MT_ELEMENTAL_BOX || i == MT_ATTRACT_BOX - || i == MT_FORCE_BOX || i == MT_ARMAGEDDON_BOX || i == MT_WHIRLWIND_BOX) + || i == MT_FORCE_BOX || i == MT_ARMAGEDDON_BOX || i == MT_WHIRLWIND_BOX + || i == MT_FLAMEAURA_BOX || i == MT_BUBBLEWRAP_BOX || i == MT_THUNDERCOIN_BOX) return; // No shields in Ultimate mode if (i == MT_RING_BOX && !G_IsSpecialStage(gamemap)) From bb764a7b30742bc911bd463fface4dd4cbea18de Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 105/181] Stacked force shield icons instead of the full-flashing dichotomy. https://cdn.discordapp.com/attachments/293238104096112641/308275437782433792/srb20025.gif THIS IS THE LAST THING I PROMISE --- src/st_stuff.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 26f70dd97..4e9ebdd0b 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -805,10 +805,7 @@ static void ST_drawFirstPersonHUD(void) // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right if ((player->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE) - { - if ((player->powers[pw_shield] & SH_FORCEHP) > 0 || leveltime & 1) - p = forceshield; - } + p = forceshield; else switch (player->powers[pw_shield] & SH_NOSTACK) { case SH_WHIRLWIND: p = jumpshield; break; @@ -822,7 +819,19 @@ static void ST_drawFirstPersonHUD(void) default: break; } - if (p) + if (p == forceshield) + { + UINT8 i, max = (player->powers[pw_shield] & SH_FORCEHP); + for (i = 0; i <= max; i++) + { + INT32 flags = (V_SNAPTORIGHT|V_SNAPTOTOP)|((i == max) ? V_HUDTRANS : V_HUDTRANSHALF); + if (splitscreen) + V_DrawSmallScaledPatch(312-(3*i), STRINGY(24)+(3*i), flags, p); + else + V_DrawScaledPatch(304-(3*i), 24+(3*i), flags, p); + } + } + else if (p) { if (splitscreen) V_DrawSmallScaledPatch(312, STRINGY(24), V_SNAPTORIGHT|V_SNAPTOTOP|V_HUDTRANS, p); From cfd47d33e92f4a121734c311c79dea9f3d712f20 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 106/181] Got rid of redundant writes. --- src/st_stuff.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 4e9ebdd0b..8e40f138c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -805,7 +805,17 @@ static void ST_drawFirstPersonHUD(void) // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right if ((player->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE) - p = forceshield; + { + UINT8 i, max = (player->powers[pw_shield] & SH_FORCEHP); + for (i = 0; i <= max; i++) + { + INT32 flags = (V_SNAPTORIGHT|V_SNAPTOTOP)|((i == max) ? V_HUDTRANS : V_HUDTRANSHALF); + if (splitscreen) + V_DrawSmallScaledPatch(312-(3*i), STRINGY(24)+(3*i), flags, forceshield); + else + V_DrawScaledPatch(304-(3*i), 24+(3*i), flags, forceshield); + } + } else switch (player->powers[pw_shield] & SH_NOSTACK) { case SH_WHIRLWIND: p = jumpshield; break; @@ -819,19 +829,7 @@ static void ST_drawFirstPersonHUD(void) default: break; } - if (p == forceshield) - { - UINT8 i, max = (player->powers[pw_shield] & SH_FORCEHP); - for (i = 0; i <= max; i++) - { - INT32 flags = (V_SNAPTORIGHT|V_SNAPTOTOP)|((i == max) ? V_HUDTRANS : V_HUDTRANSHALF); - if (splitscreen) - V_DrawSmallScaledPatch(312-(3*i), STRINGY(24)+(3*i), flags, p); - else - V_DrawScaledPatch(304-(3*i), 24+(3*i), flags, p); - } - } - else if (p) + if (p) { if (splitscreen) V_DrawSmallScaledPatch(312, STRINGY(24), V_SNAPTORIGHT|V_SNAPTOTOP|V_HUDTRANS, p); From 19ca1698d8ac9cd1503d5d735ccdd22f155d2265 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 30 Apr 2017 20:33:36 +0100 Subject: [PATCH 107/181] Combine all /objs/*/.gitignore files into /objs/.gitignore, make sure depend.ped is also ignored --- objs/.gitignore | 8 ++++++++ objs/DC/SDL/Debug/.gitignore | 1 - objs/DC/SDL/Release/.gitignore | 1 - objs/Linux/SDL/Debug/.gitignore | 2 -- objs/Linux/SDL/Release/.gitignore | 2 -- objs/Linux64/SDL/Debug/.gitignore | 2 -- objs/Linux64/SDL/Release/.gitignore | 2 -- objs/Mingw/Debug/.gitignore | 3 --- objs/Mingw/Release/.gitignore | 3 --- objs/Mingw/SDL/Debug/.gitignore | 3 --- objs/Mingw/SDL/Release/.gitignore | 3 --- objs/Mingw64/Debug/.gitignore | 3 --- objs/Mingw64/Release/.gitignore | 3 --- objs/Mingw64/SDL/Debug/.gitignore | 3 --- objs/Mingw64/SDL/Release/.gitignore | 3 --- objs/PS3/SDL/Debug/.gitignore | 2 -- objs/PS3/SDL/Release/.gitignore | 2 -- objs/PSP/SDL/Release/.gitignore | 1 - objs/SDL/Release/.gitignore | 1 - objs/VC/.gitignore | 0 objs/VC9/.gitignore | 2 -- objs/Wii/SDL/Debug/.gitignore | 2 -- objs/Wii/SDL/Release/.gitignore | 2 -- objs/WinCE/SDL/Release/.gitignore | 1 - objs/djgppdos/Debug/.gitignore | 1 - objs/djgppdos/Release/.gitignore | 1 - objs/nds/Debug/.gitignore | 2 -- objs/nds/Release/.gitignore | 2 -- 28 files changed, 8 insertions(+), 53 deletions(-) create mode 100644 objs/.gitignore delete mode 100644 objs/DC/SDL/Debug/.gitignore delete mode 100644 objs/DC/SDL/Release/.gitignore delete mode 100644 objs/Linux/SDL/Debug/.gitignore delete mode 100644 objs/Linux/SDL/Release/.gitignore delete mode 100644 objs/Linux64/SDL/Debug/.gitignore delete mode 100644 objs/Linux64/SDL/Release/.gitignore delete mode 100644 objs/Mingw/Debug/.gitignore delete mode 100644 objs/Mingw/Release/.gitignore delete mode 100644 objs/Mingw/SDL/Debug/.gitignore delete mode 100644 objs/Mingw/SDL/Release/.gitignore delete mode 100644 objs/Mingw64/Debug/.gitignore delete mode 100644 objs/Mingw64/Release/.gitignore delete mode 100644 objs/Mingw64/SDL/Debug/.gitignore delete mode 100644 objs/Mingw64/SDL/Release/.gitignore delete mode 100644 objs/PS3/SDL/Debug/.gitignore delete mode 100644 objs/PS3/SDL/Release/.gitignore delete mode 100644 objs/PSP/SDL/Release/.gitignore delete mode 100644 objs/SDL/Release/.gitignore delete mode 100644 objs/VC/.gitignore delete mode 100644 objs/VC9/.gitignore delete mode 100644 objs/Wii/SDL/Debug/.gitignore delete mode 100644 objs/Wii/SDL/Release/.gitignore delete mode 100644 objs/WinCE/SDL/Release/.gitignore delete mode 100644 objs/djgppdos/Debug/.gitignore delete mode 100644 objs/djgppdos/Release/.gitignore delete mode 100644 objs/nds/Debug/.gitignore delete mode 100644 objs/nds/Release/.gitignore diff --git a/objs/.gitignore b/objs/.gitignore new file mode 100644 index 000000000..35ecd6def --- /dev/null +++ b/objs/.gitignore @@ -0,0 +1,8 @@ +#All folders +SRB2.res +depend.dep +depend.ped +*.o +#VC9 folder only +/VC9/Win32 +/VC9/x64 diff --git a/objs/DC/SDL/Debug/.gitignore b/objs/DC/SDL/Debug/.gitignore deleted file mode 100644 index 867fcb4e0..000000000 --- a/objs/DC/SDL/Debug/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.dep diff --git a/objs/DC/SDL/Release/.gitignore b/objs/DC/SDL/Release/.gitignore deleted file mode 100644 index 867fcb4e0..000000000 --- a/objs/DC/SDL/Release/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.dep diff --git a/objs/Linux/SDL/Debug/.gitignore b/objs/Linux/SDL/Debug/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/Linux/SDL/Debug/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/Linux/SDL/Release/.gitignore b/objs/Linux/SDL/Release/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/Linux/SDL/Release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/Linux64/SDL/Debug/.gitignore b/objs/Linux64/SDL/Debug/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/Linux64/SDL/Debug/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/Linux64/SDL/Release/.gitignore b/objs/Linux64/SDL/Release/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/Linux64/SDL/Release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/Mingw/Debug/.gitignore b/objs/Mingw/Debug/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw/Debug/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw/Release/.gitignore b/objs/Mingw/Release/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw/Release/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw/SDL/Debug/.gitignore b/objs/Mingw/SDL/Debug/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw/SDL/Debug/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw/SDL/Release/.gitignore b/objs/Mingw/SDL/Release/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw/SDL/Release/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw64/Debug/.gitignore b/objs/Mingw64/Debug/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw64/Debug/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw64/Release/.gitignore b/objs/Mingw64/Release/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw64/Release/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw64/SDL/Debug/.gitignore b/objs/Mingw64/SDL/Debug/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw64/SDL/Debug/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/Mingw64/SDL/Release/.gitignore b/objs/Mingw64/SDL/Release/.gitignore deleted file mode 100644 index da4b3e912..000000000 --- a/objs/Mingw64/SDL/Release/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/SRB2.res -/depend.dep -/*.o diff --git a/objs/PS3/SDL/Debug/.gitignore b/objs/PS3/SDL/Debug/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/PS3/SDL/Debug/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/PS3/SDL/Release/.gitignore b/objs/PS3/SDL/Release/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/PS3/SDL/Release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/PSP/SDL/Release/.gitignore b/objs/PSP/SDL/Release/.gitignore deleted file mode 100644 index 867fcb4e0..000000000 --- a/objs/PSP/SDL/Release/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.dep diff --git a/objs/SDL/Release/.gitignore b/objs/SDL/Release/.gitignore deleted file mode 100644 index 4a262f94f..000000000 --- a/objs/SDL/Release/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.ped diff --git a/objs/VC/.gitignore b/objs/VC/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/objs/VC9/.gitignore b/objs/VC9/.gitignore deleted file mode 100644 index 205fe45de..000000000 --- a/objs/VC9/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Win32 -/x64 diff --git a/objs/Wii/SDL/Debug/.gitignore b/objs/Wii/SDL/Debug/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/Wii/SDL/Debug/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/Wii/SDL/Release/.gitignore b/objs/Wii/SDL/Release/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/Wii/SDL/Release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/WinCE/SDL/Release/.gitignore b/objs/WinCE/SDL/Release/.gitignore deleted file mode 100644 index 867fcb4e0..000000000 --- a/objs/WinCE/SDL/Release/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.dep diff --git a/objs/djgppdos/Debug/.gitignore b/objs/djgppdos/Debug/.gitignore deleted file mode 100644 index 867fcb4e0..000000000 --- a/objs/djgppdos/Debug/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.dep diff --git a/objs/djgppdos/Release/.gitignore b/objs/djgppdos/Release/.gitignore deleted file mode 100644 index 867fcb4e0..000000000 --- a/objs/djgppdos/Release/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/depend.dep diff --git a/objs/nds/Debug/.gitignore b/objs/nds/Debug/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/nds/Debug/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o diff --git a/objs/nds/Release/.gitignore b/objs/nds/Release/.gitignore deleted file mode 100644 index 8f6d0bdcd..000000000 --- a/objs/nds/Release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/depend.dep -/*.o From d7a216e1927784112142a220ea812976c6b75136 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 30 Apr 2017 20:42:24 +0100 Subject: [PATCH 108/181] Ignore all *.exe files and *.mo files (such as en.mo) in all bin/Mingw folders --- bin/Mingw/Debug/.gitignore | 6 +++--- bin/Mingw/Release/.gitignore | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/Mingw/Debug/.gitignore b/bin/Mingw/Debug/.gitignore index e431dca5d..834f313e3 100644 --- a/bin/Mingw/Debug/.gitignore +++ b/bin/Mingw/Debug/.gitignore @@ -1,3 +1,3 @@ -/srb2sdl.exe -/srb2win.exe -/r_opengl.dll +*.exe +*.mo +r_opengl.dll diff --git a/bin/Mingw/Release/.gitignore b/bin/Mingw/Release/.gitignore index e431dca5d..834f313e3 100644 --- a/bin/Mingw/Release/.gitignore +++ b/bin/Mingw/Release/.gitignore @@ -1,3 +1,3 @@ -/srb2sdl.exe -/srb2win.exe -/r_opengl.dll +*.exe +*.mo +r_opengl.dll From d669a4e84ac4e4292a8b95ab88f4948090282741 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 109/181] Introducing pMasterPalette. Used instead of pLocalPalette when attempting to determine objective truths, such as "the colours of this gif without color profile modification" and "what indicies should this colormap remap to". Also, made f_wipe.c's paldiv only get calculated once. --- src/f_wipe.c | 7 ++++--- src/m_anigif.c | 19 +++++++------------ src/m_misc.c | 46 +++++++++++++++++----------------------------- src/r_data.c | 20 ++++++++++---------- src/v_video.c | 11 +++++++---- src/v_video.h | 1 + 6 files changed, 46 insertions(+), 58 deletions(-) diff --git a/src/f_wipe.c b/src/f_wipe.c index a0b685a32..acc4efaaa 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -86,7 +86,7 @@ INT32 lastwipetic = 0; static UINT8 *wipe_scr_start; //screen 3 static UINT8 *wipe_scr_end; //screen 4 static UINT8 *wipe_scr; //screen 0 (main drawing) -static fixed_t paldiv; +static fixed_t paldiv = 0; /** Create fademask_t from lump * @@ -145,7 +145,7 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { while (lsize--) { // Determine pixel to use from fademask - pcolor = &pLocalPalette[*lump++]; + pcolor = &pMasterPalette[*lump++]; *mask++ = FixedDiv((pcolor->s.red+1)<>FRACBITS; } @@ -337,7 +337,8 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) UINT8 wipeframe = 0; fademask_t *fmask; - paldiv = FixedDiv(257< Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 110/181] Fix typo. --- src/v_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index a0f2a86b5..f7a5c2841 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -382,7 +382,7 @@ static void LoadPalette(const char *lumpname) else if (working[0][q] < 0.0) working[0][q] = 0.0; } -#undef dowork +#undef dolerp pLocalPalette[i].s.red = (UINT8)(working[0][0]); pLocalPalette[i].s.green = (UINT8)(working[0][1]); From 1af1bbee3eca961ea3230a919b89fec4a92fa185 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 111/181] Free level select memory whenever it isn't possible to go back to the menu. --- src/m_menu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 4530e3f05..aecb91dd0 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4134,6 +4134,8 @@ static void M_HandleLevelPlatter(INT32 choice) M_SetupNextMenu(currentMenu->prevMenu->prevMenu); else M_ChangeLevel(0); + Z_Free(levelselect.rows); + levelselect.rows = NULL; } else M_LevelSelectWarp(0); @@ -4163,6 +4165,8 @@ static void M_HandleLevelPlatter(INT32 choice) } else M_ClearMenus(true); + Z_Free(levelselect.rows); + levelselect.rows = NULL; } } @@ -6105,6 +6109,10 @@ static void M_ChoosePlayer(INT32 choice) G_DeferedInitNew(ultmode, G_BuildMapName(startmap), (UINT8)skinnum, false, fromlevelselect); COM_BufAddText("dummyconsvar 1\n"); // G_DeferedInitNew doesn't do this + + if (levelselect.rows) + Z_Free(levelselect.rows); + levelselect.rows = NULL; } // =============== From 59397d7cb3e7d580c4c65e50f6715e24e2d06040 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 29 Apr 2017 16:40:07 +0100 Subject: [PATCH 112/181] More sound naming consistency! (Sorry.) --- src/info.c | 2 +- src/sounds.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/info.c b/src/info.c index 87b0dc586..9e779acb0 100644 --- a/src/info.c +++ b/src/info.c @@ -7105,7 +7105,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_PITY_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_s3k3a, // seesound + sfx_shield, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate diff --git a/src/sounds.c b/src/sounds.c index 390107c1f..2f5f6acf0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -290,8 +290,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Attraction shot"}, {"s3k41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning Shield"}, {"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Twinspin"}, - {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fire burst"}, - {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"}, + {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flame burst"}, + {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bubble bounce"}, {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Lightning zap"}, {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Transformation"}, {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising dust"}, From 7f936d8b57f0e12f8c2be513fcf38ee3fe863b71 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 1 May 2017 19:34:53 +0100 Subject: [PATCH 113/181] Add CONS_Alert warning as toaster suggested --- src/p_spec.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 7be9c96ea..29956d160 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3167,22 +3167,31 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT32 viewid = sides[line->sidenum[0]].textureoffset>>FRACBITS; INT32 centerid = sides[line->sidenum[0]].rowoffset>>FRACBITS; - // set viewpoint mobj - if (!(line->flags & ML_EFFECT4)) + if ((line->flags & (ML_EFFECT4|ML_BLOCKMONSTERS)) == ML_EFFECT4) // Solid Midtexture is on but Block Enemies is off? { - if (viewid >= 0 && viewid < 16) - skyboxmo[0] = skyboxviewpnts[viewid]; - else - skyboxmo[0] = NULL; + CONS_Alert(CONS_WARNING, + M_GetText("Skybox switch linedef (tag %d) doesn't have anything to do.\nConsider changing the linedef's flag configuration or removing it entirely.\n"), + line->tag); } - - // set centerpoint mobj - if (line->flags & ML_BLOCKMONSTERS) + else { - if (centerid >= 0 && centerid < 16) - skyboxmo[1] = skyboxcenterpnts[centerid]; - else - skyboxmo[1] = NULL; + // set viewpoint mobj + if (!(line->flags & ML_EFFECT4)) // Solid Midtexture turns off viewpoint setting + { + if (viewid >= 0 && viewid < 16) + skyboxmo[0] = skyboxviewpnts[viewid]; + else + skyboxmo[0] = NULL; + } + + // set centerpoint mobj + if (line->flags & ML_BLOCKMONSTERS) // Block Enemies turns ON centerpoint setting + { + if (centerid >= 0 && centerid < 16) + skyboxmo[1] = skyboxcenterpnts[centerid]; + else + skyboxmo[1] = NULL; + } } CONS_Debug(DBG_GAMELOGIC, "Line type 448 Executor: viewid = %d, centerid = %d, viewpoint? = %s, centerpoint? = %s\n", From 41130465b4e3f77aab4f88bbf1ee88b923eda2d6 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 7 May 2017 22:21:17 +0100 Subject: [PATCH 114/181] Use NF instead of normal P_SetMobjState to prevent endless looping --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index a8a6bb6b4..649c78838 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1102,7 +1102,7 @@ void A_JetJawChomp(mobj_t *actor) if (!actor->target || !(actor->target->flags & MF_SHOOTABLE) || actor->target->health <= 0 || !P_CheckSight(actor, actor->target)) { - P_SetMobjState(actor, actor->info->spawnstate); + P_SetMobjStateNF(actor, actor->info->spawnstate); return; } From 1745966aa62876f2951914f0e034324898fd7f19 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 8 May 2017 15:54:17 +0100 Subject: [PATCH 115/181] Re-add all the folders present in objs before my .gitignore changes, by adding .gitignore files again to keep them from disappearing --- objs/DC/SDL/Debug/.gitignore | 2 ++ objs/DC/SDL/Release/.gitignore | 2 ++ objs/Linux/SDL/Debug/.gitignore | 2 ++ objs/Linux/SDL/Release/.gitignore | 2 ++ objs/Linux64/SDL/Debug/.gitignore | 2 ++ objs/Linux64/SDL/Release/.gitignore | 2 ++ objs/Mingw/Debug/.gitignore | 2 ++ objs/Mingw/Release/.gitignore | 2 ++ objs/Mingw/SDL/Debug/.gitignore | 2 ++ objs/Mingw/SDL/Release/.gitignore | 2 ++ objs/Mingw64/Debug/.gitignore | 2 ++ objs/Mingw64/Release/.gitignore | 2 ++ objs/Mingw64/SDL/Debug/.gitignore | 2 ++ objs/Mingw64/SDL/Release/.gitignore | 2 ++ objs/PS3/SDL/Debug/.gitignore | 2 ++ objs/PS3/SDL/Release/.gitignore | 2 ++ objs/PSP/SDL/Release/.gitignore | 2 ++ objs/SDL/Release/.gitignore | 2 ++ objs/VC/.gitignore | 2 ++ objs/VC9/.gitignore | 2 ++ objs/Wii/SDL/Debug/.gitignore | 2 ++ objs/Wii/SDL/Release/.gitignore | 2 ++ objs/WinCE/SDL/Release/.gitignore | 2 ++ objs/djgppdos/Debug/.gitignore | 2 ++ objs/djgppdos/Release/.gitignore | 2 ++ objs/nds/Debug/.gitignore | 2 ++ objs/nds/Release/.gitignore | 2 ++ 27 files changed, 54 insertions(+) create mode 100644 objs/DC/SDL/Debug/.gitignore create mode 100644 objs/DC/SDL/Release/.gitignore create mode 100644 objs/Linux/SDL/Debug/.gitignore create mode 100644 objs/Linux/SDL/Release/.gitignore create mode 100644 objs/Linux64/SDL/Debug/.gitignore create mode 100644 objs/Linux64/SDL/Release/.gitignore create mode 100644 objs/Mingw/Debug/.gitignore create mode 100644 objs/Mingw/Release/.gitignore create mode 100644 objs/Mingw/SDL/Debug/.gitignore create mode 100644 objs/Mingw/SDL/Release/.gitignore create mode 100644 objs/Mingw64/Debug/.gitignore create mode 100644 objs/Mingw64/Release/.gitignore create mode 100644 objs/Mingw64/SDL/Debug/.gitignore create mode 100644 objs/Mingw64/SDL/Release/.gitignore create mode 100644 objs/PS3/SDL/Debug/.gitignore create mode 100644 objs/PS3/SDL/Release/.gitignore create mode 100644 objs/PSP/SDL/Release/.gitignore create mode 100644 objs/SDL/Release/.gitignore create mode 100644 objs/VC/.gitignore create mode 100644 objs/VC9/.gitignore create mode 100644 objs/Wii/SDL/Debug/.gitignore create mode 100644 objs/Wii/SDL/Release/.gitignore create mode 100644 objs/WinCE/SDL/Release/.gitignore create mode 100644 objs/djgppdos/Debug/.gitignore create mode 100644 objs/djgppdos/Release/.gitignore create mode 100644 objs/nds/Debug/.gitignore create mode 100644 objs/nds/Release/.gitignore diff --git a/objs/DC/SDL/Debug/.gitignore b/objs/DC/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/DC/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/DC/SDL/Release/.gitignore b/objs/DC/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/DC/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Linux/SDL/Debug/.gitignore b/objs/Linux/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Linux/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Linux/SDL/Release/.gitignore b/objs/Linux/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Linux/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Linux64/SDL/Debug/.gitignore b/objs/Linux64/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Linux64/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Linux64/SDL/Release/.gitignore b/objs/Linux64/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Linux64/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw/Debug/.gitignore b/objs/Mingw/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw/Release/.gitignore b/objs/Mingw/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw/SDL/Debug/.gitignore b/objs/Mingw/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw/SDL/Release/.gitignore b/objs/Mingw/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw64/Debug/.gitignore b/objs/Mingw64/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw64/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw64/Release/.gitignore b/objs/Mingw64/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw64/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw64/SDL/Debug/.gitignore b/objs/Mingw64/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw64/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Mingw64/SDL/Release/.gitignore b/objs/Mingw64/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Mingw64/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/PS3/SDL/Debug/.gitignore b/objs/PS3/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/PS3/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/PS3/SDL/Release/.gitignore b/objs/PS3/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/PS3/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/PSP/SDL/Release/.gitignore b/objs/PSP/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/PSP/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/SDL/Release/.gitignore b/objs/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/VC/.gitignore b/objs/VC/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/VC/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/VC9/.gitignore b/objs/VC9/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/VC9/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Wii/SDL/Debug/.gitignore b/objs/Wii/SDL/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Wii/SDL/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/Wii/SDL/Release/.gitignore b/objs/Wii/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/Wii/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/WinCE/SDL/Release/.gitignore b/objs/WinCE/SDL/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/WinCE/SDL/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/djgppdos/Debug/.gitignore b/objs/djgppdos/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/djgppdos/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/djgppdos/Release/.gitignore b/objs/djgppdos/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/djgppdos/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/nds/Debug/.gitignore b/objs/nds/Debug/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/nds/Debug/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing diff --git a/objs/nds/Release/.gitignore b/objs/nds/Release/.gitignore new file mode 100644 index 000000000..42c6dc2c6 --- /dev/null +++ b/objs/nds/Release/.gitignore @@ -0,0 +1,2 @@ +# DON'T REMOVE +# This keeps the folder from disappearing From 2696ed52fd89b4ddfe1c363d09b471dd691a7f6a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 9 May 2017 12:50:28 +0100 Subject: [PATCH 116/181] Fixed the thing where Robo Hood's jump was messed up. Also, ditto re Super Sonic's floaties. --- src/p_user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index bbcaa3708..8ce1d08d7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9137,8 +9137,9 @@ void P_PlayerThink(player_t *player) if (player->panim != PA_ABILITY) P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); } - else if ((player->pflags & PF_JUMPED && !(player->pflags & PF_NOJUMPDAMAGE)) - && ((player->charflags & SF_NOJUMPSPIN && player->panim != PA_ROLL) + else if ((player->pflags & PF_JUMPED && !(player->pflags & PF_NOJUMPDAMAGE) + && (player->mo->state-states != S_PLAY_FLOAT && player->mo->state-states != S_PLAY_FLOAT_RUN)) + && ((((player->charflags & (SF_NOJUMPSPIN|SF_NOJUMPDAMAGE)) == (SF_NOJUMPSPIN|SF_NOJUMPDAMAGE)) && player->panim != PA_ROLL) || (!(player->charflags & SF_NOJUMPSPIN) && player->panim != PA_JUMP))) { if (!(player->charflags & SF_NOJUMPSPIN)) From 0cc838bca720a6ebb5a6755deef6a2fc2e61d8bd Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 9 May 2017 14:17:34 +0100 Subject: [PATCH 117/181] make: *** [../objs/Mingw/Debug/m_menu.o] Error 1 s_sound.c: In function `S_StartCaption': s_sound.c:416: warning: comparison of unsigned expression >= 0 is always true Makefile:770: recipe for target '../objs/Mingw/Debug/s_sound.o' failed make: *** [../objs/Mingw/Debug/s_sound.o] Error 1 --- src/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index b8cb06075..20b71fce8 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -413,7 +413,7 @@ void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan) return; // check for bogus sound # - I_Assert(sfx_id >= 0); // allows sfx_None; this shouldn't be allowed directly if S_StartCaption is ever exposed to Lua by itself + // I_Assert(sfx_id >= 0); -- allowing sfx_None; this shouldn't be allowed directly if S_StartCaption is ever exposed to Lua by itself I_Assert(sfx_id < NUMSFX); sfx = &S_sfx[sfx_id]; From 378b913e6623252cf0408b80a2b20a0efd8fbe6a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 9 May 2017 14:18:45 +0100 Subject: [PATCH 118/181] lua_blockmaplib.c:269:7: no newline at end of file Makefile:770: recipe for target '../objs/Mingw/Debug/lua_blockmaplib.o' failed make: *** [../objs/Mingw/Debug/lua_blockmaplib.o] Error 1 --- src/lua_blockmaplib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_blockmaplib.c b/src/lua_blockmaplib.c index d90ef4d67..ccd90f993 100644 --- a/src/lua_blockmaplib.c +++ b/src/lua_blockmaplib.c @@ -266,4 +266,4 @@ int LUA_BlockmapLib(lua_State *L) return 0; } -#endif \ No newline at end of file +#endif From a4b74e7d3fcfc665ee272da0c9946f5754e08e96 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 9 May 2017 14:19:54 +0100 Subject: [PATCH 119/181] m_menu.c:1907: error: `M_DrawScreenshotMenu' undeclared here (not in a function) m_menu.c:1907: error: initializer element is not constant m_menu.c:1907: error: (near initialization for `OP_ScreenshotOptionsDef.drawroutine') m_menu.c:9353: warning: 'M_DrawScreenshotMenu' defined but not used Makefile:770: recipe for target '../objs/Mingw/Debug/m_menu.o' failed make: *** [../objs/Mingw/Debug/m_menu.o] Error 1 --- src/m_menu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/m_menu.c b/src/m_menu.c index 68a838760..b7f9e8802 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -358,6 +358,7 @@ static void M_DrawMainVideoMenu(void); static void M_DrawVideoMode(void); static void M_DrawColorMenu(void); static void M_DrawSoundMenu(void); +static void M_DrawScreenshotMenu(void); static void M_DrawMonitorToggles(void); #ifdef HWRENDER static void M_OGL_DrawFogMenu(void); From e69b08178f91648e327cff663356fa330f8e7f47 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 9 May 2017 14:42:06 +0100 Subject: [PATCH 120/181] p_floor.c: In function `EV_CrumbleChain': p_floor.c:2932: warning: 'widthfactor' might be used uninitialized in this function p_floor.c:2932: warning: 'heightfactor' might be used uninitialized in this function --- src/p_floor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index cefdc3d4f..68c3d55b8 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2929,7 +2929,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) fixed_t leftx, rightx; fixed_t topy, bottomy; fixed_t topz, bottomz; - fixed_t widthfactor, heightfactor; + fixed_t widthfactor = FRACUNIT, heightfactor = FRACUNIT; fixed_t a, b, c; mobjtype_t type = MT_ROCKCRUMBLE1; fixed_t spacing = (32< Date: Tue, 9 May 2017 14:42:23 +0100 Subject: [PATCH 121/181] s_sound.c: In function `S_StartCaption': s_sound.c:409: warning: 'same' might be used uninitialized in this functio --- src/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index 20b71fce8..2f3b1ae93 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -406,7 +406,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum) void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan) { UINT8 i, set, moveup, start; - boolean same; + boolean same = false; sfxinfo_t *sfx; if (!cv_closedcaptioning.value) // no captions at all From 8582406dd2f27d7e9e7c810cca15993b09a41f36 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 9 May 2017 19:57:21 +0100 Subject: [PATCH 122/181] prevent invalid nodes from crashing Net_CloseConnection, print a warning and return instead --- src/d_net.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/d_net.c b/src/d_net.c index 7f16c302d..98fe71ab8 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -716,6 +716,12 @@ void Net_CloseConnection(INT32 node) if (!node) return; + if (node >= MAXNETNODES) // prevent invalid nodes from crashing the game + { + CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node); + return; + } + nodes[node].flags |= NF_CLOSE; // try to Send ack back (two army problem) From 96c63bf95b66061d84e8b71ed1679a8180a3c477 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 9 May 2017 20:02:42 +0100 Subject: [PATCH 123/181] Whoops forgot this bit too --- src/d_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_net.c b/src/d_net.c index 98fe71ab8..70cdc5f14 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -716,7 +716,7 @@ void Net_CloseConnection(INT32 node) if (!node) return; - if (node >= MAXNETNODES) // prevent invalid nodes from crashing the game + if (node < 0 || node >= MAXNETNODES) // prevent invalid nodes from crashing the game { CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node); return; From b8ffeeb59f4a7022b6ebbb8e2762deb21f5df6e2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 12 May 2017 16:06:27 +0100 Subject: [PATCH 124/181] Update version number to v2.1.18 Don't worry, I remembered to update MODVERSION as well this time :) --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- src/doomdef.h | 8 ++++---- src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31597f399..23b768a70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) project(SRB2 - VERSION 2.1.17 + VERSION 2.1.18 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index b0544a90b..76e1261f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.1.17.{branch}-{build} +version: 2.1.18.{branch}-{build} os: MinGW environment: diff --git a/src/doomdef.h b/src/doomdef.h index 99e54c077..428972ccd 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -150,9 +150,9 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 201 // Game version -#define SUBVERSION 17 // more precise version number -#define VERSIONSTRING "v2.1.17" -#define VERSIONSTRINGW L"v2.1.17" +#define SUBVERSION 18 // more precise version number +#define VERSIONSTRING "v2.1.18" +#define VERSIONSTRINGW L"v2.1.18" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -214,7 +214,7 @@ extern FILE *logstream; // 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.1.0 is not version "1". -#define MODVERSION 22 +#define MODVERSION 23 // ========================================================================= diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 32ae88c02..fbf9bacb2 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1214,7 +1214,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.17; + CURRENT_PROJECT_VERSION = 2.1.18; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1226,7 +1226,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.17; + CURRENT_PROJECT_VERSION = 2.1.18; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj index 13e78f314..98a760c7b 100644 --- a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1214,7 +1214,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.17; + CURRENT_PROJECT_VERSION = 2.1.18; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1226,7 +1226,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.17; + CURRENT_PROJECT_VERSION = 2.1.18; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From 377fc814479f768558114960c5bc8557195b1f01 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 13 May 2017 12:07:37 -0400 Subject: [PATCH 125/181] Appveyor: disable deployment --- appveyor.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 76e1261f9..75f3b3abf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -63,21 +63,21 @@ after_build: test: off -deploy: - - provider: FTP - protocol: ftps - host: - secure: NsLJEPIBvmwCOj8Tg8RoRQ== - username: - secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= - password: - secure: Hbn6Uy3lT0YZ88yFJ3aW4w== - folder: appveyor - application: - active_mode: false - on: - branch: master - appveyor_repo_tag: true +#deploy: +# - provider: FTP +# protocol: ftps +# host: +# secure: NsLJEPIBvmwCOj8Tg8RoRQ== +# username: +# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= +# password: +# secure: Hbn6Uy3lT0YZ88yFJ3aW4w== +# folder: appveyor +# application: +# active_mode: false +# on: +# branch: master +# appveyor_repo_tag: true on_finish: From 7d4146870a8b7dd1484af3c8650a2f8979dc79f4 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 13 May 2017 12:13:47 -0400 Subject: [PATCH 126/181] Appveyor: keep a stable name version of the archive --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 75f3b3abf..c1f6894ef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -58,8 +58,11 @@ after_build: - cmd: git rev-parse --short %APPVEYOR_REPO_COMMIT%>%TMP%/gitshort.txt - cmd: set /P GITSHORT=<%TMP%/gitshort.txt - set BUILD_ARCHIVE=%APPVEYOR_REPO_BRANCH%-%GITSHORT%-%CONFIGURATION%.7z +- set BUILDSARCHIVE=%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%.7z - cmd: 7z a %BUILD_ARCHIVE% bin\Mingw\Release -xr!.gitignore - appveyor PushArtifact %BUILD_ARCHIVE% +- cmd: copy %BUILD_ARCHIVE% %BUILDSARCHIVE% +- appveyor PushArtifact %BUILDSARCHIVE% test: off From bdcd9125d299cb59c0d3a49be5b2ce0da0f4195c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 14 May 2017 14:47:09 +0100 Subject: [PATCH 127/181] Fixed that thing where missiles like sliding up slopes for some reason. This isn't a 1:1 fix for non-slopes - they still like stepping up over the borders of sloped sectors - but this fixes the most egregrious issue. --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index fb8648013..82640abcf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2363,7 +2363,7 @@ static boolean P_ZMovement(mobj_t *mo) mo->z = mo->floorz; #ifdef ESLOPE - if (mo->standingslope) // You're still on the ground; why are we here? + if (!(mo->flags & MF_MISSILE) && mo->standingslope) // You're still on the ground; why are we here? { mo->momz = 0; return true; From 222807c6f62d73e60c33f1d229f8c7678273b562 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 14:29:31 +0100 Subject: [PATCH 128/181] Fix R_InitExtraColormaps reporting 6 or more colormaps every time you loaded the game, even though we haven't used C_START/C_END in more than a decade now Note to self: W_ functions are awfully confusing with returning with LUMPERROR or INT16_MAX. Should sort out what's going on there if necessary --- src/r_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index 7bad6bb89..4066ca648 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -944,12 +944,12 @@ static void R_InitExtraColormaps(void) for (cfile = clump = 0; cfile < numwadfiles; cfile++, clump = 0) { startnum = W_CheckNumForNamePwad("C_START", cfile, clump); - if (startnum == LUMPERROR) + if (startnum == INT16_MAX) continue; endnum = W_CheckNumForNamePwad("C_END", cfile, clump); - if (endnum == LUMPERROR) + if (endnum == INT16_MAX) I_Error("R_InitExtraColormaps: C_START without C_END\n"); if (WADFILENUM(startnum) != WADFILENUM(endnum)) From f8482421e5dd1666a61e4901b988a62829b1c2d7 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 14:38:55 +0100 Subject: [PATCH 129/181] Don't need to use WADFILENUM/LUMPNUM in this function, since W_CheckNumForNamePwad returns just the lump number, not a combined WAD + lump number frankenstein's monster This is just in case someone actually tries to dump in C_START/C_END and "add" colormaps using them, not that they would ever be used currently anyway. --- src/r_data.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index 4066ca648..d19882dd3 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -952,15 +952,16 @@ static void R_InitExtraColormaps(void) if (endnum == INT16_MAX) I_Error("R_InitExtraColormaps: C_START without C_END\n"); - if (WADFILENUM(startnum) != WADFILENUM(endnum)) - I_Error("R_InitExtraColormaps: C_START and C_END in different wad files!\n"); + // This shouldn't be possible when you use the Pwad function, silly + //if (WADFILENUM(startnum) != WADFILENUM(endnum)) + //I_Error("R_InitExtraColormaps: C_START and C_END in different wad files!\n"); if (numcolormaplumps >= maxcolormaplumps) maxcolormaplumps *= 2; colormaplumps = Z_Realloc(colormaplumps, sizeof (*colormaplumps) * maxcolormaplumps, PU_STATIC, NULL); - colormaplumps[numcolormaplumps].wadfile = WADFILENUM(startnum); - colormaplumps[numcolormaplumps].firstlump = LUMPNUM(startnum+1); + colormaplumps[numcolormaplumps].wadfile = cfile; + colormaplumps[numcolormaplumps].firstlump = startnum+1; colormaplumps[numcolormaplumps].numlumps = endnum - (startnum + 1); numcolormaplumps++; } From 093800cb06be63040368adbf4579af0738ae97a5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 15:24:40 +0100 Subject: [PATCH 130/181] I_FinishUpdate: OglSdlFinishUpdate should never run for render_soft, even if screens[0] somehow is NULL --- src/sdl/i_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index aa572e6e0..73bbe8acd 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -931,7 +931,7 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - if (render_soft == rendermode && screens[0]) + if (rendermode == render_soft && screens[0]) { SDL_Rect rect; @@ -958,7 +958,7 @@ void I_FinishUpdate(void) } #ifdef HWRENDER - else + else if (rendermode == render_opengl) { OglSdlFinishUpdate(cv_vidwait.value); } From d1bbd1261e7f3b3dbdbbe9951ae007fa120d0df0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 15:36:51 +0100 Subject: [PATCH 131/181] VID_SetMode: SDLSetMode should use vid.width/vid.height, not windowedModes[modeNum]. If modenum was < 0 or >= MAXWINMODES, that would make windowedModes[modeNum] be out of bounds and possibly crash the game. --- src/sdl/i_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 73bbe8acd..43a293ae5 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1188,7 +1188,7 @@ INT32 VID_SetMode(INT32 modeNum) } Impl_SetWindowName("SRB2 "VERSIONSTRING); - SDLSetMode(windowedModes[modeNum][0], windowedModes[modeNum][1], USE_FULLSCREEN); + SDLSetMode(vid.width, vid.height, USE_FULLSCREEN); if (render_soft == rendermode) { From 4979ab6b8ec0de1e684ff87a00978b0fab87df51 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 15:43:31 +0100 Subject: [PATCH 132/181] Not really important or anything, but checking render_soft == rendermode rather than rendermode == render_soft always bugged me. And it's not consistent with the rest of the source code (or at least most of it) anyway. --- src/sdl/i_video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 43a293ae5..2df4d527e 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -899,7 +899,7 @@ static inline boolean I_SkipFrame(void) { static boolean skip = false; - if (render_soft != rendermode) + if (rendermode != render_soft) return false; skip = !skip; @@ -1190,7 +1190,7 @@ INT32 VID_SetMode(INT32 modeNum) SDLSetMode(vid.width, vid.height, USE_FULLSCREEN); - if (render_soft == rendermode) + if (rendermode == render_soft) { if (bufSurface) { @@ -1483,7 +1483,7 @@ void I_ShutdownGraphics(void) rendermode = render_none; if (icoSurface) SDL_FreeSurface(icoSurface); icoSurface = NULL; - if (render_soft == oldrendermode) + if (oldrendermode == render_soft) { if (vidSurface) SDL_FreeSurface(vidSurface); vidSurface = NULL; From a340f2c8edec7c9e2e84f5aef4372f2423923c5c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 16:19:28 +0100 Subject: [PATCH 133/181] Impl_CreateWindow: re-use "flags" for SDL_RENDERER_* flags, remove unnecessary curly braces --- src/sdl/i_video.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2df4d527e..5602ed04d 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1209,30 +1209,20 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) int flags = 0; if (rendermode == render_none) // dedicated - { return SDL_TRUE; // Monster Iestyn -- not sure if it really matters what we return here tbh - } if (window != NULL) - { return SDL_FALSE; - } if (fullscreen) - { flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; - } if (borderlesswindow) - { flags |= SDL_WINDOW_BORDERLESS; - } #ifdef HWRENDER if (rendermode == render_opengl) - { flags |= SDL_WINDOW_OPENGL; - } #endif // Create a window @@ -1261,7 +1251,13 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) #endif if (rendermode == render_soft) { - renderer = SDL_CreateRenderer(window, -1, (usesdl2soft ? SDL_RENDERER_SOFTWARE : 0) | (cv_vidwait.value && !usesdl2soft ? SDL_RENDERER_PRESENTVSYNC : 0)); + flags = 0; // Use this to set SDL_RENDERER_* flags now + if (usesdl2soft) + flags |= SDL_RENDERER_SOFTWARE; + else if (cv_vidwait.value) + flags |= SDL_RENDERER_PRESENTVSYNC; + + renderer = SDL_CreateRenderer(window, -1, flags); if (renderer == NULL) { CONS_Printf(M_GetText("Couldn't create rendering context: %s\n"), SDL_GetError()); From 87085f2475ff5b699a1f95221b73e2e7fc81f5f6 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 16:35:32 +0100 Subject: [PATCH 134/181] SDLSetMode: merge wasfullscreen/windowed mode code into one block --- src/sdl/i_video.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 5602ed04d..ec9b901c9 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -181,15 +181,13 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) wasfullscreen = SDL_TRUE; SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); } - else if (wasfullscreen) - { - wasfullscreen = SDL_FALSE; - SDL_SetWindowFullscreen(window, 0); - SDL_SetWindowSize(window, width, height); - SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1)); - } - else + else // windowed mode { + if (wasfullscreen) + { + wasfullscreen = SDL_FALSE; + SDL_SetWindowFullscreen(window, 0); + } // Reposition window only in windowed mode SDL_SetWindowSize(window, width, height); SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1)); From 17a06dd6c4875f562bbb33ddb6ddb0fa37d8428b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 15 May 2017 18:39:59 +0100 Subject: [PATCH 135/181] I_GetConsoleEvents: Split KEY_EVENT code into a function of its own, like with I_GetEvent's event types One benefit of this is that event_t data need only be created if KEY_EVENT is found, since the other event types never do anything anyway --- src/sdl/i_system.c | 112 ++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 52 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 71ee3f794..f72a9857d 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -590,70 +590,78 @@ static BOOL I_ReadyConsole(HANDLE ci) static boolean entering_con_command = false; +static void Impl_HandleKeyboardConsoleEvent(KEY_EVENT_RECORD evt, HANDLE co) +{ + event_t event; + CONSOLE_SCREEN_BUFFER_INFO CSBI; + DWORD t; + + memset(&event,0x00,sizeof (event)); + + if (evt.bKeyDown) + { + event.type = ev_console; + entering_con_command = true; + switch (evt.wVirtualKeyCode) + { + case VK_ESCAPE: + case VK_TAB: + event.data1 = KEY_NULL; + break; + case VK_SHIFT: + event.data1 = KEY_LSHIFT; + break; + case VK_RETURN: + entering_con_command = false; + // Fall through. + default: + event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char + } + if (co != INVALID_HANDLE_VALUE && GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &t)) + { + if (event.data1 && event.data1 != KEY_LSHIFT && event.data1 != KEY_RSHIFT) + { +#ifdef _UNICODE + WriteConsole(co, &evt.uChar.UnicodeChar, 1, &t, NULL); +#else + WriteConsole(co, &evt.uChar.AsciiChar, 1 , &t, NULL); +#endif + } + if (evt.wVirtualKeyCode == VK_BACK + && GetConsoleScreenBufferInfo(co,&CSBI)) + { + WriteConsoleOutputCharacterA(co, " ",1, CSBI.dwCursorPosition, &t); + } + } + } + else + { + event.type = ev_keyup; + switch (evt.wVirtualKeyCode) + { + case VK_SHIFT: + event.data1 = KEY_LSHIFT; + break; + default: + break; + } + } + if (event.data1) D_PostEvent(&event); +} + void I_GetConsoleEvents(void) { - event_t ev = {0,0,0,0}; HANDLE ci = GetStdHandle(STD_INPUT_HANDLE); HANDLE co = GetStdHandle(STD_OUTPUT_HANDLE); - CONSOLE_SCREEN_BUFFER_INFO CSBI; INPUT_RECORD input; DWORD t; while (I_ReadyConsole(ci) && ReadConsoleInput(ci, &input, 1, &t) && t) { - memset(&ev,0x00,sizeof (ev)); switch (input.EventType) { case KEY_EVENT: - if (input.Event.KeyEvent.bKeyDown) - { - ev.type = ev_console; - entering_con_command = true; - switch (input.Event.KeyEvent.wVirtualKeyCode) - { - case VK_ESCAPE: - case VK_TAB: - ev.data1 = KEY_NULL; - break; - case VK_SHIFT: - ev.data1 = KEY_LSHIFT; - break; - case VK_RETURN: - entering_con_command = false; - // Fall through. - default: - ev.data1 = MapVirtualKey(input.Event.KeyEvent.wVirtualKeyCode,2); // convert in to char - } - if (co != INVALID_HANDLE_VALUE && GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &t)) - { - if (ev.data1 && ev.data1 != KEY_LSHIFT && ev.data1 != KEY_RSHIFT) - { -#ifdef _UNICODE - WriteConsole(co, &input.Event.KeyEvent.uChar.UnicodeChar, 1, &t, NULL); -#else - WriteConsole(co, &input.Event.KeyEvent.uChar.AsciiChar, 1 , &t, NULL); -#endif - } - if (input.Event.KeyEvent.wVirtualKeyCode == VK_BACK - && GetConsoleScreenBufferInfo(co,&CSBI)) - { - WriteConsoleOutputCharacterA(co, " ",1, CSBI.dwCursorPosition, &t); - } - } - } - else - { - ev.type = ev_keyup; - switch (input.Event.KeyEvent.wVirtualKeyCode) - { - case VK_SHIFT: - ev.data1 = KEY_LSHIFT; - break; - default: - break; - } - } - if (ev.data1) D_PostEvent(&ev); + Impl_HandleKeyboardConsoleEvent(input.Event.KeyEvent, co); break; case MOUSE_EVENT: case WINDOW_BUFFER_SIZE_EVENT: From bc79365cf458b579b52f3b978792695a156d2b92 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 18 May 2017 16:54:58 +0100 Subject: [PATCH 136/181] Moved Y_EndGame from y_inter.c/h to g_game.c/h, renamed it to G_EndGame --- src/f_finale.c | 4 ++-- src/g_game.c | 34 +++++++++++++++++++++++++++++++++- src/g_game.h | 1 + src/y_inter.c | 33 +-------------------------------- src/y_inter.h | 1 - 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index c78db4df0..db497daf7 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1723,7 +1723,7 @@ static void F_AdvanceToNextScene(void) void F_EndCutScene(void) { - cutsceneover = true; // do this first, just in case Y_EndGame or something wants to turn it back false later + cutsceneover = true; // do this first, just in case G_EndGame or something wants to turn it back false later if (runningprecutscene) { if (server) @@ -1738,7 +1738,7 @@ void F_EndCutScene(void) else if (nextmap < 1100-1) G_NextLevel(); else - Y_EndGame(); + G_EndGame(); } } diff --git a/src/g_game.c b/src/g_game.c index db06edf46..b5d4e3f0e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2927,7 +2927,7 @@ void G_AfterIntermission(void) if (nextmap < 1100-1) G_NextLevel(); else - Y_EndGame(); + G_EndGame(); } } @@ -3013,6 +3013,38 @@ static void G_DoContinued(void) gameaction = ga_nothing; } +// +// G_EndGame (formerly Y_EndGame) +// Franky this function fits better in g_game.c than it does in y_inter.c +// +// ...Gee, (why) end the game? +// Because Y_FollowIntermission and F_EndCutscene would +// both do this exact same thing *in different ways* otherwise, +// which made it so that you could only unlock Ultimate mode +// if you had a cutscene after the final level and crap like that. +// This function simplifies it so only one place has to be updated +// when something new is added. +void G_EndGame(void) +{ + // Only do evaluation and credits in coop games. + if (gametype == GT_COOP) + { + if (nextmap == 1102-1) // end game with credits + { + F_StartCredits(); + return; + } + if (nextmap == 1101-1) // end game with evaluation + { + F_StartGameEvaluation(); + return; + } + } + + // 1100 or competitive multiplayer, so go back to title screen. + D_StartTitle(); +} + // // G_LoadGameSettings // diff --git a/src/g_game.h b/src/g_game.h index 2cb527ba2..145c3ec93 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -174,6 +174,7 @@ void G_NextLevel(void); void G_Continue(void); void G_UseContinue(void); void G_AfterIntermission(void); +void G_EndGame(void); // moved from y_inter.c/h and renamed void G_Ticker(boolean run); boolean G_Responder(event_t *ev); diff --git a/src/y_inter.c b/src/y_inter.c index f639addd3..4832f0834 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1823,37 +1823,6 @@ void Y_EndIntermission(void) usebuffer = false; } -// -// Y_EndGame -// -// Why end the game? -// Because Y_FollowIntermission and F_EndCutscene would -// both do this exact same thing *in different ways* otherwise, -// which made it so that you could only unlock Ultimate mode -// if you had a cutscene after the final level and crap like that. -// This function simplifies it so only one place has to be updated -// when something new is added. -void Y_EndGame(void) -{ - // Only do evaluation and credits in coop games. - if (gametype == GT_COOP) - { - if (nextmap == 1102-1) // end game with credits - { - F_StartCredits(); - return; - } - if (nextmap == 1101-1) // end game with evaluation - { - F_StartGameEvaluation(); - return; - } - } - - // 1100 or competitive multiplayer, so go back to title screen. - D_StartTitle(); -} - // // Y_FollowIntermission // @@ -1879,7 +1848,7 @@ static void Y_FollowIntermission(void) return; } - Y_EndGame(); + G_EndGame(); } #define UNLOAD(x) Z_ChangeTag(x, PU_CACHE); x = NULL diff --git a/src/y_inter.h b/src/y_inter.h index 9fe95fcc4..26f7dc390 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -15,7 +15,6 @@ void Y_IntermissionDrawer(void); void Y_Ticker(void); void Y_StartIntermission(void); void Y_EndIntermission(void); -void Y_EndGame(void); typedef enum { From d2313ea32bd1bf9e36bb40948ea2ad503abf1990 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 18 May 2017 17:10:44 +0100 Subject: [PATCH 137/181] G_ExitLevel tweak: Use HU_ClearCEcho() instead of HU_DoCEcho(""), the latter causes an empty line to appear in log.txt --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index b5d4e3f0e..d35c7d424 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2633,7 +2633,7 @@ void G_ExitLevel(void) CONS_Printf(M_GetText("The round has ended.\n")); // Remove CEcho text on round end. - HU_DoCEcho(""); + HU_ClearCEcho(); } } From 229e75ab8bb3bf211f6f97324b1209ca0a41b506 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 18 May 2017 17:23:19 +0100 Subject: [PATCH 138/181] Removed all code in Y_FollowIntermission that's already handled in G_AfterIntermission Only real difference here is that CEcho messages will always be cleared when going to credits/evaluation, but that's hardly a loss tbh. --- src/g_game.c | 4 ++-- src/y_inter.c | 19 ++++--------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index d35c7d424..40878a70f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3015,10 +3015,10 @@ static void G_DoContinued(void) // // G_EndGame (formerly Y_EndGame) -// Franky this function fits better in g_game.c than it does in y_inter.c +// Frankly this function fits better in g_game.c than it does in y_inter.c // // ...Gee, (why) end the game? -// Because Y_FollowIntermission and F_EndCutscene would +// Because G_AfterIntermission and F_EndCutscene would // both do this exact same thing *in different ways* otherwise, // which made it so that you could only unlock Ultimate mode // if you had a cutscene after the final level and crap like that. diff --git a/src/y_inter.c b/src/y_inter.c index 4832f0834..b92b0a5ca 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1834,21 +1834,10 @@ static void Y_FollowIntermission(void) return; } - if (nextmap < 1100-1) - { - // normal level - G_AfterIntermission(); - return; - } - - // Start a custom cutscene if there is one. - if (mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking) - { - F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false); - return; - } - - G_EndGame(); + // This handles whether to play a post-level cutscene, end the game, + // or simply go to the next level. + // No need to duplicate the code here! + G_AfterIntermission(); } #define UNLOAD(x) Z_ChangeTag(x, PU_CACHE); x = NULL From 5a1fc6098ed84aa82bc73afa2640840d17a0845f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 19 May 2017 11:25:28 +0100 Subject: [PATCH 139/181] Attempts to prevent stupid stuff from happening --- src/d_clisrv.c | 7 ++++++- src/d_net.c | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 939d53dec..87e51b447 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3936,6 +3936,9 @@ FILESTAMP while (HGetPacket()) { + if (doomcom->remotenode == -1) // ...this should have been ignored already + continue; // might come from PT_NODETIMEOUT somehow though + node = (SINT8)doomcom->remotenode; if (netbuffer->packettype == PT_CLIENTJOIN && server) @@ -3968,8 +3971,10 @@ FILESTAMP if (netbuffer->packettype == PT_PLAYERINFO) continue; // We do nothing with PLAYERINFO, that's for the MS browser. + if (node < 0 || node >= MAXNETNODES) // THIS SHOULDN'T EVEN BE POSSIBLE + ; //CONS_Printf("Received packet from node %d!\n", (int)node); // Packet received from someone already playing - if (nodeingame[node]) + else if (nodeingame[node]) HandlePacketFromPlayer(node); // Packet received from someone not playing else diff --git a/src/d_net.c b/src/d_net.c index 70cdc5f14..68720f5ee 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -711,6 +711,10 @@ void Net_CloseConnection(INT32 node) #else INT32 i; boolean forceclose = (node & FORCECLOSE) != 0; + + if (node == -1) + return; // nope, just ignore it + node &= ~FORCECLOSE; if (!node) @@ -718,7 +722,7 @@ void Net_CloseConnection(INT32 node) if (node < 0 || node >= MAXNETNODES) // prevent invalid nodes from crashing the game { - CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node); + //CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node); return; } @@ -1128,6 +1132,9 @@ boolean HGetPacket(void) doomcom->remotenode = 0; rebound_tail = (rebound_tail+1) % MAXREBOUND; + + if (doomcom->remotenode == -1) // wait hang on what? + return true; // there might still be packets from others though, so don't return false #ifdef DEBUGFILE if (debugfile) DebugPrintpacket("GETLOCAL"); From 1078a642dfee676cf87fcb023d9b8889477ae959 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 19 May 2017 11:52:50 +0100 Subject: [PATCH 140/181] Loop through rebound packets until you found a good one or ran out of them --- src/d_net.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index 68720f5ee..8f11f60fc 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1124,22 +1124,27 @@ boolean HGetPacket(void) // Get a packet from self if (rebound_tail != rebound_head) { - M_Memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]); - doomcom->datalength = reboundsize[rebound_tail]; - if (netbuffer->packettype == PT_NODETIMEOUT) - doomcom->remotenode = netbuffer->u.textcmd[0]; - else - doomcom->remotenode = 0; + while (true) // loop until we found a valid packet, or we ran out of packets + { // provided MAXREBOUND is not all that large this shouldn't take too long + if (rebound_tail == rebound_head) + break; // just give up, none of them were any good somehow + M_Memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]); + doomcom->datalength = reboundsize[rebound_tail]; + if (netbuffer->packettype == PT_NODETIMEOUT) + doomcom->remotenode = netbuffer->u.textcmd[0]; + else + doomcom->remotenode = 0; - rebound_tail = (rebound_tail+1) % MAXREBOUND; + rebound_tail = (rebound_tail+1) % MAXREBOUND; - if (doomcom->remotenode == -1) // wait hang on what? - return true; // there might still be packets from others though, so don't return false + if (doomcom->remotenode == -1) // wait hang on what? + continue; // ignore it, look for the next packet #ifdef DEBUGFILE - if (debugfile) - DebugPrintpacket("GETLOCAL"); + if (debugfile) + DebugPrintpacket("GETLOCAL"); #endif - return true; + return true; + } } if (!netgame) From 284e539c66817d2448781a29024818d1c620a29c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 19 May 2017 16:31:23 +0100 Subject: [PATCH 141/181] Don't bail out in Y_StartIntermission in dedicated mode, this causes the game not to add on score bonuses for players from the server's view of things! --- src/y_inter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index b2e1cdf9f..2fd37ff33 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -965,7 +965,8 @@ void Y_StartIntermission(void) } // We couldn't display the intermission even if we wanted to. - if (dedicated) return; + // But we still need to give the players their score bonuses, dummy. + //if (dedicated) return; // This should always exist, but just in case... if(!mapheaderinfo[prevmap]) From 5aeb4b591949399676d0e5e3e358e539115f0e43 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 20 May 2017 21:29:05 +0100 Subject: [PATCH 142/181] Revert "Loop through rebound packets until you found a good one or ran out of them" On second thought, this was probably unnecessary anyway. This reverts commit 1078a642dfee676cf87fcb023d9b8889477ae959. --- src/d_net.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index 8f11f60fc..68720f5ee 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1124,27 +1124,22 @@ boolean HGetPacket(void) // Get a packet from self if (rebound_tail != rebound_head) { - while (true) // loop until we found a valid packet, or we ran out of packets - { // provided MAXREBOUND is not all that large this shouldn't take too long - if (rebound_tail == rebound_head) - break; // just give up, none of them were any good somehow - M_Memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]); - doomcom->datalength = reboundsize[rebound_tail]; - if (netbuffer->packettype == PT_NODETIMEOUT) - doomcom->remotenode = netbuffer->u.textcmd[0]; - else - doomcom->remotenode = 0; + M_Memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]); + doomcom->datalength = reboundsize[rebound_tail]; + if (netbuffer->packettype == PT_NODETIMEOUT) + doomcom->remotenode = netbuffer->u.textcmd[0]; + else + doomcom->remotenode = 0; - rebound_tail = (rebound_tail+1) % MAXREBOUND; + rebound_tail = (rebound_tail+1) % MAXREBOUND; - if (doomcom->remotenode == -1) // wait hang on what? - continue; // ignore it, look for the next packet + if (doomcom->remotenode == -1) // wait hang on what? + return true; // there might still be packets from others though, so don't return false #ifdef DEBUGFILE - if (debugfile) - DebugPrintpacket("GETLOCAL"); + if (debugfile) + DebugPrintpacket("GETLOCAL"); #endif - return true; - } + return true; } if (!netgame) From 247ed56e1790caa0a69f9f1027dfcb0d0fb5b8e8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 22 May 2017 16:44:50 +0100 Subject: [PATCH 143/181] Don't allow nonsense PT_ASKINFOVIAMS packets, nor any at all if offline --- src/d_clisrv.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 87e51b447..098430230 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3405,13 +3405,23 @@ static void HandlePacketFromAwayNode(SINT8 node) switch (netbuffer->packettype) { case PT_ASKINFOVIAMS: + if (ms_RoomId < 0) // ignore if we're not actually on the MS right now + { + Net_CloseConnection(node); // and yes, close connection + break; + } if (server && serverrunning) { INT32 clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr); - SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time)); - SV_SendPlayerInfo(clientnode); // Send extra info - Net_CloseConnection(clientnode); - // Don't close connection to MS. + if (clientnode != -1) + { + SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time)); + SV_SendPlayerInfo(clientnode); // Send extra info + Net_CloseConnection(clientnode); + // Don't close connection to MS... + } + else + Net_CloseConnection(node); // ...unless the IP address is not valid } break; From 28444c12dd6d57ae43d08186a40dd5b5e8b43019 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 22 May 2017 16:54:39 +0100 Subject: [PATCH 144/181] Some more things I overlooked in this fix --- src/d_clisrv.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 098430230..17f0b7743 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3405,14 +3405,16 @@ static void HandlePacketFromAwayNode(SINT8 node) switch (netbuffer->packettype) { case PT_ASKINFOVIAMS: - if (ms_RoomId < 0) // ignore if we're not actually on the MS right now - { - Net_CloseConnection(node); // and yes, close connection - break; - } + if (server && serverrunning) { - INT32 clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr); + INT32 clientnode; + if (ms_RoomId < 0) // ignore if we're not actually on the MS right now + { + Net_CloseConnection(node); // and yes, close connection + return; + } + clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr); if (clientnode != -1) { SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time)); @@ -3423,6 +3425,8 @@ static void HandlePacketFromAwayNode(SINT8 node) else Net_CloseConnection(node); // ...unless the IP address is not valid } + else + Net_CloseConnection(node); // you're not supposed to get it, so ignore it break; case PT_ASKINFO: From 3784d765e493d7820f7dd37b5d4c3c66ef7a3f8a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 22 May 2017 20:47:38 +0100 Subject: [PATCH 145/181] Remove extra whitespace I added --- src/d_clisrv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 17f0b7743..36b03be63 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3405,7 +3405,6 @@ static void HandlePacketFromAwayNode(SINT8 node) switch (netbuffer->packettype) { case PT_ASKINFOVIAMS: - if (server && serverrunning) { INT32 clientnode; From c70839334e180869279c84f5d40360afdcc43bdc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 22 May 2017 22:17:51 +0100 Subject: [PATCH 146/181] Added a bunch of missing checks to prevent non-server players from sending other non-server players stuff --- src/d_clisrv.c | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 36b03be63..c6b8bbd64 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3433,8 +3433,8 @@ static void HandlePacketFromAwayNode(SINT8 node) { SV_SendServerInfo(node, (tic_t)LONG(netbuffer->u.askinfo.time)); SV_SendPlayerInfo(node); // Send extra info - Net_CloseConnection(node); } + Net_CloseConnection(node); break; case PT_SERVERREFUSE: // Negative response of client join request @@ -3443,6 +3443,11 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; } + if (node != servernode) // nope you're not the server + { + Net_CloseConnection(node); + break; + } if (cl_mode == CL_WAITJOINRESPONSE) { // Save the reason so it can be displayed after quitting the netgame @@ -3474,6 +3479,11 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; } + if (node != servernode) // nope you're not the server + { + Net_CloseConnection(node); + break; + } /// \note how would this happen? and is it doing the right thing if it does? if (cl_mode != CL_WAITJOINRESPONSE) break; @@ -3537,11 +3547,20 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; } - else - Got_Filetxpak(); + if (node != servernode) // nope you're not the server + { + Net_CloseConnection(node); + break; + } + Got_Filetxpak(); break; case PT_REQUESTFILE: + if (node != servernode) // nope you're not the server + { + Net_CloseConnection(node); + break; + } if (server) Got_RequestFilePak(node); break; @@ -3926,6 +3945,21 @@ FILESTAMP case PT_SERVERCFG: break; case PT_FILEFRAGMENT: + // Only accept PT_FILEFRAGMENT from the server. + if (node != servernode) + { + CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node); + + if (server) + { + XBOXSTATIC UINT8 buf[2]; + buf[0] = (UINT8)node; + buf[1] = KICK_MSG_CON_FAIL; + SendNetXCmd(XD_KICK, &buf, 2); + } + + break; + } if (client) Got_Filetxpak(); break; From fdfd6e1c0bbce1c7c584a906a7b51f7907eba5bb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 22 May 2017 22:20:08 +0100 Subject: [PATCH 147/181] Whoops don't do that for PT_REQUESTFILE --- src/d_clisrv.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index c6b8bbd64..762624612 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3556,11 +3556,6 @@ static void HandlePacketFromAwayNode(SINT8 node) break; case PT_REQUESTFILE: - if (node != servernode) // nope you're not the server - { - Net_CloseConnection(node); - break; - } if (server) Got_RequestFilePak(node); break; From 9e3bdc5ee229c061db3550eda3c4cf1c7e4a35fb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 23 May 2017 16:13:42 +0100 Subject: [PATCH 148/181] Prevent bad PT_TEXTCMD/PT_TEXTCMD2 textcmd[0] sizes? --- src/d_clisrv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 762624612..4700fcb88 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3737,6 +3737,15 @@ FILESTAMP tic_t tic = maketic; UINT8 *textcmd; + // ignore if the textcmd size var is actually larger than it should be + if (BASEPACKETSIZE + netbuffer->u.textcmd[0] > (size_t)doomcom->datalength) + { + DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %d)\n", + BASEPACKETSIZE + netbuffer->u.textcmd[0], doomcom->datalength)); + Net_UnAcknowledgePacket(node); + break; + } + // check if tic that we are making isn't too large else we cannot send it :( // doomcom->numslots+1 "+1" since doomcom->numslots can change within this time and sent time j = software_MAXPACKETLENGTH From ff1cc07a1d20989c0271dc8c875a4d3b248aea94 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 23 May 2017 16:29:09 +0100 Subject: [PATCH 149/181] Implemented toaster's suggestion to make a macro here --- src/d_clisrv.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 4700fcb88..246642b98 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3402,6 +3402,14 @@ static void HandlePacketFromAwayNode(SINT8 node) if (node != servernode) DEBFILE(va("Received packet from unknown host %d\n", node)); +// macro for packets that should only be sent by the server +// if it is NOT from the server, bail out and close the connection! +#define SERVERONLY \ + if (node != servernode) \ + { \ + Net_CloseConnection(node); \ + break; \ + } switch (netbuffer->packettype) { case PT_ASKINFOVIAMS: @@ -3443,11 +3451,7 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; } - if (node != servernode) // nope you're not the server - { - Net_CloseConnection(node); - break; - } + SERVERONLY if (cl_mode == CL_WAITJOINRESPONSE) { // Save the reason so it can be displayed after quitting the netgame @@ -3479,11 +3483,7 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; } - if (node != servernode) // nope you're not the server - { - Net_CloseConnection(node); - break; - } + SERVERONLY /// \note how would this happen? and is it doing the right thing if it does? if (cl_mode != CL_WAITJOINRESPONSE) break; @@ -3547,11 +3547,7 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; } - if (node != servernode) // nope you're not the server - { - Net_CloseConnection(node); - break; - } + SERVERONLY Got_Filetxpak(); break; @@ -3580,6 +3576,7 @@ static void HandlePacketFromAwayNode(SINT8 node) break; // Ignore it } +#undef SERVERONLY } /** Handles a packet received from a node that is in game From 0b0b738a6f8af4ceb95c05de44f42da11b550408 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 23 May 2017 16:34:56 +0100 Subject: [PATCH 150/181] Don't allow non-servers to receive PT_RESYNCHGET --- src/d_clisrv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 246642b98..186c25e6a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3609,6 +3609,8 @@ FILESTAMP { // -------------------------------------------- SERVER RECEIVE ---------- case PT_RESYNCHGET: + if (client) + break; SV_AcknowledgeResynchAck(netconsole, netbuffer->u.resynchgot); break; case PT_CLIENTCMD: From 7147e0fcafcdf89f65bb2e909e94ea575cdbc3d9 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 23 May 2017 17:35:32 +0100 Subject: [PATCH 151/181] Improve previous PT_TEXTCMD/PT_TEXTCMD2 check, add another one to ignore zero size textcmds! --- src/d_clisrv.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 186c25e6a..a42fcf1d1 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3736,11 +3736,23 @@ FILESTAMP tic_t tic = maketic; UINT8 *textcmd; - // ignore if the textcmd size var is actually larger than it should be - if (BASEPACKETSIZE + netbuffer->u.textcmd[0] > (size_t)doomcom->datalength) + // ignore if the textcmd has a reported size of zero + // this shouldn't be sent at all + if (!netbuffer->u.textcmd[0]) { - DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %d)\n", - BASEPACKETSIZE + netbuffer->u.textcmd[0], doomcom->datalength)); + DEBFILE(va("GetPacket: Textcmd with size 0 detected! (node %u, player %d)\n", + node, netconsole)); + Net_UnAcknowledgePacket(node); + break; + } + + // ignore if the textcmd size var is actually larger than it should be + // BASEPACKETSIZE + 1 (for size) + textcmd[0] should == datalength + if (netbuffer->u.textcmd[0] > (size_t)doomcom->datalength-BASEPACKETSIZE-1) + { + DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %d, node %u, player %d)\n", + netbuffer->u.textcmd[0], (size_t)doomcom->datalength-BASEPACKETSIZE-1, + node, netconsole)); Net_UnAcknowledgePacket(node); break; } From c92aaa74a41e3ad2477b564eaa9bfe086b518450 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 23 May 2017 18:46:34 +0100 Subject: [PATCH 152/181] I think PT_CLIENT2MIS was meant to do this too, probably --- src/d_clisrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index a42fcf1d1..27fcd0672 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3677,7 +3677,8 @@ FILESTAMP } // Splitscreen cmd - if (netbuffer->packettype == PT_CLIENT2CMD && nodetoplayer2[node] >= 0) + if ((netbuffer->packettype == PT_CLIENT2CMD || netbuffer->packettype == PT_CLIENT2MIS) + && nodetoplayer2[node] >= 0) G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]], &netbuffer->u.client2pak.cmd2, 1); From 2aa1215716c28f06a5be7cc3aefc2e7626d22e2c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 25 May 2017 15:22:32 +0100 Subject: [PATCH 153/181] Fix a thing where the host adds a WAD and you have too many WADs loaded to add it. --- src/d_netcmd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 478772ed9..0434e7e4b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3180,10 +3180,15 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum) ncs = findfile(filename,md5sum,true); - if (ncs != FS_FOUND) + if (ncs != FS_FOUND || !P_AddWadFile(filename, NULL)) { Command_ExitGame_f(); - if (ncs == FS_NOTFOUND) + if (ncs == FS_FOUND) + { + CONS_Printf(M_GetText("The server tried to add %s,\nbut you have too many files added.\nRestart the game to clear loaded files\nand play on this server."), filename); + M_StartMessage(va("The server added a file \n(%s)\nbut you have too many files added.\nRestart the game to clear loaded files.\n\nPress ESC\n",filename), NULL, MM_NOTHING); + } + else if (ncs == FS_NOTFOUND) { CONS_Printf(M_GetText("The server tried to add %s,\nbut you don't have this file.\nYou need to find it in order\nto play on this server."), filename); M_StartMessage(va("The server added a file \n(%s)\nthat you do not have.\n\nPress ESC\n",filename), NULL, MM_NOTHING); @@ -3201,7 +3206,6 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum) return; } - P_AddWadFile(filename, NULL); G_SetGameModified(true); } From 5c302d7ffcdce40003016b2fc4cb81a35606c252 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 25 May 2017 15:34:21 +0100 Subject: [PATCH 154/181] Partial implementation of fix for Got_RequestAddfilecmd (the other half - the limitation on the size of the filesneeded section of the serverinfo packet - will be applied in internal.) --- src/d_netcmd.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 0434e7e4b..f4916756c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3078,6 +3078,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) filestatus_t ncs = FS_NOTFOUND; UINT8 md5sum[16]; boolean kick = false; + boolean toomany = false; INT32 i; READSTRINGN(*cp, filename, 240); @@ -3104,13 +3105,18 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) return; } - ncs = findfile(filename,md5sum,true); + if (numwadfiles >= MAX_WADFILES) // a more comprehensive check in internal; bare minimum of out-of-bounds for public next + toomany = true; + else + ncs = findfile(filename,md5sum,true); - if (ncs != FS_FOUND) + if (ncs != FS_FOUND || toomany) { char message[256]; - if (ncs == FS_NOTFOUND) + if (toomany) + sprintf(message, M_GetText("Too many files loaded to add %s\n"), filename); + else if (ncs == FS_NOTFOUND) sprintf(message, M_GetText("The server doesn't have %s\n"), filename); else if (ncs == FS_MD5SUMBAD) sprintf(message, M_GetText("Checksum mismatch on %s\n"), filename); From 47e171250f88c4d12f4b594213e159d01d592d1b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 25 May 2017 16:06:39 +0100 Subject: [PATCH 155/181] * Prevent joining a server if you have too many files loaded to add the remainder. * Made the check in Got_RequestAddfilecmd more comprehensive, since I might as well. Just something to tweak a little later in internal. --- src/d_clisrv.c | 17 ++++++++++++++--- src/d_netcmd.c | 14 +++++++++++++- src/d_netfil.c | 15 +++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 939d53dec..76b5c95d5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1733,9 +1733,7 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent) { #ifndef NONET INT32 i; -#endif -#ifndef NONET // serverlist is updated by GetPacket function if (serverlistcount > 0) { @@ -1769,7 +1767,20 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent) serverlist[i].info.fileneeded); CONS_Printf(M_GetText("Checking files...\n")); i = CL_CheckFiles(); - if (i == 2) // cannot join for some reason + if (i == 3) // too many files + { + D_QuitNetGame(); + CL_Reset(); + D_StartTitle(); + M_StartMessage(M_GetText( + "You have too many WAD files loaded\n" + "to add ones the server is using.\n" + "Please restart SRB2 before connecting.\n\n" + "Press ESC\n" + ), NULL, MM_NOTHING); + return false; + } + else if (i == 2) // cannot join for some reason { D_QuitNetGame(); CL_Reset(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f4916756c..d7bbb0aa1 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3080,6 +3080,11 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) boolean kick = false; boolean toomany = false; INT32 i; + size_t packetsize = 0; + serverinfo_pak *dummycheck = NULL; + + // Shut the compiler up. + (void)dummycheck; READSTRINGN(*cp, filename, 240); READMEM(*cp, md5sum, 16); @@ -3105,7 +3110,14 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) return; } - if (numwadfiles >= MAX_WADFILES) // a more comprehensive check in internal; bare minimum of out-of-bounds for public next + // See W_LoadWadFile in w_wad.c + for (i = 0; i < numwadfiles; i++) + packetsize += nameonlylength(wadfiles[i]->filename) + 22; + + packetsize += nameonlylength(filename) + 22; + + if ((numwadfiles >= MAX_WADFILES) + || (packetsize > sizeof(dummycheck->fileneeded))) toomany = true; else ncs = findfile(filename,md5sum,true); diff --git a/src/d_netfil.c b/src/d_netfil.c index bf4e59878..479fd60de 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -330,6 +330,11 @@ INT32 CL_CheckFiles(void) INT32 i, j; char wadfilename[MAX_WADPATH]; INT32 ret = 1; + size_t packetsize = 0; + serverinfo_pak *dummycheck = NULL; + + // Shut the compiler up. + (void)dummycheck; // if (M_CheckParm("-nofiles")) // return 1; @@ -378,6 +383,10 @@ INT32 CL_CheckFiles(void) return 1; } + // See W_LoadWadFile in w_wad.c + for (i = 0; i < numwadfiles; i++) + packetsize += nameonlylength(wadfiles[i]->filename) + 22; + for (i = 1; i < fileneedednum; i++) { CONS_Debug(DBG_NETPLAY, "searching for '%s' ", fileneeded[i].filename); @@ -397,6 +406,12 @@ INT32 CL_CheckFiles(void) if (fileneeded[i].status != FS_NOTFOUND || !fileneeded[i].important) continue; + packetsize += nameonlylength(fileneeded[i].filename) + 22; + + if ((numwadfiles >= MAX_WADFILES) + || (packetsize > sizeof(dummycheck->fileneeded))) + return 3; + fileneeded[i].status = findfile(fileneeded[i].filename, fileneeded[i].md5sum, true); CONS_Debug(DBG_NETPLAY, "found %d\n", fileneeded[i].status); if (fileneeded[i].status != FS_FOUND) From 58236af6f73f535f5071d5fca84457b993239f5d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 25 May 2017 16:55:59 +0100 Subject: [PATCH 156/181] Tweak to D_MapChange: if you failed to start a server, DON'T send a map change command --- src/d_netcmd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 478772ed9..f23549315 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1569,8 +1569,13 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese mapchangepending = 0; // spawn the server if needed // reset players if there is a new one - if (!(adminplayer == consoleplayer) && SV_SpawnServer()) - buf[0] &= ~(1<<1); + if (!(adminplayer == consoleplayer)) + { + if (SV_SpawnServer()) + buf[0] &= ~(1<<1); + if (!Playing()) // you failed to start a server somehow, so cancel the map change + return; + } // Kick bot from special stages if (botskin) From a23e9bc32b6357f5e366246dada0aa55c34c235b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 25 May 2017 18:10:20 +0100 Subject: [PATCH 157/181] Fix size_t printing --- src/d_clisrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 27fcd0672..c095d38a5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3751,8 +3751,8 @@ FILESTAMP // BASEPACKETSIZE + 1 (for size) + textcmd[0] should == datalength if (netbuffer->u.textcmd[0] > (size_t)doomcom->datalength-BASEPACKETSIZE-1) { - DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %d, node %u, player %d)\n", - netbuffer->u.textcmd[0], (size_t)doomcom->datalength-BASEPACKETSIZE-1, + DEBFILE(va("GetPacket: Bad Textcmd packet size! (expected %d, actual %s, node %u, player %d)\n", + netbuffer->u.textcmd[0], sizeu1((size_t)doomcom->datalength-BASEPACKETSIZE-1), node, netconsole)); Net_UnAcknowledgePacket(node); break; From 437780d503e8cac007d9dcc7a30c410bb08a7365 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 25 May 2017 18:40:48 +0100 Subject: [PATCH 158/181] Add missing break for MT_EGGCAPSULE's switch case in P_SpawnMobj (sorry!) --- src/p_mobj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index fb8648013..47886ce8f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7807,6 +7807,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) break; case MT_EGGCAPSULE: mobj->extravalue1 = -1; // timer for how long a player has been at the capsule + break; case MT_REDTEAMRING: mobj->color = skincolor_redteam; break; From aecc97ded33bbfd7e8e62aca333398a14b3c06d5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 May 2017 13:39:54 +0100 Subject: [PATCH 159/181] PT_REQUESTFILE checking: * if you sent it to a client rather than the server, game over, your connection is closed * if files that don't exist or are too large are requested are listed, game over, your connection is closed (they should have been checked on YOUR side beforehand, silly) * if the server has downloading disabled anyway, ...yeah, you get the idea Don't worry, I made sure Got_RequestFilePak cleaned up the full file request list for the node in case of failure --- src/d_clisrv.c | 7 +++++- src/d_netfil.c | 64 +++++++++++++++++++++++++++++++++++++++++++++----- src/d_netfil.h | 2 +- 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index c095d38a5..2fc895c23 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3553,7 +3553,12 @@ static void HandlePacketFromAwayNode(SINT8 node) case PT_REQUESTFILE: if (server) - Got_RequestFilePak(node); + { + if (!cv_downloading.value || !Got_RequestFilePak(node)) + Net_CloseConnection(node); // close connection if one of the requested files could not be sent, or you disabled downloading anyway + } + else + Net_CloseConnection(node); // nope break; case PT_NODETIMEOUT: diff --git a/src/d_netfil.c b/src/d_netfil.c index bf4e59878..777814cee 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -62,7 +62,9 @@ #include -static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid); +// Prototypes +static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid); +static void SV_RemoveFileSendList(INT32 node); // Sender structure typedef struct filetx_s @@ -303,7 +305,8 @@ boolean CL_SendRequestFile(void) } // get request filepak and put it on the send queue -void Got_RequestFilePak(INT32 node) +// returns false if a requested file was not found or cannot be sent +boolean Got_RequestFilePak(INT32 node) { char wad[MAX_WADPATH+1]; UINT8 *p = netbuffer->u.textcmd; @@ -314,8 +317,13 @@ void Got_RequestFilePak(INT32 node) if (id == 0xFF) break; READSTRINGN(p, wad, MAX_WADPATH); - SV_SendFile(node, wad, id); + if (!SV_SendFile(node, wad, id)) + { + SV_RemoveFileSendList(node); + return false; // don't read the rest of the files + } } + return true; // no problems with any files } /** Checks if the files needed aren't already loaded or on the disk @@ -480,7 +488,7 @@ static INT32 filestosend = 0; * \sa SV_SendRam * */ -static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid) +static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid) { filetx_t **q; // A pointer to the "next" field of the last file in the list filetx_t *p; // The new file request @@ -537,7 +545,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid) free(p->id.filename); free(p); *q = NULL; - return; + return false; // cancel the rest of the requests } // Handle huge file requests (i.e. bigger than cv_maxsend.value KB) @@ -549,7 +557,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid) free(p->id.filename); free(p); *q = NULL; - return; + return false; // cancel the rest of the requests } DEBFILE(va("Sending file %s (id=%d) to %d\n", filename, fileid, node)); @@ -557,6 +565,7 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid) p->fileid = fileid; p->next = NULL; // End of list filestosend++; + return true; } /** Adds a memory block to the file list for a node @@ -598,6 +607,49 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UI filestosend++; } +/** Removes all file requests for a node + * This is needed only if a PT_REQUESTFILE's content gave you something that shouldn't be there + * + * \param node The destination + * \sa Got_RequestFilePak + * + */ +static void SV_RemoveFileSendList(INT32 node) +{ + filetx_t *p = transfer[node].txlist; + + if (p == NULL) + return; // ...well, that was easy + + while (p) + { + // Free the file request according to the freemethod parameter used with SV_SendFile/Ram + switch (p->ram) + { + case SF_FILE: // It's a file, close it and free its filename + if (cv_noticedownload.value) + CONS_Printf("Cancelling file transfer for node %d\n", node); + if (transfer[node].currentfile) + fclose(transfer[node].currentfile); + free(p->id.filename); + break; + case SF_Z_RAM: // It's a memory block allocated with Z_Alloc or the likes, use Z_Free + Z_Free(p->id.ram); + break; + case SF_RAM: // It's a memory block allocated with malloc, use free + free(p->id.ram); + case SF_NOFREERAM: // Nothing to free + break; + } + // Remove the file request from the list + transfer[node].txlist = p->next; + free(p); + // Indicate that the transmission is over (if for some reason it had started) + transfer[node].currentfile = NULL; + filestosend--; + } +} + /** Stops sending a file for a node, and removes the file request from the list, * either because the file has been fully sent or because the node was disconnected * diff --git a/src/d_netfil.h b/src/d_netfil.h index c9085a5b0..b9b7b2f2e 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -69,7 +69,7 @@ boolean SV_SendingFile(INT32 node); boolean CL_CheckDownloadable(void); boolean CL_SendRequestFile(void); -void Got_RequestFilePak(INT32 node); +boolean Got_RequestFilePak(INT32 node); void SV_AbortSendFiles(INT32 node); void CloseNetFile(void); From 7979f84e258769cf230610a6cd7b4c0161479ba4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 May 2017 13:58:34 +0100 Subject: [PATCH 160/181] whoops --- src/d_netfil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_netfil.c b/src/d_netfil.c index 777814cee..8704e05ce 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -644,6 +644,7 @@ static void SV_RemoveFileSendList(INT32 node) // Remove the file request from the list transfer[node].txlist = p->next; free(p); + p = transfer[node].txlist; // Indicate that the transmission is over (if for some reason it had started) transfer[node].currentfile = NULL; filestosend--; From 569af9f4c13b3124c7821689b612762d727274eb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 May 2017 14:19:18 +0100 Subject: [PATCH 161/181] I am dumb, SV_AbortSendFiles already does what SV_RemoveFileSendList was made to do --- src/d_netfil.c | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 8704e05ce..84e16aa1d 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -64,7 +64,6 @@ // Prototypes static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid); -static void SV_RemoveFileSendList(INT32 node); // Sender structure typedef struct filetx_s @@ -319,7 +318,7 @@ boolean Got_RequestFilePak(INT32 node) READSTRINGN(p, wad, MAX_WADPATH); if (!SV_SendFile(node, wad, id)) { - SV_RemoveFileSendList(node); + SV_AbortSendFiles(node); return false; // don't read the rest of the files } } @@ -607,50 +606,6 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UI filestosend++; } -/** Removes all file requests for a node - * This is needed only if a PT_REQUESTFILE's content gave you something that shouldn't be there - * - * \param node The destination - * \sa Got_RequestFilePak - * - */ -static void SV_RemoveFileSendList(INT32 node) -{ - filetx_t *p = transfer[node].txlist; - - if (p == NULL) - return; // ...well, that was easy - - while (p) - { - // Free the file request according to the freemethod parameter used with SV_SendFile/Ram - switch (p->ram) - { - case SF_FILE: // It's a file, close it and free its filename - if (cv_noticedownload.value) - CONS_Printf("Cancelling file transfer for node %d\n", node); - if (transfer[node].currentfile) - fclose(transfer[node].currentfile); - free(p->id.filename); - break; - case SF_Z_RAM: // It's a memory block allocated with Z_Alloc or the likes, use Z_Free - Z_Free(p->id.ram); - break; - case SF_RAM: // It's a memory block allocated with malloc, use free - free(p->id.ram); - case SF_NOFREERAM: // Nothing to free - break; - } - // Remove the file request from the list - transfer[node].txlist = p->next; - free(p); - p = transfer[node].txlist; - // Indicate that the transmission is over (if for some reason it had started) - transfer[node].currentfile = NULL; - filestosend--; - } -} - /** Stops sending a file for a node, and removes the file request from the list, * either because the file has been fully sent or because the node was disconnected * From e09270276ef445a36dae97b147c023b345f63eed Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 May 2017 14:38:59 +0100 Subject: [PATCH 162/181] Display node's IP when printing the "sending file to node n" message, if noticedownload is turned on --- src/d_netfil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 84e16aa1d..2c463c0b5 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -495,7 +495,7 @@ static boolean SV_SendFile(INT32 node, const char *filename, UINT8 fileid) char wadfilename[MAX_WADPATH]; if (cv_noticedownload.value) - CONS_Printf("Sending file \"%s\" to node %d\n", filename, node); + CONS_Printf("Sending file \"%s\" to node %d (%s)\n", filename, node, I_GetNodeAddress(node)); // Find the last file in the list and set a pointer to its "next" field q = &transfer[node].txlist; From ab5835cd3b325b748a1b514bd6a825264779b982 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 May 2017 15:26:00 +0100 Subject: [PATCH 163/181] Remove cruft from my initial days of fumbling with this branch textcmd[0] for PT_NODETIMEOUT can't hold anything < 0 anyway, and you'd probably have to really try to get >= MAXNETNODES --- src/d_clisrv.c | 7 +------ src/d_net.c | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 2fc895c23..89418dde2 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4004,9 +4004,6 @@ FILESTAMP while (HGetPacket()) { - if (doomcom->remotenode == -1) // ...this should have been ignored already - continue; // might come from PT_NODETIMEOUT somehow though - node = (SINT8)doomcom->remotenode; if (netbuffer->packettype == PT_CLIENTJOIN && server) @@ -4039,10 +4036,8 @@ FILESTAMP if (netbuffer->packettype == PT_PLAYERINFO) continue; // We do nothing with PLAYERINFO, that's for the MS browser. - if (node < 0 || node >= MAXNETNODES) // THIS SHOULDN'T EVEN BE POSSIBLE - ; //CONS_Printf("Received packet from node %d!\n", (int)node); // Packet received from someone already playing - else if (nodeingame[node]) + if (nodeingame[node]) HandlePacketFromPlayer(node); // Packet received from someone not playing else diff --git a/src/d_net.c b/src/d_net.c index 68720f5ee..b6914f817 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1133,8 +1133,6 @@ boolean HGetPacket(void) rebound_tail = (rebound_tail+1) % MAXREBOUND; - if (doomcom->remotenode == -1) // wait hang on what? - return true; // there might still be packets from others though, so don't return false #ifdef DEBUGFILE if (debugfile) DebugPrintpacket("GETLOCAL"); From 4d1af86431b9b7d4f90b314811df7825ac467fe8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 May 2017 15:30:26 +0100 Subject: [PATCH 164/181] Cleanup part 2, make ye old 2.1.18 warning a debugfile only message, and make the node == -1 have its own debugfile only message too Also get rid of a stray newline --- src/d_net.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index b6914f817..50b6c8cf6 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -713,7 +713,10 @@ void Net_CloseConnection(INT32 node) boolean forceclose = (node & FORCECLOSE) != 0; if (node == -1) + { + DEBFILE(M_GetText("Net_CloseConnection: node -1 detected!\n")); return; // nope, just ignore it + } node &= ~FORCECLOSE; @@ -722,7 +725,7 @@ void Net_CloseConnection(INT32 node) if (node < 0 || node >= MAXNETNODES) // prevent invalid nodes from crashing the game { - //CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node); + DEBFILE(va(M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node)); return; } @@ -1132,7 +1135,6 @@ boolean HGetPacket(void) doomcom->remotenode = 0; rebound_tail = (rebound_tail+1) % MAXREBOUND; - #ifdef DEBUGFILE if (debugfile) DebugPrintpacket("GETLOCAL"); From db2f8a50bac82d604cf25fcadbb46a439f72256f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 26 May 2017 16:16:10 +0100 Subject: [PATCH 165/181] Make sure that the number of files you're trying to add is properly considered! --- src/d_netfil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 479fd60de..70e9ce565 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -331,6 +331,7 @@ INT32 CL_CheckFiles(void) char wadfilename[MAX_WADPATH]; INT32 ret = 1; size_t packetsize = 0; + size_t filestoget = 0; serverinfo_pak *dummycheck = NULL; // Shut the compiler up. @@ -408,10 +409,12 @@ INT32 CL_CheckFiles(void) packetsize += nameonlylength(fileneeded[i].filename) + 22; - if ((numwadfiles >= MAX_WADFILES) + if ((numwadfiles+filestoget >= MAX_WADFILES) || (packetsize > sizeof(dummycheck->fileneeded))) return 3; + filestoget++; + fileneeded[i].status = findfile(fileneeded[i].filename, fileneeded[i].md5sum, true); CONS_Debug(DBG_NETPLAY, "found %d\n", fileneeded[i].status); if (fileneeded[i].status != FS_FOUND) From 86a76a9766c7807283f5a35a09ff7a2593d81211 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 26 May 2017 18:10:53 -0400 Subject: [PATCH 166/181] Makefile: disable GETTEXT by default --- src/Makefile | 2 -- src/Makefile.cfg | 9 --------- 2 files changed, 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index 76f013c52..426dc2289 100644 --- a/src/Makefile +++ b/src/Makefile @@ -511,13 +511,11 @@ OBJS:=$(i_main_o) \ # For reference, this is the command I use to build a srb2.pot file from the source code. # (The listed source files are the ones containing translated strings). # FILES=""; for file in `find ./ | grep "\.c" | grep -v svn`; do [ "`grep "M_GetText(" $file`" ] && FILES="$FILES $file"; done; xgettext -d srb2 -o locale/srb2.pot -kM_GetText -F --no-wrap $FILES -ifndef NOGETTEXT ifdef GETTEXT POS:=$(BIN)/en.mo OPTS+=-DGETTEXT endif -endif ifdef DJGPPDOS all: pre-build $(BIN)/$(EXENAME) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 22546fbff..5bf7f247d 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -283,9 +283,6 @@ else ifdef LINUX NASMFORMAT=elf -DLINUX SDL=1 -ifndef NOGETTEXT - GETTEXT=1 -endif ifdef LINUX64 OBJDIR:=$(OBJDIR)/Linux64 BIN:=$(BIN)/Linux64 @@ -321,9 +318,6 @@ else ifdef MINGW64 INTERFACE=win32 #NASMFORMAT=win64 -ifndef NOGETTEXT - #GETTEXT=1 -endif OBJDIR:=$(OBJDIR)/Mingw64 BIN:=$(BIN)/Mingw64 else @@ -354,9 +348,6 @@ else ifdef MINGW INTERFACE=win32 NASMFORMAT=win32 -ifndef NOGETTEXT - #GETTEXT=1 -endif OBJDIR:=$(OBJDIR)/Mingw BIN:=$(BIN)/Mingw else From 877e9510f7e0397814e28eb6630625bead5a9165 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 26 May 2017 21:38:49 -0400 Subject: [PATCH 167/181] Update version number to v2.1.19 --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- src/doomdef.h | 8 ++++---- src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23b768a70..f9364fdd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) project(SRB2 - VERSION 2.1.18 + VERSION 2.1.19 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index c1f6894ef..cc073ff01 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.1.18.{branch}-{build} +version: 2.1.19.{branch}-{build} os: MinGW environment: diff --git a/src/doomdef.h b/src/doomdef.h index 428972ccd..cdb1a7dbf 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -150,9 +150,9 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 201 // Game version -#define SUBVERSION 18 // more precise version number -#define VERSIONSTRING "v2.1.18" -#define VERSIONSTRINGW L"v2.1.18" +#define SUBVERSION 19 // more precise version number +#define VERSIONSTRING "v2.1.19" +#define VERSIONSTRINGW L"v2.1.19" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -214,7 +214,7 @@ extern FILE *logstream; // 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.1.0 is not version "1". -#define MODVERSION 23 +#define MODVERSION 24 // ========================================================================= diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index fbf9bacb2..68391f99c 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1214,7 +1214,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.18; + CURRENT_PROJECT_VERSION = 2.1.19; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1226,7 +1226,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.18; + CURRENT_PROJECT_VERSION = 2.1.19; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj index 98a760c7b..fada7849c 100644 --- a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1214,7 +1214,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.18; + CURRENT_PROJECT_VERSION = 2.1.19; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1226,7 +1226,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.18; + CURRENT_PROJECT_VERSION = 2.1.19; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From d20efa5a744ec046cce1e4df8a9fecb45e0c590f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 27 May 2017 19:06:46 +0100 Subject: [PATCH 168/181] Entirely ignore PT_ASKINFOVIAMS packets, since it turns out it's not even sent by the MS anyway --- src/d_clisrv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 89418dde2..6adaae191 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3413,6 +3413,7 @@ static void HandlePacketFromAwayNode(SINT8 node) switch (netbuffer->packettype) { case PT_ASKINFOVIAMS: +#if 0 if (server && serverrunning) { INT32 clientnode; @@ -3434,6 +3435,9 @@ static void HandlePacketFromAwayNode(SINT8 node) } else Net_CloseConnection(node); // you're not supposed to get it, so ignore it +#else + Net_CloseConnection(node); +#endif break; case PT_ASKINFO: From c44a935b04cec66913f23e040f26bcc3e0739a04 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Sat, 27 May 2017 14:03:27 -0500 Subject: [PATCH 169/181] Rewrote `thinkers.iterate` to handle invalid pointers elegantly. --- src/lua_thinkerlib.c | 134 +++++++++++++++++++++++++++---------------- 1 file changed, 84 insertions(+), 50 deletions(-) diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c index d5251425a..aaa8435e9 100644 --- a/src/lua_thinkerlib.c +++ b/src/lua_thinkerlib.c @@ -16,84 +16,118 @@ #include "lua_script.h" #include "lua_libs.h" +#define META_ITERATIONSTATE "iteration state" + static const char *const iter_opt[] = { "all", "mobj", NULL}; +static const actionf_p1 iter_funcs[] = { + NULL, + (actionf_p1)P_MobjThinker +}; + +struct iterationState { + actionf_p1 filter; + int next; +}; + +static int iterationState_gc(lua_State *L) +{ + struct iterationState *it = luaL_checkudata(L, -1, META_ITERATIONSTATE); + if (it->next != LUA_REFNIL) + { + luaL_unref(L, LUA_REGISTRYINDEX, it->next); + it->next = LUA_REFNIL; + } + return 0; +} + +#define push_thinker(th) {\ + if ((th)->function.acp1 == (actionf_p1)P_MobjThinker) \ + LUA_PushUserdata(L, (th), META_MOBJ); \ + else \ + lua_pushlightuserdata(L, (th)); \ +} + static int lib_iterateThinkers(lua_State *L) { - int state = luaL_checkoption(L, 1, "mobj", iter_opt); - - thinker_t *th = NULL; - actionf_p1 searchFunc; - const char *searchMeta; - + thinker_t *th = NULL, *next = NULL; + struct iterationState *it = luaL_checkudata(L, 1, META_ITERATIONSTATE); lua_settop(L, 2); - lua_remove(L, 1); // remove state now. - switch(state) + if (lua_isnil(L, 2)) + th = &thinkercap; + else if (lua_isuserdata(L, 2)) { - case 0: - searchFunc = NULL; - searchMeta = NULL; - break; - case 1: - default: - searchFunc = (actionf_p1)P_MobjThinker; - searchMeta = META_MOBJ; - break; + if (lua_islightuserdata(L, 2)) + th = lua_touserdata(L, 2); + else + { + th = *(thinker_t **)lua_touserdata(L, -1); + if (!th) + { + if (it->next == LUA_REFNIL) + return 0; + + lua_rawgeti(L, LUA_REGISTRYINDEX, it->next); + if (lua_islightuserdata(L, -1)) + next = lua_touserdata(L, -1); + else + next = *(thinker_t **)lua_touserdata(L, -1); + } + } } - if (!lua_isnil(L, 1)) { - if (lua_islightuserdata(L, 1)) - th = (thinker_t *)lua_touserdata(L, 1); - else if (searchMeta) - th = *((thinker_t **)luaL_checkudata(L, 1, searchMeta)); - else - th = *((thinker_t **)lua_touserdata(L, 1)); - } else - th = &thinkercap; + luaL_unref(L, LUA_REGISTRYINDEX, it->next); + it->next = LUA_REFNIL; - if (!th) // something got our userdata invalidated! - return 0; + if (th && !next) + next = th->next; + if (!next) + return luaL_error(L, "next thinker invalidated during iteration"); - if (searchFunc == NULL) - { - if ((th = th->next) != &thinkercap) + for (; next != &thinkercap; next = next->next) + if (!it->filter || next->function.acp1 == it->filter) { - if (th->function.acp1 == (actionf_p1)P_MobjThinker) - LUA_PushUserdata(L, th, META_MOBJ); - else - lua_pushlightuserdata(L, th); + push_thinker(next); + if (next->next != &thinkercap) + { + push_thinker(next->next); + it->next = luaL_ref(L, LUA_REGISTRYINDEX); + } return 1; } - return 0; - } - - for (th = th->next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != searchFunc) - continue; - - LUA_PushUserdata(L, th, searchMeta); - return 1; - } return 0; } static int lib_startIterate(lua_State *L) { - luaL_checkoption(L, 1, iter_opt[0], iter_opt); - lua_pushcfunction(L, lib_iterateThinkers); - lua_pushvalue(L, 1); + struct iterationState *it; + + lua_pushvalue(L, lua_upvalueindex(1)); + it = lua_newuserdata(L, sizeof(struct iterationState)); + luaL_getmetatable(L, META_ITERATIONSTATE); + lua_setmetatable(L, -2); + + it->filter = iter_funcs[luaL_checkoption(L, 1, "mobj", iter_opt)]; + it->next = LUA_REFNIL; return 2; } +#undef push_thinker + int LUA_ThinkerLib(lua_State *L) { + luaL_newmetatable(L, META_ITERATIONSTATE); + lua_pushcfunction(L, iterationState_gc); + lua_setfield(L, -2, "__gc"); + lua_pop(L, 1); + lua_createtable(L, 0, 1); - lua_pushcfunction(L, lib_startIterate); + lua_pushcfunction(L, lib_iterateThinkers); + lua_pushcclosure(L, lib_startIterate, 1); lua_setfield(L, -2, "iterate"); lua_setglobal(L, "thinkers"); return 0; From f96844b2620654892de5f73b46c5775288076552 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 May 2017 21:28:36 +0100 Subject: [PATCH 170/181] Fix screenshots taken in OpenGL with 1366x768 being messed up This is based on GZDoom's own fix for the same issue, had to add support for glPixelStorei first though --- src/hardware/r_opengl/r_opengl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 3a0bf7054..a3c47df89 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -244,6 +244,7 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...) #define pglMaterialfv glMaterialfv /* Raster functions */ +#define pglPixelStorei glPixelStorei #define pglReadPixels glReadPixels /* Texture mapping */ @@ -365,6 +366,8 @@ typedef void (APIENTRY * PFNglMaterialfv) (GLint face, GLenum pname, GLfloat *pa static PFNglMaterialfv pglMaterialfv; /* Raster functions */ +typedef void (APIENTRY * PFNglPixelStorei) (GLenum pname, GLint param); +static PFNglPixelStorei pglPixelStorei; typedef void (APIENTRY * PFNglReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); static PFNglReadPixels pglReadPixels; @@ -494,6 +497,7 @@ boolean SetupGLfunc(void) GETOPENGLFUNC(pglLightModelfv , glLightModelfv) GETOPENGLFUNC(pglMaterialfv , glMaterialfv) + GETOPENGLFUNC(pglPixelStorei , glPixelStorei) GETOPENGLFUNC(pglReadPixels , glReadPixels) GETOPENGLFUNC(pglTexEnvi , glTexEnvi) @@ -897,7 +901,9 @@ EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height, GLubyte*top = (GLvoid*)dst_data, *bottom = top + dst_stride * (height - 1); GLubyte *row = malloc(dst_stride); if (!row) return; + pglPixelStorei(GL_PACK_ALIGNMENT, 1); pglReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, dst_data); + pglPixelStorei(GL_UNPACK_ALIGNMENT, 1); for(i = 0; i < height/2; i++) { memcpy(row, top, dst_stride); @@ -913,7 +919,9 @@ EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height, INT32 j; GLubyte *image = malloc(width*height*3*sizeof (*image)); if (!image) return; + pglPixelStorei(GL_PACK_ALIGNMENT, 1); pglReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, image); + pglPixelStorei(GL_UNPACK_ALIGNMENT, 1); for (i = height-1; i >= 0; i--) { for (j = 0; j < width; j++) From 6be7693ecb4ecd4136c3b3434f94ab292f167e2b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 29 May 2017 22:52:51 -0400 Subject: [PATCH 171/181] OpenGL: Load the GLU and OpenGL 1.3 multitexturing functions during runtime --- src/hardware/r_opengl/r_opengl.c | 27 +++++---------------------- src/sdl/ogl_sdl.c | 2 -- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index a3c47df89..92e5592e3 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -263,15 +263,8 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...) /* texture mapping */ //GL_EXT_copy_texture #ifndef KOS_GL_COMPATIBILITY #define pglCopyTexImage2D glCopyTexImage2D +#endif -/* GLU functions */ -#define pgluBuild2DMipmaps gluBuild2DMipmaps -#endif -#ifndef MINI_GL_COMPATIBILITY -/* 1.3 functions for multitexturing */ -#define pglActiveTexture glActiveTexture -#define pglMultiTexCoord2f glMultiTexCoord2f -#endif #else //!STATIC_OPENGL /* 1.0 functions */ @@ -394,7 +387,7 @@ static PFNglBindTexture pglBindTexture; /* texture mapping */ //GL_EXT_copy_texture typedef void (APIENTRY * PFNglCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); static PFNglCopyTexImage2D pglCopyTexImage2D; - +#endif /* GLU functions */ typedef GLint (APIENTRY * PFNgluBuild2DMipmaps) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); static PFNgluBuild2DMipmaps pgluBuild2DMipmaps; @@ -406,7 +399,6 @@ static PFNglActiveTexture pglActiveTexture; typedef void (APIENTRY *PFNglMultiTexCoord2f) (GLenum, GLfloat, GLfloat); static PFNglMultiTexCoord2f pglMultiTexCoord2f; #endif -#endif #ifndef MINI_GL_COMPATIBILITY /* 1.2 Parms */ @@ -523,17 +515,13 @@ boolean SetupGLfunc(void) // This has to be done after the context is created so the version number can be obtained boolean SetupGLFunc13(void) { +#ifdef MINI_GL_COMPATIBILITY + return false; +#else const GLubyte *version = pglGetString(GL_VERSION); int glmajor, glminor; gl13 = false; -#ifdef MINI_GL_COMPATIBILITY - return false; -#else -#ifdef STATIC_OPENGL - gl13 = true; -#else - // Parse the GL version if (version != NULL) { @@ -572,9 +560,6 @@ boolean SetupGLFunc13(void) } else DBG_Printf("GL_ARB_multitexture support: disabled\n"); -#undef GETOPENGLFUNC - -#endif return true; #endif } @@ -1823,13 +1808,11 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value) min_filter = GL_NEAREST; #endif } -#ifndef STATIC_OPENGL if (!pgluBuild2DMipmaps) { MipMap = GL_FALSE; min_filter = GL_LINEAR; } -#endif Flush(); //??? if we want to change filter mode by texture, remove this break; diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 21afd831d..cd7ced7ca 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -71,7 +71,6 @@ INT32 oglflags = 0; void *GLUhandle = NULL; SDL_GLContext sdlglcontext = 0; -#ifndef STATIC_OPENGL void *GetGLFunc(const char *proc) { if (strncmp(proc, "glu", 3) == 0) @@ -83,7 +82,6 @@ void *GetGLFunc(const char *proc) } return SDL_GL_GetProcAddress(proc); } -#endif boolean LoadGL(void) { From 6847a89bc2043d536263e98b41d96207ba976242 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 29 May 2017 23:04:03 -0400 Subject: [PATCH 172/181] OpenGL: check for 1.3+ or 2.0+, not just 1.3/2.X to 4.X --- src/hardware/r_opengl/r_opengl.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 92e5592e3..e6ff83e89 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -528,18 +528,10 @@ boolean SetupGLFunc13(void) if (sscanf((const char*)version, "%d.%d", &glmajor, &glminor) == 2) { // Look, we gotta prepare for the inevitable arrival of GL 2.0 code... - switch (glmajor) - { - case 1: - if (glminor == 3) gl13 = true; - break; - case 2: - case 3: - case 4: - gl13 = true; - default: - break; - } + if (glmajor == 1 && glminor >= 3) + gl13 = true; + else if (glmajor > 1) + gl13 = true; } } From 3d86e7135dcf7cbdc1dfa9759847a7cde7a064bf Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 1 Jun 2017 19:01:57 +0100 Subject: [PATCH 173/181] Fix confusion between nodes and players in ping updating code and PT_PING packet sending code --- src/d_clisrv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 312a308a1..1f83b8dab 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4529,8 +4529,8 @@ static inline void PingUpdate(void) } //send out our ping packets - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i]) + for (i = 0; i < MAXNETNODES; i++) + if (nodeingame[i]) HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS); pingmeasurecount = 1; //Reset count @@ -4571,9 +4571,9 @@ void NetUpdate(void) if (server) { // update node latency values so we can take an average later. - for (i = 0; i < MAXNETNODES; i++) + for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) - realpingtable[i] += G_TicsToMilliseconds(GetLag(i)); + realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i])); pingmeasurecount++; } #endif From fe15305df0b78b5ce3ccb45cf12277ea574907d7 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 1 Jun 2017 20:43:24 +0100 Subject: [PATCH 174/181] Merge the two NEWPING parts of NetUpdate into one block --- src/d_clisrv.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1f83b8dab..bf5bca2f5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4560,16 +4560,11 @@ void NetUpdate(void) gametime = nowtime; - if (!(gametime % 255) && netgame && server) - { -#ifdef NEWPING - PingUpdate(); -#endif - } - #ifdef NEWPING if (server) { + if (netgame && !(gametime % 255)) + PingUpdate(); // update node latency values so we can take an average later. for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) From 2e42c9621c6c18badfe8020843701f8cadbfddb2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 1 Jun 2017 20:46:44 +0100 Subject: [PATCH 175/181] Eck, potted another node/player confusion for clients reciving PT_PING --- 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 bf5bca2f5..43b684e10 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3971,7 +3971,7 @@ FILESTAMP if (client) { INT32 i; - for (i = 0; i < MAXNETNODES; i++) + for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; } From 3658b22a7f6d54206d7d81cc90721f652e68aa42 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 3 Jun 2017 14:46:03 +0100 Subject: [PATCH 176/181] wallVerts[].y is actually the map z coord, so use wallVerts[].z instead (which is actually the map y coord) Don't worry I'm not going mad, this is actually how it's supposed to be --- src/hardware/hw_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 45b59f9b8..fe04a2c49 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1084,9 +1084,9 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum, float endheight = 0.0f, endbheight = 0.0f; fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x); - fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].y); + fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].z); // not a typo fixed_t v2x = FLOAT_TO_FIXED(wallVerts[1].x); - fixed_t v2y = FLOAT_TO_FIXED(wallVerts[1].y); + fixed_t v2y = FLOAT_TO_FIXED(wallVerts[1].z); // not a typo // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // use this as a temp var to store P_GetZAt's return value each time fixed_t temp; From c3c85bb4d2a4e5a1e39b999aadf919c55973e8c4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 3 Jun 2017 17:47:46 +0100 Subject: [PATCH 177/181] Do not draw segs that belong to polyobjects, if you're drawing subsectors adjacent to them Polyobject segs should ONLY be drawn if the polyobject itself is in the polylist of a subsector being rendered. That way you won't sometimes see polyobject walls through level boundaries, if you happen to be close enough to their pre-spawn locations outside the level (or in them, if you decided to go on a noclip journey). --- src/hardware/hw_main.c | 3 +++ src/r_bsp.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 45b59f9b8..e04610717 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3722,6 +3722,9 @@ static void HWR_Subsector(size_t num) while (count--) { +#ifdef POLYOBJECTS + if (!line->polyseg) // ignore segs that belong to polyobjects +#endif HWR_AddLine(line); line++; } diff --git a/src/r_bsp.c b/src/r_bsp.c index 44cb991a7..abb11204a 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1222,6 +1222,9 @@ static void R_Subsector(size_t num) while (count--) { // CONS_Debug(DBG_GAMELOGIC, "Adding normal line %d...(%d)\n", line->linedef-lines, leveltime); +#ifdef POLYOBJECTS + if (!line->polyseg) // ignore segs that belong to polyobjects +#endif R_AddLine(line); line++; curline = NULL; /* cph 2001/11/18 - must clear curline now we're done with it, so stuff doesn't try using it for other things */ From 997eb58c9372c2b18994d1ef8193eadb259d9c61 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 7 Jun 2017 18:24:06 +0100 Subject: [PATCH 178/181] Fix invalid sfx numbers supplied to linedef type 414 crashing the game Had to make P_MobjReadyToTrigger non-inline for this fix though, because the compiler was being stupid --- src/p_spec.c | 124 +++++++++++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 58 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 48c0f58b3..4d893d5de 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2437,73 +2437,81 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 414: // Play SFX { - fixed_t sfxnum; + INT32 sfxnum; sfxnum = sides[line->sidenum[0]].toptexture; //P_AproxDistance(line->dx, line->dy)>>FRACBITS; - if (line->tag != 0 && line->flags & ML_EFFECT5) + if (sfxnum == sfx_None) + return; // Do nothing! + if (sfxnum < sfx_None || sfxnum >= NUMSFX) { - sector_t *sec; - - while ((secnum = P_FindSectorFromLineTag(line, secnum)) >= 0) + CONS_Debug(DBG_GAMELOGIC, "Line type 414 Executor: sfx number %d is invalid!\n", sfxnum); + return; + } + if (line->tag != 0) // Do special stuff only if a non-zero linedef tag is set + { + if (line->flags & ML_EFFECT5) // Repeat Midtexture { - sec = §ors[secnum]; - S_StartSound(&sec->soundorg, sfxnum); + // Additionally play the sound from tagged sectors' soundorgs + sector_t *sec; + + while ((secnum = P_FindSectorFromLineTag(line, secnum)) >= 0) + { + sec = §ors[secnum]; + S_StartSound(&sec->soundorg, sfxnum); + } + } + else if (mo) // A mobj must have triggered the executor + { + // Only trigger if mobj is touching the tag + ffloor_t *rover; + boolean foundit = false; + + for(rover = mo->subsector->sector->ffloors; rover; rover = rover->next) + { + if (rover->master->frontsector->tag != line->tag) + continue; + + if (mo->z > P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector)) + continue; + + if (mo->z + mo->height < P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector)) + continue; + + foundit = true; + } + + if (mo->subsector->sector->tag == line->tag) + foundit = true; + + if (!foundit) + return; } } - else if (line->tag != 0 && mo) + + if (line->flags & ML_NOCLIMB) { - // Only trigger if mobj is touching the tag - ffloor_t *rover; - boolean foundit = false; - - for(rover = mo->subsector->sector->ffloors; rover; rover = rover->next) - { - if (rover->master->frontsector->tag != line->tag) - continue; - - if (mo->z > P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector)) - continue; - - if (mo->z + mo->height < P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector)) - continue; - - foundit = true; - } - - if (mo->subsector->sector->tag == line->tag) - foundit = true; - - if (!foundit) - return; - } - - if (sfxnum < NUMSFX && sfxnum > sfx_None) - { - if (line->flags & ML_NOCLIMB) - { - // play the sound from nowhere, but only if display player triggered it - if (mo && mo->player && (mo->player == &players[displayplayer] || mo->player == &players[secondarydisplayplayer])) - S_StartSound(NULL, sfxnum); - } - else if (line->flags & ML_EFFECT4) - { - // play the sound from nowhere + // play the sound from nowhere, but only if display player triggered it + if (mo && mo->player && (mo->player == &players[displayplayer] || mo->player == &players[secondarydisplayplayer])) S_StartSound(NULL, sfxnum); - } - else if (line->flags & ML_BLOCKMONSTERS) - { - // play the sound from calling sector's soundorg - if (callsec) - S_StartSound(&callsec->soundorg, sfxnum); - else if (mo) - S_StartSound(&mo->subsector->sector->soundorg, sfxnum); - } + } + else if (line->flags & ML_EFFECT4) + { + // play the sound from nowhere + S_StartSound(NULL, sfxnum); + } + else if (line->flags & ML_BLOCKMONSTERS) + { + // play the sound from calling sector's soundorg + if (callsec) + S_StartSound(&callsec->soundorg, sfxnum); else if (mo) - { - // play the sound from mobj that triggered it - S_StartSound(mo, sfxnum); - } + S_StartSound(&mo->subsector->sector->soundorg, sfxnum); + } + else if (mo) + { + // play the sound from mobj that triggered it + S_StartSound(mo, sfxnum); } } break; @@ -3476,7 +3484,7 @@ static boolean P_ThingIsOnThe3DFloor(mobj_t *mo, sector_t *sector, sector_t *tar // // Is player standing on the sector's "ground"? // -static inline boolean P_MobjReadyToTrigger(mobj_t *mo, sector_t *sec) +static boolean P_MobjReadyToTrigger(mobj_t *mo, sector_t *sec) { if (mo->eflags & MFE_VERTICALFLIP) return (mo->z+mo->height == P_GetSpecialTopZ(mo, sec, sec) && sec->flags & SF_FLIPSPECIAL_CEILING); From ba6d011d7b6ea91047009c3f006e933096cf6f7e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 17 Jun 2017 17:22:45 +0100 Subject: [PATCH 179/181] Scale should be fixed_t not UINT16! This is probably a leftover from how scaling worked in v2.0 I take it --- src/g_game.c | 2 +- src/g_game.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 7499fe7a0..5774b4731 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3872,7 +3872,7 @@ void G_GhostAddColor(ghostcolor_t color) ghostext.color = (UINT8)color; } -void G_GhostAddScale(UINT16 scale) +void G_GhostAddScale(fixed_t scale) { if (!demorecording || !(demoflags & DF_GHOST)) return; diff --git a/src/g_game.h b/src/g_game.h index 6d4125517..ada82404c 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -139,7 +139,7 @@ void G_GhostAddSpin(void); void G_GhostAddRev(void); void G_GhostAddColor(ghostcolor_t color); void G_GhostAddFlip(void); -void G_GhostAddScale(UINT16 scale); +void G_GhostAddScale(fixed_t scale); void G_GhostAddHit(mobj_t *victim); void G_WriteGhostTic(mobj_t *ghost); void G_ConsGhostTic(void); From 2bd11120b5a029f5b273d95fa7453ed2012e1189 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 19 Jun 2017 14:17:58 -0400 Subject: [PATCH 180/181] Appvenyor: disable OBJDUMP --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index cc073ff01..23b9b6281 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ before_build: - upx -V - ccache -V - ccache -s -- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC63=1 CCACHE=1 +- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC63=1 CCACHE=1 NOOBJDUMP=1 build_script: - cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean From da2f5fe0a2432cc3d37d9f4bb518769f31c06c01 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 20 Jun 2017 16:18:51 +0100 Subject: [PATCH 181/181] Fix PlayerSpawn hook not being called if the player is respawned at a starpost --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 5774b4731..e3d4ac855 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2288,6 +2288,9 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) if (starpost) //Don't even bother with looking for a place to spawn. { P_MovePlayerToStarpost(playernum); +#ifdef HAVE_BLUA + LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :) +#endif return; }