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

Function ILAPIENTRY iSeekWLump

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

Returns 1 on error, 0 on success

Source from the content-addressed store, hash-verified

729
730// Returns 1 on error, 0 on success
731ILint ILAPIENTRY iSeekWLump(ILint Offset, ILuint Mode)
732{
733 switch (Mode)
734 {
735 case IL_SEEK_SET:
736 if (Offset > (ILint)WriteLumpSize)
737 return 1;
738 WriteLumpPos = Offset;
739 break;
740
741 case IL_SEEK_CUR:
742 if (WriteLumpPos + Offset > WriteLumpSize)
743 return 1;
744 WriteLumpPos += Offset;
745 break;
746
747 case IL_SEEK_END:
748 if (Offset > 0)
749 return 1;
750 // Should we use >= instead?
751 if (abs(Offset) > (ILint)WriteLumpSize) // If WriteLumpSize == 0, too bad
752 return 1;
753 WriteLumpPos = WriteLumpSize + Offset;
754 break;
755
756 default:
757 return 1;
758 }
759
760 return 0;
761}
762
763
764ILuint ILAPIENTRY iTellWFile(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected