mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
Various DirectDraw items (#1411)
This commit is contained in:
@@ -12,21 +12,24 @@ DECOMP_SIZE_ASSERT(MxDirect3D, 0x894)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b0a0
|
// FUNCTION: LEGO1 0x1009b0a0
|
||||||
|
// FUNCTION: BETA10 0x1011b220
|
||||||
MxDirect3D::MxDirect3D()
|
MxDirect3D::MxDirect3D()
|
||||||
{
|
{
|
||||||
this->m_pDirect3d = NULL;
|
m_pDirect3d = NULL;
|
||||||
this->m_pDirect3dDevice = NULL;
|
m_pDirect3dDevice = NULL;
|
||||||
this->m_bTexturesDisabled = FALSE;
|
m_bTexturesDisabled = FALSE;
|
||||||
this->m_assignedDevice = NULL;
|
m_currentDeviceInfo = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b140
|
// FUNCTION: LEGO1 0x1009b140
|
||||||
|
// FUNCTION: BETA10 0x1011b2c3
|
||||||
MxDirect3D::~MxDirect3D()
|
MxDirect3D::~MxDirect3D()
|
||||||
{
|
{
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b1a0
|
// FUNCTION: LEGO1 0x1009b1a0
|
||||||
|
// FUNCTION: BETA10 0x1011b333
|
||||||
BOOL MxDirect3D::Create(
|
BOOL MxDirect3D::Create(
|
||||||
HWND hWnd,
|
HWND hWnd,
|
||||||
BOOL fullscreen_1,
|
BOOL fullscreen_1,
|
||||||
@@ -40,22 +43,33 @@ BOOL MxDirect3D::Create(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
BOOL success = FALSE;
|
BOOL success = FALSE;
|
||||||
BOOL ret = MxDirectDraw::Create(
|
assert(m_currentDeviceInfo);
|
||||||
hWnd,
|
|
||||||
fullscreen_1,
|
|
||||||
surface_fullscreen,
|
|
||||||
onlySystemMemory,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
bpp,
|
|
||||||
pPaletteEntries,
|
|
||||||
paletteEntryCount
|
|
||||||
);
|
|
||||||
|
|
||||||
if (ret && D3DCreate() && D3DSetMode()) {
|
if (!MxDirectDraw::Create(
|
||||||
success = TRUE;
|
hWnd,
|
||||||
|
fullscreen_1,
|
||||||
|
surface_fullscreen,
|
||||||
|
onlySystemMemory,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
bpp,
|
||||||
|
pPaletteEntries,
|
||||||
|
paletteEntryCount
|
||||||
|
)) {
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!D3DCreate()) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!D3DSetMode()) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
success = TRUE;
|
||||||
|
|
||||||
|
done:
|
||||||
if (!success) {
|
if (!success) {
|
||||||
FUN_1009d920();
|
FUN_1009d920();
|
||||||
}
|
}
|
||||||
@@ -64,24 +78,26 @@ BOOL MxDirect3D::Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b210
|
// FUNCTION: LEGO1 0x1009b210
|
||||||
|
// FUNCTION: BETA10 0x1011b41d
|
||||||
void MxDirect3D::Destroy()
|
void MxDirect3D::Destroy()
|
||||||
{
|
{
|
||||||
RELEASE(m_pDirect3dDevice);
|
RELEASE(m_pDirect3dDevice);
|
||||||
RELEASE(m_pDirect3d);
|
RELEASE(m_pDirect3d);
|
||||||
|
|
||||||
if (this->m_assignedDevice) {
|
if (m_currentDeviceInfo) {
|
||||||
delete m_assignedDevice;
|
delete m_currentDeviceInfo;
|
||||||
this->m_assignedDevice = NULL;
|
m_currentDeviceInfo = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pCurrentDeviceModesList) {
|
if (m_currentDevInfo) {
|
||||||
m_pCurrentDeviceModesList = NULL;
|
m_currentDevInfo = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MxDirectDraw::Destroy();
|
MxDirectDraw::Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b290
|
// FUNCTION: LEGO1 0x1009b290
|
||||||
|
// FUNCTION: BETA10 0x1011b50a
|
||||||
void MxDirect3D::DestroyButNotDirectDraw()
|
void MxDirect3D::DestroyButNotDirectDraw()
|
||||||
{
|
{
|
||||||
RELEASE(m_pDirect3dDevice);
|
RELEASE(m_pDirect3dDevice);
|
||||||
@@ -90,6 +106,7 @@ void MxDirect3D::DestroyButNotDirectDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b2d0
|
// FUNCTION: LEGO1 0x1009b2d0
|
||||||
|
// FUNCTION: BETA10 0x1011b592
|
||||||
BOOL MxDirect3D::D3DCreate()
|
BOOL MxDirect3D::D3DCreate()
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -103,46 +120,50 @@ BOOL MxDirect3D::D3DCreate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b310
|
// FUNCTION: LEGO1 0x1009b310
|
||||||
|
// FUNCTION: BETA10 0x1011b617
|
||||||
BOOL MxDirect3D::D3DSetMode()
|
BOOL MxDirect3D::D3DSetMode()
|
||||||
{
|
{
|
||||||
if (m_assignedDevice->m_flags & MxAssignedDevice::c_hardwareMode) {
|
assert(m_currentDeviceInfo);
|
||||||
|
|
||||||
|
if (m_currentDeviceInfo->m_flags & MxAssignedDevice::c_hardwareMode) {
|
||||||
if (m_bOnlySoftRender) {
|
if (m_bOnlySoftRender) {
|
||||||
Error("Failed to place vital surfaces in video memory for hardware driver", DDERR_GENERIC);
|
Error("Failed to place vital surfaces in video memory for hardware driver", DDERR_GENERIC);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_assignedDevice->m_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) {
|
if (m_currentDeviceInfo->m_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) {
|
||||||
m_bTexturesDisabled = FALSE;
|
m_bTexturesDisabled = FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_bTexturesDisabled = TRUE;
|
m_bTexturesDisabled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CreateZBuffer(DDSCAPS_VIDEOMEMORY, ZBufferDepth(m_assignedDevice))) {
|
if (!CreateZBuffer(DDSCAPS_VIDEOMEMORY, ZBufferDepth(m_currentDeviceInfo))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_assignedDevice->m_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) {
|
if (m_currentDeviceInfo->m_desc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) {
|
||||||
m_bTexturesDisabled = FALSE;
|
m_bTexturesDisabled = FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_bTexturesDisabled = TRUE;
|
m_bTexturesDisabled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CreateZBuffer(DDSCAPS_SYSTEMMEMORY, ZBufferDepth(m_assignedDevice))) {
|
if (!CreateZBuffer(DDSCAPS_SYSTEMMEMORY, ZBufferDepth(m_currentDeviceInfo))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT result = m_pDirect3d->CreateDevice(m_assignedDevice->m_guid, m_pBackBuffer, &m_pDirect3dDevice);
|
LPDIRECTDRAWSURFACE backBuf = BackBuffer();
|
||||||
|
HRESULT result = m_pDirect3d->CreateDevice(m_currentDeviceInfo->m_guid, backBuf, &m_pDirect3dDevice);
|
||||||
|
|
||||||
if (result != DD_OK) {
|
if (result != DD_OK) {
|
||||||
Error("Create D3D device failed", result);
|
Error("Create D3D device failed", result);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceModesInfo::Mode mode = m_currentMode;
|
DeviceModesInfo::Mode mode = *CurrentMode();
|
||||||
|
|
||||||
if (IsFullScreen()) {
|
if (IsFullScreen()) {
|
||||||
if (!IsSupportedMode(mode.width, mode.height, mode.bitsPerPixel)) {
|
if (!IsSupportedMode(mode.width, mode.height, mode.bitsPerPixel)) {
|
||||||
@@ -151,8 +172,8 @@ BOOL MxDirect3D::D3DSetMode()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LPDIRECTDRAWSURFACE frontBuffer = m_pFrontBuffer;
|
LPDIRECTDRAWSURFACE frontBuffer = FrontBuffer();
|
||||||
LPDIRECTDRAWSURFACE backBuffer = m_pBackBuffer;
|
LPDIRECTDRAWSURFACE backBuffer = BackBuffer();
|
||||||
|
|
||||||
DDSURFACEDESC desc;
|
DDSURFACEDESC desc;
|
||||||
memset(&desc, 0, sizeof(desc));
|
memset(&desc, 0, sizeof(desc));
|
||||||
@@ -161,7 +182,7 @@ BOOL MxDirect3D::D3DSetMode()
|
|||||||
if (backBuffer->Lock(NULL, &desc, DDLOCK_WAIT, NULL) == DD_OK) {
|
if (backBuffer->Lock(NULL, &desc, DDLOCK_WAIT, NULL) == DD_OK) {
|
||||||
unsigned char* surface = (unsigned char*) desc.lpSurface;
|
unsigned char* surface = (unsigned char*) desc.lpSurface;
|
||||||
|
|
||||||
for (int i = mode.height; i > 0; i--) {
|
for (int i = 0; i < mode.height; i++) {
|
||||||
memset(surface, 0, mode.width * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
memset(surface, 0, mode.width * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||||
surface += desc.lPitch;
|
surface += desc.lPitch;
|
||||||
}
|
}
|
||||||
@@ -172,14 +193,14 @@ BOOL MxDirect3D::D3DSetMode()
|
|||||||
OutputDebugString("MxDirect3D::D3DSetMode() back lock failed\n");
|
OutputDebugString("MxDirect3D::D3DSetMode() back lock failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_bFullScreen) {
|
if (IsFullScreen()) {
|
||||||
memset(&desc, 0, sizeof(desc));
|
memset(&desc, 0, sizeof(desc));
|
||||||
desc.dwSize = sizeof(desc);
|
desc.dwSize = sizeof(desc);
|
||||||
|
|
||||||
if (frontBuffer->Lock(NULL, &desc, DDLOCK_WAIT, NULL) == DD_OK) {
|
if (frontBuffer->Lock(NULL, &desc, DDLOCK_WAIT, NULL) == DD_OK) {
|
||||||
unsigned char* surface = (unsigned char*) desc.lpSurface;
|
unsigned char* surface = (unsigned char*) desc.lpSurface;
|
||||||
|
|
||||||
for (int i = mode.height; i > 0; i--) {
|
for (int i = 0; i < mode.height; i++) {
|
||||||
memset(surface, 0, mode.width * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
memset(surface, 0, mode.width * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||||
surface += desc.lPitch;
|
surface += desc.lPitch;
|
||||||
}
|
}
|
||||||
@@ -195,6 +216,7 @@ BOOL MxDirect3D::D3DSetMode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009b5a0
|
// FUNCTION: LEGO1 0x1009b5a0
|
||||||
|
// FUNCTION: BETA10 0x1011babb
|
||||||
int MxDirect3D::ZBufferDepth(MxAssignedDevice* p_assignedDevice)
|
int MxDirect3D::ZBufferDepth(MxAssignedDevice* p_assignedDevice)
|
||||||
{
|
{
|
||||||
int depth;
|
int depth;
|
||||||
@@ -230,10 +252,10 @@ int MxDirect3D::ZBufferDepth(MxAssignedDevice* p_assignedDevice)
|
|||||||
// FUNCTION: BETA10 0x1011bbca
|
// FUNCTION: BETA10 0x1011bbca
|
||||||
BOOL MxDirect3D::SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, Direct3DDeviceInfo* p_device)
|
BOOL MxDirect3D::SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, Direct3DDeviceInfo* p_device)
|
||||||
{
|
{
|
||||||
if (m_assignedDevice) {
|
if (m_currentDeviceInfo) {
|
||||||
delete m_assignedDevice;
|
delete m_currentDeviceInfo;
|
||||||
m_assignedDevice = NULL;
|
m_currentDeviceInfo = NULL;
|
||||||
m_pCurrentDeviceModesList = NULL;
|
m_currentDevInfo = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MxAssignedDevice* d = new MxAssignedDevice;
|
MxAssignedDevice* d = new MxAssignedDevice;
|
||||||
@@ -287,15 +309,15 @@ BOOL MxDirect3D::SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_dri
|
|||||||
d->m_desc = device.m_HELDesc;
|
d->m_desc = device.m_HELDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_assignedDevice = d;
|
m_currentDeviceInfo = d;
|
||||||
m_pCurrentDeviceModesList = d->m_deviceInfo;
|
m_currentDevInfo = d->m_deviceInfo;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_assignedDevice) {
|
if (!m_currentDeviceInfo) {
|
||||||
delete d;
|
delete d;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <d3d.h>
|
#include <d3d.h>
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100db800
|
// VTABLE: LEGO1 0x100db800
|
||||||
|
// VTABLE: BETA10 0x101c1af8
|
||||||
// SIZE 0x894
|
// SIZE 0x894
|
||||||
class MxDirect3D : public MxDirectDraw {
|
class MxDirect3D : public MxDirectDraw {
|
||||||
public:
|
public:
|
||||||
@@ -29,9 +30,13 @@ public:
|
|||||||
void Destroy() override; // vtable+0x08
|
void Destroy() override; // vtable+0x08
|
||||||
void DestroyButNotDirectDraw() override; // vtable+0x0c
|
void DestroyButNotDirectDraw() override; // vtable+0x0c
|
||||||
|
|
||||||
MxAssignedDevice* AssignedDevice() { return this->m_assignedDevice; }
|
MxAssignedDevice* AssignedDevice() { return m_currentDeviceInfo; }
|
||||||
IDirect3D2* Direct3D() { return this->m_pDirect3d; }
|
|
||||||
IDirect3DDevice2* Direct3DDevice() { return this->m_pDirect3dDevice; }
|
// FUNCTION: BETA10 0x100d8b40
|
||||||
|
IDirect3D2* Direct3D() { return m_pDirect3d; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100d8b70
|
||||||
|
IDirect3DDevice2* Direct3DDevice() { return m_pDirect3dDevice; }
|
||||||
|
|
||||||
BOOL SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, Direct3DDeviceInfo* p_device);
|
BOOL SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, Direct3DDeviceInfo* p_device);
|
||||||
|
|
||||||
@@ -42,14 +47,19 @@ protected:
|
|||||||
int ZBufferDepth(MxAssignedDevice* p_assignedDevice);
|
int ZBufferDepth(MxAssignedDevice* p_assignedDevice);
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1009b120
|
// SYNTHETIC: LEGO1 0x1009b120
|
||||||
|
// SYNTHETIC: BETA10 0x1011c0f0
|
||||||
// MxDirect3D::`scalar deleting destructor'
|
// MxDirect3D::`scalar deleting destructor'
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxAssignedDevice* m_assignedDevice; // 0x880
|
MxAssignedDevice* m_currentDeviceInfo; // 0x880
|
||||||
IDirect3D2* m_pDirect3d; // 0x884
|
IDirect3D2* m_pDirect3d; // 0x884
|
||||||
IDirect3DDevice2* m_pDirect3dDevice; // 0x888
|
IDirect3DDevice2* m_pDirect3dDevice; // 0x888
|
||||||
BOOL m_bTexturesDisabled; // 0x88c
|
BOOL m_bTexturesDisabled; // 0x88c
|
||||||
undefined4 m_unk0x890; // 0x890
|
undefined4 m_unk0x890; // 0x890
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// GLOBAL: LEGO1 0x100dd1b0
|
||||||
|
// GLOBAL: BETA10 0x101c2de8
|
||||||
|
// IID_IDirect3D2
|
||||||
|
|
||||||
#endif // MXDIRECT3D_H
|
#endif // MXDIRECT3D_H
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDirectDraw, 0x880)
|
DECOMP_SIZE_ASSERT(MxDirectDraw, 0x880)
|
||||||
|
|
||||||
#define RELEASE(x) \
|
#define RELEASE(x) \
|
||||||
@@ -15,9 +17,11 @@ DECOMP_SIZE_ASSERT(MxDirectDraw, 0x880)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x10100c68
|
// GLOBAL: LEGO1 0x10100c68
|
||||||
|
// GLOBAL: BETA10 0x101ff1c4
|
||||||
BOOL g_isPaletteIndexed8 = 0;
|
BOOL g_isPaletteIndexed8 = 0;
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d490
|
// FUNCTION: LEGO1 0x1009d490
|
||||||
|
// FUNCTION: BETA10 0x1012036a
|
||||||
MxDirectDraw::MxDirectDraw()
|
MxDirectDraw::MxDirectDraw()
|
||||||
{
|
{
|
||||||
m_pFrontBuffer = NULL;
|
m_pFrontBuffer = NULL;
|
||||||
@@ -26,6 +30,7 @@ MxDirectDraw::MxDirectDraw()
|
|||||||
m_pClipper = NULL;
|
m_pClipper = NULL;
|
||||||
m_pPalette = NULL;
|
m_pPalette = NULL;
|
||||||
m_pDirectDraw = NULL;
|
m_pDirectDraw = NULL;
|
||||||
|
m_bIsOnPrimaryDevice = TRUE;
|
||||||
m_pText1Surface = NULL;
|
m_pText1Surface = NULL;
|
||||||
m_pText2Surface = NULL;
|
m_pText2Surface = NULL;
|
||||||
m_hWndMain = NULL;
|
m_hWndMain = NULL;
|
||||||
@@ -39,32 +44,31 @@ MxDirectDraw::MxDirectDraw()
|
|||||||
m_pFatalErrorHandler = NULL;
|
m_pFatalErrorHandler = NULL;
|
||||||
m_pErrorHandlerArg = NULL;
|
m_pErrorHandlerArg = NULL;
|
||||||
m_pFatalErrorHandlerArg = NULL;
|
m_pFatalErrorHandlerArg = NULL;
|
||||||
m_pCurrentDeviceModesList = NULL;
|
m_currentDevInfo = NULL;
|
||||||
m_bIsOnPrimaryDevice = TRUE;
|
|
||||||
m_hFont = NULL;
|
m_hFont = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d530
|
// FUNCTION: LEGO1 0x1009d530
|
||||||
|
// FUNCTION: BETA10 0x1012048f
|
||||||
MxDirectDraw::~MxDirectDraw()
|
MxDirectDraw::~MxDirectDraw()
|
||||||
{
|
{
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
||||||
if (m_pCurrentDeviceModesList != NULL) {
|
if (m_currentDevInfo != NULL) {
|
||||||
delete m_pCurrentDeviceModesList;
|
delete m_currentDevInfo;
|
||||||
m_pCurrentDeviceModesList = NULL;
|
m_currentDevInfo = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d570
|
// FUNCTION: LEGO1 0x1009d570
|
||||||
|
// FUNCTION: BETA10 0x101204fe
|
||||||
int MxDirectDraw::GetPrimaryBitDepth()
|
int MxDirectDraw::GetPrimaryBitDepth()
|
||||||
{
|
{
|
||||||
DWORD dwRGBBitCount;
|
DWORD dwRGBBitCount = 8;
|
||||||
LPDIRECTDRAW pDDraw;
|
LPDIRECTDRAW pDDraw;
|
||||||
DDSURFACEDESC ddsd;
|
DDSURFACEDESC ddsd;
|
||||||
|
|
||||||
HRESULT result = DirectDrawCreate(NULL, &pDDraw, NULL);
|
if (!DirectDrawCreate(NULL, &pDDraw, NULL)) {
|
||||||
dwRGBBitCount = 8;
|
|
||||||
if (!result) {
|
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
|
||||||
@@ -78,6 +82,7 @@ int MxDirectDraw::GetPrimaryBitDepth()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d5e0
|
// FUNCTION: LEGO1 0x1009d5e0
|
||||||
|
// FUNCTION: BETA10 0x1012058c
|
||||||
BOOL MxDirectDraw::Create(
|
BOOL MxDirectDraw::Create(
|
||||||
HWND hWnd,
|
HWND hWnd,
|
||||||
BOOL fullscreen,
|
BOOL fullscreen,
|
||||||
@@ -90,17 +95,19 @@ BOOL MxDirectDraw::Create(
|
|||||||
int paletteEntryCount
|
int paletteEntryCount
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
assert(m_currentDevInfo);
|
||||||
|
|
||||||
m_hWndMain = hWnd;
|
m_hWndMain = hWnd;
|
||||||
|
|
||||||
CacheOriginalPaletteEntries();
|
CacheOriginalPaletteEntries();
|
||||||
|
|
||||||
if (!RecreateDirectDraw(&m_pCurrentDeviceModesList->m_guid)) {
|
if (!RecreateDirectDraw(&m_currentDevInfo->m_guid)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bFlipSurfaces = surface_fullscreen;
|
m_bFlipSurfaces = surface_fullscreen;
|
||||||
m_bOnlySystemMemory = onlySystemMemory;
|
m_bOnlySystemMemory = onlySystemMemory;
|
||||||
m_bIsOnPrimaryDevice = !m_pCurrentDeviceModesList->m_guid;
|
m_bIsOnPrimaryDevice = m_currentDevInfo->m_guid ? FALSE : TRUE;
|
||||||
|
|
||||||
if (!m_bIsOnPrimaryDevice) {
|
if (!m_bIsOnPrimaryDevice) {
|
||||||
fullscreen = TRUE;
|
fullscreen = TRUE;
|
||||||
@@ -122,6 +129,7 @@ BOOL MxDirectDraw::Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d690
|
// FUNCTION: LEGO1 0x1009d690
|
||||||
|
// FUNCTION: BETA10 0x101206ca
|
||||||
BOOL MxDirectDraw::RecreateDirectDraw(GUID** ppGUID)
|
BOOL MxDirectDraw::RecreateDirectDraw(GUID** ppGUID)
|
||||||
{
|
{
|
||||||
RELEASE(m_pDirectDraw);
|
RELEASE(m_pDirectDraw);
|
||||||
@@ -129,6 +137,7 @@ BOOL MxDirectDraw::RecreateDirectDraw(GUID** ppGUID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d6c0
|
// FUNCTION: LEGO1 0x1009d6c0
|
||||||
|
// FUNCTION: BETA10 0x10120733
|
||||||
BOOL MxDirectDraw::CacheOriginalPaletteEntries()
|
BOOL MxDirectDraw::CacheOriginalPaletteEntries()
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
@@ -142,11 +151,9 @@ BOOL MxDirectDraw::CacheOriginalPaletteEntries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d700
|
// FUNCTION: LEGO1 0x1009d700
|
||||||
|
// FUNCTION: BETA10 0x1012078c
|
||||||
BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int paletteEntryCount, BOOL fullscreen)
|
BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int paletteEntryCount, BOOL fullscreen)
|
||||||
{
|
{
|
||||||
int reservedLowEntryCount = 10;
|
|
||||||
int reservedHighEntryCount = 10;
|
|
||||||
int arraySize = sizeOfArray(m_paletteEntries);
|
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -156,24 +163,26 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa
|
|||||||
ReleaseDC(NULL, hdc);
|
ReleaseDC(NULL, hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < reservedLowEntryCount; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x80;
|
m_paletteEntries[i].peFlags = 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = reservedLowEntryCount; i < 142; i++) {
|
for (; i < 142; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x44;
|
m_paletteEntries[i].peFlags = 0x44;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 142; i < arraySize - reservedHighEntryCount; i++) {
|
for (; i < 246; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x84;
|
m_paletteEntries[i].peFlags = 0x84;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 256 - reservedHighEntryCount; i < 256; i++) {
|
for (; i < 256; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x80;
|
m_paletteEntries[i].peFlags = 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paletteEntryCount != 0) {
|
if (paletteEntryCount != 0) {
|
||||||
for (i = reservedLowEntryCount; (i < paletteEntryCount) && (i < 256 - reservedHighEntryCount); i++) {
|
assert(paletteEntryCount <= (sizeof(m_paletteEntries) / sizeof(m_paletteEntries[0])));
|
||||||
|
|
||||||
|
for (i = 10; (i < paletteEntryCount) && (i < 246); i++) {
|
||||||
m_paletteEntries[i].peRed = pPaletteEntries[i].peRed;
|
m_paletteEntries[i].peRed = pPaletteEntries[i].peRed;
|
||||||
m_paletteEntries[i].peGreen = pPaletteEntries[i].peGreen;
|
m_paletteEntries[i].peGreen = pPaletteEntries[i].peGreen;
|
||||||
m_paletteEntries[i].peBlue = pPaletteEntries[i].peBlue;
|
m_paletteEntries[i].peBlue = pPaletteEntries[i].peBlue;
|
||||||
@@ -194,6 +203,7 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d800
|
// FUNCTION: LEGO1 0x1009d800
|
||||||
|
// FUNCTION: BETA10 0x10120971
|
||||||
void MxDirectDraw::Destroy()
|
void MxDirectDraw::Destroy()
|
||||||
{
|
{
|
||||||
DestroyButNotDirectDraw();
|
DestroyButNotDirectDraw();
|
||||||
@@ -204,13 +214,14 @@ void MxDirectDraw::Destroy()
|
|||||||
|
|
||||||
m_bIsOnPrimaryDevice = TRUE;
|
m_bIsOnPrimaryDevice = TRUE;
|
||||||
|
|
||||||
if (m_pCurrentDeviceModesList != NULL) {
|
if (m_currentDevInfo != NULL) {
|
||||||
delete m_pCurrentDeviceModesList;
|
delete m_currentDevInfo;
|
||||||
m_pCurrentDeviceModesList = NULL;
|
m_currentDevInfo = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d860
|
// FUNCTION: LEGO1 0x1009d860
|
||||||
|
// FUNCTION: BETA10 0x10120a18
|
||||||
void MxDirectDraw::DestroyButNotDirectDraw()
|
void MxDirectDraw::DestroyButNotDirectDraw()
|
||||||
{
|
{
|
||||||
RestoreOriginalPaletteEntries();
|
RestoreOriginalPaletteEntries();
|
||||||
@@ -232,6 +243,7 @@ void MxDirectDraw::DestroyButNotDirectDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d920
|
// FUNCTION: LEGO1 0x1009d920
|
||||||
|
// FUNCTION: BETA10 0x10120b9e
|
||||||
void MxDirectDraw::FUN_1009d920()
|
void MxDirectDraw::FUN_1009d920()
|
||||||
{
|
{
|
||||||
RestoreOriginalPaletteEntries();
|
RestoreOriginalPaletteEntries();
|
||||||
@@ -244,8 +256,11 @@ void MxDirectDraw::FUN_1009d920()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d960
|
// FUNCTION: LEGO1 0x1009d960
|
||||||
|
// FUNCTION: BETA10 0x10120d61
|
||||||
BOOL MxDirectDraw::DDInit(BOOL fullscreen)
|
BOOL MxDirectDraw::DDInit(BOOL fullscreen)
|
||||||
{
|
{
|
||||||
|
assert(m_pDirectDraw);
|
||||||
|
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
@@ -268,12 +283,15 @@ BOOL MxDirectDraw::DDInit(BOOL fullscreen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009d9d0
|
// FUNCTION: LEGO1 0x1009d9d0
|
||||||
|
// FUNCTION: BETA10 0x10120e45
|
||||||
BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp)
|
BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp)
|
||||||
{
|
{
|
||||||
DeviceModesInfo::Mode mode = {width, height, bpp};
|
DeviceModesInfo::Mode mode = {width, height, bpp};
|
||||||
|
|
||||||
for (int i = 0; i < m_pCurrentDeviceModesList->m_count; i++) {
|
assert(m_currentDevInfo);
|
||||||
if (m_pCurrentDeviceModesList->m_modeArray[i] == mode) {
|
|
||||||
|
for (int i = 0; i < m_currentDevInfo->m_count; i++) {
|
||||||
|
if (m_currentDevInfo->m_modeArray[i] == mode) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,6 +300,7 @@ BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009da20
|
// FUNCTION: LEGO1 0x1009da20
|
||||||
|
// FUNCTION: BETA10 0x10120efb
|
||||||
void EnableResizing(HWND p_hwnd, BOOL p_flag)
|
void EnableResizing(HWND p_hwnd, BOOL p_flag)
|
||||||
{
|
{
|
||||||
static DWORD g_dwStyle;
|
static DWORD g_dwStyle;
|
||||||
@@ -298,17 +317,17 @@ void EnableResizing(HWND p_hwnd, BOOL p_flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009da80
|
// FUNCTION: LEGO1 0x1009da80
|
||||||
|
// FUNCTION: BETA10 0x10120f68
|
||||||
BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
|
|
||||||
if (m_bFullScreen) {
|
if (m_bFullScreen) {
|
||||||
LPDIRECTDRAW lpDD;
|
|
||||||
|
|
||||||
EnableResizing(m_hWndMain, FALSE);
|
EnableResizing(m_hWndMain, FALSE);
|
||||||
|
|
||||||
|
#ifndef BETA10
|
||||||
if (!m_bIsOnPrimaryDevice) {
|
if (!m_bIsOnPrimaryDevice) {
|
||||||
lpDD = NULL;
|
LPDIRECTDRAW lpDD = NULL;
|
||||||
result = DirectDrawCreate(0, &lpDD, 0);
|
result = DirectDrawCreate(0, &lpDD, 0);
|
||||||
if (result == DD_OK) {
|
if (result == DD_OK) {
|
||||||
result = lpDD->SetCooperativeLevel(m_hWndMain, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT);
|
result = lpDD->SetCooperativeLevel(m_hWndMain, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT);
|
||||||
@@ -317,11 +336,12 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!IsSupportedMode(width, height, bpp)) {
|
if (!IsSupportedMode(width, height, bpp)) {
|
||||||
width = m_pCurrentDeviceModesList->m_modeArray[0].width;
|
width = m_currentDevInfo->m_modeArray[0].width;
|
||||||
height = m_pCurrentDeviceModesList->m_modeArray[0].height;
|
height = m_currentDevInfo->m_modeArray[0].height;
|
||||||
bpp = m_pCurrentDeviceModesList->m_modeArray[0].bitsPerPixel;
|
bpp = m_currentDevInfo->m_modeArray[0].bitsPerPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bIgnoreWMSIZE = TRUE;
|
m_bIgnoreWMSIZE = TRUE;
|
||||||
@@ -412,20 +432,29 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create debug text only in windowed mode?
|
// create debug text only in windowed mode?
|
||||||
return m_bFullScreen || CreateTextSurfaces();
|
if (!m_bFullScreen) {
|
||||||
|
if (!CreateTextSurfaces()) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009dd80
|
// FUNCTION: LEGO1 0x1009dd80
|
||||||
|
// FUNCTION: BETA10 0x1012137f
|
||||||
HRESULT MxDirectDraw::CreateDDSurface(
|
HRESULT MxDirectDraw::CreateDDSurface(
|
||||||
LPDDSURFACEDESC p_lpDDSurfDesc,
|
LPDDSURFACEDESC p_lpDDSurfDesc,
|
||||||
LPDIRECTDRAWSURFACE FAR* p_lpDDSurface,
|
LPDIRECTDRAWSURFACE FAR* p_lpDDSurface,
|
||||||
IUnknown FAR* p_pUnkOuter
|
IUnknown FAR* p_pUnkOuter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return m_pDirectDraw->CreateSurface(p_lpDDSurfDesc, p_lpDDSurface, p_pUnkOuter);
|
HRESULT res = m_pDirectDraw->CreateSurface(p_lpDDSurfDesc, p_lpDDSurface, p_pUnkOuter);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009dda0
|
// FUNCTION: LEGO1 0x1009dda0
|
||||||
|
// FUNCTION: BETA10 0x101213bb
|
||||||
BOOL MxDirectDraw::GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSURFACE lpDDSurf)
|
BOOL MxDirectDraw::GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSURFACE lpDDSurf)
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -441,6 +470,7 @@ BOOL MxDirectDraw::GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSU
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009ddf0
|
// FUNCTION: LEGO1 0x1009ddf0
|
||||||
|
// FUNCTION: BETA10 0x10121430
|
||||||
BOOL MxDirectDraw::DDCreateSurfaces()
|
BOOL MxDirectDraw::DDCreateSurfaces()
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -518,13 +548,14 @@ BOOL MxDirectDraw::DDCreateSurfaces()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e020
|
// FUNCTION: LEGO1 0x1009e020
|
||||||
|
// FUNCTION: BETA10 0x10121700
|
||||||
void MxDirectDraw::FUN_1009e020()
|
void MxDirectDraw::FUN_1009e020()
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
byte* line;
|
byte* line;
|
||||||
DDSURFACEDESC ddsd;
|
DDSURFACEDESC ddsd;
|
||||||
int j;
|
|
||||||
int count = m_bFlipSurfaces ? 2 : 1;
|
int count = m_bFlipSurfaces ? 2 : 1;
|
||||||
|
int value = 0;
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
@@ -543,8 +574,8 @@ void MxDirectDraw::FUN_1009e020()
|
|||||||
|
|
||||||
// clear backBuffer
|
// clear backBuffer
|
||||||
line = (byte*) ddsd.lpSurface;
|
line = (byte*) ddsd.lpSurface;
|
||||||
for (j = ddsd.dwHeight; j--;) {
|
for (int j = ddsd.dwHeight; j--;) {
|
||||||
memset(line, 0, ddsd.dwWidth);
|
memset(line, value, ddsd.dwWidth);
|
||||||
line += ddsd.lPitch;
|
line += ddsd.lPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,6 +588,7 @@ void MxDirectDraw::FUN_1009e020()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e110
|
// FUNCTION: LEGO1 0x1009e110
|
||||||
|
// FUNCTION: BETA10 0x101219de
|
||||||
BOOL MxDirectDraw::TextToTextSurface(const char* text, IDirectDrawSurface* pSurface, SIZE& textSizeOnSurface)
|
BOOL MxDirectDraw::TextToTextSurface(const char* text, IDirectDrawSurface* pSurface, SIZE& textSizeOnSurface)
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -589,18 +621,21 @@ BOOL MxDirectDraw::TextToTextSurface(const char* text, IDirectDrawSurface* pSurf
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e210
|
// FUNCTION: LEGO1 0x1009e210
|
||||||
|
// FUNCTION: BETA10 0x10121aea
|
||||||
BOOL MxDirectDraw::TextToTextSurface1(const char* text)
|
BOOL MxDirectDraw::TextToTextSurface1(const char* text)
|
||||||
{
|
{
|
||||||
return TextToTextSurface(text, m_pText1Surface, m_text1SizeOnSurface);
|
return TextToTextSurface(text, m_pText1Surface, m_text1SizeOnSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e230
|
// FUNCTION: LEGO1 0x1009e230
|
||||||
|
// FUNCTION: BETA10 0x10121b1e
|
||||||
BOOL MxDirectDraw::TextToTextSurface2(const char* text)
|
BOOL MxDirectDraw::TextToTextSurface2(const char* text)
|
||||||
{
|
{
|
||||||
return TextToTextSurface(text, m_pText2Surface, m_text2SizeOnSurface);
|
return TextToTextSurface(text, m_pText2Surface, m_text2SizeOnSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e250
|
// FUNCTION: LEGO1 0x1009e250
|
||||||
|
// FUNCTION: BETA10 0x10121b52
|
||||||
BOOL MxDirectDraw::CreateTextSurfaces()
|
BOOL MxDirectDraw::CreateTextSurfaces()
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -680,6 +715,7 @@ BOOL MxDirectDraw::CreateTextSurfaces()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e4d0
|
// FUNCTION: LEGO1 0x1009e4d0
|
||||||
|
// FUNCTION: BETA10 0x10121e87
|
||||||
BOOL MxDirectDraw::RestoreSurfaces()
|
BOOL MxDirectDraw::RestoreSurfaces()
|
||||||
{
|
{
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -738,6 +774,7 @@ BOOL MxDirectDraw::RestoreSurfaces()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e5e0
|
// FUNCTION: LEGO1 0x1009e5e0
|
||||||
|
// FUNCTION: BETA10 0x10122087
|
||||||
BOOL MxDirectDraw::CreateZBuffer(DWORD memorytype, DWORD depth)
|
BOOL MxDirectDraw::CreateZBuffer(DWORD memorytype, DWORD depth)
|
||||||
{
|
{
|
||||||
HRESULT result; // eax
|
HRESULT result; // eax
|
||||||
@@ -769,6 +806,7 @@ BOOL MxDirectDraw::CreateZBuffer(DWORD memorytype, DWORD depth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e6a0
|
// FUNCTION: LEGO1 0x1009e6a0
|
||||||
|
// FUNCTION: BETA10 0x10122166
|
||||||
int MxDirectDraw::Pause(BOOL p_pause)
|
int MxDirectDraw::Pause(BOOL p_pause)
|
||||||
{
|
{
|
||||||
if (p_pause) {
|
if (p_pause) {
|
||||||
@@ -811,6 +849,7 @@ int MxDirectDraw::Pause(BOOL p_pause)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e750
|
// FUNCTION: LEGO1 0x1009e750
|
||||||
|
// FUNCTION: BETA10 0x101223c9
|
||||||
BOOL MxDirectDraw::RestorePaletteEntries()
|
BOOL MxDirectDraw::RestorePaletteEntries()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -831,6 +870,7 @@ BOOL MxDirectDraw::RestorePaletteEntries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e7a0
|
// FUNCTION: LEGO1 0x1009e7a0
|
||||||
|
// FUNCTION: BETA10 0x10122458
|
||||||
BOOL MxDirectDraw::RestoreOriginalPaletteEntries()
|
BOOL MxDirectDraw::RestoreOriginalPaletteEntries()
|
||||||
{
|
{
|
||||||
if (m_bPrimaryPalettized) {
|
if (m_bPrimaryPalettized) {
|
||||||
@@ -854,6 +894,7 @@ BOOL MxDirectDraw::RestoreOriginalPaletteEntries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e7f0
|
// FUNCTION: LEGO1 0x1009e7f0
|
||||||
|
// FUNCTION: BETA10 0x101224d9
|
||||||
int MxDirectDraw::FlipToGDISurface()
|
int MxDirectDraw::FlipToGDISurface()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -871,22 +912,27 @@ int MxDirectDraw::FlipToGDISurface()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e830
|
// FUNCTION: LEGO1 0x1009e830
|
||||||
|
// FUNCTION: BETA10 0x101225b9
|
||||||
void MxDirectDraw::Error(const char* p_message, int p_error)
|
void MxDirectDraw::Error(const char* p_message, int p_error)
|
||||||
{
|
{
|
||||||
// at LEGO1 0x10100c70, needs no annotation
|
// ~GLOBAL: LEGO1 0x10100c70
|
||||||
|
// ~GLOBAL: BETA10 0x101ff1cc
|
||||||
static BOOL g_isInsideError = FALSE;
|
static BOOL g_isInsideError = FALSE;
|
||||||
|
|
||||||
if (!g_isInsideError) {
|
if (g_isInsideError) {
|
||||||
g_isInsideError = TRUE;
|
return;
|
||||||
Destroy();
|
|
||||||
if (m_pErrorHandler) {
|
|
||||||
m_pErrorHandler(p_message, p_error, m_pErrorHandlerArg);
|
|
||||||
}
|
|
||||||
g_isInsideError = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_isInsideError = TRUE;
|
||||||
|
Destroy();
|
||||||
|
if (m_pErrorHandler) {
|
||||||
|
m_pErrorHandler(p_message, p_error, m_pErrorHandlerArg);
|
||||||
|
}
|
||||||
|
g_isInsideError = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1009e880
|
// FUNCTION: LEGO1 0x1009e880
|
||||||
|
// FUNCTION: BETA10 0x10122630
|
||||||
const char* MxDirectDraw::ErrorToString(HRESULT p_error)
|
const char* MxDirectDraw::ErrorToString(HRESULT p_error)
|
||||||
{
|
{
|
||||||
switch (p_error) {
|
switch (p_error) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100db818
|
// VTABLE: LEGO1 0x100db818
|
||||||
|
// VTABLE: BETA10 0x101c1b10
|
||||||
// SIZE 0x880
|
// SIZE 0x880
|
||||||
class MxDirectDraw {
|
class MxDirectDraw {
|
||||||
public:
|
public:
|
||||||
@@ -32,10 +33,20 @@ public:
|
|||||||
virtual void DestroyButNotDirectDraw(); // vtable+0x0c
|
virtual void DestroyButNotDirectDraw(); // vtable+0x0c
|
||||||
|
|
||||||
IDirectDraw* DirectDraw() { return m_pDirectDraw; }
|
IDirectDraw* DirectDraw() { return m_pDirectDraw; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100d8ab0
|
||||||
IDirectDrawSurface* FrontBuffer() { return m_pFrontBuffer; }
|
IDirectDrawSurface* FrontBuffer() { return m_pFrontBuffer; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100d8ae0
|
||||||
IDirectDrawSurface* BackBuffer() { return m_pBackBuffer; }
|
IDirectDrawSurface* BackBuffer() { return m_pBackBuffer; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100d8b10
|
||||||
IDirectDrawClipper* Clipper() { return m_pClipper; }
|
IDirectDrawClipper* Clipper() { return m_pClipper; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x1011c190
|
||||||
|
DeviceModesInfo::Mode* CurrentMode() { return &m_currentMode; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x1011c170
|
||||||
BOOL IsFullScreen() { return m_bFullScreen; }
|
BOOL IsFullScreen() { return m_bFullScreen; }
|
||||||
|
|
||||||
BOOL IsSupportedMode(int width, int height, int bpp);
|
BOOL IsSupportedMode(int width, int height, int bpp);
|
||||||
@@ -72,6 +83,7 @@ protected:
|
|||||||
void FUN_1009d920();
|
void FUN_1009d920();
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1009d510
|
// SYNTHETIC: LEGO1 0x1009d510
|
||||||
|
// SYNTHETIC: BETA10 0x10122f80
|
||||||
// MxDirectDraw::`scalar deleting destructor'
|
// MxDirectDraw::`scalar deleting destructor'
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -102,7 +114,7 @@ protected:
|
|||||||
void* m_pErrorHandlerArg; // 0x864
|
void* m_pErrorHandlerArg; // 0x864
|
||||||
void* m_pFatalErrorHandlerArg; // 0x868
|
void* m_pFatalErrorHandlerArg; // 0x868
|
||||||
int m_pauseCount; // 0x86c
|
int m_pauseCount; // 0x86c
|
||||||
DeviceModesInfo* m_pCurrentDeviceModesList; // 0x870
|
DeviceModesInfo* m_currentDevInfo; // 0x870
|
||||||
DeviceModesInfo::Mode m_currentMode; // 0x874
|
DeviceModesInfo::Mode m_currentMode; // 0x874
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
struct DeviceModesInfo {
|
struct DeviceModesInfo {
|
||||||
// SIZE 0x0c
|
// SIZE 0x0c
|
||||||
struct Mode {
|
struct Mode {
|
||||||
|
// FUNCTION: BETA10 0x10122fc0
|
||||||
int operator==(const Mode& p_mode) const
|
int operator==(const Mode& p_mode) const
|
||||||
{
|
{
|
||||||
return ((width == p_mode.width) && (height == p_mode.height) && (bitsPerPixel == p_mode.bitsPerPixel));
|
return ((width == p_mode.width) && (height == p_mode.height) && (bitsPerPixel == p_mode.bitsPerPixel));
|
||||||
|
|||||||
Reference in New Issue
Block a user