From 01ad5e60b4e9363dc1a0e3122eb65da1d5f49b92 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 8 Jan 2015 05:22:39 +0100 Subject: 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 --- blits.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'blits.c') diff --git a/blits.c b/blits.c index 24bdd93..23913d8 100644 --- a/blits.c +++ b/blits.c @@ -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]); } } } -- cgit v1.2.3