From 0893467f084848676f708ed7c8fcd7c88a34eeec Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 21 May 2022 01:50:14 +0300 Subject: [PATCH] Fix indicator bar position See #3 --- src/core.c | 12 ++++++++++++ src/core.h | 3 +++ src/interface.c | 9 ++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/core.c b/src/core.c index 99441f0..0ca1bff 100644 --- a/src/core.c +++ b/src/core.c @@ -4606,3 +4606,15 @@ err: return false; } + +int screenGetWidth() +{ + // TODO: Make it on par with _xres; + return _scr_size.right + _scr_size.left + 1; +} + +int screenGetHeight() +{ + // TODO: Make it on par with _yres. + return _scr_size.bottom + _scr_size.top + 1; +} diff --git a/src/core.h b/src/core.h index b12ed5e..dbdb3ea 100644 --- a/src/core.h +++ b/src/core.h @@ -634,4 +634,7 @@ int _vcr_dump_buffer(); bool _vcr_save_record(STRUCT_51E2F0* ptr, File* stream); bool _vcr_load_record(STRUCT_51E2F0* ptr, File* stream); +int screenGetWidth(); +int screenGetHeight(); + #endif /* CORE_H */ diff --git a/src/interface.c b/src/interface.c index 850c6c3..7244f30 100644 --- a/src/interface.c +++ b/src/interface.c @@ -29,12 +29,11 @@ #include -#define INDICATOR_BAR_X 0 -#define INDICATOR_BAR_Y 358 - #define INDICATOR_BOX_WIDTH 130 #define INDICATOR_BOX_HEIGHT 21 +#define INTERFACE_BAR_HEIGHT 100 + // The width of connectors in the indicator box. // // There are male connectors on the left, and female connectors on the right. @@ -2478,8 +2477,8 @@ int indicatorBarRefresh() } if (count != 0) { - gIndicatorBarWindow = windowCreate(INDICATOR_BAR_X, - INDICATOR_BAR_Y, + gIndicatorBarWindow = windowCreate(0, + screenGetHeight() - INTERFACE_BAR_HEIGHT - INDICATOR_BOX_HEIGHT - 1, (INDICATOR_BOX_WIDTH - INDICATOR_BOX_CONNECTOR_WIDTH) * count, INDICATOR_BOX_HEIGHT, _colorTable[0],