From 27e3696df467f390c80772509feab720c7a6e9f0 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 26 Aug 2019 17:13:37 +0200 Subject: [PATCH] Use consts for drawing ui --- Source/control.cpp | 60 ++++++++++++++++++------------------ Source/inv.cpp | 76 +++++++++++++++++++++++----------------------- defs.h | 1 + 3 files changed, 69 insertions(+), 68 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index e5b9535b3..b9c3be6d2 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -868,7 +868,7 @@ void DrawPanelBox(int x, int y, int w, int h, int sx, int sy) /// ASSERT: assert(gpBuffer); nSrcOff = x + PANEL_WIDTH * y; - nDstOff = sx + BUFFER_WIDTH * sy; + nDstOff = sx + BUFFER_WIDTH * sy + (SCREEN_WIDTH - PANEL_WIDTH) / 2; #ifdef USE_ASM __asm { @@ -1041,9 +1041,9 @@ void UpdateLifeFlask() else if (filled < 0) filled = 0; if (filled != 69) - SetFlaskHeight(pLifeBuff, 16, 85 - filled, 160, 512); + SetFlaskHeight(pLifeBuff, 16, 85 - filled, 96 + SCREEN_X, 352 + SCREEN_Y); if (filled) - DrawPanelBox(96, 85 - filled, 88, filled, 160, 581 - filled); + DrawPanelBox(96, 85 - filled, 88, filled, 96 + SCREEN_X, 421 + SCREEN_Y - filled); } void DrawManaFlask() @@ -1098,9 +1098,9 @@ void UpdateManaFlask() if (filled > 69) filled = 69; if (filled != 69) - SetFlaskHeight(pManaBuff, 16, 85 - filled, 160 + 368, 512); + SetFlaskHeight(pManaBuff, 16, 85 - filled, 96 + SCREEN_X + 368, 352 + SCREEN_Y); if (filled) - DrawPanelBox(96 + 368, 85 - filled, 88, filled, 160 + 368, 581 - filled); + DrawPanelBox(96 + 368, 85 - filled, 88, filled, 96 + SCREEN_X + 368, 421 + SCREEN_Y - filled); DrawSpell(); } @@ -1201,16 +1201,16 @@ void DrawCtrlPan() for (i = 0; i < 6; i++) { if (!panbtn[i]) - DrawPanelBox(PanBtnPos[i][0], PanBtnPos[i][1] - 336, 71, 20, PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 160); + DrawPanelBox(PanBtnPos[i][0], PanBtnPos[i][1] - 336, 71, 20, PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y); else - CelDecodeOnly(PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 178, pPanelButtons, i + 1, 71); + CelDecodeOnly(PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y + 18, pPanelButtons, i + 1, 71); } if (numpanbtns == 8) { - CelDecodeOnly(151, 634, pMultiBtns, panbtn[6] + 1, 33); + CelDecodeOnly(87 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[6] + 1, 33); if (FriendlyMode) - CelDecodeOnly(591, 634, pMultiBtns, panbtn[7] + 3, 33); + CelDecodeOnly(527 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[7] + 3, 33); else - CelDecodeOnly(591, 634, pMultiBtns, panbtn[7] + 5, 33); + CelDecodeOnly(527 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[7] + 5, 33); } } @@ -1617,7 +1617,7 @@ void control_print_info_str(int y, char *str, BOOL center, int lines) int screen_x, line, nOffset; line = 0; - nOffset = lineoffset[y + 4 * lines + lines]; + nOffset = lineoffset[y + 4 * lines + lines] + (SCREEN_WIDTH - PANEL_WIDTH) / 2; if (center == 1) { screen_x = 0; tmp = str; @@ -1646,7 +1646,7 @@ void PrintGameStr(int x, int y, char *str, int color) { BYTE c; int off; - off = PitchTbl[y + SCREEN_Y] + x + 64; + off = PitchTbl[y + SCREEN_Y] + x + SCREEN_X; while (*str) { c = gbFontTransTbl[(BYTE)*str++]; c = fontframe[c]; @@ -1662,7 +1662,7 @@ void DrawChr() char chrstr[64]; int pc, mindam, maxdam; - CelDecodeOnly(64, 511, pChrPanel, 1, 320); + CelDecodeOnly(SCREEN_X, 351 + SCREEN_Y, pChrPanel, 1, 320); ADD_PlrStringXY(20, 32, 151, plr[myplr]._pName, COL_WHITE); if (plr[myplr]._pClass == PC_WARRIOR) { @@ -1835,13 +1835,13 @@ void DrawChr() ADD_PlrStringXY(95, 266, 126, chrstr, COL_RED); pc = plr[myplr]._pClass; if (plr[myplr]._pBaseStr < MaxStats[pc][ATTRIB_STR]) - CelDecodeOnly(201, 319, pChrButtons, chrbtn[ATTRIB_STR] + 2, 41); + CelDecodeOnly(137 + SCREEN_X, 159 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_STR] + 2, 41); if (plr[myplr]._pBaseMag < MaxStats[pc][ATTRIB_MAG]) - CelDecodeOnly(201, 347, pChrButtons, chrbtn[ATTRIB_MAG] + 4, 41); + CelDecodeOnly(137 + SCREEN_X, 187 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_MAG] + 4, 41); if (plr[myplr]._pBaseDex < MaxStats[pc][ATTRIB_DEX]) - CelDecodeOnly(201, 376, pChrButtons, chrbtn[ATTRIB_DEX] + 6, 41); + CelDecodeOnly(137 + SCREEN_X, 216 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_DEX] + 6, 41); if (plr[myplr]._pBaseVit < MaxStats[pc][ATTRIB_VIT]) - CelDecodeOnly(201, 404, pChrButtons, chrbtn[ATTRIB_VIT] + 8, 41); + CelDecodeOnly(137 + SCREEN_X, 244 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_VIT] + 8, 41); } col = plr[myplr]._pMaxHP <= plr[myplr]._pMaxHPBase ? COL_WHITE : COL_BLUE; @@ -1870,7 +1870,7 @@ void ADD_PlrStringXY(int x, int y, int width, char *pszStr, char col) char *tmp; int nOffset, screen_x, line, widthOffset; - nOffset = x + PitchTbl[y + SCREEN_Y] + 64; + nOffset = x + PitchTbl[y + SCREEN_Y] + SCREEN_X; widthOffset = width - x + 1; line = 0; screen_x = 0; @@ -1900,7 +1900,7 @@ void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base) char *tmp; int nOffset, screen_x, line, widthOffset; - nOffset = x + PitchTbl[y + SCREEN_Y] + 64; + nOffset = x + PitchTbl[y + SCREEN_Y] + SCREEN_X; widthOffset = width - x + 1; line = 0; screen_x = 0; @@ -1944,7 +1944,7 @@ void DrawLevelUpIcon() if (!stextflag) { nCel = lvlbtndown ? 3 : 2; ADD_PlrStringXY(0, 303, 120, "Level Up", COL_WHITE); - CelDecodeOnly(104, 495, pChrButtons, nCel, 41); + CelDecodeOnly(40 + SCREEN_X, 335 + SCREEN_Y, pChrButtons, nCel, 41); } } @@ -2069,7 +2069,7 @@ int DrawDurIcon4Item(ItemStruct *pItem, int x, int c) } if (pItem->_iDurability > 2) c += 8; - CelDecodeOnly(x, 495, pDurIcons, c, 32); + CelDecodeOnly(x, 335 + SCREEN_Y, pDurIcons, c, 32); return x - 40; } @@ -2181,8 +2181,8 @@ void DrawSpellBook() char st; unsigned __int64 spl; - CelDecodeOnly(384, 511, pSpellBkCel, 1, 320); - CelDecodeOnly(76 * sbooktab + 391, 508, pSBkBtnCel, sbooktab + 1, 76); + CelDecodeOnly(PANEL_RIGHT, 351 + SCREEN_Y, pSpellBkCel, 1, 320); + CelDecodeOnly(PANEL_RIGHT + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76); spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells; @@ -2192,10 +2192,10 @@ void DrawSpellBook() if (sn != -1 && spl & (__int64)1 << (sn - 1)) { st = GetSBookTrans(sn, TRUE); SetSpellTrans(st); - DrawSpellCel(395, yp, pSBkIconCels, SpellITbl[sn], 37); + DrawSpellCel(SCREEN_WIDTH - 320 + 75, yp, pSBkIconCels, SpellITbl[sn], 37); if (sn == plr[myplr]._pRSpell && st == plr[myplr]._pRSplType) { SetSpellTrans(RSPLTYPE_SKILL); - DrawSpellCel(395, yp, pSBkIconCels, 43, 37); + DrawSpellCel(SCREEN_WIDTH - 320 + 75, yp, pSBkIconCels, 43, 37); } PrintSBookStr(10, yp - 23, FALSE, spelldata[sn].sNameText, COL_WHITE); switch (GetSBookTrans(sn, FALSE)) { @@ -2240,7 +2240,7 @@ void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col) char *tmp; int screen_x, line, width; - width = PitchTbl[y] + x + 440; + width = PitchTbl[y] + x + SCREEN_WIDTH - 320 + 120;; line = 0; if (cjustflag) { screen_x = 0; @@ -2307,7 +2307,7 @@ void DrawGoldSplit(int amount) int screen_x, i; screen_x = 0; - CelDecodeOnly(415, 338, pGBoxBuff, 1, 261); + CelDecodeOnly(351 + SCREEN_X, 178 + SCREEN_Y, pGBoxBuff, 1, 261); sprintf(tempstr, "You have %u gold", initialDropGoldValue); ADD_PlrStringXY(366, 87, 600, tempstr, COL_GOLD); sprintf(tempstr, "%s. How many do", get_pieces_str(initialDropGoldValue)); @@ -2323,7 +2323,7 @@ void DrawGoldSplit(int amount) } else { screen_x = 450; } - CelDecodeOnly(screen_x, 300, pSPentSpn2Cels, nGoldFrame, 12); + CelDecodeOnly(screen_x, 140 + SCREEN_Y, pSPentSpn2Cels, nGoldFrame, 12); nGoldFrame = (nGoldFrame & 7) + 1; } @@ -2443,7 +2443,7 @@ void DrawTalkPan() nCel = 4; else nCel = 3; - CelDecodeOnly(236, 596 + 18 * talk_btn, pTalkBtns, nCel, 61); + CelDecodeOnly(172 + SCREEN_X, 436 + 18 * talk_btn + SCREEN_Y, pTalkBtns, nCel, 61); } } else { color = COL_RED; @@ -2453,7 +2453,7 @@ void DrawTalkPan() nCel = 1; if (talkbtndown[talk_btn]) nCel += 4; - CelDecodeOnly(236, 596 + 18 * talk_btn, pTalkBtns, nCel, 61); + CelDecodeOnly(172 + SCREEN_X, 436 + 18 * talk_btn + SCREEN_Y, pTalkBtns, nCel, 61); } if (plr[i].plractive) { control_print_talk_msg(plr[i]._pName, 46, 60 + talk_btn * 18, &x, color); diff --git a/Source/inv.cpp b/Source/inv.cpp index c03aa3011..871b7e6b2 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -172,10 +172,10 @@ void DrawInv() BOOL invtest[40]; int frame, frame_width, colour, screen_x, screen_y, i, j, ii; - CelDecodeOnly(384, 511, pInvCels, 1, 320); + CelDecodeOnly(PANEL_RIGHT, 351 + SCREEN_Y, pInvCels, 1, 320); if (plr[myplr].InvBody[INVLOC_HEAD]._itype != ITYPE_NONE) { - InvDrawSlotBack(517, 219, 2 * INV_SLOT_SIZE_PX, 2 * INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 133, 59 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 2 * INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_HEAD]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; @@ -188,18 +188,18 @@ void DrawInv() if (!plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) { colour = ICOL_RED; } - CelDecodeClr(colour, 517, 219, pCursCels, frame, frame_width, 0, 8); + CelDecodeClr(colour, PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) { - CelDrawHdrOnly(517, 219, pCursCels, frame, frame_width, 0, 8); + CelDrawHdrOnly(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } else { - CelDrawHdrLightRed(517, 219, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawHdrLightRed(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); } } if (plr[myplr].InvBody[INVLOC_RING_LEFT]._itype != ITYPE_NONE) { - InvDrawSlotBack(432, 365, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 48, 205 + SCREEN_Y, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_RING_LEFT]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; @@ -212,18 +212,18 @@ void DrawInv() if (!plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) { colour = ICOL_RED; } - CelDecodeClr(colour, 432, 365, pCursCels, frame, frame_width, 0, 8); + CelDecodeClr(colour, PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) { - CelDrawHdrOnly(432, 365, pCursCels, frame, frame_width, 0, 8); + CelDrawHdrOnly(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } else { - CelDrawHdrLightRed(432, 365, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawHdrLightRed(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); } } if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._itype != ITYPE_NONE) { - InvDrawSlotBack(633, 365, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 249, 205 + SCREEN_Y, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_RING_RIGHT]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; @@ -236,18 +236,18 @@ void DrawInv() if (!plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) { colour = ICOL_RED; } - CelDecodeClr(colour, 633, 365, pCursCels, frame, frame_width, 0, 8); + CelDecodeClr(colour, PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) { - CelDrawHdrOnly(633, 365, pCursCels, frame, frame_width, 0, 8); + CelDrawHdrOnly(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } else { - CelDrawHdrLightRed(633, 365, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawHdrLightRed(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); } } if (plr[myplr].InvBody[INVLOC_AMULET]._itype != ITYPE_NONE) { - InvDrawSlotBack(589, 220, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 205, 60 + SCREEN_Y, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_AMULET]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; @@ -260,24 +260,24 @@ void DrawInv() if (!plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) { colour = ICOL_RED; } - CelDecodeClr(colour, 589, 220, pCursCels, frame, frame_width, 0, 8); + CelDecodeClr(colour, PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) { - CelDrawHdrOnly(589, 220, pCursCels, frame, frame_width, 0, 8); + CelDrawHdrOnly(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } else { - CelDrawHdrLightRed(589, 220, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawHdrLightRed(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); } } if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE) { - InvDrawSlotBack(401, 320, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 17, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; // calc item offsets for weapons smaller than 2x3 slots - screen_x = frame_width == INV_SLOT_SIZE_PX ? 415 : 401; - screen_y = InvItemHeight[frame] == (3 * INV_SLOT_SIZE_PX) ? 320 : 306; + screen_x = frame_width == INV_SLOT_SIZE_PX ? (PANEL_RIGHT + 31) : (PANEL_RIGHT + 17); + screen_y = InvItemHeight[frame] == (3 * INV_SLOT_SIZE_PX) ? (160 + SCREEN_Y) : (146 + SCREEN_Y); if (pcursinvitem == INVITEM_HAND_LEFT) { colour = ICOL_WHITE; @@ -297,27 +297,27 @@ void DrawInv() } if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) { - InvDrawSlotBack(631, 320, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 247, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); light_table_index = 0; cel_transparency_active = 1; CelDecodeHdrLightTrans( frame_width == INV_SLOT_SIZE_PX - ? &gpBuffer[SCREENXY(581, 160)] - : &gpBuffer[SCREENXY(567, 160)], + ? &gpBuffer[SCREENXY(PANEL_RIGHT + 197, SCREEN_Y)] + : &gpBuffer[SCREENXY(PANEL_RIGHT + 183, SCREEN_Y)], pCursCels, frame, frame_width, 0, 8); cel_transparency_active = 0; } } if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_NONE) { - InvDrawSlotBack(631, 320, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 247, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; // calc item offsets for weapons smaller than 2x3 slots - screen_x = frame_width == INV_SLOT_SIZE_PX ? 645 : 633; - screen_y = InvItemHeight[frame] == 3 * INV_SLOT_SIZE_PX ? 320 : 306; + screen_x = frame_width == INV_SLOT_SIZE_PX ? (PANEL_RIGHT + 261) : (PANEL_RIGHT + 249); + screen_y = InvItemHeight[frame] == 3 * INV_SLOT_SIZE_PX ? (160 + SCREEN_Y) : (146 + SCREEN_Y); if (pcursinvitem == INVITEM_HAND_RIGHT) { colour = ICOL_WHITE; @@ -338,7 +338,7 @@ void DrawInv() } if (plr[myplr].InvBody[INVLOC_CHEST]._itype != ITYPE_NONE) { - InvDrawSlotBack(517, 320, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); + InvDrawSlotBack(PANEL_RIGHT + 133, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); frame = plr[myplr].InvBody[INVLOC_CHEST]._iCurs + CURSOR_FIRSTITEM; frame_width = InvItemWidth[frame]; @@ -351,21 +351,21 @@ void DrawInv() if (!plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) { colour = ICOL_RED; } - CelDecodeClr(colour, 517, 320, pCursCels, frame, frame_width, 0, 8); + CelDecodeClr(colour, PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) { - CelDrawHdrOnly(517, 320, pCursCels, frame, frame_width, 0, 8); + CelDrawHdrOnly(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); } else { - CelDrawHdrLightRed(517, 320, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawHdrLightRed(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); } } for (i = 0; i < NUM_INV_GRID_ELEM; i++) { if (plr[myplr].InvGrid[i] != 0) { InvDrawSlotBack( - InvRect[i + SLOTXY_INV_FIRST].X + 64, - InvRect[i + SLOTXY_INV_FIRST].Y + 159, + InvRect[i + SLOTXY_INV_FIRST].X + SCREEN_X, + InvRect[i + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, INV_SLOT_SIZE_PX, INV_SLOT_SIZE_PX); } @@ -390,20 +390,20 @@ void DrawInv() } CelDecodeClr( colour, - InvRect[j + SLOTXY_INV_FIRST].X + 64, - InvRect[j + SLOTXY_INV_FIRST].Y + 159, + InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, + InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8); } if (plr[myplr].InvList[ii]._iStatFlag) { CelDrawHdrOnly( - InvRect[j + SLOTXY_INV_FIRST].X + 64, - InvRect[j + SLOTXY_INV_FIRST].Y + 159, + InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, + InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8); } else { CelDrawHdrLightRed( - InvRect[j + SLOTXY_INV_FIRST].X + 64, - InvRect[j + SLOTXY_INV_FIRST].Y + 159, + InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, + InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8, 1); } } diff --git a/defs.h b/defs.h index 2c7a0446b..0c9f1bb71 100644 --- a/defs.h +++ b/defs.h @@ -121,6 +121,7 @@ #define PANEL_HEIGHT 128 #define PANEL_TOP (SCREEN_HEIGHT - PANEL_HEIGHT) #define PANEL_Y (PANEL_TOP + SCREEN_Y) +#define PANEL_RIGHT (SCREEN_X + SCREEN_WIDTH - 320) #if SCREEN_WIDTH == PANEL_WIDTH #define VIEWPORT_HEIGHT (SCREEN_HEIGHT - PANEL_HEIGHT)