Fix automap position

See #3
This commit is contained in:
Alexander Batalov 2022-05-21 01:56:07 +03:00
parent 0893467f08
commit 6c4927b129
3 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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)

View File

@ -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);
}