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