isle-portable/LEGO1/mxdirectx/mxdirectdraw.h

110 lines
3.7 KiB
C
Raw Normal View History

2023-04-27 22:19:39 -04:00
#ifndef MXDIRECTDRAW_H
#define MXDIRECTDRAW_H
#include "mxdirectxinfo.h"
#include <ddraw.h>
#include <windows.h>
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// VTABLE: LEGO1 0x100db818
// SIZE 0x880
2023-10-24 19:38:27 -04:00
class MxDirectDraw {
public:
2023-10-24 19:38:27 -04:00
typedef void (*ErrorHandler)(const char*, HRESULT, void*);
static int GetPrimaryBitDepth();
2023-10-24 19:38:27 -04:00
MxDirectDraw();
virtual ~MxDirectDraw();
2023-10-24 19:38:27 -04:00
virtual BOOL Create(
HWND hWnd,
BOOL fullscreen_1,
BOOL surface_fullscreen,
BOOL onlySystemMemory,
int width,
int height,
int bpp,
const PALETTEENTRY* pPaletteEntries,
int paletteEntryCount
); // vtable+0x04
virtual void Destroy(); // vtable+0x08
virtual void DestroyButNotDirectDraw(); // vtable+0x0c
IDirectDraw* DirectDraw() { return m_pDirectDraw; }
IDirectDrawSurface* FrontBuffer() { return m_pFrontBuffer; }
IDirectDrawSurface* BackBuffer() { return m_pBackBuffer; }
IDirectDrawClipper* Clipper() { return m_pClipper; }
BOOL IsFullScreen() { return m_bFullScreen; }
BOOL IsSupportedMode(int width, int height, int bpp);
int Pause(BOOL);
BOOL RestoreSurfaces();
BOOL TextToTextSurface1(const char* text);
BOOL TextToTextSurface2(const char* lpString);
virtual const char* ErrorToString(HRESULT p_error); // vtable+0x10
int FlipToGDISurface();
protected:
BOOL SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int paletteEntryCount, BOOL fullscreen);
2023-10-24 19:38:27 -04:00
BOOL CacheOriginalPaletteEntries();
BOOL RestoreOriginalPaletteEntries();
BOOL RestorePaletteEntries();
2023-10-24 19:38:27 -04:00
BOOL DDInit(BOOL fullscreen);
BOOL DDSetMode(int width, int height, int bpp);
BOOL DDCreateSurfaces();
HRESULT CreateDDSurface(LPDDSURFACEDESC a2, LPDIRECTDRAWSURFACE* a3, IUnknown* a4);
BOOL GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSURFACE lpDDSurf);
BOOL CreateZBuffer(DWORD memorytype, DWORD depth);
BOOL CreateTextSurfaces();
BOOL TextToTextSurface(const char* text, IDirectDrawSurface* pSurface, SIZE& textSizeOnSurface);
void Error(const char* p_message, int p_error);
2023-10-24 19:38:27 -04:00
BOOL RecreateDirectDraw(GUID** a2);
void FUN_1009e020();
void FUN_1009d920();
// SYNTHETIC: LEGO1 0x1009d510
// MxDirectDraw::`scalar deleting destructor'
protected:
BOOL m_bOnlySoftRender; // 0x04
BOOL m_bFlipSurfaces; // 0x08
IDirectDraw* m_pDirectDraw; // 0x0c
IDirectDrawSurface* m_pFrontBuffer; // 0x10
IDirectDrawSurface* m_pBackBuffer; // 0x14
IDirectDrawSurface* m_pZBuffer; // 0x18
IDirectDrawSurface* m_pText1Surface; // 0x1c
IDirectDrawSurface* m_pText2Surface; // 0x20
IDirectDrawClipper* m_pClipper; // 0x24
IDirectDrawPalette* m_pPalette; // 0x28
PALETTEENTRY m_paletteEntries[256]; // 0x2c
PALETTEENTRY m_originalPaletteEntries[256]; // 0x42c
SIZE m_text1SizeOnSurface; // 0x82c
SIZE m_text2SizeOnSurface; // 0x834
HWND m_hWndMain; // 0x83c
HFONT m_hFont; // 0x840
BOOL m_bIgnoreWMSIZE; // 0x844
BOOL m_bPrimaryPalettized; // 0x848
BOOL m_bFullScreen; // 0x84c
void* m_unk0x850; // 0x850
BOOL m_bOnlySystemMemory; // 0x854
BOOL m_bIsOnPrimaryDevice; // 0x858
ErrorHandler m_pErrorHandler; // 0x85c
ErrorHandler m_pFatalErrorHandler; // 0x860
void* m_pErrorHandlerArg; // 0x864
void* m_pFatalErrorHandlerArg; // 0x868
int m_pauseCount; // 0x86c
DeviceModesInfo* m_pCurrentDeviceModesList; // 0x870
DeviceModesInfo::Mode m_currentMode; // 0x874
2023-04-27 22:19:39 -04:00
};
#endif // MXDIRECTDRAW_H