push changes

This commit is contained in:
Misha 2024-01-27 19:45:53 -05:00
parent d4cb8677b8
commit 3d5a7b277d
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
9 changed files with 148 additions and 8 deletions

View File

@ -1,6 +1,7 @@
#ifndef LEGOCONTROLMANAGER_H #ifndef LEGOCONTROLMANAGER_H
#define LEGOCONTROLMANAGER_H #define LEGOCONTROLMANAGER_H
#include "legoeventnotificationparam.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxpresenterlist.h" #include "mxpresenterlist.h"
@ -28,13 +29,20 @@ class LegoControlManager : public MxCore {
void FUN_10028df0(MxPresenterList* p_presenterList); void FUN_10028df0(MxPresenterList* p_presenterList);
void Register(MxCore* p_listener); void Register(MxCore* p_listener);
void Unregister(MxCore* p_listener); void Unregister(MxCore* p_listener);
MxBool FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter);
void FUN_100293c0(undefined4, const char*, undefined2); void FUN_100293c0(undefined4, const char*, undefined2);
inline undefined4 GetUnknown0x0c() { return m_unk0x0c; }
inline undefined GetUnknown0x10() { return m_unk0x10; }
// SYNTHETIC: LEGO1 0x10028d40 // SYNTHETIC: LEGO1 0x10028d40
// LegoControlManager::`scalar deleting destructor' // LegoControlManager::`scalar deleting destructor'
private: private:
undefined m_padding0x08[0x58]; // 0x08 undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
undefined m_unk0x10; // 0x10
undefined m_padding0x08[0x4c]; // 0x14
}; };
#endif // LEGOCONTROLMANAGER_H #endif // LEGOCONTROLMANAGER_H

View File

@ -3,6 +3,7 @@
#include "mxnotificationparam.h" #include "mxnotificationparam.h"
#include "mxtypes.h" #include "mxtypes.h"
#include "roi/legoroi.h"
#include <stdlib.h> #include <stdlib.h>
@ -21,7 +22,7 @@ class LegoEventNotificationParam : public MxNotificationParam {
MxS32 p_y, MxS32 p_y,
MxU8 p_key MxU8 p_key
) )
: MxNotificationParam(p_type, p_sender), m_modifier(p_modifier), m_x(p_x), m_y(p_y), m_key(p_key), m_unk0x1c(0) : MxNotificationParam(p_type, p_sender), m_modifier(p_modifier), m_x(p_x), m_y(p_y), m_key(p_key), m_roi(0)
{ {
} }
@ -29,12 +30,14 @@ class LegoEventNotificationParam : public MxNotificationParam {
inline MxS32 GetX() const { return m_x; } inline MxS32 GetX() const { return m_x; }
inline MxS32 GetY() const { return m_y; } inline MxS32 GetY() const { return m_y; }
inline void SetROI(LegoROI* p_roi) { m_roi = p_roi; }
protected: protected:
MxU8 m_modifier; // 0x0c MxU8 m_modifier; // 0x0c
MxS32 m_x; // 0x10 MxS32 m_x; // 0x10
MxS32 m_y; // 0x14 MxS32 m_y; // 0x14
MxU8 m_key; // 0x18 MxU8 m_key; // 0x18
MxU32 m_unk0x1c; // 0x1c LegoROI* m_roi; // 0x1c
}; };
// SYNTHETIC: LEGO1 0x10028770 // SYNTHETIC: LEGO1 0x10028770

View File

