diff --git a/prboom2/src/dsda/stretch.c b/prboom2/src/dsda/stretch.c index 081ab79e5..fb787652a 100644 --- a/prboom2/src/dsda/stretch.c +++ b/prboom2/src/dsda/stretch.c @@ -183,6 +183,15 @@ static void InitStretchParam(stretch_param_t* offsets, int stretch, enum patch_t break; } + // Raven HUD breaks in "patch_stretch_not_adjusted", + // so let's use "patch_stretch_doom_format" settings + if (raven && stretch == patch_stretch_not_adjusted) + { + offsets->video = &video_stretch; + offsets->deltax1 = (SCREENWIDTH - WIDE_SCREENWIDTH) / 2; + offsets->deltax2 = (SCREENWIDTH - WIDE_SCREENWIDTH) / 2; + } + if (flags == VPT_ALIGN_LEFT || flags == VPT_ALIGN_LEFT_BOTTOM || flags == VPT_ALIGN_LEFT_TOP) { offsets->deltax1 = 0; offsets->deltax2 = 0; @@ -271,9 +280,6 @@ void dsda_EvaluatePatchScale(void) { SCREENHEIGHT < 200 || WIDE_SCREENHEIGHT < 200) render_stretch_hud = patch_stretch_fit_to_width; - if (raven && render_stretch_hud == 0) - render_stretch_hud++; - switch (render_stretch_hud) { case patch_stretch_not_adjusted: wide_offset2x = SCREENWIDTH - patches_scalex * 320; @@ -293,6 +299,14 @@ void dsda_EvaluatePatchScale(void) { break; } + // Raven HUD breaks in "patch_stretch_not_adjusted", + // so let's use "patch_stretch_doom_format" settings + if (raven && render_stretch_hud == patch_stretch_not_adjusted) { + ST_SCALED_HEIGHT = g_st_height * WIDE_SCREENHEIGHT / 200; + wide_offset2x = SCREENWIDTH - WIDE_SCREENWIDTH; + wide_offset2y = SCREENHEIGHT - WIDE_SCREENHEIGHT; + } + wide_offsetx = wide_offset2x / 2; wide_offsety = wide_offset2y / 2; } diff --git a/prboom2/src/st_stuff.c b/prboom2/src/st_stuff.c index da13d41df..27474291c 100644 --- a/prboom2/src/st_stuff.c +++ b/prboom2/src/st_stuff.c @@ -416,6 +416,11 @@ void ST_SetScaledWidth(void) break; } + // Raven HUD breaks in "patch_stretch_not_adjusted", + // so let's use "patch_stretch_doom_format" settings + if (raven && render_stretch_hud == patch_stretch_not_adjusted) + ST_SCALED_WIDTH = width * WIDE_SCREENWIDTH / 320; + ST_SCALED_WIDTH = (ST_SCALED_WIDTH + 3) & (int)~3; if (ST_SCALED_WIDTH > SCREENWIDTH) diff --git a/prboom2/src/v_video.c b/prboom2/src/v_video.c index f05666357..075d5ee8a 100644 --- a/prboom2/src/v_video.c +++ b/prboom2/src/v_video.c @@ -1417,7 +1417,7 @@ void V_DrawRawScreen(const char *lump_name) void V_DrawRawScreenSection(const char *lump_name, int source_offset, int dest_y_offset, int dest_y_limit) { int i, j; - float x_factor, y_factor; + float x_factor = 0, y_factor = 0; int x_offset, y_offset; const byte* raw; @@ -1440,11 +1440,24 @@ void V_DrawRawScreenSection(const char *lump_name, int source_offset, int dest_y } } - x_factor = (float)SCREENWIDTH / 320; - y_factor = (float)SCREENHEIGHT / 200; - - if (y_factor < x_factor) - x_factor = y_factor; + switch (render_stretch_hud) { + case patch_stretch_not_adjusted: + x_factor = (float)SCREENWIDTH / 320; + y_factor = (float)SCREENHEIGHT / 200; + if (y_factor < x_factor) + x_factor = y_factor; + break; + case patch_stretch_doom_format: + x_factor = (float)WIDE_SCREENWIDTH / 320; + y_factor = (float)WIDE_SCREENHEIGHT / 200; + if (y_factor < x_factor) + x_factor = y_factor; + break; + case patch_stretch_fit_to_width: + x_factor = (float)SCREENWIDTH / 320; + y_factor = (float)SCREENHEIGHT / 200; + break; + } x_offset = (int)((SCREENWIDTH - (x_factor * 320)) / 2); y_offset = (int)((dest_y_offset * y_factor) - (source_offset * y_factor / 320));