Cleanup / refractor
This commit is contained in:
+1
-5
@@ -182,13 +182,9 @@ struct App {
|
||||
current_scene_id = scene_id;
|
||||
}
|
||||
|
||||
App(Vec2<float> size, const char *title, int anim_loading) {
|
||||
App(Vec2<float> size, const char *title) {
|
||||
window.update(size, title);
|
||||
#warning "Should try to center the loading image or scale it to fit the screen"
|
||||
Scene *loading_scene = new Scene{};
|
||||
EImage *image = new EImage(anim_loading);
|
||||
int image_id = element_pool.acquire(image);
|
||||
loading_scene->add_element(image_id);
|
||||
current_scene_id = scene_pool.acquire(loading_scene);
|
||||
}
|
||||
|
||||
|
||||
@@ -353,18 +353,7 @@ static mrb_value app_run(mrb_state *mrb, mrb_value) {
|
||||
char *title = nullptr;
|
||||
mrb_get_args(mrb, "iiz", &width, &height, &title);
|
||||
|
||||
int loading_image = window.load_image("assets/images/menu_bg.png", 1.0f, true);
|
||||
|
||||
Animation loading_animation = {
|
||||
.frames = {loading_image},
|
||||
.frame_rate = 1.0f,
|
||||
.loop = false
|
||||
};
|
||||
|
||||
int loading_animation_id = animation_pool.acquire(new Animation(loading_animation));
|
||||
animation_pool.use(loading_animation_id);
|
||||
|
||||
app_ = new app::App({(float)width, (float)height}, title, loading_animation_id);
|
||||
app_ = new app::App({(float)width, (float)height}, title);
|
||||
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user