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

Function CelDrawLight

Source/engine.cpp:90–105  ·  view source on GitHub ↗

* @brief Blit CEL sprite, and apply lighting, to the back buffer at the given coordinates * @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

88 * @param nWidth Width of sprite
89 */
90void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, BYTE *tbl)
91{
92 int nDataSize;
93 BYTE *pDecodeTo, *pRLEBytes;
94
95 assert(gpBuffer);
96 assert(pCelBuff != NULL);
97
98 pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize);
99 pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy];
100
101 if (light_table_index || tbl)
102 CelBlitLightSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth, tbl);
103 else
104 CelBlitSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth);
105}
106
107/**
108 * @brief Same as CelDrawLight but with the option to skip parts of the top and bottom of the sprite

Callers 3

gmenu_print_textFunction · 0.85
DrawSpellCelFunction · 0.85
PrintCharFunction · 0.85

Calls 3

CelGetFrameFunction · 0.85
CelBlitLightSafeFunction · 0.85
CelBlitSafeFunction · 0.85

Tested by

no test coverage detected