summaryrefslogtreecommitdiffhomepage
path: root/loader/ground-atlas.cpp
blob: d46b0dfc64e92f37f02d2449908c910736d5e5f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "impl.hpp"
#include "atlas-loader.inl"
#include "ground-traits.hpp"
#include "ground-cell.hpp"
#include <Magnum/Math/Vector2.h>

namespace floormat::loader_detail {

template class atlas_loader<ground_atlas>;

std::shared_ptr<ground_atlas>
loader_impl::get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false)
{
    return _ground_loader->make_atlas(name, {
        .atlas = {}, .name = {}, .size = size, .pass = pass,
    });
}

atlas_loader<class ground_atlas>* loader_impl::make_ground_atlas_loader()
{
    return new atlas_loader<class ground_atlas>;
}

auto loader_impl::ground_atlas_list() noexcept(false) -> ArrayView<const ground_cell>
{
    return _ground_loader->atlas_list();
}

const ground_cell& loader_impl::invalid_ground_atlas()
{
    return _ground_loader->get_invalid_atlas();
}

const std::shared_ptr<class ground_atlas>&
loader_impl::ground_atlas(StringView filename, loader_policy policy) noexcept(false)
{
    return _ground_loader->get_atlas(filename, policy);
}

} // namespace floormat::loader_detail