From bf4d7234e14ad543c0acaa5a1cbd51a9603d2241 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 23 Jul 2017 22:04:00 +0200 Subject: [PATCH] - Increase MAXWIDTH and MAXHEIGHT defines to support supersampled 5K monitors --- src/menu/videomenu.cpp | 4 ++-- src/r_defs.h | 4 ++-- src/swrenderer/line/r_farclip_line.cpp | 2 +- src/swrenderer/scene/r_3dfloors.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/menu/videomenu.cpp b/src/menu/videomenu.cpp index 4c77f83fd..bb9fbd624 100644 --- a/src/menu/videomenu.cpp +++ b/src/menu/videomenu.cpp @@ -145,7 +145,7 @@ int ViewportScaledWidth(int width) case 1: return 320; case 2: return 640; case 3: return (int)roundf(width * 0.5f); - case 4: return (int)(width * 2.0f); + case 4: return width * 2; } } @@ -158,7 +158,7 @@ int ViewportScaledHeight(int height) case 1: return 200; case 2: return 400; case 3: return (int)roundf(height * 0.5f); - case 4: return (int)(height * 2.0f); + case 4: return height * 2; } } diff --git a/src/r_defs.h b/src/r_defs.h index 411a3c078..1ac282cf9 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -52,8 +52,8 @@ struct seg_t; struct sector_t; class AActor; -#define MAXWIDTH 5760 -#define MAXHEIGHT 3600 +#define MAXWIDTH 12000 +#define MAXHEIGHT 5000 const uint16_t NO_INDEX = 0xffffu; const uint32_t NO_SIDE = 0xffffffffu; diff --git a/src/swrenderer/line/r_farclip_line.cpp b/src/swrenderer/line/r_farclip_line.cpp index 95e559a24..f000744c2 100644 --- a/src/swrenderer/line/r_farclip_line.cpp +++ b/src/swrenderer/line/r_farclip_line.cpp @@ -113,7 +113,7 @@ namespace swrenderer //walltop.Project(Thread->Viewport.get(), mFrontSector->ceilingplane, &WallC, mLineSegment, Thread->Portal->MirrorFlags & RF_XFLIP); wallbottom.Project(Thread->Viewport.get(), mFrontSector->floorplane, &WallC, mLineSegment, Thread->Portal->MirrorFlags & RF_XFLIP); - memcpy(walltop.ScreenY, wallbottom.ScreenY, sizeof(short) * MAXWIDTH); + memcpy(walltop.ScreenY, wallbottom.ScreenY, sizeof(short) * Thread->Viewport->RenderTarget->GetWidth()); } ClipSegmentTopBottom(x1, x2); diff --git a/src/swrenderer/scene/r_3dfloors.cpp b/src/swrenderer/scene/r_3dfloors.cpp index 567660e9a..111cbf504 100644 --- a/src/swrenderer/scene/r_3dfloors.cpp +++ b/src/swrenderer/scene/r_3dfloors.cpp @@ -142,8 +142,8 @@ namespace swrenderer curr = (ClipStack*)M_Malloc(sizeof(ClipStack)); curr->next = 0; - memcpy(curr->floorclip, Thread->OpaquePass->floorclip, sizeof(short) * MAXWIDTH); - memcpy(curr->ceilingclip, Thread->OpaquePass->ceilingclip, sizeof(short) * MAXWIDTH); + memcpy(curr->floorclip, Thread->OpaquePass->floorclip, sizeof(short) * Thread->Viewport->RenderTarget->GetWidth()); + memcpy(curr->ceilingclip, Thread->OpaquePass->ceilingclip, sizeof(short) * Thread->Viewport->RenderTarget->GetWidth()); curr->ffloor = fakeFloor; assert(fakeFloor->floorclip == nullptr); assert(fakeFloor->ceilingclip == nullptr);