Rename inline getters. malloc/free -> new/delete

This commit is contained in:
disinvite 2023-10-07 10:48:09 -04:00
parent 2c04af3c77
commit 41828183ed
2 changed files with 9 additions and 9 deletions

View File

@ -70,8 +70,8 @@ class MxPresenter : public MxCore
inline MxS32 GetCurrentTickleState() const { return this->m_currentTickleState; } inline MxS32 GetCurrentTickleState() const { return this->m_currentTickleState; }
inline MxPoint32 GetLocation() const { return this->m_location; } inline MxPoint32 GetLocation() const { return this->m_location; }
inline MxS32 GetDisplayX() const { return this->m_location.m_x; } inline MxS32 GetLocationX() const { return this->m_location.m_x; }
inline MxS32 GetDisplayY() const { return this->m_location.m_y; } inline MxS32 GetLocationY() const { return this->m_location.m_y; }
inline MxS32 GetDisplayZ() const { return this->m_displayZ; } inline MxS32 GetDisplayZ() const { return this->m_displayZ; }
inline MxDSAction *GetAction() const { return this->m_action; } inline MxDSAction *GetAction() const { return this->m_action; }

View File

@ -23,7 +23,7 @@ MxTransitionManager::MxTransitionManager()
// OFFSET: LEGO1 0x1004ba00 // OFFSET: LEGO1 0x1004ba00
MxTransitionManager::~MxTransitionManager() MxTransitionManager::~MxTransitionManager()
{ {
free(m_copyBuffer); delete[] m_copyBuffer;
if (m_waitIndicator != NULL) { if (m_waitIndicator != NULL) {
delete m_waitIndicator->GetAction(); delete m_waitIndicator->GetAction();
@ -337,7 +337,7 @@ void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc)
} }
// Free the copy buffer // Free the copy buffer
free(m_copyBuffer); delete[] m_copyBuffer;
m_copyBuffer = NULL; 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 copyPitch = (ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously
DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
m_copyRect.left = m_waitIndicator->GetDisplayX(); m_copyRect.left = m_waitIndicator->GetLocationX();
m_copyRect.top = m_waitIndicator->GetDisplayY(); m_copyRect.top = m_waitIndicator->GetLocationY();
MxS32 height = m_waitIndicator->GetHeight(); MxS32 height = m_waitIndicator->GetHeight();
MxS32 width = m_waitIndicator->GetWidth(); MxS32 width = m_waitIndicator->GetWidth();
@ -370,7 +370,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc)
// Allocate the copy buffer // Allocate the copy buffer
const char *src = (const char*)ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left; 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) if (!m_copyBuffer)
return; return;
@ -390,11 +390,11 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc)
{ {
MxDisplaySurface *displaySurface = VideoManager()->GetDisplaySurface(); MxDisplaySurface *displaySurface = VideoManager()->GetDisplaySurface();
MxBool unkbool = FALSE; 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 else
{ {
MxDisplaySurface *displaySurface = VideoManager()->GetDisplaySurface(); 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());
} }
} }