| 83 | } |
| 84 | |
| 85 | Input::LogSource::LogSource(const char* log_path, const Game_ConfigInput& cfg, DirectionMappingArray directions) |
| 86 | : Source(cfg, std::move(directions)), |
| 87 | log_file(FileFinder::Root().OpenInputStream(log_path, std::ios::in)) |
| 88 | { |
| 89 | if (!log_file) { |
| 90 | Output::Error("Error reading input logfile {}", log_path); |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | std::string header; |
| 95 | Utils::ReadLine(log_file, header); |
| 96 | if (StartsWith(header, "H EasyRPG")) { |
| 97 | std::string ver; |
| 98 | Utils::ReadLine(log_file, ver); |
| 99 | if (StartsWith(ver, "V 2")) { |
| 100 | version = 2; |
| 101 | } else { |
| 102 | Output::Error("Unsupported logfile version {}", ver); |
| 103 | } |
| 104 | } else { |
| 105 | Output::Debug("Using legacy inputlog format"); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | void Input::LogSource::Update() { |
| 110 | if (version == 2) { |
nothing calls this directly
no test coverage detected