diff --git a/LEGO1/mxpresenter.h b/LEGO1/mxpresenter.h index 35ba4b1e..156065f4 100644 --- a/LEGO1/mxpresenter.h +++ b/LEGO1/mxpresenter.h @@ -70,8 +70,8 @@ class MxPresenter : public MxCore inline MxS32 GetCurrentTickleState() const { return this->m_currentTickleState; } inline MxPoint32 GetLocation() const { return this->m_location; } - inline MxS32 GetDisplayX() const { return this->m_location.m_x; } - inline MxS32 GetDisplayY() const { return this->m_location.m_y; } + inline MxS32 GetLocationX() const { return this->m_location.m_x; } + inline MxS32 GetLocationY() const { return this->m_location.m_y; } inline MxS32 GetDisplayZ() const { return this->m_displayZ; } inline MxDSAction *GetAction() const { return this->m_action; } diff --git a/LEGO1/mxtransitionmanager.cpp b/LEGO1/mxtransitionmanager.cpp index fc316277..479dfa41 100644 --- a/LEGO1/mxtransitionmanager.cpp +++ b/LEGO1/mxtransitionmanager.cpp @@ -23,7 +23,7 @@ MxTransitionManager::MxTransitionManager() // OFFSET: LEGO1 0x1004ba00 MxTransitionManager::~MxTransitionManager() { - free(m_copyBuffer); + delete[] m_copyBuffer; if (m_waitIndicator != NULL) { delete m_waitIndicator->GetAction(); @@ -337,7 +337,7 @@ void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc) } // Free the copy buffer - free(m_copyBuffer); + delete[] m_copyBuffer; m_copyBuffer = NULL; } @@ -358,8 +358,8 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) DWORD copyPitch = (ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; - m_copyRect.left = m_waitIndicator->GetDisplayX(); - m_copyRect.top = m_waitIndicator->GetDisplayY(); + m_copyRect.left = m_waitIndicator->GetLocationX(); + m_copyRect.top = m_waitIndicator->GetLocationY(); MxS32 height = m_waitIndicator->GetHeight(); MxS32 width = m_waitIndicator->GetWidth(); @@ -370,7 +370,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) // Allocate the copy buffer const char *src = (const char*)ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left; - m_copyBuffer = malloc(bytesPerPixel * width * height); + m_copyBuffer = new char[bytesPerPixel * width * height]; if (!m_copyBuffer) return; @@ -390,11 +390,11 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) { MxDisplaySurface *displaySurface = VideoManager()->GetDisplaySurface(); MxBool unkbool = FALSE; - displaySurface->vtable2c(ddsc, m_waitIndicator->m_bitmap, 0, 0, m_waitIndicator->GetDisplayX(), m_waitIndicator->GetDisplayY(), m_waitIndicator->GetWidth(), m_waitIndicator->GetHeight(), unkbool); + displaySurface->vtable2c(ddsc, m_waitIndicator->m_bitmap, 0, 0, m_waitIndicator->GetLocationX(), m_waitIndicator->GetLocationY(), m_waitIndicator->GetWidth(), m_waitIndicator->GetHeight(), unkbool); } else { MxDisplaySurface *displaySurface = VideoManager()->GetDisplaySurface(); - displaySurface->vtable24(ddsc, m_waitIndicator->m_bitmap, 0, 0, m_waitIndicator->GetDisplayX(), m_waitIndicator->GetDisplayY(), m_waitIndicator->GetWidth(), m_waitIndicator->GetHeight()); + displaySurface->vtable24(ddsc, m_waitIndicator->m_bitmap, 0, 0, m_waitIndicator->GetLocationX(), m_waitIndicator->GetLocationY(), m_waitIndicator->GetWidth(), m_waitIndicator->GetHeight()); } }