diff options
| author | Aetias <aetias@outlook.com> | 2024-03-19 17:53:59 +0100 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2024-03-19 17:53:59 +0100 |
| commit | 6f707bb31d5411e8292b8df833f1faccfc70fc64 (patch) | |
| tree | bda79a2cb0e6d63a7b5f3f49897e773fe82175ad /include/Player | |
| parent | f9f944ae47471903b1f56e2d53a6199e3dc71cc9 (diff) | |
Add `TouchControl.s`
Diffstat (limited to 'include/Player')
| -rw-r--r-- | include/Player/TouchControl.hpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/Player/TouchControl.hpp b/include/Player/TouchControl.hpp new file mode 100644 index 00000000..804078c9 --- /dev/null +++ b/include/Player/TouchControl.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "global.h" +#include "types.h" +#include "lib/touch.h" + +typedef u16 TouchFlags; +enum TouchFlag_ { + TouchFlag_TouchedNow = 0x0001, + TouchFlag_UntouchedNow = 0x0002, + TouchFlag_Repeat = 0x0004, +}; + +class TouchControl { +public: + /* 00 */ u16 mSpeed; + /* 02 */ u16 mTimeBetweenTouches; // gets set to mTimeSinceTouch when touching the screen + /* 04 */ u16 mTimeSinceTouch; // increases by mSpeed every frame + /* 06 */ unk16 mRepeatStart; + /* 08 */ unk16 mRepeatLoop; + // mRepeatTimer starts at mRepeatStart, decreases by mSpeed while touching the screen. + // if equal to 0, mRepeatTimer gets set to mRepeatLoop and the Repeat flag is set + /* 0a */ unk16 mRepeatTimer; + /* 0c */ bool mTouch; + /* 10 */ s32 mTouchX; + /* 14 */ s32 mTouchY; + /* 18 */ bool mTouchPrev; + /* 1c */ s32 mTouchPrevX; + /* 20 */ s32 mTouchPrevY; + /* 24 */ s32 mTouchLastX; + /* 28 */ s32 mTouchLastY; + /* 2c */ s32 mTouchStartX; + /* 30 */ s32 mTouchStartY; + /* 34 */ TouchFlags mFlags; + /* 36 */ + + TouchControl(); + void IncreaseSpeed(s16 increase); + void UpdateFlags(u16 speed); + void UpdateWithStateFlags(TouchStateFlags *state, u16 speed); + void Update(TouchState *state, u16 speed); + bool func_ov00_0207aeac(); + void UpdateConditionally(TouchState *state, u16 speed); + void func_ov00_0207af38(u16 speed, bool param2); +}; |
