From e6808d30aadeb7e20ed78f25e8a463897d5878b4 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 21 May 2022 20:35:18 +0300 Subject: [PATCH] Fix main menu position See #3 --- src/main.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 0eeaaea..d6dac1e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -29,6 +29,9 @@ #include "word_wrap.h" #include "world_map.h" +#define MAIN_MENU_WINDOW_WIDTH 640 +#define MAIN_MENU_WINDOW_HEIGHT 480 + // 0x5194C8 char _mainMap[] = "artemple.map"; @@ -573,7 +576,14 @@ int mainMenuWindowInit() colorPaletteLoad("color.pal"); - gMainMenuWindow = windowCreate(0, 0, 640, 480, 0, 12); + int mainMenuWindowX = (screenGetWidth() - MAIN_MENU_WINDOW_WIDTH) / 2; + int mainMenuWindowY = (screenGetHeight() - MAIN_MENU_WINDOW_HEIGHT) / 2; + gMainMenuWindow = windowCreate(mainMenuWindowX, + mainMenuWindowY, + MAIN_MENU_WINDOW_WIDTH, + MAIN_MENU_WINDOW_HEIGHT, + 0, + WINDOW_HIDDEN | WINDOW_FLAG_0x04); if (gMainMenuWindow == -1) { mainMenuWindowFree(); return -1;