| 514 | |
| 515 | |
| 516 | ILuint ILAPIENTRY iReadLump(void *Buffer, const ILuint Size, const ILuint Number) |
| 517 | { |
| 518 | ILuint i, ByteSize = IL_MIN( Size*Number, ReadLumpSize-ReadLumpPos); |
| 519 | |
| 520 | for (i = 0; i < ByteSize; i++) { |
| 521 | *((ILubyte*)Buffer + i) = *((ILubyte*)ReadLump + ReadLumpPos + i); |
| 522 | if (ReadLumpSize > 0) { // ReadLumpSize is too large to care about apparently |
| 523 | if (ReadLumpPos + i > ReadLumpSize) { |
| 524 | ReadLumpPos += i; |
| 525 | if (i != Number) |
| 526 | ilSetError(IL_FILE_READ_ERROR); |
| 527 | return i; |
| 528 | } |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | ReadLumpPos += i; |
| 533 | if (Size != 0) |
| 534 | i /= Size; |
| 535 | if (i != Number) |
| 536 | ilSetError(IL_FILE_READ_ERROR); |
| 537 | return i; |
| 538 | } |
| 539 | |
| 540 | |
| 541 | ILboolean iPreCache(ILuint Size) |
nothing calls this directly
no test coverage detected