diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -460,7 +460,7 @@ typedef struct ButtonSprite { | |||
460 | int x; | 460 | int x; |
461 | int y; | 461 | int y; |
462 | int frame; | 462 | int frame; |
463 | GbaBtnState state; | 463 | BtnState state; |
464 | } ButtonSprite; | 464 | } ButtonSprite; |
465 | 465 | ||
466 | #define NUM_SPRITES 128 | 466 | #define NUM_SPRITES 128 |
@@ -516,7 +516,7 @@ int main(void) { | |||
516 | .x = buttons_x, | 516 | .x = buttons_x, |
517 | .y = buttons_y, | 517 | .y = buttons_y, |
518 | .frame = 0, | 518 | .frame = 0, |
519 | .state = GBA_BTN_STATE_IDLE, | 519 | .state = BTN_STATE_IDLE, |
520 | }; | 520 | }; |
521 | OBJ_ATTR_0(btn_b.id) = btn_b.y; | 521 | OBJ_ATTR_0(btn_b.id) = btn_b.y; |
522 | OBJ_ATTR_1(btn_b.id) = btn_b.x | (1 << 0xF); | 522 | OBJ_ATTR_1(btn_b.id) = btn_b.x | (1 << 0xF); |
@@ -527,7 +527,7 @@ int main(void) { | |||
527 | .x = buttons_x + 20, | 527 | .x = buttons_x + 20, |
528 | .y = buttons_y - 16, | 528 | .y = buttons_y - 16, |
529 | .frame = 0, | 529 | .frame = 0, |
530 | .state = GBA_BTN_STATE_IDLE, | 530 | .state = BTN_STATE_IDLE, |
531 | }; | 531 | }; |
532 | OBJ_ATTR_0(btn_a.id) = btn_a.y; | 532 | OBJ_ATTR_0(btn_a.id) = btn_a.y; |
533 | OBJ_ATTR_1(btn_a.id) = btn_a.x | (1 << 0xF); | 533 | OBJ_ATTR_1(btn_a.id) = btn_a.x | (1 << 0xF); |
@@ -551,7 +551,7 @@ int main(void) { | |||
551 | } | 551 | } |
552 | if (key_pressed(KEY_B)) { | 552 | if (key_pressed(KEY_B)) { |
553 | btn_b.frame = 0; | 553 | btn_b.frame = 0; |
554 | btn_b.state = GBA_BTN_STATE_PRESSED; | 554 | btn_b.state = BTN_STATE_PRESSED; |
555 | } else if (key_hold(KEY_B)) { | 555 | } else if (key_hold(KEY_B)) { |
556 | size_t n_frames = animation_states[btn_b.state]->n_frames; | 556 | size_t n_frames = animation_states[btn_b.state]->n_frames; |
557 | if (btn_b.frame < n_frames - 1) { | 557 | if (btn_b.frame < n_frames - 1) { |
@@ -564,12 +564,12 @@ int main(void) { | |||
564 | btn_b.frame++; | 564 | btn_b.frame++; |
565 | } else { | 565 | } else { |
566 | btn_b.frame = 0; | 566 | btn_b.frame = 0; |
567 | btn_b.state = GBA_BTN_STATE_IDLE; | 567 | btn_b.state = BTN_STATE_IDLE; |
568 | } | 568 | } |
569 | } | 569 | } |
570 | if (key_pressed(KEY_A)) { | 570 | if (key_pressed(KEY_A)) { |
571 | btn_a.frame = 0; | 571 | btn_a.frame = 0; |
572 | btn_a.state = GBA_BTN_STATE_PRESSED; | 572 | btn_a.state = BTN_STATE_PRESSED; |
573 | } else if (key_hold(KEY_A)) { | 573 | } else if (key_hold(KEY_A)) { |
574 | size_t n_frames = animation_states[btn_a.state]->n_frames; | 574 | size_t n_frames = animation_states[btn_a.state]->n_frames; |
575 | if (btn_a.frame < n_frames - 1) { | 575 | if (btn_a.frame < n_frames - 1) { |
@@ -582,7 +582,7 @@ int main(void) { | |||
582 | btn_a.frame++; | 582 | btn_a.frame++; |
583 | } else { | 583 | } else { |
584 | btn_a.frame = 0; | 584 | btn_a.frame = 0; |
585 | btn_a.state = GBA_BTN_STATE_IDLE; | 585 | btn_a.state = BTN_STATE_IDLE; |
586 | } | 586 | } |
587 | } | 587 | } |
588 | if (key_pressed(KEY_L)) { | 588 | if (key_pressed(KEY_L)) { |