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

Function SS2

src/Engine/Flc.cpp:210–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208} /* COLORS256 */
209
210void SS2()
211{ Uint8 *pSrc, *pDst, *pTmpDst;
212 Sint8 CountData;
213 Uint8 ColumSkip, Fill1, Fill2;
214 Uint16 Lines, Count;
215
216 pSrc=flc.pChunk+6;
217 pDst=(Uint8*)flc.mainscreen->pixels + flc.offset;
218 ReadU16(&Lines, pSrc);
219
220 pSrc+=2;
221 while(Lines--) {
222 ReadU16(&Count, pSrc);
223 pSrc+=2;
224
225 while(Count & 0xc000) {
226/* Upper bits 11 - Lines skip
227*/
228 if((Count & 0xc000)==0xc000) { // 0xc000h = 1100000000000000
229 pDst+=(0x10000-Count)*flc.mainscreen->pitch;
230 }
231
232 if((Count & 0xc000)==0x4000) { // 0x4000h = 0100000000000000
233/* Upper bits 01 - Last pixel
234*/
235#ifdef DEBUG
236 printf("Last pixel not implemented");
237#endif
238 }
239 ReadU16(&Count, pSrc);
240 pSrc+=2;
241 }
242
243 if((Count & SDL_SwapLE16(0xc000))==0x0000) { // 0xc000h = 1100000000000000
244 pTmpDst=pDst;
245 while(Count--) {
246 ColumSkip=*(pSrc++);
247 pTmpDst+=ColumSkip;
248 CountData=*(pSrc++);
249 if(CountData>0) {
250 while(CountData--) {
251 *(pTmpDst++)=*(pSrc++);
252 *(pTmpDst++)=*(pSrc++);
253 }
254 } else {
255 if(CountData<0) {
256 CountData=(0x100-CountData);
257 Fill1=*(pSrc++);
258 Fill2=*(pSrc++);
259 while(CountData--) {
260 *(pTmpDst++)=Fill1;
261 *(pTmpDst++)=Fill2;
262 }
263 }
264 }
265 }
266 pDst+=flc.mainscreen->pitch;
267 }

Callers 1

FlcDoOneFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected