MCPcopy Create free account
hub / github.com/DentonW/DevIL / iffReadUncompressedTile

Function iffReadUncompressedTile

DevIL/src-IL/src/il_iff.cpp:362–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360*/
361
362char *iffReadUncompressedTile(ILushort width, ILushort height, ILbyte depth)
363{
364
365 char *data = NULL;
366 char *iniPixel;
367 char *finPixel;
368 int i, j;
369 int tam = width* height * depth * sizeof(char);
370
371 data = (char*)ialloc(tam);
372 if (data == NULL)
373 return NULL;
374
375 if (iread(data, tam, 1) != 1) {
376 ifree(data);
377 return NULL;
378 }
379
380 iniPixel = data;
381 for (i = 0; i < tam / depth; i++) {
382 finPixel = iniPixel + depth;
383 for (j = 0; j < (depth /2); j++) {
384 char aux;
385 aux = *iniPixel;
386 *(finPixel--) = *iniPixel;
387 *(iniPixel++) = aux;
388 }
389 }
390 return data;
391}
392
393
394char *iff_decompress_tile_rle(ILushort width, ILushort height, ILushort depth,

Callers 1

iLoadIffInternalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected