Skip to content

Commit 552638b

Browse files
authored
Merge pull request #3422 from Ghabry/issue-3417
Fix #3417 + small FF cleanup
2 parents 6215395 + aa8e20a commit 552638b

4 files changed

Lines changed: 5 additions & 17 deletions

File tree

src/battle_animation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void BattleAnimation::DrawAt(Bitmap& dst, int x, int y) {
109109
continue;
110110
}
111111

112-
SetX(cell.x + x);
112+
SetX(invert ? x - cell.x : cell.x + x);
113113
SetY(cell.y + y);
114114
int sx = cell.cell_id % 5;
115115
int sy = cell.cell_id / 5;

src/player.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ namespace Player {
132132
std::string replay_input_path;
133133
std::string record_input_path;
134134
std::string command_line;
135-
int speed_modifier_a;
136-
int speed_modifier_b;
137135
int rng_seed = -1;
138136
Game_ConfigPlayer player_config;
139137
Game_ConfigGame game_config;
@@ -204,8 +202,6 @@ void Player::Init(std::vector<std::string> args) {
204202
Input::AddRecordingData(Input::RecordingData::CommandLine, command_line);
205203

206204
player_config = std::move(cfg.player);
207-
speed_modifier_a = cfg.input.speed_modifier_a.Get();
208-
speed_modifier_b = cfg.input.speed_modifier_b.Get();
209205

210206
last_auto_screenshot = Game_Clock::now();
211207
}
@@ -326,10 +322,10 @@ void Player::UpdateInput() {
326322
}
327323
float speed = 1.0;
328324
if (Input::IsSystemPressed(Input::FAST_FORWARD_A)) {
329-
speed = speed_modifier_a;
325+
speed = Input::GetInputSource()->GetConfig().speed_modifier_a.Get();
330326
}
331327
if (Input::IsSystemPressed(Input::FAST_FORWARD_B)) {
332-
speed = speed_modifier_b;
328+
speed = Input::GetInputSource()->GetConfig().speed_modifier_b.Get();
333329
}
334330
Game_Clock::SetGameSpeedFactor(speed);
335331

src/player.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,6 @@ namespace Player {
424424
/** Translation manager, including list of languages and current translation. */
425425
extern Translation translation;
426426

427-
/**
428-
* The default speed modifier applied when the speed up button is pressed
429-
* Only used for configuring the speedup, don't read this var directly use
430-
* GetSpeedModifier() instead.
431-
*/
432-
extern int speed_modifier_a;
433-
extern int speed_modifier_b;
434-
435427
/**
436428
* The engine game logic configuration
437429
*/

src/window_settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ void Window_Settings::RefreshInput() {
628628
AddOption(cfg.gamepad_swap_ab_and_xy, [&cfg](){ cfg.gamepad_swap_ab_and_xy.Toggle(); Input::ResetTriggerKeys(); });
629629
AddOption(cfg.gamepad_swap_analog, [&cfg](){ cfg.gamepad_swap_analog.Toggle(); Input::ResetTriggerKeys(); });
630630
AddOption(cfg.gamepad_swap_dpad_with_buttons, [&cfg](){ cfg.gamepad_swap_dpad_with_buttons.Toggle(); Input::ResetTriggerKeys(); });
631-
AddOption(cfg.speed_modifier_a, [this, &cfg](){ auto tmp = GetCurrentOption().current_value; Player::speed_modifier_a = tmp; cfg.speed_modifier_a.Set(tmp); });
632-
AddOption(cfg.speed_modifier_b, [this, &cfg](){ auto tmp = GetCurrentOption().current_value; Player::speed_modifier_b = tmp; cfg.speed_modifier_b.Set(tmp); });
631+
AddOption(cfg.speed_modifier_a, [this, &cfg](){ cfg.speed_modifier_a.Set(GetCurrentOption().current_value); });
632+
AddOption(cfg.speed_modifier_b, [this, &cfg](){ cfg.speed_modifier_b.Set(GetCurrentOption().current_value); });
633633
}
634634

635635
void Window_Settings::RefreshButtonCategory() {

0 commit comments

Comments
 (0)