]> git.localhorst.tv Git - blobs.git/blob - src/app/Assets.hpp
5f971c689ddba201d7cbc700a6b1c1e79c975692
[blobs.git] / src / app / Assets.hpp
1 #ifndef BLOBS_APP_ASSETS_HPP_
2 #define BLOBS_APP_ASSETS_HPP_
3
4 #include "../graphics/AlphaSprite.hpp"
5 #include "../graphics/ArrayTexture.hpp"
6 #include "../graphics/Canvas.hpp"
7 #include "../graphics/CreatureSkin.hpp"
8 #include "../graphics/Font.hpp"
9 #include "../graphics/PlanetSurface.hpp"
10 #include "../graphics/SunSurface.hpp"
11 #include "../math/GaloisLFSR.hpp"
12 #include "../world/Resource.hpp"
13 #include "../world/Set.hpp"
14 #include "../world/TileType.hpp"
15
16 #include <string>
17
18
19 namespace blobs {
20 namespace io {
21         class TokenStreamReader;
22 }
23 namespace app {
24
25 struct Assets {
26
27         std::string path;
28         std::string data_path;
29         std::string font_path;
30         std::string skin_path;
31         std::string tile_path;
32
33         math::GaloisLFSR random;
34
35         struct {
36                 world::Set<world::Resource> resources;
37                 world::Set<world::TileType> tile_types;
38         } data;
39
40         struct {
41                 graphics::Font large;
42                 graphics::Font medium;
43                 graphics::Font small;
44         } fonts;
45
46         struct {
47                 graphics::ArrayTexture tiles;
48                 graphics::ArrayTexture skins;
49         } textures;
50
51         struct {
52                 graphics::AlphaSprite alpha_sprite;
53                 graphics::Canvas canvas;
54                 graphics::PlanetSurface planet_surface;
55                 graphics::SunSurface sun_surface;
56                 graphics::CreatureSkin creature_skin;
57         } shaders;
58
59         Assets();
60         ~Assets();
61
62         Assets(const Assets &) = delete;
63         Assets &operator =(const Assets &) = delete;
64
65         Assets(Assets &&) = delete;
66         Assets &operator =(Assets &&) = delete;
67
68         void ReadResources(io::TokenStreamReader &);
69         void ReadTileTypes(io::TokenStreamReader &);
70
71         void LoadTileTexture(const std::string &name, graphics::ArrayTexture &, int layer) const;
72         void LoadSkinTexture(const std::string &name, graphics::ArrayTexture &, int layer) const;
73
74 };
75
76 }
77 }
78
79 #endif