Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions components/doom/prboom/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,18 @@ void R_SetViewSize(int blocks)
setblocks = blocks;
}

// Force a full screen redraw on the next D_Display, reusing the current view
// size. D_Display's setsizeneeded path sets oldgamestate = -1, which triggers
// R_FillBackScreen + a border redraw and (in status-bar mode) ST_doRefresh --
// a FULL status bar repaint instead of the usual ST_diffDraw. Call this after
// something external overwrites the framebuffer (e.g. returning from the
// emulator's pause/state menu); otherwise the diff-optimized status bar stays
// garbage until an individual widget value (ammo/health) happens to change.
void R_ForceRedraw(void)
{
setsizeneeded = true;
}

//
// R_ExecuteSetViewSize
//
Expand Down
1 change: 1 addition & 0 deletions components/doom/prboom/r_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void R_RenderPlayerView(player_t *player); // Called by G_Drawer.
void R_Init(void); // Called by startup code.
void R_SetViewSize(int blocks); // Called by M_Responder.
void R_ExecuteSetViewSize(void); // cph - called by D_Display to complete a view resize
void R_ForceRedraw(void); // force a full redraw next D_Display (e.g. after an external menu)

//
// HAPTICS - functions to call for various events that should trigger haptics
Expand Down
7 changes: 7 additions & 0 deletions components/doom/src/doom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ extern "C" {
#include <m_misc.h>
#include <r_draw.h>
#include <r_fps.h>
#include <r_main.h>
#include <s_sound.h>
#include <st_stuff.h>
#include <mus2mid.h>
Expand Down Expand Up @@ -614,6 +615,12 @@ void pause_doom_tasks() {
void resume_doom_tasks() {
snd_MusicVolume = DEFAULT_AUDIO_VOLUME;
snd_SfxVolume = DEFAULT_AUDIO_VOLUME;
// The pause/state menu (and clear_screen) overwrote the shared framebuffer,
// including the status bar region. Doom's status bar uses an incremental
// (diff) draw that assumes that region persists, so without a forced full
// redraw the HUD stays garbage until an individual widget value changes.
// Force a full redraw (background + border + ST_doRefresh) on the next frame.
R_ForceRedraw();
}

void load_doom(std::string_view save_path, int save_slot) {
Expand Down
Loading