From 7e9a5a7c4fa77f3eb704ea4ab30b4cb0897345f4 Mon Sep 17 00:00:00 2001 From: Daanish Date: Tue, 5 May 2026 21:37:54 +0100 Subject: [PATCH] Cleanup / refractor --- include/app/app.h | 6 +----- include/binding/definitions.h | 13 +------------ src/window/window.cc | 6 ------ 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/include/app/app.h b/include/app/app.h index 94665f3..d1be796 100644 --- a/include/app/app.h +++ b/include/app/app.h @@ -182,13 +182,9 @@ struct App { current_scene_id = scene_id; } - App(Vec2 size, const char *title, int anim_loading) { + App(Vec2 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); } diff --git a/include/binding/definitions.h b/include/binding/definitions.h index 48ac47c..011f960 100644 --- a/include/binding/definitions.h +++ b/include/binding/definitions.h @@ -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(); } diff --git a/src/window/window.cc b/src/window/window.cc index 81c009a..72b77ed 100644 --- a/src/window/window.cc +++ b/src/window/window.cc @@ -363,17 +363,11 @@ bool Window::poll(Event &event) { break; case SDL_EVENT_KEY_DOWN: -#warning "This is a bit of a hack to prevent key down/up events from being generated when text input is active on certian keys," \ - "but this list is not enough, need to look more into it" - if (text_input_active && sdl_event.key.key > '0' && sdl_event.key.key < 'z') - return false; event.type = Event::KEY_DOWN; event.key.key = sdl_event.key.scancode; break; case SDL_EVENT_KEY_UP: - if (text_input_active && sdl_event.key.key > '0' && sdl_event.key.key < 'z') - return false; event.type = Event::KEY_UP; event.key.key = sdl_event.key.scancode; break;