Files

145 lines
5.0 KiB
C++
Raw Permalink Normal View History

2024-03-21 23:22:54 +01:00
#pragma once
#include "global.h"
2025-01-18 15:50:03 +01:00
#include "nds/math.h"
2024-03-21 23:22:54 +01:00
#include "types.h"
2024-04-06 09:26:14 +02:00
#include "Actor/Actor.hpp"
2024-10-12 16:16:32 +02:00
#include "Actor/ActorManager.hpp"
2024-04-06 09:26:14 +02:00
#include "Debug/DebugHierarchy.hpp"
#include "Item/Item.hpp"
2024-10-12 16:16:32 +02:00
#include "Player/TouchControl.hpp"
#include "Player/TouchGesture.hpp"
2024-04-06 09:26:14 +02:00
2025-02-16 16:07:22 +01:00
typedef s16 TouchEdge;
2024-03-21 23:22:54 +01:00
enum TouchEdge_ {
2024-10-12 16:16:32 +02:00
TouchEdge_Right = 0,
TouchEdge_Left = 1,
2024-03-21 23:22:54 +01:00
TouchEdge_Bottom = 2,
2024-10-12 16:16:32 +02:00
TouchEdge_Top = 3,
2024-03-21 23:22:54 +01:00
TouchEdge_Middle = 4
};
class PlayerControl : public TouchControl {
2024-04-06 09:26:14 +02:00
public:
2024-03-21 23:22:54 +01:00
/* 00 (base) */
/* 38 */ Vec3p mTouchWorld; // tile position
/* 44 */ Vec3p mUnk_44;
/* 50 */ q20 mTouchSpeedX; // how fast the stylus moves
/* 54 */ q20 mTouchSpeedY;
/* 58 */ q20 mTouchDist; // pixel distance from touch to link, deadzone is 20 pixels
2025-02-09 09:38:23 +01:00
/* 5c */ q20 mTouchSpeed;
2024-03-21 23:22:54 +01:00
/* 60 */ s16 mTouchDuration;
/* 62 */ s16 mTouchSlowDuration; // resets to 0 if stylus is fast enough
/* 64 */ s16 mTouchFastTime; // gets set to mTouchDuration if stylus is fast enough
/* 66 */ s16 mTouchFastX; // gets set to mTouchX if stylus is fast enough
/* 68 */ s16 mTouchFastY; // gets set to mTouchY if stylus is fast enough
/* 6a */ s16 mTouchAngle; // angle from touch to link, 0 = down, 0x4000 = right, 0x8000 = up, 0xc000 = left
/* 6c */ s16 mTouchFastAngle; // gets set to mTouchAngle if stylus is fast enough
/* 6e */ TouchEdge mTouchEdge; // changes value when touching close to the edge of the screen
/* 70 */ TouchEdge mTouchLastEdge;
/* 72 */ s16 mTouchDiffX;
/* 74 */ s16 mTouchDiffY;
/* 76 */ bool mTouchFast;
2024-04-06 09:26:14 +02:00
/* 77 */ unk8 mUnk_77;
/* 78 */ bool mUnk_78;
/* 79 */ bool mUsingEquipItem;
/* 7a */ bool mUnk_7a;
/* 7b */ bool mUnk_7b;
2025-01-10 09:27:01 +01:00
/* 7c */ u8 mUnk_7c;
2024-04-06 09:26:14 +02:00
/* 7d */ bool mUnk_7d;
2025-01-09 08:24:32 +01:00
/* 7e */ u8 mUnk_7e;
2024-04-06 09:26:14 +02:00
/* 7f */ bool mUnk_7f;
/* 80 */ bool mUnk_80;
/* 81 */ bool mFollowing;
2025-02-16 16:07:22 +01:00
/* 82 */ bool mUnk_82;
2024-04-06 09:26:14 +02:00
/* 83 */ bool mUnk_83;
/* 84 */ ActorRef mFollowRef;
/* 8c */ ActorRef mNextFollowRef;
/* 94 */ ActorRef mLastFollowRef;
2025-02-09 09:38:23 +01:00
/* 9c */ Vec2b mUnk_9c;
2024-04-06 09:26:14 +02:00
/* 9e */ unk8 mUnk_9e[2];
2025-02-10 23:07:55 +01:00
/* a0 */ void *mFollowObject;
2024-03-21 23:22:54 +01:00
/* a4 */ q20 mFollowDist;
2025-02-18 18:33:12 +01:00
/* a8 */ s16 mFollowStuckTimer;
2025-02-09 09:38:23 +01:00
/* aa */ s16 mCutsceneEndTimer;
2024-04-06 09:26:14 +02:00
/* ac */ s16 mUnk_ac;
/* ae */ unk16 mUnk_ae;
2024-03-21 23:22:54 +01:00
/* b0 */ Vec3p mAim; // used by boomerang, bow and rope
/* bc */ Vec3p mAimWorld; // used by hammer
/* c8 */ s32 mUnk_c8;
/* cc */ s32 mUnk_cc;
2024-04-06 09:26:14 +02:00
/* d0 */ TouchGesture **mTouchGesture;
/* d4 */ DebugHierarchy *mDebug;
/* d8 */
static bool func_ov00_020aeeac();
2025-02-09 09:38:23 +01:00
static bool func_ov00_020aeef8();
2024-04-06 09:26:14 +02:00
void func_ov00_020aef30();
void UpdateAim();
2024-10-12 16:16:32 +02:00
Actor *GetFollowActor();
2025-02-09 09:38:23 +01:00
bool func_ov00_020af01c(Vec2b *param1);
2024-04-06 09:26:14 +02:00
void SetUnk_80();
void StopFollowing();
void func_ov00_020af06c();
void UpdateUsingEquipItem();
bool func_ov00_020af2d4(u32 param1, bool param2);
bool CheckTouchedNow(u32 param1);
bool CheckUntouchedNow(u32 param1);
bool CheckTouching(u32 param1);
bool CheckTouchFast(u32 param1);
bool func_ov00_020af4a4();
2025-02-09 09:38:23 +01:00
void func_ov00_020af538(bool param1, u8 param2);
2024-04-06 09:26:14 +02:00
void func_ov00_020af6e4(Vec3p *param1, s32 param3, s32 param4);
bool func_ov00_020af778();
bool func_ov00_020afad8(Vec3p *param1);
void func_ov00_020afb6c();
bool func_ov00_020afe88(s32 param1, bool param2);
bool func_ov00_020afeec(unk32 param1, bool param2);
2025-02-18 18:33:12 +01:00
void func_ov00_020aff90(Vec3p *param1, unk32 param2);
2024-04-06 09:26:14 +02:00
void func_ov00_020affec(Vec3p *param1, s32 y, s32 param3, Vec3p *param4);
2025-02-10 23:07:55 +01:00
void func_ov00_020b014c(Vec3p *param1);
void ResetAim();
2024-04-06 09:26:14 +02:00
bool UpdateAimWorld(Vec3p *param1);
s16 GetTouchAngle();
u32 func_ov00_020b034c();
s32 func_ov00_020b0418();
bool func_ov00_020b049c(Vec3p *param1, bool param2);
bool func_ov00_020b05e8(Vec3p *param1);
2025-02-16 16:07:22 +01:00
bool func_ov00_020b0778(Vec3p *param1, u32 param2, unk32 *param3);
2024-04-06 09:26:14 +02:00
bool CheckNotTouching();
bool func_ov00_020b0ad0(Actor *actor);
bool func_ov00_020b0b0c(s16 *pAngle, ItemFlag *pEquipId, unk32 *pCardinal, bool *pFast);
bool func_ov00_020b0de8(Vec3p *param1);
bool func_ov00_020b0e54(Vec3p *param1, Vec3p *param2);
2025-02-16 16:07:22 +01:00
bool func_ov00_020b0f88(Vec3p *param1, unk32 scale, Vec3p *param3);
2024-04-06 09:26:14 +02:00
bool func_ov00_020b1058(Vec3p *param1, unk32 param2, Vec3p *param3, Vec3p *param4);
bool IsUntouchedNow();
bool IsNotUntouchedNow();
bool func_ov00_020b1248(unk32 *param1);
bool func_ov00_020b129c();
bool func_ov00_020b12d0(s16 *pAngle);
bool IsNotTouching();
bool IsTouchingFast();
bool IsTappedNow();
bool func_ov00_020b13c4();
2025-01-06 22:09:32 +01:00
void ResetTouchWorld();
void InitTouchMovement();
void func_ov000_020b7924(s32 param1);
2025-01-21 20:24:28 +01:00
void ApplyTouchWorld(Vec3p *result, unk32 scale);
2025-01-06 22:09:32 +01:00
bool func_ov000_020b7d6c();
2025-01-25 14:35:02 +01:00
PlayerControl();
~PlayerControl();
static void Create();
static void Destroy();
void Init();
void func_ov004_0210b1d0();
static void func_ov004_0210b1f0();
2025-02-10 23:07:55 +01:00
bool func_ov024_02178348(Vec3p *param1);
2024-03-21 23:22:54 +01:00
};
2024-05-23 23:00:10 +02:00
extern PlayerControl *gPlayerControl;