test models hot-reload

This commit is contained in:
MihailRis 2026-08-31 01:18:35 +03:00
parent 395dc15fb6
commit 22c0f5b9d2
3 changed files with 24 additions and 4 deletions

View file

@ -208,7 +208,9 @@ void SkeletonConfig::render(
model,
&skeleton.textures
);
}
} else if (!node->model.name.empty()) {
node->model.updateFlag = true;
}
}
}

View file

@ -1,9 +1,13 @@
#include "DebuggingServer.hpp"
#include "engine/Engine.hpp"
#include "network/Network.hpp"
#include "debug/Logger.hpp"
#include "assets/AssetsLoader.hpp"
#include "coders/json.hpp"
#include "data/dv.hpp"
#include "debug/Logger.hpp"
#include "engine/AssetsManagement.hpp"
#include "engine/Engine.hpp"
#include "io/path.hpp"
#include "network/Network.hpp"
using namespace devtools;
@ -260,6 +264,16 @@ bool DebuggingServer::performCommand(
}
});
return true;
} else if (type == "hot-reload") {
if (!map.has("file")) {
return false;
}
logger.info() << "hot-reload: " << map["file"].asString();
int count = engine.getAssetsManagement().acquireBackgroundLoader().addReload(
map["file"].asString()
);
logger.info() << "enqueued to reload: " << count;
return false;
} else {
logger.error() << "unsupported command '" << type << "'";
}

View file

@ -190,5 +190,9 @@ public:
return *appScripts;
}
AssetsManagement& getAssetsManagement() const {
return *assets;
}
void detachDebugger();
};