Merge pull request #13 from foxtacles/isle-legonavcontroller

lego1: bootstrap LegoNavController implementation
This commit is contained in:
MattKC 2023-06-13 17:19:10 -07:00 committed by GitHub
commit e2f13161b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 116 additions and 3 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -55,6 +55,7 @@ ALL : ".\Release\LEGO1.DLL"
CLEAN :
-@erase "$(INTDIR)\dllmain.obj"
-@erase "$(INTDIR)\legonavcontroller.obj"
-@erase "$(INTDIR)\legoomni.obj"
-@erase "$(INTDIR)\mxcore.obj"
-@erase "$(INTDIR)\mxcriticalsection.obj"
@ -116,6 +117,7 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
/out:"Release/LEGO1.DLL" /implib:"Release/LEGO1.LIB"
LINK32_OBJS= \
"$(INTDIR)\dllmain.obj" \
"$(INTDIR)\legonavcontroller.obj" \
"$(INTDIR)\legoomni.obj" \
"$(INTDIR)\mxcore.obj" \
"$(INTDIR)\mxcriticalsection.obj"
@ -144,6 +146,7 @@ ALL : ".\Debug\LEGO1.DLL"
CLEAN :
-@erase "$(INTDIR)\dllmain.obj"
-@erase "$(INTDIR)\legonavcontroller.obj"
-@erase "$(INTDIR)\legoomni.obj"
-@erase "$(INTDIR)\mxcore.obj"
-@erase "$(INTDIR)\mxcriticalsection.obj"
@ -209,6 +212,7 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
/out:"Debug/LEGO1.DLL" /implib:"$(OUTDIR)/LEGO1.lib"
LINK32_OBJS= \
"$(INTDIR)\dllmain.obj" \
"$(INTDIR)\legonavcontroller.obj" \
"$(INTDIR)\legoomni.obj" \
"$(INTDIR)\mxcore.obj" \
"$(INTDIR)\mxcriticalsection.obj"
@ -497,6 +501,21 @@ DEP_CPP_MXCRI=\
$(CPP) $(CPP_PROJ) $(SOURCE)
# End Source File
################################################################################
# Begin Source File
SOURCE=.\LEGO1\legonavcontroller.cpp
DEP_CPP_LEGON=\
".\LEGO1\legonavcontroller.h"\
".\LEGO1\mxbool.h"\
".\LEGO1\mxcore.h"\
"$(INTDIR)\legonavcontroller.obj" : $(SOURCE) $(DEP_CPP_LEGON) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
# End Source File
# End Target
################################################################################

BIN
isle.mdp

Binary file not shown.