Merge branch 'main' of https://github.com/smartcmd/MinecraftConsoles into Infinite-worlds

This commit is contained in:
bwmp 2026-03-02 04:56:42 -08:00
commit 23afd781ef
1592 changed files with 17369 additions and 17364 deletions

View file

@ -1,5 +1,7 @@
# Pull Request # Pull Request
## Note: IF YOUR PR CHANGES THE GAME BEHAVIOR VISIBLY, REMEMBER TO ATTACH A GAMEPLAY FOOTAGE (or at least a screenshot) OF YOU *ACTUALLY* PLAYING THE GAME WITH YOUR CHANGES. Untested PRs are *NOT* welcome. Please don't forget to describe what did you do in each commit in your PR.
## Description ## Description
Briefly describe the changes this PR introduces. Briefly describe the changes this PR introduces.

View file

@ -75,7 +75,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
} }
} }
std::shared_ptr<Inventory> inventory = minecraft->player->inventory; shared_ptr<Inventory> inventory = minecraft->player->inventory;
if (inventory->getCarried() != NULL) if (inventory->getCarried() != NULL)
{ {
glTranslatef(0, 0, 32); glTranslatef(0, 0, 32);
@ -128,7 +128,7 @@ void AbstractContainerScreen::renderSlot(Slot *slot)
#if 0 #if 0
int x = slot->x; int x = slot->x;
int y = slot->y; int y = slot->y;
std::shared_ptr<ItemInstance> item = slot->getItem(); shared_ptr<ItemInstance> item = slot->getItem();
if (item == NULL) if (item == NULL)
{ {
@ -218,7 +218,7 @@ void AbstractContainerScreen::removed()
if (minecraft->player == NULL) return; if (minecraft->player == NULL) return;
} }
void AbstractContainerScreen::slotsChanged(std::shared_ptr<Container> container) void AbstractContainerScreen::slotsChanged(shared_ptr<Container> container)
{ {
} }

View file

@ -32,7 +32,7 @@ protected:
virtual void keyPressed(wchar_t eventCharacter, int eventKey); virtual void keyPressed(wchar_t eventCharacter, int eventKey);
public: public:
virtual void removed(); virtual void removed();
virtual void slotsChanged(std::shared_ptr<Container> container); virtual void slotsChanged(shared_ptr<Container> container);
virtual bool isPauseScreen(); virtual bool isPauseScreen();
virtual void tick(); virtual void tick();
}; };

View file

@ -13,7 +13,7 @@ private:
wstring title; wstring title;
wstring desc; wstring desc;
Achievement *ach; Achievement *ach;
int64_t startTime; __int64 startTime;
ItemRenderer *ir; ItemRenderer *ir;
bool isHelper; bool isHelper;

View file

@ -3,11 +3,11 @@
#include "..\Minecraft.World\net.minecraft.world.entity.projectile.h" #include "..\Minecraft.World\net.minecraft.world.entity.projectile.h"
#include "..\Minecraft.World\Mth.h" #include "..\Minecraft.World\Mth.h"
void ArrowRenderer::render(std::shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a) void ArrowRenderer::render(shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a)
{ {
// 4J - original version used generics and thus had an input parameter of type Arrow rather than std::shared_ptr<Entity> we have here - // 4J - original version used generics and thus had an input parameter of type Arrow rather than shared_ptr<Entity> we have here -
// do some casting around instead // do some casting around instead
std::shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(_arrow); shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(_arrow);
bindTexture(TN_ITEM_ARROWS); // 4J - was L"/item/arrows.png" bindTexture(TN_ITEM_ARROWS); // 4J - was L"/item/arrows.png"
glPushMatrix(); glPushMatrix();

View file

@ -4,5 +4,5 @@
class ArrowRenderer : public EntityRenderer class ArrowRenderer : public EntityRenderer
{ {
public: public:
virtual void render(std::shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a); virtual void render(shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a);
}; };

View file

@ -30,7 +30,7 @@ int BlazeModel::modelVersion()
return 8; return 8;
} }
void BlazeModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) void BlazeModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{ {
setupAnim(time, r, bob, yRot, xRot, scale); setupAnim(time, r, bob, yRot, xRot, scale);

View file

@ -11,6 +11,6 @@ private:
public: public:
BlazeModel(); BlazeModel();
int modelVersion(); int modelVersion();
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0);
}; };

View file

@ -8,11 +8,11 @@ BlazeRenderer::BlazeRenderer() : MobRenderer(new BlazeModel(), 0.5f)
this->modelVersion = ((BlazeModel *) model)->modelVersion(); this->modelVersion = ((BlazeModel *) model)->modelVersion();
} }
void BlazeRenderer::render(std::shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a) void BlazeRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
{ {
// 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr<Entity> we have here - // 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr<Entity> we have here -
// do some casting around instead // do some casting around instead
std::shared_ptr<Blaze> mob = dynamic_pointer_cast<Blaze>(_mob); shared_ptr<Blaze> mob = dynamic_pointer_cast<Blaze>(_mob);
int modelVersion = ((BlazeModel *) model)->modelVersion(); int modelVersion = ((BlazeModel *) model)->modelVersion();
if (modelVersion != this->modelVersion) if (modelVersion != this->modelVersion)

View file

@ -10,5 +10,5 @@ private:
public: public:
BlazeRenderer(); BlazeRenderer();
virtual void render(std::shared_ptr<Entity> mob, double x, double y, double z, float rot, float a); virtual void render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
}; };

View file

@ -42,7 +42,7 @@ BoatModel::BoatModel() : Model()
cubes[4]->compile(1.0f/16.0f); cubes[4]->compile(1.0f/16.0f);
} }
void BoatModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) void BoatModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {

View file

@ -7,5 +7,5 @@ class BoatModel : public Model
public: public:
ModelPart *cubes[5]; ModelPart *cubes[5];
BoatModel(); BoatModel();
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
}; };

View file

@ -10,11 +10,11 @@ BoatRenderer::BoatRenderer() : EntityRenderer()
model = new BoatModel(); model = new BoatModel();
} }
void BoatRenderer::render(std::shared_ptr<Entity> _boat, double x, double y, double z, float rot, float a) void BoatRenderer::render(shared_ptr<Entity> _boat, double x, double y, double z, float rot, float a)
{ {
// 4J - original version used generics and thus had an input parameter of type Boat rather than std::shared_ptr<Entity> we have here - // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr<Entity> we have here -
// do some casting around instead // do some casting around instead
std::shared_ptr<Boat> boat = dynamic_pointer_cast<Boat>(_boat); shared_ptr<Boat> boat = dynamic_pointer_cast<Boat>(_boat);
glPushMatrix(); glPushMatrix();

View file

@ -9,5 +9,5 @@ protected:
public: public:
BoatRenderer(); BoatRenderer();
virtual void render(std::shared_ptr<Entity> boat, double x, double y, double z, float rot, float a); virtual void render(shared_ptr<Entity> boat, double x, double y, double z, float rot, float a);
}; };

View file

@ -33,7 +33,7 @@ BookModel::BookModel()
} }
void BookModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) void BookModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{ {
setupAnim(time, r, bob, yRot, xRot, scale); setupAnim(time, r, bob, yRot, xRot, scale);

View file

@ -11,6 +11,6 @@ public:
ModelPart *seam; ModelPart *seam;
BookModel(); BookModel();
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0);
}; };

View file

@ -21,7 +21,7 @@ float Camera::za = 0.0f;
float Camera::xa2 = 0.0f; float Camera::xa2 = 0.0f;
float Camera::za2 = 0.0f; float Camera::za2 = 0.0f;
void Camera::prepare(std::shared_ptr<Player> player, bool mirror) void Camera::prepare(shared_ptr<Player> player, bool mirror)
{ {
glGetFloat(GL_MODELVIEW_MATRIX, modelview); glGetFloat(GL_MODELVIEW_MATRIX, modelview);
glGetFloat(GL_PROJECTION_MATRIX, projection); glGetFloat(GL_PROJECTION_MATRIX, projection);
@ -88,12 +88,12 @@ void Camera::prepare(std::shared_ptr<Player> player, bool mirror)
ya = cosf(xRot * PI / 180.0f); ya = cosf(xRot * PI / 180.0f);
} }
TilePos *Camera::getCameraTilePos(std::shared_ptr<Mob> player, double alpha) TilePos *Camera::getCameraTilePos(shared_ptr<Mob> player, double alpha)
{ {
return new TilePos(getCameraPos(player, alpha)); return new TilePos(getCameraPos(player, alpha));
} }
Vec3 *Camera::getCameraPos(std::shared_ptr<Mob> player, double alpha) Vec3 *Camera::getCameraPos(shared_ptr<Mob> player, double alpha)
{ {
double xx = player->xo + (player->x - player->xo) * alpha; double xx = player->xo + (player->x - player->xo) * alpha;
double yy = player->yo + (player->y - player->yo) * alpha + player->getHeadHeight(); double yy = player->yo + (player->y - player->yo) * alpha + player->getHeadHeight();
@ -106,7 +106,7 @@ Vec3 *Camera::getCameraPos(std::shared_ptr<Mob> player, double alpha)
return Vec3::newTemp(xt, yt, zt); return Vec3::newTemp(xt, yt, zt);
} }
int Camera::getBlockAt(Level *level, std::shared_ptr<Mob> player, float alpha) int Camera::getBlockAt(Level *level, shared_ptr<Mob> player, float alpha)
{ {
Vec3 *p = Camera::getCameraPos(player, alpha); Vec3 *p = Camera::getCameraPos(player, alpha);
TilePos tp = TilePos(p); TilePos tp = TilePos(p);

View file

@ -24,9 +24,9 @@ private:
public: public:
static float xa, ya, za, xa2, za2; static float xa, ya, za, xa2, za2;
static void prepare(std::shared_ptr<Player> player, bool mirror); static void prepare(shared_ptr<Player> player, bool mirror);
static TilePos *getCameraTilePos(std::shared_ptr<Mob> player, double alpha); static TilePos *getCameraTilePos(shared_ptr<Mob> player, double alpha);
static Vec3 *getCameraPos(std::shared_ptr<Mob> player, double alpha); static Vec3 *getCameraPos(shared_ptr<Mob> player, double alpha);
static int getBlockAt(Level *level, std::shared_ptr<Mob> player, float alpha); static int getBlockAt(Level *level, shared_ptr<Mob> player, float alpha);
}; };

View file

@ -18,10 +18,10 @@ ChestRenderer::~ChestRenderer()
delete largeChestModel; delete largeChestModel;
} }
void ChestRenderer::render(std::shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) void ChestRenderer::render(shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
{ {
// 4J Convert as we aren't using a templated class // 4J Convert as we aren't using a templated class
std::shared_ptr<ChestTileEntity> chest = dynamic_pointer_cast<ChestTileEntity>(_chest); shared_ptr<ChestTileEntity> chest = dynamic_pointer_cast<ChestTileEntity>(_chest);
int data; int data;

View file

@ -14,5 +14,5 @@ public:
ChestRenderer(); ChestRenderer();
~ChestRenderer(); ~ChestRenderer();
void render(std::shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param void render(shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param
}; };

View file

@ -49,7 +49,7 @@ ChickenModel::ChickenModel() : Model()
wing1->compile(1.0f/16.0f); wing1->compile(1.0f/16.0f);
} }
void ChickenModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) void ChickenModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{ {
setupAnim(time, r, bob, yRot, xRot, scale); setupAnim(time, r, bob, yRot, xRot, scale);
if (young) if (young)

View file

@ -6,6 +6,6 @@ public:
ModelPart *head, *hair, *body, *leg0, *leg1, *wing0,* wing1, *beak, *redThing; ModelPart *head, *hair, *body, *leg0, *leg1, *wing0,* wing1, *beak, *redThing;
ChickenModel(); ChickenModel();
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0);
}; };

View file

