#pragma comment(lib, "ddraw") #include "mxdirectdraw.h" HRESULT MxDirectDraw::SetEntries() { HRESULT ret; if (m_unk848) { if (m_ddpal) { ret = m_ddpal->SetEntries(0, 0, 256, m_pal1); if (ret != DD_OK) { FUN_1009e830("SetEntries failed", ret); return 0; } } } return 1; } HRESULT MxDirectDraw::FlipToGDISurface() { HRESULT ret; if (m_ddraw) { ret = m_ddraw->FlipToGDISurface(); if (ret != DD_OK) { FUN_1009e830("FlipToGDISurface failed", ret); } return !ret; } return 1; } void MxDirectDraw::FUN_1009e830(char *error_msg, HRESULT ret) { if (!DAT_10100c70) { DAT_10100c70 = 1; vtable08(); if (m_unk85c) { m_unk85c(error_msg, ret, m_unk864); } } DAT_10100c70 = 0; } int MxDirectDraw::GetPrimaryBitDepth() { LPDIRECTDRAW pDDraw; DirectDrawCreate(NULL, &pDDraw, NULL); return 0; } int MxDirectDraw::Pause(int param_1) { if (param_1) { m_unk86c++; if (m_unk86c > 1) { return 1; } if (!SetEntries()) { return 0; } if (m_unk84c) { if (!FlipToGDISurface()) { return 0; } DrawMenuBar(hWindow); RedrawWindow(hWindow, NULL, NULL, RDW_FRAME); } return 1; } else { m_unk86c--; if (m_unk86c > 0) { return 1; } else if (m_unk86c < 0) { m_unk86c = 0; } FUN_1009e750(); } return 0; } HRESULT MxDirectDraw::FUN_1009e750() { HRESULT ret; if (m_unk84c && m_unk848) { if (m_ddpal) { ret = m_ddpal->SetEntries(0, 0, 256, m_pal0); if (ret != DD_OK) { FUN_1009e830("SetEntries failed", ret); return 0; } } } return 1; }