Use reference for PresenterNameDispatch param

- fix or add const markers so we can use a const reference
This commit is contained in:
disinvite 2023-09-22 17:04:01 -04:00
parent 8fbacc0837
commit 353c1c2dcd
5 changed files with 13 additions and 13 deletions

View File

@ -56,7 +56,7 @@ class MxDSAction : public MxDSObject
inline const MxVector3Data &GetLocation() const { return m_location; }
inline void SetOmni(MxOmni *p_omni) { m_omni = p_omni; }
inline MxBool const IsLooping() { return this->m_flags & Flag_Looping; }
inline MxBool IsLooping() const { return this->m_flags & Flag_Looping; }
private:
MxU32 m_sizeOnDisk;

View File

@ -33,7 +33,7 @@ class MxDSMediaAction : public MxDSAction
void CopyMediaSrcPath(const char *p_mediaSrcPath);
inline MxS32 const GetMediaFormat() { return this->m_mediaFormat; }
inline MxS32 GetMediaFormat() const { return this->m_mediaFormat; }
private:
MxU32 m_sizeOnDisk;
char *m_mediaSrcPath;

View File

@ -40,10 +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; }
inline char *GetSourceName() { return this->m_sourceName; }
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;

View File

@ -158,23 +158,23 @@ void MxPresenter::Enable(MxBool p_enable)
}
// OFFSET: LEGO1 0x100b5310
char *PresenterNameDispatch(MxDSAction *p_action)
char *PresenterNameDispatch(const MxDSAction &p_action)
{
char *name = p_action->GetSourceName();
char *name = p_action.GetSourceName();
MxS32 format;
if (!name || strlen(name) == 0) {
switch (p_action->GetType()) {
switch (p_action.GetType()) {
case MxDSType_Anim:
format = ((MxDSAnim*)p_action)->GetMediaFormat();
format = ((MxDSAnim&)p_action).GetMediaFormat();
switch (format) {
case FOURCC(' ', 'F', 'L', 'C'):
name = !p_action->IsLooping() ?
name = !p_action.IsLooping() ?
"MxFlcPresenter" :
"MxLoopingFlcPresenter";
break;
case FOURCC(' ', 'S', 'M', 'K'):
name = !p_action->IsLooping() ?
name = !p_action.IsLooping() ?
"MxSmkPresenter" :
"MxLoopingSmkPresenter";
break;
@ -182,10 +182,10 @@ char *PresenterNameDispatch(MxDSAction *p_action)
break;
case MxDSType_Sound:
format = ((MxDSSound*)p_action)->GetMediaFormat();
format = ((MxDSSound&)p_action).GetMediaFormat();
switch(format) {
case FOURCC(' ', 'M', 'I', 'D'):
name = !p_action->IsLooping() ?
name = !p_action.IsLooping() ?
"MxMIDIPresenter" :
"MxLoopingMIDIPresenter";
break;

View File

@ -84,6 +84,6 @@ class MxPresenter : public MxCore
MxPresenter *m_unkPresenter; // 0x3c
};
char *PresenterNameDispatch(MxDSAction *);
char *PresenterNameDispatch(const MxDSAction &);
#endif // MXPRESENTER_H