12345678910111213141516171819202122 |
- #include <compression.h>
- #include "sprite.h"
- #include <debug.h>
- void Sprite_log(char* msg){
- dbg_sprintf(dbgout, "[Sprite] %s\n", msg);
- }
- void free_Sprite(Sprite* self){
- Sprite_log("Freeing sprite");
- free(self->data);
- free(self);
- }
- Sprite* new_Sprite(int width, int height, void* compressed_data){
- gfx_sprite_t* data = gfx_MallocSprite(width, height);
- Sprite* self = (Sprite*)malloc(sizeof(Sprite));
- zx7_Decompress(data, compressed_data);
- self->data = data;
- return self;
- }
|