From f48e3e5b4d3f47732aead0e1d64c475b90f36189 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Wed, 25 Apr 2018 22:35:40 +0300 Subject: [PATCH] Use real height/width instead warp dimensions --- src/client/refresh/soft/header/local.h | 3 --- src/client/refresh/soft/sw_main.c | 2 +- src/client/refresh/soft/sw_misc.c | 6 +++--- src/client/refresh/soft/sw_scan.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/client/refresh/soft/header/local.h b/src/client/refresh/soft/header/local.h index ae43f1d5..efa4a2ed 100644 --- a/src/client/refresh/soft/header/local.h +++ b/src/client/refresh/soft/header/local.h @@ -140,9 +140,6 @@ extern oldrefdef_t r_refdef; #define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate // polygon (while processing) -#define WARP_WIDTH 320 -#define WARP_HEIGHT 240 - #define PARTICLE_Z_CLIP 8.0 #define TRANSPARENT_COLOR 0xFF diff --git a/src/client/refresh/soft/sw_main.c b/src/client/refresh/soft/sw_main.c index e09407f6..7b3e59f2 100644 --- a/src/client/refresh/soft/sw_main.c +++ b/src/client/refresh/soft/sw_main.c @@ -1907,7 +1907,7 @@ SWimp_InitGraphics(int fullscreen, int *pwidth, int *pheight) finalverts = malloc((MAXALIASVERTS + 3) * sizeof(finalvert_t)); ledges = malloc((NUMSTACKEDGES + 1) * sizeof(edge_t)); lsurfs = malloc((NUMSTACKSURFACES + 1) * sizeof(surf_t)); - r_warpbuffer = malloc(WARP_WIDTH * WARP_HEIGHT * sizeof(pixel_t)); + r_warpbuffer = malloc(vid.height * vid.width * sizeof(pixel_t)); if ((vid.width >= 2048) && (sizeof(shift20_t) == 4)) // 2k+ resolution and 32 == shift20_t { diff --git a/src/client/refresh/soft/sw_misc.c b/src/client/refresh/soft/sw_misc.c index dc877a5a..fbf7eb0f 100644 --- a/src/client/refresh/soft/sw_misc.c +++ b/src/client/refresh/soft/sw_misc.c @@ -355,11 +355,11 @@ void R_SetupFrame (void) // warp into off screen buffer vrect.x = 0; vrect.y = 0; - vrect.width = r_newrefdef.width < WARP_WIDTH ? r_newrefdef.width : WARP_WIDTH; - vrect.height = r_newrefdef.height < WARP_HEIGHT ? r_newrefdef.height : WARP_HEIGHT; + vrect.width = r_newrefdef.width; + vrect.height = r_newrefdef.height; d_viewbuffer = r_warpbuffer; - r_screenwidth = WARP_WIDTH; + r_screenwidth = vid.width; } else { diff --git a/src/client/refresh/soft/sw_scan.c b/src/client/refresh/soft/sw_scan.c index afbc3823..ebc9b2ef 100644 --- a/src/client/refresh/soft/sw_scan.c +++ b/src/client/refresh/soft/sw_scan.c @@ -65,7 +65,7 @@ void D_WarpScreen (void) int v2; v2 = (int)((float)v/(h + AMP2 * 2) * r_refdef.vrect.height); - warp_rowptr[v] = r_warpbuffer + (WARP_WIDTH * v2); + warp_rowptr[v] = r_warpbuffer + (r_refdef.vrect.width * v2); } for (u=0 ; u