|
|
|
|
@ -429,6 +429,13 @@ void ToggleSpell(int slot)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Print letter to the backbuffer |
|
|
|
|
* @param sx Backbuffer offset |
|
|
|
|
* @param sy Backbuffer offset |
|
|
|
|
* @param nCel Number of letter in Windows-1252 |
|
|
|
|
* @param col text_color color value |
|
|
|
|
*/ |
|
|
|
|
void CPrintString(int sx, int sy, int nCel, char col) |
|
|
|
|
{ |
|
|
|
|
/// ASSERT: assert(gpBuffer);
|
|
|
|
|
@ -497,7 +504,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 + PANEL_LEFT; |
|
|
|
|
nDstOff = sx + BUFFER_WIDTH * sy; |
|
|
|
|
|
|
|
|
|
int hgt; |
|
|
|
|
BYTE *src, *dst; |
|
|
|
|
@ -545,7 +552,7 @@ void SetFlaskHeight(BYTE *pCelBuff, int min, int max, int sx, int sy)
|
|
|
|
|
* into the target buffer. |
|
|
|
|
* @param pCelBuff The flask cel buffer. |
|
|
|
|
* @param w Width of the cel. |
|
|
|
|
* @param nSrcOffset Offset of the source buffer from where the bytes will start to be copied from. |
|
|
|
|
* @param nSrcOff Offset of the source buffer from where the bytes will start to be copied from. |
|
|
|
|
* @param pBuff Target buffer. |
|
|
|
|
* @param nDstOff Offset of the target buffer where the bytes will start to be copied to. |
|
|
|
|
* @param h How many lines of the source buffer that will be copied. |
|
|
|
|
@ -584,9 +591,9 @@ void DrawLifeFlask()
|
|
|
|
|
filled = 11; |
|
|
|
|
filled += 2; |
|
|
|
|
|
|
|
|
|
DrawFlask(pLifeBuff, 88, 277, gpBuffer, BUFFER_WIDTH * 499 + 173, filled); |
|
|
|
|
DrawFlask(pLifeBuff, 88, 277, gpBuffer, SCREENXY(PANEL_LEFT + 109, PANEL_TOP - 13), filled); |
|
|
|
|
if (filled != 13) |
|
|
|
|
DrawFlask(pBtmBuff, PANEL_WIDTH, PANEL_WIDTH * filled + 2029, gpBuffer, BUFFER_WIDTH * filled + BUFFER_WIDTH * 499 + 173, 13 - filled); |
|
|
|
|
DrawFlask(pBtmBuff, PANEL_WIDTH, PANEL_WIDTH * (filled + 3) + 109, gpBuffer, SCREENXY(PANEL_LEFT + 109, PANEL_TOP - 13 + filled), 13 - filled); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -619,9 +626,9 @@ void DrawManaFlask()
|
|
|
|
|
filled = 11; |
|
|
|
|
filled += 2; |
|
|
|
|
|
|
|
|
|
DrawFlask(pManaBuff, 88, 277, gpBuffer, BUFFER_WIDTH * 499 + 173 + 366, filled); |
|
|
|
|
DrawFlask(pManaBuff, 88, 277, gpBuffer, SCREENXY(PANEL_LEFT + 475, PANEL_TOP - 13), filled); |
|
|
|
|
if (filled != 13) |
|
|
|
|
DrawFlask(pBtmBuff, PANEL_WIDTH, PANEL_WIDTH * filled + 2029 + 366, gpBuffer, BUFFER_WIDTH * filled + BUFFER_WIDTH * 499 + 173 + 366, 13 - filled); |
|
|
|
|
DrawFlask(pBtmBuff, PANEL_WIDTH, PANEL_WIDTH * (filled + 3) + 475, gpBuffer, SCREENXY(PANEL_LEFT + 475, PANEL_TOP - 13 + filled), 13 - filled); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void control_update_life_mana() |
|
|
|
|
@ -772,9 +779,9 @@ void DrawCtrlPan()
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) { |
|
|
|
|
if (!panbtn[i]) |
|
|
|
|
DrawPanelBox(PanBtnPos[i][0] - PANEL_LEFT, PanBtnPos[i][1] - (PANEL_TOP - 16), 71, 20, PanBtnPos[i][0] + PANEL_X, PanBtnPos[i][1] + SCREEN_Y); |
|
|
|
|
DrawPanelBox(PanBtnPos[i][0] - PANEL_LEFT, PanBtnPos[i][1] - (PANEL_TOP - 16), 71, 20, PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y); |
|
|
|
|
else |
|
|
|
|
CelDraw(PanBtnPos[i][0] + PANEL_X, PanBtnPos[i][1] + (PANEL_Y - 334), pPanelButtons, i + 1, 71); |
|
|
|
|
CelDraw(PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + (PANEL_Y - 334), pPanelButtons, i + 1, 71); |
|
|
|
|
} |
|
|
|
|
if (numpanbtns == 8) { |
|
|
|
|
CelDraw(87 + PANEL_X, 122 + PANEL_Y, pMultiBtns, panbtn[6] + 1, 33); |
|
|
|
|
@ -1453,7 +1460,16 @@ void DrawChr()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base) |
|
|
|
|
/**
|
|
|
|
|
* @brief Render text string to back buffer |
|
|
|
|
* @param x Screen coordinate |
|
|
|
|
* @param y Screen coordinate |
|
|
|
|
* @param endX End of line in screen coordinate |
|
|
|
|
* @param pszStr String to print, in Windows-1252 encoding |
|
|
|
|
* @param col text_color color value |
|
|
|
|
* @param base Letter spacing |
|
|
|
|
*/ |
|
|
|
|
void MY_PlrStringXY(int x, int y, int endX, char *pszStr, char col, int base) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
char *tmp; |
|
|
|
|
@ -1461,7 +1477,7 @@ void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base)
|
|
|
|
|
|
|
|
|
|
sx = x + SCREEN_X; |
|
|
|
|
sy = y + SCREEN_Y; |
|
|
|
|
widthOffset = width - x + 1; |
|
|
|
|
widthOffset = endX - x + 1; |
|
|
|
|
line = 0; |
|
|
|
|
screen_x = 0; |
|
|
|
|
tmp = pszStr; |
|
|
|
|
@ -1503,7 +1519,7 @@ void DrawLevelUpIcon()
|
|
|
|
|
|
|
|
|
|
if (!stextflag) { |
|
|
|
|
nCel = lvlbtndown ? 3 : 2; |
|
|
|
|
ADD_PlrStringXY(0, 303, 120, "Level Up", COL_WHITE); |
|
|
|
|
ADD_PlrStringXY(PANEL_LEFT + 0, PANEL_TOP - 49, PANEL_LEFT + 120, "Level Up", COL_WHITE); |
|
|
|
|
CelDraw(40 + PANEL_X, -17 + PANEL_Y, pChrButtons, nCel, 41); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1647,7 +1663,7 @@ void RedBack()
|
|
|
|
|
if (leveltype != DTYPE_HELL) { |
|
|
|
|
dst = &gpBuffer[SCREENXY(0, 0)]; |
|
|
|
|
tbl = &pLightTbl[idx]; |
|
|
|
|
for (h = PANEL_TOP; h; h--, dst += BUFFER_WIDTH - SCREEN_WIDTH) { |
|
|
|
|
for (h = VIEWPORT_HEIGHT; h; h--, dst += BUFFER_WIDTH - SCREEN_WIDTH) { |
|
|
|
|
for (w = SCREEN_WIDTH; w; w--) { |
|
|
|
|
*dst = tbl[*dst]; |
|
|
|
|
dst++; |
|
|
|
|
@ -1656,7 +1672,7 @@ void RedBack()
|
|
|
|
|
} else { |
|
|
|
|
dst = &gpBuffer[SCREENXY(0, 0)]; |
|
|
|
|
tbl = &pLightTbl[idx]; |
|
|
|
|
for (h = PANEL_TOP; h; h--, dst += BUFFER_WIDTH - SCREEN_WIDTH) { |
|
|
|
|
for (h = VIEWPORT_HEIGHT; h; h--, dst += BUFFER_WIDTH - SCREEN_WIDTH) { |
|
|
|
|
for (w = SCREEN_WIDTH; w; w--) { |
|
|
|
|
if (*dst >= 32) |
|
|
|
|
*dst = tbl[*dst]; |
|
|
|
|
|