From f3376060f5a6e761fffd14a8df33da812c388467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0imek?= Date: Sat, 21 May 2022 00:30:11 -0700 Subject: [PATCH] Rename variables and match coding style --- src/interface.c | 9 +++++---- src/tile.c | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/interface.c b/src/interface.c index 7244f30..5ceeb56 100644 --- a/src/interface.c +++ b/src/interface.c @@ -32,6 +32,7 @@ #define INDICATOR_BOX_WIDTH 130 #define INDICATOR_BOX_HEIGHT 21 +#define INTERFACE_BAR_WIDTH 640 #define INTERFACE_BAR_HEIGHT 100 // The width of connectors in the indicator box. @@ -350,10 +351,10 @@ int interfaceInit() gInterfaceBarInitialized = 1; - int xPos = (_scr_size.right - 640) / 2; - int yPos = _scr_size.bottom - 99; + int interfaceBarWindowX = (screenGetWidth() - INTERFACE_BAR_WIDTH) / 2; + int interfaceBarWindowY = screenGetHeight() - INTERFACE_BAR_HEIGHT - 1; - gInterfaceBarWindow = windowCreate(xPos, yPos, 640, 100, _colorTable[0], WINDOW_HIDDEN); + gInterfaceBarWindow = windowCreate(interfaceBarWindowX, interfaceBarWindowY, INTERFACE_BAR_WIDTH, INTERFACE_BAR_HEIGHT, _colorTable[0], WINDOW_HIDDEN); if (gInterfaceBarWindow == -1) { goto err; } @@ -369,7 +370,7 @@ int interfaceInit() goto err; } - blitBufferToBuffer(backgroundFrmData, 640, 99, 640, gInterfaceWindowBuffer, 640); + blitBufferToBuffer(backgroundFrmData, INTERFACE_BAR_WIDTH, INTERFACE_BAR_HEIGHT - 1, INTERFACE_BAR_WIDTH, gInterfaceWindowBuffer, 640); artUnlock(backgroundFrmHandle); fid = buildFid(6, 47, 0, 0, 0); diff --git a/src/tile.c b/src/tile.c index f39d400..b07e749 100644 --- a/src/tile.c +++ b/src/tile.c @@ -502,21 +502,21 @@ int tileSetCenter(int tile, int flags) } } - int v9 = gHexGridWidth - 1 - tile % gHexGridWidth; - int v10 = tile / gHexGridWidth; + int tile_x = gHexGridWidth - 1 - tile % gHexGridWidth; + int tile_y = tile / gHexGridWidth; if (_borderInitialized) { - if (v9 <= _tile_border || v9 >= dword_66BBCC || v10 <= dword_66BBC8 || v10 >= dword_66BBD0) { + if (tile_x <= _tile_border || tile_x >= dword_66BBCC || tile_y <= dword_66BBC8 || tile_y >= dword_66BBD0) { return -1; } } - _tile_y = v10; + _tile_y = tile_y; _tile_offx = (gTileWindowWidth - 32) / 2; - _tile_x = v9; + _tile_x = tile_x; _tile_offy = (gTileWindowHeight - 16) / 2; - if (v9 & 1) { + if (tile_x & 1) { _tile_x -= 1; _tile_offx -= 32; }