mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
improve lag because of cc_2x2_white_image
This commit is contained in:
parent
8b9860be5b
commit
9875f5d597
1 changed files with 14 additions and 0 deletions
|
@ -93,4 +93,18 @@ struct FileUtilsUpdatePaths : Modify<FileUtilsUpdatePaths, CCFileUtils> {
|
|||
}
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue