| 360 | */ |
| 361 | |
| 362 | char *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 | |
| 394 | char *iff_decompress_tile_rle(ILushort width, ILushort height, ILushort depth, |