summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-08 05:22:39 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-08 05:30:38 +0100
commit01ad5e60b4e9363dc1a0e3122eb65da1d5f49b92 (patch)
tree7879345b0ab4f82596b258ba8cc93a4c865b76ec
parentfc6ca98f8bb4fd0e9399220a1614bb6847259283 (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>
-rw-r--r--blits.c8
1 files changed, 4 insertions, 4 deletions
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]);
}
}
}