Mercurial > molko
comparison libmlk-rpg/mlk/rpg/battle-indicator.c @ 461:d7874f11565f
core: color -> mlk_color
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 27 Feb 2023 09:46:20 +0100 |
parents | 90a097b1aa0f |
children | 01f5580e43d1 |
comparison
equal
deleted
inserted
replaced
460:8fa69c770569 | 461:d7874f11565f |
---|---|
41 | 41 |
42 static inline int | 42 static inline int |
43 colored(const struct battle_indicator *bti) | 43 colored(const struct battle_indicator *bti) |
44 { | 44 { |
45 /* Only check r, g, b and ignore alpha. */ | 45 /* Only check r, g, b and ignore alpha. */ |
46 return COLOR_R(bti->cur) == COLOR_R(bti->color) && | 46 return MLK_COLOR_R(bti->cur) == MLK_COLOR_R(bti->color) && |
47 COLOR_G(bti->cur) == COLOR_G(bti->color) && | 47 MLK_COLOR_G(bti->cur) == MLK_COLOR_G(bti->color) && |
48 COLOR_B(bti->cur) == COLOR_B(bti->color); | 48 MLK_COLOR_B(bti->cur) == MLK_COLOR_B(bti->color); |
49 } | 49 } |
50 | 50 |
51 void | 51 void |
52 battle_indicator_start(struct battle_indicator *bti) | 52 battle_indicator_start(struct battle_indicator *bti) |
53 { | 53 { |
91 if (bti->elapsed > DELAY) { | 91 if (bti->elapsed > DELAY) { |
92 bti->elapsed = 0; | 92 bti->elapsed = 0; |
93 | 93 |
94 if (!colored(bti)) { | 94 if (!colored(bti)) { |
95 /* Update colors first. */ | 95 /* Update colors first. */ |
96 bti->cur = COLOR_HEX( | 96 bti->cur = MLK_COLOR_HEX( |
97 inc(COLOR_R(bti->cur), COLOR_R(bti->color)), | 97 inc(MLK_COLOR_R(bti->cur), MLK_COLOR_R(bti->color)), |
98 inc(COLOR_G(bti->cur), COLOR_G(bti->color)), | 98 inc(MLK_COLOR_G(bti->cur), MLK_COLOR_G(bti->color)), |
99 inc(COLOR_B(bti->cur), COLOR_B(bti->color)), | 99 inc(MLK_COLOR_B(bti->cur), MLK_COLOR_B(bti->color)), |
100 255 | 100 255 |
101 ); | 101 ); |
102 | 102 |
103 texture_set_color_mod(&bti->tex[0], bti->cur); | 103 texture_set_color_mod(&bti->tex[0], bti->cur); |
104 } else { | 104 } else { |