@ -7,15 +7,15 @@ ChickenRenderer::ChickenRenderer(Model *model, float shadow) : MobRenderer(model
{ {
} }
void ChickenRenderer::render(std::shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a) void ChickenRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
{ {
MobRenderer::render(_mob, x, y, z, rot, a); MobRenderer::render(_mob, x, y, z, rot, a);
} }
float ChickenRenderer::getBob(std::shared_ptr<Mob> _mob, float a) float ChickenRenderer::getBob(shared_ptr<Mob> _mob, float a)
{ {
// 4J - dynamic cast required because we aren't using templates/generics in our version // 4J - dynamic cast required because we aren't using templates/generics in our version
std::shared_ptr<Chicken> mob = dynamic_pointer_cast<Chicken>(_mob); shared_ptr<Chicken> mob = dynamic_pointer_cast<Chicken>(_mob);
float flap = mob->oFlap+(mob->flap-mob->oFlap)*a; float flap = mob->oFlap+(mob->flap-mob->oFlap)*a;
float flapSpeed = mob->oFlapSpeed+(mob->flapSpeed-mob->oFlapSpeed)*a; float flapSpeed = mob->oFlapSpeed+(mob->flapSpeed-mob->oFlapSpeed)*a;

View file

@ -5,7 +5,7 @@ class ChickenRenderer : public MobRenderer
{ {
public: public:
ChickenRenderer(Model *model, float shadow); ChickenRenderer(Model *model, float shadow);
virtual void render(std::shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a); virtual void render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a);
protected: protected:
virtual float getBob(std::shared_ptr<Mob> _mob, float a); virtual float getBob(shared_ptr<Mob> _mob, float a);
}; };

View file

@ -204,10 +204,10 @@ void Chunk::rebuild()
LevelChunk::touchedSky = false; LevelChunk::touchedSky = false;
// unordered_set<std::shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line // unordered_set<shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line
// renderableTileEntities.clear(); // renderableTileEntities.clear();
vector<std::shared_ptr<TileEntity> > renderableTileEntities; // 4J - added vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - added
int r = 1; int r = 1;
@ -402,7 +402,7 @@ void Chunk::rebuild()
Tile *tile = Tile::tiles[tileId]; Tile *tile = Tile::tiles[tileId];
if (currentLayer == 0 && tile->isEntityTile()) if (currentLayer == 0 && tile->isEntityTile())
{ {
std::shared_ptr<TileEntity> et = region->getTileEntity(x, y, z); shared_ptr<TileEntity> et = region->getTileEntity(x, y, z);
if (TileEntityRenderDispatcher::instance->hasRenderer(et)) if (TileEntityRenderDispatcher::instance->hasRenderer(et))
{ {
renderableTileEntities.push_back(et); renderableTileEntities.push_back(et);
@ -554,10 +554,10 @@ void Chunk::rebuild()
*/ */
unordered_set<std::shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); unordered_set<shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end());
AUTO_VAR(endIt, oldTileEntities.end()); AUTO_VAR(endIt, oldTileEntities.end());
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ ) for( unordered_set<shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ )
{ {
newTileEntities.erase(*it); newTileEntities.erase(*it);
} }
@ -566,7 +566,7 @@ void Chunk::rebuild()
EnterCriticalSection(globalRenderableTileEntities_cs); EnterCriticalSection(globalRenderableTileEntities_cs);
endIt = newTileEntities.end(); endIt = newTileEntities.end();
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ ) for( unordered_set<shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ )
{ {
globalRenderableTileEntities->push_back(*it); globalRenderableTileEntities->push_back(*it);
} }
@ -574,12 +574,12 @@ void Chunk::rebuild()
// 4J - All these new things added to globalRenderableTileEntities // 4J - All these new things added to globalRenderableTileEntities
AUTO_VAR(endItRTE, renderableTileEntities.end()); AUTO_VAR(endItRTE, renderableTileEntities.end());
for( vector<std::shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ ) for( vector<shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ )
{ {
oldTileEntities.erase(*it); oldTileEntities.erase(*it);
} }
// 4J - oldTileEntities is now the removed items // 4J - oldTileEntities is now the removed items
vector<std::shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin(); vector<shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin();
while( it != globalRenderableTileEntities->end() ) while( it != globalRenderableTileEntities->end() )
{ {
if( oldTileEntities.find(*it) != oldTileEntities.end() ) if( oldTileEntities.find(*it) != oldTileEntities.end() )
@ -656,10 +656,10 @@ void Chunk::rebuild_SPU()
LevelChunk::touchedSky = false; LevelChunk::touchedSky = false;
// unordered_set<std::shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line // unordered_set<shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line
// renderableTileEntities.clear(); // renderableTileEntities.clear();
vector<std::shared_ptr<TileEntity> > renderableTileEntities; // 4J - added vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - added
// List<TileEntity> newTileEntities = new ArrayList<TileEntity>(); // List<TileEntity> newTileEntities = new ArrayList<TileEntity>();
// newTileEntities.clear(); // newTileEntities.clear();
@ -750,7 +750,7 @@ void Chunk::rebuild_SPU()
{ {
if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile()) if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile())
{ {
std::shared_ptr<TileEntity> et = region.getTileEntity(x, y, z); shared_ptr<TileEntity> et = region.getTileEntity(x, y, z);
if (TileEntityRenderDispatcher::instance->hasRenderer(et)) if (TileEntityRenderDispatcher::instance->hasRenderer(et))
{ {
renderableTileEntities.push_back(et); renderableTileEntities.push_back(et);
@ -883,10 +883,10 @@ void Chunk::rebuild_SPU()
*/ */
unordered_set<std::shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); unordered_set<shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end());
AUTO_VAR(endIt, oldTileEntities.end()); AUTO_VAR(endIt, oldTileEntities.end());
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ ) for( unordered_set<shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ )
{ {
newTileEntities.erase(*it); newTileEntities.erase(*it);
} }
@ -895,7 +895,7 @@ void Chunk::rebuild_SPU()
EnterCriticalSection(globalRenderableTileEntities_cs); EnterCriticalSection(globalRenderableTileEntities_cs);
endIt = newTileEntities.end(); endIt = newTileEntities.end();
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ ) for( unordered_set<shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ )
{ {
globalRenderableTileEntities.push_back(*it); globalRenderableTileEntities.push_back(*it);
} }
@ -903,12 +903,12 @@ void Chunk::rebuild_SPU()
// 4J - All these new things added to globalRenderableTileEntities // 4J - All these new things added to globalRenderableTileEntities
AUTO_VAR(endItRTE, renderableTileEntities.end()); AUTO_VAR(endItRTE, renderableTileEntities.end());
for( vector<std::shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ ) for( vector<shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ )
{ {
oldTileEntities.erase(*it); oldTileEntities.erase(*it);
} }
// 4J - oldTileEntities is now the removed items // 4J - oldTileEntities is now the removed items
vector<std::shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin(); vector<shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin();
while( it != globalRenderableTileEntities->end() ) while( it != globalRenderableTileEntities->end() )
{ {
if( oldTileEntities.find(*it) != oldTileEntities.end() ) if( oldTileEntities.find(*it) != oldTileEntities.end() )
@ -941,7 +941,7 @@ void Chunk::rebuild_SPU()
#endif // _PS3_ #endif // _PS3_
float Chunk::distanceToSqr(std::shared_ptr<Entity> player) const float Chunk::distanceToSqr(shared_ptr<Entity> player) const
{ {
float xd = (float) (player->x - xm); float xd = (float) (player->x - xm);
float yd = (float) (player->y - ym); float yd = (float) (player->y - ym);
@ -949,7 +949,7 @@ float Chunk::distanceToSqr(std::shared_ptr<Entity> player) const
return xd * xd + yd * yd + zd * zd; return xd * xd + yd * yd + zd * zd;
} }
float Chunk::squishedDistanceToSqr(std::shared_ptr<Entity> player) float Chunk::squishedDistanceToSqr(shared_ptr<Entity> player)
{ {
float xd = (float) (player->x - xm); float xd = (float) (player->x - xm);
float yd = (float) (player->y - ym) * 2; float yd = (float) (player->y - ym) * 2;

View file

@ -52,7 +52,7 @@ public:
int id; int id;
//public: //public:
// vector<std::shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed // vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed
private: private:
LevelRenderer::rteMap *globalRenderableTileEntities; LevelRenderer::rteMap *globalRenderableTileEntities;
@ -71,8 +71,8 @@ public:
#ifdef __PS3__ #ifdef __PS3__
void rebuild_SPU(); void rebuild_SPU();
#endif // __PS3__ #endif // __PS3__
float distanceToSqr(std::shared_ptr<Entity> player) const; float distanceToSqr(shared_ptr<Entity> player) const;
float squishedDistanceToSqr(std::shared_ptr<Entity> player); float squishedDistanceToSqr(shared_ptr<Entity> player);
void reset(); void reset();
void _delete(); void _delete();

File diff suppressed because it is too large Load diff

View file

@ -49,92 +49,92 @@ public:
~ClientConnection(); ~ClientConnection();
void tick(); void tick();
INetworkPlayer *getNetworkPlayer(); INetworkPlayer *getNetworkPlayer();
virtual void handleLogin(std::shared_ptr<LoginPacket> packet); virtual void handleLogin(shared_ptr<LoginPacket> packet);
virtual void handleAddEntity(std::shared_ptr<AddEntityPacket> packet); virtual void handleAddEntity(shared_ptr<AddEntityPacket> packet);
virtual void handleAddExperienceOrb(std::shared_ptr<AddExperienceOrbPacket> packet); virtual void handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet);
virtual void handleAddGlobalEntity(std::shared_ptr<AddGlobalEntityPacket> packet); virtual void handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet);
virtual void handleAddPainting(std::shared_ptr<AddPaintingPacket> packet); virtual void handleAddPainting(shared_ptr<AddPaintingPacket> packet);
virtual void handleSetEntityMotion(std::shared_ptr<SetEntityMotionPacket> packet); virtual void handleSetEntityMotion(shared_ptr<SetEntityMotionPacket> packet);
virtual void handleSetEntityData(std::shared_ptr<SetEntityDataPacket> packet); virtual void handleSetEntityData(shared_ptr<SetEntityDataPacket> packet);
virtual void handleAddPlayer(std::shared_ptr<AddPlayerPacket> packet); virtual void handleAddPlayer(shared_ptr<AddPlayerPacket> packet);
virtual void handleTeleportEntity(std::shared_ptr<TeleportEntityPacket> packet); virtual void handleTeleportEntity(shared_ptr<TeleportEntityPacket> packet);
virtual void handleMoveEntity(std::shared_ptr<MoveEntityPacket> packet); virtual void handleMoveEntity(shared_ptr<MoveEntityPacket> packet);
virtual void handleRotateMob(std::shared_ptr<RotateHeadPacket> packet); virtual void handleRotateMob(shared_ptr<RotateHeadPacket> packet);
virtual void handleMoveEntitySmall(std::shared_ptr<MoveEntityPacketSmall> packet); virtual void handleMoveEntitySmall(shared_ptr<MoveEntityPacketSmall> packet);
virtual void handleRemoveEntity(std::shared_ptr<RemoveEntitiesPacket> packet); virtual void handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packet);
virtual void handleMovePlayer(std::shared_ptr<MovePlayerPacket> packet); virtual void handleMovePlayer(shared_ptr<MovePlayerPacket> packet);
Random *random; Random *random;
// 4J Added // 4J Added
virtual void handleChunkVisibilityArea(std::shared_ptr<ChunkVisibilityAreaPacket> packet); virtual void handleChunkVisibilityArea(shared_ptr<ChunkVisibilityAreaPacket> packet);
virtual void handleChunkVisibility(std::shared_ptr<ChunkVisibilityPacket> packet); virtual void handleChunkVisibility(shared_ptr<ChunkVisibilityPacket> packet);
virtual void handleChunkTilesUpdate(std::shared_ptr<ChunkTilesUpdatePacket> packet); virtual void handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket> packet);
virtual void handleBlockRegionUpdate(std::shared_ptr<BlockRegionUpdatePacket> packet); virtual void handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacket> packet);
virtual void handleTileUpdate(std::shared_ptr<TileUpdatePacket> packet); virtual void handleTileUpdate(shared_ptr<TileUpdatePacket> packet);
virtual void handleDisconnect(std::shared_ptr<DisconnectPacket> packet); virtual void handleDisconnect(shared_ptr<DisconnectPacket> packet);
virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects); virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects);
void sendAndDisconnect(std::shared_ptr<Packet> packet); void sendAndDisconnect(shared_ptr<Packet> packet);
void send(std::shared_ptr<Packet> packet); void send(shared_ptr<Packet> packet);
virtual void handleTakeItemEntity(std::shared_ptr<TakeItemEntityPacket> packet); virtual void handleTakeItemEntity(shared_ptr<TakeItemEntityPacket> packet);
virtual void handleChat(std::shared_ptr<ChatPacket> packet); virtual void handleChat(shared_ptr<ChatPacket> packet);
virtual void handleAnimate(std::shared_ptr<AnimatePacket> packet); virtual void handleAnimate(shared_ptr<AnimatePacket> packet);
virtual void handleEntityActionAtPosition(std::shared_ptr<EntityActionAtPositionPacket> packet); virtual void handleEntityActionAtPosition(shared_ptr<EntityActionAtPositionPacket> packet);
virtual void handlePreLogin(std::shared_ptr<PreLoginPacket> packet); virtual void handlePreLogin(shared_ptr<PreLoginPacket> packet);
void close(); void close();
virtual void handleAddMob(std::shared_ptr<AddMobPacket> packet); virtual void handleAddMob(shared_ptr<AddMobPacket> packet);
virtual void handleSetTime(std::shared_ptr<SetTimePacket> packet); virtual void handleSetTime(shared_ptr<SetTimePacket> packet);
virtual void handleSetSpawn(std::shared_ptr<SetSpawnPositionPacket> packet); virtual void handleSetSpawn(shared_ptr<SetSpawnPositionPacket> packet);
virtual void handleRidePacket(std::shared_ptr<SetRidingPacket> packet); virtual void handleRidePacket(shared_ptr<SetRidingPacket> packet);
virtual void handleEntityEvent(std::shared_ptr<EntityEventPacket> packet); virtual void handleEntityEvent(shared_ptr<EntityEventPacket> packet);
private: private:
std::shared_ptr<Entity> getEntity(int entityId); shared_ptr<Entity> getEntity(int entityId);
wstring GetDisplayNameByGamertag(wstring gamertag); wstring GetDisplayNameByGamertag(wstring gamertag);
public: public:
virtual void handleSetHealth(std::shared_ptr<SetHealthPacket> packet); virtual void handleSetHealth(shared_ptr<SetHealthPacket> packet);
virtual void handleSetExperience(std::shared_ptr<SetExperiencePacket> packet); virtual void handleSetExperience(shared_ptr<SetExperiencePacket> packet);
virtual void handleRespawn(std::shared_ptr<RespawnPacket> packet); virtual void handleRespawn(shared_ptr<RespawnPacket> packet);
virtual void handleExplosion(std::shared_ptr<ExplodePacket> packet); virtual void handleExplosion(shared_ptr<ExplodePacket> packet);
virtual void handleContainerOpen(std::shared_ptr<ContainerOpenPacket> packet); virtual void handleContainerOpen(shared_ptr<ContainerOpenPacket> packet);
virtual void handleContainerSetSlot(std::shared_ptr<ContainerSetSlotPacket> packet); virtual void handleContainerSetSlot(shared_ptr<ContainerSetSlotPacket> packet);
virtual void handleContainerAck(std::shared_ptr<ContainerAckPacket> packet); virtual void handleContainerAck(shared_ptr<ContainerAckPacket> packet);
virtual void handleContainerContent(std::shared_ptr<ContainerSetContentPacket> packet); virtual void handleContainerContent(shared_ptr<ContainerSetContentPacket> packet);
virtual void handleSignUpdate(std::shared_ptr<SignUpdatePacket> packet); virtual void handleSignUpdate(shared_ptr<SignUpdatePacket> packet);
virtual void handleTileEntityData(std::shared_ptr<TileEntityDataPacket> packet); virtual void handleTileEntityData(shared_ptr<TileEntityDataPacket> packet);
virtual void handleContainerSetData(std::shared_ptr<ContainerSetDataPacket> packet); virtual void handleContainerSetData(shared_ptr<ContainerSetDataPacket> packet);
virtual void handleSetEquippedItem(std::shared_ptr<SetEquippedItemPacket> packet); virtual void handleSetEquippedItem(shared_ptr<SetEquippedItemPacket> packet);
virtual void handleContainerClose(std::shared_ptr<ContainerClosePacket> packet); virtual void handleContainerClose(shared_ptr<ContainerClosePacket> packet);
virtual void handleTileEvent(std::shared_ptr<TileEventPacket> packet); virtual void handleTileEvent(shared_ptr<TileEventPacket> packet);
virtual void handleTileDestruction(std::shared_ptr<TileDestructionPacket> packet); virtual void handleTileDestruction(shared_ptr<TileDestructionPacket> packet);
virtual bool canHandleAsyncPackets(); virtual bool canHandleAsyncPackets();
virtual void handleGameEvent(std::shared_ptr<GameEventPacket> gameEventPacket); virtual void handleGameEvent(shared_ptr<GameEventPacket> gameEventPacket);
virtual void handleComplexItemData(std::shared_ptr<ComplexItemDataPacket> packet); virtual void handleComplexItemData(shared_ptr<ComplexItemDataPacket> packet);
virtual void handleLevelEvent(std::shared_ptr<LevelEventPacket> packet); virtual void handleLevelEvent(shared_ptr<LevelEventPacket> packet);
virtual void handleAwardStat(std::shared_ptr<AwardStatPacket> packet); virtual void handleAwardStat(shared_ptr<AwardStatPacket> packet);
virtual void handleUpdateMobEffect(std::shared_ptr<UpdateMobEffectPacket> packet); virtual void handleUpdateMobEffect(shared_ptr<UpdateMobEffectPacket> packet);
virtual void handleRemoveMobEffect(std::shared_ptr<RemoveMobEffectPacket> packet); virtual void handleRemoveMobEffect(shared_ptr<RemoveMobEffectPacket> packet);
virtual bool isServerPacketListener(); virtual bool isServerPacketListener();
virtual void handlePlayerInfo(std::shared_ptr<PlayerInfoPacket> packet); virtual void handlePlayerInfo(shared_ptr<PlayerInfoPacket> packet);
virtual void handleKeepAlive(std::shared_ptr<KeepAlivePacket> packet); virtual void handleKeepAlive(shared_ptr<KeepAlivePacket> packet);
virtual void handlePlayerAbilities(std::shared_ptr<PlayerAbilitiesPacket> playerAbilitiesPacket); virtual void handlePlayerAbilities(shared_ptr<PlayerAbilitiesPacket> playerAbilitiesPacket);
virtual void handleSoundEvent(std::shared_ptr<LevelSoundPacket> packet); virtual void handleSoundEvent(shared_ptr<LevelSoundPacket> packet);
virtual void handleCustomPayload(std::shared_ptr<CustomPayloadPacket> customPayloadPacket); virtual void handleCustomPayload(shared_ptr<CustomPayloadPacket> customPayloadPacket);
virtual Connection *getConnection(); virtual Connection *getConnection();
// 4J Added // 4J Added
virtual void handleServerSettingsChanged(std::shared_ptr<ServerSettingsChangedPacket> packet); virtual void handleServerSettingsChanged(shared_ptr<ServerSettingsChangedPacket> packet);
virtual void handleTexture(std::shared_ptr<TexturePacket> packet); virtual void handleTexture(shared_ptr<TexturePacket> packet);
virtual void handleTextureAndGeometry(std::shared_ptr<TextureAndGeometryPacket> packet); virtual void handleTextureAndGeometry(shared_ptr<TextureAndGeometryPacket> packet);
virtual void handleUpdateProgress(std::shared_ptr<UpdateProgressPacket> packet); virtual void handleUpdateProgress(shared_ptr<UpdateProgressPacket> packet);
// 4J Added // 4J Added
static int HostDisconnectReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int HostDisconnectReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
virtual void handleTextureChange(std::shared_ptr<TextureChangePacket> packet); virtual void handleTextureChange(shared_ptr<TextureChangePacket> packet);
virtual void handleTextureAndGeometryChange(std::shared_ptr<TextureAndGeometryChangePacket> packet); virtual void handleTextureAndGeometryChange(shared_ptr<TextureAndGeometryChangePacket> packet);
virtual void handleUpdateGameRuleProgressPacket(std::shared_ptr<UpdateGameRuleProgressPacket> packet); virtual void handleUpdateGameRuleProgressPacket(shared_ptr<UpdateGameRuleProgressPacket> packet);
virtual void handleXZ(std::shared_ptr<XZPacket> packet); virtual void handleXZ(shared_ptr<XZPacket> packet);
void displayPrivilegeChanges(std::shared_ptr<MultiplayerLocalPlayer> player, unsigned int oldPrivileges); void displayPrivilegeChanges(shared_ptr<MultiplayerLocalPlayer> player, unsigned int oldPrivileges);
}; };

