mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-24 03:39:56 -04:00
small changes
- hook loadAssets instead loadFinished for target scene in geode::cocos::reloadTextures - add virtual destructor to BasicEventHandler that unlistens the handler
This commit is contained in:
parent
6059a15dff
commit
ffc9287a61
3 changed files with 13 additions and 1 deletions
|
@ -17,6 +17,8 @@ namespace geode {
|
|||
struct GEODE_DLL BasicEventHandler {
|
||||
virtual PassThrough passThrough(Event*) = 0;
|
||||
|
||||
virtual ~BasicEventHandler();
|
||||
|
||||
void listen();
|
||||
void unlisten();
|
||||
};
|
||||
|
|
|
@ -13,6 +13,10 @@ void BasicEventHandler::unlisten() {
|
|||
Event::s_handlers.erase(this);
|
||||
}
|
||||
|
||||
BasicEventHandler::~BasicEventHandler() {
|
||||
this->unlisten();
|
||||
}
|
||||
|
||||
Event::~Event() {}
|
||||
|
||||
void Event::postFrom(Mod* m) {
|
||||
|
|
|
@ -118,7 +118,13 @@ void geode::cocos::reloadTextures(CreateLayerFunc returnTo) {
|
|||
}
|
||||
|
||||
class $modify(LoadingLayer) {
|
||||
void loadingFinished() {
|
||||
void loadAssets() {
|
||||
// loadFinished is inlined on Macchew OS :sob:
|
||||
|
||||
if (m_loadStep < 14) {
|
||||
return LoadingLayer::loadAssets();
|
||||
}
|
||||
|
||||
// Default behaviour
|
||||
if (!LOADING_FINISHED_SCENE) {
|
||||
return LoadingLayer::loadingFinished();
|
||||
|
|
Loading…
Add table
Reference in a new issue