MCPcopy Create free account
hub / github.com/EasyRPG/Player / Init

Method Init

src/input.cpp:62–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60void Input::WaitInput(bool v) { wait_input = v; }
61
62void Input::Init(
63 Game_ConfigInput cfg,
64 const std::string& replay_from_path,
65 const std::string& record_to_path
66) {
67 std::fill(press_time.begin(), press_time.end(), 0);
68 triggered.reset();
69 repeated.reset();
70 released.reset();
71 raw_triggered.reset();
72 raw_pressed.reset();
73 raw_released.reset();
74
75 DirectionMappingArray directions = {
76 { Direction::DOWN, DOWN },
77 { Direction::LEFT, LEFT },
78 { Direction::RIGHT, RIGHT },
79 { Direction::UP, UP }
80 };
81
82 cfg.Hide();
83 Input::GetSupportedConfig(cfg);
84
85 source = Source::Create(cfg, std::move(directions), replay_from_path);
86 source->InitRecording(record_to_path);
87
88 ResetMask();
89}
90
91static void UpdateButton(int i, bool pressed) {
92 using namespace Input;

Callers

nothing calls this directly

Calls 5

HideMethod · 0.80
InitRecordingMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected