diff --git a/loader/src/cocos2d-ext/CCFileUtils.cpp b/loader/src/cocos2d-ext/CCFileUtils.cpp index ba4c6f49..67796df9 100644 --- a/loader/src/cocos2d-ext/CCFileUtils.cpp +++ b/loader/src/cocos2d-ext/CCFileUtils.cpp @@ -93,4 +93,18 @@ struct FileUtilsUpdatePaths : Modify { } return ret; } + + gd::string fullPathForFilename(const char* filename, bool unk) override { + using namespace std::string_literals; + using namespace std::string_view_literals; + + // this filename in particular is never cached because its not actually present anywhere. + // this is only an issue because cocos itself requests the full path for this in CCSprite, + // and with a lot of search paths (specially ones added by geode), this can cause a significant amount of lag. + if (filename == "cc_2x2_white_image"sv) { + return "cc_2x2_white_image"s; + } + + return CCFileUtils::fullPathForFilename(filename, unk); + } };