refactor: unglob std::shared_ptr

This commit is contained in:
Tropical
2026-03-06 11:20:45 -06:00
parent 0dd1654dec
commit 67ceccf2d4
1065 changed files with 5754 additions and 5749 deletions
@@ -75,7 +75,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
}
}
shared_ptr<Inventory> inventory = minecraft->player->inventory;
std::shared_ptr<Inventory> inventory = minecraft->player->inventory;
if (inventory->getCarried() != NULL)
{
glTranslatef(0, 0, 32);
@@ -128,7 +128,7 @@ void AbstractContainerScreen::renderSlot(Slot *slot)
#if 0
int x = slot->x;
int y = slot->y;
shared_ptr<ItemInstance> item = slot->getItem();
std::shared_ptr<ItemInstance> item = slot->getItem();
if (item == NULL)
{
@@ -218,7 +218,7 @@ void AbstractContainerScreen::removed()
if (minecraft->player == NULL) return;
}
void AbstractContainerScreen::slotsChanged(shared_ptr<Container> container)
void AbstractContainerScreen::slotsChanged(std::shared_ptr<Container> container)
{
}
@@ -32,7 +32,7 @@ protected:
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
public:
virtual void removed();
virtual void slotsChanged(shared_ptr<Container> container);
virtual void slotsChanged(std::shared_ptr<Container> container);
virtual bool isPauseScreen();
virtual void tick();
};
@@ -17,7 +17,7 @@ ConnectScreen::ConnectScreen(Minecraft *minecraft, const wstring& ip, int port)
// 4J - removed from separate thread, but need to investigate what we actually need here
connection = new ClientConnection(minecraft, ip, port);
if (aborted) return;
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
#else
new Thread() {
@@ -3,7 +3,7 @@
#include "../../Textures/Textures.h"
#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h"
ContainerScreen::ContainerScreen(shared_ptr<Container> inventory, shared_ptr<Container> container) : AbstractContainerScreen(new ContainerMenu(inventory, container))
ContainerScreen::ContainerScreen(std::shared_ptr<Container> inventory, std::shared_ptr<Container> container) : AbstractContainerScreen(new ContainerMenu(inventory, container))
{
this->inventory = inventory;
this->container = container;
@@ -5,13 +5,13 @@ class Container;
class ContainerScreen : public AbstractContainerScreen
{
private:
shared_ptr<Container> inventory;
shared_ptr<Container> container;
std::shared_ptr<Container> inventory;
std::shared_ptr<Container> container;
int containerRows;
public:
ContainerScreen(shared_ptr<Container>inventory, shared_ptr<Container>container);
ContainerScreen(std::shared_ptr<Container>inventory, std::shared_ptr<Container>container);
protected:
virtual void renderLabels();
@@ -4,7 +4,7 @@
#include "../../Player/MultiPlayerLocalPlayer.h"
#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h"
CraftingScreen::CraftingScreen(shared_ptr<Inventory> inventory, Level *level, int x, int y, int z) : AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z))
CraftingScreen::CraftingScreen(std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z) : AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z))
{
}
+1 -1
View File
@@ -6,7 +6,7 @@ class Level;
class CraftingScreen : public AbstractContainerScreen
{
public:
CraftingScreen(shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
CraftingScreen(std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
virtual void removed();
protected:
virtual void renderLabels();
@@ -6,7 +6,7 @@
#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h"
#include "../../../Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h"
FurnaceScreen::FurnaceScreen(shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace) : AbstractContainerScreen(new FurnaceMenu(inventory, furnace))
FurnaceScreen::FurnaceScreen(std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace) : AbstractContainerScreen(new FurnaceMenu(inventory, furnace))
{
this->furnace = furnace;
}
+2 -2
View File
@@ -7,10 +7,10 @@ class Inventory;
class FurnaceScreen : public AbstractContainerScreen
{
private:
shared_ptr<FurnaceTileEntity> furnace;
std::shared_ptr<FurnaceTileEntity> furnace;
public:
FurnaceScreen(shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace);
FurnaceScreen(std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace);
protected:
virtual void renderLabels();
virtual void renderBg(float a);
@@ -10,7 +10,7 @@
#include "StatsScreen.h"
#include "../../../Minecraft.World/Headers/net.minecraft.stats.h"
InventoryScreen::InventoryScreen(shared_ptr<Player> player) : AbstractContainerScreen(player->inventoryMenu)
InventoryScreen::InventoryScreen(std::shared_ptr<Player> player) : AbstractContainerScreen(player->inventoryMenu)
{
xMouse = yMouse = 0.0f; // 4J added
@@ -6,7 +6,7 @@ class Button;
class InventoryScreen : public AbstractContainerScreen
{
public:
InventoryScreen(shared_ptr<Player> player);
InventoryScreen(std::shared_ptr<Player> player);
virtual void init();
protected:
virtual void renderLabels();
@@ -23,7 +23,7 @@ void ReceivingLevelScreen::tick()
tickCount++;
if (tickCount % 20 == 0)
{
connection->send( shared_ptr<KeepAlivePacket>( new KeepAlivePacket() ) );
connection->send( std::shared_ptr<KeepAlivePacket>( new KeepAlivePacket() ) );
}
if (connection != NULL)
{
@@ -13,7 +13,7 @@
const wstring TextEditScreen::allowedChars = SharedConstants::readAcceptableChars();
TextEditScreen::TextEditScreen(shared_ptr<SignTileEntity> sign)
TextEditScreen::TextEditScreen(std::shared_ptr<SignTileEntity> sign)
{
// 4J - added initialisers
line = 0;
@@ -35,7 +35,7 @@ void TextEditScreen::removed()
Keyboard::enableRepeatEvents(false);
if (minecraft->level->isClientSide)
{
minecraft->getConnection(0)->send( shared_ptr<SignUpdatePacket>( new SignUpdatePacket(sign->x, sign->y, sign->z, sign->IsVerified(), sign->IsCensored(), sign->GetMessages()) ) );
minecraft->getConnection(0)->send( std::shared_ptr<SignUpdatePacket>( new SignUpdatePacket(sign->x, sign->y, sign->z, sign->IsVerified(), sign->IsCensored(), sign->GetMessages()) ) );
}
}
+2 -2
View File
@@ -8,12 +8,12 @@ class TextEditScreen : public Screen
protected:
wstring title;
private:
shared_ptr<SignTileEntity> sign;
std::shared_ptr<SignTileEntity> sign;
int frame;
int line;
public:
TextEditScreen(shared_ptr<SignTileEntity> sign);
TextEditScreen(std::shared_ptr<SignTileEntity> sign);
virtual void init();
virtual void removed();
virtual void tick();
+1 -1
View File
@@ -6,7 +6,7 @@
#include "../../../Minecraft.World/Blocks/TileEntities/DispenserTileEntity.h"
#include "../../../Minecraft.World/Headers/net.minecraft.world.h"
TrapScreen::TrapScreen(shared_ptr<Inventory> inventory, shared_ptr<DispenserTileEntity> trap) : AbstractContainerScreen(new TrapMenu(inventory, trap))
TrapScreen::TrapScreen(std::shared_ptr<Inventory> inventory, std::shared_ptr<DispenserTileEntity> trap) : AbstractContainerScreen(new TrapMenu(inventory, trap))
{
}
+1 -1
View File
@@ -6,7 +6,7 @@ class Inventory;
class TrapScreen : public AbstractContainerScreen
{
public:
TrapScreen(shared_ptr<Inventory> inventory, shared_ptr<DispenserTileEntity> trap);
TrapScreen(std::shared_ptr<Inventory> inventory, std::shared_ptr<DispenserTileEntity> trap);
protected:
virtual void renderLabels();
virtual void renderBg(float a);