MCPcopy Create free account
hub / github.com/diasurgical/devilution / CelClippedDrawSafe

Function CelClippedDrawSafe

Source/engine.cpp:232–247  ·  view source on GitHub ↗

* @brief Same as CelClippedDraw but checks for drawing outside the buffer * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param pCelBuff Cel data * @param nCel CEL frame number * @param nWidth Width of sprite */

Source from the content-addressed store, hash-verified

230 * @param nWidth Width of sprite
231 */
232void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
233{
234 BYTE *pRLEBytes;
235 int nDataSize;
236
237 assert(gpBuffer);
238 assert(pCelBuff != NULL);
239
240 pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize);
241
242 CelBlitSafe(
243 &gpBuffer[sx + BUFFER_WIDTH * sy],
244 pRLEBytes,
245 nDataSize,
246 nWidth);
247}
248
249/**
250 * @brief Blit CEL sprite, and apply lighting, to the given buffer, checks for drawing outside the buffer

Callers 1

Calls 2

CelGetFrameClippedFunction · 0.85
CelBlitSafeFunction · 0.85

Tested by

no test coverage detected