Fix indicator bar position

See #3
This commit is contained in:
Alexander Batalov 2022-05-21 01:50:14 +03:00
parent 7495659fc0
commit 0893467f08
3 changed files with 19 additions and 5 deletions

View File

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

View File

@ -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 */

View File

@ -29,12 +29,11 @@
#include <stdio.h>
#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],