View file

@ -43,7 +43,7 @@ class ConsoleSoundEngine
public: public:
ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){}; ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){};
virtual void tick(std::shared_ptr<Mob> *players, float a) =0; virtual void tick(shared_ptr<Mob> *players, float a) =0;
virtual void destroy()=0; virtual void destroy()=0;
virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0; virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0;
virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0; virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0;

View file

@ -32,7 +32,7 @@ void SoundEngine::init(Options *pOptions)
{ {
} }
void SoundEngine::tick(std::shared_ptr<Mob> *players, float a) void SoundEngine::tick(shared_ptr<Mob> *players, float a)
{ {
} }
void SoundEngine::destroy() {} void SoundEngine::destroy() {}
@ -622,7 +622,7 @@ static float fVal=0.0f;
static S32 running = AIL_ms_count(); static S32 running = AIL_ms_count();
#endif #endif
void SoundEngine::tick(std::shared_ptr<Mob> *players, float a) void SoundEngine::tick(shared_ptr<Mob> *players, float a)
{ {
#ifdef __DISABLE_MILES__ #ifdef __DISABLE_MILES__
return; return;

View file

@ -103,7 +103,7 @@ public:
virtual void updateSystemMusicPlaying(bool isPlaying); virtual void updateSystemMusicPlaying(bool isPlaying);
virtual void updateSoundEffectVolume(float fVal); virtual void updateSoundEffectVolume(float fVal);
virtual void init(Options *); virtual void init(Options *);
virtual void tick(std::shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one virtual void tick(shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one
virtual void add(const wstring& name, File *file); virtual void add(const wstring& name, File *file);
virtual void addMusic(const wstring& name, File *file); virtual void addMusic(const wstring& name, File *file);
virtual void addStreaming(const wstring& name, File *file); virtual void addStreaming(const wstring& name, File *file);

View file

@ -365,7 +365,7 @@ void CMinecraftApp::HandleButtonPresses(int iPad)
// ProfileManager.WriteToProfile(iPad,true); // ProfileManager.WriteToProfile(iPad,true);
} }
bool CMinecraftApp::LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack) bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack)
{ {
bool success = true; bool success = true;
@ -388,7 +388,7 @@ bool CMinecraftApp::LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> play
return success; return success;
} }
bool CMinecraftApp::LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack) bool CMinecraftApp::LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack)
{ {
bool success = true; bool success = true;
@ -411,7 +411,7 @@ bool CMinecraftApp::LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> playe
return success; return success;
} }
bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> player) bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player)
{ {
bool success = true; bool success = true;
@ -437,7 +437,7 @@ bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> pl
return success; return success;
} }
bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> player, int x, int y, int z) bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z)
{ {
bool success = true; bool success = true;
@ -463,7 +463,7 @@ bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> pl
return success; return success;
} }
bool CMinecraftApp::LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inventory, int x, int y, int z, Level *level) bool CMinecraftApp::LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level)
{ {
bool success = true; bool success = true;
@ -489,7 +489,7 @@ bool CMinecraftApp::LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inven
return success; return success;
} }
bool CMinecraftApp::LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace) bool CMinecraftApp::LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace)
{ {
bool success = true; bool success = true;
@ -514,7 +514,7 @@ bool CMinecraftApp::LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventor
return success; return success;
} }
bool CMinecraftApp::LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand) bool CMinecraftApp::LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand)
{ {
bool success = true; bool success = true;
@ -540,7 +540,7 @@ bool CMinecraftApp::LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inv
} }
bool CMinecraftApp::LoadContainerMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<Container> container) bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container)
{ {
bool success = true; bool success = true;
@ -574,7 +574,7 @@ bool CMinecraftApp::LoadContainerMenu(int iPad,std::shared_ptr<Container> invent
return success; return success;
} }
bool CMinecraftApp::LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap) bool CMinecraftApp::LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap)
{ {
bool success = true; bool success = true;
@ -599,7 +599,7 @@ bool CMinecraftApp::LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory,
return success; return success;
} }
bool CMinecraftApp::LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> sign) bool CMinecraftApp::LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign)
{ {
bool success = true; bool success = true;
@ -615,7 +615,7 @@ bool CMinecraftApp::LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> s
return success; return success;
} }
bool CMinecraftApp::LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z) bool CMinecraftApp::LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z)
{ {
bool success = true; bool success = true;
@ -634,7 +634,7 @@ bool CMinecraftApp::LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> invent
return success; return success;
} }
bool CMinecraftApp::LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level *level) bool CMinecraftApp::LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level)
{ {
bool success = true; bool success = true;
@ -1272,7 +1272,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
PlayerList *players = MinecraftServer::getInstance()->getPlayerList(); PlayerList *players = MinecraftServer::getInstance()->getPlayerList();
for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3)
{ {
std::shared_ptr<ServerPlayer> decorationPlayer = *it3; shared_ptr<ServerPlayer> decorationPlayer = *it3;
decorationPlayer->setShowOnMaps((app.GetGameHostOption(eGameHostOption_Gamertags)!=0)?true:false); decorationPlayer->setShowOnMaps((app.GetGameHostOption(eGameHostOption_Gamertags)!=0)?true:false);
} }
} }
@ -2240,7 +2240,7 @@ unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlay
} }
if(iPad < 0) iPad = 0; if(iPad < 0) iPad = 0;
std::shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad]; shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
if(bOverridePlayer || player==NULL) if(bOverridePlayer || player==NULL)
{ {
@ -2260,7 +2260,7 @@ void CMinecraftApp::SetGameSettingsDebugMask(int iPad, unsigned int uiVal)
GameSettingsA[iPad]->uiDebugBitmask=uiVal; GameSettingsA[iPad]->uiDebugBitmask=uiVal;
// update the value so the network server can use it // update the value so the network server can use it
std::shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad]; shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
if(player) if(player)
{ {
@ -2427,7 +2427,7 @@ void CMinecraftApp::HandleXuiActions(void)
eTMSAction eTMS; eTMSAction eTMS;
LPVOID param; LPVOID param;
Minecraft *pMinecraft=Minecraft::GetInstance(); Minecraft *pMinecraft=Minecraft::GetInstance();
std::shared_ptr<MultiplayerLocalPlayer> player; shared_ptr<MultiplayerLocalPlayer> player;
// are there any global actions to deal with? // are there any global actions to deal with?
eAction = app.GetGlobalXuiAction(); eAction = app.GetGlobalXuiAction();
@ -5577,7 +5577,7 @@ void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes)
// // read the local file // // read the local file
// File gtsFile( wsFile->c_str() ); // File gtsFile( wsFile->c_str() );
// //
// int64_t fileSize = gtsFile.length(); // __int64 fileSize = gtsFile.length();
// //
// if(fileSize!=0) // if(fileSize!=0)
// { // {
@ -6510,7 +6510,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue)
} }
#if (defined _XBOX || defined _WINDOWS64) #if (defined _XBOX || defined _WINDOWS64)
HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, uint64_t ullOfferID_Full, uint64_t ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile)
{ {
HRESULT hr=S_OK; HRESULT hr=S_OK;
DLC_INFO *pDLCData=new DLC_INFO; DLC_INFO *pDLCData=new DLC_INFO;
@ -7763,7 +7763,7 @@ void CMinecraftApp::GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsig
return; return;
} }
unsigned int CMinecraftApp::CreateImageTextData(PBYTE bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId) unsigned int CMinecraftApp::CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId)
{ {
int iTextMetadataBytes = 0; int iTextMetadataBytes = 0;
if(hasSeed) if(hasSeed)

View file

@ -125,18 +125,18 @@ public:
bool GetGameStarted() {return m_bGameStarted;} bool GetGameStarted() {return m_bGameStarted;}
void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;} void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;}
int GetLocalPlayerCount(void); int GetLocalPlayerCount(void);
bool LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> player, bool bNavigateBack=false); bool LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player, bool bNavigateBack=false);
bool LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack=false); bool LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack=false);
bool LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inventory, int x, int y, int z, Level *level); bool LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level);
bool LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace); bool LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace);
bool LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand); bool LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand);
bool LoadContainerMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<Container> container); bool LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container);
bool LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap); bool LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap);
bool LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> player); bool LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player);
bool LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> player, int x, int y, int z); bool LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z);
bool LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> sign); bool LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign);
bool LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z); bool LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level *level); bool LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level);
bool GetTutorialMode() { return m_bTutorialMode;} bool GetTutorialMode() { return m_bTutorialMode;}
void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;} void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;}
@ -590,7 +590,7 @@ public:
DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId); DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId);
DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName); DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName);
#else #else
static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, uint64_t, uint64_t, WCHAR *, unsigned int, int, WCHAR *pDataFile); static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile);
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal);
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
@ -701,7 +701,7 @@ public:
// World seed from png image // World seed from png image
void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack); void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack);
unsigned int CreateImageTextData(PBYTE bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); unsigned int CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId);
// Game rules // Game rules
GameRuleManager m_gameRules; GameRuleManager m_gameRules;

View file

@ -43,7 +43,7 @@ void AddEnchantmentRuleDefinition::addAttribute(const wstring &attributeName, co
} }
} }
bool AddEnchantmentRuleDefinition::enchantItem(std::shared_ptr<ItemInstance> item) bool AddEnchantmentRuleDefinition::enchantItem(shared_ptr<ItemInstance> item)
{ {
bool enchanted = false; bool enchanted = false;
if (item != NULL) if (item != NULL)

View file

@ -19,5 +19,5 @@ public:
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
bool enchantItem(std::shared_ptr<ItemInstance> item); bool enchantItem(shared_ptr<ItemInstance> item);
}; };

View file

@ -94,13 +94,13 @@ void AddItemRuleDefinition::addAttribute(const wstring &attributeName, const wst
} }
} }
bool AddItemRuleDefinition::addItemToContainer(std::shared_ptr<Container> container, int slotId) bool AddItemRuleDefinition::addItemToContainer(shared_ptr<Container> container, int slotId)
{ {
bool added = false; bool added = false;
if(Item::items[m_itemId] != NULL) if(Item::items[m_itemId] != NULL)
{ {
int quantity = min(m_quantity, Item::items[m_itemId]->getMaxStackSize()); int quantity = min(m_quantity, Item::items[m_itemId]->getMaxStackSize());
std::shared_ptr<ItemInstance> newItem = std::shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) ); shared_ptr<ItemInstance> newItem = shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) );
newItem->set4JData(m_dataTag); newItem->set4JData(m_dataTag);
for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it) for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it)

View file

@ -26,5 +26,5 @@ public:
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
bool addItemToContainer(std::shared_ptr<Container> container, int slotId); bool addItemToContainer(shared_ptr<Container> container, int slotId);
}; };

View file

@ -19,8 +19,8 @@ private:
ConsoleSchematicFile::ESchematicRotation m_rotation; ConsoleSchematicFile::ESchematicRotation m_rotation;
int m_dimension; int m_dimension;
int64_t m_totalBlocksChanged; __int64 m_totalBlocksChanged;
int64_t m_totalBlocksChangedLighting; __int64 m_totalBlocksChangedLighting;
bool m_completed; bool m_completed;
void updateLocationBox(); void updateLocationBox();

View file

@ -74,7 +74,7 @@ void CollectItemRuleDefinition::populateGameRule(GameRulesInstance::EGameRulesIn
GameRuleDefinition::populateGameRule(type, rule); GameRuleDefinition::populateGameRule(type, rule);
} }
bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item) bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item)
{ {
bool statusChanged = false; bool statusChanged = false;
if(item != NULL && item->id == m_itemId && item->getAuxValue() == m_auxValue && item->get4JData() == m_4JDataValue) if(item != NULL && item->id == m_itemId && item->getAuxValue() == m_auxValue && item->get4JData() == m_4JDataValue)
@ -94,7 +94,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<It
if(rule->getConnection() != NULL) if(rule->getConnection() != NULL)
{ {
rule->getConnection()->send( std::shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0))); rule->getConnection()->send( shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0)));
} }
} }
} }
@ -102,7 +102,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<It
return statusChanged; return statusChanged;
} }
wstring CollectItemRuleDefinition::generateXml(std::shared_ptr<ItemInstance> item) wstring CollectItemRuleDefinition::generateXml(shared_ptr<ItemInstance> item)
{ {
// 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd // 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd
wstring xml = L""; wstring xml = L"";

View file

@ -31,9 +31,9 @@ public:
void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item); bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item);
static wstring generateXml(std::shared_ptr<ItemInstance> item); static wstring generateXml(shared_ptr<ItemInstance> item);
private: private:
//static wstring generateXml(CollectItemRuleDefinition *ruleDef); //static wstring generateXml(CollectItemRuleDefinition *ruleDef);

View file

@ -17,7 +17,7 @@ bool CompleteAllRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, int
return statusChanged; return statusChanged;
} }
bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item) bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item)
{ {
bool statusChanged = CompoundGameRuleDefinition::onCollectItem(rule,item); bool statusChanged = CompoundGameRuleDefinition::onCollectItem(rule,item);
if(statusChanged) updateStatus(rule); if(statusChanged) updateStatus(rule);
@ -51,7 +51,7 @@ void CompleteAllRuleDefinition::updateStatus(GameRule *rule)
auxValue = m_lastRuleStatusChanged->getAuxValue(); auxValue = m_lastRuleStatusChanged->getAuxValue();
m_lastRuleStatusChanged = NULL; m_lastRuleStatusChanged = NULL;
} }
rule->getConnection()->send( std::shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData)))); rule->getConnection()->send( shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData))));
} }
app.DebugPrintf("Updated CompleteAllRule - Completed %d of %d\n", progress, goal); app.DebugPrintf("Updated CompleteAllRule - Completed %d of %d\n", progress, goal);
} }

View file

@ -17,7 +17,7 @@ public:
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(vector<GameRuleDefinition *> *children);
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item); virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item);
static wstring generateDescriptionString(const wstring &description, void *data, int dataLength); static wstring generateDescriptionString(const wstring &description, void *data, int dataLength);

View file

@ -91,7 +91,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, in
return statusChanged; return statusChanged;
} }
bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item) bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item)
{ {
bool statusChanged = false; bool statusChanged = false;
for(AUTO_VAR(it, rule->m_parameters.begin()); it != rule->m_parameters.end(); ++it) for(AUTO_VAR(it, rule->m_parameters.begin()); it != rule->m_parameters.end(); ++it)
@ -109,7 +109,7 @@ bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<I
return statusChanged; return statusChanged;
} }
void CompoundGameRuleDefinition::postProcessPlayer(std::shared_ptr<Player> player) void CompoundGameRuleDefinition::postProcessPlayer(shared_ptr<Player> player)
{ {
for(AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) for(AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it)
{ {

View file

@ -18,6 +18,6 @@ public:
virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item); virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item);
virtual void postProcessPlayer(std::shared_ptr<Player> player); virtual void postProcessPlayer(shared_ptr<Player> player);
}; };

View file

@ -116,7 +116,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
for (int i = 0; i < tileEntityTags->size(); i++) for (int i = 0; i < tileEntityTags->size(); i++)
{ {
CompoundTag *teTag = tileEntityTags->get(i); CompoundTag *teTag = tileEntityTags->get(i);
std::shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag); shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag);
if(te == NULL) if(te == NULL)
{ {
@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
delete tag; delete tag;
} }
int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
{ {
int xStart = max(destinationBox->x0, (double)chunk->x*16); int xStart = max(destinationBox->x0, (double)chunk->x*16);
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
@ -323,7 +323,7 @@ int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
// At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so // At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so
// we can do the sort of lighting that might propagate out of the chunk. // we can do the sort of lighting that might propagate out of the chunk.
int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) __int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
{ {
int xStart = max(destinationBox->x0, (double)chunk->x*16); int xStart = max(destinationBox->x0, (double)chunk->x*16);
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
@ -433,7 +433,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
{ {
for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it) for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it)
{ {
std::shared_ptr<TileEntity> te = *it; shared_ptr<TileEntity> te = *it;
double targetX = te->x; double targetX = te->x;
double targetY = te->y + destinationBox->y0; double targetY = te->y + destinationBox->y0;
@ -444,7 +444,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ); Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ);
if( chunkBox->containsIncludingLowerBound(pos) ) if( chunkBox->containsIncludingLowerBound(pos) )
{ {
std::shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 ); shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
if ( teCopy != NULL ) if ( teCopy != NULL )
{ {
@ -495,11 +495,11 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
} }
CompoundTag *eTag = it->second; CompoundTag *eTag = it->second;
std::shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL); shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL);
if( e->GetType() == eTYPE_PAINTING ) if( e->GetType() == eTYPE_PAINTING )
{ {
std::shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e); shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
double tileX = painting->xTile; double tileX = painting->xTile;
double tileZ = painting->zTile; double tileZ = painting->zTile;
@ -512,7 +512,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
} }
else if( e->GetType() == eTYPE_ITEM_FRAME ) else if( e->GetType() == eTYPE_ITEM_FRAME )
{ {
std::shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e); shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
double tileX = frame->xTile; double tileX = frame->xTile;
double tileZ = frame->zTile; double tileZ = frame->zTile;
@ -678,12 +678,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
{ {
for (int zc = zc0; zc <= zc1; zc++) for (int zc = zc0; zc <= zc1; zc++)
{ {
vector<std::shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize); vector<shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize);
for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it) for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it)
{ {
std::shared_ptr<TileEntity> te = *it; shared_ptr<TileEntity> te = *it;
CompoundTag *teTag = new CompoundTag(); CompoundTag *teTag = new CompoundTag();
std::shared_ptr<TileEntity> teCopy = te->clone(); shared_ptr<TileEntity> teCopy = te->clone();
// Adjust the tileEntity position to schematic coords from world co-ords // Adjust the tileEntity position to schematic coords from world co-ords
teCopy->x -= xStart; teCopy->x -= xStart;
@ -698,12 +698,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
tag.put(L"TileEntities", tileEntitiesTag); tag.put(L"TileEntities", tileEntitiesTag);
AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd); AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd);
vector<std::shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb); vector<shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb);
ListTag<CompoundTag> *entitiesTag = new ListTag<CompoundTag>(L"entities"); ListTag<CompoundTag> *entitiesTag = new ListTag<CompoundTag>(L"entities");
for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it)
{ {
std::shared_ptr<Entity> e = *it; shared_ptr<Entity> e = *it;
bool mobCanBeSaved = false; bool mobCanBeSaved = false;
if(bSaveMobs) if(bSaveMobs)
@ -1005,12 +1005,12 @@ void ConsoleSchematicFile::setBlocksAndData(LevelChunk *chunk, byteArray blockDa
} }
} }
vector<std::shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1) vector<shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1)
{ {
vector<std::shared_ptr<TileEntity> > *result = new vector<std::shared_ptr<TileEntity> >; vector<shared_ptr<TileEntity> > *result = new vector<shared_ptr<TileEntity> >;
for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it) for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it)
{ {
std::shared_ptr<TileEntity> te = it->second; shared_ptr<TileEntity> te = it->second;
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1) if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1)
{ {
result->push_back(te); result->push_back(te);

View file

@ -55,7 +55,7 @@ public:
} XboxSchematicInitParam; } XboxSchematicInitParam;
private: private:
int m_xSize, m_ySize, m_zSize; int m_xSize, m_ySize, m_zSize;
vector<std::shared_ptr<TileEntity> > m_tileEntities; vector<shared_ptr<TileEntity> > m_tileEntities;
vector< pair<Vec3 *, CompoundTag *> > m_entities; vector< pair<Vec3 *, CompoundTag *> > m_entities;
public: public:
@ -72,8 +72,8 @@ public:
void save(DataOutputStream *dos); void save(DataOutputStream *dos);
void load(DataInputStream *dis); void load(DataInputStream *dis);
int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); __int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); __int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes); static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes);
@ -83,7 +83,7 @@ private:
void load_tags(DataInputStream *dis); void load_tags(DataInputStream *dis);
static void getBlocksAndData(LevelChunk *chunk, byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int &blocksP, int &dataP, int &blockLightP, int &skyLightP); static void getBlocksAndData(LevelChunk *chunk, byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int &blocksP, int &dataP, int &blockLightP, int &skyLightP);
static vector<std::shared_ptr<TileEntity> > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1); static vector<shared_ptr<TileEntity> > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1);
void chunkCoordToSchematicCoord(AABB *destinationBox, int chunkX, int chunkZ, ESchematicRotation rot, int &schematicX, int &schematicZ); void chunkCoordToSchematicCoord(AABB *destinationBox, int chunkX, int chunkZ, ESchematicRotation rot, int &schematicX, int &schematicZ);
void schematicCoordToChunkCoord(AABB *destinationBox, double schematicX, double schematicZ, ESchematicRotation rot, double &chunkX, double &chunkZ); void schematicCoordToChunkCoord(AABB *destinationBox, double schematicX, double schematicZ, ESchematicRotation rot, double &chunkX, double &chunkZ);

View file

@ -53,7 +53,7 @@ GameRuleDefinition *GameRule::getGameRuleDefinition()
} }
void GameRule::onUseTile(int tileId, int x, int y, int z) { m_definition->onUseTile(this,tileId,x,y,z); } void GameRule::onUseTile(int tileId, int x, int y, int z) { m_definition->onUseTile(this,tileId,x,y,z); }
void GameRule::onCollectItem(std::shared_ptr<ItemInstance> item) { m_definition->onCollectItem(this,item); } void GameRule::onCollectItem(shared_ptr<ItemInstance> item) { m_definition->onCollectItem(this,item); }
void GameRule::write(DataOutputStream *dos) void GameRule::write(DataOutputStream *dos)
{ {

View file

@ -14,7 +14,7 @@ public:
typedef struct _ValueType typedef struct _ValueType
{ {
union{ union{
int64_t i64; __int64 i64;
int i; int i;
char c; char c;
bool b; bool b;
@ -51,7 +51,7 @@ public:
// All the hooks go here // All the hooks go here
void onUseTile(int tileId, int x, int y, int z); void onUseTile(int tileId, int x, int y, int z);
void onCollectItem(std::shared_ptr<ItemInstance> item); void onCollectItem(shared_ptr<ItemInstance> item);
// 4J-JEV: For saving. // 4J-JEV: For saving.
//CompoundTag *toTags(unordered_map<GameRuleDefinition *, int> *map); //CompoundTag *toTags(unordered_map<GameRuleDefinition *, int> *map);

View file

@ -53,8 +53,8 @@ public:
// Here we should have functions for all the hooks, with a GameRule* as the first parameter // Here we should have functions for all the hooks, with a GameRule* as the first parameter
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z) { return false; } virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z) { return false; }
virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item) { return false; } virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item) { return false; }
virtual void postProcessPlayer(std::shared_ptr<Player> player) { } virtual void postProcessPlayer(shared_ptr<Player> player) { }
vector<GameRuleDefinition *> *enumerate(); vector<GameRuleDefinition *> *enumerate();
unordered_map<GameRuleDefinition *, int> *enumerateMap(); unordered_map<GameRuleDefinition *, int> *enumerateMap();

View file

@ -391,7 +391,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
// Read File. // Read File.
// version_number // version_number
int64_t version = dis.readShort(); __int64 version = dis.readShort();
unsigned char compressionType = 0; unsigned char compressionType = 0;
if(version == 0) if(version == 0)
{ {

View file

@ -162,7 +162,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
{ {
if(attributeName.compare(L"seed") == 0) if(attributeName.compare(L"seed") == 0)
{ {
m_seed = _fromString<int64_t>(attributeValue); m_seed = _fromString<__int64>(attributeValue);
app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed); app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed);
} }
else if(attributeName.compare(L"spawnX") == 0) else if(attributeName.compare(L"spawnX") == 0)
@ -505,7 +505,7 @@ void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete
bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; } bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; }
void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; } void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; }
int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; } __int64 LevelGenerationOptions::getLevelSeed() { return m_seed; }
Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; } Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; }
bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; } bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; }

View file

@ -146,7 +146,7 @@ public:
private: private:
// This should match the "MapOptionsRule" definition in the XML schema // This should match the "MapOptionsRule" definition in the XML schema
int64_t m_seed; __int64 m_seed;
bool m_useFlatWorld; bool m_useFlatWorld;
Pos *m_spawnPos; Pos *m_spawnPos;
vector<ApplySchematicRuleDefinition *> m_schematicRules; vector<ApplySchematicRuleDefinition *> m_schematicRules;
@ -173,7 +173,7 @@ public:
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
int64_t getLevelSeed(); __int64 getLevelSeed();
Pos *getSpawnPos(); Pos *getSpawnPos();
bool getuseFlatWorld(); bool getuseFlatWorld();

View file

@ -130,7 +130,7 @@ void UpdatePlayerRuleDefinition::addAttribute(const wstring &attributeName, cons
} }
} }
void UpdatePlayerRuleDefinition::postProcessPlayer(std::shared_ptr<Player> player) void UpdatePlayerRuleDefinition::postProcessPlayer(shared_ptr<Player> player)
{ {
if(m_bUpdateHealth) if(m_bUpdateHealth)
{ {

View file

@ -29,5 +29,5 @@ public:
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
virtual void postProcessPlayer(std::shared_ptr<Player> player); virtual void postProcessPlayer(shared_ptr<Player> player);
}; };

View file

@ -78,7 +78,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(StructurePiece *st
} }
level->setTile( worldX, worldY, worldZ, m_tile ); level->setTile( worldX, worldY, worldZ, m_tile );
std::shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ )); shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ ));
app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ); app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ);
if ( container != NULL ) if ( container != NULL )

View file

@ -54,7 +54,7 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(StructurePiece *struct
} }
level->setTile( worldX, worldY, worldZ, m_tile ); level->setTile( worldX, worldY, worldZ, m_tile );
std::shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ )); shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ ));
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ); wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ);

View file

@ -44,8 +44,8 @@
CGameNetworkManager g_NetworkManager; CGameNetworkManager g_NetworkManager;
CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager; CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager;
int64_t CGameNetworkManager::messageQueue[512]; __int64 CGameNetworkManager::messageQueue[512];
int64_t CGameNetworkManager::byteQueue[512]; __int64 CGameNetworkManager::byteQueue[512];
int CGameNetworkManager::messageQueuePos = 0; int CGameNetworkManager::messageQueuePos = 0;
CGameNetworkManager::CGameNetworkManager() CGameNetworkManager::CGameNetworkManager()
@ -188,7 +188,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
ProfileManager.SetDeferredSignoutEnabled(true); ProfileManager.SetDeferredSignoutEnabled(true);
#endif #endif
int64_t seed = 0; __int64 seed = 0;
if(lpParameter != NULL) if(lpParameter != NULL)
{ {
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
@ -209,7 +209,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
} }
} }
static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
ServerStoppedCreate(false); ServerStoppedCreate(false);
if( g_NetworkManager.IsHost() ) if( g_NetworkManager.IsHost() )
{ {
@ -316,7 +316,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
return false; return false;
} }
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) ); connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
// Tick connection until we're ready to go. The stages involved in this are: // Tick connection until we're ready to go. The stages involved in this are:
// (1) Creating the ClientConnection sends a prelogin packet to the server // (1) Creating the ClientConnection sends a prelogin packet to the server
@ -403,7 +403,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
// Open the socket on the server end to accept incoming data // Open the socket on the server end to accept incoming data
Socket::addIncomingSocket(socket); Socket::addIncomingSocket(socket);
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) ); connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) );
createdConnections.push_back( connection ); createdConnections.push_back( connection );
@ -850,7 +850,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
int CGameNetworkManager::ServerThreadProc( void* lpParameter ) int CGameNetworkManager::ServerThreadProc( void* lpParameter )
{ {
int64_t seed = 0; __int64 seed = 0;
if(lpParameter != NULL) if(lpParameter != NULL)
{ {
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
@ -1134,7 +1134,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
PlayerList *players = pServer->getPlayers(); PlayerList *players = pServer->getPlayers();
for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it) for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it)
{ {
std::shared_ptr<ServerPlayer> servPlayer = *it; shared_ptr<ServerPlayer> servPlayer = *it;
if( servPlayer->connection->isLocal() && !servPlayer->connection->isGuest() ) if( servPlayer->connection->isLocal() && !servPlayer->connection->isGuest() )
{ {
servPlayer->connection->connection->getSocket()->setPlayer(NULL); servPlayer->connection->connection->getSocket()->setPlayer(NULL);
@ -1202,7 +1202,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
PlayerList *players = pServer->getPlayers(); PlayerList *players = pServer->getPlayers();
for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it) for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it)
{ {
std::shared_ptr<ServerPlayer> servPlayer = *it; shared_ptr<ServerPlayer> servPlayer = *it;
if( servPlayer->getXuid() == localPlayerXuid ) if( servPlayer->getXuid() == localPlayerXuid )
{ {
servPlayer->connection->connection->getSocket()->setPlayer( g_NetworkManager.GetLocalPlayerByUserIndex(index) ); servPlayer->connection->connection->getSocket()->setPlayer( g_NetworkManager.GetLocalPlayerByUserIndex(index) );
@ -1391,7 +1391,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
Socket *socket = NULL; Socket *socket = NULL;
std::shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()]; shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL) if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
{ {
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change // If we already have a MultiplayerLocalPlayer here then we are doing a session type change
@ -1428,7 +1428,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
if( connection->createdOk ) if( connection->createdOk )
{ {
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) ); connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) );
pMinecraft->addPendingLocalConnection(idx, connection); pMinecraft->addPendingLocalConnection(idx, connection);
} }
else else

View file

@ -163,9 +163,9 @@ public:
// Used for debugging output // Used for debugging output
static const int messageQueue_length = 512; static const int messageQueue_length = 512;
static int64_t messageQueue[messageQueue_length]; static __int64 messageQueue[messageQueue_length];
static const int byteQueue_length = 512; static const int byteQueue_length = 512;
static int64_t byteQueue[byteQueue_length]; static __int64 byteQueue[byteQueue_length];
static int messageQueuePos; static int messageQueuePos;
// Methods called from PlatformNetworkManager // Methods called from PlatformNetworkManager

View file

@ -161,7 +161,7 @@ ESavePlatform SonyRemoteStorage::getSavePlatform()
} }
int64_t SonyRemoteStorage::getSaveSeed() __int64 SonyRemoteStorage::getSaveSeed()
{ {
if(m_getInfoStatus != e_infoFound) if(m_getInfoStatus != e_infoFound)
return 0; return 0;
@ -171,7 +171,7 @@ int64_t SonyRemoteStorage::getSaveSeed()
ZeroMemory(seedString,17); ZeroMemory(seedString,17);
memcpy(seedString, pDescData->m_seed,16); memcpy(seedString, pDescData->m_seed,16);
uint64_t seed = 0; __uint64 seed = 0;
std::stringstream ss; std::stringstream ss;
ss << seedString; ss << seedString;
ss >> std::hex >> seed; ss >> std::hex >> seed;
@ -294,7 +294,7 @@ bool SonyRemoteStorage::saveIsAvailable()
int SonyRemoteStorage::getDataProgress() int SonyRemoteStorage::getDataProgress()
{ {
int64_t time = System::currentTimeMillis(); __int64 time = System::currentTimeMillis();
int elapsedSecs = (time - m_startTime) / 1000; int elapsedSecs = (time - m_startTime) / 1000;
int progVal = m_dataProgress + (elapsedSecs/3); int progVal = m_dataProgress + (elapsedSecs/3);
if(progVal > 95) if(progVal > 95)

View file

@ -72,7 +72,7 @@ public:
const char* getLocalFilename(); const char* getLocalFilename();
const char* getSaveNameUTF8(); const char* getSaveNameUTF8();
ESavePlatform getSavePlatform(); ESavePlatform getSavePlatform();
int64_t getSaveSeed(); __int64 getSaveSeed();
unsigned int getSaveHostOptions(); unsigned int getSaveHostOptions();
unsigned int getSaveTexturePack(); unsigned int getSaveTexturePack();
@ -111,7 +111,7 @@ protected:
unsigned int m_thumbnailDataSize; unsigned int m_thumbnailDataSize;
C4JThread* m_SetDataThread; C4JThread* m_SetDataThread;
PSAVE_INFO m_setDataSaveInfo; PSAVE_INFO m_setDataSaveInfo;
int64_t m_startTime; __int64 m_startTime;
bool m_bAborting; bool m_bAborting;
bool m_bTransferStarted; bool m_bTransferStarted;

View file

@ -60,10 +60,10 @@ void ChangeStateConstraint::tick(int iPad)
{ {
// Send update settings packet to server // Send update settings packet to server
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad]; shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
{ {
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
} }
} }
} }
@ -101,10 +101,10 @@ void ChangeStateConstraint::tick(int iPad)
{ {
// Send update settings packet to server // Send update settings packet to server
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad]; shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
{ {
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
} }
} }
} }
@ -125,10 +125,10 @@ void ChangeStateConstraint::tick(int iPad)
{ {
// Send update settings packet to server // Send update settings packet to server
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad]; shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
{ {
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
} }
} }
} }

View file

@ -23,7 +23,7 @@ bool CompleteUsingItemTask::isCompleted()
return bIsCompleted; return bIsCompleted;
} }
void CompleteUsingItemTask::completeUsingItem(std::shared_ptr<ItemInstance> item) void CompleteUsingItemTask::completeUsingItem(shared_ptr<ItemInstance> item)
{ {
if(!hasBeenActivated() && !isPreCompletionEnabled()) return; if(!hasBeenActivated() && !isPreCompletionEnabled()) return;
for(int i=0;i<m_iValidItemsCount;i++) for(int i=0;i<m_iValidItemsCount;i++)

View file

@ -16,5 +16,5 @@ public:
CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion = false); CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion = false);
virtual ~CompleteUsingItemTask(); virtual ~CompleteUsingItemTask();
virtual bool isCompleted(); virtual bool isCompleted();
virtual void completeUsingItem(std::shared_ptr<ItemInstance> item); virtual void completeUsingItem(shared_ptr<ItemInstance> item);
}; };

View file

@ -40,7 +40,7 @@ CraftTask::~CraftTask()
delete[] m_auxValues; delete[] m_auxValues;
} }
void CraftTask::onCrafted(std::shared_ptr<ItemInstance> item) void CraftTask::onCrafted(shared_ptr<ItemInstance> item)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"CraftTask::onCrafted - %ls\n", item->toString().c_str() ); wprintf(L"CraftTask::onCrafted - %ls\n", item->toString().c_str() );

View file

@ -14,7 +14,7 @@ public:
~CraftTask(); ~CraftTask();
virtual bool isCompleted() { return bIsCompleted; } virtual bool isCompleted() { return bIsCompleted; }
virtual void onCrafted(std::shared_ptr<ItemInstance> item); virtual void onCrafted(shared_ptr<ItemInstance> item);
private: private:
int *m_items; int *m_items;

View file

@ -20,7 +20,7 @@ DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descri
tutorial->addMessage(IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL, true); tutorial->addMessage(IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL, true);
} }
int DiggerItemHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile) int DiggerItemHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
{ {
if(item != NULL) if(item != NULL)
{ {
@ -46,7 +46,7 @@ int DiggerItemHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *
return -1; return -1;
} }
int DiggerItemHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity) int DiggerItemHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
{ {
if(item != NULL) if(item != NULL)
{ {

View file

@ -13,6 +13,6 @@ private:
public: public:
DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, int items[], unsigned int itemsLength); DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, int items[], unsigned int itemsLength);
virtual int startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile); virtual int startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
virtual int attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity); virtual int attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity);
}; };

View file

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "PickupTask.h" #include "PickupTask.h"
void PickupTask::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) void PickupTask::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
{ {
if(item->id == m_itemId) if(item->id == m_itemId)
{ {

View file

@ -17,7 +17,7 @@ public:
{} {}
virtual bool isCompleted() { return bIsCompleted; } virtual bool isCompleted() { return bIsCompleted; }
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
private: private:
int m_itemId; int m_itemId;

View file

@ -111,7 +111,7 @@ bool ProcedureCompoundTask::isCompleted()
return allCompleted; return allCompleted;
} }
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item) void ProcedureCompoundTask::onCrafted(shared_ptr<ItemInstance> item)
{ {
AUTO_VAR(itEnd, m_taskSequence.end()); AUTO_VAR(itEnd, m_taskSequence.end());
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
@ -222,7 +222,7 @@ bool ProcedureCompoundTask::AllowFade()
return allowFade; return allowFade;
} }
void ProcedureCompoundTask::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly) void ProcedureCompoundTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
{ {
AUTO_VAR(itEnd, m_taskSequence.end()); AUTO_VAR(itEnd, m_taskSequence.end());
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
@ -232,7 +232,7 @@ void ProcedureCompoundTask::useItemOn(Level *level, std::shared_ptr<ItemInstance
} }
} }
void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly) void ProcedureCompoundTask::useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly)
{ {
AUTO_VAR(itEnd, m_taskSequence.end()); AUTO_VAR(itEnd, m_taskSequence.end());
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
@ -242,7 +242,7 @@ void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item, bool bTe
} }
} }
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) void ProcedureCompoundTask::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
{ {
AUTO_VAR(itEnd, m_taskSequence.end()); AUTO_VAR(itEnd, m_taskSequence.end());
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)

View file

@ -18,7 +18,7 @@ public:
virtual int getDescriptionId(); virtual int getDescriptionId();
virtual int getPromptId(); virtual int getPromptId();
virtual bool isCompleted(); virtual bool isCompleted();
virtual void onCrafted(std::shared_ptr<ItemInstance> item); virtual void onCrafted(shared_ptr<ItemInstance> item);
virtual void handleUIInput(int iAction); virtual void handleUIInput(int iAction);
virtual void setAsCurrentTask(bool active = true); virtual void setAsCurrentTask(bool active = true);
virtual bool ShowMinimumTime(); virtual bool ShowMinimumTime();
@ -26,9 +26,9 @@ public:
virtual void setShownForMinimumTime(); virtual void setShownForMinimumTime();
virtual bool AllowFade(); virtual bool AllowFade();
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false); virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
virtual void useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false); virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
virtual void onStateChange(eTutorial_State newState); virtual void onStateChange(eTutorial_State newState);
private: private:

View file

@ -17,7 +17,7 @@ TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], u
} }
} }
bool TakeItemHint::onTake(std::shared_ptr<ItemInstance> item) bool TakeItemHint::onTake(shared_ptr<ItemInstance> item)
{ {
if(item != NULL) if(item != NULL)
{ {

View file

@ -15,5 +15,5 @@ public:
TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength); TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength);
~TakeItemHint(); ~TakeItemHint();
virtual bool onTake( std::shared_ptr<ItemInstance> item ); virtual bool onTake( shared_ptr<ItemInstance> item );
}; };

View file

@ -1208,7 +1208,7 @@ void Tutorial::tick()
} }
else if(m_freezeTime && m_timeFrozen && m_fullTutorialComplete) else if(m_freezeTime && m_timeFrozen && m_fullTutorialComplete)
{ {
int64_t currentTime = pMinecraft->level->getTime(); __int64 currentTime = pMinecraft->level->getTime();
int currentDayTime = (currentTime % Level::TICKS_PER_DAY); int currentDayTime = (currentTime % Level::TICKS_PER_DAY);
int timeToAdd = 0; int timeToAdd = 0;
if(currentDayTime > m_iTutorialFreezeTimeValue) if(currentDayTime > m_iTutorialFreezeTimeValue)
@ -1219,7 +1219,7 @@ void Tutorial::tick()
{ {
timeToAdd = m_iTutorialFreezeTimeValue - currentDayTime; timeToAdd = m_iTutorialFreezeTimeValue - currentDayTime;
} }
int64_t targetTime = currentTime + timeToAdd; __int64 targetTime = currentTime + timeToAdd;
MinecraftServer::SetTimeOfDay(-1); MinecraftServer::SetTimeOfDay(-1);
MinecraftServer::SetTime(targetTime); MinecraftServer::SetTime(targetTime);
pMinecraft->level->setOverrideTimeOfDay(-1); pMinecraft->level->setOverrideTimeOfDay(-1);
@ -1681,7 +1681,7 @@ void Tutorial::showTutorialPopup(bool show)
} }
} }
void Tutorial::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly) void Tutorial::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly)
{ {
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it) for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
{ {
@ -1690,7 +1690,7 @@ void Tutorial::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x
} }
} }
void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly) void Tutorial::useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly)
{ {
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it) for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
{ {
@ -1699,7 +1699,7 @@ void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly)
} }
} }
void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) void Tutorial::completeUsingItem(shared_ptr<ItemInstance> item)
{ {
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it) for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
{ {
@ -1718,7 +1718,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item)
} }
} }
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile) void Tutorial::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
{ {
int hintNeeded = -1; int hintNeeded = -1;
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
@ -1754,7 +1754,7 @@ void Tutorial::destroyBlock(Tile *tile)
} }
} }
void Tutorial::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity) void Tutorial::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
{ {
int hintNeeded = -1; int hintNeeded = -1;
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
@ -1772,7 +1772,7 @@ void Tutorial::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> en
} }
} }
void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) void Tutorial::itemDamaged(shared_ptr<ItemInstance> item)
{ {
int hintNeeded = -1; int hintNeeded = -1;
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
@ -1803,7 +1803,7 @@ void Tutorial::handleUIInput(int iAction)
currentTask[m_CurrentState]->handleUIInput(iAction); currentTask[m_CurrentState]->handleUIInput(iAction);
} }
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake) void Tutorial::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
{ {
int hintNeeded = -1; int hintNeeded = -1;
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
@ -1821,7 +1821,7 @@ void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMa
} }
} }
void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item) void Tutorial::onCrafted(shared_ptr<ItemInstance> item)
{ {
for(unsigned int state = 0; state < e_Tutorial_State_Max; ++state) for(unsigned int state = 0; state < e_Tutorial_State_Max; ++state)
{ {
@ -1833,7 +1833,7 @@ void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item)
} }
} }
void Tutorial::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) void Tutorial::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
{ {
if( !m_hintDisplayed ) if( !m_hintDisplayed )
{ {
@ -1860,7 +1860,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCo
} }
} }
void Tutorial::onSelectedItemChanged(std::shared_ptr<ItemInstance> item) void Tutorial::onSelectedItemChanged(shared_ptr<ItemInstance> item)
{ {
// We only handle this if we are in a state that allows changing based on the selected item // We only handle this if we are in a state that allows changing based on the selected item
// Menus and states like riding in a minecart will NOT allow this // Menus and states like riding in a minecart will NOT allow this

View file

@ -151,19 +151,19 @@ public:
void showTutorialPopup(bool show); void showTutorialPopup(bool show);
void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly=false); void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly=false);
void useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false); void useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
void completeUsingItem(std::shared_ptr<ItemInstance> item); void completeUsingItem(shared_ptr<ItemInstance> item);
void startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile); void startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
void destroyBlock(Tile *tile); void destroyBlock(Tile *tile);
void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity); void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
void itemDamaged(std::shared_ptr<ItemInstance> item); void itemDamaged(shared_ptr<ItemInstance> item);
void handleUIInput(int iAction); void handleUIInput(int iAction);
void createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake); void createItemSelected(shared_ptr<ItemInstance> item, bool canMake);
void onCrafted(std::shared_ptr<ItemInstance> item); void onCrafted(shared_ptr<ItemInstance> item);
void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
void onSelectedItemChanged(std::shared_ptr<ItemInstance> item); void onSelectedItemChanged(shared_ptr<ItemInstance> item);
void onLookAt(int id, int iData=0); void onLookAt(int id, int iData=0);
void onLookAtEntity(eINSTANCEOF type); void onLookAtEntity(eINSTANCEOF type);
void onEffectChanged(MobEffect *effect, bool bRemoved=false); void onEffectChanged(MobEffect *effect, bool bRemoved=false);

View file

@ -14,7 +14,7 @@ TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptio
tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients); tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients);
} }
int TutorialHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile) int TutorialHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
{ {
int returnVal = -1; int returnVal = -1;
switch(m_type) switch(m_type)
@ -59,7 +59,7 @@ int TutorialHint::destroyBlock(Tile *tile)
return returnVal; return returnVal;
} }
int TutorialHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity) int TutorialHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
{ {
/* /*
switch(m_type) switch(m_type)
@ -71,7 +71,7 @@ int TutorialHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Ent
return -1; return -1;
} }
int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake) int TutorialHint::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
{ {
int returnVal = -1; int returnVal = -1;
switch(m_type) switch(m_type)
@ -86,7 +86,7 @@ int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item, bool ca
return returnVal; return returnVal;
} }
int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item) int TutorialHint::itemDamaged(shared_ptr<ItemInstance> item)
{ {
int returnVal = -1; int returnVal = -1;
switch(m_type) switch(m_type)
@ -100,7 +100,7 @@ int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item)
return returnVal; return returnVal;
} }
bool TutorialHint::onTake( std::shared_ptr<ItemInstance> item ) bool TutorialHint::onTake( shared_ptr<ItemInstance> item )
{ {
return false; return false;
} }

View file

@ -40,12 +40,12 @@ public:
eTutorial_Hint getId() { return m_id; } eTutorial_Hint getId() { return m_id; }
virtual int startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile); virtual int startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
virtual int destroyBlock(Tile *tile); virtual int destroyBlock(Tile *tile);
virtual int attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity); virtual int attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity);
virtual int createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake); virtual int createItemSelected(shared_ptr<ItemInstance> item, bool canMake);
virtual int itemDamaged(std::shared_ptr<ItemInstance> item); virtual int itemDamaged(shared_ptr<ItemInstance> item);
virtual bool onTake( std::shared_ptr<ItemInstance> item ); virtual bool onTake( shared_ptr<ItemInstance> item );
virtual bool onLookAt(int id, int iData=0); virtual bool onLookAt(int id, int iData=0);
virtual bool onLookAtEntity(eINSTANCEOF type); virtual bool onLookAtEntity(eINSTANCEOF type);
virtual int tick(); virtual int tick();

View file

@ -36,7 +36,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face)
int t = minecraft->level->getTile(x, y, z); int t = minecraft->level->getTile(x, y, z);
tutorial->destroyBlock(Tile::tiles[t]); tutorial->destroyBlock(Tile::tiles[t]);
} }
std::shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem(); shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
int damageBefore; int damageBefore;
if(item != NULL) if(item != NULL)
{ {
@ -78,7 +78,7 @@ void TutorialMode::tick()
*/ */
} }
bool TutorialMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem) bool TutorialMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem)
{ {
bool haveItem = false; bool haveItem = false;
int itemCount = 0; int itemCount = 0;
@ -110,7 +110,7 @@ bool TutorialMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::
return result; return result;
} }
void TutorialMode::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity) void TutorialMode::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
{ {
if(!tutorial->m_allTutorialsComplete) if(!tutorial->m_allTutorialsComplete)
tutorial->attack(player, entity); tutorial->attack(player, entity);

View file

@ -19,8 +19,8 @@ public:
virtual void startDestroyBlock(int x, int y, int z, int face); virtual void startDestroyBlock(int x, int y, int z, int face);
virtual bool destroyBlock(int x, int y, int z, int face); virtual bool destroyBlock(int x, int y, int z, int face);
virtual void tick(); virtual void tick();
virtual bool useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL); virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL);
virtual void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity); virtual void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
virtual bool isInputAllowed(int mapping); virtual bool isInputAllowed(int mapping);

View file

@ -52,12 +52,12 @@ public:
bool TaskReminders() { return m_bTaskReminders;} bool TaskReminders() { return m_bTaskReminders;}
virtual bool ShowMinimumTime() { return m_bShowMinimumTime;} virtual bool ShowMinimumTime() { return m_bShowMinimumTime;}
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { } virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { }
virtual void useItem(std::shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { } virtual void useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { }
virtual void completeUsingItem(std::shared_ptr<ItemInstance> item) { } virtual void completeUsingItem(shared_ptr<ItemInstance> item) { }
virtual void handleUIInput(int iAction) { } virtual void handleUIInput(int iAction) { }
virtual void onCrafted(std::shared_ptr<ItemInstance> item) { } virtual void onCrafted(shared_ptr<ItemInstance> item) { }
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { } virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { }
virtual void onStateChange(eTutorial_State newState) { } virtual void onStateChange(eTutorial_State newState) { }
virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { } virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { }
}; };

View file

@ -16,7 +16,7 @@ bool UseItemTask::isCompleted()
return bIsCompleted; return bIsCompleted;
} }
void UseItemTask::useItem(std::shared_ptr<ItemInstance> item,bool bTestUseOnly) void UseItemTask::useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly)
{ {
if(bTestUseOnly) return; if(bTestUseOnly) return;

View file

@ -16,5 +16,5 @@ public:
UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId, UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId,
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
virtual bool isCompleted(); virtual bool isCompleted();
virtual void useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false); virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
}; };

View file

@ -25,7 +25,7 @@ bool UseTileTask::isCompleted()
return bIsCompleted; return bIsCompleted;
} }
void UseTileTask::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly) void UseTileTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
{ {
if(bTestUseOnly) return; if(bTestUseOnly) return;

View file

@ -20,5 +20,5 @@ public:
UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId, UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId,
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true); bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true);
virtual bool isCompleted(); virtual bool isCompleted();
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false); virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
}; };

View file

@ -704,11 +704,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
// Determine appropriate context sensitive tool tips, based on what is carried on the pointer and what is under the pointer. // Determine appropriate context sensitive tool tips, based on what is carried on the pointer and what is under the pointer.
// What are we carrying on pointer. // What are we carrying on pointer.
std::shared_ptr<LocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()]; shared_ptr<LocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
std::shared_ptr<ItemInstance> carriedItem = nullptr; shared_ptr<ItemInstance> carriedItem = nullptr;
if(player != NULL) carriedItem = player->inventory->getCarried(); if(player != NULL) carriedItem = player->inventory->getCarried();
std::shared_ptr<ItemInstance> slotItem = nullptr; shared_ptr<ItemInstance> slotItem = nullptr;
Slot *slot = NULL; Slot *slot = NULL;
int slotIndex = 0; int slotIndex = 0;
if(bPointerIsOverSlot) if(bPointerIsOverSlot)
@ -889,7 +889,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if((eSectionUnderPointer==eSectionInventoryUsing)||(eSectionUnderPointer==eSectionInventoryInventory)) if((eSectionUnderPointer==eSectionInventoryUsing)||(eSectionUnderPointer==eSectionInventoryInventory))
{ {
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
ArmorRecipes::_eArmorType eArmourType=ArmorRecipes::GetArmorType(item->id); ArmorRecipes::_eArmorType eArmourType=ArmorRecipes::GetArmorType(item->id);
if(eArmourType==ArmorRecipes::eArmorType_None) if(eArmourType==ArmorRecipes::eArmorType_None)
@ -952,7 +952,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
else if((eSectionUnderPointer==eSectionFurnaceUsing)||(eSectionUnderPointer==eSectionFurnaceInventory)) else if((eSectionUnderPointer==eSectionFurnaceUsing)||(eSectionUnderPointer==eSectionFurnaceInventory))
{ {
// Get the info on this item. // Get the info on this item.
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
bool bValidFuel = FurnaceTileEntity::isFuel(item); bool bValidFuel = FurnaceTileEntity::isFuel(item);
bool bValidIngredient = FurnaceRecipes::getInstance()->getResult(item->getItem()->id) != NULL; bool bValidIngredient = FurnaceRecipes::getInstance()->getResult(item->getItem()->id) != NULL;
@ -962,7 +962,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if(!isSlotEmpty(eSectionFurnaceIngredient,0)) if(!isSlotEmpty(eSectionFurnaceIngredient,0))
{ {
// is it the same as this item // is it the same as this item
std::shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0); shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0);
if(IngredientItem->id == item->id) if(IngredientItem->id == item->id)
{ {
buttonY = eToolTipQuickMoveIngredient; buttonY = eToolTipQuickMoveIngredient;
@ -991,7 +991,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if(!isSlotEmpty(eSectionFurnaceFuel,0)) if(!isSlotEmpty(eSectionFurnaceFuel,0))
{ {
// is it the same as this item // is it the same as this item
std::shared_ptr<ItemInstance> fuelItem = getSlotItem(eSectionFurnaceFuel,0); shared_ptr<ItemInstance> fuelItem = getSlotItem(eSectionFurnaceFuel,0);
if(fuelItem->id == item->id) if(fuelItem->id == item->id)
{ {
buttonY = eToolTipQuickMoveFuel; buttonY = eToolTipQuickMoveFuel;
@ -1002,7 +1002,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if(!isSlotEmpty(eSectionFurnaceIngredient,0)) if(!isSlotEmpty(eSectionFurnaceIngredient,0))
{ {
// is it the same as this item // is it the same as this item
std::shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0); shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0);
if(IngredientItem->id == item->id) if(IngredientItem->id == item->id)
{ {
buttonY = eToolTipQuickMoveIngredient; buttonY = eToolTipQuickMoveIngredient;
@ -1044,7 +1044,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
else if((eSectionUnderPointer==eSectionBrewingUsing)||(eSectionUnderPointer==eSectionBrewingInventory)) else if((eSectionUnderPointer==eSectionBrewingUsing)||(eSectionUnderPointer==eSectionBrewingInventory))
{ {
// Get the info on this item. // Get the info on this item.
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
int iId=item->id; int iId=item->id;
// valid ingredient? // valid ingredient?
@ -1062,7 +1062,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if(!isSlotEmpty(eSectionBrewingIngredient,0)) if(!isSlotEmpty(eSectionBrewingIngredient,0))
{ {
// is it the same as this item // is it the same as this item
std::shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionBrewingIngredient,0); shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionBrewingIngredient,0);
if(IngredientItem->id == item->id) if(IngredientItem->id == item->id)
{ {
buttonY = eToolTipQuickMoveIngredient; buttonY = eToolTipQuickMoveIngredient;
@ -1104,7 +1104,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
else if((eSectionUnderPointer==eSectionEnchantUsing)||(eSectionUnderPointer==eSectionEnchantInventory)) else if((eSectionUnderPointer==eSectionEnchantUsing)||(eSectionUnderPointer==eSectionEnchantInventory))
{ {
// Get the info on this item. // Get the info on this item.
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
int iId=item->id; int iId=item->id;
// valid enchantable tool? // valid enchantable tool?
@ -1199,7 +1199,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
SetPointerOutsideMenu( false ); SetPointerOutsideMenu( false );
} }
std::shared_ptr<ItemInstance> item = nullptr; shared_ptr<ItemInstance> item = nullptr;
if(bPointerIsOverSlot && bSlotHasItem) item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); if(bPointerIsOverSlot && bSlotHasItem) item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
overrideTooltips(eSectionUnderPointer, item, bIsItemCarried, bSlotHasItem, bCarriedIsSameAsSlot, iSlotStackSizeRemaining, buttonA, buttonX, buttonY, buttonRT); overrideTooltips(eSectionUnderPointer, item, bIsItemCarried, bSlotHasItem, bCarriedIsSameAsSlot, iSlotStackSizeRemaining, buttonA, buttonX, buttonY, buttonRT);
@ -1410,7 +1410,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex); bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex);
if ( bSlotHasItem ) if ( bSlotHasItem )
{ {
std::shared_ptr<ItemInstance> item = getSlotItem(m_eCurrSection, currentIndex); shared_ptr<ItemInstance> item = getSlotItem(m_eCurrSection, currentIndex);
if( Minecraft::GetInstance()->localgameModes[iPad] != NULL ) if( Minecraft::GetInstance()->localgameModes[iPad] != NULL )
{ {
Tutorial::PopupMessageDetails *message = new Tutorial::PopupMessageDetails; Tutorial::PopupMessageDetails *message = new Tutorial::PopupMessageDetails;
@ -1569,7 +1569,7 @@ int IUIScene_AbstractContainerMenu::getCurrentIndex(ESceneSection eSection)
return currentIndex + getSectionStartOffset(eSection); return currentIndex + getSectionStartOffset(eSection);
} }
bool IUIScene_AbstractContainerMenu::IsSameItemAs(std::shared_ptr<ItemInstance> itemA, std::shared_ptr<ItemInstance> itemB) bool IUIScene_AbstractContainerMenu::IsSameItemAs(shared_ptr<ItemInstance> itemA, shared_ptr<ItemInstance> itemB)
{ {
if(itemA == NULL || itemB == NULL) return false; if(itemA == NULL || itemB == NULL) return false;
@ -1583,7 +1583,7 @@ int IUIScene_AbstractContainerMenu::GetEmptyStackSpace(Slot *slot)
if(slot != NULL && slot->hasItem()) if(slot != NULL && slot->hasItem())
{ {
std::shared_ptr<ItemInstance> item = slot->getItem(); shared_ptr<ItemInstance> item = slot->getItem();
if ( item->isStackable() ) if ( item->isStackable() )
{ {
int iCount = item->GetCount(); int iCount = item->GetCount();

View file

@ -201,15 +201,15 @@ protected:
virtual void setSectionSelectedSlot(ESceneSection eSection, int x, int y) = 0; virtual void setSectionSelectedSlot(ESceneSection eSection, int x, int y) = 0;
virtual void setFocusToPointer(int iPad) = 0; virtual void setFocusToPointer(int iPad) = 0;
virtual void SetPointerText(const wstring &description, vector<wstring> &unformattedStrings, bool newSlot) = 0; virtual void SetPointerText(const wstring &description, vector<wstring> &unformattedStrings, bool newSlot) = 0;
virtual std::shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot) = 0; virtual shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot) = 0;
virtual bool isSlotEmpty(ESceneSection eSection, int iSlot) = 0; virtual bool isSlotEmpty(ESceneSection eSection, int iSlot) = 0;
virtual void adjustPointerForSafeZone() = 0; virtual void adjustPointerForSafeZone() = 0;
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, virtual bool overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT) { return false; } EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT) { return false; }
private: private:
bool IsSameItemAs(std::shared_ptr<ItemInstance> itemA, std::shared_ptr<ItemInstance> itemB); bool IsSameItemAs(shared_ptr<ItemInstance> itemA, shared_ptr<ItemInstance> itemB);
int GetEmptyStackSpace(Slot *slot); int GetEmptyStackSpace(Slot *slot);
wstring GetItemDescription(Slot *slot, vector<wstring> &unformattedStrings); wstring GetItemDescription(Slot *slot, vector<wstring> &unformattedStrings);

View file

@ -245,15 +245,15 @@ void IUIScene_AnvilMenu::updateItemName()
ByteArrayOutputStream baos; ByteArrayOutputStream baos;
DataOutputStream dos(&baos); DataOutputStream dos(&baos);
dos.writeUTF(m_itemName); dos.writeUTF(m_itemName);
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(std::shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray()))); Minecraft::GetInstance()->localplayers[getPad()]->connection->send(shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray())));
} }
void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector<std::shared_ptr<ItemInstance> > *items) void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector<shared_ptr<ItemInstance> > *items)
{ {
slotChanged(container, RepairMenu::INPUT_SLOT, container->getSlot(0)->getItem()); slotChanged(container, RepairMenu::INPUT_SLOT, container->getSlot(0)->getItem());
} }
void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr<ItemInstance> item) void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr<ItemInstance> item)
{ {
if (slotIndex == RepairMenu::INPUT_SLOT) if (slotIndex == RepairMenu::INPUT_SLOT)
{ {

View file

@ -16,7 +16,7 @@ class RepairMenu;
class IUIScene_AnvilMenu : public virtual IUIScene_AbstractContainerMenu, public net_minecraft_world_inventory::ContainerListener class IUIScene_AnvilMenu : public virtual IUIScene_AbstractContainerMenu, public net_minecraft_world_inventory::ContainerListener
{ {
protected: protected:
std::shared_ptr<Inventory> m_inventory; shared_ptr<Inventory> m_inventory;
RepairMenu *m_repairMenu; RepairMenu *m_repairMenu;
wstring m_itemName; wstring m_itemName;
@ -39,7 +39,7 @@ protected:
void updateItemName(); void updateItemName();
// ContainerListenr // ContainerListenr
void refreshContainer(AbstractContainerMenu *container, vector<std::shared_ptr<ItemInstance> > *items); void refreshContainer(AbstractContainerMenu *container, vector<shared_ptr<ItemInstance> > *items);
void slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr<ItemInstance> item); void slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr<ItemInstance> item);
void setContainerData(AbstractContainerMenu *container, int id, int value); void setContainerData(AbstractContainerMenu *container, int id, int value);
}; };

View file

@ -208,7 +208,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
int iSlot=iVSlotIndexA[m_iCurrentSlotVIndex]; int iSlot=iVSlotIndexA[m_iCurrentSlotVIndex];
int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]; int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot];
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue()); //int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
if( pMinecraft->localgameModes[iPad] != NULL) if( pMinecraft->localgameModes[iPad] != NULL)
@ -244,7 +244,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
iSlot=0; iSlot=0;
} }
int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]; int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot];
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue()); //int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
if( pMinecraft->localgameModes[iPad] != NULL ) if( pMinecraft->localgameModes[iPad] != NULL )
@ -272,7 +272,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
{ {
for(int j=0;j<pRecipeIngredientsRequired[iRecipe].iIngValA[i];j++) for(int j=0;j<pRecipeIngredientsRequired[iRecipe].iIngValA[i];j++)
{ {
std::shared_ptr<ItemInstance> ingItemInst = nullptr; shared_ptr<ItemInstance> ingItemInst = nullptr;
// do we need to remove a specific aux value? // do we need to remove a specific aux value?
if(pRecipeIngredientsRequired[iRecipe].iIngAuxValA[i]!=Recipes::ANY_AUX_VALUE) if(pRecipeIngredientsRequired[iRecipe].iIngAuxValA[i]!=Recipes::ANY_AUX_VALUE)
{ {
@ -291,7 +291,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
if (ingItemInst->getItem()->hasCraftingRemainingItem()) if (ingItemInst->getItem()->hasCraftingRemainingItem())
{ {
// replace item with remaining result // replace item with remaining result
m_pPlayer->inventory->add( std::shared_ptr<ItemInstance>( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) ); m_pPlayer->inventory->add( shared_ptr<ItemInstance>( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) );
} }
} }
@ -624,7 +624,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
// for (int i = 0; i < iRecipeC; i++) // for (int i = 0; i < iRecipeC; i++)
// { // {
// std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL); // shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL);
// if (pTempItemInst != NULL) // if (pTempItemInst != NULL)
// { // {
// wstring itemstring=pTempItemInst->toString(); // wstring itemstring=pTempItemInst->toString();
@ -761,7 +761,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
if(iHSlotBrushControl<=m_iCraftablesMaxHSlotC) if(iHSlotBrushControl<=m_iCraftablesMaxHSlotC)
{ {
bool bFound=false; bool bFound=false;
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr);
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue()); //int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
int iID=pTempItemInst->getItem()->id; int iID=pTempItemInst->getItem()->id;
int iBaseType; int iBaseType;
@ -835,7 +835,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
while((iIndex<m_iCraftablesMaxHSlotC) && CanBeMadeA[iIndex].iCount!=0) while((iIndex<m_iCraftablesMaxHSlotC) && CanBeMadeA[iIndex].iCount!=0)
{ {
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].pRecipy->assemble(nullptr);
assert(pTempItemInst->id!=0); assert(pTempItemInst->id!=0);
unsigned int uiAlpha; unsigned int uiAlpha;
@ -903,7 +903,7 @@ void IUIScene_CraftingMenu::UpdateHighlight()
{ {
iSlot=0; iSlot=0;
} }
std::shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr);
// special case for the torch coal/charcoal // special case for the torch coal/charcoal
int id=pTempItemInstAdditional->getDescriptionId(); int id=pTempItemInstAdditional->getDescriptionId();
@ -991,7 +991,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots()
{ {
if(i!=1) continue; if(i!=1) continue;
} }
std::shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].pRecipy->assemble(nullptr);
assert(pTempItemInstAdditional->id!=0); assert(pTempItemInstAdditional->id!=0);
unsigned int uiAlpha; unsigned int uiAlpha;
@ -1057,7 +1057,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
int iBoxWidth=(m_iContainerType==RECIPE_TYPE_2x2)?2:3; int iBoxWidth=(m_iContainerType==RECIPE_TYPE_2x2)?2:3;
int iRecipe=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]; int iRecipe=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot];
bool bCanMakeRecipe = pRecipeIngredientsRequired[iRecipe].bCanMake[getPad()]; bool bCanMakeRecipe = pRecipeIngredientsRequired[iRecipe].bCanMake[getPad()];
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
m_iIngredientsC=pRecipeIngredientsRequired[iRecipe].iIngC; m_iIngredientsC=pRecipeIngredientsRequired[iRecipe].iIngC;
@ -1077,7 +1077,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
iAuxVal = 0xFF; iAuxVal = 0xFF;
} }
std::shared_ptr<ItemInstance> itemInst= std::shared_ptr<ItemInstance>(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal)); shared_ptr<ItemInstance> itemInst= shared_ptr<ItemInstance>(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal));
setIngredientDescriptionItem(getPad(),i,itemInst); setIngredientDescriptionItem(getPad(),i,itemInst);
setIngredientDescriptionRedBox(i,false); setIngredientDescriptionRedBox(i,false);
@ -1141,7 +1141,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
{ {
iAuxVal = 0xFF; iAuxVal = 0xFF;
} }
std::shared_ptr<ItemInstance> itemInst= std::shared_ptr<ItemInstance>(new ItemInstance(id,1,iAuxVal)); shared_ptr<ItemInstance> itemInst= shared_ptr<ItemInstance>(new ItemInstance(id,1,iAuxVal));
setIngredientSlotItem(getPad(),index,itemInst); setIngredientSlotItem(getPad(),index,itemInst);
// show the ingredients we don't have if we can't make the recipe // show the ingredients we don't have if we can't make the recipe
if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_CraftAnything)) if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_CraftAnything))
@ -1218,7 +1218,7 @@ void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade)
//iRecipy=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[0]; //iRecipy=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[0];
} }
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr);
int iID=pTempItemInst->getItem()->id; int iID=pTempItemInst->getItem()->id;
int iAuxVal=pTempItemInst->getAuxValue(); int iAuxVal=pTempItemInst->getAuxValue();
int iBaseType; int iBaseType;

View file

@ -49,7 +49,7 @@ protected:
int m_iCurrentSlotVIndex; int m_iCurrentSlotVIndex;
int m_iRecipeC; int m_iRecipeC;
int m_iContainerType; // 2x2 or 3x3 int m_iContainerType; // 2x2 or 3x3
std::shared_ptr<LocalPlayer> m_pPlayer; shared_ptr<LocalPlayer> m_pPlayer;
int m_iGroupIndex; int m_iGroupIndex;
int iVSlotIndexA[3]; // index of the v slots currently displayed int iVSlotIndexA[3]; // index of the v slots currently displayed
@ -96,13 +96,13 @@ protected:
virtual void hideAllHSlots() = 0; virtual void hideAllHSlots() = 0;
virtual void hideAllVSlots() = 0; virtual void hideAllVSlots() = 0;
virtual void hideAllIngredientsSlots() = 0; virtual void hideAllIngredientsSlots() = 0;
virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0; virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0; virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr<ItemInstance> item) = 0; virtual void setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item) = 0;
virtual void setCraftingOutputSlotRedBox(bool show) = 0; virtual void setCraftingOutputSlotRedBox(bool show) = 0;
virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr<ItemInstance> item) = 0; virtual void setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item) = 0;
virtual void setIngredientSlotRedBox(int index, bool show) = 0; virtual void setIngredientSlotRedBox(int index, bool show) = 0;
virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr<ItemInstance> item) = 0; virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item) = 0;
virtual void setIngredientDescriptionRedBox(int index, bool show) = 0; virtual void setIngredientDescriptionRedBox(int index, bool show) = 0;
virtual void setIngredientDescriptionText(int index, LPCWSTR text) = 0; virtual void setIngredientDescriptionText(int index, LPCWSTR text) = 0;
virtual void setShowCraftHSlot(int iIndex, bool show) = 0; virtual void setShowCraftHSlot(int iIndex, bool show) = 0;

View file

@ -12,16 +12,16 @@
// 4J JEV - Images for each tab. // 4J JEV - Images for each tab.
IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL; IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL;
vector< std::shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount]; vector< shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount];
#define ITEM(id) list->push_back( std::shared_ptr<ItemInstance>(new ItemInstance(id, 1, 0)) ); #define ITEM(id) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, 0)) );
#define ITEM_AUX(id, aux) list->push_back( std::shared_ptr<ItemInstance>(new ItemInstance(id, 1, aux)) ); #define ITEM_AUX(id, aux) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, aux)) );
#define DEF(index) list = &categoryGroups[index]; #define DEF(index) list = &categoryGroups[index];
void IUIScene_CreativeMenu::staticCtor() void IUIScene_CreativeMenu::staticCtor()
{ {
vector< std::shared_ptr<ItemInstance> > *list; vector< shared_ptr<ItemInstance> > *list;
// Building Blocks // Building Blocks
@ -708,7 +708,7 @@ unsigned int IUIScene_CreativeMenu::TabSpec::getPageCount()
// 4J JEV - Item Picker Menu // 4J JEV - Item Picker Menu
IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( std::shared_ptr<SimpleContainer> smp, std::shared_ptr<Inventory> inv ) : AbstractContainerMenu() IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( shared_ptr<SimpleContainer> smp, shared_ptr<Inventory> inv ) : AbstractContainerMenu()
{ {
inventory = inv; inventory = inv;
creativeContainer = smp; creativeContainer = smp;
@ -734,7 +734,7 @@ IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( std::shared_ptr<SimpleCon
containerId = CONTAINER_ID_CREATIVE; containerId = CONTAINER_ID_CREATIVE;
} }
bool IUIScene_CreativeMenu::ItemPickerMenu::stillValid(std::shared_ptr<Player> player) bool IUIScene_CreativeMenu::ItemPickerMenu::stillValid(shared_ptr<Player> player)
{ {
return true; return true;
} }
@ -794,7 +794,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i) for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
{ {
std::shared_ptr<ItemInstance> newItem = m_menu->getSlot(i)->getItem(); shared_ptr<ItemInstance> newItem = m_menu->getSlot(i)->getItem();
if(newItem != NULL) if(newItem != NULL)
{ {
@ -813,7 +813,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q
// Drop items. // Drop items.
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
std::shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[iPad]->inventory; shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[iPad]->inventory;
if (playerInventory->getCarried() != NULL) if (playerInventory->getCarried() != NULL)
{ {
if (buttonNum == 0) if (buttonNum == 0)
@ -823,7 +823,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q
} }
if (buttonNum == 1) if (buttonNum == 1)
{ {
std::shared_ptr<ItemInstance> removedItem = playerInventory->getCarried()->remove(1); shared_ptr<ItemInstance> removedItem = playerInventory->getCarried()->remove(1);
pMinecraft->localgameModes[iPad]->handleCreativeModeItemDrop(removedItem); pMinecraft->localgameModes[iPad]->handleCreativeModeItemDrop(removedItem);
if (playerInventory->getCarried()->count == 0) playerInventory->setCarried(nullptr); if (playerInventory->getCarried()->count == 0) playerInventory->setCarried(nullptr);
} }
@ -894,9 +894,9 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
if (buttonNum == 0) if (buttonNum == 0)
{ {
std::shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory; shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
std::shared_ptr<ItemInstance> carried = playerInventory->getCarried(); shared_ptr<ItemInstance> carried = playerInventory->getCarried();
std::shared_ptr<ItemInstance> clicked = m_menu->getSlot(currentIndex)->getItem(); shared_ptr<ItemInstance> clicked = m_menu->getSlot(currentIndex)->getItem();
if (clicked != NULL) if (clicked != NULL)
{ {
playerInventory->setCarried(ItemInstance::clone(clicked)); playerInventory->setCarried(ItemInstance::clone(clicked));
@ -928,7 +928,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
quickKeyHeld = FALSE; quickKeyHeld = FALSE;
} }
m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]); m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]);
std::shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem(); shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem();
// call this function to synchronize multiplayer item bar // call this function to synchronize multiplayer item bar
pMinecraft->localgameModes[getPad()]->handleCreativeModeItemAdd(newItem, currentIndex - (int)m_menu->slots->size() + 9 + InventoryMenu::USE_ROW_SLOT_START); pMinecraft->localgameModes[getPad()]->handleCreativeModeItemAdd(newItem, currentIndex - (int)m_menu->slots->size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
@ -941,7 +941,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
m_iCurrSlotX = m_creativeSlotX; m_iCurrSlotX = m_creativeSlotX;
m_iCurrSlotY = m_creativeSlotY; m_iCurrSlotY = m_creativeSlotY;
std::shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory; shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
playerInventory->setCarried(nullptr); playerInventory->setCarried(nullptr);
m_bCarryingCreativeItem = false; m_bCarryingCreativeItem = false;
} }
@ -970,14 +970,14 @@ bool IUIScene_CreativeMenu::CanHaveFocus( ESceneSection eSection )
return false; return false;
} }
bool IUIScene_CreativeMenu::getEmptyInventorySlot(std::shared_ptr<ItemInstance> item, int &slotX) bool IUIScene_CreativeMenu::getEmptyInventorySlot(shared_ptr<ItemInstance> item, int &slotX)
{ {
bool sameItemFound = false; bool sameItemFound = false;
bool emptySlotFound = false; bool emptySlotFound = false;
// Jump to the slot with this item already on it, if we can stack more // Jump to the slot with this item already on it, if we can stack more
for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i) for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
{ {
std::shared_ptr<ItemInstance> slotItem = m_menu->getSlot(i)->getItem(); shared_ptr<ItemInstance> slotItem = m_menu->getSlot(i)->getItem();
if( slotItem != NULL && slotItem->sameItem(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() )) if( slotItem != NULL && slotItem->sameItem(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() ))
{ {
sameItemFound = true; sameItemFound = true;
@ -1020,7 +1020,7 @@ int IUIScene_CreativeMenu::getSectionStartOffset(ESceneSection eSection)
return offset; return offset;
} }
bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT) EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT)
{ {
bool _override = false; bool _override = false;

View file

@ -74,21 +74,21 @@ public:
class ItemPickerMenu : public AbstractContainerMenu class ItemPickerMenu : public AbstractContainerMenu
{ {
protected: protected:
std::shared_ptr<SimpleContainer> creativeContainer; shared_ptr<SimpleContainer> creativeContainer;
std::shared_ptr<Inventory> inventory; shared_ptr<Inventory> inventory;
public: public:
ItemPickerMenu( std::shared_ptr<SimpleContainer> creativeContainer, std::shared_ptr<Inventory> inventory ); ItemPickerMenu( shared_ptr<SimpleContainer> creativeContainer, shared_ptr<Inventory> inventory );
virtual bool stillValid(std::shared_ptr<Player> player); virtual bool stillValid(shared_ptr<Player> player);
bool isOverrideResultClick(int slotNum, int buttonNum); bool isOverrideResultClick(int slotNum, int buttonNum);
protected: protected:
// 4J Stu - Brought forward from 1.2 to fix infinite recursion bug in creative // 4J Stu - Brought forward from 1.2 to fix infinite recursion bug in creative
virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, std::shared_ptr<Player> player) { } // do nothing virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr<Player> player) { } // do nothing
} *itemPickerMenu; } *itemPickerMenu;
protected: protected:
static vector< std::shared_ptr<ItemInstance> > categoryGroups[eCreativeInventoryGroupsCount]; static vector< shared_ptr<ItemInstance> > categoryGroups[eCreativeInventoryGroupsCount];
// 4J JEV - Tabs // 4J JEV - Tabs
static TabSpec **specs; static TabSpec **specs;
@ -112,11 +112,11 @@ protected:
virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld); virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld);
virtual void handleAdditionalKeyPress(int iAction); virtual void handleAdditionalKeyPress(int iAction);
virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld); virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld);
bool getEmptyInventorySlot(std::shared_ptr<ItemInstance> item, int &slotX); bool getEmptyInventorySlot(shared_ptr<ItemInstance> item, int &slotX);
int getSectionStartOffset(ESceneSection eSection); int getSectionStartOffset(ESceneSection eSection);
virtual bool IsSectionSlotList( ESceneSection eSection ); virtual bool IsSectionSlotList( ESceneSection eSection );
virtual bool CanHaveFocus( ESceneSection eSection ); virtual bool CanHaveFocus( ESceneSection eSection );
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, virtual bool overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT); EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT);
}; };

