Cleaner sprite creation.
This commit is contained in:
parent
025bd3eda2
commit
c128a5dc39
17
src/sprite.c
17
src/sprite.c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue