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

Function Sprites_Decode

src/sprites.c:181–206  ·  view source on GitHub ↗

* Decodes an image. * * @param source The encoded image. * @param dest The place the decoded image will be. * @return The size of the decoded image. */

Source from the content-addressed store, hash-verified

179 * @return The size of the decoded image.
180 */
181static uint32 Sprites_Decode(uint8 *source, uint8 *dest)
182{
183 uint32 size = 0;
184
185 switch(*source) {
186 case 0x0:
187 source += 2;
188 size = READ_LE_UINT32(source);
189 source += 4;
190 source += READ_LE_UINT16(source);
191 source += 2;
192 memmove(dest, source, size);
193 break;
194
195 case 0x4:
196 source += 6;
197 source += READ_LE_UINT16(source);
198 source += 2;
199 size = Format80_Decode(dest, source, 0xFFFF);
200 break;
201
202 default: break;
203 }
204
205 return size;
206}
207
208/**
209 * Loads an ICN file.

Callers 2

Tiles_LoadICNFileFunction · 0.85
Sprites_LoadCPSFileFunction · 0.85

Calls 1

Format80_DecodeFunction · 0.85

Tested by

no test coverage detected