- size_t spritesheetMemorySize = width * height * sizeof(uint8_t);
- spritesheet = bzMemoryAlloc(arena, spritesheetMemorySize);
- memcpy(spritesheet, data, spritesheetMemorySize);
+ size_t spritesheetDataSize = frames * width * height * sizeof(uint8_t);
+ spritesheet = bzMemoryAlloc(arena, sizeof(BZSpritesheet) + spritesheetDataSize);
+
+ spritesheet->width = width;
+ spritesheet->height = height * frames;
+ spritesheet->spriteCount = frames;
+ spritesheet->spriteWidth = width;
+ spritesheet->spriteHeight = height;
+ memcpy(&spritesheet->data, data, spritesheetDataSize);