MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / DECODE_COLOR

Function DECODE_COLOR

src/Engine/Flc.cpp:344–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342} /* DECODE_LC */
343
344void DECODE_COLOR()
345{ Uint8 *pSrc;
346 Uint16 NumColors, NumColorPackets;
347 Uint8 NumColorsSkip;
348 int i;
349
350 pSrc=flc.pChunk+6;
351 ReadU16(&NumColorPackets, pSrc);
352 pSrc+=2;
353 while(NumColorPackets--) {
354 NumColorsSkip=*(pSrc++);
355 if(!(NumColors=*(pSrc++))) {
356 NumColors=256;
357 }
358 i=0;
359 while(NumColors--) {
360 flc.colors[i].r=*(pSrc++)<<2;
361 flc.colors[i].g=*(pSrc++)<<2;
362 flc.colors[i].b=*(pSrc++)<<2;
363 i++;
364 }
365 flc.realscreen->setPalette(flc.colors, NumColorsSkip, i);
366 SDL_SetColors(flc.mainscreen, flc.colors, NumColorsSkip, i);
367 flc.realscreen->getSurface(); // force palette update to really happen
368 }
369} /* DECODE_COLOR */
370
371
372void DECODE_COPY()

Callers 1

FlcDoOneFrameFunction · 0.85

Calls 2

setPaletteMethod · 0.45
getSurfaceMethod · 0.45

Tested by

no test coverage detected