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

Function ILAPIENTRY iSizeSeek

DevIL/src-IL/src/il_size.cpp:24–51  ·  view source on GitHub ↗

Fake seek function

Source from the content-addressed store, hash-verified

22
23//! Fake seek function
24ILint ILAPIENTRY iSizeSeek(ILint Offset, ILuint Mode)
25{
26 switch (Mode)
27 {
28 case IL_SEEK_SET:
29 CurPos = Offset;
30 if (CurPos > MaxPos)
31 MaxPos = CurPos;
32 break;
33
34 case IL_SEEK_CUR:
35 CurPos = CurPos + Offset;
36 break;
37
38 case IL_SEEK_END:
39 CurPos = MaxPos + Offset; // Offset should be negative in this case.
40 break;
41
42 default:
43 ilSetError(IL_INTERNAL_ERROR); // Should never happen!
44 return -1; // Error code
45 }
46
47 if (CurPos > MaxPos)
48 MaxPos = CurPos;
49
50 return 0; // Code for success
51}
52
53ILuint ILAPIENTRY iSizeTell(void)
54{

Callers

nothing calls this directly

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected