diff --git a/LEGO1/legonavcontroller.cpp b/LEGO1/legonavcontroller.cpp new file mode 100644 index 00000000..aaea52e6 --- /dev/null +++ b/LEGO1/legonavcontroller.cpp @@ -0,0 +1,66 @@ +#include "legonavcontroller.h" + +int g_mouseDeadzone = 40; +float g_zeroThreshold = 0.001f; +float g_movementMaxSpeed = 40.0f; +float g_turnMaxSpeed = 20.0f; +float g_movementMaxAccel = 15.0f; +float g_turnMaxAccel = 30.0f; +float g_movementMinAccel = 4.0f; +float g_turnMinAccel = 15.0f; +float g_movementDecel = 50.0f; +float g_turnDecel = 50.0f; +float g_rotationSensitivity = 0.4f; +MxBool g_turnUseVelocity = 0; + +void LegoNavController::GetDefaults(int *p_mouseDeadzone, float *p_movementMaxSpeed, float *p_turnMaxSpeed, + float *p_movementMaxAccel, float *p_turnMaxAccel, float *p_movementDecel, + float *p_turnDecel, float *p_movementMinAccel, float *p_turnMinAccel, + float *p_rotationSensitivity, MxBool *p_turnUseVelocity) +{ + *p_mouseDeadzone = g_mouseDeadzone; + *p_movementMaxSpeed = g_movementMaxSpeed; + *p_turnMaxSpeed = g_turnMaxSpeed; + *p_movementMaxAccel = g_movementMaxAccel; + *p_turnMaxAccel = g_turnMaxAccel; + *p_movementDecel = g_movementDecel; + *p_turnDecel = g_turnDecel; + *p_movementMinAccel = g_movementMinAccel; + *p_turnMinAccel = g_turnMinAccel; + *p_rotationSensitivity = g_rotationSensitivity; + *p_turnUseVelocity = g_turnUseVelocity; +} + +void LegoNavController::SetDefaults(int p_mouseDeadzone, float p_movementMaxSpeed, float p_turnMaxSpeed, + float p_movementMaxAccel, float p_turnMaxAccel, float p_movementDecel, + float p_turnDecel, float p_movementMinAccel, float p_turnMinAccel, + float p_rotationSensitivity, MxBool p_turnUseVelocity) +{ + g_mouseDeadzone = p_mouseDeadzone; + g_movementMaxSpeed = p_movementMaxSpeed; + g_turnMaxSpeed = p_turnMaxSpeed; + g_movementMaxAccel = p_movementMaxAccel; + g_turnMaxAccel = p_turnMaxAccel; + g_movementDecel = p_movementDecel; + g_turnDecel = p_turnDecel; + g_movementMinAccel = p_movementMinAccel; + g_turnMinAccel = p_turnMinAccel; + g_rotationSensitivity = p_rotationSensitivity; + g_turnUseVelocity = p_turnUseVelocity; +} + +void LegoNavController::ResetToDefault() +{ + this->m_mouseDeadzone = g_mouseDeadzone; + this->m_zeroThreshold = g_zeroThreshold; + this->m_turnMaxAccel = g_turnMaxAccel; + this->m_movementMaxAccel = g_movementMaxAccel; + this->m_turnMinAccel = g_turnMinAccel; + this->m_movementMinAccel = g_movementMinAccel; + this->m_turnDecel = g_turnDecel; + this->m_movementDecel = g_movementDecel; + this->m_turnMaxSpeed = g_turnMaxSpeed; + this->m_movementMaxSpeed = g_movementMaxSpeed; + this->m_turnUseVelocity = g_turnUseVelocity; + this->m_rotationSensitivity = g_rotationSensitivity; +} \ No newline at end of file diff --git a/LEGO1/legonavcontroller.h b/LEGO1/legonavcontroller.h index 33e16916..84be9b62 100644 --- a/LEGO1/legonavcontroller.h +++ b/LEGO1/legonavcontroller.h @@ -1,11 +1,39 @@ #ifndef LEGONAVCONTROLLER_H #define LEGONAVCONTROLLER_H -class LegoNavController +#include "mxcore.h" +#include "mxbool.h" + +class LegoNavController : public MxCore { public: - __declspec(dllexport) static void GetDefaults(int *,float *,float *,float *,float *,float *,float *,float *,float *,float *,unsigned char *); - __declspec(dllexport) static void SetDefaults(int,float,float,float,float,float,float,float,float,float,unsigned char); + __declspec(dllexport) static void GetDefaults(int *p_mouseDeadzone, float *p_movementMaxSpeed, float *p_turnMaxSpeed, + float *p_movementMaxAccel, float *p_turnMaxAccel, float *p_movementDecel, + float *p_turnDecel, float *p_movementMinAccel, float *p_turnMinAccel, + float *p_rotationSensitivity, MxBool *p_turnUseVelocity); + __declspec(dllexport) static void SetDefaults(int p_mouseDeadzone, float p_movementMaxSpeed, float p_turnMaxSpeed, + float p_movementMaxAccel, float p_turnMaxAccel, float p_movementDecel, + float p_turnDecel, float p_movementMinAccel, float p_turnMinAccel, + float p_rotationSensitivity, MxBool p_turnUseVelocity); + void ResetToDefault(); + +private: + int unk_08; // known to be set to window width: 640 (default) + int unk_0C; // known to be set to window height: 480 (default) + int m_mouseDeadzone; + float m_zeroThreshold; + int unk_18[4]; + float m_movementMaxSpeed; + float m_turnMaxSpeed; + int unk_30[2]; + float m_movementMaxAccel; + float m_turnMaxAccel; + float m_movementMinAccel; + float m_turnMinAccel; + float m_movementDecel; + float m_turnDecel; + float m_rotationSensitivity; + MxBool m_turnUseVelocity; }; #endif // LEGONAVCONTROLLER_H diff --git a/README.md b/README.md index 9a5accfd..b4d73934 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # LEGO Island Decompilation -[Development Vlog](https://www.youtube.com/playlist?list=PLbpl-gZkNl2COf_bB6cfgTapD5WduAfPz) | [Forums](https://forum.mattkc.com/viewforum.php?f=1) | [Patreon](https://www.patreon.com/mattkc) +[Development Vlog](https://www.youtube.com/playlist?list=PLbpl-gZkNl2COf_bB6cfgTapD5WduAfPz) | [Matrix](https://matrix.to/#/#isledecomp:matrix.org) | [Forums](https://forum.mattkc.com/viewforum.php?f=1) | [Patreon](https://www.patreon.com/mattkc) This is a **work-in-progress** decompilation of LEGO Island version 1.1. It aims to be relatively faithful, but not byte accurate. The goal is to provide a workable codebase that can be modified, improved, and ported to other platforms later on.