Skip to content

Commit

Permalink
Merge pull request #612 from lethal-guitar/prep-for-release
Browse files Browse the repository at this point in the history
Prep for release
  • Loading branch information
lethal-guitar authored Nov 28, 2020
2 parents c8502ba + 64ca101 commit c017d6a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
5 changes: 5 additions & 0 deletions src/common/user_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/game_logic/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -111,8 +111,7 @@ base::Rect<int> normalizedPlayerBounds(
const auto offsetToCenter = extraTiles / 2;

auto playerBounds = player.worldSpaceCollisionBox();
playerBounds.topLeft.x -= offsetToCenter;

playerBounds.topLeft.x = player.orientedPosition().x - offsetToCenter;
return playerBounds;
}

Expand Down
2 changes: 1 addition & 1 deletion src/game_logic/game_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ void GameWorld::processEndOfFrameActions() {


void GameWorld::quickSave() {
if (!mpOptions->mQuickSavingEnabled) {
if (!mpOptions->mQuickSavingEnabled || mpState->mPlayer.isDead()) {
return;
}

Expand Down
12 changes: 3 additions & 9 deletions src/game_logic/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ int Player::animationFrame() const {


base::Vector Player::orientedPosition() const {
if (stateIs<InShip>() || !mpOptions->compatibilityModeOn()) {
if (stateIs<InShip>()) {
return position();
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion src/ui/options_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, [&]() {
Expand All @@ -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);
Expand Down

0 comments on commit c017d6a

Please sign in to comment.