Finish MxControlPresenter (#505)

* Push changes

* fix order

* use MxBitmap::Start

* Fixes/changes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha
2024-01-29 17:46:22 -05:00
committed by GitHub
parent baed704a38
commit 743e042564
6 changed files with 133 additions and 11 deletions

View File

@@ -46,6 +46,8 @@ public:
return TRUE;
} // vtable+0x64
inline MxCompositePresenterList& GetList() { return m_list; }
protected:
MxCompositePresenterList m_list; // 0x40
};

View File

@@ -8,6 +8,8 @@
class MxDSFile;
class MxDSObject;
class MxDSAction;
class MxCompositePresenterList;
class MxPresenter;
template <class T>
inline T Abs(T p_t)
@@ -71,6 +73,7 @@ MxBool GetRectIntersection(
void MakeSourceName(char*, const char*);
void SetOmniUserMessage(void (*)(const char*, int));
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter);
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);

View File

@@ -64,7 +64,7 @@ public:
virtual LPDIRECTDRAWSURFACE VTable0x78() { return m_unk0x58; } // vtable+0x78
// FUNCTION: LEGO1 0x1000c7c0
virtual MxBool VTable0x7c() { return (m_bitmap != NULL) || (m_alpha != NULL); } // vtable+0x7c
virtual MxBool VTable0x7c() { return m_bitmap != NULL || m_alpha != NULL; } // vtable+0x7c
// FUNCTION: LEGO1 0x1000c7e0
virtual MxS32 GetWidth() { return m_alpha ? m_alpha->m_width : m_bitmap->GetBmiWidth(); } // vtable+0x80
@@ -91,6 +91,7 @@ public:
inline MxS32 PrepareRects(MxRect32& p_rectDest, MxRect32& p_rectSrc);
inline MxBitmap* GetBitmap() { return m_bitmap; }
inline AlphaMask* GetAlphaMask() { return m_alpha; }
inline void SetBit0(BOOL p_e) { m_flags.m_bit0 = p_e; }
inline void SetBit1(BOOL p_e) { m_flags.m_bit1 = p_e; }

View File

@@ -1,10 +1,12 @@
#include "mxutil.h"
#include "mxcompositepresenter.h"
#include "mxdsaction.h"
#include "mxdsactionlist.h"
#include "mxdsfile.h"
#include "mxdsmultiaction.h"
#include "mxdsobject.h"
#include "mxpresenterlist.h"
#include "mxrect32.h"
// GLOBAL: LEGO1 0x101020e8
@@ -109,6 +111,19 @@ MxBool KeyValueStringParse(char* p_outputValue, const char* p_key, const char* p
return didMatch;
}
// FUNCTION: LEGO1 0x100b7170
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter)
{
for (MxCompositePresenterList::iterator it = p_presenterList.begin(); it != p_presenterList.end(); it++) {
if (p_presenter == *it || (*it)->IsA("MxCompositePresenter") &&
ContainsPresenter(((MxCompositePresenter*) *it)->GetList(), p_presenter)) {
return TRUE;
}
}
return FALSE;
}
// FUNCTION: LEGO1 0x100b7210
void SetOmniUserMessage(void (*p_userMsg)(const char*, int))
{