Browse Source

fix main animator

SBird1337 7 years ago
parent
commit
8cdcf07eec
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/overworld/tileset_animation/main_animator.c

+ 3
- 3
src/overworld/tileset_animation/main_animator.c View File

19
     while (anim[current_animation].image != (void*)0xFFFFFFFF) {
19
     while (anim[current_animation].image != (void*)0xFFFFFFFF) {
20
         void *current_vram = vram_address + (0x20 * anim[current_animation].tile_start);
20
         void *current_vram = vram_address + (0x20 * anim[current_animation].tile_start);
21
         u16 max_frame = anim[current_animation].frame_lenght * anim[current_animation].frame_count;
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
         memcpy(current_vram,
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
                anim[current_animation].tile_length * 0x20);
26
                anim[current_animation].tile_length * 0x20);
27
         current_animation++;
27
         current_animation++;
28
     }
28
     }