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

@@ -21,16 +21,16 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa
// Setup all the Iggy references we need for this scene
initialiseMovie();
const Minecraft *pMinecraft = Minecraft::GetInstance();
WCHAR tempString[256];
const int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV);
const int fovDeg = 70 + fovSliderVal * 40 / 100;
swprintf( tempString, 256, L"Set fov (%d)", fovDeg);
m_sliderFov.init(tempString,eControl_FOV,0,100,fovSliderVal);
Minecraft *pMinecraft = Minecraft::GetInstance();
WCHAR TempString[256];
int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV);
int fovDeg = 70 + fovSliderVal * 40 / 100;
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg);
m_sliderFov.init(TempString,eControl_FOV,0,100,fovSliderVal);
const float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000;
swprintf( tempString, 256, L"Set time (unsafe) (%d)", static_cast<int>(currentTime));
m_sliderTime.init(tempString,eControl_Time,0,240,currentTime/100);
float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000;
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime);
m_sliderTime.init(TempString,eControl_Time,0,240,currentTime/100);
m_buttonRain.init(L"Toggle Rain",eControl_Rain);
m_buttonThunder.init(L"Toggle Thunder",eControl_Thunder);
@@ -46,7 +46,7 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa
std::vector<std::pair<std::wstring, unsigned int>> sortedItems;
for (size_t i = 0; i < Item::items.length; ++i)
{
if (Item::items[i] != nullptr)
if (Item::items[i] != NULL)
{
sortedItems.emplace_back(std::wstring(app.GetString(Item::items[i]->getDescriptionId())), i);
}
@@ -138,19 +138,19 @@ wstring UIScene_DebugOverlay::getMoviePath()
void UIScene_DebugOverlay::customDraw(IggyCustomDrawCallbackRegion *region)
{
const Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
int itemId = -1;
swscanf(static_cast<wchar_t *>(region->name),L"item_%d",&itemId);
if (itemId == -1 || itemId > Item::ITEM_NUM_COUNT || Item::items[itemId] == nullptr)
swscanf((wchar_t*)region->name,L"item_%d",&itemId);
if (itemId == -1 || itemId > Item::ITEM_NUM_COUNT || Item::items[itemId] == NULL)
{
app.DebugPrintf("This is not the control we are looking for\n");
}
else
{
const auto item = std::make_shared<ItemInstance>(itemId, 1, 0);
if(item != nullptr) customDrawSlotControl(region,m_iPad,item,1.0f,false,false);
shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>( new ItemInstance(itemId,1,0) );
if(item != NULL) customDrawSlotControl(region,m_iPad,item,1.0f,false,false);
}
}
@@ -183,7 +183,7 @@ void UIScene_DebugOverlay::handleInput(int iPad, int key, bool repeat, bool pres
void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Items:
{
@@ -213,14 +213,14 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
case eControl_Schematic:
{
#ifndef _CONTENT_PACKAGE
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DebugCreateSchematic,nullptr,eUILayer_Debug);
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DebugCreateSchematic,NULL,eUILayer_Debug);
#endif
}
break;
case eControl_SetCamera:
{
#ifndef _CONTENT_PACKAGE
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DebugSetCamera,nullptr,eUILayer_Debug);
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DebugSetCamera,NULL,eUILayer_Debug);
#endif
}
break;
@@ -254,7 +254,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue)
{
switch(static_cast<int>(sliderId))
switch((int)sliderId)
{
case eControl_Time:
{
@@ -266,25 +266,25 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue)
MinecraftServer::SetTime(currentValue * 100);
pMinecraft->level->getLevelData()->setGameTime(currentValue * 100);
WCHAR tempString[256];
WCHAR TempString[256];
float currentTime = currentValue * 100;
swprintf( tempString, 256, L"Set time (unsafe) (%d)", static_cast<int>(currentTime));
m_sliderTime.setLabel(tempString);
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime);
m_sliderTime.setLabel(TempString);
}
break;
case eControl_FOV:
{
Minecraft *pMinecraft = Minecraft::GetInstance();
int v = static_cast<int>(currentValue);
int v = (int)currentValue;
if (v < 0) v = 0;
if (v > 100) v = 100;
int fovDeg = 70 + v * 40 / 100;
pMinecraft->gameRenderer->SetFovVal(static_cast<float>(fovDeg));
pMinecraft->gameRenderer->SetFovVal((float)fovDeg);
app.SetGameSettings(m_iPad, eGameSetting_FOV, v);
WCHAR tempString[256];
swprintf( tempString, 256, L"Set fov (%d)", fovDeg);
m_sliderFov.setLabel(tempString);
WCHAR TempString[256];
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg);
m_sliderFov.setLabel(TempString);
}
break;
};