From 5507c0e6083ee9e237e0fc93798897da7fa389a2 Mon Sep 17 00:00:00 2001 From: Nikolai Wuttke Date: Sat, 28 Nov 2020 15:10:54 +0100 Subject: [PATCH 1/3] Always use wonky orientation change, and adapt camera --- src/game_logic/camera.cpp | 5 ++--- src/game_logic/player.cpp | 12 +++--------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/game_logic/camera.cpp b/src/game_logic/camera.cpp index 406e5cbe7..1f42735a5 100644 --- a/src/game_logic/camera.cpp +++ b/src/game_logic/camera.cpp @@ -47,7 +47,7 @@ constexpr auto MAX_ADJUST_UP = 2; constexpr auto MAX_ADJUST_DOWN = 2; constexpr auto MAX_ADJUST_DOWN_ELEVATOR = 3; -constexpr auto DEAD_ZONE_START_X = 11; +constexpr auto DEAD_ZONE_START_X = 10; constexpr auto IN_SHIP_DEAD_ZONE_START_X = 12; constexpr auto DEAD_ZONE_END_X = 21; @@ -111,8 +111,7 @@ base::Rect normalizedPlayerBounds( const auto offsetToCenter = extraTiles / 2; auto playerBounds = player.worldSpaceCollisionBox(); - playerBounds.topLeft.x -= offsetToCenter; - + playerBounds.topLeft.x = player.orientedPosition().x - offsetToCenter; return playerBounds; } diff --git a/src/game_logic/player.cpp b/src/game_logic/player.cpp index 35dd484c4..7107cb2c7 100644 --- a/src/game_logic/player.cpp +++ b/src/game_logic/player.cpp @@ -438,7 +438,7 @@ int Player::animationFrame() const { base::Vector Player::orientedPosition() const { - if (stateIs() || !mpOptions->compatibilityModeOn()) { + if (stateIs()) { return position(); } @@ -805,10 +805,7 @@ void Player::updateMovement( if (movementVector.x != 0 && movementVector.x != walkingDirection) { switchOrientation(); - - if (mpOptions->compatibilityModeOn()) { - position.x -= movementVector.x; - } + position.x -= movementVector.x; } } else { setVisualState(VisualState::Standing); @@ -958,10 +955,7 @@ void Player::updateMovement( if (movementVector.x != 0 && movementVector.x != orientationAsMovement) { switchOrientation(); - - if (mpOptions->compatibilityModeOn()) { - position.x -= movementVector.x; - } + position.x -= movementVector.x; } if (mJumpRequested && movement > 0) { From 09f08c911874b9f3c37c166a929267d3a4b469ec Mon Sep 17 00:00:00 2001 From: Nikolai Wuttke Date: Sat, 28 Nov 2020 15:12:23 +0100 Subject: [PATCH 2/3] Hide gameplay style chooser UI --- src/common/user_profile.cpp | 5 +++++ src/ui/options_menu.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/user_profile.cpp b/src/common/user_profile.cpp index 671e63ad4..b3590f6a9 100644 --- a/src/common/user_profile.cpp +++ b/src/common/user_profile.cpp @@ -341,7 +341,12 @@ nlohmann::ordered_json serialize(const data::GameOptions& options) { serialized["quickSaveKeybinding"] = SDL_GetKeyName(options.mQuickSaveKeybinding); serialized["quickLoadKeybinding"] = SDL_GetKeyName(options.mQuickLoadKeybinding); +#if 0 + // NOTE: This is disabled for now, it's not quite ready yet to be made + // user-facing. serialized["compatibilityModeOn"] = options.mCompatibilityModeOn; +#endif + serialized["widescreenModeOn"] = options.mWidescreenModeOn; serialized["quickSavingEnabled"] = options.mQuickSavingEnabled; return serialized; diff --git a/src/ui/options_menu.cpp b/src/ui/options_menu.cpp index 086579ebc..2622c8fbc 100644 --- a/src/ui/options_menu.cpp +++ b/src/ui/options_menu.cpp @@ -272,10 +272,13 @@ void OptionsMenu::updateAndRender(engine::TimeDelta dt) { ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("Gameplay/Enhancements")) + if (ImGui::BeginTabItem("Enhancements")) { ImGui::NewLine(); +#if 0 + // NOTE: This is disabled for now, it's not quite ready yet to be made + // user-facing. const auto canUseCompatibilityMode = !mpOptions->mWidescreenModeOn; withEnabledState(canUseCompatibilityMode, [&]() { @@ -290,6 +293,7 @@ void OptionsMenu::updateAndRender(engine::TimeDelta dt) { mpOptions->mCompatibilityModeOn = gameplayStyleIndex == 0; } }); +#endif ImGui::Checkbox("Widescreen mode", &mpOptions->mWidescreenModeOn); ImGui::Checkbox("Quick saving", &mpOptions->mQuickSavingEnabled); From 64ca10130bccfb2246f42ea44531ed416c7619df Mon Sep 17 00:00:00 2001 From: Nikolai Wuttke Date: Sat, 28 Nov 2020 16:52:12 +0100 Subject: [PATCH 3/3] Prevent quick saving when player is dying --- src/game_logic/game_world.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game_logic/game_world.cpp b/src/game_logic/game_world.cpp index 8727bd5ae..11c797c6b 100644 --- a/src/game_logic/game_world.cpp +++ b/src/game_logic/game_world.cpp @@ -663,7 +663,7 @@ void GameWorld::processEndOfFrameActions() { void GameWorld::quickSave() { - if (!mpOptions->mQuickSavingEnabled) { + if (!mpOptions->mQuickSavingEnabled || mpState->mPlayer.isDead()) { return; }