NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_coin.cpp
1#include <game/bases/d_coin.hpp>
2
11
13 static const u8 l_h_block_time[] = {12, 8, 8, 8};
14 static const u8 l_b_block_time[] = {50, 6, 6, 6};
15
16 m_ptn_no = m_frame / 8;
17
18 if (m_ptn_no >= 4) {
19 m_ptn_no -= 4;
20 }
21
22 m_shapeAngle.y = m_frame * (0x10000 / COIN_FRAME_COUNT);
23
24 if (++m_frame >= COIN_FRAME_COUNT) {
25 m_frame = 0;
26 }
27
29 if (m_h_ptn_time == 0) {
30 if (++m_h_ptn_no >= ARRAY_SIZE(l_h_block_time)) {
31 m_h_ptn_no = 0;
32 m_h_shapeAngle.y = ((s16)m_h_shapeAngle.y + 0x3FFF) & 0xC000;
33 }
34
35 m_h_ptn_time = l_h_block_time[m_h_ptn_no];
36 }
37
38 if (m_h_ptn_no != 0) {
39 m_h_shapeAngle.y += 0x2AA;
40 }
41
43 if (m_b_ptn_time == 0) {
44 if (++m_b_ptn_no >= ARRAY_SIZE(l_b_block_time)) {
45 m_b_ptn_no = 0;
46 }
47
48 m_b_ptn_time = l_b_block_time[m_b_ptn_no];
49 }
50
51 return 1;
52}
static int execute()
Executes coin rotation.
Definition d_coin.cpp:12
static u8 m_b_ptn_time
The remaining time for the current brick block tile frame.
Definition d_coin.hpp:22
static u8 m_frame
The coin rotation animation frame.
Definition d_coin.hpp:17
static u8 m_h_ptn_no
The current animated tile frame for question blocks.
Definition d_coin.hpp:19
static u8 m_b_ptn_no
The current animated tile frame for brick blocks.
Definition d_coin.hpp:21
static u8 m_ptn_no
The current animated tile frame for coins.
Definition d_coin.hpp:18
static mAng3_c m_h_shapeAngle
Definition d_coin.hpp:16
static mAng3_c m_shapeAngle
The rotation to be applied to every coin.
Definition d_coin.hpp:15
static u8 m_h_ptn_time
The remaining time for the current question block tile frame.
Definition d_coin.hpp:20
static const int COIN_FRAME_COUNT
The coin rotation animation frame count.
Definition d_coin.hpp:14
A three-dimensional short angle vector.
Definition m_angle.hpp:59