MxParamType -> NotificationId

This commit is contained in:
disinvite 2023-11-06 22:02:42 -05:00
parent 55829d4634
commit 05101c9e57
7 changed files with 31 additions and 34 deletions

View File

@ -95,7 +95,7 @@ void IsleApp::Close()
if (Lego()) {
GameState()->Save(0);
if (InputManager()) {
InputManager()->QueueEvent(KEYDOWN, 0, 0, 0, 0x20);
InputManager()->QueueEvent(c_notificationKeyPress, 0, 0, 0, 0x20);
}
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveAll(NULL);
@ -431,22 +431,22 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
keyCode = wParam;
type = KEYDOWN;
type = c_notificationKeyPress;
break;
case WM_MOUSEMOVE:
g_mousemoved = 1;
type = MOUSEMOVE;
type = c_notificationMouseMove;
break;
case WM_TIMER:
type = TIMER;
type = c_notificationTimer;
break;
case WM_LBUTTONDOWN:
g_mousedown = 1;
type = MOUSEDOWN;
type = c_notificationButtonDown;
break;
case WM_LBUTTONUP:
g_mousedown = 0;
type = MOUSEUP;
type = c_notificationButtonUp;
break;
case 0x5400:
if (g_isle) {
@ -462,7 +462,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (InputManager()) {
InputManager()->QueueEvent(type, wParam, LOWORD(lParam), HIWORD(lParam), keyCode);
}
if (g_isle && g_isle->m_drawCursor && type == MOUSEMOVE) {
if (g_isle && g_isle->m_drawCursor && type == c_notificationMouseMove) {
int x = LOWORD(lParam);
int y = HIWORD(lParam);
if (x >= 640) {

View File

@ -7,9 +7,9 @@
// VTABLE 0x100d6aa0
class LegoEventNotificationParam : public MxNotificationParam {
public:
inline LegoEventNotificationParam() : MxNotificationParam((MxParamType) 0, NULL) {}
inline LegoEventNotificationParam() : MxNotificationParam(PARAM_NONE, NULL) {}
inline LegoEventNotificationParam(
MxParamType p_type,
NotificationId p_type,
MxCore* p_sender,
MxU8 p_modifier,
MxS32 p_x,

View File

@ -227,11 +227,10 @@ void LegoInputManager::ClearWorld()
// OFFSET: LEGO1 0x1005c740
void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key)
{
// TODO: param type wrong?
LegoEventNotificationParam param =
LegoEventNotificationParam((MxParamType) p_id, NULL, p_modifier, p_x, p_y, p_key);
LegoEventNotificationParam param = LegoEventNotificationParam(p_id, NULL, p_modifier, p_x, p_y, p_key);
if (((!m_unk0x88) || ((m_unk0x335 && (param.GetType() == MOUSEDOWN)))) || ((m_unk0x336 && (p_key == ' ')))) {
if (((!m_unk0x88) || ((m_unk0x335 && (param.GetType() == c_notificationButtonDown)))) ||
((m_unk0x336 && (p_key == ' ')))) {
ProcessOneEvent(param);
}
}

View File

@ -10,15 +10,6 @@
#include <dinput.h>
enum NotificationId {
NONE = 0,
KEYDOWN = 7,
MOUSEUP = 8,
MOUSEDOWN = 9,
MOUSEMOVE = 10,
TIMER = 15
};
class LegoControlManager;
// VTABLE 0x100d8800
@ -113,13 +104,13 @@ class LegoInputManager : public MxPresenter {
// OFFSET: LEGO1 0x1005d010 TEMPLATE
// MxListEntry<LegoEventNotificationParam>::GetValue
// VTABLE 0x100d87e8
// VTABLE 0x100d87e8 TEMPLATE
// class MxQueue<LegoEventNotificationParam>
// VTABLE 0x100d87d0
// VTABLE 0x100d87d0 TEMPLATE
// class MxList<LegoEventNotificationParam>
// VTABLE 0x100d87b8
// VTABLE 0x100d87b8 TEMPLATE
// class MxListParent<LegoEventNotificationParam>
#endif // LEGOINPUTMANAGER_H

View File

@ -8,7 +8,12 @@
// SIZE 0x14
class MxActionNotificationParam : public MxNotificationParam {
public:
inline MxActionNotificationParam(MxParamType p_type, MxCore* p_sender, MxDSAction* p_action, MxBool p_reallocAction)
inline MxActionNotificationParam(
NotificationId p_type,
MxCore* p_sender,
MxDSAction* p_action,
MxBool p_reallocAction
)
: MxNotificationParam(p_type, p_sender)
{
MxDSAction* oldAction = p_action;
@ -50,7 +55,7 @@ class MxActionNotificationParam : public MxNotificationParam {
class MxEndActionNotificationParam : public MxActionNotificationParam {
public:
inline MxEndActionNotificationParam(
MxParamType p_type,
NotificationId p_type,
MxCore* p_sender,
MxDSAction* p_action,
MxBool p_reallocAction

View File

@ -7,7 +7,7 @@
class MxCore;
enum MxParamType {
enum NotificationId {
PARAM_NONE = 0,
c_notificationStartAction = 1, // 100dc210:100d8350
c_notificationEndAction = 2, // 100d8358:100d8350
@ -36,18 +36,20 @@ enum MxParamType {
// VTABLE 0x100d56e0
class MxNotificationParam : public MxParam {
public:
inline MxNotificationParam(MxParamType p_type, MxCore* p_sender) : MxParam(), m_type(p_type), m_sender(p_sender) {}
inline MxNotificationParam(NotificationId p_type, MxCore* p_sender) : MxParam(), m_type(p_type), m_sender(p_sender)
{
}
virtual ~MxNotificationParam() override {} // vtable+0x0 (scalar deleting destructor)
virtual MxNotificationParam* Clone(); // vtable+0x4
inline MxParamType GetNotification() const { return m_type; }
inline NotificationId GetNotification() const { return m_type; }
inline MxCore* GetSender() const { return m_sender; }
inline MxParamType GetType() const { return m_type; }
inline NotificationId GetType() const { return m_type; }
protected:
MxParamType m_type; // 0x4
MxCore* m_sender; // 0x8
NotificationId m_type; // 0x4
MxCore* m_sender; // 0x8
};
#endif // MXNOTIFICATIONPARAM_H

View File

@ -42,7 +42,7 @@ class MxStreamerSubClass3 : public MxStreamerSubClass1 {
class MxStreamerNotification : public MxNotificationParam {
public:
inline MxStreamerNotification(MxParamType p_type, MxCore* p_sender, MxStreamController* p_ctrlr)
inline MxStreamerNotification(NotificationId p_type, MxCore* p_sender, MxStreamController* p_ctrlr)
: MxNotificationParam(p_type, p_sender)
{
m_controller = p_ctrlr;