From 2f2e813e5259a5389ab644e8268f71adb03c6679 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Fri, 14 Aug 2020 01:31:37 -0400 Subject: [PATCH] m_anigif, m_cheat, m_cond, m_fixed Up to m_menu, and it's screaming, so I'm going to take a break :V --- src/d_netcmd.c | 5 -- src/dehacked.c | 67 ++-------------- src/doomstat.h | 6 -- src/hardware/hw_main.c | 12 +-- src/lua_mathlib.c | 8 -- src/m_anigif.c | 26 ------- src/m_cheat.c | 169 +---------------------------------------- src/m_cheat.h | 4 - src/m_cond.c | 16 ++-- src/m_cond.h | 2 +- src/m_fixed.c | 14 ---- src/m_menu.c | 11 +-- src/p_user.c | 16 ++++ src/st_stuff.c | 35 ++------- 14 files changed, 45 insertions(+), 346 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index c62b76a88..58b997df3 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -878,8 +878,6 @@ void D_RegisterClientCommands(void) #endif // HUD - CV_RegisterVar(&cv_timetic); - CV_RegisterVar(&cv_powerupdisplay); CV_RegisterVar(&cv_itemfinder); CV_RegisterVar(&cv_showinputjoy); @@ -1018,11 +1016,8 @@ void D_RegisterClientCommands(void) COM_AddCommand("noclip", Command_CheatNoClip_f); COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("notarget", Command_CheatNoTarget_f); - /*COM_AddCommand("getallemeralds", Command_Getallemeralds_f); - COM_AddCommand("resetemeralds", Command_Resetemeralds_f); COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setlives", Command_Setlives_f); - COM_AddCommand("setcontinues", Command_Setcontinues_f);*/ COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); COM_AddCommand("scale", Command_Scale_f); diff --git a/src/dehacked.c b/src/dehacked.c index 054dcecc7..c931287ed 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3957,7 +3957,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) ty = UC_PLAYTIME + offset; re = atoi(params[1]); } - else if ((offset=0) || fastcmp(params[0], "POWERLEVEL")) + else if (fastcmp(params[0], "POWERLEVEL")) { PARAMCHECK(2); ty = UC_POWERLEVEL; @@ -3970,26 +3970,19 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) return; } } - else if ((offset=0) || fastcmp(params[0], "GAMECLEAR") - || (++offset && fastcmp(params[0], "ALLEMERALDS"))) - //|| (++offset && fastcmp(params[0], "ULTIMATECLEAR"))) + else if (fastcmp(params[0], "GAMECLEAR")) { - ty = UC_GAMECLEAR + offset; + ty = UC_GAMECLEAR; re = (params[1]) ? atoi(params[1]) : 1; } - else if ((offset=0) || fastcmp(params[0], "OVERALLTIME")) - //|| (++offset && fastcmp(params[0], "OVERALLSCORE")) - //|| (++offset && fastcmp(params[0], "OVERALLRINGS"))) + else if (fastcmp(params[0], "OVERALLTIME")) { PARAMCHECK(1); - ty = UC_OVERALLTIME + offset; + ty = UC_OVERALLTIME; re = atoi(params[1]); } else if ((offset=0) || fastcmp(params[0], "MAPVISITED") - || (++offset && fastcmp(params[0], "MAPBEATEN")) - || (++offset && fastcmp(params[0], "MAPALLEMERALDS"))) - //|| (++offset && fastcmp(params[0], "MAPULTIMATE")) - //|| (++offset && fastcmp(params[0], "MAPPERFECT"))) + || (++offset && fastcmp(params[0], "MAPBEATEN"))) { PARAMCHECK(1); ty = UC_MAPVISITED + offset; @@ -4006,12 +3999,10 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) return; } } - else if ((offset=0) || fastcmp(params[0], "MAPTIME")) - //|| (++offset && fastcmp(params[0], "MAPSCORE")) - //|| (++offset && fastcmp(params[0], "MAPRINGS"))) + else if (fastcmp(params[0], "MAPTIME")) { PARAMCHECK(2); - ty = UC_MAPTIME + offset; + ty = UC_MAPTIME; re = atoi(params[2]); // Convert to map number if it appears to be one @@ -4026,48 +4017,6 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) return; } } - /*else if ((offset=0) || fastcmp(params[0], "NIGHTSSCORE") - || (++offset && fastcmp(params[0], "NIGHTSTIME")) - || (++offset && fastcmp(params[0], "NIGHTSGRADE"))) - { - PARAMCHECK(2); // one optional one - - ty = UC_NIGHTSSCORE + offset; - i = (params[3] ? 3 : 2); - if (fastncmp("GRADE_",params[i],6)) - { - char *p = params[i]+6; - for (re = 0; NIGHTSGRADE_LIST[re]; re++) - if (*p == NIGHTSGRADE_LIST[re]) - break; - if (!NIGHTSGRADE_LIST[re]) - { - deh_warning("Invalid NiGHTS grade %s\n", params[i]); - return; - } - } - else - re = atoi(params[i]); - - // Convert to map number if it appears to be one - if (params[1][0] >= 'A' && params[1][0] <= 'Z') - x1 = (INT16)M_MapNumber(params[1][0], params[1][1]); - else - x1 = (INT16)atoi(params[1]); - - if (x1 < 0 || x1 >= NUMMAPS) - { - deh_warning("Level number %d out of range (1 - %d)", re, NUMMAPS); - return; - } - - // Mare number (0 for overall) - if (params[3]) // Only if we actually got 3 params (so the second one == mare and not requirement) - x2 = (INT16)atoi(params[2]); - else - x2 = 0; - - }*/ else if (fastcmp(params[0], "TRIGGER")) { PARAMCHECK(1); diff --git a/src/doomstat.h b/src/doomstat.h index a2724add9..f12a7e95d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -187,10 +187,6 @@ extern INT16 bootmap; //bootmap for loading a map on startup extern INT16 tutorialmap; // map to load for tutorial extern boolean tutorialmode; // are we in a tutorial right now? extern INT32 tutorialgcs; // which control scheme is loaded? -extern INT32 tutorialusemouse; // store cv_usemouse user value -extern INT32 tutorialfreelook; // store cv_alwaysfreelook user value -extern INT32 tutorialmousemove; // store cv_mousemove user value -extern INT32 tutorialanalog; // store cv_analog[0] user value extern boolean looptitle; @@ -751,8 +747,6 @@ extern boolean singletics; #include "d_clisrv.h" -extern consvar_t cv_timetic; // display high resolution timer -extern consvar_t cv_powerupdisplay; // display powerups extern consvar_t cv_showinputjoy; // display joystick in time attack extern consvar_t cv_forceskin; // force clients to use the server's skin extern consvar_t cv_downloading; // allow clients to downloading WADs. diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 49a6a14c5..991004d02 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5643,6 +5643,7 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) if (player == &players[displayplayers[i]]) { type = &postimgtype[i]; + // i is now splitscreen player num break; } } @@ -5764,10 +5765,7 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) #ifndef NEWCLIP // Make a viewangle int so we can render things based on mouselook - if (player == &players[consoleplayer]) - viewangle = localaiming; - else if (splitscreen && player == &players[displayplayers[1]]) - viewangle = localaiming2; + viewangle = localaiming[i]; // Handle stuff when you are looking farther up or down. if ((gl_aimingangle || cv_fov.value+player->fovadd > 90*FRACUNIT)) @@ -5846,6 +5844,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) if (player == &players[displayplayers[i]]) { type = &postimgtype[i]; + // i is now splitscreen player num break; } } @@ -5986,10 +5985,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) #ifndef NEWCLIP // Make a viewangle int so we can render things based on mouselook - if (player == &players[consoleplayer]) - viewangle = localaiming; - else if (splitscreen && player == &players[displayplayers[1]]) - viewangle = localaiming2; + viewangle = localaiming[i]; // Handle stuff when you are looking farther up or down. if ((gl_aimingangle || cv_fov.value+player->fovadd > 90*FRACUNIT)) diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c index 7cbe7a6cc..c6c07fc7e 100644 --- a/src/lua_mathlib.c +++ b/src/lua_mathlib.c @@ -111,13 +111,6 @@ static int lib_fixeddiv(lua_State *L) return 1; } -static int lib_fixedrem(lua_State *L) -{ - LUA_Deprecated(L, "FixedRem(a, b)", "a % b"); - lua_pushfixed(L, luaL_checkfixed(L, 1) % luaL_checkfixed(L, 2)); - return 1; -} - static int lib_fixedsqrt(lua_State *L) { fixed_t i = luaL_checkfixed(L, 1); @@ -197,7 +190,6 @@ static luaL_Reg lib[] = { {"FixedMul", lib_fixedmul}, {"FixedInt", lib_fixedint}, {"FixedDiv", lib_fixeddiv}, - {"FixedRem", lib_fixedrem}, {"FixedSqrt", lib_fixedsqrt}, {"FixedHypot", lib_fixedhypot}, {"FixedFloor", lib_fixedfloor}, diff --git a/src/m_anigif.c b/src/m_anigif.c index 6ac10e11b..83bc3dddc 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -494,32 +494,6 @@ const UINT8 gifframe_gchead[4] = {0x21,0xF9,0x04,0x04}; // GCE, bytes, packed by static UINT8 *gifframe_data = NULL; static size_t gifframe_size = 8192; -#ifdef HWRENDER -static void hwrconvert(void) -{ - UINT8 *linear = HWR_GetScreenshot(); - UINT8 *dest = screens[2]; - UINT8 r, g, b; - INT32 x, y; - size_t i = 0; - - InitColorLUT(gif_framepalette); - - for (y = 0; y < vid.height; y++) - { - for (x = 0; x < vid.width; x++, i += 3) - { - r = (UINT8)linear[i]; - g = (UINT8)linear[i + 1]; - b = (UINT8)linear[i + 2]; - dest[(y * vid.width) + x] = colorlookup[r >> SHIFTCOLORBITS][g >> SHIFTCOLORBITS][b >> SHIFTCOLORBITS]; - } - } - - free(linear); -} -#endif - // // GIF_rgbconvert // converts an RGB frame to a frame with a palette. diff --git a/src/m_cheat.c b/src/m_cheat.c index 9e12a1ca7..adc55fba7 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -712,7 +712,7 @@ void Command_Teleport_f(void) CONS_Alert(CONS_NOTICE, M_GetText("Not a valid aiming angle (between +/-90).\n")); return; } - localaiming = p->aiming = aim; + localaiming[0] = p->aiming = aim; } CONS_Printf(M_GetText("Teleporting to %d, %d, %d...\n"), FixedInt(intx), FixedInt(inty), FixedInt(intz)); @@ -1088,164 +1088,6 @@ void OP_ResetObjectplace(void) op_currentthing = 0; } -// -// Main meat of objectplace: handling functions -// -void OP_NightsObjectplace(player_t *player) -{ - ticcmd_t *cmd = &player->cmd; - mapthing_t *mt; - - player->nightstime = 3*TICRATE; - player->drillmeter = TICRATE; - - if (player->pflags & PF_ATTACKDOWN) - { - // Are ANY objectplace buttons pressed? If no, remove flag. - if (!(cmd->buttons & (BT_ATTACK|BT_ACCELERATE|BT_BRAKE|BT_FORWARD|BT_BACKWARD))) - player->pflags &= ~PF_ATTACKDOWN; - - // Do nothing. - return; - } - - // This places a hoop! - if (cmd->buttons & BT_ATTACK) - { - UINT16 angle = (UINT16)(player->anotherflyangle % 360); - INT16 temp = (INT16)FixedInt(AngleFixed(player->mo->angle)); // Traditional 2D Angle - - player->pflags |= PF_ATTACKDOWN; - - mt = OP_CreateNewMapThing(player, 1713, false); - - // Tilt - mt->angle = (INT16)FixedInt(FixedDiv(angle*FRACUNIT, 360*(FRACUNIT/256))); - - if (player->anotherflyangle < 90 || player->anotherflyangle > 270) - temp -= 90; - else - temp += 90; - temp %= 360; - - mt->options = (mt->options & ~(UINT16)cv_opflags.value) | (UINT16)cv_ophoopflags.value; - mt->angle = (INT16)(mt->angle+(INT16)((FixedInt(FixedDiv(temp*FRACUNIT, 360*(FRACUNIT/256))))<<8)); - - P_SpawnHoop(mt); - } - - // This places a bumper! - /*if (cmd->buttons & BT_SPECTATE) - { - UINT16 vertangle = (UINT16)(player->anotherflyangle % 360); - UINT16 newflags; - - player->pflags |= PF_ATTACKDOWN; - if (!OP_HeightOkay(player, false)) - return; - - mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSBUMPER].doomednum, false); - mt->z = min(mt->z - (mobjinfo[MT_NIGHTSBUMPER].height/4), 0); - // height offset: from P_TouchSpecialThing case MT_NIGHTSBUMPER - - // clockwise - if (vertangle >= 75 && vertangle < 105) // up - newflags = 3; - else if (vertangle >= 105 && vertangle < 135) // 60 upward tilt - newflags = 2; - else if (vertangle >= 135 && vertangle < 165) // 30 upward tilt - newflags = 1; - //else if (vertangle >= 165 && vertangle < 195) // forward, see else case - // newflags = 0; - else if (vertangle >= 195 && vertangle < 225) // 30 downward tilt - newflags = 11; - else if (vertangle >= 225 && vertangle < 255) // 60 downward tilt - newflags = 10; - else if (vertangle >= 255 && vertangle < 285) // down - newflags = 9; - else if (vertangle >= 285 && vertangle < 315) // 60 downward tilt backwards - newflags = 8; - else if (vertangle >= 315 && vertangle < 345) // 30 downward tilt backwards - newflags = 7; - else if (vertangle >= 345 || vertangle < 15) // backwards - newflags = 6; - else if (vertangle >= 15 && vertangle < 45) // 30 upward tilt backwards - newflags = 5; - else if (vertangle >= 45 && vertangle < 75) // 60 upward tilt backwards - newflags = 4; - else // forward - newflags = 0; - - mt->options = (mt->z << ZSHIFT) | newflags; - - // if NiGHTS is facing backwards, orient the Thing angle forwards so that the sprite angle - // displays correctly. Backwards movement via the Thing flags is unaffected. - if (vertangle < 90 || vertangle > 270) - mt->angle = (mt->angle + 180) % 360; - - P_SpawnMapThing(mt); - }*/ - - // This places a ring! - if (cmd->buttons & BT_BACKWARD) - { - player->pflags |= PF_ATTACKDOWN; - if (!OP_HeightOkay(player, false)) - return; - - mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_RING].doomednum, false); - P_SpawnMapThing(mt); - } - - // This places a wing item - if (cmd->buttons & BT_FORWARD) - { - player->pflags |= PF_ATTACKDOWN; - if (!OP_HeightOkay(player, false)) - return; - - mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSWING].doomednum, false); - P_SpawnMapThing(mt); - } - - // This places a custom object as defined in the console cv_mapthingnum. - if (cmd->buttons & BT_BRAKE) - { - UINT16 angle; - - player->pflags |= PF_ATTACKDOWN; - if (!cv_mapthingnum.value) - { - CONS_Alert(CONS_WARNING, "Set op_mapthingnum first!\n"); - return; - } - if (!OP_HeightOkay(player, false)) - return; - - if (player->mo->target->flags2 & MF2_AMBUSH) - angle = (UINT16)player->anotherflyangle; - else - { - angle = (UINT16)((360-player->anotherflyangle) % 360); - if (angle > 90 && angle < 270) - { - angle += 180; - angle %= 360; - } - } - - mt = OP_CreateNewMapThing(player, (UINT16)cv_mapthingnum.value, false); - mt->angle = angle; - - if (mt->type >= 600 && mt->type <= 609) // Placement patterns - P_SpawnItemPattern(mt, false); - else if (mt->type == 1705 || mt->type == 1713) // NiGHTS Hoops - P_SpawnHoop(mt); - else - P_SpawnMapThing(mt); - } -} - // // OP_ObjectplaceMovement // @@ -1255,8 +1097,7 @@ void OP_ObjectplaceMovement(player_t *player) { ticcmd_t *cmd = &player->cmd; - if (!player->climbing && (netgame || !cv_analog[0].value || (player->pflags & PF_SPINNING))) - player->drawangle = player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */); + player->drawangle = player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */); ticruned++; if (!(cmd->angleturn & TICCMD_RECEIVED)) @@ -1273,12 +1114,6 @@ void OP_ObjectplaceMovement(player_t *player) P_TeleportMove(player->mo, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, player->mo->z); player->mo->momx = player->mo->momy = 0; } - /*if (cmd->sidemove != 0) -- was disabled in practice anyways, since sidemove was suppressed - { - P_Thrust(player->mo, player->mo->angle-ANGLE_90, (cmd->sidemove*FRACUNIT/MAXPLMOVE)*cv_speed.value); - P_TeleportMove(player->mo, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, player->mo->z); - player->mo->momx = player->mo->momy = 0; - }*/ if (player->mo->z > player->mo->ceilingz - player->mo->height) player->mo->z = player->mo->ceilingz - player->mo->height; diff --git a/src/m_cheat.h b/src/m_cheat.h index 2b6907863..a00f0504e 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -38,7 +38,6 @@ extern UINT32 op_displayflags; boolean OP_FreezeObjectplace(void); void OP_ResetObjectplace(void); -void OP_NightsObjectplace(player_t *player); void OP_ObjectplaceMovement(player_t *player); // @@ -48,11 +47,8 @@ void Command_CheatNoClip_f(void); void Command_CheatGod_f(void); void Command_CheatNoTarget_f(void); void Command_Savecheckpoint_f(void); -/*void Command_Getallemeralds_f(void); -void Command_Resetemeralds_f(void); void Command_Setrings_f(void); void Command_Setlives_f(void); -void Command_Setcontinues_f(void);*/ void Command_Devmode_f(void); void Command_Scale_f(void); void Command_Gravflip_f(void); diff --git a/src/m_cond.c b/src/m_cond.c index 20d041f4f..c72444818 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -118,8 +118,8 @@ UINT8 M_CheckCondition(condition_t *cn) return ((mapvisited[cn->requirement - 1] & MV_VISITED) == MV_VISITED); case UC_MAPBEATEN: // Requires map x to be beaten return ((mapvisited[cn->requirement - 1] & MV_BEATEN) == MV_BEATEN); - case UC_MAPALLEMERALDS: // Requires map x to be beaten with all emeralds in possession - return ((mapvisited[cn->requirement - 1] & MV_ALLEMERALDS) == MV_ALLEMERALDS); + case UC_MAPENCORE: // Requires map x to be beaten in encore + return ((mapvisited[cn->requirement - 1] & MV_ENCORE) == MV_ENCORE); case UC_MAPTIME: // Requires time on map <= x return (G_GetBestTime(cn->extrainfo1) <= (unsigned)cn->requirement); case UC_TRIGGER: // requires map trigger set @@ -284,7 +284,7 @@ UINT8 M_CheckLevelEmblems(void) // Update Score, Time, Rings emblems for (i = 0; i < numemblems; ++i) { - if (emblemlocations[i].type <= ET_SKIN || emblemlocations[i].type == ET_MAP || emblemlocations[i].collected) + if (emblemlocations[i].type < ET_TIME || emblemlocations[i].collected) continue; levelnum = emblemlocations[i].level; @@ -324,14 +324,8 @@ UINT8 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separa embtype = emblemlocations[i].var; flags = MV_BEATEN; - if (embtype & ME_ALLEMERALDS) - flags |= MV_ALLEMERALDS; - - if (embtype & ME_ULTIMATE) - flags |= MV_ULTIMATE; - - if (embtype & ME_PERFECT) - flags |= MV_PERFECT; + if (embtype & ME_ENCORE) + flags |= MV_ENCORE; res = ((mapvisited[levelnum - 1] & flags) == flags); diff --git a/src/m_cond.h b/src/m_cond.h index 44e74d518..ed29fe326 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -24,10 +24,10 @@ typedef enum UC_MATCHESPLAYED, // SRB2Kart: MATCHESPLAYED [x played] UC_POWERLEVEL, // SRB2Kart: POWERLEVEL [power level to reach] [gametype, "0" for race, "1" for battle] UC_GAMECLEAR, // GAMECLEAR - UC_ALLEMERALDS, // ALLEMERALDS UC_OVERALLTIME, // OVERALLTIME [time to beat, tics] UC_MAPVISITED, // MAPVISITED [map number] UC_MAPBEATEN, // MAPBEATEN [map number] + UC_MAPENCORE, // MAPENCORE [map number] UC_MAPTIME, // MAPTIME [map number] [time to beat, tics] UC_TRIGGER, // TRIGGER [trigger number] UC_TOTALEMBLEMS, // TOTALEMBLEMS [number of emblems] diff --git a/src/m_fixed.c b/src/m_fixed.c index 36678f7b3..eb10fd5f8 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -411,19 +411,6 @@ boolean FV3_Equal(const vector3_t *a_1, const vector3_t *a_2) return false; } -// ClosestPointOnVector -// -// Similar to ClosestPointOnLine, but uses a vector instead of two points. -// -void FV3_ClosestPointOnVector(const vector3_t *dir, const vector3_t *p, vector3_t *out) -{ - fixed_t t = FV3_Dot(dir, p); - - // Return the point on the line closest - FV3_MulEx(dir, t, out); - return; -} - fixed_t FV3_Dot(const vector3_t *a_1, const vector3_t *a_2) { return (FixedMul(a_1->x, a_2->x) + FixedMul(a_1->y, a_2->y) + FixedMul(a_1->z, a_2->z)); @@ -471,7 +458,6 @@ vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vec return FV3_AddEx(&Line[0], &V, out); } - // // ClosestPointOnVector // diff --git a/src/m_menu.c b/src/m_menu.c index c26f05b82..7f3c835fd 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6368,13 +6368,8 @@ static char *M_GetConditionString(condition_t cond) return va("Beat game %d times", cond.requirement); else return va("Beat the game"); - case UC_ALLEMERALDS: - if (cond.requirement > 1) - return va("Beat game w/ all emeralds %d times", cond.requirement); - else - return va("Beat game w/ all emeralds"); case UC_OVERALLTIME: - return va("Get overall time of %i:%02i:%02i", + return va("Get overall Time Attack of %i:%02i:%02i", G_TicsToHours(cond.requirement), G_TicsToMinutes(cond.requirement, false), G_TicsToSeconds(cond.requirement)); @@ -6382,8 +6377,8 @@ static char *M_GetConditionString(condition_t cond) return va("Visit %s", G_BuildMapTitle(cond.requirement-1)); case UC_MAPBEATEN: return va("Beat %s", G_BuildMapTitle(cond.requirement-1)); - case UC_MAPALLEMERALDS: - return va("Beat %s w/ all emeralds", G_BuildMapTitle(cond.requirement-1)); + case UC_MAPENCORE: + return va("Beat %s in Encore Mode", G_BuildMapTitle(cond.requirement-1)); case UC_MAPTIME: return va("Beat %s in %i:%02i.%02i", G_BuildMapTitle(cond.extrainfo1-1), G_TicsToMinutes(cond.requirement, true), diff --git a/src/p_user.c b/src/p_user.c index c06ac9578..3591acc1c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -504,6 +504,22 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) player->rings = -20; // Chaotix ring debt! } +// +// P_GivePlayerLives +// +// Gives the player an extra life. +// Call this function when you want to add lives to the player. +// +void P_GivePlayerLives(player_t *player, INT32 numlives) +{ + player->lives += numlives; + + if (player->lives > 9) + player->lives = 9; + else if (player->lives < 1) + player->lives = 1; +} + // Adds to the player's score void P_AddPlayerScore(player_t *player, UINT32 amount) { diff --git a/src/st_stuff.c b/src/st_stuff.c index 5eb56ce21..7e1b491dc 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -612,29 +612,9 @@ tic_t lt_exitticker = 0, lt_endtime = 0; // static void ST_cacheLevelTitle(void) { -#define SETPATCH(default, warning, custom, idx) \ -{ \ - lumpnum_t patlumpnum = LUMPERROR; \ - if (mapheaderinfo[gamemap-1]->custom[0] != '\0') \ - { \ - patlumpnum = W_CheckNumForName(mapheaderinfo[gamemap-1]->custom); \ - if (patlumpnum != LUMPERROR) \ - lt_patches[idx] = (patch_t *)W_CachePatchNum(patlumpnum, PU_HUDGFX); \ - } \ - if (patlumpnum == LUMPERROR) \ - { \ - if (!(mapheaderinfo[gamemap-1]->levelflags & LF_WARNINGTITLE)) \ - lt_patches[idx] = (patch_t *)W_CachePatchName(default, PU_HUDGFX); \ - else \ - lt_patches[idx] = (patch_t *)W_CachePatchName(warning, PU_HUDGFX); \ - } \ -} - - SETPATCH("LTACTBLU", "LTACTRED", ltactdiamond, 0) - SETPATCH("LTZIGZAG", "LTZIGRED", ltzzpatch, 1) - SETPATCH("LTZZTEXT", "LTZZWARN", ltzztext, 2) - -#undef SETPATCH + lt_patches[0] = (patch_t *)W_CachePatchName("LTACTBLU", PU_HUDGFX); + lt_patches[1] = (patch_t *)W_CachePatchName("LTZIGZAG", PU_HUDGFX); + lt_patches[2] = (patch_t *)W_CachePatchName("LTZZTEXT", PU_HUDGFX); } // @@ -893,17 +873,13 @@ static void ST_overlayDrawer(void) } } } - else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2) - ST_drawPowerupHUD(); // same as it ever was... if (!(netgame || multiplayer) || !hu_showscores) LUAh_GameHUD(stplyr); // draw level title Tails - if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer) && !mapreset) - && LUA_HudEnabled(hud_stagetitle) - ) - ST_drawLevelTitle(); + if (stagetitle && (!WipeInAction) && (!WipeStageTitle)) + ST_drawTitleCard(); if (!hu_showscores && netgame && !mapreset) { @@ -1066,6 +1042,7 @@ void ST_Drawer(void) if (st_overlay) { + UINT8 i; // No deadview! for (i = 0; i <= r_splitscreen; i++) {