mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-26 09:28:01 -05:00
Implement/match MxVideoManager::Tickle (#128)
* Implement/match MxPresenter::StartAction * Update mxpoint32.h * Implement/match MxVideoManager::Tickle * Update mxlist.h * Update mxpresenter.cpp
This commit is contained in:
parent
4bd67e4ae1
commit
d145f914c4
9 changed files with 133 additions and 37 deletions
|
@ -59,6 +59,7 @@ class MxList : protected MxListParent<T>
|
|||
virtual ~MxList();
|
||||
|
||||
void Append(T*);
|
||||
MxU32 GetCount() { return m_count; }
|
||||
|
||||
friend class MxListCursor<T>;
|
||||
|
||||
|
@ -83,6 +84,8 @@ class MxListCursor : public MxCore
|
|||
MxBool Find(T *p_obj);
|
||||
void Detach();
|
||||
MxBool Next(T*& p_obj);
|
||||
void SetValue(T *p_obj);
|
||||
void Head() { m_match = m_list->m_first; }
|
||||
void Reset() { m_match = NULL; }
|
||||
|
||||
private:
|
||||
|
@ -193,4 +196,11 @@ inline MxBool MxListCursor<T>::Next(T*& p_obj)
|
|||
return m_match != NULL;
|
||||
}
|
||||
|
||||
#endif // MXLIST_H
|
||||
template <class T>
|
||||
inline void MxListCursor<T>::SetValue(T *p_obj)
|
||||
{
|
||||
if (m_match)
|
||||
m_match->m_obj = p_obj;
|
||||
}
|
||||
|
||||
#endif // MXLIST_H
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
DECOMP_SIZE_ASSERT(MxMediaManager, 0x2c);
|
||||
|
||||
typedef MxListCursorChildChild<MxPresenter> MxPresenterListCursor;
|
||||
|
||||
// OFFSET: LEGO1 0x100b84c0
|
||||
MxMediaManager::MxMediaManager()
|
||||
{
|
||||
|
@ -40,7 +38,7 @@ MxResult MxMediaManager::Tickle()
|
|||
cursor.Reset();
|
||||
|
||||
while (cursor.Next(presenter))
|
||||
presenter->VTable0x4c();
|
||||
presenter->PutData();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
|
|
@ -23,12 +23,10 @@ class MxMediaManager : public MxCore
|
|||
virtual void StopPresenters(); // vtable+24
|
||||
|
||||
MxResult Init();
|
||||
|
||||
private:
|
||||
MxPresenterList *m_presenters;
|
||||
MxThread *m_thread; // 0xc
|
||||
|
||||
protected:
|
||||
MxPresenterList *m_presenters;
|
||||
MxThread *m_thread; // 0xc
|
||||
MxCriticalSection m_criticalSection; // 0x10
|
||||
};
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ void MxPresenter::Init()
|
|||
m_currentTickleState = TickleState_Idle;
|
||||
m_action = NULL;
|
||||
m_location = MxPoint32(0, 0);
|
||||
m_locationZ = 0;
|
||||
m_displayZ = 0;
|
||||
m_unkPresenter = NULL;
|
||||
m_previousTickleStates = 0;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ MxLong MxPresenter::StartAction(MxStreamController *, MxDSAction *p_action)
|
|||
MxS32 previousTickleState = this->m_currentTickleState;
|
||||
|
||||
this->m_location = MxPoint32(location[0], location[1]);
|
||||
this->m_locationZ = location[2];
|
||||
this->m_displayZ = location[2];
|
||||
this->m_previousTickleStates |= 1 << (unsigned char)previousTickleState;
|
||||
this->m_currentTickleState = TickleState_Ready;
|
||||
|
||||
|
@ -236,13 +236,13 @@ MxBool MxPresenter::HasTickleStatePassed(TickleState p_tickleState)
|
|||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000bfc0
|
||||
undefined4 MxPresenter::VTable0x4c()
|
||||
undefined4 MxPresenter::PutData()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000bfd0
|
||||
undefined MxPresenter::VTable0x50(undefined4, undefined4)
|
||||
MxBool MxPresenter::IsHit(MxS32 p_x, MxS32 p_y)
|
||||
{
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -62,12 +62,14 @@ class MxPresenter : public MxCore
|
|||
__declspec(dllexport) virtual void EndAction(); // vtable+0x40
|
||||
virtual void SetTickleState(TickleState p_tickleState); // vtable+0x44
|
||||
virtual MxBool HasTickleStatePassed(TickleState p_tickleState); // vtable+0x48
|
||||
virtual undefined4 VTable0x4c(); // vtable+0x4c
|
||||
virtual undefined VTable0x50(undefined4, undefined4); // vtable+0x50
|
||||
virtual undefined4 PutData(); // vtable+0x4c
|
||||
virtual MxBool IsHit(MxS32 p_x, MxS32 p_y); // vtable+0x50
|
||||
__declspec(dllexport) virtual void Enable(MxBool p_enable); // vtable+0x54
|
||||
|
||||
MxBool IsEnabled();
|
||||
|
||||
inline MxS32 GetDisplayZ() { return this->m_displayZ; }
|
||||
|
||||
protected:
|
||||
__declspec(dllexport) void Init();
|
||||
void SendTo_unkPresenter(MxOmni *);
|
||||
|
@ -76,7 +78,7 @@ class MxPresenter : public MxCore
|
|||
MxS32 m_currentTickleState; // 0x8
|
||||
MxU32 m_previousTickleStates;
|
||||
MxPoint32 m_location;
|
||||
MxS32 m_locationZ;
|
||||
MxS32 m_displayZ;
|
||||
MxDSAction *m_action; // 0
|
||||
MxCriticalSection m_criticalSection;
|
||||
MxPresenter *m_unkPresenter; // 0x3c
|
||||
|
|
|
@ -24,4 +24,6 @@ class MxPresenterList : public MxPresenterListParent
|
|||
virtual MxS8 Compare(MxPresenter *, MxPresenter *); // +0x14
|
||||
};
|
||||
|
||||
typedef MxListCursorChildChild<MxPresenter> MxPresenterListCursor;
|
||||
|
||||
#endif // MXPRESENTERLIST_H
|
||||
|
|
26
LEGO1/mxregion.h
Normal file
26
LEGO1/mxregion.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef MXREGION_H
|
||||
#define MXREGION_H
|
||||
|
||||
#include "mxcore.h"
|
||||
|
||||
// VTABLE 0x100dcae8
|
||||
// SIZE 0x1c
|
||||
class MxRegion : public MxCore
|
||||
{
|
||||
public:
|
||||
MxRegion();
|
||||
virtual ~MxRegion() override;
|
||||
|
||||
virtual void Reset();
|
||||
virtual void vtable18();
|
||||
virtual void vtable1c();
|
||||
virtual void vtable20();
|
||||
|
||||
private:
|
||||
// A container (probably MxList) holding MxRect32
|
||||
// MxList<MxRect32> *m_rects;
|
||||
// 4 coordinates (could be MxRect32)
|
||||
// MxS32 left, top, right, bottom;
|
||||
};
|
||||
|
||||
#endif // MXREGION_H
|
|
@ -1,18 +1,6 @@
|
|||
#include "mxvideomanager.h"
|
||||
|
||||
// OFFSET: LEGO1 0x100be2a0 STUB
|
||||
MxVideoManager::~MxVideoManager()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bea90 STUB
|
||||
MxLong MxVideoManager::Tickle()
|
||||
{
|
||||
// TODO
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include "mxautolocker.h"
|
||||
#include "mxpresenter.h"
|
||||
|
||||
// OFFSET: LEGO1 0x100be1f0
|
||||
MxVideoManager::MxVideoManager()
|
||||
|
@ -20,16 +8,85 @@ MxVideoManager::MxVideoManager()
|
|||
Init();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100be2a0 STUB
|
||||
MxVideoManager::~MxVideoManager()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bea90
|
||||
MxLong MxVideoManager::Tickle()
|
||||
{
|
||||
MxAutoLocker lock(&this->m_criticalSection);
|
||||
|
||||
SortPresenterList();
|
||||
|
||||
MxPresenter *presenter;
|
||||
MxPresenterListCursor cursor(this->m_presenters);
|
||||
|
||||
while (cursor.Next(presenter))
|
||||
presenter->Tickle();
|
||||
|
||||
cursor.Reset();
|
||||
|
||||
while (cursor.Next(presenter))
|
||||
presenter->PutData();
|
||||
|
||||
UpdateRegion();
|
||||
m_region->Reset();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100be320
|
||||
int MxVideoManager::Init()
|
||||
MxResult MxVideoManager::Init()
|
||||
{
|
||||
this->m_pDirectDraw = NULL;
|
||||
this->m_unk54 = NULL;
|
||||
this->m_pDDSurface = NULL;
|
||||
this->m_displaySurface = NULL;
|
||||
this->m_unk5c = 0;
|
||||
this->m_region = NULL;
|
||||
this->m_videoParam.SetPalette(NULL);
|
||||
this->m_unk60 = FALSE;
|
||||
return 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100be440
|
||||
void MxVideoManager::SortPresenterList()
|
||||
{
|
||||
if (this->m_presenters->GetCount() <= 1)
|
||||
return;
|
||||
|
||||
MxPresenterListCursor a(this->m_presenters);
|
||||
MxPresenterListCursor b(this->m_presenters);
|
||||
MxU32 count = this->m_presenters->GetCount() - 1;
|
||||
MxBool finished;
|
||||
|
||||
if (count != 0) {
|
||||
do {
|
||||
a.Reset();
|
||||
b.Head();
|
||||
|
||||
finished = TRUE;
|
||||
for (MxU32 i = count; i != 0; i--) {
|
||||
MxPresenter *p_a, *p_b;
|
||||
|
||||
a.Next(p_a);
|
||||
b.Next(p_b);
|
||||
|
||||
if (p_a->GetDisplayZ() < p_b->GetDisplayZ()) {
|
||||
a.SetValue(p_b);
|
||||
b.SetValue(p_a);
|
||||
finished = FALSE;
|
||||
}
|
||||
}
|
||||
} while (!finished && --count != 0);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100be3e0 STUB
|
||||
void MxVideoManager::UpdateRegion()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100bea60 STUB
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define MXVIDEOMANAGER_H
|
||||
|
||||
#include "mxdisplaysurface.h"
|
||||
#include "mxregion.h"
|
||||
#include "mxmediamanager.h"
|
||||
#include "mxvideoparam.h"
|
||||
|
||||
|
@ -19,16 +20,18 @@ class MxVideoManager : public MxMediaManager
|
|||
|
||||
MxVideoManager();
|
||||
|
||||
int Init();
|
||||
MxResult Init();
|
||||
void SortPresenterList();
|
||||
void UpdateRegion();
|
||||
|
||||
inline MxVideoParam& GetVideoParam() { return this->m_videoParam; }
|
||||
inline LPDIRECTDRAW GetDirectDraw() { return this->m_pDirectDraw; }
|
||||
private:
|
||||
MxVideoParam m_videoParam;
|
||||
LPDIRECTDRAW m_pDirectDraw;
|
||||
LPDIRECTDRAWSURFACE m_unk54;
|
||||
LPDIRECTDRAWSURFACE m_pDDSurface;
|
||||
MxDisplaySurface *m_displaySurface;
|
||||
int m_unk5c;
|
||||
MxRegion *m_region;
|
||||
MxBool m_unk60;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue