1 #ifndef BLOBS_APP_ASSETS_HPP_
2 #define BLOBS_APP_ASSETS_HPP_
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"
24 class TokenStreamReader;
37 std::string data_path;
38 std::string font_path;
39 std::string skin_path;
41 std::string tile_path;
43 math::GaloisLFSR random;
45 creature::NameGenerator name;
48 world::Set<world::Resource> resources;
49 world::Set<world::TileType> tile_types;
54 graphics::Font medium;
59 graphics::ArrayTexture tiles;
60 graphics::ArrayTexture skins;
61 graphics::CubeMap sky;
65 graphics::AlphaSprite alpha_sprite;
66 graphics::Canvas canvas;
67 graphics::PlanetSurface planet_surface;
68 graphics::SunSurface sun_surface;
69 graphics::CreatureSkin creature_skin;
70 graphics::SkyBox sky_box;
76 Assets(const Assets &) = delete;
77 Assets &operator =(const Assets &) = delete;
79 Assets(Assets &&) = delete;
80 Assets &operator =(Assets &&) = delete;
82 void ReadResources(io::TokenStreamReader &);
83 void ReadTileTypes(io::TokenStreamReader &);
85 void LoadTileTexture(const std::string &name, graphics::ArrayTexture &, int layer) const;
86 void LoadSkinTexture(const std::string &name, graphics::ArrayTexture &, int layer) const;
87 void LoadSkyTexture(const std::string &name, graphics::CubeMap &) const;
89 void LoadUniverse(const std::string &name, world::Simulation &) const;
90 world::Body *ReadBody(io::TokenStreamReader &, world::Simulation &) const;
91 void ReadBodyProperty(const std::string &name, io::TokenStreamReader &, world::Body &, world::Simulation &) const;
92 void ReadPlanetProperty(const std::string &name, io::TokenStreamReader &, world::Planet &, world::Simulation &) const;
93 void ReadSunProperty(const std::string &name, io::TokenStreamReader &, world::Sun &, world::Simulation &) const;