Ei kuvausta

grass_animation.c 1.4KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include <oe_animation.h>
  2. #include <npc.h>
  3. #include <save_one.h>
  4. #include <agb_debug.h>
  5. extern u16 current_map_block_role_get(u16 x, u16 y);
  6. void sp_check_tileset(void);
  7. void grass_step_general(struct npc_state *npc)
  8. {
  9. current_oe_state.to_x___local_id = npc->to.x;
  10. current_oe_state.to_y___local_mapnumber = npc->to.y;
  11. current_oe_state.height_lsr_4___local_mapbank = (npc->height) >> 4;
  12. current_oe_state.field_C = 2;
  13. current_oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_mapnumber);
  14. current_oe_state.local_mapbank = npc->local_mapbank;
  15. current_oe_state.sav1_location = (((sav_one->location.map) << 8) | sav_one->location.bank);
  16. current_oe_state.field_1C = 1;
  17. (void)oe_exec(4);
  18. }
  19. void grass_step_elastic(struct npc_state *npc)
  20. {
  21. current_oe_state.to_x___local_id = npc->to.x;
  22. current_oe_state.to_y___local_mapnumber = npc->to.y;
  23. current_oe_state.height_lsr_4___local_mapbank = (npc->height) >> 4;
  24. current_oe_state.field_C = 2;
  25. current_oe_state.local_id_and_mapnumber = (npc->local_id << 8) | (npc->local_mapnumber);
  26. current_oe_state.local_mapbank = npc->local_mapbank;
  27. current_oe_state.sav1_location = (((sav_one->location.map) << 8) | sav_one->location.bank);
  28. current_oe_state.field_1C = 0;
  29. /* use variable to determine the oe animation to play */
  30. (void)oe_exec(4);
  31. }