Use real height/width instead warp dimensions

This commit is contained in:
Denis Pauk 2018-04-25 22:35:40 +03:00
parent 3adb4a62d7
commit f48e3e5b4d
4 changed files with 5 additions and 8 deletions

View File

@ -140,9 +140,6 @@ extern oldrefdef_t r_refdef;
#define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate #define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate
// polygon (while processing) // polygon (while processing)
#define WARP_WIDTH 320
#define WARP_HEIGHT 240
#define PARTICLE_Z_CLIP 8.0 #define PARTICLE_Z_CLIP 8.0
#define TRANSPARENT_COLOR 0xFF #define TRANSPARENT_COLOR 0xFF

View File

@ -1907,7 +1907,7 @@ SWimp_InitGraphics(int fullscreen, int *pwidth, int *pheight)
finalverts = malloc((MAXALIASVERTS + 3) * sizeof(finalvert_t)); finalverts = malloc((MAXALIASVERTS + 3) * sizeof(finalvert_t));
ledges = malloc((NUMSTACKEDGES + 1) * sizeof(edge_t)); ledges = malloc((NUMSTACKEDGES + 1) * sizeof(edge_t));
lsurfs = malloc((NUMSTACKSURFACES + 1) * sizeof(surf_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 if ((vid.width >= 2048) && (sizeof(shift20_t) == 4)) // 2k+ resolution and 32 == shift20_t
{ {

View File

@ -355,11 +355,11 @@ void R_SetupFrame (void)
// warp into off screen buffer // warp into off screen buffer
vrect.x = 0; vrect.x = 0;
vrect.y = 0; vrect.y = 0;
vrect.width = r_newrefdef.width < WARP_WIDTH ? r_newrefdef.width : WARP_WIDTH; vrect.width = r_newrefdef.width;
vrect.height = r_newrefdef.height < WARP_HEIGHT ? r_newrefdef.height : WARP_HEIGHT; vrect.height = r_newrefdef.height;
d_viewbuffer = r_warpbuffer; d_viewbuffer = r_warpbuffer;
r_screenwidth = WARP_WIDTH; r_screenwidth = vid.width;
} }
else else
{ {

View File

@ -65,7 +65,7 @@ void D_WarpScreen (void)
int v2; int v2;
v2 = (int)((float)v/(h + AMP2 * 2) * r_refdef.vrect.height); 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<w+AMP2*2 ; u++) for (u=0 ; u<w+AMP2*2 ; u++)