aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/StatsScreen.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.Client/StatsScreen.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
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 a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.Client/StatsScreen.cpp')
-rw-r--r--Minecraft.Client/StatsScreen.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Minecraft.Client/StatsScreen.cpp b/Minecraft.Client/StatsScreen.cpp
index c618a30f..01d041f0 100644
--- a/Minecraft.Client/StatsScreen.cpp
+++ b/Minecraft.Client/StatsScreen.cpp
@@ -10,15 +10,15 @@
#include "..\Minecraft.World\net.minecraft.world.item.h"
const float StatsScreen::SLOT_TEX_SIZE = 128.0f;
-ItemRenderer *StatsScreen::itemRenderer = nullptr;
+ItemRenderer *StatsScreen::itemRenderer = NULL;
StatsScreen::StatsScreen(Screen *lastScreen, StatsCounter *stats)
{
// 4J - added initialisers
itemRenderer = new ItemRenderer();
- statsList = nullptr;
- itemStatsList = nullptr;
- blockStatsList = nullptr;
+ statsList = NULL;
+ itemStatsList = NULL;
+ blockStatsList = NULL;
this->lastScreen = lastScreen;
this->stats = stats;
}
@@ -107,7 +107,7 @@ StatsScreen::GeneralStatisticsList::GeneralStatisticsList(StatsScreen *ss) : Scr
int StatsScreen::GeneralStatisticsList::getNumberOfItems()
{
- return static_cast<int>(Stats::generalStats->size());
+ return (int)Stats::generalStats->size();
}
void StatsScreen::GeneralStatisticsList::selectItem(int item, bool doubleClick)
@@ -293,7 +293,7 @@ void StatsScreen::StatisticsList::clickedHeader(int headerMouseX, int headerMous
int StatsScreen::StatisticsList::getNumberOfItems()
{
- return static_cast<int>(statItemList.size());
+ return (int)statItemList.size();
}
ItemStat *StatsScreen::StatisticsList::getSlotStat(int slot)
@@ -303,7 +303,7 @@ ItemStat *StatsScreen::StatisticsList::getSlotStat(int slot)
void StatsScreen::StatisticsList::renderStat(ItemStat *stat, int x, int y, bool shaded)
{
- if (stat != nullptr)
+ if (stat != NULL)
{
wstring msg = stat->format(parent->stats->getTotalValue(stat));
parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090);
@@ -373,7 +373,7 @@ void StatsScreen::StatisticsList::renderMousehoverTooltip(ItemStat *stat, int x,
{
// 4J Stu - Unused
#if 0
- if (stat == nullptr)
+ if (stat == NULL)
{
return;
}
@@ -429,11 +429,11 @@ StatsScreen::ItemStatisticsList::ItemStatisticsList(StatsScreen *ss) : StatsScre
{
addToList = true;
}
- else if (Stats::itemBroke[id] != nullptr && parent->stats->getTotalValue(Stats::itemBroke[id]) > 0)
+ else if (Stats::itemBroke[id] != NULL && parent->stats->getTotalValue(Stats::itemBroke[id]) > 0)
{
addToList = true;
}
- else if (Stats::itemCrafted[id] != nullptr && parent->stats->getTotalValue(Stats::itemCrafted[id]) > 0)
+ else if (Stats::itemCrafted[id] != NULL && parent->stats->getTotalValue(Stats::itemCrafted[id]) > 0)
{
addToList = true;
}
@@ -556,11 +556,11 @@ StatsScreen::BlockStatisticsList::BlockStatisticsList(StatsScreen *ss) : Statist
{
addToList = true;
}
- else if (Stats::itemUsed[id] != nullptr && parent->stats->getTotalValue(Stats::itemUsed[id]) > 0)
+ else if (Stats::itemUsed[id] != NULL && parent->stats->getTotalValue(Stats::itemUsed[id]) > 0)
{
addToList = true;
}
- else if (Stats::itemCrafted[id] != nullptr && parent->stats->getTotalValue(Stats::itemCrafted[id]) > 0)
+ else if (Stats::itemCrafted[id] != NULL && parent->stats->getTotalValue(Stats::itemCrafted[id]) > 0)
{
addToList = true;
}