From 8094dc6ab19affc544200804f65feb0a9e25c0ae Mon Sep 17 00:00:00 2001 From: Alex Zhuohao He Date: Sat, 7 Dec 2024 11:39:32 -0500 Subject: [PATCH] remove redundant window.setFlags() and pass window_settings to presenter by value --- libopenage/presenter/presenter.cpp | 2 +- libopenage/presenter/presenter.h | 2 +- libopenage/renderer/opengl/window.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libopenage/presenter/presenter.cpp b/libopenage/presenter/presenter.cpp index 6db1e23136..9775b62d9b 100644 --- a/libopenage/presenter/presenter.cpp +++ b/libopenage/presenter/presenter.cpp @@ -47,7 +47,7 @@ Presenter::Presenter(const util::Path &root_dir, time_loop{time_loop} {} -void Presenter::run(const renderer::window_settings &window_settings) { +void Presenter::run(const renderer::window_settings window_settings) { log::log(INFO << "Presenter: Launching subsystems..."); this->init_graphics(window_settings); diff --git a/libopenage/presenter/presenter.h b/libopenage/presenter/presenter.h index a4b5dec68e..2059daeed0 100644 --- a/libopenage/presenter/presenter.h +++ b/libopenage/presenter/presenter.h @@ -91,7 +91,7 @@ class Presenter { * * @param window_settings The settings to customize the display window (e.g. size, display mode, vsync). */ - void run(const renderer::window_settings &window_settings = {}); + void run(const renderer::window_settings window_settings = {}); /** * Set the game simulation controlled by this presenter. diff --git a/libopenage/renderer/opengl/window.cpp b/libopenage/renderer/opengl/window.cpp index 46772e14d9..548575dd2d 100644 --- a/libopenage/renderer/opengl/window.cpp +++ b/libopenage/renderer/opengl/window.cpp @@ -62,7 +62,7 @@ GlWindow::GlWindow(const std::string &title, this->window->setWindowState(Qt::WindowNoState); switch (settings.mode) { case window_mode::WINDOWED: - this->window->setFlags(this->window->flags() & ~Qt::FramelessWindowHint); + // nothing to do because it's the default break; case window_mode::BORDERLESS: this->window->setFlags(this->window->flags() | Qt::FramelessWindowHint);