View file

@ -16,7 +16,7 @@ IUIScene_TradingMenu::IUIScene_TradingMenu()
m_bHasUpdatedOnce = false; m_bHasUpdatedOnce = false;
} }
std::shared_ptr<Merchant> IUIScene_TradingMenu::getMerchant() shared_ptr<Merchant> IUIScene_TradingMenu::getMerchant()
{ {
return m_merchant; return m_merchant;
} }
@ -70,9 +70,9 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
if(!activeRecipe->isDeprecated()) if(!activeRecipe->isDeprecated())
{ {
// Do we have the ingredients? // Do we have the ingredients?
std::shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem(); shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem();
std::shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem(); shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem();
std::shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()]; shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
int buyAMatches = player->inventory->countMatches(buyAItem); int buyAMatches = player->inventory->countMatches(buyAItem);
int buyBMatches = player->inventory->countMatches(buyBItem); int buyBMatches = player->inventory->countMatches(buyBItem);
if( (buyAItem != NULL && buyAMatches >= buyAItem->count) && (buyBItem == NULL || buyBMatches >= buyBItem->count) ) if( (buyAItem != NULL && buyAMatches >= buyAItem->count) && (buyBItem == NULL || buyBMatches >= buyBItem->count) )
@ -84,7 +84,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
player->inventory->removeResources(buyBItem); player->inventory->removeResources(buyBItem);
// Add the item we have purchased // Add the item we have purchased
std::shared_ptr<ItemInstance> result = activeRecipe->getSellItem()->copy(); shared_ptr<ItemInstance> result = activeRecipe->getSellItem()->copy();
if(!player->inventory->add( result ) ) if(!player->inventory->add( result ) )
{ {
player->drop(result); player->drop(result);
@ -92,7 +92,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
// Send a packet to the server // Send a packet to the server
int actualShopItem = m_activeOffers.at(selectedShopItem).second; int actualShopItem = m_activeOffers.at(selectedShopItem).second;
player->connection->send( std::shared_ptr<TradeItemPacket>( new TradeItemPacket(m_menu->containerId, actualShopItem) ) ); player->connection->send( shared_ptr<TradeItemPacket>( new TradeItemPacket(m_menu->containerId, actualShopItem) ) );
updateDisplay(); updateDisplay();
} }
@ -149,7 +149,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
ByteArrayOutputStream rawOutput; ByteArrayOutputStream rawOutput;
DataOutputStream output(&rawOutput); DataOutputStream output(&rawOutput);
output.writeInt(actualShopItem); output.writeInt(actualShopItem);
Minecraft::GetInstance()->getConnection(getPad())->send(std::shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()))); Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
} }
} }
return handled; return handled;
@ -203,7 +203,7 @@ void IUIScene_TradingMenu::updateDisplay()
ByteArrayOutputStream rawOutput; ByteArrayOutputStream rawOutput;
DataOutputStream output(&rawOutput); DataOutputStream output(&rawOutput);
output.writeInt(firstValidTrade); output.writeInt(firstValidTrade);
Minecraft::GetInstance()->getConnection(getPad())->send(std::shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()))); Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
} }
} }
@ -248,8 +248,8 @@ void IUIScene_TradingMenu::updateDisplay()
wstring offerDescription = GetItemDescription(activeRecipe->getSellItem(), unformattedStrings); wstring offerDescription = GetItemDescription(activeRecipe->getSellItem(), unformattedStrings);
setOfferDescription(offerDescription, unformattedStrings); setOfferDescription(offerDescription, unformattedStrings);
std::shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem(); shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem();
std::shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem(); shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem();
setRequest1Item(buyAItem); setRequest1Item(buyAItem);
setRequest2Item(buyBItem); setRequest2Item(buyBItem);
@ -262,7 +262,7 @@ void IUIScene_TradingMenu::updateDisplay()
bool canMake = true; bool canMake = true;
std::shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()]; shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
int buyAMatches = player->inventory->countMatches(buyAItem); int buyAMatches = player->inventory->countMatches(buyAItem);
if(buyAMatches > 0) if(buyAMatches > 0)
{ {
@ -321,10 +321,10 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
{ {
if(recipe->isDeprecated()) return false; if(recipe->isDeprecated()) return false;
std::shared_ptr<ItemInstance> buyAItem = recipe->getBuyAItem(); shared_ptr<ItemInstance> buyAItem = recipe->getBuyAItem();
std::shared_ptr<ItemInstance> buyBItem = recipe->getBuyBItem(); shared_ptr<ItemInstance> buyBItem = recipe->getBuyBItem();
std::shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()]; shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
int buyAMatches = player->inventory->countMatches(buyAItem); int buyAMatches = player->inventory->countMatches(buyAItem);
if(buyAMatches > 0) if(buyAMatches > 0)
{ {
@ -349,19 +349,19 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
} }
void IUIScene_TradingMenu::setRequest1Item(std::shared_ptr<ItemInstance> item) void IUIScene_TradingMenu::setRequest1Item(shared_ptr<ItemInstance> item)
{ {
} }
void IUIScene_TradingMenu::setRequest2Item(std::shared_ptr<ItemInstance> item) void IUIScene_TradingMenu::setRequest2Item(shared_ptr<ItemInstance> item)
{ {
} }
void IUIScene_TradingMenu::setTradeItem(int index, std::shared_ptr<ItemInstance> item) void IUIScene_TradingMenu::setTradeItem(int index, shared_ptr<ItemInstance> item)
{ {
} }
wstring IUIScene_TradingMenu::GetItemDescription(std::shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings) wstring IUIScene_TradingMenu::GetItemDescription(shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings)
{ {
if(item == NULL) return L""; if(item == NULL) return L"";

View file

@ -7,7 +7,7 @@ class IUIScene_TradingMenu
{ {
protected: protected:
MerchantMenu *m_menu; MerchantMenu *m_menu;
std::shared_ptr<Merchant> m_merchant; shared_ptr<Merchant> m_merchant;
vector< pair<MerchantRecipe *,int> > m_activeOffers; vector< pair<MerchantRecipe *,int> > m_activeOffers;
int m_validOffersCount; int m_validOffersCount;
@ -42,17 +42,17 @@ protected:
virtual void setOfferDescription(const wstring &name, vector<wstring> &unformattedStrings) = 0; virtual void setOfferDescription(const wstring &name, vector<wstring> &unformattedStrings) = 0;
virtual void setRequest1Item(std::shared_ptr<ItemInstance> item); virtual void setRequest1Item(shared_ptr<ItemInstance> item);
virtual void setRequest2Item(std::shared_ptr<ItemInstance> item); virtual void setRequest2Item(shared_ptr<ItemInstance> item);
virtual void setTradeItem(int index, std::shared_ptr<ItemInstance> item); virtual void setTradeItem(int index, shared_ptr<ItemInstance> item);
private: private:
void updateDisplay(); void updateDisplay();
bool canMake(MerchantRecipe *recipe); bool canMake(MerchantRecipe *recipe);
wstring GetItemDescription(std::shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings); wstring GetItemDescription(shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings);
public: public:
std::shared_ptr<Merchant> getMerchant(); shared_ptr<Merchant> getMerchant();
virtual int getPad() = 0; virtual int getPad() = 0;
}; };

View file

@ -47,7 +47,7 @@ void UIComponent_Panorama::tick()
EnterCriticalSection(&pMinecraft->m_setLevelCS); EnterCriticalSection(&pMinecraft->m_setLevelCS);
if(pMinecraft->level!=NULL) if(pMinecraft->level!=NULL)
{ {
int64_t i64TimeOfDay =0; __int64 i64TimeOfDay =0;
// are we in the Nether? - Leave the time as 0 if we are, so we show daylight // are we in the Nether? - Leave the time as 0 if we are, so we show daylight
if(pMinecraft->level->dimension->id==0) if(pMinecraft->level->dimension->id==0)
{ {

View file

@ -209,7 +209,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
if( icon != TUTORIAL_NO_ICON ) if( icon != TUTORIAL_NO_ICON )
{ {
m_iconIsFoil = false; m_iconIsFoil = false;
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal));
} }
else else
{ {
@ -238,7 +238,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
{ {
iAuxVal = 0; iAuxVal = 0;
} }
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal));
temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L""); temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L"");
} }
@ -247,63 +247,63 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
// remove any icon text // remove any icon text
else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos) else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::workBench_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::workBench_Id,1,0));
} }
else if(temp.find(L"{*SticksIcon*}")!=wstring::npos) else if(temp.find(L"{*SticksIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::stick_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::stick_Id,1,0));
} }
else if(temp.find(L"{*PlanksIcon*}")!=wstring::npos) else if(temp.find(L"{*PlanksIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::wood_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::wood_Id,1,0));
} }
else if(temp.find(L"{*WoodenShovelIcon*}")!=wstring::npos) else if(temp.find(L"{*WoodenShovelIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::shovel_wood_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::shovel_wood_Id,1,0));
} }
else if(temp.find(L"{*WoodenHatchetIcon*}")!=wstring::npos) else if(temp.find(L"{*WoodenHatchetIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::hatchet_wood_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::hatchet_wood_Id,1,0));
} }
else if(temp.find(L"{*WoodenPickaxeIcon*}")!=wstring::npos) else if(temp.find(L"{*WoodenPickaxeIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::pickAxe_wood_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::pickAxe_wood_Id,1,0));
} }
else if(temp.find(L"{*FurnaceIcon*}")!=wstring::npos) else if(temp.find(L"{*FurnaceIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::furnace_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::furnace_Id,1,0));
} }
else if(temp.find(L"{*WoodenDoorIcon*}")!=wstring::npos) else if(temp.find(L"{*WoodenDoorIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::door_wood,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::door_wood,1,0));
} }
else if(temp.find(L"{*TorchIcon*}")!=wstring::npos) else if(temp.find(L"{*TorchIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::torch_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::torch_Id,1,0));
} }
else if(temp.find(L"{*BoatIcon*}")!=wstring::npos) else if(temp.find(L"{*BoatIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::boat_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::boat_Id,1,0));
} }
else if(temp.find(L"{*FishingRodIcon*}")!=wstring::npos) else if(temp.find(L"{*FishingRodIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod_Id,1,0));
} }
else if(temp.find(L"{*FishIcon*}")!=wstring::npos) else if(temp.find(L"{*FishIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::fish_raw_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::fish_raw_Id,1,0));
} }
else if(temp.find(L"{*MinecartIcon*}")!=wstring::npos) else if(temp.find(L"{*MinecartIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::minecart_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::minecart_Id,1,0));
} }
else if(temp.find(L"{*RailIcon*}")!=wstring::npos) else if(temp.find(L"{*RailIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::rail_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::rail_Id,1,0));
} }
else if(temp.find(L"{*PoweredRailIcon*}")!=wstring::npos) else if(temp.find(L"{*PoweredRailIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::goldenRail_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::goldenRail_Id,1,0));
} }
else if(temp.find(L"{*StructuresIcon*}")!=wstring::npos) else if(temp.find(L"{*StructuresIcon*}")!=wstring::npos)
{ {
@ -317,7 +317,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
} }
else if(temp.find(L"{*StoneIcon*}")!=wstring::npos) else if(temp.find(L"{*StoneIcon*}")!=wstring::npos)
{ {
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::rock_Id,1,0)); m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::rock_Id,1,0));
} }
else else
{ {

View file

@ -15,7 +15,7 @@ private:
bool m_lastSceneMovedLeft; bool m_lastSceneMovedLeft;
bool m_bAllowFade; bool m_bAllowFade;
Tutorial *m_tutorial; Tutorial *m_tutorial;
std::shared_ptr<ItemInstance> m_iconItem; shared_ptr<ItemInstance> m_iconItem;
bool m_iconIsFoil; bool m_iconIsFoil;
//int m_iLocalPlayerC; //int m_iLocalPlayerC;

View file

@ -100,7 +100,7 @@ void UIControl_EnchantmentBook::tickBook()
{ {
UIScene_EnchantingMenu *m_containerScene = (UIScene_EnchantingMenu *)m_parentScene; UIScene_EnchantingMenu *m_containerScene = (UIScene_EnchantingMenu *)m_parentScene;
EnchantmentMenu *menu = m_containerScene->getMenu(); EnchantmentMenu *menu = m_containerScene->getMenu();
std::shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem(); shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem();
if (!ItemInstance::matches(current, last)) if (!ItemInstance::matches(current, last))
{ {
last = current; last = current;

View file

@ -19,7 +19,7 @@ private:
//BOOL m_bDirty; //BOOL m_bDirty;
//float m_fScale,m_fAlpha; //float m_fScale,m_fAlpha;
//int m_iPad; //int m_iPad;
std::shared_ptr<ItemInstance> last; shared_ptr<ItemInstance> last;
//float m_fScreenWidth,m_fScreenHeight; //float m_fScreenWidth,m_fScreenHeight;
//float m_fRawWidth,m_fRawHeight; //float m_fRawWidth,m_fRawHeight;

View file

@ -24,7 +24,7 @@ bool UIControl_SpaceIndicatorBar::setupControl(UIScene *scene, IggyValuePath *pa
return success; return success;
} }
void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, int64_t min, int64_t max) void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, __int64 min, __int64 max)
{ {
m_label = label; m_label = label;
m_id = id; m_id = id;
@ -61,11 +61,11 @@ void UIControl_SpaceIndicatorBar::reset()
setSaveGameOffset(0.0f); setSaveGameOffset(0.0f);
} }
void UIControl_SpaceIndicatorBar::addSave(int64_t size) void UIControl_SpaceIndicatorBar::addSave(__int64 size)
{ {
float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min); float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min);
m_sizeAndOffsets.push_back( pair<int64_t, float>(size, startPercent) ); m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) );
m_currentTotal += size; m_currentTotal += size;
setTotalSize(m_currentTotal); setTotalSize(m_currentTotal);
@ -75,7 +75,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index)
{ {
if(index >= 0 && index < m_sizeAndOffsets.size()) if(index >= 0 && index < m_sizeAndOffsets.size())
{ {
pair<int64_t,float> values = m_sizeAndOffsets[index]; pair<__int64,float> values = m_sizeAndOffsets[index];
setSaveSize(values.first); setSaveSize(values.first);
setSaveGameOffset(values.second); setSaveGameOffset(values.second);
} }
@ -86,7 +86,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index)
} }
} }
void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size) void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size)
{ {
m_currentSave = size; m_currentSave = size;
@ -99,7 +99,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size)
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value ); IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value );
} }
void UIControl_SpaceIndicatorBar::setTotalSize(int64_t size) void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size)
{ {
float percent = (float)((m_currentTotal-m_min))/(m_max-m_min); float percent = (float)((m_currentTotal-m_min))/(m_max-m_min);

Some files were not shown because too many files have changed in this diff Show more