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

Method Lookup

src/filefinder_rtp.cpp:309–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309Filesystem_Stream::InputStream FileFinder_RTP::Lookup(std::string_view dir, std::string_view name, const Span<const std::string_view> exts) const {
310 if (!disable_rtp) {
311 bool is_rtp_asset;
312 auto is = LookupInternal(lcf::ReaderUtil::Normalize(dir), lcf::ReaderUtil::Normalize(name), exts, is_rtp_asset);
313
314 std::string lcase = lcf::ReaderUtil::Normalize(dir);
315 bool is_audio_asset = lcase == "music" || lcase == "sound";
316
317 if (is_rtp_asset) {
318 if (is && game_has_full_package_flag && !warning_broken_rtp_game_shown && !is_audio_asset) {
319 warning_broken_rtp_game_shown = true;
320 Output::Warning("This game claims it does not need the RTP, but actually uses files from it!");
321 } else if (!is && !game_has_full_package_flag && !is_audio_asset) {
322 std::string msg = "Cannot find: {}/{}. " +
323 std::string(search_paths.empty() ?
324 "Install RTP {} to resolve this warning." : "RTP {} was probably not installed correctly.");
325 Output::Warning(msg, dir, name, Player::EngineVersion());
326 }
327 }
328 return is;
329 }
330
331 return Filesystem_Stream::InputStream();
332}

Callers 1

open_genericFunction · 0.80

Calls 2

InputStreamClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected