From a7692fe4ef55907055d32c7079192733c28db493 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sat, 19 Aug 2023 17:50:31 +0200 Subject: [PATCH] port: add MSAA setting --- port/fast3d/gfx_pc.cpp | 1 - port/src/config.c | 1 + port/src/video.c | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/port/fast3d/gfx_pc.cpp b/port/fast3d/gfx_pc.cpp index 358915c08..3c89fc84a 100644 --- a/port/fast3d/gfx_pc.cpp +++ b/port/fast3d/gfx_pc.cpp @@ -2552,7 +2552,6 @@ extern "C" void gfx_init(struct GfxWindowManagerAPI* wapi, struct GfxRenderingAP gfx_rapi->init(); gfx_rapi->update_framebuffer_parameters(0, width, height, 1, false, true, true, true); gfx_current_dimensions.internal_mul = 1; - gfx_msaa_level = 1; gfx_current_game_window_viewport.width = gfx_current_dimensions.width = width; gfx_current_game_window_viewport.height = gfx_current_dimensions.height = height; game_framebuffer = gfx_rapi->create_framebuffer(); diff --git a/port/src/config.c b/port/src/config.c index 19cdda309..54f429ad4 100644 --- a/port/src/config.c +++ b/port/src/config.c @@ -34,6 +34,7 @@ struct configentry { { "Video.FramerateLimit", CONFIG_S32, { .s32val = 0 } }, { "Video.FovY", CONFIG_F32, { .f32val = 60.f } }, { "Video.TextureFilter", CONFIG_S32, { .s32val = 1 } }, + { "Video.MSAA", CONFIG_S32, { .s32val = 0 } }, /* Audio */ { "Audio.BufferSize", CONFIG_S32, { .s32val = 512 } }, { "Audio.QueueLimit", CONFIG_S32, { .s32val = 8192 } }, diff --git a/port/src/video.c b/port/src/video.c index a8a790433..6bf019229 100644 --- a/port/src/video.c +++ b/port/src/video.c @@ -36,6 +36,11 @@ s32 videoInit(void) const s32 h = configGetInt("Video.DefaultHeight", 480); const bool fs = configGetInt("Video.DefaultFullscreen", false); + gfx_msaa_level = configGetInt("Video.MSAA", 0); + if (gfx_msaa_level < 1 || gfx_msaa_level > 16) { + gfx_msaa_level = 1; + } + gfx_init(wmAPI, renderingAPI, "PD", fs, w, h, 100, 100); wmAPI->set_swap_interval(configGetInt("Video.VSync", 1));