mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
Alternative approach to MinGW compatibility
This commit is contained in:
parent
5bf7f1e57a
commit
fd848fa096
14
LEGO1/compat.h
Normal file
14
LEGO1/compat.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef ISLECOMPAT_H
|
||||||
|
#define ISLECOMPAT_H
|
||||||
|
|
||||||
|
// Various macros to enable compiling with other/newer compilers.
|
||||||
|
|
||||||
|
// Use `COMPAT_CONST` where something ought to be 'const', and a newer compiler would complain if it
|
||||||
|
// wasn't, but we know it isn't 'const' in the original code.
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#define COMPAT_CONST const
|
||||||
|
#else
|
||||||
|
#define COMPAT_CONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // ISLECOMPAT_H
|
||||||
@ -176,19 +176,12 @@ void LegoOmni::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x10058e70
|
// OFFSET: LEGO1 0x10058e70
|
||||||
MxResult LegoOmni::Create(MxOmniCreateParam &p)
|
MxResult LegoOmni::Create(COMPAT_CONST MxOmniCreateParam &p)
|
||||||
{
|
{
|
||||||
// FIXME: Stub
|
// FIXME: Stub
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__MINGW32__)
|
|
||||||
MxResult LegoOmni::Create(const MxOmniCreateParam &p)
|
|
||||||
{
|
|
||||||
return Create((MxOmniCreateParam &)p);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void LegoOmni::Destroy()
|
void LegoOmni::Destroy()
|
||||||
{
|
{
|
||||||
// FIXME: Stub
|
// FIXME: Stub
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#ifndef LEGOOMNI_H
|
#ifndef LEGOOMNI_H
|
||||||
#define LEGOOMNI_H
|
#define LEGOOMNI_H
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
#include "legoentity.h"
|
#include "legoentity.h"
|
||||||
#include "legoinputmanager.h"
|
#include "legoinputmanager.h"
|
||||||
#include "legogamestate.h"
|
#include "legogamestate.h"
|
||||||
@ -51,7 +52,7 @@ class LegoOmni : public MxOmni
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void Init(); // vtable+14
|
virtual void Init(); // vtable+14
|
||||||
virtual MxResult Create(MxOmniCreateParam &p); // vtable+18
|
virtual MxResult Create(COMPAT_CONST MxOmniCreateParam &p); // vtable+18
|
||||||
virtual void Destroy(); // vtable+1c
|
virtual void Destroy(); // vtable+1c
|
||||||
virtual void vtable20();
|
virtual void vtable20();
|
||||||
virtual void vtable24(MxDSAction &ds);
|
virtual void vtable24(MxDSAction &ds);
|
||||||
@ -63,10 +64,6 @@ class LegoOmni : public MxOmni
|
|||||||
virtual void vtable3c();
|
virtual void vtable3c();
|
||||||
virtual unsigned char vtable40();
|
virtual unsigned char vtable40();
|
||||||
|
|
||||||
#if defined(__MINGW32__)
|
|
||||||
virtual MxResult Create(const MxOmniCreateParam &p); // vtable+18
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LegoVideoManager *GetVideoManager() { return (LegoVideoManager *) m_videoManager; }
|
LegoVideoManager *GetVideoManager() { return (LegoVideoManager *) m_videoManager; }
|
||||||
LegoSoundManager *GetSoundManager() { return (LegoSoundManager *)m_soundManager;}
|
LegoSoundManager *GetSoundManager() { return (LegoSoundManager *)m_soundManager;}
|
||||||
MxBackgroundAudioManager *GetBackgroundAudioManager() { return m_bkgAudioManager; }
|
MxBackgroundAudioManager *GetBackgroundAudioManager() { return m_bkgAudioManager; }
|
||||||
|
|||||||
@ -17,7 +17,7 @@ MxVideoParam::MxVideoParam()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100beca0
|
// OFFSET: LEGO1 0x100beca0
|
||||||
MxVideoParam::MxVideoParam(MxRect32 &p_rect, MxPalette *p_pal, unsigned long p_backBuffers, MxVideoParamFlags &p_flags)
|
MxVideoParam::MxVideoParam(COMPAT_CONST MxRect32 &p_rect, MxPalette *p_pal, unsigned long p_backBuffers, COMPAT_CONST MxVideoParamFlags &p_flags)
|
||||||
{
|
{
|
||||||
this->m_rect.m_left = p_rect.m_left;
|
this->m_rect.m_left = p_rect.m_left;
|
||||||
this->m_rect.m_top = p_rect.m_top;
|
this->m_rect.m_top = p_rect.m_top;
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
#include "mxpalette.h"
|
#include "mxpalette.h"
|
||||||
#include "mxrect32.h"
|
#include "mxrect32.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
@ -14,17 +15,10 @@ class MxVideoParam
|
|||||||
public:
|
public:
|
||||||
__declspec(dllexport) MxVideoParam();
|
__declspec(dllexport) MxVideoParam();
|
||||||
__declspec(dllexport) MxVideoParam(MxVideoParam &);
|
__declspec(dllexport) MxVideoParam(MxVideoParam &);
|
||||||
__declspec(dllexport) MxVideoParam(MxRect32 &rect, MxPalette *pal, unsigned long p3, MxVideoParamFlags &flags);
|
__declspec(dllexport) MxVideoParam(COMPAT_CONST MxRect32 &rect, MxPalette *pal, unsigned long p3, COMPAT_CONST MxVideoParamFlags &flags);
|
||||||
__declspec(dllexport) MxVideoParam &operator=(const MxVideoParam &);
|
__declspec(dllexport) MxVideoParam &operator=(const MxVideoParam &);
|
||||||
__declspec(dllexport) ~MxVideoParam();
|
__declspec(dllexport) ~MxVideoParam();
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
__declspec(dllexport) MxVideoParam(const MxRect32 &rect, MxPalette *pal, unsigned long p3, const MxVideoParamFlags &flags)
|
|
||||||
: MxVideoParam((MxRect32 &)rect, pal, p3, (MxVideoParamFlags &)flags)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
__declspec(dllexport) void SetDeviceName(char *id);
|
__declspec(dllexport) void SetDeviceName(char *id);
|
||||||
|
|
||||||
inline MxVideoParamFlags &flags() { return m_flags; }
|
inline MxVideoParamFlags &flags() { return m_flags; }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user