Selaa lähdekoodia

fix main animator

SBird1337 7 vuotta sitten
vanhempi
commit
8cdcf07eec
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3
    3
      src/overworld/tileset_animation/main_animator.c

+ 3
- 3
src/overworld/tileset_animation/main_animator.c Näytä tiedosto

@@ -19,10 +19,10 @@ void animate_from_structure(const struct TilesetAnimation *anim, u16 tile_skip,
19 19
     while (anim[current_animation].image != (void*)0xFFFFFFFF) {
20 20
         void *current_vram = vram_address + (0x20 * anim[current_animation].tile_start);
21 21
         u16 max_frame = anim[current_animation].frame_lenght * anim[current_animation].frame_count;
22
-        current_frame = current_frame % max_frame;
23
-        current_frame /= anim[current_animation].frame_lenght;
22
+        u16 used_frame = current_frame % max_frame;
23
+        used_frame /= anim[current_animation].frame_lenght;
24 24
         memcpy(current_vram,
25
-               anim[current_animation].image + (0x20 * anim[current_animation].tile_length * current_frame),
25
+               anim[current_animation].image + (0x20 * anim[current_animation].tile_length * used_frame),
26 26
                anim[current_animation].tile_length * 0x20);
27 27
         current_animation++;
28 28
     }