summaryrefslogtreecommitdiffstats
path: root/main/main.cpp
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2018-06-11 02:59:53 +0200
committerMarc Gilleron <marc.gilleron@gmail.com>2018-12-15 05:34:53 +0000
commit065e2670af53ae2f71b78d57f8a217b4539cbbe2 (patch)
treea6b802b74f6f7ebd2018b5a3d35061bdcb91eb9d /main/main.cpp
parentca28c455bfdc8408485c217c17f07011c0b43f64 (diff)
downloadredot-engine-065e2670af53ae2f71b78d57f8a217b4539cbbe2.tar.gz
Added basic support for custom resource savers and loaders
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index db23a6c214..fd9054bf93 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1230,6 +1230,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
register_driver_types();
+ // This loads global classes, so it must happen before custom loaders and savers are registered
ScriptServer::init_languages();
MAIN_PRINT("Main: Load Translations");
@@ -1489,6 +1490,9 @@ bool Main::start() {
}
#endif
+ ResourceLoader::add_custom_loaders();
+ ResourceSaver::add_custom_savers();
+
if (!project_manager && !editor) { // game
if (game_path != "" || script != "") {
//autoload
@@ -1956,11 +1960,13 @@ void Main::force_redraw() {
* so that the engine closes cleanly without leaking memory or crashing.
* The order matters as some of those steps are linked with each other.
*/
-
void Main::cleanup() {
ERR_FAIL_COND(!_start_success);
+ ResourceLoader::remove_custom_loaders();
+ ResourceSaver::remove_custom_savers();
+
message_queue->flush();
memdelete(message_queue);