45 auto& tp = ServiceLocator<BS::thread_pool>::ref();
46 auto& config = ServiceLocator<Config>::ref();
47 auto& nui = ServiceLocator<ui::NuklearUI>::ref();
50 constexpr const nk_size total = 11;
52 tp.detach_task([
this]() ->
void {
56 tp.detach_task([
this]() ->
void {
64 current = total - tp.get_tasks_total();
68 graphics::Renderer::ref().begin_default();
69 graphics::Renderer::ref().clear_active();
72 nui.show_loading_bar(
"Loading Assets...", total, current);
75 graphics::Renderer::ref().end_default();
76 std::this_thread::sleep_for(1ms);
77 }
while (tp.get_tasks_total() > 0);
81 nui.show_building_atlas();
83 graphics::Renderer::ref().begin_default();
84 graphics::Renderer::ref().clear_active();
86 graphics::Renderer::ref().end_default();
93 auto& tp = ServiceLocator<BS::thread_pool>::ref();
95 tp.detach_task([]() ->
void {
96 ServiceLocator<resource::SoundCache>::ref().load_folder(GALAXY_SFX_DIR);
99 tp.detach_task([]() ->
void {
100 ServiceLocator<resource::MusicCache>::ref().load_folder(GALAXY_MUSIC_DIR);
103 tp.detach_task([]() ->
void {
104 ServiceLocator<resource::VoiceCache>::ref().load_folder(GALAXY_VOICE_DIR);
107 tp.detach_task([]() ->
void {
108 ServiceLocator<resource::VideoCache>::ref().load_folder(GALAXY_VIDEO_DIR);
111 tp.detach_task([]() ->
void {
112 ServiceLocator<resource::Animations>::ref().load_folder(GALAXY_ANIM_DIR);
115 tp.detach_task([]() ->
void {
116 ServiceLocator<resource::Shaders>::ref().load_folder(GALAXY_SHADER_DIR);
119 tp.detach_task([]() ->
void {
120 ServiceLocator<resource::Fonts>::ref().load_folder(GALAXY_FONT_DIR);
123 tp.detach_task([]() ->
void {
124 ServiceLocator<resource::Scripts>::ref().load_folder(GALAXY_SCRIPT_DIR);
127 tp.detach_task([]() ->
void {
128 ServiceLocator<resource::Prefabs>::ref().load_folder(GALAXY_PREFABS_DIR);
134 auto& config = core::ServiceLocator<core::Config>::ref();
135 auto& window = core::ServiceLocator<core::Window>::ref();
137 input::CameraKeys::FORWARD = input::int_to_key(config.get<
int>(
"camera_foward",
"input"));
138 input::CameraKeys::BACKWARD = input::int_to_key(config.get<
int>(
"camera_backward",
"input"));
139 input::CameraKeys::LEFT = input::int_to_key(config.get<
int>(
"camera_left",
"input"));
140 input::CameraKeys::RIGHT = input::int_to_key(config.get<
int>(
"camera_right",
"input"));
141 input::CameraKeys::ROTATE_LEFT = input::int_to_key(config.get<
int>(
"camera_rotate_left",
"input"));
142 input::CameraKeys::ROTATE_RIGHT = input::int_to_key(config.get<
int>(
"camera_rotate_right",
"input"));
144 auto& se = core::ServiceLocator<media::SoundEngine>::ref();
145 auto& me = core::ServiceLocator<media::MusicEngine>::ref();
146 auto& de = core::ServiceLocator<media::VoiceEngine>::ref();
148 se.set_volume(config.get<
float>(
"sfx_volume",
"audio"));
149 me.set_volume(config.get<
float>(
"music_volume",
"audio"));
150 de.set_volume(config.get<
float>(
"dialogue_volume",
"audio"));
155 auto& config = core::ServiceLocator<core::Config>::ref();
156 auto& window = core::ServiceLocator<core::Window>::ref();
158 auto icon = config.get<std::string>(
"icon",
"window");
159 window.set_icon(icon);
161 auto& cursor = window.get_input<input::Cursor>();
162 cursor.toggle(config.get<
bool>(
"visible_cursor",
"window"));
164 auto cursor_icon = config.get<std::string>(
"cursor_icon",
"window");
165 if (!cursor_icon.empty())
167 cursor.load_custom(cursor_icon);
168 cursor.use_custom_else_pointer();
172 cursor.use_pointer();
178 auto& shaders = core::ServiceLocator<resource::Shaders>::ref();
180 auto rtt = std::make_unique<graphics::Shader>();
183 shaders.insert(
"render_to_texture", rtt);
186 for (
const auto& [key, value] : shaders.cache())
191 for (
const auto& [key, value] : core::ServiceLocator<resource::Fonts>::ref().cache())
196 for (
auto&& [key, value] : core::ServiceLocator<resource::VideoCache>::ref().cache())
201 auto& tex = ServiceLocator<resource::Textures>::ref();
202 tex.load_folder(GALAXY_TEXTURE_DIR);
203 for (
auto&& [key, value] : tex.cache())
205 value->make_bindless();