diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-01-08 05:22:39 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-01-08 05:30:38 +0100 |
commit | 01ad5e60b4e9363dc1a0e3122eb65da1d5f49b92 (patch) | |
tree | 7879345b0ab4f82596b258ba8cc93a4c865b76ec /blits.c | |
parent | fc6ca98f8bb4fd0e9399220a1614bb6847259283 (diff) |
fix invalid display of the affinities
we used to loop through the elements in our outer loop and the
affinities in the inner one.
However since, the display is done line by line, we have to do the
contrary.
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'blits.c')
-rw-r--r-- | blits.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -294,12 +294,12 @@ void blit_character_affinities(SURFACES *surfaces, POSITIONS *positions, const s AFFINITY_ABSORPTION, }; - for (enum element_t elmt = 0; elmt < ELEMENT_COUNT; ++elmt) { - for (int i = 0; i < countof(affinities); ++i) { + for (int i = 0; i < countof(affinities); ++i) { + for (enum element_t elmt = 0; elmt < ELEMENT_COUNT; ++elmt) { if (chr->affinities[elmt] == affinities[i]) { - SDL_BlitSurface (surfaces->Pactive,NULL,surfaces->Pecran,&positions->Vpositionactivedesactive[i + elmt * countof(affinities)]); + SDL_BlitSurface (surfaces->Pactive,NULL,surfaces->Pecran,&positions->Vpositionactivedesactive[i * ELEMENT_COUNT + elmt]); } else { - SDL_BlitSurface (surfaces->Pdesactive,NULL,surfaces->Pecran,&positions->Vpositionactivedesactive[i + elmt * countof(affinities)]); + SDL_BlitSurface (surfaces->Pdesactive,NULL,surfaces->Pecran,&positions->Vpositionactivedesactive[i * ELEMENT_COUNT + elmt]); } } } |