diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index 8d0fbdc4..13a80e7f 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -236,7 +236,7 @@ BOOL CConfigApp::ReadRegisterSettings() if (tmp != 0) { is_modified = TRUE; m_device_enumerator->FUN_1009d210(); - tmp = m_device_enumerator->FUN_1009d0d0(); + tmp = m_device_enumerator->GetBestDevice(); m_device_enumerator->GetDevice(tmp, m_driver, m_device); } if (!ReadRegInt("Display Bit Depth", &m_display_bit_depth)) { @@ -349,17 +349,17 @@ DWORD CConfigApp::GetConditionalDeviceRenderBitDepth() const if (GetHardwareDeviceColorModel()) { return 0; } - return m_device->m_HELDesc.dwDeviceRenderBitDepth & 0x800; + return m_device->m_HELDesc.dwDeviceRenderBitDepth & DDBD_8; } // FUNCTION: CONFIG 0x004037e0 DWORD CConfigApp::GetDeviceRenderBitStatus() const { if (GetHardwareDeviceColorModel()) { - return m_device->m_HWDesc.dwDeviceRenderBitDepth & 0x400; + return m_device->m_HWDesc.dwDeviceRenderBitDepth & DDBD_16; } else { - return m_device->m_HELDesc.dwDeviceRenderBitDepth & 0x400; + return m_device->m_HELDesc.dwDeviceRenderBitDepth & DDBD_16; } } diff --git a/CONFIG/detectdx5.cpp b/CONFIG/detectdx5.cpp index a4284796..8a308a8d 100644 --- a/CONFIG/detectdx5.cpp +++ b/CONFIG/detectdx5.cpp @@ -113,8 +113,8 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS; - surface_desc.ddsCaps.dwCaps = DDCAPS2_NONLOCALVIDMEM; - if (FAILED(ddraw2->SetCooperativeLevel(NULL, DISCL_BACKGROUND))) { + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + if (FAILED(ddraw2->SetCooperativeLevel(NULL, DDSCL_NORMAL))) { ddraw2->Release(); FreeLibrary(ddraw_module); *p_version = 0; diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 62422373..78c3cb12 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -218,7 +218,7 @@ void IsleApp::SetupVideoFlags( m_videoParam.Flags().SetFullScreen(fullScreen); m_videoParam.Flags().SetFlipSurfaces(flipSurfaces); m_videoParam.Flags().SetBackBuffers(!backBuffers); - m_videoParam.Flags().SetF2bit0(!param_6); + m_videoParam.Flags().SetLacksLightSupport(!param_6); m_videoParam.Flags().SetF1bit7(param_7); m_videoParam.Flags().SetWideViewAngle(wideViewAngle); m_videoParam.Flags().SetF2bit1(1); diff --git a/LEGO1/lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp b/LEGO1/lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp index d89f5cd4..e79f2a1b 100644 --- a/LEGO1/lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp +++ b/LEGO1/lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp @@ -261,7 +261,7 @@ MxResult MxBackgroundAudioManager::PlayMusic( m_action2.SetAtomId(p_action.GetAtomId()); m_action2.SetObjectId(p_action.GetObjectId()); - m_action2.SetUnknown84(this); + m_action2.SetNotificationObject(this); m_action2.SetOrigin(this); MxResult result = Start(&m_action2); diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index d579beb1..59c361df 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -44,7 +44,7 @@ LegoAnimMMPresenter::~LegoAnimMMPresenter() VideoManager()->UnregisterPresenter(*this); } - delete m_unk0x68; + delete[] m_unk0x68; NotificationManager()->Unregister(this); } diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 047f673a..de6726d3 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -1303,7 +1303,7 @@ void LegoBackgroundColor::ToggleSkyColor() // FUNCTION: BETA10 0x10086984 void LegoBackgroundColor::SetLightColor(float p_r, float p_g, float p_b) { - if (!VideoManager()->GetVideoParam().Flags().GetF2bit0()) { + if (!VideoManager()->GetVideoParam().Flags().GetLacksLightSupport()) { // TODO: Computed constants based on what? p_r *= 1. / 0.23; p_g *= 1. / 0.63; diff --git a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp index 51678ed8..69970b42 100644 --- a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp +++ b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp @@ -65,7 +65,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text desc.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; desc.dwWidth = image->GetWidth(); desc.dwHeight = image->GetHeight(); - desc.ddsCaps.dwCaps = DDCAPS_OVERLAYCANTCLIP | DDCAPS_OVERLAY; + desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; desc.ddpfPixelFormat.dwSize = sizeof(desc.ddpfPixelFormat); desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8; desc.ddpfPixelFormat.dwRGBBitCount = 8; @@ -112,7 +112,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text entries[i].peBlue = image->GetPaletteEntry(i).GetBlue(); } else { - entries[i].peFlags = 0x80; + entries[i].peFlags = D3DPAL_RESERVED; } } @@ -193,7 +193,7 @@ LegoResult LegoTextureInfo::FUN_10066010(const LegoU8* p_bits) memset(&desc, 0, sizeof(desc)); desc.dwSize = sizeof(desc); - if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) { + if (m_surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR, NULL) == DD_OK) { MxU8* surface = (MxU8*) desc.lpSurface; const LegoU8* bits = p_bits; diff --git a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp index 17beb3c1..4b412940 100644 --- a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp @@ -28,7 +28,7 @@ MxControlPresenter::MxControlPresenter() MxControlPresenter::~MxControlPresenter() { if (m_states) { - delete m_states; + delete[] m_states; } } diff --git a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp index aa091160..7a8b4a45 100644 --- a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp @@ -291,10 +291,10 @@ void MxTransitionManager::MosaicTransition() memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - HRESULT res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL); + HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); if (res == DDERR_SURFACELOST) { m_ddSurface->Restore(); - res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL); + res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); } if (res == DD_OK) { diff --git a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp index 8ad448a7..bc8fa1cb 100644 --- a/LEGO1/lego/legoomni/src/video/legovideomanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legovideomanager.cpp @@ -119,20 +119,20 @@ MxResult LegoVideoManager::Create(MxVideoParam& p_videoParam, MxU32 p_frequencyM if (deviceNum < 0) { deviceEnumerate.FUN_1009d210(); - deviceNum = deviceEnumerate.FUN_1009d0d0(); + deviceNum = deviceEnumerate.GetBestDevice(); deviceNum = deviceEnumerate.GetDevice(deviceNum, driver, device); } m_direct3d->SetDevice(deviceEnumerate, driver, device); if (!driver->m_ddCaps.dwCaps2 && driver->m_ddCaps.dwSVBRops[7] != 2) { - p_videoParam.Flags().SetF2bit0(TRUE); + p_videoParam.Flags().SetLacksLightSupport(TRUE); } else { - p_videoParam.Flags().SetF2bit0(FALSE); + p_videoParam.Flags().SetLacksLightSupport(FALSE); } - ViewROI::SetUnk101013d8(p_videoParam.Flags().GetF2bit0() == FALSE); + ViewROI::SetUnk101013d8(p_videoParam.Flags().GetLacksLightSupport() == FALSE); if (!m_direct3d->Create( hwnd, @@ -639,7 +639,7 @@ void LegoVideoManager::SetSkyColor(float p_red, float p_green, float p_blue) colorStrucure.peRed = (p_red * 255.0f); colorStrucure.peGreen = (p_green * 255.0f); colorStrucure.peBlue = (p_blue * 255.0f); - colorStrucure.peFlags = -124; + colorStrucure.peFlags = D3DPAL_RESERVED | PC_NOCOLLAPSE; m_videoParam.GetPalette()->SetSkyColor(&colorStrucure); m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE); m_3dManager->GetLego3DView()->GetView()->SetBackgroundColor(p_red, p_green, p_blue); diff --git a/LEGO1/lego/legoomni/src/worlds/score.cpp b/LEGO1/lego/legoomni/src/worlds/score.cpp index b5b66d87..76f987e2 100644 --- a/LEGO1/lego/legoomni/src/worlds/score.cpp +++ b/LEGO1/lego/legoomni/src/worlds/score.cpp @@ -146,7 +146,7 @@ void Score::ReadyWorld() MxDSAction action; action.SetObjectId(InfoscorScript::c_nin001pr_RunAnim); action.SetAtomId(m_atomId); - action.SetUnknown84(this); + action.SetNotificationObject(this); Start(&action); if (m_state->GetTutorialFlag()) { diff --git a/LEGO1/lego/sources/geom/legowegedge.cpp b/LEGO1/lego/sources/geom/legowegedge.cpp index 110cd2c6..5c3a68d2 100644 --- a/LEGO1/lego/sources/geom/legowegedge.cpp +++ b/LEGO1/lego/sources/geom/legowegedge.cpp @@ -35,7 +35,7 @@ LegoWEGEdge::~LegoWEGEdge() delete[] m_edgeNormals; } if (m_pathTrigger) { - delete m_pathTrigger; + delete[] m_pathTrigger; } if (m_unk0x50) { delete m_unk0x50; diff --git a/LEGO1/lego/sources/misc/legocontainer.cpp b/LEGO1/lego/sources/misc/legocontainer.cpp index d9bdc0eb..771ce907 100644 --- a/LEGO1/lego/sources/misc/legocontainer.cpp +++ b/LEGO1/lego/sources/misc/legocontainer.cpp @@ -63,7 +63,7 @@ LegoTextureInfo* LegoTextureContainer::GetCached(LegoTextureInfo* p_textureInfo) newDesc.dwHeight = desc.dwHeight; newDesc.dwSize = sizeof(newDesc); newDesc.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; - newDesc.ddsCaps.dwCaps = DDCAPS_OVERLAYCANTCLIP | DDCAPS_OVERLAY; + newDesc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; newDesc.ddpfPixelFormat.dwSize = sizeof(desc.ddpfPixelFormat); newDesc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8; newDesc.ddpfPixelFormat.dwRGBBitCount = 8; diff --git a/LEGO1/library_msvc.h b/LEGO1/library_msvc.h index 7622ae1a..60f5988c 100644 --- a/LEGO1/library_msvc.h +++ b/LEGO1/library_msvc.h @@ -35,7 +35,10 @@ // __NLG_Notify // LIBRARY: LEGO1 0x1008b340 -// __FPinit +// __fpmath + +// LIBRARY: LEGO1 0x1008b370 +// __cfltcvt_init // LIBRARY: LEGO1 0x1008b3dc // __CIacos @@ -188,6 +191,39 @@ // LIBRARY: LEGO1 0x1008d660 // __freeptd +// LIBRARY: LEGO1 0x1008d710 +// __setdefaultprecision + +// LIBRARY: LEGO1 0x1008d730 +// __ms_p5_test_fdiv + +// LIBRARY: LEGO1 0x1008d780 +// __ms_p5_mp_test_fdiv + +// LIBRARY: LEGO1 0x1008d7b0 +// __forcdecpt + +// LIBRARY: LEGO1 0x1008d820 +// __cropzeros + +// LIBRARY: LEGO1 0x1008d880 +// __positive + +// LIBRARY: LEGO1 0x1008d8a0 +// __fassign + +// LIBRARY: LEGO1 0x1008d8f0 +// __cftoe + +// LIBRARY: LEGO1 0x1008da60 +// __cftof + +// LIBRARY: LEGO1 0x1008db90 +// __cftog + +// LIBRARY: LEGO1 0x1008dc40 +// __cfltcvt + // LIBRARY: LEGO1 0x1008dd90 // __cintrindisp2 @@ -293,6 +329,9 @@ // LIBRARY: LEGO1 0x10090080 // __getstream +// LIBRARY: LEGO1 0x10090180 +// _tolower + // LIBRARY: LEGO1 0x100901f0 // __tolower_lk @@ -344,8 +383,23 @@ // LIBRARY: LEGO1 0x10092130 // _raise -// LIBRARY: LEGO1 0x10092310 +// ~LIBRARY: LEGO1 0x10092310 // _siglookup +// Not public + +// LIBRARY: LEGO1 0x10092720 +// __control87 + +// LIBRARY: LEGO1 0x10092760 +// __controlfp + +// ~LIBRARY: LEGO1 0x10092780 +// __abstract_cw +// Not public + +// ~LIBRARY: LEGO1 0x10092830 +// __hw_cw +// Not public // LIBRARY: LEGO1 0x100928c0 // __fptrap @@ -377,6 +431,24 @@ // LIBRARY: LEGO1 0x10092d30 // __ld12tod +// LIBRARY: LEGO1 0x10092d50 +// __ld12tof + +// LIBRARY: LEGO1 0x10092d70 +// __atodbl + +// LIBRARY: LEGO1 0x10092db0 +// __atoflt + +// LIBRARY: LEGO1 0x10092df0 +// __fptostr + +// LIBRARY: LEGO1 0x10092e80 +// __fltout2 + +// LIBRARY: LEGO1 0x10092f10 +// ___dtold + // LIBRARY: LEGO1 0x10093037 // __trandisp2 @@ -458,6 +530,9 @@ // LIBRARY: LEGO1 0x100965b0 // ___mtold12 +// LIBRARY: LEGO1 0x100966a0 +// _$I10_OUTPUT + // LIBRARY: LEGO1 0x10097190 // ___ld12mul @@ -516,6 +591,12 @@ // GLOBAL: LEGO1 0x100fc8bc // __NLG_Destination +// GLOBAL: LEGO1 0x100fc8d8 +// __adjust_fdiv + +// GLOBAL: LEGO1 0x100fc8dc +// __FPinit + // GLOBAL: LEGO1 0x100fc8f0 // __iob @@ -564,6 +645,9 @@ // GLOBAL: LEGO1 0x100fcf20 // ___tlsindex +// GLOBAL: LEGO1 0x100fcf28 +// __cfltcvt_tab + // GLOBAL: LEGO1 0x100fcf60 // __OP_ACOSjmptab diff --git a/LEGO1/mxdirectx/legodxinfo.cpp b/LEGO1/mxdirectx/legodxinfo.cpp index 6241b76a..35db14b7 100644 --- a/LEGO1/mxdirectx/legodxinfo.cpp +++ b/LEGO1/mxdirectx/legodxinfo.cpp @@ -158,7 +158,7 @@ int LegoDeviceEnumerate::BETA_1011cc65(int p_idx, char* p_buffer) // FUNCTION: CONFIG 0x00402860 // FUNCTION: LEGO1 0x1009d0d0 // FUNCTION: BETA10 0x1011cdb4 -int LegoDeviceEnumerate::FUN_1009d0d0() +int LegoDeviceEnumerate::GetBestDevice() { if (!IsInitialized()) { return -1; diff --git a/LEGO1/mxdirectx/legodxinfo.h b/LEGO1/mxdirectx/legodxinfo.h index 2888c02c..dcd204cd 100644 --- a/LEGO1/mxdirectx/legodxinfo.h +++ b/LEGO1/mxdirectx/legodxinfo.h @@ -14,7 +14,7 @@ class LegoDeviceEnumerate : public MxDeviceEnumerate { int GetDevice(int p_deviceNum, MxDriver*& p_driver, Direct3DDeviceInfo*& p_device); int FormatDeviceName(char* p_buffer, const MxDriver* p_ddInfo, const Direct3DDeviceInfo* p_d3dInfo) const; int BETA_1011cc65(int p_idx, char* p_buffer); - int FUN_1009d0d0(); + int GetBestDevice(); static int SupportsMMX(); static int SupportsCPUID(); int FUN_1009d210(); diff --git a/LEGO1/mxdirectx/mxdirectdraw.cpp b/LEGO1/mxdirectx/mxdirectdraw.cpp index 50628293..86910dde 100644 --- a/LEGO1/mxdirectx/mxdirectdraw.cpp +++ b/LEGO1/mxdirectx/mxdirectdraw.cpp @@ -164,19 +164,19 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa } for (i = 0; i < 10; i++) { - m_paletteEntries[i].peFlags = 0x80; + m_paletteEntries[i].peFlags = D3DPAL_RESERVED; } for (; i < 142; i++) { - m_paletteEntries[i].peFlags = 0x44; + m_paletteEntries[i].peFlags = D3DPAL_READONLY | PC_NOCOLLAPSE; } for (; i < 246; i++) { - m_paletteEntries[i].peFlags = 0x84; + m_paletteEntries[i].peFlags = D3DPAL_RESERVED | PC_NOCOLLAPSE; } for (; i < 256; i++) { - m_paletteEntries[i].peFlags = 0x80; + m_paletteEntries[i].peFlags = D3DPAL_RESERVED; } if (paletteEntryCount != 0) { @@ -399,7 +399,7 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp) DDSURFACEDESC ddsd; - FUN_1009e020(); + ClearBackBuffers(); if (!GetDDSurfaceDesc(&ddsd, m_pBackBuffer)) { return FALSE; @@ -549,7 +549,7 @@ BOOL MxDirectDraw::DDCreateSurfaces() // FUNCTION: LEGO1 0x1009e020 // FUNCTION: BETA10 0x10121700 -void MxDirectDraw::FUN_1009e020() +void MxDirectDraw::ClearBackBuffers() { HRESULT result; byte* line; @@ -561,10 +561,10 @@ void MxDirectDraw::FUN_1009e020() memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - result = m_pBackBuffer->Lock(NULL, &ddsd, 1, NULL); + result = m_pBackBuffer->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); if (result == DDERR_SURFACELOST) { m_pBackBuffer->Restore(); - result = m_pBackBuffer->Lock(NULL, &ddsd, 1, NULL); + result = m_pBackBuffer->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); } if (result != DD_OK) { diff --git a/LEGO1/mxdirectx/mxdirectdraw.h b/LEGO1/mxdirectx/mxdirectdraw.h index 75b0f965..dd16f2e8 100644 --- a/LEGO1/mxdirectx/mxdirectdraw.h +++ b/LEGO1/mxdirectx/mxdirectdraw.h @@ -79,7 +79,7 @@ class MxDirectDraw { void Error(const char* p_message, int p_error); BOOL RecreateDirectDraw(GUID** a2); - void FUN_1009e020(); + void ClearBackBuffers(); void FUN_1009d920(); // SYNTHETIC: LEGO1 0x1009d510 diff --git a/LEGO1/mxdirectx/mxdirectxinfo.cpp b/LEGO1/mxdirectx/mxdirectxinfo.cpp index 4d2950e3..11ca9da2 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.cpp +++ b/LEGO1/mxdirectx/mxdirectxinfo.cpp @@ -41,7 +41,7 @@ MxDriver::MxDriver(LPGUID p_guid) // FUNCTION: CONFIG 0x00401180 // FUNCTION: LEGO1 0x1009ba80 // FUNCTION: BETA10 0x1011d8b6 -MxDriver::MxDriver(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName) +MxDriver::MxDriver(LPGUID p_guid, LPCSTR p_driverDesc, LPCSTR p_driverName) { m_guid = NULL; m_driverDesc = NULL; @@ -70,7 +70,7 @@ MxDriver::~MxDriver() // FUNCTION: CONFIG 0x00401330 // FUNCTION: LEGO1 0x1009bc30 // FUNCTION: BETA10 0x1011da89 -void MxDriver::Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName) +void MxDriver::Init(LPGUID p_guid, LPCSTR p_driverDesc, LPCSTR p_driverName) { if (m_driverDesc) { delete[] m_driverDesc; @@ -103,8 +103,8 @@ void MxDriver::Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName) // FUNCTION: BETA10 0x1011dbd0 Direct3DDeviceInfo::Direct3DDeviceInfo( LPGUID p_guid, - LPSTR p_deviceDesc, - LPSTR p_deviceName, + LPCSTR p_deviceDesc, + LPCSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc ) @@ -135,8 +135,8 @@ Direct3DDeviceInfo::~Direct3DDeviceInfo() // FUNCTION: BETA10 0x1011dca6 void Direct3DDeviceInfo::Initialize( LPGUID p_guid, - LPSTR p_deviceDesc, - LPSTR p_deviceName, + LPCSTR p_deviceDesc, + LPCSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc ) @@ -320,8 +320,8 @@ HRESULT MxDeviceEnumerate::EnumDisplayModesCallback(LPDDSURFACEDESC p_ddsd) // FUNCTION: BETA10 0x1011e32f HRESULT MxDeviceEnumerate::EnumDevicesCallback( LPGUID p_guid, - LPSTR p_deviceDesc, - LPSTR p_deviceName, + LPCSTR p_deviceDesc, + LPCSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc ) diff --git a/LEGO1/mxdirectx/mxdirectxinfo.h b/LEGO1/mxdirectx/mxdirectxinfo.h index ac68af79..ba6b1f00 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.h +++ b/LEGO1/mxdirectx/mxdirectxinfo.h @@ -67,16 +67,16 @@ struct Direct3DDeviceInfo { ~Direct3DDeviceInfo(); Direct3DDeviceInfo( LPGUID p_guid, - LPSTR p_deviceDesc, - LPSTR p_deviceName, + LPCSTR p_deviceDesc, + LPCSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc ); void Initialize( LPGUID p_guid, - LPSTR p_deviceDesc, - LPSTR p_deviceName, + LPCSTR p_deviceDesc, + LPCSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc ); @@ -115,9 +115,9 @@ struct MxDriver { MxDriver() {} ~MxDriver(); MxDriver(LPGUID p_guid); - MxDriver(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName); + MxDriver(LPGUID p_guid, LPCSTR p_driverDesc, LPCSTR p_driverName); - void Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName); + void Init(LPGUID p_guid, LPCSTR p_driverDesc, LPCSTR p_driverName); LPGUID m_guid; // 0x00 char* m_driverDesc; // 0x04 @@ -198,8 +198,8 @@ class MxDeviceEnumerate { HRESULT EnumDisplayModesCallback(LPDDSURFACEDESC p_ddsd); HRESULT EnumDevicesCallback( LPGUID p_guid, - LPSTR p_deviceDesc, - LPSTR p_deviceName, + LPCSTR p_deviceDesc, + LPCSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc ); diff --git a/LEGO1/omni/include/mxdsaction.h b/LEGO1/omni/include/mxdsaction.h index 1597038e..7e2c4d89 100644 --- a/LEGO1/omni/include/mxdsaction.h +++ b/LEGO1/omni/include/mxdsaction.h @@ -104,8 +104,8 @@ class MxDSAction : public MxDSObject { // FUNCTION: BETA10 0x10015430 void SetUp(const Vector3& p_up) { m_up = p_up; } - MxCore* GetUnknown84() { return m_unk0x84; } - void SetUnknown84(MxCore* p_unk0x84) { m_unk0x84 = p_unk0x84; } + MxCore* GetNotificationObject() { return m_notificationObject; } + void SetNotificationObject(MxCore* p_notificationObject) { m_notificationObject = p_notificationObject; } MxCore* GetOrigin() { return m_origin; } void SetOrigin(MxCore* p_origin) { m_origin = p_origin; } @@ -117,20 +117,20 @@ class MxDSAction : public MxDSObject { // MxDSAction::`scalar deleting destructor' protected: - MxU32 m_sizeOnDisk; // 0x2c - MxU32 m_flags; // 0x30 - MxLong m_startTime; // 0x34 - MxLong m_duration; // 0x38 - MxS32 m_loopCount; // 0x3c - Mx3DPointFloat m_location; // 0x40 - Mx3DPointFloat m_direction; // 0x54 - Mx3DPointFloat m_up; // 0x68 - char* m_extraData; // 0x7c - MxU16 m_extraLength; // 0x80 - MxCore* m_unk0x84; // 0x84 - undefined4 m_unk0x88; // 0x88 - MxCore* m_origin; // 0x8c - MxLong m_unk0x90; // 0x90 + MxU32 m_sizeOnDisk; // 0x2c + MxU32 m_flags; // 0x30 + MxLong m_startTime; // 0x34 + MxLong m_duration; // 0x38 + MxS32 m_loopCount; // 0x3c + Mx3DPointFloat m_location; // 0x40 + Mx3DPointFloat m_direction; // 0x54 + Mx3DPointFloat m_up; // 0x68 + char* m_extraData; // 0x7c + MxU16 m_extraLength; // 0x80 + MxCore* m_notificationObject; // 0x84 + undefined4 m_unk0x88; // 0x88 + MxCore* m_origin; // 0x8c + MxLong m_unk0x90; // 0x90 }; #endif // MXDSACTION_H diff --git a/LEGO1/omni/include/mxvideoparamflags.h b/LEGO1/omni/include/mxvideoparamflags.h index 4ed414d6..21ed6921 100644 --- a/LEGO1/omni/include/mxvideoparamflags.h +++ b/LEGO1/omni/include/mxvideoparamflags.h @@ -31,7 +31,7 @@ class MxVideoParamFlags { void SetF1bit7(MxBool p_e) { m_flags1.m_bit7 = p_e; } // FUNCTION: BETA10 0x100d81b0 - void SetF2bit0(MxBool p_e) { m_flags2.m_bit0 = p_e; } + void SetLacksLightSupport(MxBool p_e) { m_flags2.m_bit0 = p_e; } // inlined in ISLE void SetF2bit1(MxBool p_e) { m_flags2.m_bit1 = p_e; } @@ -55,7 +55,7 @@ class MxVideoParamFlags { MxBool GetWideViewAngle() { return m_flags1.m_bit6; } // FUNCTION: BETA10 0x100886b0 - MxBool GetF2bit0() { return m_flags2.m_bit0; } + MxBool GetLacksLightSupport() { return m_flags2.m_bit0; } // FUNCTION: BETA10 0x10142050 MxBool GetF2bit1() { return m_flags2.m_bit1; } diff --git a/LEGO1/omni/src/action/mxdsaction.cpp b/LEGO1/omni/src/action/mxdsaction.cpp index eeb3dc68..caab7f99 100644 --- a/LEGO1/omni/src/action/mxdsaction.cpp +++ b/LEGO1/omni/src/action/mxdsaction.cpp @@ -28,7 +28,7 @@ MxDSAction::MxDSAction() m_location.Fill(FLT_MAX); m_direction.Fill(FLT_MAX); m_up.Fill(FLT_MAX); - m_unk0x84 = NULL; + m_notificationObject = NULL; m_unk0x88 = 0; m_origin = NULL; m_unk0x90 = INT_MIN; @@ -89,7 +89,7 @@ void MxDSAction::CopyFrom(MxDSAction& p_dsAction) m_direction = p_dsAction.m_direction; m_up = p_dsAction.m_up; AppendExtra(p_dsAction.m_extraLength, p_dsAction.m_extraData); - m_unk0x84 = p_dsAction.m_unk0x84; + m_notificationObject = p_dsAction.m_notificationObject; m_unk0x88 = p_dsAction.m_unk0x88; m_origin = p_dsAction.m_origin; m_unk0x90 = p_dsAction.m_unk0x90; diff --git a/LEGO1/omni/src/main/mxomni.cpp b/LEGO1/omni/src/main/mxomni.cpp index d7e79bb0..fd36b683 100644 --- a/LEGO1/omni/src/main/mxomni.cpp +++ b/LEGO1/omni/src/main/mxomni.cpp @@ -271,9 +271,9 @@ MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p NotificationManager()->Send(sender, MxType4NotificationParam(this, &p_action, object)); } - if (p_action.GetUnknown84()) { + if (p_action.GetNotificationObject()) { NotificationManager()->Send( - p_action.GetUnknown84(), + p_action.GetNotificationObject(), MxStartActionNotificationParam(c_notificationStartAction, object, &p_action, FALSE) ); } diff --git a/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp b/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp index 40ae8ae9..0e34ed5a 100644 --- a/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp @@ -316,7 +316,7 @@ MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action) if (entry) { MxDSStreamingAction* action = new MxDSStreamingAction(*p_action, 0); action->SetUnknown28(entry->GetUnknown28()); - action->SetUnknown84(entry->GetUnknown84()); + action->SetNotificationObject(entry->GetNotificationObject()); action->SetOrigin(entry->GetOrigin()); action->SetUnknowna0(entry->GetUnknowna4()); diff --git a/LEGO1/omni/src/stream/mxdsbuffer.cpp b/LEGO1/omni/src/stream/mxdsbuffer.cpp index 4b7386b2..d9216b3f 100644 --- a/LEGO1/omni/src/stream/mxdsbuffer.cpp +++ b/LEGO1/omni/src/stream/mxdsbuffer.cpp @@ -207,7 +207,7 @@ MxResult MxDSBuffer::StartPresenterFromAction( if (!m_unk0x30->GetInternalAction()) { p_objectheader->SetAtomId(p_action1->GetAtomId()); p_objectheader->SetUnknown28(p_action1->GetUnknown28()); - p_objectheader->SetUnknown84(p_action1->GetUnknown84()); + p_objectheader->SetNotificationObject(p_action1->GetNotificationObject()); p_objectheader->SetOrigin(p_action1->GetOrigin()); p_objectheader->SetUnknown90(p_action1->GetUnknown90()); p_objectheader->MergeFrom(*p_action1); diff --git a/LEGO1/omni/src/video/mxbitmap.cpp b/LEGO1/omni/src/video/mxbitmap.cpp index 3cf44b33..d74008a0 100644 --- a/LEGO1/omni/src/video/mxbitmap.cpp +++ b/LEGO1/omni/src/video/mxbitmap.cpp @@ -28,10 +28,10 @@ MxBitmap::MxBitmap() MxBitmap::~MxBitmap() { if (m_info) { - delete m_info; + delete[] ((MxU8*) m_info); } if (m_data) { - delete m_data; + delete[] m_data; } if (m_palette) { delete m_palette; @@ -80,7 +80,7 @@ MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, done: if (ret) { if (m_info) { - delete[] m_info; + delete[] ((MxU8*) m_info); m_info = NULL; } @@ -118,7 +118,7 @@ MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info) done: if (result != SUCCESS) { if (m_info) { - delete[] m_info; + delete[] ((MxU8*) m_info); m_info = NULL; } @@ -157,7 +157,7 @@ MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap) done: if (result != SUCCESS) { if (m_info) { - delete[] m_info; + delete[] ((MxU8*) m_info); m_info = NULL; } @@ -249,7 +249,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle) done: if (result != SUCCESS) { if (m_info) { - delete[] m_info; + delete[] ((MxU8*) m_info); m_info = NULL; } diff --git a/LEGO1/omni/src/video/mxdisplaysurface.cpp b/LEGO1/omni/src/video/mxdisplaysurface.cpp index 32245d81..86f1b4dc 100644 --- a/LEGO1/omni/src/video/mxdisplaysurface.cpp +++ b/LEGO1/omni/src/video/mxdisplaysurface.cpp @@ -196,7 +196,7 @@ MxResult MxDisplaySurface::Create(MxVideoParam& p_videoParam) ddsd.dwSize = sizeof(ddsd); ddsd.dwBackBufferCount = m_videoParam.GetBackBuffers(); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; - ddsd.ddsCaps.dwCaps = DDSCAPS_3DDEVICE | DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_3DDEVICE | DDSCAPS_COMPLEX; if (lpDirectDraw->CreateSurface(&ddsd, &m_ddSurface1, NULL)) { goto done; @@ -1050,7 +1050,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CopySurface(LPDIRECTDRAWSURFACE p_src) RECT rect = {0, 0, (LONG) ddsd.dwWidth, (LONG) ddsd.dwHeight}; - if (newSurface->BltFast(0, 0, p_src, &rect, 16) != DD_OK) { + if (newSurface->BltFast(0, 0, p_src, &rect, DDBLTFAST_WAIT) != DD_OK) { newSurface->Release(); return NULL; } diff --git a/LEGO1/omni/src/video/mxflcpresenter.cpp b/LEGO1/omni/src/video/mxflcpresenter.cpp index 57b734c1..eb075357 100644 --- a/LEGO1/omni/src/video/mxflcpresenter.cpp +++ b/LEGO1/omni/src/video/mxflcpresenter.cpp @@ -21,7 +21,7 @@ MxFlcPresenter::MxFlcPresenter() MxFlcPresenter::~MxFlcPresenter() { if (this->m_flcHeader) { - delete this->m_flcHeader; + delete[] ((MxU8*) this->m_flcHeader); } } diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index 03ffcb31..a9731233 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -20,7 +20,7 @@ void MxStillPresenter::Destroy(MxBool p_fromDestructor) m_criticalSection.Enter(); if (m_bitmapInfo) { - delete m_bitmapInfo; + delete[] ((MxU8*) m_bitmapInfo); } m_bitmapInfo = NULL; @@ -35,7 +35,7 @@ void MxStillPresenter::Destroy(MxBool p_fromDestructor) void MxStillPresenter::LoadHeader(MxStreamChunk* p_chunk) { if (m_bitmapInfo) { - delete m_bitmapInfo; + delete[] ((MxU8*) m_bitmapInfo); } MxU8* data = new MxU8[p_chunk->GetLength()]; @@ -53,7 +53,7 @@ void MxStillPresenter::CreateBitmap() m_frameBitmap = new MxBitmap; m_frameBitmap->ImportBitmapInfo(m_bitmapInfo); - delete m_bitmapInfo; + delete[] ((MxU8*) m_bitmapInfo); m_bitmapInfo = NULL; } diff --git a/LEGO1/tgl/d3drm/view.cpp b/LEGO1/tgl/d3drm/view.cpp index aba7df5a..654528fe 100644 --- a/LEGO1/tgl/d3drm/view.cpp +++ b/LEGO1/tgl/d3drm/view.cpp @@ -443,9 +443,9 @@ inline Result ViewRender(IDirect3DRMViewport* pViewport, const IDirect3DRMFrame2 pViewportAppData->m_backgroundColorGreen, pViewportAppData->m_backgroundColorBlue ); - } - assert(Succeeded(result)); + assert(Succeeded(result)); + } result = ResultVal(pViewport->Render(const_cast(pGroup))); assert(Succeeded(result));