From 30ac257d9579ed445d654f86dae62dfc8974deab Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 23 Jun 2020 08:11:57 -0500 Subject: [PATCH] [nostalgia/core/gba] Make sizing a scale factor of the GBA --- src/nostalgia/core/sdl/gfx.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/core/sdl/gfx.cpp b/src/nostalgia/core/sdl/gfx.cpp index b2a51085..dd8a8d68 100644 --- a/src/nostalgia/core/sdl/gfx.cpp +++ b/src/nostalgia/core/sdl/gfx.cpp @@ -31,6 +31,8 @@ struct SdlImplData { uint64_t draws = 0; }; +constexpr auto Scale = 5; + [[nodiscard]] static ox::ValErr> readFile(Context *ctx, const ox::FileAddress &file) { auto [stat, err] = ctx->rom->stat(file); oxReturnError(err); @@ -51,7 +53,7 @@ template ox::Error initGfx(Context *ctx) { auto id = new SdlImplData; ctx->setImplData(id); - id->window = SDL_CreateWindow("nostalgia", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1024, 768, + id->window = SDL_CreateWindow("nostalgia", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 240 * Scale, 160 * Scale, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI); id->renderer = SDL_CreateRenderer(id->window, -1, SDL_RENDERER_ACCELERATED); return OxError(id->window == nullptr); @@ -139,7 +141,7 @@ ox::Error loadTileSheet(Context *ctx, void drawBackground(Context *ctx, const TileMap &tm, SDL_Texture *tex) { if (tex) { - constexpr auto DstSize = 32; + constexpr auto DstSize = 8 * Scale; auto id = ctx->implData(); //oxTrace("nostalgia::core::drawBackground") << "Drawing background"; SDL_Rect src = {}, dst = {};