diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 924381f6d..ec8326216 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1084,9 +1084,14 @@ static void G_DrawAltDigiNum(int32_t x, int32_t y, int32_t n, char s, int32_t cs } } +static int32_t invensc(int32_t maximum) // used to reposition the inventory icon selector as the HUD scales +{ + return scale(maximum << 16, ud.statusbarscale - 36, 100 - 36); +} + static void G_DrawInventory(const DukePlayer_t *p) { - int32_t n, j = 0, xoff = 0, y; + int32_t n, j = 0, x = 0, y; n = (p->inv_amount[GET_JETPACK] > 0)<<3; if (n&8) j++; @@ -1103,11 +1108,27 @@ static void G_DrawInventory(const DukePlayer_t *p) n |= (p->inv_amount[GET_BOOTS] > 0)<<6; if (n&64) j++; - xoff = 160-(j*11); + x = (160-(j*11))<<16; // nearly center j = 0; - y = 154; + if (ud.screen_size < 8) // mini-HUDs or no HUD + { + y = 172<<16; + + if (ud.screen_size == 4 && ud.althud) // modern mini-HUD + y -= invensc(tilesizy[BIGALPHANUM]+10); // slide on the y-axis + } + else // full HUD + { + y = (200<<16) - (sbarsc(tilesizy[BOTTOMSTATUSBAR]<<16) + (12<<16) + (tilesizy[BOTTOMSTATUSBAR]<<(16-1))); + + if (!ud.statusbarmode) // original non-overlay mode + y += sbarsc(tilesizy[BOTTOMSTATUSBAR]<<16)>>1; // account for the viewport y-size as the HUD scales + } + + if (ud.screen_size == 4 && !ud.althud) // classic mini-HUD + x += invensc(ud.multimode > 1 ? 56 : 65); // slide on the x-axis while (j <= 9) { @@ -1116,32 +1137,32 @@ static void G_DrawInventory(const DukePlayer_t *p) switch (n&(1<inven_icon == j+1) - rotatesprite_win((xoff-2)<<16,(y+19)<<16,65536L,1024,ARROW,-32,0,2+16); + rotatesprite_win(x-(2<<16),y+(19<<16),65536L,1024,ARROW,-32,0,2+16); } j++;