From e177b11d0dc1aaf283b4d19c06ec6918464ab07c Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 21 May 2022 20:42:14 +0300 Subject: [PATCH] Fix death window 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 d6dac1e..d35c8d9 100644 --- a/src/main.cc +++ b/src/main.cc @@ -32,6 +32,9 @@ #define MAIN_MENU_WINDOW_WIDTH 640 #define MAIN_MENU_WINDOW_HEIGHT 480 +#define DEATH_WINDOW_WIDTH 640 +#define DEATH_WINDOW_HEIGHT 480 + // 0x5194C8 char _mainMap[] = "artemple.map"; @@ -356,7 +359,14 @@ void showDeath() mouseShowCursor(); } - int win = windowCreate(0, 0, 640, 480, 0, WINDOW_FLAG_0x04); + int deathWindowX = (screenGetWidth() - DEATH_WINDOW_WIDTH) / 2; + int deathWindowY = (screenGetHeight() - DEATH_WINDOW_HEIGHT) / 2; + int win = windowCreate(deathWindowX, + deathWindowY, + DEATH_WINDOW_WIDTH, + DEATH_WINDOW_HEIGHT, + 0, + WINDOW_FLAG_0x04); if (win != -1) { do { unsigned char* windowBuffer = windowGetBuffer(win);