mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-26 17:46:38 -05:00
PresenterNameDispatch (#137)
* PresenterNameDispatch * Use reference for PresenterNameDispatch param - fix or add const markers so we can use a const reference
This commit is contained in:
parent
b4258da0f5
commit
6dd94d3626
5 changed files with 69 additions and 2 deletions
|
@ -12,6 +12,7 @@ class MxDSAction : public MxDSObject
|
|||
public:
|
||||
enum
|
||||
{
|
||||
Flag_Looping = 0x01,
|
||||
Flag_Enabled = 0x20,
|
||||
Flag_Parsed = 0x80,
|
||||
};
|
||||
|
@ -55,6 +56,8 @@ class MxDSAction : public MxDSObject
|
|||
inline const MxVector3Data &GetLocation() const { return m_location; }
|
||||
inline void SetOmni(MxOmni *p_omni) { m_omni = p_omni; }
|
||||
|
||||
inline MxBool IsLooping() const { return this->m_flags & Flag_Looping; }
|
||||
|
||||
private:
|
||||
MxU32 m_sizeOnDisk;
|
||||
MxU32 m_flags;
|
||||
|
|
|
@ -32,6 +32,8 @@ class MxDSMediaAction : public MxDSAction
|
|||
virtual void Deserialize(char **p_source, MxS16 p_unk24); // vtable+1c;
|
||||
|
||||
void CopyMediaSrcPath(const char *p_mediaSrcPath);
|
||||
|
||||
inline MxS32 GetMediaFormat() const { return this->m_mediaFormat; }
|
||||
private:
|
||||
MxU32 m_sizeOnDisk;
|
||||
char *m_mediaSrcPath;
|
||||
|
|
|
@ -40,9 +40,10 @@ class MxDSObject : public MxCore
|
|||
inline void SetObjectId(MxU32 p_objectId) { this->m_objectId = p_objectId; }
|
||||
inline void SetUnknown24(MxS16 p_unk24) { this->m_unk24 = p_unk24; }
|
||||
|
||||
protected:
|
||||
inline char *GetSourceName() const { return this->m_sourceName; }
|
||||
|
||||
inline void SetType(MxDSType p_type) { this->m_type = p_type; }
|
||||
inline MxDSType GetType() { return (MxDSType) this->m_type; }
|
||||
inline MxDSType GetType() const { return (MxDSType) this->m_type; }
|
||||
|
||||
private:
|
||||
MxU32 m_sizeOnDisk;
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "mxautolocker.h"
|
||||
#include "mxparam.h"
|
||||
#include "legoomni.h"
|
||||
#include "mxdsanim.h"
|
||||
#include "mxdssound.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "decomp.h"
|
||||
|
@ -155,6 +157,63 @@ void MxPresenter::Enable(MxBool p_enable)
|
|||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b5310
|
||||
char *PresenterNameDispatch(const MxDSAction &p_action)
|
||||
{
|
||||
char *name = p_action.GetSourceName();
|
||||
MxS32 format;
|
||||
|
||||
if (!name || strlen(name) == 0) {
|
||||
switch (p_action.GetType()) {
|
||||
case MxDSType_Anim:
|
||||
format = ((MxDSAnim&)p_action).GetMediaFormat();
|
||||
switch (format) {
|
||||
case FOURCC(' ', 'F', 'L', 'C'):
|
||||
name = !p_action.IsLooping() ?
|
||||
"MxFlcPresenter" :
|
||||
"MxLoopingFlcPresenter";
|
||||
break;
|
||||
case FOURCC(' ', 'S', 'M', 'K'):
|
||||
name = !p_action.IsLooping() ?
|
||||
"MxSmkPresenter" :
|
||||
"MxLoopingSmkPresenter";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case MxDSType_Sound:
|
||||
format = ((MxDSSound&)p_action).GetMediaFormat();
|
||||
switch(format) {
|
||||
case FOURCC(' ', 'M', 'I', 'D'):
|
||||
name = !p_action.IsLooping() ?
|
||||
"MxMIDIPresenter" :
|
||||
"MxLoopingMIDIPresenter";
|
||||
break;
|
||||
case FOURCC(' ', 'W', 'A', 'V'):
|
||||
name = "MxWavePresenter";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case MxDSType_SerialAction:
|
||||
case MxDSType_ParallelAction:
|
||||
case MxDSType_SelectAction:
|
||||
name = "MxCompositePresenter";
|
||||
break;
|
||||
|
||||
case MxDSType_Event:
|
||||
name = "MxEventPresenter";
|
||||
break;
|
||||
|
||||
case MxDSType_Still:
|
||||
name = "MxStillPresenter";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b54c0
|
||||
MxBool MxPresenter::IsEnabled()
|
||||
{
|
||||
|
|
|
@ -84,4 +84,6 @@ class MxPresenter : public MxCore
|
|||
MxPresenter *m_unkPresenter; // 0x3c
|
||||
};
|
||||
|
||||
char *PresenterNameDispatch(const MxDSAction &);
|
||||
|
||||
#endif // MXPRESENTER_H
|
||||
|
|
Loading…
Reference in a new issue