|
17 | 17 | #include <spdlog/spdlog.h> |
18 | 18 |
|
19 | 19 | #include "app.hpp" |
| 20 | +#include "assets/builder.hpp" |
20 | 21 | #include "assets/sounds.hpp" |
21 | 22 | #include "assets/textures.hpp" |
22 | 23 | #include "core/backend.hpp" |
|
32 | 33 | #include "generated.hpp" |
33 | 34 | #include "settings.hpp" |
34 | 35 |
|
35 | | -// Embedded road textures |
36 | | -#include "assets/data/textures/road/road_sand01.hpp" |
37 | | -#include "assets/data/textures/road/road_sand35.hpp" |
38 | | -#include "assets/data/textures/road/road_sand37.hpp" |
39 | | -#include "assets/data/textures/road/road_sand39.hpp" |
40 | | -#include "assets/data/textures/road/road_sand87.hpp" |
41 | | -#include "assets/data/textures/road/road_sand88.hpp" |
42 | | -#include "assets/data/textures/road/road_sand89.hpp" |
43 | | - |
44 | | -// Embedded car textures |
45 | | -#include "assets/data/textures/car/car_black_1.hpp" |
46 | | -#include "assets/data/textures/car/car_blue_1.hpp" |
47 | | -#include "assets/data/textures/car/car_green_1.hpp" |
48 | | -#include "assets/data/textures/car/car_red_1.hpp" |
49 | | -#include "assets/data/textures/car/car_yellow_1.hpp" |
50 | | - |
51 | | -// Embedded sounds |
52 | | -#include "assets/data/sounds/car/engine.hpp" |
53 | | -#include "assets/data/sounds/car/hit.hpp" |
54 | | -#include "assets/data/sounds/car/tires.hpp" |
55 | | -#include "assets/data/sounds/ui/ok.hpp" |
56 | | -#include "assets/data/sounds/ui/other.hpp" |
57 | | - |
58 | 36 | namespace app { |
59 | 37 |
|
60 | 38 | void run() |
@@ -91,39 +69,11 @@ void run() |
91 | 69 |
|
92 | 70 | // Setup texture manager and load textures |
93 | 71 | // Note: This cannot be "static", because the destructor for static objects is called after "main()" has finished |
94 | | - assets::textures::TextureManager textures; |
95 | | - for (const auto &[identifier, data, size] : { |
96 | | - // Road textures |
97 | | - std::tuple{"top_left", road_sand89::data, road_sand89::size}, |
98 | | - std::tuple{"top_right", road_sand01::data, road_sand01::size}, |
99 | | - std::tuple{"bottom_right", road_sand37::data, road_sand37::size}, |
100 | | - std::tuple{"bottom_left", road_sand35::data, road_sand35::size}, |
101 | | - std::tuple{"vertical", road_sand87::data, road_sand87::size}, |
102 | | - std::tuple{"horizontal", road_sand88::data, road_sand88::size}, |
103 | | - std::tuple{"horizontal_finish", road_sand39::data, road_sand39::size}, |
104 | | - // Car textures |
105 | | - std::tuple{"car_black", car_black_1::data, car_black_1::size}, |
106 | | - std::tuple{"car_blue", car_blue_1::data, car_blue_1::size}, |
107 | | - std::tuple{"car_green", car_green_1::data, car_green_1::size}, |
108 | | - std::tuple{"car_red", car_red_1::data, car_red_1::size}, |
109 | | - std::tuple{"car_yellow", car_yellow_1::data, car_yellow_1::size}, |
110 | | - }) { |
111 | | - textures.load(identifier, {data, size}); |
112 | | - } |
| 72 | + assets::textures::TextureManager textures = assets::builder::build_texture_manager(); |
113 | 73 |
|
114 | 74 | // Setup sound manager and load sounds |
115 | 75 | // Note: This cannot be "static", because the destructor for static objects is called after "main()" has finished |
116 | | - assets::sounds::SoundManager sounds; |
117 | | - for (const auto &[identifier, data, size] : { |
118 | | - // Car sounds |
119 | | - std::tuple{"engine", engine::data, engine::size}, |
120 | | - std::tuple{"tires", tires::data, tires::size}, |
121 | | - std::tuple{"hit", hit::data, hit::size}, |
122 | | - std::tuple{"ok", ok::data, ok::size}, |
123 | | - std::tuple{"other", other::data, other::size}, |
124 | | - }) { |
125 | | - sounds.load(identifier, {data, size}); |
126 | | - } |
| 76 | + assets::sounds::SoundManager sounds = assets::builder::build_sound_manager(); |
127 | 77 |
|
128 | 78 | // Create race track |
129 | 79 | core::world::Track race_track( |
|
0 commit comments