1 #ifndef CORE_RESOURCES_LOADERS_HPP
2 #define CORE_RESOURCES_LOADERS_HPP
4 #include <BLIB/Resources.hpp>
28 template<
typename T, Mode mode>
30 using Ref =
typename bl::resource::Ref<T>;
32 virtual bool load(
const std::string& path,
const char* buffer, std::size_t len, std::istream&,
34 if constexpr (mode ==
Dev) {
36 if (path ==
"Resources/Maps/Maps/WorldMap.map") {
37 bl::serial::MemoryInputBuffer wrapper(buffer, len);
38 bl::serial::binary::InputStream is(wrapper);
39 if (!result.loadProd(is)) {
40 BL_LOG_ERROR <<
"Failed to load resource: " << path;
45 bl::util::BufferIstreamBuf buf(
const_cast<char*
>(buffer), len);
46 std::istream is(&buf);
47 if (!result.loadDev(is)) {
48 BL_LOG_ERROR <<
"Failed to load resource: " << path;
54 bl::serial::MemoryInputBuffer wrapper(buffer, len);
55 bl::serial::binary::InputStream is(wrapper);
56 if (!result.loadProd(is)) {
57 BL_LOG_ERROR <<
"Failed to load resource: " << path;
Core classes and functionality for both the editor and game.
Generic resource loader for conforming Peoplemon resource types. Resource types must be default const...
typename bl::resource::Ref< T > Ref
virtual bool load(const std::string &path, const char *buffer, std::size_t len, std::istream &, T &result) override