From 96b15868d306c8b3ded01fad8c37dc964baa767d Mon Sep 17 00:00:00 2001 From: kdx Date: Thu, 11 May 2023 00:55:09 +0200 Subject: linear scaling config --- headers/TZR.h | 3 ++- headers/TZR_types.h | 1 + sources/TZR_Init.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/headers/TZR.h b/headers/TZR.h index ac450ac..168d493 100644 --- a/headers/TZR.h +++ b/headers/TZR.h @@ -16,10 +16,11 @@ .scale=2, \ .target_fps=60, \ .pixel_perfect=true, \ + .hd_render=false, \ + .scale_linear=false, \ .show_cursor=false, \ .mixer=TZR_MIXER_ON, \ .png_loading=true, \ - .hd_render=false, \ .title="TZR", \ ._=0, __VA_ARGS__ }) diff --git a/headers/TZR_types.h b/headers/TZR_types.h index 55a0d1d..aa636f1 100644 --- a/headers/TZR_types.h +++ b/headers/TZR_types.h @@ -55,6 +55,7 @@ struct TZR_Config { int target_fps; bool pixel_perfect; bool hd_render; + bool scale_linear; bool show_cursor; unsigned int mixer; bool png_loading; diff --git a/sources/TZR_Init.c b/sources/TZR_Init.c index b6163c5..a10c2fb 100644 --- a/sources/TZR_Init.c +++ b/sources/TZR_Init.c @@ -74,7 +74,8 @@ _TZR_Init(const TZR_Config *config) return _sdl_error(); } - SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, 0); + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, + ___tzr_config.scale_linear ? "1" : "0"); ___tzr_tick = 0; if (___tzr_config.target_fps > 0) { -- cgit v1.2.3