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

Function Cl2DrawLight

Source/engine.cpp:1412–1428  ·  view source on GitHub ↗

* @brief Blit CL2 sprite, and apply lighting, to the back buffer at the given coordinates * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param pCelBuff CL2 buffer * @param nCel CL2 frame number * @param nWidth Width of sprite */

Source from the content-addressed store, hash-verified

1410 * @param nWidth Width of sprite
1411 */
1412void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
1413{
1414 int nDataSize;
1415 BYTE *pRLEBytes, *pDecodeTo;
1416
1417 assert(gpBuffer != NULL);
1418 assert(pCelBuff != NULL);
1419 assert(nCel > 0);
1420
1421 pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize);
1422 pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy];
1423
1424 if (light_table_index)
1425 Cl2BlitLightSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth, &pLightTbl[light_table_index * 256]);
1426 else
1427 Cl2BlitSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth);
1428}
1429
1430/**
1431 * @brief Fade to black and play a video

Callers 4

DrawMissilePrivateFunction · 0.85
DrawMonsterFunction · 0.85
DrawPlayerFunction · 0.85
scrollrt_draw_dungeonFunction · 0.85

Calls 3

CelGetFrameClippedFunction · 0.85
Cl2BlitLightSafeFunction · 0.85
Cl2BlitSafeFunction · 0.85

Tested by

no test coverage detected