mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-23 08:11:16 +00:00
Merge branch 'isledecomp:master' into mxbitmap-vtable
This commit is contained in:
commit
6579b3fb4b
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -103,7 +103,7 @@ jobs:
|
|||||||
upload:
|
upload:
|
||||||
needs: [build, compare]
|
needs: [build, compare]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@ -92,6 +92,7 @@ add_library(lego1 SHARED
|
|||||||
LEGO1/legoworldpresenter.cpp
|
LEGO1/legoworldpresenter.cpp
|
||||||
LEGO1/motorcycle.cpp
|
LEGO1/motorcycle.cpp
|
||||||
LEGO1/mxatomid.cpp
|
LEGO1/mxatomid.cpp
|
||||||
|
LEGO1/mxatomidcounter.cpp
|
||||||
LEGO1/mxaudiopresenter.cpp
|
LEGO1/mxaudiopresenter.cpp
|
||||||
LEGO1/mxautolocker.cpp
|
LEGO1/mxautolocker.cpp
|
||||||
LEGO1/mxbackgroundaudiomanager.cpp
|
LEGO1/mxbackgroundaudiomanager.cpp
|
||||||
@ -117,6 +118,7 @@ add_library(lego1 SHARED
|
|||||||
LEGO1/mxdsparallelaction.cpp
|
LEGO1/mxdsparallelaction.cpp
|
||||||
LEGO1/mxdsselectaction.cpp
|
LEGO1/mxdsselectaction.cpp
|
||||||
LEGO1/mxdsserialaction.cpp
|
LEGO1/mxdsserialaction.cpp
|
||||||
|
LEGO1/mxdsstreamingaction.cpp
|
||||||
LEGO1/mxdssound.cpp
|
LEGO1/mxdssound.cpp
|
||||||
LEGO1/mxdssource.cpp
|
LEGO1/mxdssource.cpp
|
||||||
LEGO1/mxdsstill.cpp
|
LEGO1/mxdsstill.cpp
|
||||||
|
|||||||
@ -14,17 +14,21 @@
|
|||||||
// DIsable "nonstandard extension used : 'bool'" warning spam
|
// DIsable "nonstandard extension used : 'bool'" warning spam
|
||||||
#pragma warning( disable : 4237 )
|
#pragma warning( disable : 4237 )
|
||||||
|
|
||||||
|
// Disable "identifier was truncated to '255' characters" warning.
|
||||||
|
// Impossible to avoid this if using STL map or set.
|
||||||
|
// This removes most (but not all) occurrences of the warning.
|
||||||
|
#pragma warning( disable : 4786 )
|
||||||
|
|
||||||
#define MSVC420_VERSION 1020
|
#define MSVC420_VERSION 1020
|
||||||
|
|
||||||
// STL compatibility.
|
// STL compatibility.
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= MSVC420_VERSION
|
#if defined(_MSC_VER) && _MSC_VER <= MSVC420_VERSION
|
||||||
#include <STL.H>
|
#include "mxstl.h"
|
||||||
#else
|
#else
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <set>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
template <class T>
|
|
||||||
using List = list<T>;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// We use `override` so newer compilers can tell us our vtables are valid,
|
// We use `override` so newer compilers can tell us our vtables are valid,
|
||||||
|
|||||||
@ -1,20 +1,97 @@
|
|||||||
#include "mxatomid.h"
|
#include "mxatomid.h"
|
||||||
|
#include "mxomni.h"
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100acf90
|
// OFFSET: LEGO1 0x100acf90
|
||||||
MxAtomId::MxAtomId(const char *, LookupMode)
|
MxAtomId::MxAtomId(const char *p_str, LookupMode p_mode)
|
||||||
{
|
{
|
||||||
// TODO
|
if (!MxOmni::GetInstance())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!AtomIdCounterSet())
|
||||||
|
return;
|
||||||
|
|
||||||
|
MxAtomIdCounter *counter = GetCounter(p_str, p_mode);
|
||||||
|
m_internal = counter->GetKey()->GetData();
|
||||||
|
counter->Inc();
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100acfd0
|
// OFFSET: LEGO1 0x100acfd0
|
||||||
MxAtomId::~MxAtomId()
|
MxAtomId::~MxAtomId()
|
||||||
{
|
{
|
||||||
// TODO
|
Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100acfe0
|
||||||
|
void MxAtomId::Destroy()
|
||||||
|
{
|
||||||
|
if (!m_internal)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!MxOmni::GetInstance())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!AtomIdCounterSet())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// The dtor is called on the counter object immediately,
|
||||||
|
// so this syntax should be correct.
|
||||||
|
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(
|
||||||
|
&MxAtomIdCounter(m_internal)
|
||||||
|
);
|
||||||
|
|
||||||
|
MxAtomIdCounter *counter = (MxAtomIdCounter*)(*it);
|
||||||
|
counter->Dec();
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100ad1c0
|
// OFFSET: LEGO1 0x100ad1c0
|
||||||
MxAtomId &MxAtomId::operator=(const MxAtomId &id)
|
MxAtomId &MxAtomId::operator=(const MxAtomId &p_atomId)
|
||||||
{
|
{
|
||||||
// TODO
|
if (m_internal)
|
||||||
|
Destroy();
|
||||||
|
|
||||||
|
if (p_atomId.m_internal && MxOmni::GetInstance() && AtomIdCounterSet()) {
|
||||||
|
MxAtomIdCounter *counter = GetCounter(p_atomId.m_internal, LookupMode_Exact);
|
||||||
|
counter->Inc();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_internal = p_atomId.m_internal;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ad210
|
||||||
|
MxAtomIdCounter* MxAtomId::GetCounter(const char *p_str, LookupMode p_mode)
|
||||||
|
{
|
||||||
|
MxAtomId _unused;
|
||||||
|
MxAtomIdCounter *counter = new MxAtomIdCounter(p_str);
|
||||||
|
|
||||||
|
switch (p_mode) {
|
||||||
|
case LookupMode_LowerCase:
|
||||||
|
case LookupMode_LowerCase2:
|
||||||
|
counter->GetKey()->ToLowerCase();
|
||||||
|
break;
|
||||||
|
case LookupMode_UpperCase:
|
||||||
|
counter->GetKey()->ToUpperCase();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(counter);
|
||||||
|
if (it != AtomIdCounterSet()->end()) {
|
||||||
|
// Counter already in the set. Delete temp value and return it.
|
||||||
|
delete counter;
|
||||||
|
counter = *it;
|
||||||
|
} else {
|
||||||
|
// Counter is not in the set. Add it.
|
||||||
|
AtomIdCounterSet()->insert(counter);
|
||||||
|
}
|
||||||
|
|
||||||
|
return counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ad7e0
|
||||||
|
void MxAtomId::Clear()
|
||||||
|
{
|
||||||
|
// Reset but do not delete MxAtomId object.
|
||||||
|
Destroy();
|
||||||
|
m_internal = NULL;
|
||||||
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define MXATOMID_H
|
#define MXATOMID_H
|
||||||
|
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
|
#include "mxatomidcounter.h"
|
||||||
|
|
||||||
enum LookupMode
|
enum LookupMode
|
||||||
{
|
{
|
||||||
@ -27,9 +28,13 @@ class MxAtomId
|
|||||||
{
|
{
|
||||||
return this->m_internal == other.m_internal;
|
return this->m_internal == other.m_internal;
|
||||||
}
|
}
|
||||||
|
void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char *m_internal;
|
MxAtomIdCounter* GetCounter(const char *, LookupMode);
|
||||||
|
void Destroy();
|
||||||
|
|
||||||
|
const char *m_internal;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXATOMID_H
|
#endif // MXATOMID_H
|
||||||
|
|||||||
18
LEGO1/mxatomidcounter.cpp
Normal file
18
LEGO1/mxatomidcounter.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "mxatomidcounter.h"
|
||||||
|
#include "decomp.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxAtomIdCounter, 0x14);
|
||||||
|
DECOMP_SIZE_ASSERT(MxAtomIdCounterSet, 0x10);
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ad7f0
|
||||||
|
void MxAtomIdCounter::Inc()
|
||||||
|
{
|
||||||
|
m_value++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ad800
|
||||||
|
void MxAtomIdCounter::Dec()
|
||||||
|
{
|
||||||
|
if (m_value)
|
||||||
|
m_value--;
|
||||||
|
}
|
||||||
49
LEGO1/mxatomidcounter.h
Normal file
49
LEGO1/mxatomidcounter.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#ifndef MXATOMIDCOUNTER_H
|
||||||
|
#define MXATOMIDCOUNTER_H
|
||||||
|
|
||||||
|
#include "mxstring.h"
|
||||||
|
#include "compat.h" // STL
|
||||||
|
|
||||||
|
// Counts the number of existing MxAtomId objects based
|
||||||
|
// on the matching char* string. A <map> seems fit for purpose here:
|
||||||
|
// We have an MxString as a key and MxU16 as the value.
|
||||||
|
// And yet a <set> is the best match. The malloc in MxOmni::Create
|
||||||
|
// for the _Nil node asks for more bytes than a regular node if a <map>
|
||||||
|
// is used, but all nodes are 20 bytes wide with a <set>.
|
||||||
|
// Also: the increment/decrement methods suggest a custom type was used
|
||||||
|
// for the combined key_value_pair, which doesn't seem possible with <map>.
|
||||||
|
|
||||||
|
// SIZE: 0x14 (including padding)
|
||||||
|
class MxAtomIdCounter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// always inlined
|
||||||
|
MxAtomIdCounter(const char *p_str)
|
||||||
|
{
|
||||||
|
m_key = p_str;
|
||||||
|
m_value = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Inc();
|
||||||
|
void Dec();
|
||||||
|
inline MxString* GetKey() { return &m_key; };
|
||||||
|
inline MxU16 GetValue() { return m_value; };
|
||||||
|
|
||||||
|
private:
|
||||||
|
MxString m_key;
|
||||||
|
MxU16 m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MxAtomIdCounterCompare
|
||||||
|
{
|
||||||
|
// OFFSET: LEGO1 0x100ad120
|
||||||
|
int operator()(MxAtomIdCounter* const & p_val0, MxAtomIdCounter* const & p_val1) const
|
||||||
|
{
|
||||||
|
return strcmp(p_val0->GetKey()->GetData(), p_val1->GetKey()->GetData()) > 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare>
|
||||||
|
{};
|
||||||
|
|
||||||
|
#endif //MXATOMIDCOUNTER_H
|
||||||
@ -46,8 +46,12 @@ class MxDSAction : public MxDSObject
|
|||||||
MxU32 m_sizeOnDisk;
|
MxU32 m_sizeOnDisk;
|
||||||
DWORD m_flags;
|
DWORD m_flags;
|
||||||
DWORD m_startTime;
|
DWORD m_startTime;
|
||||||
|
|
||||||
|
protected:
|
||||||
MxLong m_duration;
|
MxLong m_duration;
|
||||||
MxS32 m_loopCount;
|
MxS32 m_loopCount;
|
||||||
|
|
||||||
|
private:
|
||||||
MxVector3Data m_location;
|
MxVector3Data m_location;
|
||||||
MxVector3Data m_direction;
|
MxVector3Data m_direction;
|
||||||
MxVector3Data m_up;
|
MxVector3Data m_up;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "mxdsanim.h"
|
#include "mxdsanim.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSAnim, 0xb8)
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c8ff0
|
// OFFSET: LEGO1 0x100c8ff0
|
||||||
MxDSAnim::MxDSAnim()
|
MxDSAnim::MxDSAnim()
|
||||||
{
|
{
|
||||||
@ -10,3 +12,30 @@ MxDSAnim::MxDSAnim()
|
|||||||
MxDSAnim::~MxDSAnim()
|
MxDSAnim::~MxDSAnim()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c91f0
|
||||||
|
void MxDSAnim::CopyFrom(MxDSAnim &p_dsAnim)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9200
|
||||||
|
MxDSAnim &MxDSAnim::operator=(MxDSAnim &p_dsAnim)
|
||||||
|
{
|
||||||
|
if (this == &p_dsAnim)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
MxDSMediaAction::operator=(p_dsAnim);
|
||||||
|
this->CopyFrom(p_dsAnim);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9230
|
||||||
|
MxDSAction *MxDSAnim::Clone()
|
||||||
|
{
|
||||||
|
MxDSAnim *clone = new MxDSAnim();
|
||||||
|
|
||||||
|
if (clone)
|
||||||
|
*clone = *this;
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
@ -9,9 +9,11 @@ class MxDSAnim : public MxDSMediaAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MxDSAnim();
|
MxDSAnim();
|
||||||
|
|
||||||
virtual ~MxDSAnim() override;
|
virtual ~MxDSAnim() override;
|
||||||
|
|
||||||
|
void CopyFrom(MxDSAnim &p_dsAnim);
|
||||||
|
MxDSAnim &operator=(MxDSAnim &p_dsAnim);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c9060
|
// OFFSET: LEGO1 0x100c9060
|
||||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
@ -24,6 +26,8 @@ class MxDSAnim : public MxDSMediaAction
|
|||||||
{
|
{
|
||||||
return !strcmp(name, MxDSAnim::ClassName()) || MxDSMediaAction::IsA(name);
|
return !strcmp(name, MxDSAnim::ClassName()) || MxDSMediaAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual MxDSAction *Clone(); // vtable+2c;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXDSANIM_H
|
#endif // MXDSANIM_H
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "mxdsevent.h"
|
#include "mxdsevent.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSEvent, 0xb8)
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c95f0
|
// OFFSET: LEGO1 0x100c95f0
|
||||||
MxDSEvent::MxDSEvent()
|
MxDSEvent::MxDSEvent()
|
||||||
{
|
{
|
||||||
@ -10,3 +12,30 @@ MxDSEvent::MxDSEvent()
|
|||||||
MxDSEvent::~MxDSEvent()
|
MxDSEvent::~MxDSEvent()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c97f0
|
||||||
|
void MxDSEvent::CopyFrom(MxDSEvent &p_dsEvent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9800
|
||||||
|
MxDSEvent &MxDSEvent::operator=(MxDSEvent &p_dsEvent)
|
||||||
|
{
|
||||||
|
if (this == &p_dsEvent)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
MxDSMediaAction::operator=(p_dsEvent);
|
||||||
|
this->CopyFrom(p_dsEvent);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9830
|
||||||
|
MxDSAction *MxDSEvent::Clone()
|
||||||
|
{
|
||||||
|
MxDSEvent *clone = new MxDSEvent();
|
||||||
|
|
||||||
|
if (clone)
|
||||||
|
*clone = *this;
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
@ -9,6 +9,9 @@ class MxDSEvent : public MxDSMediaAction
|
|||||||
MxDSEvent();
|
MxDSEvent();
|
||||||
virtual ~MxDSEvent() override;
|
virtual ~MxDSEvent() override;
|
||||||
|
|
||||||
|
void CopyFrom(MxDSEvent &p_dsEvent);
|
||||||
|
MxDSEvent &operator=(MxDSEvent &p_dsEvent);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c9660
|
// OFFSET: LEGO1 0x100c9660
|
||||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
@ -21,6 +24,8 @@ class MxDSEvent : public MxDSMediaAction
|
|||||||
{
|
{
|
||||||
return !strcmp(name, MxDSEvent::ClassName()) || MxDSMediaAction::IsA(name);
|
return !strcmp(name, MxDSEvent::ClassName()) || MxDSMediaAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual MxDSAction *Clone(); // vtable+2c;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXDSEVENT_H
|
#endif // MXDSEVENT_H
|
||||||
|
|||||||
@ -42,6 +42,7 @@ class MxDSObject : public MxCore
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline void SetType(MxDSType p_type) { this->m_type = p_type; }
|
inline void SetType(MxDSType p_type) { this->m_type = p_type; }
|
||||||
|
inline MxDSType GetType() { return (MxDSType) this->m_type; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxU32 m_sizeOnDisk;
|
MxU32 m_sizeOnDisk;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "mxdsobjectaction.h"
|
#include "mxdsobjectaction.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSObjectAction, 0xb8)
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c8870
|
// OFFSET: LEGO1 0x100c8870
|
||||||
MxDSObjectAction::MxDSObjectAction()
|
MxDSObjectAction::MxDSObjectAction()
|
||||||
{
|
{
|
||||||
@ -10,3 +12,30 @@ MxDSObjectAction::MxDSObjectAction()
|
|||||||
MxDSObjectAction::~MxDSObjectAction()
|
MxDSObjectAction::~MxDSObjectAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c8a70
|
||||||
|
void MxDSObjectAction::CopyFrom(MxDSObjectAction &p_dsObjectAction)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c8a80
|
||||||
|
MxDSObjectAction &MxDSObjectAction::operator=(MxDSObjectAction &p_dsObjectAction)
|
||||||
|
{
|
||||||
|
if (this == &p_dsObjectAction)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
MxDSMediaAction::operator=(p_dsObjectAction);
|
||||||
|
this->CopyFrom(p_dsObjectAction);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c8ab0
|
||||||
|
MxDSAction *MxDSObjectAction::Clone()
|
||||||
|
{
|
||||||
|
MxDSObjectAction *clone = new MxDSObjectAction();
|
||||||
|
|
||||||
|
if (clone)
|
||||||
|
*clone = *this;
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
|||||||
@ -11,6 +11,8 @@ class MxDSObjectAction : public MxDSMediaAction
|
|||||||
MxDSObjectAction();
|
MxDSObjectAction();
|
||||||
virtual ~MxDSObjectAction() override;
|
virtual ~MxDSObjectAction() override;
|
||||||
|
|
||||||
|
MxDSObjectAction &operator=(MxDSObjectAction &p_dsObjectAction);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c88e0
|
// OFFSET: LEGO1 0x100c88e0
|
||||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
@ -23,6 +25,9 @@ class MxDSObjectAction : public MxDSMediaAction
|
|||||||
{
|
{
|
||||||
return !strcmp(name, MxDSObjectAction::ClassName()) || MxDSMediaAction::IsA(name);
|
return !strcmp(name, MxDSObjectAction::ClassName()) || MxDSMediaAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual MxDSAction *Clone(); // vtable+2c;
|
||||||
|
virtual void CopyFrom(MxDSObjectAction &p_dsObjectAction); // vtable+44;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXDSOBJECTACTION_H
|
#endif // MXDSOBJECTACTION_H
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
#include "mxdssound.h"
|
#include "mxdssound.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSSound, 0xc0)
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c92c0
|
// OFFSET: LEGO1 0x100c92c0
|
||||||
MxDSSound::MxDSSound()
|
MxDSSound::MxDSSound()
|
||||||
{
|
{
|
||||||
this->m_lastField = 0x4f;
|
this->m_volume = 0x4f;
|
||||||
this->SetType(MxDSType_Sound);
|
this->SetType(MxDSType_Sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11,3 +13,50 @@ MxDSSound::MxDSSound()
|
|||||||
MxDSSound::~MxDSSound()
|
MxDSSound::~MxDSSound()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c94c0
|
||||||
|
void MxDSSound::CopyFrom(MxDSSound &p_dsSound)
|
||||||
|
{
|
||||||
|
this->SetType(p_dsSound.GetType());
|
||||||
|
this->m_volume = p_dsSound.m_volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c94e0
|
||||||
|
MxDSSound &MxDSSound::operator=(MxDSSound &p_dsSound)
|
||||||
|
{
|
||||||
|
if (this == &p_dsSound)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
MxDSMediaAction::operator=(p_dsSound);
|
||||||
|
this->CopyFrom(p_dsSound);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c95d0
|
||||||
|
MxU32 MxDSSound::GetSizeOnDisk()
|
||||||
|
{
|
||||||
|
MxU32 totalSizeOnDisk = MxDSMediaAction::GetSizeOnDisk();
|
||||||
|
|
||||||
|
this->m_sizeOnDisk = sizeof(this->m_volume);
|
||||||
|
return totalSizeOnDisk + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c95a0
|
||||||
|
void MxDSSound::Deserialize(char **p_source, MxS16 p_unk24)
|
||||||
|
{
|
||||||
|
MxDSMediaAction::Deserialize(p_source, p_unk24);
|
||||||
|
|
||||||
|
this->m_volume = *(MxS32*) *p_source;
|
||||||
|
*p_source += sizeof(MxS32);
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9510
|
||||||
|
MxDSAction *MxDSSound::Clone()
|
||||||
|
{
|
||||||
|
MxDSSound *clone = new MxDSSound();
|
||||||
|
|
||||||
|
if (clone)
|
||||||
|
*clone = *this;
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
@ -2,7 +2,6 @@
|
|||||||
#define MXDSSOUND_H
|
#define MXDSSOUND_H
|
||||||
|
|
||||||
#include "mxdsmediaaction.h"
|
#include "mxdsmediaaction.h"
|
||||||
#include "mxtypes.h"
|
|
||||||
|
|
||||||
// VTABLE 0x100dcdd0
|
// VTABLE 0x100dcdd0
|
||||||
// SIZE 0xc0
|
// SIZE 0xc0
|
||||||
@ -12,6 +11,9 @@ class MxDSSound : public MxDSMediaAction
|
|||||||
MxDSSound();
|
MxDSSound();
|
||||||
virtual ~MxDSSound() override;
|
virtual ~MxDSSound() override;
|
||||||
|
|
||||||
|
void CopyFrom(MxDSSound &p_dsSound);
|
||||||
|
MxDSSound &operator=(MxDSSound &p_dsSound);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c9330
|
// OFFSET: LEGO1 0x100c9330
|
||||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
@ -24,10 +26,14 @@ class MxDSSound : public MxDSMediaAction
|
|||||||
{
|
{
|
||||||
return !strcmp(name, MxDSSound::ClassName()) || MxDSMediaAction::IsA(name);
|
return !strcmp(name, MxDSSound::ClassName()) || MxDSMediaAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual MxU32 GetSizeOnDisk(); // vtable+18;
|
||||||
|
virtual void Deserialize(char **p_source, MxS16 p_unk24); // vtable+1c;
|
||||||
|
virtual MxDSAction *Clone(); // vtable+2c;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxS32 m_unkb8;
|
MxU32 m_sizeOnDisk;
|
||||||
MxLong m_lastField; // 0xbc
|
MxS32 m_volume; // 0xbc
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // MXDSSOUND_H
|
#endif // MXDSSOUND_H
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "mxdsstill.h"
|
#include "mxdsstill.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSStill, 0xb8)
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c98c0
|
// OFFSET: LEGO1 0x100c98c0
|
||||||
MxDSStill::MxDSStill()
|
MxDSStill::MxDSStill()
|
||||||
{
|
{
|
||||||
@ -10,3 +12,30 @@ MxDSStill::MxDSStill()
|
|||||||
MxDSStill::~MxDSStill()
|
MxDSStill::~MxDSStill()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9ac0
|
||||||
|
void MxDSStill::CopyFrom(MxDSStill &p_dsStill)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9ad0
|
||||||
|
MxDSStill &MxDSStill::operator=(MxDSStill &p_dsStill)
|
||||||
|
{
|
||||||
|
if (this == &p_dsStill)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
MxDSMediaAction::operator=(p_dsStill);
|
||||||
|
this->CopyFrom(p_dsStill);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9b00
|
||||||
|
MxDSAction *MxDSStill::Clone()
|
||||||
|
{
|
||||||
|
MxDSStill *clone = new MxDSStill();
|
||||||
|
|
||||||
|
if (clone)
|
||||||
|
*clone = *this;
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
@ -11,6 +11,9 @@ class MxDSStill : public MxDSMediaAction
|
|||||||
MxDSStill();
|
MxDSStill();
|
||||||
virtual ~MxDSStill() override;
|
virtual ~MxDSStill() override;
|
||||||
|
|
||||||
|
void CopyFrom(MxDSStill &p_dsStill);
|
||||||
|
MxDSStill &operator=(MxDSStill &p_dsStill);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c9930
|
// OFFSET: LEGO1 0x100c9930
|
||||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
@ -23,6 +26,8 @@ class MxDSStill : public MxDSMediaAction
|
|||||||
{
|
{
|
||||||
return !strcmp(name, MxDSStill::ClassName()) || MxDSMediaAction::IsA(name);
|
return !strcmp(name, MxDSStill::ClassName()) || MxDSMediaAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual MxDSAction *Clone(); // vtable+2c;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXDSSTILL_H
|
#endif // MXDSSTILL_H
|
||||||
|
|||||||
91
LEGO1/mxdsstreamingaction.cpp
Normal file
91
LEGO1/mxdsstreamingaction.cpp
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
#include "mxdsstreamingaction.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSStreamingAction, 0xb4)
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd010
|
||||||
|
MxDSStreamingAction::MxDSStreamingAction(MxDSAction &p_dsAction, MxU32 p_offset)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
*this = p_dsAction;
|
||||||
|
this->m_unk94 = p_offset;
|
||||||
|
this->m_bufferOffset = p_offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd0d0
|
||||||
|
MxDSStreamingAction::MxDSStreamingAction(MxDSStreamingAction &p_dsStreamingAction)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
CopyFrom(p_dsStreamingAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd150
|
||||||
|
MxDSStreamingAction::~MxDSStreamingAction()
|
||||||
|
{
|
||||||
|
// TODO: Implement MxDSBuffer
|
||||||
|
if (this->m_unka0)
|
||||||
|
delete this->m_unka0;
|
||||||
|
if (this->m_unka4)
|
||||||
|
delete this->m_unka4;
|
||||||
|
if (this->m_internalAction)
|
||||||
|
delete this->m_internalAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd220
|
||||||
|
MxDSStreamingAction *MxDSStreamingAction::CopyFrom(MxDSStreamingAction &p_dsStreamingAction)
|
||||||
|
{
|
||||||
|
*this = p_dsStreamingAction;
|
||||||
|
this->m_unk94 = p_dsStreamingAction.m_unk94;
|
||||||
|
this->m_bufferOffset = p_dsStreamingAction.m_bufferOffset;
|
||||||
|
this->m_unk9c = p_dsStreamingAction.m_unk9c;
|
||||||
|
this->m_unka0 = NULL;
|
||||||
|
this->m_unka4 = NULL;
|
||||||
|
this->m_unkac = p_dsStreamingAction.m_unkac;
|
||||||
|
this->m_unka8 = p_dsStreamingAction.m_unka8;
|
||||||
|
SetInternalAction(p_dsStreamingAction.m_internalAction ? p_dsStreamingAction.m_internalAction->Clone() : NULL);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd090
|
||||||
|
MxBool MxDSStreamingAction::HasId(MxU32 p_objectId)
|
||||||
|
{
|
||||||
|
if (this->m_internalAction)
|
||||||
|
return this->m_internalAction->HasId(p_objectId);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd1e0
|
||||||
|
MxResult MxDSStreamingAction::Init()
|
||||||
|
{
|
||||||
|
this->m_unk94 = 0;
|
||||||
|
this->m_bufferOffset = 0;
|
||||||
|
this->m_unk9c = 0;
|
||||||
|
this->m_unka0 = NULL;
|
||||||
|
this->m_unka4 = NULL;
|
||||||
|
this->m_unka8 = 0;
|
||||||
|
this->m_unkac = 2;
|
||||||
|
this->m_internalAction = NULL;
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd2a0
|
||||||
|
void MxDSStreamingAction::SetInternalAction(MxDSAction *p_dsAction)
|
||||||
|
{
|
||||||
|
if (this->m_internalAction)
|
||||||
|
delete this->m_internalAction;
|
||||||
|
this->m_internalAction = p_dsAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cd2d0
|
||||||
|
void MxDSStreamingAction::FUN_100CD2D0()
|
||||||
|
{
|
||||||
|
if (this->m_duration == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MxLong duration = this->m_duration / this->m_loopCount;
|
||||||
|
this->m_loopCount--;
|
||||||
|
|
||||||
|
this->m_duration -= duration;
|
||||||
|
this->m_unka8 += duration;
|
||||||
|
}
|
||||||
44
LEGO1/mxdsstreamingaction.h
Normal file
44
LEGO1/mxdsstreamingaction.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#ifndef MXDSSTREAMINGACTION_H
|
||||||
|
#define MXDSSTREAMINGACTION_H
|
||||||
|
|
||||||
|
#include "mxdsaction.h"
|
||||||
|
|
||||||
|
class MxDSBuffer;
|
||||||
|
|
||||||
|
// VTABLE 0x100dd088
|
||||||
|
// SIZE 0xb4
|
||||||
|
class MxDSStreamingAction : public MxDSAction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MxDSStreamingAction(MxDSAction &p_dsAction, MxU32 p_offset);
|
||||||
|
MxDSStreamingAction(MxDSStreamingAction &p_dsStreamingAction);
|
||||||
|
virtual ~MxDSStreamingAction();
|
||||||
|
|
||||||
|
MxDSStreamingAction *CopyFrom(MxDSStreamingAction &p_dsStreamingAction);
|
||||||
|
MxDSStreamingAction &operator=(MxDSAction &p_dsAction) {
|
||||||
|
MxDSAction::operator=(p_dsAction);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
MxDSStreamingAction &operator=(MxDSStreamingAction &p_dsStreamingAction) {
|
||||||
|
MxDSAction::operator=(p_dsStreamingAction);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual MxBool HasId(MxU32 p_objectId); // vtable+34;
|
||||||
|
|
||||||
|
MxResult Init();
|
||||||
|
void SetInternalAction(MxDSAction *p_dsAction);
|
||||||
|
void FUN_100CD2D0();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MxU32 m_unk94;
|
||||||
|
MxU32 m_bufferOffset;
|
||||||
|
MxS32 m_unk9c;
|
||||||
|
MxDSBuffer *m_unka0;
|
||||||
|
MxDSBuffer *m_unka4;
|
||||||
|
MxLong m_unka8;
|
||||||
|
undefined2 m_unkac;
|
||||||
|
MxDSAction *m_internalAction;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MXDSSTREAMINGACTION_H
|
||||||
@ -28,10 +28,10 @@ class MxNotification
|
|||||||
MxParam *m_param; // 0x4
|
MxParam *m_param; // 0x4
|
||||||
};
|
};
|
||||||
|
|
||||||
class MxIdList : public List<MxU32>
|
class MxIdList : public list<MxU32>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
class MxNotificationPtrList : public List<MxNotification *>
|
class MxNotificationPtrList : public list<MxNotification *>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
// VTABLE 0x100dc078
|
// VTABLE 0x100dc078
|
||||||
|
|||||||
@ -38,7 +38,7 @@ void MxOmni::Init()
|
|||||||
m_eventManager = NULL;
|
m_eventManager = NULL;
|
||||||
m_timer = NULL;
|
m_timer = NULL;
|
||||||
m_streamer = NULL;
|
m_streamer = NULL;
|
||||||
m_unk44 = NULL;
|
m_atomIdCounterSet = NULL;
|
||||||
m_unk64 = NULL;
|
m_unk64 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +104,8 @@ void MxOmni::SetInstance(MxOmni *instance)
|
|||||||
// OFFSET: LEGO1 0x100af0c0
|
// OFFSET: LEGO1 0x100af0c0
|
||||||
MxResult MxOmni::Create(MxOmniCreateParam &p)
|
MxResult MxOmni::Create(MxOmniCreateParam &p)
|
||||||
{
|
{
|
||||||
|
m_atomIdCounterSet = new MxAtomIdCounterSet();
|
||||||
|
|
||||||
if (p.CreateFlags().CreateVariableTable())
|
if (p.CreateFlags().CreateVariableTable())
|
||||||
{
|
{
|
||||||
MxVariableTable *variableTable = new MxVariableTable();
|
MxVariableTable *variableTable = new MxVariableTable();
|
||||||
@ -129,6 +131,40 @@ MxResult MxOmni::Create(MxOmniCreateParam &p)
|
|||||||
void MxOmni::Destroy()
|
void MxOmni::Destroy()
|
||||||
{
|
{
|
||||||
// FIXME: Stub
|
// FIXME: Stub
|
||||||
|
|
||||||
|
/*
|
||||||
|
// TODO: private members
|
||||||
|
if (m_notificationManager) {
|
||||||
|
while (m_notificationManager->m_queue->size()) {
|
||||||
|
m_notificationManager->Tickle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_notificationManager->m_active = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
delete m_eventManager;
|
||||||
|
delete m_soundManager;
|
||||||
|
delete m_musicManager;
|
||||||
|
delete m_videoManager;
|
||||||
|
delete m_streamer;
|
||||||
|
delete m_timer;
|
||||||
|
delete m_objectFactory;
|
||||||
|
delete m_variableTable;
|
||||||
|
delete m_notificationManager;
|
||||||
|
delete m_tickleManager;
|
||||||
|
|
||||||
|
// There could be a tree/iterator function that does this inline
|
||||||
|
if (m_atomIdCounterSet) {
|
||||||
|
while (!m_atomIdCounterSet->empty()) {
|
||||||
|
// Pop each node and delete its value
|
||||||
|
MxAtomIdCounterSet::iterator begin = m_atomIdCounterSet->begin();
|
||||||
|
MxAtomIdCounter *value = *begin;
|
||||||
|
m_atomIdCounterSet->erase(begin);
|
||||||
|
delete value;
|
||||||
|
}
|
||||||
|
delete m_atomIdCounterSet;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100b07f0
|
// OFFSET: LEGO1 0x100b07f0
|
||||||
@ -162,6 +198,12 @@ MxTimer *Timer()
|
|||||||
return MxOmni::GetInstance()->GetTimer();
|
return MxOmni::GetInstance()->GetTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100acee0
|
||||||
|
MxAtomIdCounterSet *AtomIdCounterSet()
|
||||||
|
{
|
||||||
|
return MxOmni::GetInstance()->GetAtomIdCounterSet();
|
||||||
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100acef0
|
// OFFSET: LEGO1 0x100acef0
|
||||||
MxStreamer* Streamer()
|
MxStreamer* Streamer()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
#include "mxtimer.h"
|
#include "mxtimer.h"
|
||||||
#include "mxvariabletable.h"
|
#include "mxvariabletable.h"
|
||||||
#include "mxvideomanager.h"
|
#include "mxvideomanager.h"
|
||||||
|
#include "mxatomidcounter.h"
|
||||||
|
|
||||||
// VTABLE 0x100dc168
|
// VTABLE 0x100dc168
|
||||||
// SIZE 0x68
|
// SIZE 0x68
|
||||||
@ -47,6 +48,7 @@ class MxOmni : public MxCore
|
|||||||
MxVariableTable* GetVariableTable() const { return this->m_variableTable; }
|
MxVariableTable* GetVariableTable() const { return this->m_variableTable; }
|
||||||
MxMusicManager* GetMusicManager() const { return this->m_musicManager; }
|
MxMusicManager* GetMusicManager() const { return this->m_musicManager; }
|
||||||
MxEventManager* GetEventManager() const { return this->m_eventManager; }
|
MxEventManager* GetEventManager() const { return this->m_eventManager; }
|
||||||
|
MxAtomIdCounterSet* GetAtomIdCounterSet() const { return this->m_atomIdCounterSet; }
|
||||||
protected:
|
protected:
|
||||||
static MxOmni* g_instance;
|
static MxOmni* g_instance;
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ class MxOmni : public MxCore
|
|||||||
MxTimer* m_timer; //0x3C
|
MxTimer* m_timer; //0x3C
|
||||||
MxStreamer* m_streamer; //0x40
|
MxStreamer* m_streamer; //0x40
|
||||||
|
|
||||||
int m_unk44; // 0x44
|
MxAtomIdCounterSet* m_atomIdCounterSet; // 0x44
|
||||||
|
|
||||||
MxCriticalSection m_criticalsection; // 0x48
|
MxCriticalSection m_criticalsection; // 0x48
|
||||||
|
|
||||||
@ -78,5 +80,6 @@ __declspec(dllexport) MxMusicManager * MusicManager();
|
|||||||
__declspec(dllexport) MxEventManager * EventManager();
|
__declspec(dllexport) MxEventManager * EventManager();
|
||||||
__declspec(dllexport) MxNotificationManager * NotificationManager();
|
__declspec(dllexport) MxNotificationManager * NotificationManager();
|
||||||
MxVideoManager * MVideoManager();
|
MxVideoManager * MVideoManager();
|
||||||
|
MxAtomIdCounterSet* AtomIdCounterSet();
|
||||||
|
|
||||||
#endif // MXOMNI_H
|
#endif // MXOMNI_H
|
||||||
|
|||||||
218
LEGO1/mxstl.h
Normal file
218
LEGO1/mxstl.h
Normal file
@ -0,0 +1,218 @@
|
|||||||
|
#ifndef MXSTL_H
|
||||||
|
#define MXSTL_H
|
||||||
|
|
||||||
|
#include <use_ansi.h>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <deque>
|
||||||
|
#include <functional>
|
||||||
|
#include <iterator>
|
||||||
|
#include <list>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <numeric>
|
||||||
|
#include <queue>
|
||||||
|
#include <set>
|
||||||
|
#include <stack>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/*
|
||||||
|
* Currently, all MS C compilers for Win32 platforms default to 8 byte
|
||||||
|
* alignment.
|
||||||
|
*/
|
||||||
|
#pragma pack(push,8)
|
||||||
|
#endif // _MSC_VER
|
||||||
|
|
||||||
|
template<class _TYPE>
|
||||||
|
class Deque : public deque<_TYPE, allocator<_TYPE> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Deque<_TYPE> _Myt;
|
||||||
|
typedef allocator<_TYPE> _A;
|
||||||
|
|
||||||
|
explicit Deque(const _A& _Al = _A()) : deque<_TYPE, _A>(_Al)
|
||||||
|
{}
|
||||||
|
|
||||||
|
explicit Deque(size_type _N, const _TYPE& _V = _TYPE()) : deque<_TYPE, _A>(_N, _V)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
deque<_TYPE, _A>::swap((deque<_TYPE, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _TYPE>
|
||||||
|
class List : public list<_TYPE, allocator<_TYPE> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef List<_TYPE> _Myt;
|
||||||
|
typedef allocator<_TYPE> _A;
|
||||||
|
|
||||||
|
explicit List() : list<_TYPE, _A>()
|
||||||
|
{}
|
||||||
|
|
||||||
|
explicit List(size_type _N, const _TYPE& _V = _TYPE()) : list<_TYPE, _A>(_N, _V)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
list<_TYPE, _A>::swap((list<_TYPE, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _K, class _TYPE, class _Pr>
|
||||||
|
class Map : public map<_K, _TYPE, _Pr, allocator<_TYPE> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Map<_K, _TYPE, _Pr> _Myt;
|
||||||
|
typedef allocator<_TYPE> _A;
|
||||||
|
|
||||||
|
explicit Map(const _Pr& _Pred = _Pr())
|
||||||
|
: map<_K, _TYPE, _Pr, _A>(_Pred)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
map<_K, _TYPE, _Pr, _A>::swap((map<_K, _TYPE, _Pr, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _K, class _TYPE, class _Pr>
|
||||||
|
class Multimap : public multimap<_K, _TYPE, _Pr, allocator<_TYPE> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Multimap<_K, _TYPE, _Pr> _Myt;
|
||||||
|
typedef allocator<_TYPE> _A;
|
||||||
|
|
||||||
|
explicit Multimap(const _Pr& _Pred = _Pr()) : multimap<_K, _TYPE, _Pr, _A>(_Pred)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
multimap<_K, _TYPE, _Pr, _A>::swap((multimap<_K, _TYPE, _Pr, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _K, class _Pr>
|
||||||
|
class Set : public set<_K, _Pr, allocator<_K> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Set<_K, _Pr> _Myt;
|
||||||
|
typedef allocator<_K> _A;
|
||||||
|
|
||||||
|
explicit Set(const _Pr& _Pred = _Pr()) : set<_K, _Pr, _A>(_Pred)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
set<_K, _Pr, _A>::swap((set<_K, _Pr, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _K, class _Pr>
|
||||||
|
class Multiset : public multiset<_K, _Pr, allocator<_K> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Multiset<_K, _Pr> _Myt;
|
||||||
|
typedef allocator<_K> _A;
|
||||||
|
|
||||||
|
explicit Multiset(const _Pr& _Pred = _Pr())
|
||||||
|
: multiset<_K, _Pr, _A>(_Pred)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
multiset<_K, _Pr, _A>::swap((multiset<_K, _Pr, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _TYPE>
|
||||||
|
class Vector : public vector<_TYPE, allocator<_TYPE> >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Vector<_TYPE> _Myt;
|
||||||
|
typedef allocator<_TYPE> _A;
|
||||||
|
|
||||||
|
explicit Vector(const _A& _Al = _A()) : vector<_TYPE, _A>(_Al)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void swap(_Myt& _X)
|
||||||
|
{
|
||||||
|
vector<_TYPE, _A>::swap((vector<_TYPE, _A>&)_X);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend void swap(_Myt& _X, _Myt& _Y)
|
||||||
|
{
|
||||||
|
_X.swap(_Y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _C, class _Pr>
|
||||||
|
class Priority_queue : public priority_queue<_C::value_type, _C, _Pr, _C::allocator_type>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef _C::value_type _TYPE;
|
||||||
|
typedef _C::allocator_type _A;
|
||||||
|
typedef _C::allocator_type allocator_type;
|
||||||
|
|
||||||
|
explicit Priority_queue(const _Pr& _X = _Pr(), const _C::allocator_type& _Al = _C::allocator_type()) : priority_queue<_C::value_type, _C, _Pr, _C::allocator_type>(_X, _Al)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class _C>
|
||||||
|
class Queue : public queue<_C::value_type, _C, _C::allocator_type>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template<class _C>
|
||||||
|
class Stack : public stack<_C::value_type, _C, _C::allocator_type>
|
||||||
|
{};
|
||||||
|
|
||||||
|
#define deque Deque
|
||||||
|
#define list List
|
||||||
|
#define map Map
|
||||||
|
#define multimap Multimap
|
||||||
|
#define set Set
|
||||||
|
#define multiset Multiset
|
||||||
|
#define vector Vector
|
||||||
|
#define priority_queue Priority_queue
|
||||||
|
#define queue Queue
|
||||||
|
#define stack Stack
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma pack(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // MXSTL_H
|
||||||
@ -53,7 +53,7 @@ class MxTickleClient
|
|||||||
MxU16 m_flags; // 0xc
|
MxU16 m_flags; // 0xc
|
||||||
};
|
};
|
||||||
|
|
||||||
class MxTickleClientPtrList : public List<MxTickleClient *>
|
class MxTickleClientPtrList : public list<MxTickleClient *>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
// VTABLE 0x100d86d8
|
// VTABLE 0x100d86d8
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user