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
Sprite* sprite_create_default(void)
{
Position pos = { 0, 0 };
Sprite *s = ec_malloc(sizeof(Sprite));
*s = (Sprite) {
{ NULL, NULL },
(SDL_Rect) { 0, 0, 16, 16 },
false,
pos,
NULL,
0
};
s->textures[0] = NULL;
s->textures[1] = NULL;
s->clip = (SDL_Rect) { 0, 0, 16, 16 };
s->destroyTextures = false;
s->pos = (Position) { 0, 0 };
s->renderTimer = timer_create();
s->texture_index = 0;
return s;
}