Skip to content

Commit

Permalink
Fix main menu position
Browse files Browse the repository at this point in the history
See #3
  • Loading branch information
alexbatalov committed May 21, 2022
1 parent cffd032 commit e6808d3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e6808d3

Please sign in to comment.