helos1/graphics/xcursor/xcursor.c

19 lines
404 B
C
Raw Permalink Normal View History

2021-10-10 23:16:23 +08:00
#include "xcursor.h"
#include <string.h>
void xcursor_LoadMemory(xcursor_Xcursor *cursor, void *file, uintptr_t fileSize) {
cursor->header = 0;
xcursor_Header *head = file;
if (memcmp(head->magic, XCURSOR_MAGIC, XCURSOR_MAGIC_SIZE) != 0)
return; // magic mismatch
cursor->size = fileSize;
cursor->n = head->numTOC;
cursor->toc = file + head->headerSize;
cursor->header = head;
}