mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 12:50:44 +00:00
Various fixes and tweaks to rewinds
This commit is contained in:
parent
1f2adee119
commit
aaa6418981
2 changed files with 26 additions and 11 deletions
25
src/g_game.c
25
src/g_game.c
|
@ -5939,6 +5939,10 @@ void G_PreviewRewind(tic_t previewtime)
|
|||
size_t i, j;
|
||||
fixed_t tweenvalue = 0;
|
||||
rewindinfo_t *info = rewindhead, *next_info = rewindhead;
|
||||
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
while (info->leveltime > previewtime && info->prev)
|
||||
{
|
||||
next_info = info;
|
||||
|
@ -5947,6 +5951,7 @@ void G_PreviewRewind(tic_t previewtime)
|
|||
if (info != next_info)
|
||||
tweenvalue = FixedDiv(previewtime - info->leveltime, next_info->leveltime - info->leveltime);
|
||||
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
|
@ -5998,16 +6003,23 @@ void G_PreviewRewind(tic_t previewtime)
|
|||
void G_ConfirmRewind(tic_t rewindtime)
|
||||
{
|
||||
tic_t i;
|
||||
boolean oldmenuactive = menuactive, oldsounddisabled = sound_disabled, olddigitaldisabled = digital_disabled;
|
||||
boolean oldmenuactive = menuactive, oldsounddisabled = sound_disabled;
|
||||
|
||||
INT32 olddp1 = displayplayer, olddp2 = secondarydisplayplayer, olddp3 = thirddisplayplayer, olddp4 = fourthdisplayplayer;
|
||||
UINT8 oldss = splitscreen;
|
||||
|
||||
cv_renderview.value = 0;
|
||||
|
||||
menuactive = false; // Prevent loops
|
||||
sound_disabled = /*digital_disabled =*/ true; // Prevent sound spam
|
||||
demo.rewinding = true; // may not need later
|
||||
|
||||
CV_StealthSetValue(&cv_renderview, 0);
|
||||
|
||||
if (rewindtime > starttime)
|
||||
{
|
||||
sound_disabled = true; // Prevent sound spam
|
||||
demo.rewinding = true;
|
||||
}
|
||||
else
|
||||
demo.rewinding = false;
|
||||
|
||||
G_DoPlayDemo(NULL); // Restart the current demo
|
||||
|
||||
for (i = 0; i < rewindtime && leveltime < rewindtime; i++)
|
||||
|
@ -6019,11 +6031,10 @@ void G_ConfirmRewind(tic_t rewindtime)
|
|||
demo.rewinding = false;
|
||||
menuactive = oldmenuactive; // Bring the menu back up
|
||||
sound_disabled = oldsounddisabled; // Re-enable SFX
|
||||
digital_disabled = olddigitaldisabled;
|
||||
|
||||
wipegamestate = gamestate; // No fading back in!
|
||||
|
||||
cv_renderview.value = 1;
|
||||
COM_BufInsertText("renderview on\n");
|
||||
|
||||
splitscreen = oldss;
|
||||
displayplayer = olddp1;
|
||||
|
|
12
src/m_menu.c
12
src/m_menu.c
|
@ -5759,7 +5759,7 @@ static void M_DrawPlaybackMenu(void)
|
|||
else
|
||||
icon = W_CachePatchName("PLAYRANK", PU_CACHE); // temp
|
||||
|
||||
if (i == playback_fastforward && cv_playbackspeed.value > 1)
|
||||
if ((i == playback_fastforward && cv_playbackspeed.value > 1) || (i == playback_rewind && demo.rewinding))
|
||||
V_DrawMappedPatch(currentMenu->x + currentMenu->menuitems[i].alphaKey, currentMenu->y, 0, icon, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SILVER, GTC_MENUCACHE));
|
||||
else
|
||||
V_DrawMappedPatch(currentMenu->x + currentMenu->menuitems[i].alphaKey, currentMenu->y, 0, icon, (i == itemOn) ? activemap : inactivemap);
|
||||
|
@ -5771,6 +5771,8 @@ static void M_DrawPlaybackMenu(void)
|
|||
|
||||
static void M_PlaybackRewind(INT32 choice)
|
||||
{
|
||||
static tic_t lastconfirmtime;
|
||||
|
||||
(void)choice;
|
||||
|
||||
if (!demo.rewinding)
|
||||
|
@ -5784,11 +5786,13 @@ static void M_PlaybackRewind(INT32 choice)
|
|||
else
|
||||
demo.rewinding = paused = true;
|
||||
}
|
||||
else
|
||||
else if (lastconfirmtime + TICRATE/2 < I_GetTime())
|
||||
{
|
||||
lastconfirmtime = I_GetTime();
|
||||
G_ConfirmRewind(leveltime);
|
||||
}
|
||||
|
||||
// temp
|
||||
//G_ConfirmRewind(starttime + 90*TICRATE);
|
||||
CV_SetValue(&cv_playbackspeed, 1);
|
||||
}
|
||||
|
||||
static void M_PlaybackPause(INT32 choice)
|
||||
|
|
Loading…
Reference in a new issue