Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::asset_reader Namespace Reference

Namespaces

namespace  detail
 

Functions

auto resolve_compiled_key (const std::string &key) -> std::string
 
auto resolve_compiled_path (const std::string &key) -> fs::path
 
auto resolve_compiled_asset_path (const std::string &key, const std::string &source_extension) -> fs::path
 
auto resolve_path (const std::string &key) -> fs::path
 
void log_missing_compiled_asset_for_key (const std::string &key)
 
void log_missing_raw_asset_for_key (const std::string &key)
 
void log_unknown_protocol_for_key (const std::string &key)
 
auto validate (const std::string &key, const std::string &compiled_ext, std::string &out) -> bool
 
template<>
auto load_from_file< gfx::texture > (tpp::thread_pool &pool, asset_handle< gfx::texture > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< gfx::shader > (tpp::thread_pool &pool, asset_handle< gfx::shader > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< material > (tpp::thread_pool &pool, asset_handle< material > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< mesh > (tpp::thread_pool &pool, asset_handle< mesh > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< animation_clip > (tpp::thread_pool &pool, asset_handle< animation_clip > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< prefab > (tpp::thread_pool &pool, asset_handle< prefab > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< scene_prefab > (tpp::thread_pool &pool, asset_handle< scene_prefab > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< physics_material > (tpp::thread_pool &pool, asset_handle< physics_material > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< audio_clip > (tpp::thread_pool &pool, asset_handle< audio_clip > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< font > (tpp::thread_pool &pool, asset_handle< font > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< script > (tpp::thread_pool &pool, asset_handle< script > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< ui_tree > (tpp::thread_pool &pool, asset_handle< ui_tree > &output, const std::string &key, load_mode mode) -> bool
 
template<>
auto load_from_file< style_sheet > (tpp::thread_pool &pool, asset_handle< style_sheet > &output, const std::string &key, load_mode mode) -> bool
 
template<typename T >
auto resolve_compiled_path (const std::string &key) -> fs::path
 
template<typename T >
auto load_from_file (tpp::thread_pool &pool, asset_handle< T > &output, const std::string &key, load_mode mode=load_mode::immediate) -> bool
 
 DECLARE_LOADER_SPEC (gfx::shader)
 
 DECLARE_LOADER_SPEC (gfx::texture)
 
 DECLARE_LOADER_SPEC (material)
 
 DECLARE_LOADER_SPEC (mesh)
 
 DECLARE_LOADER_SPEC (animation_clip)
 
 DECLARE_LOADER_SPEC (prefab)
 
 DECLARE_LOADER_SPEC (scene_prefab)
 
 DECLARE_LOADER_SPEC (physics_material)
 
 DECLARE_LOADER_SPEC (audio_clip)
 
 DECLARE_LOADER_SPEC (font)
 
 DECLARE_LOADER_SPEC (script)
 
 DECLARE_LOADER_SPEC (ui_tree)
 
 DECLARE_LOADER_SPEC (style_sheet)
 
template<typename T >
auto get_job_name () -> std::string
 
template<typename T >
auto load_from_instance (tpp::thread_pool &pool, asset_handle< T > &output, std::shared_ptr< T > instance) -> bool
 

Function Documentation

◆ DECLARE_LOADER_SPEC() [1/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( animation_clip )

◆ DECLARE_LOADER_SPEC() [2/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( audio_clip )

◆ DECLARE_LOADER_SPEC() [3/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( font )

◆ DECLARE_LOADER_SPEC() [4/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( gfx::shader )

◆ DECLARE_LOADER_SPEC() [5/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( gfx::texture )

◆ DECLARE_LOADER_SPEC() [6/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( material )

◆ DECLARE_LOADER_SPEC() [7/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( mesh )

◆ DECLARE_LOADER_SPEC() [8/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( physics_material )

◆ DECLARE_LOADER_SPEC() [9/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( prefab )

◆ DECLARE_LOADER_SPEC() [10/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( scene_prefab )

◆ DECLARE_LOADER_SPEC() [11/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( script )

◆ DECLARE_LOADER_SPEC() [12/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( style_sheet )

◆ DECLARE_LOADER_SPEC() [13/13]

unravel::asset_reader::DECLARE_LOADER_SPEC ( ui_tree )

◆ get_job_name()

template<typename T >
auto unravel::asset_reader::get_job_name ( ) -> std::string
inline

Definition at line 86 of file asset_reader.h.

◆ load_from_file()

template<typename T >
auto unravel::asset_reader::load_from_file ( tpp::thread_pool & pool,
asset_handle< T > & output,
const std::string & key,
load_mode mode = load_mode::immediate ) -> bool

◆ load_from_file< animation_clip >()

template<>
auto unravel::asset_reader::load_from_file< animation_clip > ( tpp::thread_pool & pool,
asset_handle< animation_clip > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 220 of file asset_reader.cpp.

◆ load_from_file< audio_clip >()

template<>
auto unravel::asset_reader::load_from_file< audio_clip > ( tpp::thread_pool & pool,
asset_handle< audio_clip > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 274 of file asset_reader.cpp.

◆ load_from_file< font >()

template<>
auto unravel::asset_reader::load_from_file< font > ( tpp::thread_pool & pool,
asset_handle< font > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 294 of file asset_reader.cpp.

◆ load_from_file< gfx::shader >()

template<>
auto unravel::asset_reader::load_from_file< gfx::shader > ( tpp::thread_pool & pool,
asset_handle< gfx::shader > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 179 of file asset_reader.cpp.

◆ load_from_file< gfx::texture >()

template<>
auto unravel::asset_reader::load_from_file< gfx::texture > ( tpp::thread_pool & pool,
asset_handle< gfx::texture > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 168 of file asset_reader.cpp.

◆ load_from_file< material >()

template<>
auto unravel::asset_reader::load_from_file< material > ( tpp::thread_pool & pool,
asset_handle< material > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 191 of file asset_reader.cpp.

◆ load_from_file< mesh >()

template<>
auto unravel::asset_reader::load_from_file< mesh > ( tpp::thread_pool & pool,
asset_handle< mesh > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 204 of file asset_reader.cpp.

◆ load_from_file< physics_material >()

template<>
auto unravel::asset_reader::load_from_file< physics_material > ( tpp::thread_pool & pool,
asset_handle< physics_material > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 261 of file asset_reader.cpp.

◆ load_from_file< prefab >()

template<>
auto unravel::asset_reader::load_from_file< prefab > ( tpp::thread_pool & pool,
asset_handle< prefab > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 233 of file asset_reader.cpp.

◆ load_from_file< scene_prefab >()

template<>
auto unravel::asset_reader::load_from_file< scene_prefab > ( tpp::thread_pool & pool,
asset_handle< scene_prefab > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 247 of file asset_reader.cpp.

◆ load_from_file< script >()

template<>
auto unravel::asset_reader::load_from_file< script > ( tpp::thread_pool & pool,
asset_handle< script > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 312 of file asset_reader.cpp.

◆ load_from_file< style_sheet >()

template<>
auto unravel::asset_reader::load_from_file< style_sheet > ( tpp::thread_pool & pool,
asset_handle< style_sheet > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 338 of file asset_reader.cpp.

◆ load_from_file< ui_tree >()

template<>
auto unravel::asset_reader::load_from_file< ui_tree > ( tpp::thread_pool & pool,
asset_handle< ui_tree > & output,
const std::string & key,
load_mode mode ) -> bool

Definition at line 325 of file asset_reader.cpp.

◆ load_from_instance()

template<typename T >
auto unravel::asset_reader::load_from_instance ( tpp::thread_pool & pool,
asset_handle< T > & output,
std::shared_ptr< T > instance ) -> bool
inline

Definition at line 92 of file asset_reader.h.

◆ log_missing_compiled_asset_for_key()

void unravel::asset_reader::log_missing_compiled_asset_for_key ( const std::string & key)

Definition at line 85 of file asset_reader.cpp.

◆ log_missing_raw_asset_for_key()

void unravel::asset_reader::log_missing_raw_asset_for_key ( const std::string & key)

Definition at line 92 of file asset_reader.cpp.

◆ log_unknown_protocol_for_key()

void unravel::asset_reader::log_unknown_protocol_for_key ( const std::string & key)

Definition at line 97 of file asset_reader.cpp.

◆ resolve_compiled_asset_path()

auto unravel::asset_reader::resolve_compiled_asset_path ( const std::string & key,
const std::string & source_extension ) -> fs::path

Resolves the cooked artifact path for a source asset identified by key and source_extension. Returns an empty path when the extension is not a known importable source format.

Definition at line 40 of file asset_reader.cpp.

◆ resolve_compiled_key()

auto unravel::asset_reader::resolve_compiled_key ( const std::string & key) -> std::string

Definition at line 29 of file asset_reader.cpp.

◆ resolve_compiled_path() [1/2]

auto unravel::asset_reader::resolve_compiled_path ( const std::string & key) -> fs::path

Definition at line 34 of file asset_reader.cpp.

◆ resolve_compiled_path() [2/2]

template<typename T >
auto unravel::asset_reader::resolve_compiled_path ( const std::string & key) -> fs::path
inline

Resolves the on-disk path of the cooked artifact for key, appending any type-specific compiled suffix (e.g. the active renderer extension for shaders).

Definition at line 53 of file asset_reader.h.

◆ resolve_path()

auto unravel::asset_reader::resolve_path ( const std::string & key) -> fs::path

Definition at line 80 of file asset_reader.cpp.

◆ validate()

auto unravel::asset_reader::validate ( const std::string & key,
const std::string & compiled_ext,
std::string & out ) -> bool

Definition at line 102 of file asset_reader.cpp.