diff --git a/src/engine/input.h b/src/engine/input.h index 593e1ea..2d54549 100644 --- a/src/engine/input.h +++ b/src/engine/input.h @@ -31,8 +31,9 @@ void UpdateMouseScreen(Mouse *mouse){ void UpdateMouse(Mouse *mouse, Camera2D *camera) { - mouse->screenPosition = GetMousePosition(); - mouse->worldPosition = GetScreenToWorld2D(GetMousePosition(), *camera); + Vector2 pos = GetMousePosition(); + mouse->screenPosition = pos; + mouse->worldPosition = GetScreenToWorld2D(pos, *camera); mouse->leftButton = IsMouseButtonDown(MOUSE_LEFT_BUTTON); mouse->rightButton = IsMouseButtonDown(MOUSE_RIGHT_BUTTON); diff --git a/src/game/menu.h b/src/game/menu.h index fd13e3d..40506e5 100644 --- a/src/game/menu.h +++ b/src/game/menu.h @@ -151,7 +151,6 @@ void CleanupMenu(MenuState *m){ for (int i = 0; i < MENU_SOUND_COUNT; i++){ UnloadSound(m->sounds[i]); } for (int i = 0; i < MENU_TEX_COUNT; i++){ if (m->textures[i].id > 0) { UnloadTexture(m->textures[i]); } } for (int i = 0; i < MENU_SOUNDTRACK_COUNT; i++){ UnloadMusicStream(m->soundtracks[i].music); } - } #endif // MENU_H diff --git a/src/main.c b/src/main.c index 4543afb..a375e58 100644 --- a/src/main.c +++ b/src/main.c @@ -20,6 +20,7 @@ typedef struct { int main(void) { + Display display = { .name = "The Last Hive", .width = 1280, @@ -65,6 +66,7 @@ int main(void) default: break; } } + CleanupMenu(&app.menu); CleanupGame(&app.game); UnloadFont(app.font); CloseWindow();