MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY iWriteLump

Function ILAPIENTRY iWriteLump

DevIL/src-IL/src/il_files.cpp:699–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697
698
699ILint ILAPIENTRY iWriteLump(const void *Buffer, ILuint Size, ILuint Number)
700{
701 ILuint SizeBytes = Size * Number;
702 ILuint i = 0;
703
704 for (; i < SizeBytes; i++) {
705 if (WriteLumpSize > 0) {
706 if (WriteLumpPos + i >= WriteLumpSize) { // Should we use > instead?
707 ilSetError(IL_FILE_WRITE_ERROR);
708 WriteLumpPos += i;
709 return i;
710 }
711 }
712
713 *((ILubyte*)WriteLump + WriteLumpPos + i) = *((ILubyte*)Buffer + i);
714 }
715
716 WriteLumpPos += SizeBytes;
717
718 return SizeBytes;
719}
720
721
722ILint ILAPIENTRY iSeekWFile(ILint Offset, ILuint Mode)

Callers

nothing calls this directly

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected