diff --git a/src/automap.c b/src/automap.c index 24a9314..1a0e7f8 100644 --- a/src/automap.c +++ b/src/automap.c @@ -288,7 +288,9 @@ void automapShow(bool isInGame, bool isUsingScanner) int oldFont = fontGetCurrent(); fontSetCurrent(101); - int window = windowCreate(AUTOMAP_WINDOW_X, AUTOMAP_WINDOW_Y, AUTOMAP_WINDOW_WIDTH, AUTOMAP_WINDOW_HEIGHT, color, WINDOW_FLAG_0x10 | WINDOW_FLAG_0x04); + int automapWindowX = (screenGetWidth() - AUTOMAP_WINDOW_WIDTH) / 2; + int automapWindowY = (screenGetHeight() - AUTOMAP_WINDOW_HEIGHT) / 2; + int window = windowCreate(automapWindowX, automapWindowY, AUTOMAP_WINDOW_WIDTH, AUTOMAP_WINDOW_HEIGHT, color, WINDOW_FLAG_0x10 | WINDOW_FLAG_0x04); int scannerBtn = buttonCreate(window, 111, 454, 15, 16, -1, -1, -1, KEY_LOWERCASE_S, frmData[AUTOMAP_FRM_BUTTON_UP], frmData[AUTOMAP_FRM_BUTTON_DOWN], NULL, BUTTON_FLAG_TRANSPARENT); if (scannerBtn != -1) { diff --git a/src/automap.h b/src/automap.h index 9b65b99..5d669f3 100644 --- a/src/automap.h +++ b/src/automap.h @@ -16,8 +16,6 @@ #define AUTOMAP_OFFSET_COUNT (AUTOMAP_MAP_COUNT * ELEVATION_COUNT) -#define AUTOMAP_WINDOW_X (75) -#define AUTOMAP_WINDOW_Y (0) #define AUTOMAP_WINDOW_WIDTH (519) #define AUTOMAP_WINDOW_HEIGHT (480) diff --git a/src/core.c b/src/core.c index 0ca1bff..c75125c 100644 --- a/src/core.c +++ b/src/core.c @@ -4610,11 +4610,11 @@ err: int screenGetWidth() { // TODO: Make it on par with _xres; - return _scr_size.right + _scr_size.left + 1; + return rectGetWidth(&_scr_size); } int screenGetHeight() { // TODO: Make it on par with _yres. - return _scr_size.bottom + _scr_size.top + 1; + return rectGetHeight(&_scr_size); }