Mercurial > molko
comparison libmlk-core/core/sprite.c @ 298:196264679079
misc: remove usage of bool
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 10 Mar 2021 18:49:08 +0100 |
parents | cc676046aac9 |
children | d01e83210ca2 |
comparison
equal
deleted
inserted
replaced
297:6151152d009c | 298:196264679079 |
---|---|
35 sprite->cellh = cellh; | 35 sprite->cellh = cellh; |
36 sprite->nrows = tex->h / cellh; | 36 sprite->nrows = tex->h / cellh; |
37 sprite->ncols = tex->w / cellw; | 37 sprite->ncols = tex->w / cellw; |
38 } | 38 } |
39 | 39 |
40 bool | 40 int |
41 sprite_ok(const struct sprite *sprite) | 41 sprite_ok(const struct sprite *sprite) |
42 { | 42 { |
43 if (!sprite) | 43 return sprite && texture_ok(sprite->texture) && sprite->cellw != 0 && sprite->cellh != 0; |
44 return false; | |
45 | |
46 return texture_ok(sprite->texture) && sprite->cellw != 0 && sprite->cellh != 0; | |
47 } | 44 } |
48 | 45 |
49 bool | 46 int |
50 sprite_draw(const struct sprite *sprite, unsigned int r, unsigned int c, int x, int y) | 47 sprite_draw(const struct sprite *sprite, unsigned int r, unsigned int c, int x, int y) |
51 { | 48 { |
52 return sprite_scale(sprite, r, c, x, y, sprite->cellw, sprite->cellh); | 49 return sprite_scale(sprite, r, c, x, y, sprite->cellw, sprite->cellh); |
53 } | 50 } |
54 | 51 |
55 bool | 52 int |
56 sprite_scale(const struct sprite *sprite, | 53 sprite_scale(const struct sprite *sprite, |
57 unsigned int r, | 54 unsigned int r, |
58 unsigned int c, | 55 unsigned int c, |
59 int x, | 56 int x, |
60 int y, | 57 int y, |