Dummy texture importer

Added a dummy importer for textures to use with the server platform.
Allows for running a project in headless mode without crashing when loading scenes containing textured objects
Also as a result decreases load time as no image files have to be loaded.
This commit is contained in:
Gustav Lund
2018-05-07 14:56:47 +02:00
parent cfd950382f
commit 3dcf338ebb
4 changed files with 143 additions and 0 deletions
+6
View File
@@ -30,6 +30,7 @@
#include "os_server.h"
#include "drivers/dummy/audio_driver_dummy.h"
#include "drivers/dummy/rasterizer_dummy.h"
#include "drivers/dummy/texture_loader_dummy.h"
#include "print_string.h"
#include "servers/visual/visual_server_raster.h"
#include <stdio.h>
@@ -83,6 +84,9 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int
_ensure_user_data_dir();
resource_loader_dummy = memnew(ResourceFormatDummyTexture);
ResourceLoader::add_resource_format_loader(resource_loader_dummy);
return OK;
}
@@ -99,6 +103,8 @@ void OS_Server::finalize() {
memdelete(power_manager);
memdelete(resource_loader_dummy);
args.clear();
}