From 931d0fc9cfbd2528a3c78094ae811c3fe608c4ff Mon Sep 17 00:00:00 2001 From: lethal-guitar Date: Sun, 22 Aug 2021 11:26:22 +0200 Subject: [PATCH 1/4] Fix spelling of openSUSE --- src/ui/options_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/options_menu.cpp b/src/ui/options_menu.cpp index 0a7e165fd..0b72465f2 100644 --- a/src/ui/options_menu.cpp +++ b/src/ui/options_menu.cpp @@ -709,7 +709,7 @@ void OptionsMenu::drawCreditsBox(const engine::TimeDelta dt) ImGui::NewLine(); - centeredText("OpenSUSE package by mnhauke (https://github.com/mnhauke)"); + centeredText("openSUSE package by mnhauke (https://github.com/mnhauke)"); ImGui::NewLine(); From ee67dd590762923d3c138b5479abdfdf41921cfa Mon Sep 17 00:00:00 2001 From: lethal-guitar Date: Sun, 22 Aug 2021 11:31:31 +0200 Subject: [PATCH 2/4] Update Mac build instructions --- BUILDING.md | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 95b82b17d..ac5dfee79 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -250,9 +250,7 @@ docker run -ti --device=/dev/dri:/dev/dri --cap-add=SYS_PTRACE --security-opt se ### OS X builds -:exclamation: On Mojave (10.14) and older, non-Apple clang must be installed via Homebrew, Apple's clang does not have all required C++ library features. Starting with Catalina (10.15), Xcode's clang works fine. - -The oldest OS/compiler combination that has worked for me is clang 7 on Sierra (10.12). +:exclamation: On Mojave (10.14), non-Apple clang must be installed via Homebrew, Apple's clang does not have all required C++ library features. Starting with Catalina (10.15), Xcode's clang works fine. ### Catalina (10.15) or newer @@ -266,6 +264,9 @@ mkdir build cd build cmake .. -DWARNINGS_AS_ERRORS=OFF make + +# Now run it! +./src/RigelEngine.app/Contents/MacOS/RigelEngine ``` ### Mojave (10.14) using clang 8 @@ -290,28 +291,9 @@ mkdir build cd build cmake .. -DWARNINGS_AS_ERRORS=OFF make -``` - -### High Sierra (10.13) or older using clang 7 - -```bash -# You might need to run brew update. -brew install llvm@7 cmake sdl2 sdl2_mixer boost - -# Set up environment variables so that CMake picks up the newly installed clang - -# this is only necessary the first time. -export rigel_llvm_path=`brew --prefix llvm@7`; -export CC="$rigel_llvm_path/bin/clang"; -export CXX="$CC++"; -export CPPFLAGS="-I$rigel_llvm_path/include"; -export LDFLAGS="-L$rigel_llvm_path/lib -Wl,-rpath,$rigel_llvm_path/lib"; -unset rigel_llvm_path; -# Now, the regular build via CMake should work: -mkdir build -cd build -cmake .. -DWARNINGS_AS_ERRORS=OFF -make +# Now run it! +./src/RigelEngine.app/Contents/MacOS/RigelEngine ``` ### Windows builds From 33bf02f86e5ee2871a23e1c3fd0d177ee1f7e2dc Mon Sep 17 00:00:00 2001 From: lethal-guitar Date: Sun, 22 Aug 2021 11:40:36 +0200 Subject: [PATCH 3/4] Fix Mac high DPI rendering when hires replacement graphics present --- src/frontend/game.cpp | 5 ++++- src/frontend/game.hpp | 1 + src/game_logic/game_world.cpp | 5 ++++- src/game_logic/game_world.hpp | 1 + src/renderer/upscaling_utils.cpp | 4 +--- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/frontend/game.cpp b/src/frontend/game.cpp index fc560c2ba..5ea86a214 100644 --- a/src/frontend/game.cpp +++ b/src/frontend/game.cpp @@ -258,6 +258,7 @@ Game::Game( , mIsMinimized(false) , mCommandLineOptions(commandLineOptions) , mpUserProfile(pUserProfile) + , mPreviousWindowSize(mRenderer.windowSize()) , mWidescreenModeWasActive( pUserProfile->mOptions.mWidescreenModeOn && renderer::canUseWidescreenMode(&mRenderer)) @@ -637,7 +638,8 @@ void Game::applyChangedOptions() if ( widescreenModeActive != mWidescreenModeWasActive || currentOptions.mPerElementUpscalingEnabled != - mPreviousOptions.mPerElementUpscalingEnabled) + mPreviousOptions.mPerElementUpscalingEnabled || + mPreviousWindowSize != mRenderer.windowSize()) { mRenderTarget = renderer::createFullscreenRenderTarget( &mRenderer, mpUserProfile->mOptions); @@ -646,6 +648,7 @@ void Game::applyChangedOptions() mPreviousOptions = mpUserProfile->mOptions; mWidescreenModeWasActive = widescreenModeActive; + mPreviousWindowSize = mRenderer.windowSize(); } diff --git a/src/frontend/game.hpp b/src/frontend/game.hpp index 120ef35c6..6dc7e571d 100644 --- a/src/frontend/game.hpp +++ b/src/frontend/game.hpp @@ -142,6 +142,7 @@ class Game : public IGameServiceProvider CommandLineOptions mCommandLineOptions; UserProfile* mpUserProfile; data::GameOptions mPreviousOptions; + base::Size mPreviousWindowSize; bool mWidescreenModeWasActive; std::filesystem::path mGamePathToSwitchTo; diff --git a/src/game_logic/game_world.cpp b/src/game_logic/game_world.cpp index 9f1b62f53..49b9de431 100644 --- a/src/game_logic/game_world.cpp +++ b/src/game_logic/game_world.cpp @@ -299,6 +299,7 @@ GameWorld::GameWorld( mpRenderer, renderer::determineWidescreenViewPort(mpRenderer).mWidthPx, data::GameTraits::viewPortHeightPx) + , mPreviousWindowSize(mpRenderer->windowSize()) , mWidescreenModeWasOn(widescreenModeOn()) , mPerElementUpscalingWasEnabled(mpOptions->mPerElementUpscalingEnabled) { @@ -703,7 +704,8 @@ void GameWorld::render() { if ( widescreenModeOn() != mWidescreenModeWasOn || - mpOptions->mPerElementUpscalingEnabled != mPerElementUpscalingWasEnabled) + mpOptions->mPerElementUpscalingEnabled != mPerElementUpscalingWasEnabled || + mPreviousWindowSize != mpRenderer->windowSize()) { mWaterEffectBuffer = renderer::createFullscreenRenderTarget(mpRenderer, *mpOptions); @@ -843,6 +845,7 @@ void GameWorld::render() mWidescreenModeWasOn = widescreenModeOn(); mPerElementUpscalingWasEnabled = mpOptions->mPerElementUpscalingEnabled; + mPreviousWindowSize = mpRenderer->windowSize(); } diff --git a/src/game_logic/game_world.hpp b/src/game_logic/game_world.hpp index c2bb99500..8594a1b4a 100644 --- a/src/game_logic/game_world.hpp +++ b/src/game_logic/game_world.hpp @@ -157,6 +157,7 @@ class GameWorld : public entityx::Receiver ui::IngameMessageDisplay mMessageDisplay; renderer::RenderTargetTexture mWaterEffectBuffer; renderer::RenderTargetTexture mLowResLayer; + base::Size mPreviousWindowSize; bool mWidescreenModeWasOn; bool mPerElementUpscalingWasEnabled; diff --git a/src/renderer/upscaling_utils.cpp b/src/renderer/upscaling_utils.cpp index a010b6957..dc2355b0d 100644 --- a/src/renderer/upscaling_utils.cpp +++ b/src/renderer/upscaling_utils.cpp @@ -125,9 +125,7 @@ RenderTargetTexture createFullscreenRenderTarget( if (options.mPerElementUpscalingEnabled) { return RenderTargetTexture{ - pRenderer, - pRenderer->maxWindowSize().width, - pRenderer->maxWindowSize().height}; + pRenderer, pRenderer->windowSize().width, pRenderer->windowSize().height}; } else { From bc0e1aa00f2718efb0601e8af52fdb2d3c8f12c1 Mon Sep 17 00:00:00 2001 From: lethal-guitar Date: Sun, 22 Aug 2021 11:42:40 +0200 Subject: [PATCH 4/4] Cleanup: Remove now unused function --- src/renderer/renderer.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/renderer/renderer.cpp b/src/renderer/renderer.cpp index a3416dde6..9e4eab16a 100644 --- a/src/renderer/renderer.cpp +++ b/src/renderer/renderer.cpp @@ -401,7 +401,6 @@ struct Renderer::Impl RenderMode mLastKnownRenderMode = RenderMode::SpriteBatch; // cold - base::Size mMaxWindowSize; int mNumTextures = 0; int mNumInternalTextures = 0; TextureId mWaterSurfaceAnimTexture = 0; @@ -429,11 +428,6 @@ struct Renderer::Impl {"position", "texCoordMask"}) , mWindowSize(getSize(pWindow)) , mpWindow(pWindow) - , mMaxWindowSize([pWindow]() { - SDL_DisplayMode displayMode; - sdl_utils::check(SDL_GetDesktopDisplayMode(0, &displayMode)); - return base::Size{displayMode.w, displayMode.h}; - }()) { // General configuration glDisable(GL_DEPTH_TEST); @@ -1323,12 +1317,6 @@ base::Size Renderer::windowSize() const } -base::Size Renderer::maxWindowSize() const -{ - return mpImpl->mMaxWindowSize; -} - - void Renderer::setRenderTarget(const TextureId target) { mpImpl->setRenderTarget(target);