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

Method LoadLogos

src/scene_logo.cpp:212–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212std::vector<std::vector<uint8_t>> Scene_Logo::LoadLogos() {
213 if (Player::player_config.show_startup_logos.Get() == ConfigEnum::StartupLogos::None) {
214 return {};
215 }
216
217 std::vector<std::vector<uint8_t>> logos;
218
219 for (int i = 1; i < 100; ++i) {
220 auto is = FileFinder::OpenImage("Logo", "LOGO" + std::to_string(i));
221 if (is) {
222 logos.push_back(Utils::ReadStream(is));
223 } else {
224 break;
225 }
226 }
227
228#ifndef EMSCRIPTEN
229 if (logos.empty()) {
230 // Attempt reading Logos from RPG_RT.exe (not supported on Emscripten)
231 auto exeis = FileFinder::Game().OpenFile(EXE_NAME);
232
233 if (exeis) {
234 std::unique_ptr<EXEReader> exe_reader = std::make_unique<EXEReader>(std::move(exeis));
235 logos = exe_reader->GetLogos();
236 }
237 }
238#endif
239
240 return logos;
241}
242
243void Scene_Logo::OnIndexReady(FileRequestResult*) {
244 async_ready = true;

Callers

nothing calls this directly

Calls 5

GameClass · 0.85
OpenFileMethod · 0.80
GetLogosMethod · 0.80
GetMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected