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

Function CelClippedDrawLight

Source/engine.cpp:115–130  ·  view source on GitHub ↗

* @brief Same as CelDrawLight but with the option to skip parts of the top and bottom of the sprite * @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

113 * @param nWidth Width of sprite
114 */
115void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
116{
117 int nDataSize;
118 BYTE *pRLEBytes, *pDecodeTo;
119
120 assert(gpBuffer);
121 assert(pCelBuff != NULL);
122
123 pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize);
124 pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy];
125
126 if (light_table_index)
127 CelBlitLightSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth, NULL);
128 else
129 CelBlitSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth);
130}
131
132/**
133 * @brief Blit CEL sprite, and apply lighting, to the back buffer at the given coordinates, translated to a red hue

Callers 2

DrawObjectFunction · 0.85
DrawItemFunction · 0.85

Calls 3

CelGetFrameClippedFunction · 0.85
CelBlitLightSafeFunction · 0.85
CelBlitSafeFunction · 0.85

Tested by

no test coverage detected