diff --git a/Source/engine.cpp b/Source/engine.cpp index 36f42d09e..ed8a99927 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -1070,27 +1070,18 @@ void Cl2Draw(CelOutputBuffer out, int sx, int sy, BYTE *pCelBuff, int nCel, int Cl2BlitSafe(out, sx, sy, pRLEBytes, nDataSize, nWidth); } -/** - * @brief Blit a solid colder shape one pixel larger then the given sprite shape, to the back buffer at the given coordianates - * @param col Color index from current palette - * @param sx Back buffer coordinate - * @param sy Back buffer coordinate - * @param pCelBuff CL2 buffer - * @param nCel CL2 frame number - * @param nWidth Width of sprite - */ -void Cl2DrawOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) + +void Cl2DrawOutline(CelOutputBuffer out, BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) { int nDataSize; BYTE *pRLEBytes; - assert(gpBuffer != NULL); + assert(out.begin != NULL); assert(pCelBuff != NULL); assert(nCel > 0); pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); - CelOutputBuffer out = GlobalBackBuffer(); out.end -= out.line_width; Cl2BlitOutlineSafe(out, sx, sy, pRLEBytes, nDataSize, nWidth, col); } diff --git a/Source/engine.h b/Source/engine.h index ad18e3e7b..bb61a42be 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -254,18 +254,19 @@ void SetPixel(CelOutputBuffer out, int sx, int sy, BYTE col); void Cl2Draw(CelOutputBuffer out, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); /** - * @brief Blit a solid colder shape one pixel larger then the given sprite shape, to the back buffer at the given coordianates + * @brief Blit a solid colder shape one pixel larger then the given sprite shape, to the given buffer at the given coordianates * @param col Color index from current palette - * @param sx Back buffer coordinate - * @param sy Back buffer coordinate + * @param out Output buffer + * @param sx Output buffer coordinate + * @param sy Output buffer coordinate * @param pCelBuff CL2 buffer * @param nCel CL2 frame number * @param nWidth Width of sprite */ -void Cl2DrawOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); +void Cl2DrawOutline(CelOutputBuffer out, BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); /** - * @brief Blit CL2 sprite, and apply a given lighting, to the back buffer at the given coordianates + * @brief Blit CL2 sprite, and apply a given lighting, to the given buffer at the given coordianates * @param out Output buffer * @param sx Output buffer coordinate * @param sy Output buffer coordinate @@ -277,7 +278,7 @@ void Cl2DrawOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid void Cl2DrawLightTbl(CelOutputBuffer out, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light); /** - * @brief Blit CL2 sprite, and apply lighting, to the back buffer at the given coordinates + * @brief Blit CL2 sprite, and apply lighting, to the given buffer at the given coordinates * @param out Output buffer * @param sx Output buffer coordinate * @param sy Output buffer coordinate diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 3ef0daa8d..8cfac3a5c 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -431,7 +431,7 @@ static void DrawPlayer(CelOutputBuffer out, int pnum, int x, int y, int px, int } if (pnum == pcursplr) - Cl2DrawOutline(165, px, py, pCelBuff, nCel, nWidth); + Cl2DrawOutline(out, 165, px, py, pCelBuff, nCel, nWidth); if (pnum == myplr) { Cl2Draw(out, px, py, pCelBuff, nCel, nWidth); @@ -695,7 +695,7 @@ static void DrawMonsterHelper(CelOutputBuffer out, int x, int y, int oy, int sx, px = sx + pMonster->_mxoff - pMonster->MType->width2; py = sy + pMonster->_myoff; if (mi == pcursmonst) { - Cl2DrawOutline(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width); + Cl2DrawOutline(out, 233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width); } DrawMonster(out, x, y, px, py, mi); }