comparison libmlk-rpg/mlk/rpg/battle-indicator.c @ 486:d6757c30658e

core: rework errors
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:04:13 +0100
parents bc5483849614
children 2af25db99273
comparison
equal deleted inserted replaced
485:3ff1fe64d0cd 486:d6757c30658e
53 { 53 {
54 assert(bti); 54 assert(bti);
55 55
56 char buf[128]; 56 char buf[128];
57 const struct theme *theme = THEME(bti); 57 const struct theme *theme = THEME(bti);
58 int err;
58 59
59 snprintf(buf, sizeof (buf), "%u", bti->amount); 60 snprintf(buf, sizeof (buf), "%u", bti->amount);
60 61
61 bti->cur = 0xffffffff; 62 bti->cur = 0xffffffff;
62 bti->elapsed = 0; 63 bti->elapsed = 0;
63 bti->alpha = 250; 64 bti->alpha = 250;
64 65
65 if (mlk_font_render(theme->fonts[THEME_FONT_INTERFACE], &bti->tex[0], buf, bti->cur) < 0|| 66 if ((err = mlk_font_render(theme->fonts[THEME_FONT_INTERFACE], &bti->tex[0], buf, bti->cur)) < 0 ||
66 mlk_font_render(theme->fonts[THEME_FONT_INTERFACE], &bti->tex[1], buf, 0x000000ff) < 0) 67 (err = mlk_font_render(theme->fonts[THEME_FONT_INTERFACE], &bti->tex[1], buf, 0x000000ff)) < 0)
67 mlk_panic(); 68 mlk_panic(err);
68 } 69 }
69 70
70 int 71 int
71 battle_indicator_completed(const struct battle_indicator *bti) 72 battle_indicator_completed(const struct battle_indicator *bti)
72 { 73 {