Revert "Project modernization (#630)"

This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.

This reverts commit a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -49,15 +49,15 @@ void UIScene_AbstractContainerMenu::handleDestroy()
#endif
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[m_iPad] != nullptr )
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
if(gameMode != nullptr) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
}
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(pMinecraft->localplayers[m_iPad] != nullptr && pMinecraft->localplayers[m_iPad]->containerMenu->containerId == m_menu->containerId)
if(pMinecraft->localplayers[m_iPad] != NULL && pMinecraft->localplayers[m_iPad]->containerMenu->containerId == m_menu->containerId)
{
pMinecraft->localplayers[m_iPad]->closeContainer();
}
@@ -149,8 +149,8 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
m_fPointerMaxX = m_fPanelMaxX + fPointerWidth;
m_fPointerMaxY = m_fPanelMaxY + (fPointerHeight/2);
// m_hPointerText=nullptr;
// m_hPointerTextBkg=nullptr;
// m_hPointerText=NULL;
// m_hPointerTextBkg=NULL;
// Put the pointer over first item in use row to start with.
UIVec2D itemPos;
@@ -187,8 +187,8 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
IggyEvent mouseEvent;
S32 width, height;
m_parentLayer->getRenderDimensions(width, height);
S32 x = m_pointerPos.x*(static_cast<float>(width)/m_movieWidth);
S32 y = m_pointerPos.y*(static_cast<float>(height)/m_movieHeight);
S32 x = m_pointerPos.x*((float)width/m_movieWidth);
S32 y = m_pointerPos.y*((float)height/m_movieHeight);
IggyMakeEventMouseMove( &mouseEvent, x, y);
IggyEventResult result;
@@ -212,8 +212,8 @@ void UIScene_AbstractContainerMenu::tick()
S32 width, height;
m_parentLayer->getRenderDimensions(width, height);
S32 x = static_cast<S32>(m_pointerPos.x * ((float)width / m_movieWidth));
S32 y = static_cast<S32>(m_pointerPos.y * ((float)height / m_movieHeight));
S32 x = (S32)(m_pointerPos.x * ((float)width / m_movieWidth));
S32 y = (S32)(m_pointerPos.y * ((float)height / m_movieHeight));
IggyMakeEventMouseMove( &mouseEvent, x, y);
@@ -254,7 +254,7 @@ void UIScene_AbstractContainerMenu::render(S32 width, S32 height, C4JRender::eVi
void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
shared_ptr<ItemInstance> item = nullptr;
int slotId = -1;
@@ -265,7 +265,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg
}
else
{
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
if (slotId == -1)
{
app.DebugPrintf("This is not the control we are looking for\n");
@@ -278,7 +278,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg
}
}
if(item != nullptr) customDrawSlotControl(region,m_iPad,item,m_menu->isValidIngredient(item, slotId)?1.0f:0.5f,item->isFoil(),true);
if(item != NULL) customDrawSlotControl(region,m_iPad,item,m_menu->isValidIngredient(item, slotId)?1.0f:0.5f,item->isFoil(),true);
}
void UIScene_AbstractContainerMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
@@ -337,7 +337,7 @@ Slot *UIScene_AbstractContainerMenu::getSlot(ESceneSection eSection, int iSlot)
{
Slot *slot = m_menu->getSlot( getSectionStartOffset(eSection) + iSlot );
if(slot) return slot;
else return nullptr;
else return NULL;
}
bool UIScene_AbstractContainerMenu::isSlotEmpty(ESceneSection eSection, int iSlot)