Mercurial > molko
comparison libmlk-rpg/mlk/rpg/battle-state-check.c @ 442:9c3b3935f0aa
core: rework allocations
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 03 Nov 2022 21:09:25 +0100 |
parents | 25a56ca53ac2 |
children | 773a082f0b91 |
comparison
equal
deleted
inserted
replaced
441:31c1bbc33813 | 442:9c3b3935f0aa |
---|---|
86 if (!bt->effects) { | 86 if (!bt->effects) { |
87 tracef("can't create a fadeout effect without a drawable_stack"); | 87 tracef("can't create a fadeout effect without a drawable_stack"); |
88 return; | 88 return; |
89 } | 89 } |
90 | 90 |
91 fade = mlk_alloc_new0(sizeof (*fade)); | 91 fade = mlk_alloc_new0(1, sizeof (*fade)); |
92 fade->ch = et->ch; | 92 fade->ch = et->ch; |
93 fade->x = et->x; | 93 fade->x = et->x; |
94 fade->y = et->y; | 94 fade->y = et->y; |
95 fade->alpha = 250; | 95 fade->alpha = 250; |
96 fade->dw.data = fade; | 96 fade->dw.data = fade; |
195 { | 195 { |
196 assert(battle_ok(bt)); | 196 assert(battle_ok(bt)); |
197 | 197 |
198 struct battle_state *self; | 198 struct battle_state *self; |
199 | 199 |
200 self = mlk_alloc_new0(sizeof (*self)); | 200 self = mlk_alloc_new0(1, sizeof (*self)); |
201 self->data = bt; | 201 self->data = bt; |
202 self->update = update; | 202 self->update = update; |
203 self->draw = draw; | 203 self->draw = draw; |
204 self->finish = finish; | 204 self->finish = finish; |
205 | 205 |