mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 08:07:17 +07:00
initialize assets cache from starter
This commit is contained in:
@@ -19,6 +19,7 @@ namespace e2d
|
||||
class binary_asset;
|
||||
class shader_asset;
|
||||
class texture_asset;
|
||||
class material_asset;
|
||||
|
||||
template < typename T >
|
||||
class asset_cache;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <enduro2d/high/starter.hpp>
|
||||
|
||||
#include <enduro2d/high/assets.hpp>
|
||||
#include <enduro2d/high/library.hpp>
|
||||
|
||||
namespace
|
||||
@@ -61,7 +62,16 @@ namespace e2d
|
||||
|
||||
starter::starter(int argc, char *argv[], const parameters& params) {
|
||||
safe_module_initialize<engine>(argc, argv, params.engine_params());
|
||||
|
||||
safe_module_initialize<library>(params.library_root());
|
||||
|
||||
safe_module_initialize<asset_cache<text_asset>>(the<library>());
|
||||
safe_module_initialize<asset_cache<mesh_asset>>(the<library>());
|
||||
safe_module_initialize<asset_cache<image_asset>>(the<library>());
|
||||
safe_module_initialize<asset_cache<binary_asset>>(the<library>());
|
||||
safe_module_initialize<asset_cache<shader_asset>>(the<library>());
|
||||
safe_module_initialize<asset_cache<texture_asset>>(the<library>());
|
||||
safe_module_initialize<asset_cache<material_asset>>(the<library>());
|
||||
}
|
||||
|
||||
starter::~starter() noexcept = default;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
|
||||
#include <assimp/Importer.hpp>
|
||||
@@ -130,7 +131,7 @@ namespace
|
||||
return data_size;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
bool validate_mesh(const mesh& mesh) noexcept {
|
||||
if ( mesh.vertices.empty() ) {
|
||||
|
||||
Reference in New Issue
Block a user