@ -110,6 +110,8 @@ class LegoInputManager : public MxPresenter {
void ProcessEvents(); void ProcessEvents();
MxBool ProcessOneEvent(LegoEventNotificationParam& p_param); MxBool ProcessOneEvent(LegoEventNotificationParam& p_param);
MxBool FUN_1005cdf0(LegoEventNotificationParam& p_param);
// SYNTHETIC: LEGO1 0x1005b8d0 // SYNTHETIC: LEGO1 0x1005b8d0
// LegoInputManager::`scalar deleting destructor' // LegoInputManager::`scalar deleting destructor'

View File

@ -31,7 +31,7 @@ class LegoVideoManager : public MxVideoManager {
override; // vtable+0x2c override; // vtable+0x2c
virtual MxResult RealizePalette(MxPalette*) override; // vtable+0x30 virtual MxResult RealizePalette(MxPalette*) override; // vtable+0x30
virtual void UpdateView(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) override; // vtable+0x34 virtual void UpdateView(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) override; // vtable+0x34
virtual void VTable0x38(undefined4, undefined4); // vtable+0x38 virtual MxPresenter* VTable0x38(MxS32 p_x, MxS32 p_y); // vtable+0x38
// FUNCTION: LEGO1 0x1007ab10 // FUNCTION: LEGO1 0x1007ab10
virtual LegoUnknown100d9d00* VTable0x3c() { return m_unk0x100d9d00; } // vtable+0x3c virtual LegoUnknown100d9d00* VTable0x3c() { return m_unk0x100d9d00; } // vtable+0x3c

View File

@ -1,5 +1,8 @@
#include "legocontrolmanager.h" #include "legocontrolmanager.h"
#include "legoeventnotificationparam.h"
#include "mxpresenter.h"
DECOMP_SIZE_ASSERT(LegoControlManager, 0x60); DECOMP_SIZE_ASSERT(LegoControlManager, 0x60);
// STUB: LEGO1 0x10028520 // STUB: LEGO1 0x10028520
@ -32,6 +35,12 @@ void LegoControlManager::Unregister(MxCore* p_listener)
// TODO // TODO
} }
// STUB: LEGO1 0x10029210
MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter)
{
return TRUE;
}
// STUB: LEGO1 0x100293c0 // STUB: LEGO1 0x100293c0
void LegoControlManager::FUN_100293c0(undefined4, const char*, undefined2) void LegoControlManager::FUN_100293c0(undefined4, const char*, undefined2)
{ {

View File

@ -2,7 +2,9 @@
#include "legocontrolmanager.h" #include "legocontrolmanager.h"
#include "legoomni.h" #include "legoomni.h"
#include "legovideomanager.h"
#include "mxautolocker.h" #include "mxautolocker.h"
#include "roi/legoroi.h"
DECOMP_SIZE_ASSERT(LegoInputManager, 0x338) DECOMP_SIZE_ASSERT(LegoInputManager, 0x338)
DECOMP_SIZE_ASSERT(LegoNotifyList, 0x18) DECOMP_SIZE_ASSERT(LegoNotifyList, 0x18)
@ -279,8 +281,112 @@ void LegoInputManager::ProcessEvents()
} }
} }
// STUB: LEGO1 0x1005c9c0 // FUNCTION: LEGO1 0x1005c9c0
MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param) MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
{
MxBool processRoi;
if (p_param.GetType() == c_notificationKeyPress) {
if (!Lego()->IsTimerRunning() || p_param.GetKey() == 0x13) {
if (p_param.GetKey() == 16) {
if (m_unk0x195) {
m_unk0x80 = 0;
p_param.SetType(c_notificationDrag);
if (m_camera) {
m_camera->Notify(p_param);
}
}
m_unk0x195 = !m_unk0x195;
return TRUE;
}
LegoNotifyListCursor cursor(m_keyboardNotifyList);
MxCore* obj;
while (cursor.Next(obj)) {
if (obj->Notify(p_param) != 0) {
return TRUE;
}
}
}
}
else {
if (!Lego()->IsTimerRunning()) {
processRoi = TRUE;
if (m_unk0x335 != 0) {
if (p_param.GetType() == c_notificationButtonDown) {
LegoEventNotificationParam notification(c_notificationKeyPress, NULL, 0, 0, 0, ' ');
LegoNotifyListCursor cursor(m_keyboardNotifyList);
MxCore* obj;
while (cursor.Next(obj)) {
if (obj->Notify(p_param) != 0) {
return TRUE;
}
}
}
return TRUE;
}
if (m_unk0x195 && p_param.GetType() == c_notificationButtonDown) {
m_unk0x195 = 0;
return TRUE;
}
if (m_world != NULL && m_world->Notify(p_param) != 0) {
return TRUE;
}
if (p_param.GetType() == c_notificationButtonDown) {
MxPresenter* presenter = VideoManager()->VTable0x38(p_param.GetX(), p_param.GetY());
if (presenter) {
if (presenter->GetDisplayZ() < 0) {
processRoi = FALSE;
if (m_controlManager->FUN_10029210(p_param, presenter)) {
return TRUE;
}
}
else {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi == NULL && m_controlManager->FUN_10029210(p_param, presenter)) {
return TRUE;
}
}
}
}
if (p_param.GetType() == c_notificationButtonUp) {
if (g_unk0x100f31b0 != -1 || !m_controlManager->GetUnknown0x10() ||
m_controlManager->GetUnknown0x0c() == 1) {
MxBool result2 = m_controlManager->FUN_10029210(p_param, NULL);
KillTimer();
m_unk0x80 = 0;
m_unk0x81 = 0;
return result2;
}
else {
if (FUN_1005cdf0(p_param)) {
if (processRoi && p_param.GetType() == c_notificationType11) {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
p_param.SetROI(roi);
if (roi && roi->GetUnk0x0c() == 1) {
// TODO: enumerate through some list in ROI
}
}
if (m_camera && m_camera->Notify(p_param) != 0) {
return TRUE;
}
}
}
}
}
}
return FALSE;
}
// STUB: LEGO1 0x1005cdf0
MxBool LegoInputManager::FUN_1005cdf0(LegoEventNotificationParam& p_param)
{ {
// TODO // TODO
return FALSE; return FALSE;

View File

@ -330,10 +330,18 @@ void LegoVideoManager::DrawFPS()
// TODO // TODO
} }
// STUB: LEGO1 0x1007c080 // FUNCTION: LEGO1 0x1007c080
void LegoVideoManager::VTable0x38(undefined4, undefined4) MxPresenter* LegoVideoManager::VTable0x38(MxS32 p_x, MxS32 p_y)
{ {
// TODO MxPresenterListCursor cursor(m_presenters);
MxPresenter* presenter;
while (cursor.Next(presenter)) {
if (presenter->IsHit(p_x, p_y)) {
return presenter;
}
}
return NULL;
} }
// FUNCTION: LEGO1 0x1007c290 // FUNCTION: LEGO1 0x1007c290

View File

@ -48,6 +48,8 @@ class MxNotificationParam : public MxParam {
inline MxCore* GetSender() const { return m_sender; } inline MxCore* GetSender() const { return m_sender; }
inline NotificationId GetType() const { return m_type; } inline NotificationId GetType() const { return m_type; }
inline void SetType(NotificationId p_type) { m_type = p_type; }
protected: protected:
NotificationId m_type; // 0x04 NotificationId m_type; // 0x04
MxCore* m_sender; // 0x08 MxCore* m_sender; // 0x08

View File

@ -103,6 +103,8 @@ class ROI {
int GetLODCount() const { return m_lods ? m_lods->Size() : 0; } int GetLODCount() const { return m_lods ? m_lods->Size() : 0; }
const CompoundObject* GetComp() const { return m_comp; } const CompoundObject* GetComp() const { return m_comp; }
inline undefined GetUnk0x0c() { return m_unk0xc; }
// SYNTHETIC: LEGO1 0x100a5d60 // SYNTHETIC: LEGO1 0x100a5d60
// ROI::`scalar deleting destructor' // ROI::`scalar deleting destructor'