mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-24 00:31:16 +00:00
* This PR kicks off work on decompiling the D3D Retained Mode (D3DRM) rendering part of the codebase. * High level overview: * There is a base IMxDirect3DRMObject class which all of the D3DRM rendering objects inherit from. Its only virtual method is one to get the underlying object handle. * A hierarchy of abstract classes inherits from this base class, which I've called "IMxDirect3DRM<class>". These classes only have pure virtual methods on them and don't contain any data. * Each one of the abstract classes has exactly one concrete implementation, which I've called "MxDirect3DRM<class>". These classes have exactly one piece of data, which is a pointer to the underlying D3D Retained Mode object. * If the classes need to store additional data, they store it in a userdata blob which is attached to the D3DRM object rather than the additional data being stored in the class itself. * I've worked out about twice this many classes related to D3DRM rendering so far but the PR was getting large enough as is, so I'm cutting it here for now. * I decomped sufficiently many methods of these classe to convince myself that the above observations are correct. About 60% of the decomped methods here are perfect matches, including at least one non-trivial method per class.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
|
|
#include "mxdirect3drmdevice.h"
|
|
|
|
#include "ddraw.h"
|
|
|
|
// Not sure what the deal is with these small holder structs. They might
|
|
// actually be the first part of a larger class because I haven't worked out
|
|
// enough code further up the call chain to work my way back to a constructor.
|
|
struct D3DHolder
|
|
{
|
|
IDirect3D *m_pDirect3D;
|
|
IDirect3DDevice *m_pDirect3DDevice;
|
|
};
|
|
|
|
struct D3DSurfaceHolder
|
|
{
|
|
IDirectDraw* m_pDirectDraw;
|
|
int unk;
|
|
IDirectDrawSurface* m_pDirectDrawSurface;
|
|
};
|
|
|
|
// VTABLE 0x100db948
|
|
class IMxDirect3DRM : public IMxDirect3DRMObject
|
|
{
|
|
public:
|
|
virtual ~IMxDirect3DRM() {}
|
|
|
|
virtual IUnknown **GetHandle() = 0;
|
|
virtual MxDirect3DRMDevice *CreateDeviceFromD3D(D3DHolder *p_holder) = 0;
|
|
};
|
|
|
|
// VTABLE 0x100db910
|
|
class MxDirect3DRM : public IMxDirect3DRM
|
|
{
|
|
public:
|
|
inline MxDirect3DRM();
|
|
virtual ~MxDirect3DRM();
|
|
|
|
static MxDirect3DRM *Create();
|
|
|
|
virtual IUnknown **GetHandle();
|
|
virtual MxDirect3DRMDevice *CreateDeviceFromD3D(D3DHolder *p_holder);
|
|
virtual MxDirect3DRMDevice *CreateDeviceFromSurface(D3DSurfaceHolder *p_holder);
|
|
|
|
private:
|
|
IDirect3DRM *m_pD3DRM;
|
|
}; |