* @brief Blit CL2 sprite, and apply a given lighting, to the back buffer at the given coordianates * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param pCelBuff CL2 buffer * @param nCel CL2 frame number * @param nWidth Width of sprite * @param light Light shade to use */
| 1296 | * @param light Light shade to use |
| 1297 | */ |
| 1298 | void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light) |
| 1299 | { |
| 1300 | int nDataSize, idx; |
| 1301 | BYTE *pRLEBytes, *pDecodeTo; |
| 1302 | |
| 1303 | assert(gpBuffer != NULL); |
| 1304 | assert(pCelBuff != NULL); |
| 1305 | assert(nCel > 0); |
| 1306 | |
| 1307 | pRLEBytes = CelGetFrameClipped(pCelBuff, nCel, &nDataSize); |
| 1308 | pDecodeTo = &gpBuffer[sx + BUFFER_WIDTH * sy]; |
| 1309 | |
| 1310 | idx = light4flag ? 1024 : 4096; |
| 1311 | if (light == 2) |
| 1312 | idx += 256; |
| 1313 | if (light >= 4) |
| 1314 | idx += (light - 1) << 8; |
| 1315 | |
| 1316 | Cl2BlitLightSafe( |
| 1317 | pDecodeTo, |
| 1318 | pRLEBytes, |
| 1319 | nDataSize, |
| 1320 | nWidth, |
| 1321 | &pLightTbl[idx]); |
| 1322 | } |
| 1323 | |
| 1324 | /** |
| 1325 | * @brief Blit CL2 sprite, and apply lighting, to the given buffer |
no test coverage detected