summaryrefslogtreecommitdiffhomepage
path: root/loader/scenery-atlas.cpp
blob: a11049aea3ecfdc7fae8d16b235bed0d3d5beb9b (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
41
42
43
44
45
46
47
48
49
#include "impl.hpp"
#include "atlas-loader.inl"
#include "scenery-traits.hpp"
#include "scenery-cell.hpp"
#include "src/anim.hpp"
#include "serialize/json-helper.hpp"
#include "serialize/anim.hpp"
#include "serialize/scenery.hpp"
#include "serialize/json-wrapper.hpp"

namespace floormat {

anim_def loader_::deserialize_anim_def(StringView filename) noexcept(false)
{
    return json_helper::from_json<anim_def>(filename);
}

} // namespace floormat

namespace floormat::loader_detail {

template class atlas_loader<struct scenery_proto>;

atlas_loader<struct scenery_proto>* loader_impl::make_scenery_atlas_loader()
{
    return new atlas_loader<struct scenery_proto>;
}

ArrayView<const scenery_cell> loader_impl::scenery_list()
{
    return _scenery_loader->atlas_list();
}

const struct scenery_proto& loader_impl::scenery(StringView name, loader_policy policy)
{
    return *_scenery_loader->get_atlas(name, policy);
}

const scenery_cell& loader_impl::invalid_scenery_atlas()
{
    return _scenery_loader->get_invalid_atlas();
}

struct scenery_proto loader_impl::get_scenery(StringView filename, const scenery_cell& c) noexcept(false)
{
    return *_scenery_loader->make_atlas(filename, c);
}

} // namespace floormat::loader_detail