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