From 933262d701cdfb97d7430fb81434414834b1bf43 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 22 Oct 2019 00:24:13 +0200 Subject: [PATCH] Remove support for partial cel decoding Since we no longer make use of this it should result in a small speed up --- Source/engine.cpp | 134 +++++++++++--------------------------------- Source/engine.h | 74 ++++++------------------ Source/inv.cpp | 18 +++--- Source/scrollrt.cpp | 18 +++--- 4 files changed, 67 insertions(+), 177 deletions(-) diff --git a/Source/engine.cpp b/Source/engine.cpp index 1ff92fc7f..da9011d42 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -36,11 +36,7 @@ void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth) CelBlitSafe(pBuff, pRLEBytes, nDataSize, nWidth); } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { BYTE *pRLEBytes; int nDataSize; @@ -52,12 +48,10 @@ void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Ce if (!pCelBuff) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); CelBlitSafe( - &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)], + &gpBuffer[sx + BUFFER_WIDTH * sy], pRLEBytes, nDataSize, nWidth); @@ -84,11 +78,7 @@ void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, BYTE *tb CelBlitSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth); } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { int nDataSize; BYTE *pRLEBytes, *pDecodeTo; @@ -100,11 +90,9 @@ void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i if (!pCelBuff) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); - pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)]; + pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy]; if (light_table_index) CelBlitLightSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth); @@ -112,11 +100,7 @@ void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i CelBlitSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth); } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light) +void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light) { int nDataSize, w, idx; BYTE *pRLEBytes, *dst, *tbl; @@ -128,11 +112,9 @@ void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C if (!pCelBuff) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); - dst = &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)]; + dst = &gpBuffer[sx + BUFFER_WIDTH * sy]; idx = light4flag ? 1024 : 4096; if (light == 2) @@ -231,11 +213,7 @@ void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth) } } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { BYTE *pRLEBytes; int nDataSize; @@ -247,12 +225,10 @@ void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, in if (!pCelBuff) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); CelBlitSafe( - &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)], + &gpBuffer[sx + BUFFER_WIDTH * sy], pRLEBytes, nDataSize, nWidth); @@ -417,11 +393,7 @@ void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int } } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth) { int nDataSize; BYTE *pRLEBytes; @@ -430,9 +402,7 @@ void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, if (!pCelBuff) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); if (cel_transparency_active) CelBlitLightTransSafe(pBuff, pRLEBytes, nDataSize, nWidth); @@ -442,12 +412,7 @@ void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, CelBlitSafe(pBuff, pRLEBytes, nDataSize, nWidth); } -/** - * @brief Same as CelDrawLightRed but checks for drawing outside the buffer - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light) +void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light) { int nDataSize, w, idx; BYTE *pRLEBytes, *dst, *tbl; @@ -459,11 +424,9 @@ void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i if (!pCelBuff) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); - dst = &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)]; + dst = &gpBuffer[sx + BUFFER_WIDTH * sy]; idx = light4flag ? 1024 : 4096; if (light == 2) @@ -506,7 +469,7 @@ void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i /** * @brief Same as CelBlit but cropped to given width */ -void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth) +void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth) { BYTE *pRLEBytes, *dst, *end; @@ -522,7 +485,7 @@ void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, in pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize); end = &pRLEBytes[nDataSize]; - dst = &pBuff[hgt * wdt + CelSkip]; + dst = &pBuff[y * wdt + x]; for (; pRLEBytes != end; dst -= wdt + nWidth) { for (i = nWidth; i;) { @@ -560,12 +523,7 @@ void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, in } } -/** - * @brief Same as CelBlitOutline but checks for drawing outside the buffer - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { int nDataSize, w; BYTE *src, *dst, *end; @@ -578,12 +536,12 @@ void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid if (!gpBuffer) return; - src = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); + src = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); if (src == NULL) return; end = &src[nDataSize]; - dst = &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)]; + dst = &gpBuffer[sx + BUFFER_WIDTH * sy]; for (; src != end; dst -= BUFFER_WIDTH + nWidth) { for (w = nWidth; w;) { @@ -1046,11 +1004,7 @@ void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel) } } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { BYTE *pRLEBytes; int nDataSize; @@ -1065,12 +1019,10 @@ void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, if (nCel <= 0) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); Cl2BlitSafe( - &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)], + &gpBuffer[sx + BUFFER_WIDTH * sy], pRLEBytes, nDataSize, nWidth); @@ -1147,11 +1099,7 @@ void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth) } } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { int nDataSize; BYTE *pRLEBytes; @@ -1166,13 +1114,11 @@ void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid if (nCel <= 0) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); gpBufEnd -= BUFFER_WIDTH; Cl2BlitOutlineSafe( - &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)], + &gpBuffer[sx + BUFFER_WIDTH * sy], pRLEBytes, nDataSize, nWidth, @@ -1256,11 +1202,7 @@ void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi } } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light) +void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light) { int nDataSize, idx; BYTE *pRLEBytes, *pDecodeTo; @@ -1275,11 +1217,9 @@ void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C if (nCel <= 0) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); - pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)]; + pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy]; idx = light4flag ? 1024 : 4096; if (light == 2) @@ -1367,11 +1307,7 @@ void Cl2BlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidt } } -/** - * @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8 - * @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8 - */ -void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap) +void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { int nDataSize; BYTE *pRLEBytes, *pDecodeTo; @@ -1386,11 +1322,9 @@ void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelS if (nCel <= 0) return; - pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, CelSkip, CelCap, &nDataSize); - if (pRLEBytes == NULL) - return; + pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); - pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * (sy - 16 * CelSkip)]; + pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy]; if (light_table_index) Cl2BlitLightSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth, &pLightTbl[light_table_index * 256]); diff --git a/Source/engine.h b/Source/engine.h index c37bd79e6..362c17438 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -20,15 +20,6 @@ inline BYTE *CelGetFrameStart(BYTE *pCelBuff, int nCel) return pCelBuff + SwapLE32(pFrameTable[nCel]); } -inline int CelGetFrameSize(BYTE *pCelBuff, int nCel) -{ - DWORD *pFrameTable; - - pFrameTable = (DWORD *)pCelBuff; - - return SwapLE32(pFrameTable[nCel + 1]) - SwapLE32(pFrameTable[nCel]); -} - inline BYTE *CelGetFrame(BYTE *pCelBuff, int nCel, int *nDataSize) { DWORD *pFrameTable; @@ -41,62 +32,31 @@ inline BYTE *CelGetFrame(BYTE *pCelBuff, int nCel, int *nDataSize) return pCelBuff + nCellStart; } -inline BYTE *CelGetFrameClipped(BYTE *pCelBuff, int nCel, int CelSkip, int CelCap, int *nDataSize) +inline BYTE *CelGetFrameClipped(BYTE *pCelBuff, int nCel, int *nDataSize) { - BYTE *pRLEBytes; - DWORD *pFrameTable; - int nDataStart, nCellStart, nDataCap; - - pFrameTable = (DWORD *)pCelBuff; - - nCellStart = SwapLE32(pFrameTable[nCel]); - - const int nCellEnd = SwapLE32(pFrameTable[nCel + 1]); - if (CelSkip + 1 >= nCellEnd) - return nullptr; - - pRLEBytes = &pCelBuff[nCellStart]; - - const auto read_as_word = [pRLEBytes](int i) -> WORD { -#ifdef PLATFORM_LITTLE_ENDIAN - return (pRLEBytes[i] << 8) | pRLEBytes[i + 1]; -#else - return pRLEBytes[i] | (pRLEBytes[i + 1] << 8); -#endif - }; - - nDataStart = read_as_word(CelSkip); - if (nDataStart == 0) - return NULL; - - *nDataSize = nCellEnd - nCellStart; - if (CelCap == 8) - nDataCap = 0; - else - nDataCap = read_as_word(CelCap); + DWORD nDataStart; + BYTE *pRLEBytes = CelGetFrame(pCelBuff, nCel, nDataSize); - if (nDataCap) - *nDataSize = nDataCap - nDataStart; - else - *nDataSize -= nDataStart; + nDataStart = SwapLE16(pRLEBytes[1] << 8 | pRLEBytes[0]); + *nDataSize -= nDataStart; return pRLEBytes + nDataStart; } void CelDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth); -void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); +void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, BYTE *tbl = NULL); -void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); -void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); -void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light); +void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); +void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth); +void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light); void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth); -void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); +void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *tbl = NULL); void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth); -void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light); -void CelBlitWidth(BYTE *pBuff, int always_0, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth); -void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); +void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light); +void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth); +void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void ENG_set_pixel(int sx, int sy, BYTE col); void engine_draw_pixel(int sx, int sy); void DrawLine(int x0, int y0, int x1, int y1, BYTE col); @@ -110,10 +70,10 @@ void mem_free_dbg(void *p); BYTE *LoadFileInMem(char *pszName, DWORD *pdwFileLen); DWORD LoadFileWithMem(const char *pszName, void *p); void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel); -void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); -void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); -void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light); -void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip = 0, int CelCap = 8); +void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); +void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); +void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light); +void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth); void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col); void Cl2BlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable); diff --git a/Source/inv.cpp b/Source/inv.cpp index 1f799d325..9ce3c9b2a 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -163,7 +163,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) { CelClippedDraw(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 1); } } @@ -187,7 +187,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) { CelClippedDraw(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 1); } } @@ -211,7 +211,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) { CelClippedDraw(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 1); } } @@ -235,7 +235,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) { CelClippedDraw(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 1); } } @@ -262,7 +262,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) { CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 1); } if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) { @@ -302,7 +302,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) { CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 1); } } @@ -326,7 +326,7 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) { CelClippedDraw(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width); } else { - CelDrawLightRed(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 1); } } @@ -373,7 +373,7 @@ void DrawInv() CelDrawLightRed( InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, - pCursCels, frame, frame_width, 0, 8, 1); + pCursCels, frame, frame_width, 1); } } } @@ -411,7 +411,7 @@ void DrawInvBelt() if (plr[myplr].SpdList[i]._iStatFlag) CelClippedDraw(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width); else - CelDrawLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8, 1); + CelDrawLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 1); if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable && plr[myplr].SpdList[i]._iStatFlag diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index a6c1129e8..2e65bcf01 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -156,7 +156,7 @@ static void scrollrt_draw_cursor_item() if (col != PAL16_RED + 5) { CelClippedDrawSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW); } else { - CelDrawLightRedSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8, 1); + CelDrawLightRedSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 1); } } else { CelClippedDrawSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW); @@ -185,7 +185,7 @@ void DrawMissilePrivate(MissileStruct *m, int sx, int sy, BOOL pre) mx = sx + m->_mixoff - m->_miAnimWidth2; my = sy + m->_miyoff; if (m->_miUniqTrans) - Cl2DrawLightTbl(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, 0, 8, m->_miUniqTrans + 3); + Cl2DrawLightTbl(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, m->_miUniqTrans + 3); else if (m->_miLightFlag) Cl2DrawLight(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth); else @@ -253,7 +253,7 @@ static void DrawMonster(int x, int y, int mx, int my, int m) } if (!(dFlags[x][y] & BFLAG_LIT)) { - Cl2DrawLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, 0, 8, 1); + Cl2DrawLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, 1); } else { trans = 0; if (monster[m]._uniqtype) @@ -263,7 +263,7 @@ static void DrawMonster(int x, int y, int mx, int my, int m) if (plr[myplr]._pInfraFlag && light_table_index > 8) trans = 1; if (trans) - Cl2DrawLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, 0, 8, trans); + Cl2DrawLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, trans); else Cl2DrawLight(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width); } @@ -307,7 +307,7 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i 1, misfiledata[MFILE_MANASHLD].mAnimWidth[0]); } else if (!(dFlags[x][y] & BFLAG_LIT) || plr[myplr]._pInfraFlag && light_table_index > 8) { - Cl2DrawLightTbl(px, py, pCelBuff, nCel, nWidth, 0, 8, 1); + Cl2DrawLightTbl(px, py, pCelBuff, nCel, nWidth, 1); if (plr[pnum].pManaShield) Cl2DrawLightTbl( px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0], @@ -315,8 +315,6 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i misfiledata[MFILE_MANASHLD].mAnimData[0], 1, misfiledata[MFILE_MANASHLD].mAnimWidth[0], - 0, - 8, 1); } else { l = light_table_index; @@ -331,9 +329,7 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i py, misfiledata[MFILE_MANASHLD].mAnimData[0], 1, - misfiledata[MFILE_MANASHLD].mAnimWidth[0], - 0, - 8); + misfiledata[MFILE_MANASHLD].mAnimWidth[0]); light_table_index = l; } } @@ -586,7 +582,7 @@ static void scrollrt_draw_dungeon(int sx, int sy, int dx, int dy, int eflag) /// ASSERT: assert(pDeadGuy->_deadData[dd] != NULL); if (pCelBuff != NULL) { if (pDeadGuy->_deadtrans != 0) { - Cl2DrawLightTbl(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, 0, 8, pDeadGuy->_deadtrans); + Cl2DrawLightTbl(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, pDeadGuy->_deadtrans); } else { Cl2DrawLight(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth); }