MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / WSA_GetFrameOffset_FromMemory

Function WSA_GetFrameOffset_FromMemory

src/wsa.c:80–96  ·  view source on GitHub ↗

* Get the offset in the fileContent which stores the animation data for a * given frame. * @param header The header of the WSA. * @param frame The frame of animation. * @return The offset for the animation from the beginning of the fileContent. */

Source from the content-addressed store, hash-verified

78 * @return The offset for the animation from the beginning of the fileContent.
79 */
80static uint32 WSA_GetFrameOffset_FromMemory(WSAHeader *header, uint16 frame)
81{
82 uint16 lengthAnimation = 0;
83 uint32 animationFrame;
84 uint32 animation0;
85
86 animationFrame = READ_LE_UINT32(header->fileContent + frame * 4);
87
88 if (animationFrame == 0) return 0;
89
90 animation0 = READ_LE_UINT32(header->fileContent);
91 if (animation0 != 0) {
92 lengthAnimation = READ_LE_UINT32(header->fileContent + 4) - animation0;
93 }
94
95 return animationFrame - lengthAnimation - 10;
96}
97
98/**
99 * Get the offset in the file which stores the animation data for a given

Callers 2

WSA_GotoNextFrameFunction · 0.85
WSA_LoadFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected