From 118e3db5ca77497b827685d7f555ea42a3cce289 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 1 Jan 2020 23:23:20 -0500 Subject: [PATCH] - r_videoscale: make the compiler manage vScaleTable's size --- src/rendering/r_videoscale.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/r_videoscale.cpp b/src/rendering/r_videoscale.cpp index b62ddb854e..4fc9f6c124 100644 --- a/src/rendering/r_videoscale.cpp +++ b/src/rendering/r_videoscale.cpp @@ -40,7 +40,7 @@ #include "console/c_console.h" #include "menu/menu.h" -#define NUMSCALEMODES 8 +#define NUMSCALEMODES countof(vScaleTable) extern bool setsizeneeded; extern bool generic_ui; @@ -133,7 +133,7 @@ namespace // the odd formatting of this struct definition is meant to resemble a table header. set your tab stops to 4 when editing this file. struct v_ScaleTable { bool isValid; uint32_t(*GetScaledWidth)(uint32_t Width, uint32_t Height); uint32_t(*GetScaledHeight)(uint32_t Width, uint32_t Height); float pixelAspect; bool isCustom; }; - v_ScaleTable vScaleTable[NUMSCALEMODES] = + v_ScaleTable vScaleTable[] = { { true, [](uint32_t Width, uint32_t Height)->uint32_t { return Width; }, [](uint32_t Width, uint32_t Height)->uint32_t { return Height; }, 1.0f, false }, // 0 - Native { true, [](uint32_t Width, uint32_t Height)->uint32_t { return v_mfillX(Width, Height); }, [](uint32_t Width, uint32_t Height)->uint32_t { return v_mfillY(Width, Height); }, 1.0f, false }, // 6 - Minimum Scale to Fill Entire Screen