Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raven RawScreen Aspect Fix #546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 17 additions & 3 deletions prboom2/src/dsda/stretch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == 0)
{
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;
Expand Down Expand Up @@ -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;
Expand All @@ -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 == 0) {
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;
}
5 changes: 5 additions & 0 deletions prboom2/src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == 0)
ST_SCALED_WIDTH = width * WIDE_SCREENWIDTH / 320;

ST_SCALED_WIDTH = (ST_SCALED_WIDTH + 3) & (int)~3;

if (ST_SCALED_WIDTH > SCREENWIDTH)
Expand Down
28 changes: 23 additions & 5 deletions prboom2/src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,11 +1440,29 @@ 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;
default:
// This should never happen
x_factor = 0;
y_factor = 0;
break;
}

x_offset = (int)((SCREENWIDTH - (x_factor * 320)) / 2);
y_offset = (int)((dest_y_offset * y_factor) - (source_offset * y_factor / 320));
Expand Down
Loading