Cleaner sprite creation.

This commit is contained in:
Linus Probert 2017-12-19 23:30:58 +01:00
parent 025bd3eda2
commit c128a5dc39
1 changed files with 6 additions and 11 deletions

View File

@ -4,19 +4,14 @@
static static
Sprite* sprite_create_default(void) Sprite* sprite_create_default(void)
{ {
Position pos = { 0, 0 };
Sprite *s = ec_malloc(sizeof(Sprite)); Sprite *s = ec_malloc(sizeof(Sprite));
*s = (Sprite) { s->textures[0] = NULL;
{ NULL, NULL }, s->textures[1] = NULL;
(SDL_Rect) { 0, 0, 16, 16 }, s->clip = (SDL_Rect) { 0, 0, 16, 16 };
false, s->destroyTextures = false;
pos, s->pos = (Position) { 0, 0 };
NULL,
0
};
s->renderTimer = timer_create(); s->renderTimer = timer_create();
s->texture_index = 0;
return s; return s;
} }