diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 8d175dfa..93500783 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -357,7 +357,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } return DefWindowProcA(hWnd, uMsg, wParam, lParam); case WM_DISPLAYCHANGE: - if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->m_unk74 && VideoManager()->m_unk74[0x220]) { + if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->GetDirect3D() && VideoManager()->GetDirect3D()->GetDeviceModeFinder()) { int targetWidth = LOWORD(lParam); int targetHeight = HIWORD(lParam); int targetDepth = wParam; diff --git a/LEGO1/legovideomanager.h b/LEGO1/legovideomanager.h index 379ec468..60f670fb 100644 --- a/LEGO1/legovideomanager.h +++ b/LEGO1/legovideomanager.h @@ -2,7 +2,9 @@ #define LEGOVIDEOMANAGER_H #include "mxvideomanager.h" +#include "mxdirect3d.h" #include "lego3dmanager.h" +#include "decomp.h" // VTABLE 0x100d9c88 // SIZE 0x590 @@ -18,13 +20,16 @@ class LegoVideoManager : public MxVideoManager __declspec(dllexport) void MoveCursor(int x, int y); inline Lego3DManager *Get3DManager() { return this->m_3dManager; } + inline MxDirect3D *GetDirect3D() { return this->m_direct3d; } + void SetSkyColor(float r, float g, float b); - int m_unk64; +private: + undefined4 m_unk64; Lego3DManager *m_3dManager; - int m_unk6c; - int m_unk70; - int *m_unk74; + undefined4 m_unk6c; + undefined4 m_unk70; + MxDirect3D *m_direct3d; }; #endif // LEGOVIDEOMANAGER_H diff --git a/LEGO1/mxdirect3d.h b/LEGO1/mxdirect3d.h index e69de29b..ecc1f0aa 100644 --- a/LEGO1/mxdirect3d.h +++ b/LEGO1/mxdirect3d.h @@ -0,0 +1,25 @@ +#ifndef MXDIRECT3D_H +#define MXDIRECT3D_H + +#include "mxdirectdraw.h" +#include "decomp.h" + +#include + +class MxDeviceModeFinder; + +// SIZE 0x894 +class MxDirect3D : public MxDirectDraw +{ +public: + inline MxDeviceModeFinder *GetDeviceModeFinder() { return this->m_pDeviceModeFinder; }; + +private: + MxDeviceModeFinder *m_pDeviceModeFinder; + IDirect3D *m_pDirect3d; + IDirect3DDevice *m_pDirect3dDevice; + undefined4 m_unk88c; + undefined4 m_unk890; +}; + +#endif // MXDIRECT3D_H \ No newline at end of file diff --git a/LEGO1/mxdirectdraw.cpp b/LEGO1/mxdirectdraw.cpp index dbe07d12..625a6fae 100644 --- a/LEGO1/mxdirectdraw.cpp +++ b/LEGO1/mxdirectdraw.cpp @@ -2,6 +2,7 @@ #include "mxdirectdraw.h" #include "decomp.h" +DECOMP_SIZE_ASSERT(MxDirectDraw, 0x880); #ifndef DDSCAPS_3DDEVICE #define DDSCAPS_3DDEVICE 0x00002000l @@ -100,7 +101,7 @@ int MxDirectDraw::GetPrimaryBitDepth() dwRGBBitCount = ddsd.ddpfPixelFormat.dwRGBBitCount; g_is_PALETTEINDEXED8 = (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) != 0; pDDraw->Release(); -} + } return dwRGBBitCount; } @@ -738,7 +739,7 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp) EnableResizing(m_hWndMain, FALSE); - if (!m_bIsOnPrimaryDevice) + if (!m_bIsOnPrimaryDevice) { lpDD = NULL; result = DirectDrawCreate(0, &lpDD, 0); @@ -1096,7 +1097,7 @@ BOOL MxDirectDraw::SetPaletteEntries( if (m_pPalette != NULL) { - HRESULT result; + HRESULT result; result = m_pPalette->SetEntries(0, 0, _countof(m_paletteEntries), m_paletteEntries); if (result != DD_OK) { @@ -1194,13 +1195,12 @@ void MxDirectDraw::FUN_1009E020() line = (byte*)ddsd.lpSurface; for (j = ddsd.dwHeight; j-- ;) { - memset(line, 0, ddsd.dwWidth); - line += ddsd.lPitch; + memset(line, 0, ddsd.dwWidth); + line += ddsd.lPitch; } m_pBackBuffer->Unlock(ddsd.lpSurface); - if (m_bFlipSurfaces) { m_pFrontBuffer->Flip(NULL, DDFLIP_WAIT); diff --git a/LEGO1/mxdirectdraw.h b/LEGO1/mxdirectdraw.h index 2024a3ac..3e2c710a 100644 --- a/LEGO1/mxdirectdraw.h +++ b/LEGO1/mxdirectdraw.h @@ -3,11 +3,11 @@ #define MXDIRECTDRAW_H #include -#include +#include extern BOOL g_is_PALETTEINDEXED8; -//size 0x880 +// SIZE 0x880 class MxDirectDraw { public: