Replaced every C-style cast with C++ ones

This commit is contained in:
Chase Cooper 2026-03-05 17:43:29 -05:00
parent 82a6cc662d
commit 5471f91814
677 changed files with 4314 additions and 4314 deletions

View file

@ -59,7 +59,7 @@ void AchievementPopup::prepareWindow()
glClear(GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, (float)width, (float)height, 0, 1000, 3000);
glOrtho(0, static_cast<float>(width), static_cast<float>(height), 0, 1000, 3000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, -2000);

View file

@ -23,7 +23,7 @@ void ArrowRenderer::render(shared_ptr<Entity> _arrow, double x, double y, double
if( ( xRot - xRotO ) > 180.0f ) xRot -= 360.0f;
else if( ( xRot - xRotO ) < -180.0f ) xRot += 360.0f;
glTranslatef((float)x, (float)y, (float)z);
glTranslatef(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
glRotatef(yRotO + (yRot - yRotO) * a - 90, 0, 1, 0);
glRotatef(xRotO + (xRot - xRotO) * a, 0, 0, 1);
@ -55,19 +55,19 @@ void ArrowRenderer::render(shared_ptr<Entity> _arrow, double x, double y, double
// glNormal3f(ss, 0, 0); // 4J - changed to use tesselator
t->begin();
t->normal(1,0,0);
t->vertexUV((float)(-7), (float)( -2), (float)( -2), (float)( u02), (float)( v02));
t->vertexUV((float)(-7), (float)( -2), (float)( +2), (float)( u12), (float)( v02));
t->vertexUV((float)(-7), (float)( +2), (float)( +2), (float)( u12), (float)( v12));
t->vertexUV((float)(-7), (float)( +2), (float)( -2), (float)( u02), (float)( v12));
t->vertexUV(static_cast<float>(-7), static_cast<float>(-2), static_cast<float>(-2), (float)( u02), (float)( v02));
t->vertexUV(static_cast<float>(-7), static_cast<float>(-2), static_cast<float>(+2), (float)( u12), (float)( v02));
t->vertexUV(static_cast<float>(-7), static_cast<float>(+2), static_cast<float>(+2), (float)( u12), (float)( v12));
t->vertexUV(static_cast<float>(-7), static_cast<float>(+2), static_cast<float>(-2), (float)( u02), (float)( v12));
t->end();
// glNormal3f(-ss, 0, 0); // 4J - changed to use tesselator
t->begin();
t->normal(-1,0,0);
t->vertexUV((float)(-7), (float)( +2), (float)( -2), (float)( u02), (float)( v02));
t->vertexUV((float)(-7), (float)( +2), (float)( +2), (float)( u12), (float)( v02));
t->vertexUV((float)(-7), (float)( -2), (float)( +2), (float)( u12), (float)( v12));
t->vertexUV((float)(-7), (float)( -2), (float)( -2), (float)( u02), (float)( v12));
t->vertexUV(static_cast<float>(-7), static_cast<float>(+2), static_cast<float>(-2), (float)( u02), (float)( v02));
t->vertexUV(static_cast<float>(-7), static_cast<float>(+2), static_cast<float>(+2), (float)( u12), (float)( v02));
t->vertexUV(static_cast<float>(-7), static_cast<float>(-2), static_cast<float>(+2), (float)( u12), (float)( v12));
t->vertexUV(static_cast<float>(-7), static_cast<float>(-2), static_cast<float>(-2), (float)( u02), (float)( v12));
t->end();
for (int i = 0; i < 4; i++)
@ -77,10 +77,10 @@ void ArrowRenderer::render(shared_ptr<Entity> _arrow, double x, double y, double
// glNormal3f(0, 0, ss); // 4J - changed to use tesselator
t->begin();
t->normal(0,0,1);
t->vertexUV((float)(-8), (float)( -2), (float)( 0), (float)( u0), (float)( v0));
t->vertexUV((float)(+8), (float)( -2), (float)( 0), (float)( u1), (float)( v0));
t->vertexUV((float)(+8), (float)( +2), (float)( 0), (float)( u1), (float)( v1));
t->vertexUV((float)(-8), (float)( +2), (float)( 0), (float)( u0), (float)( v1));
t->vertexUV(static_cast<float>(-8), static_cast<float>(-2), static_cast<float>(0), (float)( u0), (float)( v0));
t->vertexUV(static_cast<float>(+8), static_cast<float>(-2), static_cast<float>(0), (float)( u1), (float)( v0));
t->vertexUV(static_cast<float>(+8), static_cast<float>(+2), static_cast<float>(0), (float)( u1), (float)( v1));
t->vertexUV(static_cast<float>(-8), static_cast<float>(+2), static_cast<float>(0), (float)( u0), (float)( v1));
t->end();
}
glDisable(GL_RESCALE_NORMAL);

View file

@ -7,7 +7,7 @@ ResourceLocation BatRenderer::BAT_LOCATION = ResourceLocation(TN_MOB_BAT);
BatRenderer::BatRenderer() : MobRenderer(new BatModel(), 0.25f)
{
modelVersion = ((BatModel *)model)->modelVersion();
modelVersion = static_cast<BatModel *>(model)->modelVersion();
}
void BatRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)

View file

@ -7,7 +7,7 @@ ResourceLocation BlazeRenderer::BLAZE_LOCATION = ResourceLocation(TN_MOB_BLAZE);
BlazeRenderer::BlazeRenderer() : MobRenderer(new BlazeModel(), 0.5f)
{
modelVersion = ((BlazeModel *) model)->modelVersion();
modelVersion = static_cast<BlazeModel *>(model)->modelVersion();
}
void BlazeRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
@ -16,7 +16,7 @@ void BlazeRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z
// do some casting around instead
shared_ptr<Blaze> mob = dynamic_pointer_cast<Blaze>(_mob);
int modelVersion = ((BlazeModel *) model)->modelVersion();
int modelVersion = static_cast<BlazeModel *>(model)->modelVersion();
if (modelVersion != this->modelVersion)
{
this->modelVersion = modelVersion;

View file

@ -14,20 +14,20 @@ BoatModel::BoatModel() : Model()
int h = 20;
int yOff = 4;
cubes[0]->addBox((float)(-w / 2), (float)(-h / 2 + 2), -3, w, h - 4, 4, 0);
cubes[0]->setPos(0, (float)(0 + yOff), 0);
cubes[0]->addBox(static_cast<float>(-w / 2), static_cast<float>(-h / 2 + 2), -3, w, h - 4, 4, 0);
cubes[0]->setPos(0, static_cast<float>(0 + yOff), 0);
cubes[1]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0);
cubes[1]->setPos((float)(-w / 2 + 1), (float)(0 + yOff), 0);
cubes[1]->addBox(static_cast<float>(-w / 2 + 2), static_cast<float>(-d - 1), -1, w - 4, d, 2, 0);
cubes[1]->setPos(static_cast<float>(-w / 2 + 1), static_cast<float>(0 + yOff), 0);
cubes[2]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0);
cubes[2]->setPos((float)(+w / 2 - 1), (float)(0 + yOff), 0);
cubes[2]->addBox(static_cast<float>(-w / 2 + 2), static_cast<float>(-d - 1), -1, w - 4, d, 2, 0);
cubes[2]->setPos(static_cast<float>(+w / 2 - 1), static_cast<float>(0 + yOff), 0);
cubes[3]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0);
cubes[3]->setPos(0, (float)(0 + yOff), (float)(-h / 2 + 1));
cubes[3]->addBox(static_cast<float>(-w / 2 + 2), static_cast<float>(-d - 1), -1, w - 4, d, 2, 0);
cubes[3]->setPos(0, static_cast<float>(0 + yOff), static_cast<float>(-h / 2 + 1));
cubes[4]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0);
cubes[4]->setPos(0, (float)(0 + yOff), (float)(+h / 2 - 1));
cubes[4]->addBox(static_cast<float>(-w / 2 + 2), static_cast<float>(-d - 1), -1, w - 4, d, 2, 0);
cubes[4]->setPos(0, static_cast<float>(0 + yOff), static_cast<float>(+h / 2 - 1));
cubes[0]->xRot = PI / 2;
cubes[1]->yRot = PI / 2 * 3;

View file

@ -20,7 +20,7 @@ void BoatRenderer::render(shared_ptr<Entity> _boat, double x, double y, double z
glPushMatrix();
glTranslatef((float) x, (float) y, (float) z);
glTranslatef(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
glRotatef(180-rot, 0, 1, 0);
float hurt = boat->getHurtTime() - a;

View file

@ -50,9 +50,9 @@ void BreakingItemParticle::render(Tesselator *t, float a, float xa, float ya, fl
v1 = tex->getV(((vo + 1) / 4.0f) * SharedConstants::WORLD_RESOLUTION);
}
float x = (float) (xo + (this->x - xo) * a - xOff);
float y = (float) (yo + (this->y - yo) * a - yOff);
float z = (float) (zo + (this->z - zo) * a - zOff);
float x = static_cast<float>(xo + (this->x - xo) * a - xOff);
float y = static_cast<float>(yo + (this->y - yo) * a - yOff);
float z = static_cast<float>(zo + (this->z - zo) * a - zOff);
float br = SharedConstants::TEXTURE_LIGHTING ? 1 : getBrightness(a); // 4J - change brought forward from 1.8.2
t->color(br * rCol, br * gCol, br * bCol);

View file

@ -16,11 +16,11 @@ BubbleParticle::BubbleParticle(Level *level, double x, double y, double z, doubl
size = size*(random->nextFloat()*0.6f+0.2f);
xd = xa*0.2f+(float)(Math::random()*2-1)*0.02f;
yd = ya*0.2f+(float)(Math::random()*2-1)*0.02f;
zd = za*0.2f+(float)(Math::random()*2-1)*0.02f;
xd = xa*0.2f+static_cast<float>(Math::random() * 2 - 1)*0.02f;
yd = ya*0.2f+static_cast<float>(Math::random() * 2 - 1)*0.02f;
zd = za*0.2f+static_cast<float>(Math::random() * 2 - 1)*0.02f;
lifetime = (int) (8 / (Math::random() * 0.8 + 0.2));
lifetime = static_cast<int>(8 / (Math::random() * 0.8 + 0.2));
}
void BubbleParticle::tick()

View file

@ -391,9 +391,9 @@ void BufferedImage::preMultiplyAlpha()
{
cur = curData[i];
alpha = (cur >> 24) & 0xff;
r = ((cur >> 16) & 0xff) * (float)alpha/255;
g = ((cur >> 8) & 0xff) * (float)alpha/255;
b = (cur & 0xff) * (float)alpha/255;
r = ((cur >> 16) & 0xff) * static_cast<float>(alpha)/255;
g = ((cur >> 8) & 0xff) * static_cast<float>(alpha)/255;
b = (cur & 0xff) * static_cast<float>(alpha)/255;
curData[i] = (r << 16) | (g << 8) | (b ) | (alpha << 24);
}

View file

@ -54,7 +54,7 @@ void ChestRenderer::render(shared_ptr<TileEntity> _chest, double x, double y, d
if (dynamic_cast<ChestTile*>(tile) != NULL && data == 0)
{
((ChestTile *) tile)->recalcLockDir(chest->getLevel(), chest->x, chest->y, chest->z);
static_cast<ChestTile *>(tile)->recalcLockDir(chest->getLevel(), chest->x, chest->y, chest->z);
data = chest->getData();
}
@ -102,7 +102,7 @@ void ChestRenderer::render(shared_ptr<TileEntity> _chest, double x, double y, d
glEnable(GL_RESCALE_NORMAL);
//if( setColor ) glColor4f(1, 1, 1, 1);
if( setColor ) glColor4f(1, 1, 1, alpha);
glTranslatef((float) x, (float) y + 1, (float) z + 1);
glTranslatef(static_cast<float>(x), static_cast<float>(y) + 1, static_cast<float>(z) + 1);
glScalef(1, -1, -1);
glTranslatef(0.5f, 0.5f, 0.5f);

View file

@ -8,35 +8,35 @@ ChickenModel::ChickenModel() : Model()
int yo = 16;
head = new ModelPart(this, 0, 0);
head->addBox(-2.0f, -6.0f, -2.0f, 4, 6, 3, 0.0f); // Head
head->setPos(0, (float)(-1 + yo), -4);
head->setPos(0, static_cast<float>(-1 + yo), -4);
beak = new ModelPart(this, 14, 0);
beak->addBox(-2.0f, -4.0f, -4.0f, 4, 2, 2, 0.0f); // Beak
beak->setPos(0, (float)(-1 + yo), -4);
beak->setPos(0, static_cast<float>(-1 + yo), -4);
redThing = new ModelPart(this, 14, 4);
redThing->addBox(-1.0f, -2.0f, -3.0f, 2, 2, 2, 0.0f); // Beak
redThing->setPos(0, (float)(-1 + yo), -4);
redThing->setPos(0, static_cast<float>(-1 + yo), -4);
body = new ModelPart(this, 0, 9);
body->addBox(-3.0f, -4.0f, -3.0f, 6, 8, 6, 0.0f); // Body
body->setPos(0, (float)(0 + yo), 0);
body->setPos(0, static_cast<float>(0 + yo), 0);
leg0 = new ModelPart(this, 26, 0);
leg0->addBox(-1.0f, 0.0f, -3.0f, 3, 5, 3); // Leg0
leg0->setPos(-2, (float)(3 + yo), 1);
leg0->setPos(-2, static_cast<float>(3 + yo), 1);
leg1 = new ModelPart(this, 26, 0);
leg1->addBox(-1.0f, 0.0f, -3.0f, 3, 5, 3); // Leg1
leg1->setPos(1, (float)(3 + yo), 1);
leg1->setPos(1, static_cast<float>(3 + yo), 1);
wing0 = new ModelPart(this, 24, 13);
wing0->addBox(0.0f, 0.0f, -3.0f, 1, 4, 6); // Wing0
wing0->setPos(-4, (float)(-3 + yo), 0);
wing0->setPos(-4, static_cast<float>(-3 + yo), 0);
wing1 = new ModelPart(this, 24, 13);
wing1->addBox(-1.0f, 0.0f, -3.0f, 1, 4, 6); // Wing1
wing1->setPos(4, (float)(-3 + yo), 0);
wing1->setPos(4, static_cast<float>(-3 + yo), 0);
// 4J added - compile now to avoid random performance hit first time cubes are rendered
head->compile(1.0f/16.0f);

View file

@ -32,13 +32,13 @@ void Chunk::CreateNewThreadStorage()
void Chunk::ReleaseThreadStorage()
{
unsigned char *tileIds = (unsigned char *)TlsGetValue(tlsIdx);
unsigned char *tileIds = static_cast<unsigned char *>(TlsGetValue(tlsIdx));
delete tileIds;
}
unsigned char *Chunk::GetTileIdsStorage()
{
unsigned char *tileIds = (unsigned char *)TlsGetValue(tlsIdx);
unsigned char *tileIds = static_cast<unsigned char *>(TlsGetValue(tlsIdx));
return tileIds;
}
#else
@ -148,7 +148,7 @@ void Chunk::setPos(int x, int y, int z)
void Chunk::translateToPos()
{
glTranslatef((float)xRenderOffs, (float)yRenderOffs, (float)zRenderOffs);
glTranslatef(static_cast<float>(xRenderOffs), static_cast<float>(yRenderOffs), static_cast<float>(zRenderOffs));
}
@ -399,7 +399,7 @@ void Chunk::rebuild()
glTranslatef(zs / 2.0f, ys / 2.0f, zs / 2.0f);
#endif
t->begin();
t->offset((float)(-this->x), (float)(-this->y), (float)(-this->z));
t->offset(static_cast<float>(-this->x), static_cast<float>(-this->y), static_cast<float>(-this->z));
}
Tile *tile = Tile::tiles[tileId];
@ -936,17 +936,17 @@ void Chunk::rebuild_SPU()
float Chunk::distanceToSqr(shared_ptr<Entity> player) const
{
float xd = (float) (player->x - xm);
float yd = (float) (player->y - ym);
float zd = (float) (player->z - zm);
float xd = static_cast<float>(player->x - xm);
float yd = static_cast<float>(player->y - ym);
float zd = static_cast<float>(player->z - zm);
return xd * xd + yd * yd + zd * zd;
}
float Chunk::squishedDistanceToSqr(shared_ptr<Entity> player)
{
float xd = (float) (player->x - xm);
float yd = (float) (player->y - ym) * 2;
float zd = (float) (player->z - zm);
float xd = static_cast<float>(player->x - xm);
float yd = static_cast<float>(player->y - ym) * 2;
float zd = static_cast<float>(player->z - zm);
return xd * xd + yd * yd + zd * zd;
}

View file

@ -468,12 +468,12 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
break;
case AddEntityPacket::ITEM_FRAME:
{
int ix=(int) x;
int iy=(int) y;
int iz = (int) z;
int ix=static_cast<int>(x);
int iy=static_cast<int>(y);
int iz = static_cast<int>(z);
app.DebugPrintf("ClientConnection ITEM_FRAME xyz %d,%d,%d\n",ix,iy,iz);
}
e = shared_ptr<Entity>(new ItemFrame(level, (int) x, (int) y, (int) z, packet->data));
e = shared_ptr<Entity>(new ItemFrame(level, static_cast<int>(x), static_cast<int>(y), static_cast<int>(z), packet->data));
packet->data = 0;
setRot = false;
break;
@ -530,7 +530,7 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
e = shared_ptr<Entity>(new FireworksRocketEntity(level, x, y, z, nullptr));
break;
case AddEntityPacket::LEASH_KNOT:
e = shared_ptr<Entity>(new LeashFenceKnotEntity(level, (int) x, (int) y, (int) z));
e = shared_ptr<Entity>(new LeashFenceKnotEntity(level, static_cast<int>(x), static_cast<int>(y), static_cast<int>(z)));
packet->data = 0;
break;
#ifndef _FINAL_BUILD
@ -804,11 +804,11 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e;
if (pktXuid >= WIN64_XUID_BASE && pktXuid < WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS)
{
BYTE smallId = (BYTE)(pktXuid - WIN64_XUID_BASE);
BYTE smallId = static_cast<BYTE>(pktXuid - WIN64_XUID_BASE);
INetworkPlayer* np = g_NetworkManager.GetPlayerBySmallId(smallId);
if (np != NULL)
{
NetworkPlayerXbox* npx = (NetworkPlayerXbox*)np;
NetworkPlayerXbox* npx = static_cast<NetworkPlayerXbox *>(np);
IQNetPlayer* qp = npx->GetQNetPlayer();
if (qp != NULL && qp->m_gamertag[0] == 0)
{
@ -976,7 +976,7 @@ void ClientConnection::handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packe
INetworkPlayer* np = g_NetworkManager.GetPlayerByXuid(xuid);
if (np != NULL)
{
NetworkPlayerXbox* npx = (NetworkPlayerXbox*)np;
NetworkPlayerXbox* npx = static_cast<NetworkPlayerXbox *>(np);
IQNetPlayer* qp = npx->GetQNetPlayer();
if (qp != NULL)
{
@ -1727,7 +1727,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
}
else
{
message = replaceAll(message,L"{*DESTINATION*}", app.getEntityName((eINSTANCEOF)packet->m_intArgs[0]));
message = replaceAll(message,L"{*DESTINATION*}", app.getEntityName(static_cast<eINSTANCEOF>(packet->m_intArgs[0])));
}
break;
case ChatPacket::e_ChatCommandTeleportMe:
@ -1767,7 +1767,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
}
else
{
entityName = app.getEntityName((eINSTANCEOF) packet->m_intArgs[0]);
entityName = app.getEntityName(static_cast<eINSTANCEOF>(packet->m_intArgs[0]));
}
message = replaceAll(message,L"{*SOURCE*}", entityName);
@ -2744,7 +2744,7 @@ void ClientConnection::handleRespawn(shared_ptr<RespawnPacket> packet)
if( minecraft->localgameModes[m_userIndex] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)minecraft->localgameModes[m_userIndex];
TutorialMode *gameMode = static_cast<TutorialMode *>(minecraft->localgameModes[m_userIndex]);
gameMode->getTutorial()->showTutorialPopup(false);
}
@ -3267,7 +3267,7 @@ void ClientConnection::handleGameEvent(shared_ptr<GameEventPacket> gameEventPack
}
else if (event == GameEventPacket::WIN_GAME)
{
ui.SetWinUserIndex( (BYTE)gameEventPacket->param );
ui.SetWinUserIndex( static_cast<BYTE>(gameEventPacket->param) );
#ifdef _XBOX
@ -3439,11 +3439,11 @@ void ClientConnection::displayPrivilegeChanges(shared_ptr<MultiplayerLocalPlayer
{
int userIndex = player->GetXboxPad();
unsigned int newPrivileges = player->getAllPlayerGamePrivileges();
Player::EPlayerGamePrivileges priv = (Player::EPlayerGamePrivileges)0;
Player::EPlayerGamePrivileges priv = static_cast<Player::EPlayerGamePrivileges>(0);
bool privOn = false;
for(unsigned int i = 0; i < Player::ePlayerGamePrivilege_MAX; ++i)
{
priv = (Player::EPlayerGamePrivileges) i;
priv = static_cast<Player::EPlayerGamePrivileges>(i);
if( Player::getPlayerGamePrivilege(newPrivileges,priv) != Player::getPlayerGamePrivilege(oldPrivileges,priv))
{
privOn = Player::getPlayerGamePrivilege(newPrivileges,priv);
@ -3579,7 +3579,7 @@ void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> custo
}
#else
UIScene *scene = ui.GetTopScene(m_userIndex, eUILayer_Scene);
UIScene_TradingMenu *screen = (UIScene_TradingMenu *)scene;
UIScene_TradingMenu *screen = static_cast<UIScene_TradingMenu *>(scene);
trader = screen->getMerchant();
#endif
@ -3665,7 +3665,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
{
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(tPack);
DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))

View file

@ -57,7 +57,7 @@ void ClockTexture::cycleFrames()
// 4J Stu - We share data with another texture
if(m_dataTexture != NULL)
{
int newFrame = (int) ((rot + 1.0) * m_dataTexture->frames->size()) % m_dataTexture->frames->size();
int newFrame = static_cast<int>((rot + 1.0) * m_dataTexture->frames->size()) % m_dataTexture->frames->size();
while (newFrame < 0)
{
newFrame = (newFrame + m_dataTexture->frames->size()) % m_dataTexture->frames->size();
@ -70,7 +70,7 @@ void ClockTexture::cycleFrames()
}
else
{
int newFrame = (int) ((rot + 1.0) * frames->size()) % frames->size();
int newFrame = static_cast<int>((rot + 1.0) * frames->size()) % frames->size();
while (newFrame < 0)
{
newFrame = (newFrame + frames->size()) % frames->size();

View file

@ -447,7 +447,7 @@ void SoundEngine::updateMiles()
int Playing = 0;
while (AIL_enumerate_sound_instances(0, &token, 0, 0, 0, &SoundInfo))
{
AUDIO_INFO* game_data= (AUDIO_INFO*)( SoundInfo.UserBuffer );
AUDIO_INFO* game_data= static_cast<AUDIO_INFO *>(SoundInfo.UserBuffer);
if( SoundInfo.Status == MILESEVENT_SOUND_STATUS_PLAYING )
{
@ -1134,7 +1134,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
#ifdef __DISABLE_MILES__
return 0;
#endif
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
SoundEngine *soundEngine = static_cast<SoundEngine *>(lpParameter);
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
if(soundEngine->m_hStream==0)
@ -1211,9 +1211,9 @@ void SoundEngine::playMusicUpdate()
{
// It's a mash-up - need to use the DLC path for the music
TexturePack *pTexPack=Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexPack;
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(pTexPack);
DLCPack *pack = pDLCTexPack->getDLCInfoParentPack();
DLCAudioFile *dlcAudioFile = (DLCAudioFile *) pack->getFile(DLCManager::e_DLCType_Audio, 0);
DLCAudioFile *dlcAudioFile = static_cast<DLCAudioFile *>(pack->getFile(DLCManager::e_DLCType_Audio, 0));
app.DebugPrintf("Mashup pack \n");
@ -1683,7 +1683,7 @@ char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpac
{
if(c==' ') c='_';
}
buf[i] = (char)c;
buf[i] = static_cast<char>(c);
}
buf[name.length()] = 0;
return buf;

View file

@ -325,7 +325,7 @@ void ColourTable::staticCtor()
{
for(unsigned int i = eMinecraftColour_NOT_SET; i < eMinecraftColour_COUNT; ++i)
{
s_colourNamesMap.insert( unordered_map<wstring,eMinecraftColour>::value_type( ColourTableElements[i], (eMinecraftColour)i) );
s_colourNamesMap.insert( unordered_map<wstring,eMinecraftColour>::value_type( ColourTableElements[i], static_cast<eMinecraftColour>(i)) );
}
}
@ -366,7 +366,7 @@ void ColourTable::setColour(const wstring &colourName, int value)
auto it = s_colourNamesMap.find(colourName);
if(it != s_colourNamesMap.end())
{
m_colourValues[(int)it->second] = value;
m_colourValues[static_cast<int>(it->second)] = value;
}
}
@ -377,5 +377,5 @@ void ColourTable::setColour(const wstring &colourName, const wstring &value)
unsigned int ColourTable::getColour(eMinecraftColour id)
{
return m_colourValues[(int)id];
return m_colourValues[static_cast<int>(id)];
}

View file

@ -803,7 +803,7 @@ void CMinecraftApp::InitGameSettings()
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
GameSettingsA[i]=(GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(i);
#else
GameSettingsA[i]=(GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(i);
GameSettingsA[i]=static_cast<GAME_SETTINGS *>(ProfileManager.GetGameDefinedProfileData(i));
#endif
// clear the flag to say the settings have changed
GameSettingsA[i]->bSettingsChanged=false;
@ -933,7 +933,7 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C4JStorage::PROFILESETTI
int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad)
#endif
{
CMinecraftApp *pApp=(CMinecraftApp *)pParam;
CMinecraftApp *pApp=static_cast<CMinecraftApp *>(pParam);
// flag the default options to be set
@ -1368,20 +1368,20 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
case eGameSetting_MusicVolume:
if(iPad==ProfileManager.GetPrimaryPad())
{
pMinecraft->options->set(Options::Option::MUSIC,((float)GameSettingsA[iPad]->ucMusicVolume)/100.0f);
pMinecraft->options->set(Options::Option::MUSIC,static_cast<float>(GameSettingsA[iPad]->ucMusicVolume)/100.0f);
}
break;
case eGameSetting_SoundFXVolume:
if(iPad==ProfileManager.GetPrimaryPad())
{
pMinecraft->options->set(Options::Option::SOUND,((float)GameSettingsA[iPad]->ucSoundFXVolume)/100.0f);
pMinecraft->options->set(Options::Option::SOUND,static_cast<float>(GameSettingsA[iPad]->ucSoundFXVolume)/100.0f);
}
break;
case eGameSetting_Gamma:
if(iPad==ProfileManager.GetPrimaryPad())
{
#if defined(_WIN64) || defined(_WINDOWS64)
pMinecraft->options->set(Options::Option::GAMMA, ((float)GameSettingsA[iPad]->ucGamma) / 100.0f);
pMinecraft->options->set(Options::Option::GAMMA, static_cast<float>(GameSettingsA[iPad]->ucGamma) / 100.0f);
#else
// ucGamma range is 0-100, UpdateGamma is 0 - 32768
float fVal=((float)GameSettingsA[iPad]->ucGamma)*327.68f;
@ -1417,7 +1417,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
case eGameSetting_Sensitivity_InGame:
// 4J-PB - we don't use the options value
// tell the input that we've changed the sensitivity - range of the slider is 0 to 200, default is 100
pMinecraft->options->set(Options::Option::SENSITIVITY,((float)GameSettingsA[iPad]->ucSensitivity)/100.0f);
pMinecraft->options->set(Options::Option::SENSITIVITY,static_cast<float>(GameSettingsA[iPad]->ucSensitivity)/100.0f);
//InputManager.SetJoypadSensitivity(iPad,((float)GameSettingsA[iPad]->ucSensitivity)/100.0f);
break;
@ -1697,7 +1697,7 @@ unsigned char CMinecraftApp::GetPlayerFavoriteSkinsPos(int iPad)
void CMinecraftApp::SetPlayerFavoriteSkinsPos(int iPad, int iPos)
{
GameSettingsA[iPad]->ucCurrentFavoriteSkinPos=(unsigned char)iPos;
GameSettingsA[iPad]->ucCurrentFavoriteSkinPos=static_cast<unsigned char>(iPos);
GameSettingsA[iPad]->bSettingsChanged = true;
}
@ -2644,7 +2644,7 @@ int CMinecraftApp::DisplaySavingMessage(void *pParam, C4JStorage::ESavingMessage
void CMinecraftApp::SetActionConfirmed(LPVOID param)
{
XuiActionParam *actionInfo = (XuiActionParam *)param;
XuiActionParam *actionInfo = static_cast<XuiActionParam *>(param);
app.SetAction(actionInfo->iPad, actionInfo->action);
}
@ -2800,7 +2800,7 @@ void CMinecraftApp::HandleXuiActions(void)
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &UIScene_PauseMenu::SaveWorldThreadProc;
loadingParams->lpParam = (LPVOID)false;
loadingParams->lpParam = static_cast<LPVOID>(false);
// 4J-JEV - PS4: Fix for #5708 - [ONLINE] - If the user pulls their network cable out while saving the title will hang.
loadingParams->waitForThreadToDelete = true;
@ -2861,7 +2861,7 @@ void CMinecraftApp::HandleXuiActions(void)
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &UIScene_PauseMenu::SaveWorldThreadProc;
loadingParams->lpParam = (LPVOID)true;
loadingParams->lpParam = (LPVOID)(true);
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground=TRUE;
@ -3692,7 +3692,7 @@ void CMinecraftApp::HandleXuiActions(void)
if(pTexPack->hasAudio())
{
// get the dlc texture pack, and store it
pDLCTexPack=(DLCTexturePack *)pTexPack;
pDLCTexPack=static_cast<DLCTexturePack *>(pTexPack);
}
// change to the default texture pack
@ -3745,7 +3745,7 @@ void CMinecraftApp::HandleXuiActions(void)
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::ExitAndJoinFromInviteThreadProc;
loadingParams->lpParam = (LPVOID)&m_InviteData;
loadingParams->lpParam = static_cast<LPVOID>(&m_InviteData);
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground=TRUE;
@ -3768,7 +3768,7 @@ void CMinecraftApp::HandleXuiActions(void)
g_NetworkManager.SetLocalGame(false);
JoinFromInviteData *inviteData = (JoinFromInviteData *)param;
JoinFromInviteData *inviteData = static_cast<JoinFromInviteData *>(param);
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
@ -3894,7 +3894,7 @@ void CMinecraftApp::HandleXuiActions(void)
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
SetDefaultOptions((C4JStorage::PROFILESETTINGS *)param,i);
#else
SetDefaultOptions((C_4JProfile::PROFILESETTINGS *)param,i);
SetDefaultOptions(static_cast<C_4JProfile::PROFILESETTINGS *>(param),i);
#endif
// if the profile data has been changed, then force a profile write
@ -4312,7 +4312,7 @@ void CMinecraftApp::HandleXuiActions(void)
int CMinecraftApp::BannedLevelDialogReturned(void *pParam,int iPad,const C4JStorage::EMessageResult result)
{
CMinecraftApp* pApp = (CMinecraftApp*)pParam;
CMinecraftApp* pApp = static_cast<CMinecraftApp *>(pParam);
//Minecraft *pMinecraft=Minecraft::GetInstance();
if(result==C4JStorage::EMessage_ResultAccept)
@ -4721,7 +4721,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes
int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
CMinecraftApp* pApp = (CMinecraftApp*)pParam;
CMinecraftApp* pApp = static_cast<CMinecraftApp *>(pParam);
Minecraft *pMinecraft=Minecraft::GetInstance();
if(result==C4JStorage::EMessage_ResultAccept)
@ -4793,7 +4793,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes
int CMinecraftApp::TrialOverReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
CMinecraftApp* pApp = (CMinecraftApp*)pParam;
CMinecraftApp* pApp = static_cast<CMinecraftApp *>(pParam);
Minecraft *pMinecraft=Minecraft::GetInstance();
if(result==C4JStorage::EMessage_ResultAccept)
@ -4851,7 +4851,7 @@ int CMinecraftApp::TrialOverReturned(void *pParam,int iPad,C4JStorage::EMessageR
void CMinecraftApp::ProfileReadErrorCallback(void *pParam)
{
CMinecraftApp *pApp=(CMinecraftApp *)pParam;
CMinecraftApp *pApp=static_cast<CMinecraftApp *>(pParam);
int iPrimaryPlayer=ProfileManager.GetPrimaryPad();
pApp->SetAction(iPrimaryPlayer, eAppAction_ProfileReadError);
}
@ -4883,7 +4883,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
Minecraft::GetInstance()->user->name = convStringToWstring( ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
#endif
CMinecraftApp *pApp=(CMinecraftApp *)pParam;
CMinecraftApp *pApp=static_cast<CMinecraftApp *>(pParam);
// check if the primary player signed out
int iPrimaryPlayer=ProfileManager.GetPrimaryPad();
@ -5058,7 +5058,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
void CMinecraftApp::NotificationsCallback(LPVOID pParam,DWORD dwNotification, unsigned int uiParam)
{
CMinecraftApp* pClass = (CMinecraftApp*)pParam;
CMinecraftApp* pClass = static_cast<CMinecraftApp *>(pParam);
// push these on to the notifications to be handled in qnet's dowork
@ -5247,7 +5247,7 @@ void CMinecraftApp::SetDebugSequence(const char *pchSeq)
}
int CMinecraftApp::DebugInputCallback(LPVOID pParam)
{
CMinecraftApp* pClass = (CMinecraftApp*)pParam;
CMinecraftApp* pClass = static_cast<CMinecraftApp *>(pParam);
//printf("sequence matched\n");
pClass->m_bDebugOptions=!pClass->m_bDebugOptions;
@ -5592,7 +5592,7 @@ void CMinecraftApp::InitTime()
// Get the frequency of the timer
LARGE_INTEGER qwTicksPerSec;
QueryPerformanceFrequency( &qwTicksPerSec );
m_Time.fSecsPerTick = 1.0f / (float)qwTicksPerSec.QuadPart;
m_Time.fSecsPerTick = 1.0f / static_cast<float>(qwTicksPerSec.QuadPart);
// Save the start time
QueryPerformanceCounter( &m_Time.qwTime );
@ -5618,8 +5618,8 @@ void CMinecraftApp::UpdateTime()
m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart;
m_Time.qwTime.QuadPart = qwNewTime.QuadPart;
m_Time.fElapsedTime = m_Time.fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart));
m_Time.fElapsedTime = m_Time.fSecsPerTick * static_cast<FLOAT>(qwDeltaTime.QuadPart);
m_Time.fAppTime = m_Time.fSecsPerTick * static_cast<FLOAT>(m_Time.qwAppTime.QuadPart);
}
@ -5913,7 +5913,7 @@ void CMinecraftApp::ProcessInvite(DWORD dwUserIndex, DWORD dwLocalUsersMask, con
int CMinecraftApp::ExitAndJoinFromInvite(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
CMinecraftApp* pApp = (CMinecraftApp*)pParam;
CMinecraftApp* pApp = static_cast<CMinecraftApp *>(pParam);
//Minecraft *pMinecraft=Minecraft::GetInstance();
// buttons are swapped on this menu
@ -5927,7 +5927,7 @@ int CMinecraftApp::ExitAndJoinFromInvite(void *pParam,int iPad,C4JStorage::EMess
int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
CMinecraftApp *pClass = (CMinecraftApp *)pParam;
CMinecraftApp *pClass = static_cast<CMinecraftApp *>(pParam);
// Exit with or without saving
// Decline means save in this dialog
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption)
@ -7487,7 +7487,7 @@ int CMinecraftApp::ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4
{
#ifndef _XBOX
// Inform fullscreen progress scene that it's not being cancelled after all
UIScene_FullscreenProgress *pScene = (UIScene_FullscreenProgress *)ui.FindScene(eUIScene_FullscreenProgress);
UIScene_FullscreenProgress *pScene = static_cast<UIScene_FullscreenProgress *>(ui.FindScene(eUIScene_FullscreenProgress));
#ifdef __PS3__
if(pScene!=NULL)
#else
@ -7565,7 +7565,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, char *ps
if(bWriteToTMS)
{
DWORD dwDataBytes=(DWORD)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size());
DWORD dwDataBytes=static_cast<DWORD>(sizeof(BANNEDLISTDATA) * m_vBannedListA[iPad]->size());
PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new CHAR [dwDataBytes]);
int iCount=0;
for (PBANNEDLISTDATA pData : *m_vBannedListA[iPad] )
@ -7638,7 +7638,7 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid, cha
}
}
DWORD dwDataBytes=(DWORD)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size());
DWORD dwDataBytes=static_cast<DWORD>(sizeof(BANNEDLISTDATA) * m_vBannedListA[iPad]->size());
if(dwDataBytes==0)
{
// wipe the file
@ -7652,7 +7652,7 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid, cha
{
PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new BYTE [dwDataBytes]);
int iSize=(int)m_vBannedListA[iPad]->size();
int iSize=static_cast<int>(m_vBannedListA[iPad]->size());
for(int i=0;i<iSize;i++)
{
PBANNEDLISTDATA pBannedListData =m_vBannedListA[iPad]->at(i);
@ -7706,7 +7706,7 @@ bool CMinecraftApp::AlreadySeenCreditText(const wstring &wstemp)
unsigned int CMinecraftApp::GetDLCCreditsCount()
{
return (unsigned int)vDLCCredits.size();
return static_cast<unsigned int>(vDLCCredits.size());
}
SCreditTextItemDef * CMinecraftApp::GetDLCCredits(int iIndex)
@ -8825,7 +8825,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto
{
#endif
CMinecraftApp* pClass = (CMinecraftApp *) pParam;
CMinecraftApp* pClass = static_cast<CMinecraftApp *>(pParam);
// find the right one in the vector
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
@ -9086,7 +9086,7 @@ void CMinecraftApp::ClearTMSPPFilesRetrieved()
int CMinecraftApp::DLCOffersReturned(void *pParam, int iOfferC, DWORD dwType, int iPad)
{
CMinecraftApp* pClass = (CMinecraftApp *) pParam;
CMinecraftApp* pClass = static_cast<CMinecraftApp *>(pParam);
// find the right one in the vector
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
@ -9111,10 +9111,10 @@ eDLCContentType CMinecraftApp::Find_eDLCContentType(DWORD dwType)
{
if(m_dwContentTypeA[i]==dwType)
{
return (eDLCContentType)i;
return static_cast<eDLCContentType>(i);
}
}
return (eDLCContentType)0;
return static_cast<eDLCContentType>(0);
}
bool CMinecraftApp::DLCContentRetrieved(eDLCMarketplaceType eType)
{
@ -9457,18 +9457,18 @@ int CMinecraftApp::GetDLCInfoFullOffersCount()
#else
int CMinecraftApp::GetDLCInfoTrialOffersCount()
{
return (int)DLCInfo_Trial.size();
return static_cast<int>(DLCInfo_Trial.size());
}
int CMinecraftApp::GetDLCInfoFullOffersCount()
{
return (int)DLCInfo_Full.size();
return static_cast<int>(DLCInfo_Full.size());
}
#endif
int CMinecraftApp::GetDLCInfoTexturesOffersCount()
{
return (int)DLCTextures_PackID.size();
return static_cast<int>(DLCTextures_PackID.size());
}
// AUTOSAVE

View file

@ -625,7 +625,7 @@ public:
virtual void ReleaseSaveThumbnail()=0;
virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize)=0;
virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false)=0;
virtual void ReadBannedList(int iPad, eTMSAction action=static_cast<eTMSAction>(0), bool bCallback=false)=0;
private:

View file

@ -40,7 +40,7 @@ DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const wstring &
{
if(paramName.compare(wchTypeNamesA[i]) == 0)
{
type = (EAudioParameterType)i;
type = static_cast<EAudioParameterType>(i);
break;
}
}
@ -87,7 +87,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
{
i++;
}
int iLast=(int)creditValue.find_last_of(L" ",i);
int iLast=static_cast<int>(creditValue.find_last_of(L" ", i));
switch(XGetLanguage())
{
case XC_LANGUAGE_JAPANESE:
@ -96,7 +96,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
iLast = maximumChars;
break;
default:
iLast=(int)creditValue.find_last_of(L" ",i);
iLast=static_cast<int>(creditValue.find_last_of(L" ", i));
break;
}
@ -145,7 +145,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
for(unsigned int i=0;i<uiParameterTypeCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData);
wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
EAudioParameterType type = getParameterType(parameterName);
if( type != e_AudioParamType_Invalid )
{
@ -169,7 +169,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
for(unsigned int i=0;i<uiFileCount;i++)
{
EAudioType type = (EAudioType)pFile->dwType;
EAudioType type = static_cast<EAudioType>(pFile->dwType);
// Params
unsigned int uiParameterCount=*(unsigned int *)pbTemp;
pbTemp+=sizeof(int);
@ -182,7 +182,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
if(it != parameterMapping.end() )
{
addParameter(type,(EAudioParameterType)pParams->dwType,(WCHAR *)pParams->wchData);
addParameter(type,static_cast<EAudioParameterType>(pParams->dwType),(WCHAR *)pParams->wchData);
}
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount);
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;

View file

@ -47,7 +47,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring &paramN
{
if(paramName.compare(wchTypeNamesA[i]) == 0)
{
type = (EDLCParameterType)i;
type = static_cast<EDLCParameterType>(i);
break;
}
}
@ -70,7 +70,7 @@ DWORD DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/)
}
else
{
packCount = (DWORD)m_packs.size();
packCount = static_cast<DWORD>(m_packs.size());
}
return packCount;
}
@ -403,7 +403,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
for(unsigned int i=0;i<uiParameterCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData);
wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
if( type != DLCManager::e_DLCParamType_Invalid )
{
@ -429,7 +429,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
for(unsigned int i=0;i<uiFileCount;i++)
{
DLCManager::EDLCType type = (DLCManager::EDLCType)pFile->dwType;
DLCManager::EDLCType type = static_cast<DLCManager::EDLCType>(pFile->dwType);
DLCFile *dlcFile = NULL;
DLCPack *dlcTexturePack = NULL;
@ -608,7 +608,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
for(unsigned int i=0;i<uiParameterCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData);
wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
if( type != DLCManager::e_DLCParamType_Invalid )
{
@ -633,7 +633,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
for(unsigned int i=0;i<uiFileCount;i++)
{
DLCManager::EDLCType type = (DLCManager::EDLCType)pFile->dwType;
DLCManager::EDLCType type = static_cast<DLCManager::EDLCType>(pFile->dwType);
// Params
uiParameterCount=*(unsigned int *)pbTemp;
@ -649,7 +649,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
{
if(it->second==e_DLCParamType_PackId)
{
wstring wsTemp=(WCHAR *)pParams->wchData;
wstring wsTemp=static_cast<WCHAR *>(pParams->wchData);
std::wstringstream ss;
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
ss << std::dec << wsTemp.c_str();

View file

@ -156,7 +156,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type, const wstring &va
m_dataPath = value;
break;
default:
m_parameters[(int)type] = value;
m_parameters[static_cast<int>(type)] = value;
break;
}
}
@ -263,7 +263,7 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const wstring &path
bool hasFile = false;
if(type == DLCManager::e_DLCType_All)
{
for(DLCManager::EDLCType currentType = (DLCManager::EDLCType)0; currentType < DLCManager::e_DLCType_Max; currentType = (DLCManager::EDLCType)(currentType + 1))
for(DLCManager::EDLCType currentType = static_cast<DLCManager::EDLCType>(0); currentType < DLCManager::e_DLCType_Max; currentType = static_cast<DLCManager::EDLCType>(currentType + 1))
{
hasFile = doesPackContainFile(currentType,path);
if(hasFile) break;
@ -287,7 +287,7 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index)
DLCFile *file = NULL;
if(type == DLCManager::e_DLCType_All)
{
for(DLCManager::EDLCType currentType = (DLCManager::EDLCType)0; currentType < DLCManager::e_DLCType_Max; currentType = (DLCManager::EDLCType)(currentType + 1))
for(DLCManager::EDLCType currentType = static_cast<DLCManager::EDLCType>(0); currentType < DLCManager::e_DLCType_Max; currentType = static_cast<DLCManager::EDLCType>(currentType + 1))
{
file = getFile(currentType,index);
if(file != NULL) break;
@ -309,7 +309,7 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const wstring &path)
DLCFile *file = NULL;
if(type == DLCManager::e_DLCType_All)
{
for(DLCManager::EDLCType currentType = (DLCManager::EDLCType)0; currentType < DLCManager::e_DLCType_Max; currentType = (DLCManager::EDLCType)(currentType + 1))
for(DLCManager::EDLCType currentType = static_cast<DLCManager::EDLCType>(0); currentType < DLCManager::e_DLCType_Max; currentType = static_cast<DLCManager::EDLCType>(currentType + 1))
{
file = getFile(currentType,path);
if(file != NULL) break;
@ -346,11 +346,11 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT
case DLCManager::e_DLCType_All:
for(int i = 0; i < DLCManager::e_DLCType_Max; ++i)
{
count += getDLCItemsCount((DLCManager::EDLCType)i);
count += getDLCItemsCount(static_cast<DLCManager::EDLCType>(i));
}
break;
default:
count = (DWORD)m_files[(int)type].size();
count = static_cast<DWORD>(m_files[(int)type].size());
break;
};
return count;
@ -425,7 +425,7 @@ void DLCPack::UpdateLanguage()
if(m_files[DLCManager::e_DLCType_LocalisationData].size() > 0)
{
file = m_files[DLCManager::e_DLCType_LocalisationData][0];
DLCLocalisationFile *localisationFile = (DLCLocalisationFile *)getFile(DLCManager::e_DLCType_LocalisationData, L"languages.loc");
DLCLocalisationFile *localisationFile = static_cast<DLCLocalisationFile *>(getFile(DLCManager::e_DLCType_LocalisationData, L"languages.loc"));
StringTable *strTable = localisationFile->getStringTable();
strTable->ReloadStringTable();
}

View file

@ -87,8 +87,8 @@ public:
DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
DWORD getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
DLCSkinFile *getSkinFile(const wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
DLCSkinFile *getSkinFile(const wstring &path) { return static_cast<DLCSkinFile *>(getFile(DLCManager::e_DLCType_Skin, path)); }
DLCSkinFile *getSkinFile(DWORD index) { return static_cast<DLCSkinFile *>(getFile(DLCManager::e_DLCType_Skin, index)); }
bool doesPackContainSkin(const wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
bool hasPurchasedFile(DLCManager::EDLCType type, const wstring &path);

View file

@ -79,7 +79,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
{
i++;
}
int iLast=(int)creditValue.find_last_of(L" ",i);
int iLast=static_cast<int>(creditValue.find_last_of(L" ", i));
switch(XGetLanguage())
{
case XC_LANGUAGE_JAPANESE:
@ -88,7 +88,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
iLast = maximumChars;
break;
default:
iLast=(int)creditValue.find_last_of(L" ",i);
iLast=static_cast<int>(creditValue.find_last_of(L" ", i));
break;
}
@ -178,7 +178,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
int DLCSkinFile::getAdditionalBoxesCount()
{
return (int)m_AdditionalBoxes.size();
return static_cast<int>(m_AdditionalBoxes.size());
}
vector<SKIN_BOX *> *DLCSkinFile::getAdditionalBoxes()
{

View file

@ -45,7 +45,7 @@ GameRuleDefinition *AddItemRuleDefinition::addChild(ConsoleGameRules::EGameRuleT
if(ruleType == ConsoleGameRules::eGameRuleType_AddEnchantment)
{
rule = new AddEnchantmentRuleDefinition();
m_enchantments.push_back((AddEnchantmentRuleDefinition *)rule);
m_enchantments.push_back(static_cast<AddEnchantmentRuleDefinition *>(rule));
}
else
{

View file

@ -72,20 +72,20 @@ void ApplySchematicRuleDefinition::addAttribute(const wstring &attributeName, co
else if(attributeName.compare(L"x") == 0)
{
m_location->x = _fromString<int>(attributeValue);
if( ((int)abs(m_location->x))%2 != 0) m_location->x -=1;
if( static_cast<int>(abs(m_location->x))%2 != 0) m_location->x -=1;
//app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter x=%f\n",m_location->x);
}
else if(attributeName.compare(L"y") == 0)
{
m_location->y = _fromString<int>(attributeValue);
if( ((int)abs(m_location->y))%2 != 0) m_location->y -= 1;
if( static_cast<int>(abs(m_location->y))%2 != 0) m_location->y -= 1;
if(m_location->y < 0) m_location->y = 0;
//app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter y=%f\n",m_location->y);
}
else if(attributeName.compare(L"z") == 0)
{
m_location->z = _fromString<int>(attributeValue);
if(((int)abs(m_location->z))%2 != 0) m_location->z -= 1;
if(static_cast<int>(abs(m_location->z))%2 != 0) m_location->z -= 1;
//app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter z=%f\n",m_location->z);
}
else if(attributeName.compare(L"rot") == 0)
@ -95,7 +95,7 @@ void ApplySchematicRuleDefinition::addAttribute(const wstring &attributeName, co
while(degrees < 0) degrees += 360;
while(degrees >= 360) degrees -= 360;
float quad = degrees/90;
degrees = (int)(quad + 0.5f);
degrees = static_cast<int>(quad + 0.5f);
switch(degrees)
{
case 1:

View file

@ -58,7 +58,7 @@ void CompleteAllRuleDefinition::updateStatus(GameRule *rule)
wstring CompleteAllRuleDefinition::generateDescriptionString(const wstring &description, void *data, int dataLength)
{
PacketData *values = (PacketData *)data;
PacketData *values = static_cast<PacketData *>(data);
wstring newDesc = description;
newDesc = replaceAll(newDesc,L"{*progress*}",std::to_wstring(values->progress));
newDesc = replaceAll(newDesc,L"{*goal*}",std::to_wstring(values->goal));

View file

@ -29,22 +29,22 @@ GameRuleDefinition *ConsoleGenerateStructure::addChild(ConsoleGameRules::EGameRu
if(ruleType == ConsoleGameRules::eGameRuleType_GenerateBox)
{
rule = new XboxStructureActionGenerateBox();
m_actions.push_back((XboxStructureActionGenerateBox *)rule);
m_actions.push_back(static_cast<XboxStructureActionGenerateBox *>(rule));
}
else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceBlock)
{
rule = new XboxStructureActionPlaceBlock();
m_actions.push_back((XboxStructureActionPlaceBlock *)rule);
m_actions.push_back(static_cast<XboxStructureActionPlaceBlock *>(rule));
}
else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceContainer)
{
rule = new XboxStructureActionPlaceContainer();
m_actions.push_back((XboxStructureActionPlaceContainer *)rule);
m_actions.push_back(static_cast<XboxStructureActionPlaceContainer *>(rule));
}
else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceSpawner)
{
rule = new XboxStructureActionPlaceSpawner();
m_actions.push_back((XboxStructureActionPlaceSpawner *)rule);
m_actions.push_back(static_cast<XboxStructureActionPlaceSpawner *>(rule));
}
else
{
@ -139,25 +139,25 @@ bool ConsoleGenerateStructure::postProcess(Level *level, Random *random, Boundin
{
case ConsoleGameRules::eGameRuleType_GenerateBox:
{
XboxStructureActionGenerateBox *genBox = (XboxStructureActionGenerateBox *)action;
XboxStructureActionGenerateBox *genBox = static_cast<XboxStructureActionGenerateBox *>(action);
genBox->generateBoxInLevel(this,level,chunkBB);
}
break;
case ConsoleGameRules::eGameRuleType_PlaceBlock:
{
XboxStructureActionPlaceBlock *pPlaceBlock = (XboxStructureActionPlaceBlock *)action;
XboxStructureActionPlaceBlock *pPlaceBlock = static_cast<XboxStructureActionPlaceBlock *>(action);
pPlaceBlock->placeBlockInLevel(this,level,chunkBB);
}
break;
case ConsoleGameRules::eGameRuleType_PlaceContainer:
{
XboxStructureActionPlaceContainer *pPlaceContainer = (XboxStructureActionPlaceContainer *)action;
XboxStructureActionPlaceContainer *pPlaceContainer = static_cast<XboxStructureActionPlaceContainer *>(action);
pPlaceContainer->placeContainerInLevel(this,level,chunkBB);
}
break;
case ConsoleGameRules::eGameRuleType_PlaceSpawner:
{
XboxStructureActionPlaceSpawner *pPlaceSpawner = (XboxStructureActionPlaceSpawner *)action;
XboxStructureActionPlaceSpawner *pPlaceSpawner = static_cast<XboxStructureActionPlaceSpawner *>(action);
pPlaceSpawner->placeSpawnerInLevel(this,level,chunkBB);
}
break;

View file

@ -36,7 +36,7 @@ public:
virtual int getMinY();
EStructurePiece GetType() { return (EStructurePiece)0; }
EStructurePiece GetType() { return static_cast<EStructurePiece>(0); }
void addAdditonalSaveData(CompoundTag *tag) {}
void readAdditonalSaveData(CompoundTag *tag) {}
};

View file

@ -61,7 +61,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
if (version > XBOX_SCHEMATIC_ORIGINAL_VERSION) // Or later versions
{
compressionType = (Compression::ECompressionTypes)dis->readByte();
compressionType = static_cast<Compression::ECompressionTypes>(dis->readByte());
}
if (version > XBOX_SCHEMATIC_CURRENT_VERSION)
@ -146,14 +146,14 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
if( type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME )
{
x = ((IntTag *) eTag->get(L"TileX") )->data;
y = ((IntTag *) eTag->get(L"TileY") )->data;
z = ((IntTag *) eTag->get(L"TileZ") )->data;
x = static_cast<IntTag *>(eTag->get(L"TileX"))->data;
y = static_cast<IntTag *>(eTag->get(L"TileY"))->data;
z = static_cast<IntTag *>(eTag->get(L"TileZ"))->data;
}
#ifdef _DEBUG
//app.DebugPrintf(1,"Loaded entity type %d at (%f,%f,%f)\n",(int)type,x,y,z);
#endif
m_entities.push_back( pair<Vec3 *, CompoundTag *>(Vec3::newPermanent(x,y,z),(CompoundTag *)eTag->copy()));
m_entities.push_back( pair<Vec3 *, CompoundTag *>(Vec3::newPermanent(x,y,z),static_cast<CompoundTag *>(eTag->copy())));
}
}
delete tag;
@ -178,7 +178,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
tag->put(L"Entities", entityTags);
for (auto& it : m_entities )
entityTags->add( (CompoundTag *)(it).second->copy() );
entityTags->add( static_cast<CompoundTag *>((it).second->copy()) );
NbtIo::write(tag,dos);
delete tag;
@ -186,15 +186,15 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
{
int xStart = static_cast<int>(std::fmax<double>(destinationBox->x0, (double)chunk->x*16));
int xEnd = static_cast<int>(std::fmin<double>(destinationBox->x1, (double)((xStart >> 4) << 4) + 16));
int xStart = static_cast<int>(std::fmax<double>(destinationBox->x0, static_cast<double>(chunk->x)*16));
int xEnd = static_cast<int>(std::fmin<double>(destinationBox->x1, static_cast<double>((xStart >> 4) << 4) + 16));
int yStart = destinationBox->y0;
int yEnd = destinationBox->y1;
if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight;
int zStart = static_cast<int>(std::fmax<double>(destinationBox->z0, (double)chunk->z * 16));
int zEnd = static_cast<int>(std::fmin<double>(destinationBox->z1, (double)((zStart >> 4) << 4) + 16));
int zStart = static_cast<int>(std::fmax<double>(destinationBox->z0, static_cast<double>(chunk->z) * 16));
int zEnd = static_cast<int>(std::fmin<double>(destinationBox->z1, static_cast<double>((zStart >> 4) << 4) + 16));
#ifdef _DEBUG
app.DebugPrintf("Range is (%d,%d,%d) to (%d,%d,%d)\n",xStart,yStart,zStart,xEnd-1,yEnd-1,zEnd-1);
@ -442,7 +442,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ);
if( chunkBox->containsIncludingLowerBound(pos) )
{
shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
shared_ptr<TileEntity> teCopy = chunk->getTileEntity( static_cast<int>(targetX) & 15, static_cast<int>(targetY) & 15, static_cast<int>(targetZ) & 15 );
if ( teCopy != NULL )
{
@ -726,9 +726,9 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
if( e->instanceof(eTYPE_HANGING_ENTITY) )
{
((IntTag *) eTag->get(L"TileX") )->data -= xStart;
((IntTag *) eTag->get(L"TileY") )->data -= yStart;
((IntTag *) eTag->get(L"TileZ") )->data -= zStart;
static_cast<IntTag *>(eTag->get(L"TileX"))->data -= xStart;
static_cast<IntTag *>(eTag->get(L"TileY"))->data -= yStart;
static_cast<IntTag *>(eTag->get(L"TileZ"))->data -= zStart;
}
entitiesTag->add(eTag);

View file

@ -95,14 +95,14 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
if(pack->doesPackContainFile(DLCManager::e_DLCType_LocalisationData,L"languages.loc"))
{
DLCLocalisationFile *localisationFile = (DLCLocalisationFile *)pack->getFile(DLCManager::e_DLCType_LocalisationData, L"languages.loc");
DLCLocalisationFile *localisationFile = static_cast<DLCLocalisationFile *>(pack->getFile(DLCManager::e_DLCType_LocalisationData, L"languages.loc"));
strings = localisationFile->getStringTable();
}
int gameRulesCount = pack->getDLCItemsCount(DLCManager::e_DLCType_GameRulesHeader);
for(int i = 0; i < gameRulesCount; ++i)
{
DLCGameRulesHeader *dlcHeader = (DLCGameRulesHeader *)pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i);
DLCGameRulesHeader *dlcHeader = static_cast<DLCGameRulesHeader *>(pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i));
DWORD dSize;
byte *dData = dlcHeader->getData(dSize);
@ -120,7 +120,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
gameRulesCount = pack->getDLCItemsCount(DLCManager::e_DLCType_GameRules);
for (int i = 0; i < gameRulesCount; ++i)
{
DLCGameRulesFile *dlcFile = (DLCGameRulesFile *)pack->getFile(DLCManager::e_DLCType_GameRules, i);
DLCGameRulesFile *dlcFile = static_cast<DLCGameRulesFile *>(pack->getFile(DLCManager::e_DLCType_GameRules, i));
DWORD dSize;
byte *dData = dlcFile->getData(dSize);
@ -182,7 +182,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
compr_content(new BYTE[compr_len], compr_len);
dis.read(compr_content);
Compression::getCompression()->SetDecompressionType( (Compression::ECompressionTypes)compression_type );
Compression::getCompression()->SetDecompressionType( static_cast<Compression::ECompressionTypes>(compression_type) );
Compression::getCompression()->DecompressLZXRLE( content.data, &content.length,
compr_content.data, compr_content.length);
Compression::getCompression()->SetDecompressionType( SAVE_FILE_PLATFORM_LOCAL );
@ -469,13 +469,13 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
tagsAndAtts.push_back( contentDis->readUTF() );
unordered_map<int, ConsoleGameRules::EGameRuleType> tagIdMap;
for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < (int)ConsoleGameRules::eGameRuleType_Count; ++type)
for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < static_cast<int>(ConsoleGameRules::eGameRuleType_Count); ++type)
{
for(UINT i = 0; i < numStrings; ++i)
{
if(tagsAndAtts[i].compare(wchTagNameA[type]) == 0)
{
tagIdMap.insert( unordered_map<int, ConsoleGameRules::EGameRuleType>::value_type(i, (ConsoleGameRules::EGameRuleType)type) );
tagIdMap.insert( unordered_map<int, ConsoleGameRules::EGameRuleType>::value_type(i, static_cast<ConsoleGameRules::EGameRuleType>(type)) );
break;
}
}

View file

@ -145,22 +145,22 @@ GameRuleDefinition *LevelGenerationOptions::addChild(ConsoleGameRules::EGameRule
if(ruleType == ConsoleGameRules::eGameRuleType_ApplySchematic)
{
rule = new ApplySchematicRuleDefinition(this);
m_schematicRules.push_back((ApplySchematicRuleDefinition *)rule);
m_schematicRules.push_back(static_cast<ApplySchematicRuleDefinition *>(rule));
}
else if(ruleType == ConsoleGameRules::eGameRuleType_GenerateStructure)
{
rule = new ConsoleGenerateStructure();
m_structureRules.push_back((ConsoleGenerateStructure *)rule);
m_structureRules.push_back(static_cast<ConsoleGenerateStructure *>(rule));
}
else if(ruleType == ConsoleGameRules::eGameRuleType_BiomeOverride)
{
rule = new BiomeOverride();
m_biomeOverrides.push_back((BiomeOverride *)rule);
m_biomeOverrides.push_back(static_cast<BiomeOverride *>(rule));
}
else if(ruleType == ConsoleGameRules::eGameRuleType_StartFeature)
{
rule = new StartFeature();
m_features.push_back((StartFeature *)rule);
m_features.push_back(static_cast<StartFeature *>(rule));
}
else
{
@ -485,7 +485,7 @@ void LevelGenerationOptions::loadBaseSaveData()
int LevelGenerationOptions::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask)
{
LevelGenerationOptions *lgo = (LevelGenerationOptions *)pParam;
LevelGenerationOptions *lgo = static_cast<LevelGenerationOptions *>(pParam);
lgo->m_bLoadingData = false;
if(dwErr!=ERROR_SUCCESS)
{
@ -499,7 +499,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD
int gameRulesCount = lgo->m_parentDLCPack->getDLCItemsCount(DLCManager::e_DLCType_GameRulesHeader);
for(int i = 0; i < gameRulesCount; ++i)
{
DLCGameRulesHeader *dlcFile = (DLCGameRulesHeader *) lgo->m_parentDLCPack->getFile(DLCManager::e_DLCType_GameRulesHeader, i);
DLCGameRulesHeader *dlcFile = static_cast<DLCGameRulesHeader *>(lgo->m_parentDLCPack->getFile(DLCManager::e_DLCType_GameRulesHeader, i));
if (!dlcFile->getGrfPath().empty())
{

View file

@ -30,7 +30,7 @@ GameRuleDefinition *LevelRuleset::addChild(ConsoleGameRules::EGameRuleType ruleT
if(ruleType == ConsoleGameRules::eGameRuleType_NamedArea)
{
rule = new NamedAreaRuleDefinition();
m_areas.push_back((NamedAreaRuleDefinition *)rule);
m_areas.push_back(static_cast<NamedAreaRuleDefinition *>(rule));
}
else
{

View file

@ -47,7 +47,7 @@ void StartFeature::addAttribute(const wstring &attributeName, const wstring &att
else if(attributeName.compare(L"feature") == 0)
{
int value = _fromString<int>(attributeValue);
m_feature = (StructureFeature::EFeatureTypes)value;
m_feature = static_cast<StructureFeature::EFeatureTypes>(value);
app.DebugPrintf("StartFeature: Adding parameter feature=%d\n",m_feature);
}
else

View file

@ -69,7 +69,7 @@ GameRuleDefinition *UpdatePlayerRuleDefinition::addChild(ConsoleGameRules::EGame
if(ruleType == ConsoleGameRules::eGameRuleType_AddItem)
{
rule = new AddItemRuleDefinition();
m_items.push_back((AddItemRuleDefinition *)rule);
m_items.push_back(static_cast<AddItemRuleDefinition *>(rule));
}
else
{

View file

@ -37,7 +37,7 @@ GameRuleDefinition *XboxStructureActionPlaceContainer::addChild(ConsoleGameRules
if(ruleType == ConsoleGameRules::eGameRuleType_AddItem)
{
rule = new AddItemRuleDefinition();
m_items.push_back((AddItemRuleDefinition *)rule);
m_items.push_back(static_cast<AddItemRuleDefinition *>(rule));
}
else
{

View file

@ -6,7 +6,7 @@ LeaderboardInterface::LeaderboardInterface(LeaderboardManager *man)
m_manager = man;
m_pending = false;
m_filter = (LeaderboardManager::EFilterMode) -1;
m_filter = static_cast<LeaderboardManager::EFilterMode>(-1);
m_callback = NULL;
m_difficulty = 0;
m_type = LeaderboardManager::eStatsType_UNDEFINED;

View file

@ -197,7 +197,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
__int64 seed = 0;
if(lpParameter != NULL)
{
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
NetworkGameInitData *param = static_cast<NetworkGameInitData *>(lpParameter);
seed = param->seed;
app.setLevelGenerationOptions(param->levelGen);
@ -744,7 +744,7 @@ CGameNetworkManager::eJoinGameResult CGameNetworkManager::JoinGame(FriendSession
// Make sure that the Primary Pad is in by default
localUsersMask |= GetLocalPlayerMask( ProfileManager.GetPrimaryPad() );
return (eJoinGameResult)(s_pPlatformNetworkManager->JoinGame( searchResult, localUsersMask, primaryUserIndex ));
return static_cast<eJoinGameResult>(s_pPlatformNetworkManager->JoinGame(searchResult, localUsersMask, primaryUserIndex));
}
void CGameNetworkManager::CancelJoinGame(LPVOID lpParam)
@ -762,7 +762,7 @@ bool CGameNetworkManager::LeaveGame(bool bMigrateHost)
int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad)
{
INVITE_INFO * pInviteInfo = (INVITE_INFO *)pParam;
INVITE_INFO * pInviteInfo = static_cast<INVITE_INFO *>(pParam);
if(bContinue==true)
{
@ -932,7 +932,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
__int64 seed = 0;
if(lpParameter != NULL)
{
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
NetworkGameInitData *param = static_cast<NetworkGameInitData *>(lpParameter);
seed = param->seed;
app.SetGameHostOption(eGameHostOption_All,param->settings);
@ -988,7 +988,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
// Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in
#if !defined(__PS3__) && !defined(__PSVITA__)
JoinFromInviteData *inviteData = (JoinFromInviteData *)lpParam;
JoinFromInviteData *inviteData = static_cast<JoinFromInviteData *>(lpParam);
app.SetAction(inviteData->dwUserIndex, eAppAction_JoinFromInvite, lpParam);
#else
if(ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()))

View file

@ -23,7 +23,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
bool createFakeSocket = false;
bool localPlayer = false;
NetworkPlayerXbox *networkPlayer = (NetworkPlayerXbox *)addNetworkPlayer(pQNetPlayer);
NetworkPlayerXbox *networkPlayer = static_cast<NetworkPlayerXbox *>(addNetworkPlayer(pQNetPlayer));
if( pQNetPlayer->IsLocal() )
{
@ -540,7 +540,7 @@ void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pN
int CPlatformNetworkManagerStub::RemovePlayerOnSocketClosedThreadProc( void* lpParam )
{
INetworkPlayer *pNetworkPlayer = (INetworkPlayer *)lpParam;
INetworkPlayer *pNetworkPlayer = static_cast<INetworkPlayer *>(lpParam);
Socket *socket = pNetworkPlayer->GetSocket();
@ -667,7 +667,7 @@ wstring CPlatformNetworkManagerStub::GatherRTTStats()
for(unsigned int i = 0; i < GetPlayerCount(); ++i)
{
IQNetPlayer *pQNetPlayer = ((NetworkPlayerXbox *)GetPlayerByIndex( i ))->GetQNetPlayer();
IQNetPlayer *pQNetPlayer = static_cast<NetworkPlayerXbox *>(GetPlayerByIndex(i))->GetQNetPlayer();
if(!pQNetPlayer->IsLocal())
{
@ -711,7 +711,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
size_t nameLen = wcslen(lanSessions[i].hostName);
info->displayLabel = new wchar_t[nameLen + 1];
wcscpy_s(info->displayLabel, nameLen + 1, lanSessions[i].hostName);
info->displayLabelLength = (unsigned char)nameLen;
info->displayLabelLength = static_cast<unsigned char>(nameLen);
info->displayLabelViewableStartIndex = 0;
info->data.netVersion = lanSessions[i].netVersion;
@ -726,7 +726,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
info->data.playerCount = lanSessions[i].playerCount;
info->data.maxPlayers = lanSessions[i].maxPlayers;
info->sessionId = (SessionID)((unsigned __int64)inet_addr(lanSessions[i].hostIP) | ((unsigned __int64)lanSessions[i].hostPort << 32));
info->sessionId = (SessionID)(static_cast<unsigned __int64>(inet_addr(lanSessions[i].hostIP)) | (static_cast<unsigned __int64>(lanSessions[i].hostPort) << 32));
friendsSessions[0].push_back(info);
}
@ -766,7 +766,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
size_t nameLen = wcslen(label);
info->displayLabel = new wchar_t[nameLen+1];
wcscpy_s(info->displayLabel, nameLen + 1, label);
info->displayLabelLength = (unsigned char)nameLen;
info->displayLabelLength = static_cast<unsigned char>(nameLen);
info->displayLabelViewableStartIndex = 0;
info->data.isReadyToJoin = true;
info->data.isJoinable = true;
@ -780,7 +780,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
std::fclose(file);
}
m_searchResultsCount[0] = (int)friendsSessions[0].size();
m_searchResultsCount[0] = static_cast<int>(friendsSessions[0].size());
if (m_SessionsUpdatedCallback != NULL)
m_SessionsUpdatedCallback(m_pSearchParam);

View file

@ -16,12 +16,12 @@ unsigned char NetworkPlayerSony::GetSmallId()
void NetworkPlayerSony::SendData(INetworkPlayer *player, const void *pvData, int dataSize, bool lowPriority, bool ack)
{
// TODO - handle priority
m_sqrPlayer->SendData( ((NetworkPlayerSony *)player)->m_sqrPlayer, pvData, dataSize, ack );
m_sqrPlayer->SendData( static_cast<NetworkPlayerSony *>(player)->m_sqrPlayer, pvData, dataSize, ack );
}
bool NetworkPlayerSony::IsSameSystem(INetworkPlayer *player)
{
return m_sqrPlayer->IsSameSystem(((NetworkPlayerSony *)player)->m_sqrPlayer);
return m_sqrPlayer->IsSameSystem(static_cast<NetworkPlayerSony *>(player)->m_sqrPlayer);
}
int NetworkPlayerSony::GetOutstandingAckCount()
@ -133,5 +133,5 @@ int NetworkPlayerSony::GetTimeSinceLastChunkPacket_ms()
}
__int64 currentTime = System::currentTimeMillis();
return (int)( currentTime - m_lastChunkPacketTime );
return static_cast<int>(currentTime - m_lastChunkPacketTime);
}

View file

@ -63,7 +63,7 @@ class SQRNetworkPlayer
public:
DataPacketHeader() : m_dataSize(0), m_ackFlags(e_flag_AckUnknown) {}
DataPacketHeader(int dataSize, AckFlags ackFlags) : m_dataSize(dataSize), m_ackFlags(ackFlags) { }
AckFlags GetAckFlags() { return (AckFlags)m_ackFlags;}
AckFlags GetAckFlags() { return static_cast<AckFlags>(m_ackFlags);}
int GetDataSize() { return m_dataSize; }
};

View file

@ -39,13 +39,13 @@ static SceRemoteStorageStatus statParams;
void SonyRemoteStorage::SetRetrievedDescData()
{
DescriptionData* pDescDataTest = (DescriptionData*)m_remoteFileInfo->fileDescription;
ESavePlatform testPlatform = (ESavePlatform)MAKE_FOURCC(pDescDataTest->m_platform[0], pDescDataTest->m_platform[1], pDescDataTest->m_platform[2], pDescDataTest->m_platform[3]);
ESavePlatform testPlatform = static_cast<ESavePlatform>(MAKE_FOURCC(pDescDataTest->m_platform[0], pDescDataTest->m_platform[1], pDescDataTest->m_platform[2], pDescDataTest->m_platform[3]));
if(testPlatform == SAVE_FILE_PLATFORM_NONE)
{
// new version of the descData
DescriptionData_V2* pDescData2 = (DescriptionData_V2*)m_remoteFileInfo->fileDescription;
m_retrievedDescData.m_descDataVersion = GetU32FromHexBytes(pDescData2->m_descDataVersion);
m_retrievedDescData.m_savePlatform = (ESavePlatform)MAKE_FOURCC(pDescData2->m_platform[0], pDescData2->m_platform[1], pDescData2->m_platform[2], pDescData2->m_platform[3]);
m_retrievedDescData.m_savePlatform = static_cast<ESavePlatform>(MAKE_FOURCC(pDescData2->m_platform[0], pDescData2->m_platform[1], pDescData2->m_platform[2], pDescData2->m_platform[3]));
m_retrievedDescData.m_seed = GetU64FromHexBytes(pDescData2->m_seed);
m_retrievedDescData.m_hostOptions = GetU32FromHexBytes(pDescData2->m_hostOptions);
m_retrievedDescData.m_texturePack = GetU32FromHexBytes(pDescData2->m_texturePack);
@ -58,7 +58,7 @@ void SonyRemoteStorage::SetRetrievedDescData()
// old version,copy the data across to the new version
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
m_retrievedDescData.m_descDataVersion = 1;
m_retrievedDescData.m_savePlatform = (ESavePlatform)MAKE_FOURCC(pDescData->m_platform[0], pDescData->m_platform[1], pDescData->m_platform[2], pDescData->m_platform[3]);
m_retrievedDescData.m_savePlatform = static_cast<ESavePlatform>(MAKE_FOURCC(pDescData->m_platform[0], pDescData->m_platform[1], pDescData->m_platform[2], pDescData->m_platform[3]));
m_retrievedDescData.m_seed = GetU64FromHexBytes(pDescData->m_seed);
m_retrievedDescData.m_hostOptions = GetU32FromHexBytes(pDescData->m_hostOptions);
m_retrievedDescData.m_texturePack = GetU32FromHexBytes(pDescData->m_texturePack);
@ -73,7 +73,7 @@ void SonyRemoteStorage::SetRetrievedDescData()
void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
{
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
SonyRemoteStorage* pRemoteStorage = static_cast<SonyRemoteStorage *>(lpParam);
app.DebugPrintf("remoteStorageGetInfoCallback err : 0x%08x\n", error_code);
if(error_code == 0)
{
@ -99,7 +99,7 @@ void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int
static void getSaveInfoInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
{
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
SonyRemoteStorage* pRemoteStorage = static_cast<SonyRemoteStorage *>(lpParam);
if(error_code != 0)
{
app.DebugPrintf("getSaveInfoInitCallback err : 0x%08x\n", error_code);
@ -143,7 +143,7 @@ bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb,
static void setSaveDataInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
{
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
SonyRemoteStorage* pRemoteStorage = static_cast<SonyRemoteStorage *>(lpParam);
if(error_code != 0)
{
app.DebugPrintf("setSaveDataInitCallback err : 0x%08x\n", error_code);
@ -244,7 +244,7 @@ bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpPara
int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
{
SonyRemoteStorage *pClass= (SonyRemoteStorage *)lpParam;
SonyRemoteStorage *pClass= static_cast<SonyRemoteStorage *>(lpParam);
if(pClass->m_bAborting)
{
@ -277,7 +277,7 @@ int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThum
int SonyRemoteStorage::setDataThread(void* lpParam)
{
SonyRemoteStorage* pClass = (SonyRemoteStorage*)lpParam;
SonyRemoteStorage* pClass = static_cast<SonyRemoteStorage *>(lpParam);
pClass->m_startTime = System::currentTimeMillis();
pClass->setDataInternal();
return 0;
@ -322,8 +322,8 @@ int SonyRemoteStorage::getDataProgress()
__int64 time = System::currentTimeMillis();
int elapsedSecs = (time - m_startTime) / 1000;
float estimatedTransfered = float(elapsedSecs * transferRatePerSec);
int progVal = m_dataProgress + (estimatedTransfered / float(totalSize)) * 100;
float estimatedTransfered = static_cast<float>(elapsedSecs * transferRatePerSec);
int progVal = m_dataProgress + (estimatedTransfered / static_cast<float>(totalSize)) * 100;
if(progVal > nextChunk)
return nextChunk;
if(progVal > 99)

View file

@ -148,7 +148,7 @@ This should be tracked independently of saved games (restoring a save should not
*/
INT CTelemetryManager::GetSecondsSinceInitialize()
{
return (INT)(app.getAppTime() - m_initialiseTime);
return static_cast<INT>(app.getAppTime() - m_initialiseTime);
}
/*
@ -171,15 +171,15 @@ INT CTelemetryManager::GetMode(DWORD dwUserId)
if (gameType->isSurvival())
{
mode = (INT)eTelem_ModeId_Survival;
mode = static_cast<INT>(eTelem_ModeId_Survival);
}
else if (gameType->isCreative())
{
mode = (INT)eTelem_ModeId_Creative;
mode = static_cast<INT>(eTelem_ModeId_Creative);
}
else
{
mode = (INT)eTelem_ModeId_Undefined;
mode = static_cast<INT>(eTelem_ModeId_Undefined);
}
}
return mode;
@ -198,11 +198,11 @@ INT CTelemetryManager::GetSubMode(DWORD dwUserId)
if(Minecraft::GetInstance()->isTutorial())
{
subMode = (INT)eTelem_SubModeId_Tutorial;
subMode = static_cast<INT>(eTelem_SubModeId_Tutorial);
}
else
{
subMode = (INT)eTelem_SubModeId_Normal;
subMode = static_cast<INT>(eTelem_SubModeId_Normal);
}
return subMode;
@ -220,7 +220,7 @@ INT CTelemetryManager::GetLevelId(DWORD dwUserId)
{
INT levelId = (INT)eTelem_LevelId_Undefined;
levelId = (INT)eTelem_LevelId_PlayerGeneratedLevel;
levelId = static_cast<INT>(eTelem_LevelId_PlayerGeneratedLevel);
return levelId;
}
@ -242,13 +242,13 @@ INT CTelemetryManager::GetSubLevelId(DWORD dwUserId)
switch(pMinecraft->localplayers[dwUserId]->dimension)
{
case 0:
subLevelId = (INT)eTelem_SubLevelId_Overworld;
subLevelId = static_cast<INT>(eTelem_SubLevelId_Overworld);
break;
case -1:
subLevelId = (INT)eTelem_SubLevelId_Nether;
subLevelId = static_cast<INT>(eTelem_SubLevelId_Nether);
break;
case 1:
subLevelId = (INT)eTelem_SubLevelId_End;
subLevelId = static_cast<INT>(eTelem_SubLevelId_End);
break;
};
}
@ -272,7 +272,7 @@ Helps differentiate level attempts when a play plays the same mode/level - espec
*/
INT CTelemetryManager::GetLevelInstanceID()
{
return (INT)m_levelInstanceID;
return static_cast<INT>(m_levelInstanceID);
}
/*
@ -314,19 +314,19 @@ INT CTelemetryManager::GetSingleOrMultiplayer()
if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() == 0)
{
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Single_Player;
singleOrMultiplayer = static_cast<INT>(eSen_SingleOrMultiplayer_Single_Player);
}
else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() == 0)
{
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Local;
singleOrMultiplayer = static_cast<INT>(eSen_SingleOrMultiplayer_Multiplayer_Local);
}
else if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() > 0)
{
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Live;
singleOrMultiplayer = static_cast<INT>(eSen_SingleOrMultiplayer_Multiplayer_Live);
}
else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() > 0)
{
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live;
singleOrMultiplayer = static_cast<INT>(eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live);
}
return singleOrMultiplayer;
@ -343,16 +343,16 @@ INT CTelemetryManager::GetDifficultyLevel(INT diff)
switch(diff)
{
case 0:
difficultyLevel = (INT)eSen_DifficultyLevel_Easiest;
difficultyLevel = static_cast<INT>(eSen_DifficultyLevel_Easiest);
break;
case 1:
difficultyLevel = (INT)eSen_DifficultyLevel_Easier;
difficultyLevel = static_cast<INT>(eSen_DifficultyLevel_Easier);
break;
case 2:
difficultyLevel = (INT)eSen_DifficultyLevel_Normal;
difficultyLevel = static_cast<INT>(eSen_DifficultyLevel_Normal);
break;
case 3:
difficultyLevel = (INT)eSen_DifficultyLevel_Harder;
difficultyLevel = static_cast<INT>(eSen_DifficultyLevel_Harder);
break;
}
@ -372,11 +372,11 @@ INT CTelemetryManager::GetLicense()
if(ProfileManager.IsFullVersion())
{
license = (INT)eSen_License_Full_Purchased_Title;
license = static_cast<INT>(eSen_License_Full_Purchased_Title);
}
else
{
license = (INT)eSen_License_Trial_or_Demo;
license = static_cast<INT>(eSen_License_Trial_or_Demo);
}
return license;
}
@ -411,15 +411,15 @@ INT CTelemetryManager::GetAudioSettings(DWORD dwUserId)
if(volume == 0)
{
audioSettings = (INT)eSen_AudioSettings_Off;
audioSettings = static_cast<INT>(eSen_AudioSettings_Off);
}
else if(volume == DEFAULT_VOLUME_LEVEL)
{
audioSettings = (INT)eSen_AudioSettings_On_Default;
audioSettings = static_cast<INT>(eSen_AudioSettings_On_Default);
}
else
{
audioSettings = (INT)eSen_AudioSettings_On_CustomSetting;
audioSettings = static_cast<INT>(eSen_AudioSettings_On_CustomSetting);
}
}
return audioSettings;

View file

@ -23,7 +23,7 @@ bool RideEntityTask::isCompleted()
void RideEntityTask::onRideEntity(shared_ptr<Entity> entity)
{
if (entity->instanceof((eINSTANCEOF) m_eType))
if (entity->instanceof(static_cast<eINSTANCEOF>(m_eType)))
{
bIsCompleted = true;
}

View file

@ -20,6 +20,6 @@ bool StatTask::isCompleted()
return true;
Minecraft *minecraft = Minecraft::GetInstance();
bIsCompleted = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) >= (unsigned int)targetValue;
bIsCompleted = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) >= static_cast<unsigned int>(targetValue);
return bIsCompleted;
}

View file

@ -1173,7 +1173,7 @@ void Tutorial::debugResetPlayerSavedProgress(int iPad)
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(iPad);
#else
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(iPad);
GAME_SETTINGS *pGameSettings = static_cast<GAME_SETTINGS *>(ProfileManager.GetGameDefinedProfileData(iPad));
#endif
ZeroMemory( pGameSettings->ucTutorialCompletion, TUTORIAL_PROFILE_STORAGE_BYTES );
pGameSettings->uiSpecialTutorialBitmask = 0;
@ -1202,7 +1202,7 @@ void Tutorial::setCompleted( int completableId )
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(m_iPad);
#else
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(m_iPad);
GAME_SETTINGS *pGameSettings = static_cast<GAME_SETTINGS *>(ProfileManager.GetGameDefinedProfileData(m_iPad));
#endif
int arrayIndex = completableIndex >> 3;
int bitIndex = 7 - (completableIndex % 8);
@ -1235,7 +1235,7 @@ bool Tutorial::getCompleted( int completableId )
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(m_iPad);
#else
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(m_iPad);
GAME_SETTINGS *pGameSettings = static_cast<GAME_SETTINGS *>(ProfileManager.GetGameDefinedProfileData(m_iPad));
#endif
int arrayIndex = completableIndex >> 3;
int bitIndex = 7 - (completableIndex % 8);

View file

@ -296,8 +296,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
int iPad = getPad();
bool bStickInput = false;
float fInputX = InputManager.GetJoypadStick_LX( iPad, false )*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f); // apply the sensitivity
float fInputY = InputManager.GetJoypadStick_LY( iPad, false )*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f); // apply the sensitivity
float fInputX = InputManager.GetJoypadStick_LX( iPad, false )*(static_cast<float>(app.GetGameSettings(iPad, eGameSetting_Sensitivity_InMenu))/100.0f); // apply the sensitivity
float fInputY = InputManager.GetJoypadStick_LY( iPad, false )*(static_cast<float>(app.GetGameSettings(iPad, eGameSetting_Sensitivity_InMenu))/100.0f); // apply the sensitivity
#ifdef __ORBIS__
// should have sensitivity for the touchpad
@ -406,7 +406,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if ( m_iConsectiveInputTicks < MAX_INPUT_TICKS_FOR_SCALING )
{
++m_iConsectiveInputTicks;
fInputScale = ( (float)( m_iConsectiveInputTicks) / (float)(MAX_INPUT_TICKS_FOR_SCALING) );
fInputScale = ( static_cast<float>(m_iConsectiveInputTicks) / static_cast<float>((MAX_INPUT_TICKS_FOR_SCALING)) );
}
#ifdef TAP_DETECTION
else if ( m_iConsectiveInputTicks < MAX_INPUT_TICKS_FOR_TAPPING )
@ -494,11 +494,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if (winW > 0 && winH > 0)
{
float scaleX = (float)getMovieWidth() / (float)winW;
float scaleY = (float)getMovieHeight() / (float)winH;
float scaleX = static_cast<float>(getMovieWidth()) / static_cast<float>(winW);
float scaleY = static_cast<float>(getMovieHeight()) / static_cast<float>(winH);
vPointerPos.x += (float)deltaX * scaleX;
vPointerPos.y += (float)deltaY * scaleY;
vPointerPos.x += static_cast<float>(deltaX) * scaleX;
vPointerPos.y += static_cast<float>(deltaY) * scaleY;
}
if (deltaX != 0 || deltaY != 0)
@ -527,7 +527,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
}
else if ( eSectionUnderPointer == eSectionNone )
{
ESceneSection eSection = ( ESceneSection )( iSection );
ESceneSection eSection = static_cast<ESceneSection>(iSection);
// Get position of this section.
UIVec2D sectionPos;
@ -1309,9 +1309,9 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
}
vPointerPos.x = floor(vPointerPos.x);
vPointerPos.x += ( (int)vPointerPos.x%2);
vPointerPos.x += ( static_cast<int>(vPointerPos.x)%2);
vPointerPos.y = floor(vPointerPos.y);
vPointerPos.y += ( (int)vPointerPos.y%2);
vPointerPos.y += ( static_cast<int>(vPointerPos.y)%2);
m_pointerPos = vPointerPos;
adjustPointerForSafeZone();
@ -1525,7 +1525,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
message->m_iAuxVal = item->getAuxValue();
message->m_forceDisplay = true;
TutorialMode *gameMode = (TutorialMode *)Minecraft::GetInstance()->localgameModes[iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(Minecraft::GetInstance()->localgameModes[iPad]);
gameMode->getTutorial()->setMessage(NULL, message);
ui.PlayUISFX(eSFX_Press);
}

View file

@ -620,7 +620,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
*/
RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies();
Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray();
int iRecipeC=(int)recipes->size();
int iRecipeC=static_cast<int>(recipes->size());
auto itRecipe = recipes->begin();
// dump out the recipe products

View file

@ -1040,7 +1040,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu
{
m_menu->getSlot(i)->set(nullptr);
// call this function to synchronize multiplayer item bar
pMinecraft->localgameModes[iPad]->handleCreativeModeItemAdd(nullptr, i - (int)m_menu->slots.size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
pMinecraft->localgameModes[iPad]->handleCreativeModeItemAdd(nullptr, i - static_cast<int>(m_menu->slots.size()) + 9 + InventoryMenu::USE_ROW_SLOT_START);
}
}
return true;
@ -1082,8 +1082,8 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction)
// Fall through intentional
case ACTION_MENU_RIGHT_SCROLL:
{
ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir);
if (tab < 0) tab = (ECreativeInventoryTabs)(eCreativeInventoryTab_COUNT - 1);
ECreativeInventoryTabs tab = static_cast<ECreativeInventoryTabs>(m_curTab + dir);
if (tab < 0) tab = static_cast<ECreativeInventoryTabs>(eCreativeInventoryTab_COUNT - 1);
if (tab >= eCreativeInventoryTab_COUNT) tab = eCreativeInventoryTab_BuildingBlocks;
switchTab(tab);
ui.PlayUISFX(eSFX_Focus);
@ -1188,7 +1188,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]);
shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem();
// 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 - static_cast<int>(m_menu->slots.size()) + 9 + InventoryMenu::USE_ROW_SLOT_START);
if(m_bCarryingCreativeItem)
{
@ -1370,7 +1370,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *lis
expTags->add(expTag);
fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags);
fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphur);
fireTag->putByte(FireworksItem::TAG_FLIGHT, static_cast<byte>(sulphur));
itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag);

View file

@ -181,5 +181,5 @@ bool IUIScene_EnchantingMenu::IsSectionSlotList( ESceneSection eSection )
EnchantmentMenu *IUIScene_EnchantingMenu::getMenu()
{
return (EnchantmentMenu *)m_menu;
return static_cast<EnchantmentMenu *>(m_menu);
}

View file

@ -146,8 +146,8 @@ void IUIScene_HUD::updateFrameTick()
{
if(uiOpacityTimer<10)
{
float fStep=(80.0f-(float)ucAlpha)/10.0f;
fVal=0.01f*(80.0f-((10.0f-(float)uiOpacityTimer)*fStep));
float fStep=(80.0f-static_cast<float>(ucAlpha))/10.0f;
fVal=0.01f*(80.0f-((10.0f-static_cast<float>(uiOpacityTimer))*fStep));
}
else
{
@ -156,7 +156,7 @@ void IUIScene_HUD::updateFrameTick()
}
else
{
fVal=0.01f*(float)ucAlpha;
fVal=0.01f*static_cast<float>(ucAlpha);
}
}
else
@ -166,7 +166,7 @@ void IUIScene_HUD::updateFrameTick()
{
ucAlpha=15;
}
fVal=0.01f*(float)ucAlpha;
fVal=0.01f*static_cast<float>(ucAlpha);
}
SetOpacity(fVal);
@ -198,7 +198,7 @@ void IUIScene_HUD::renderPlayerHealth()
bool bHasPoison = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::poison);
bool bHasWither = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::wither);
AttributeInstance *maxHealthAttribute = pMinecraft->localplayers[iPad]->getAttribute(SharedMonsterAttributes::MAX_HEALTH);
float maxHealth = (float)maxHealthAttribute->getValue();
float maxHealth = static_cast<float>(maxHealthAttribute->getValue());
float totalAbsorption = pMinecraft->localplayers[iPad]->getAbsorptionAmount();
// Update armour
@ -242,8 +242,8 @@ void IUIScene_HUD::renderPlayerHealth()
if (pMinecraft->localplayers[iPad]->isUnderLiquid(Material::water))
{
ShowAir(true);
int count = (int) ceil((pMinecraft->localplayers[iPad]->getAirSupply() - 2) * 10.0f / Player::TOTAL_AIR_SUPPLY);
int extra = (int) ceil((pMinecraft->localplayers[iPad]->getAirSupply()) * 10.0f / Player::TOTAL_AIR_SUPPLY) - count;
int count = static_cast<int>(ceil((pMinecraft->localplayers[iPad]->getAirSupply() - 2) * 10.0f / Player::TOTAL_AIR_SUPPLY));
int extra = static_cast<int>(ceil((pMinecraft->localplayers[iPad]->getAirSupply()) * 10.0f / Player::TOTAL_AIR_SUPPLY)) - count;
SetAir(count, extra);
}
else
@ -254,7 +254,7 @@ void IUIScene_HUD::renderPlayerHealth()
else if(riding->instanceof(eTYPE_LIVINGENTITY) )
{
shared_ptr<LivingEntity> living = dynamic_pointer_cast<LivingEntity>(riding);
int riderCurrentHealth = (int) ceil(living->getHealth());
int riderCurrentHealth = static_cast<int>(ceil(living->getHealth()));
float maxRiderHealth = living->getMaxHealth();
SetRidingHorse(true, pMinecraft->localplayers[iPad]->isRidingJumpable(), maxRiderHealth);

View file

@ -52,7 +52,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStor
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
{
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(tPack);
DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))
@ -352,7 +352,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4
int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter )
{
bool bAutosave=(bool)lpParameter;
bool bAutosave=static_cast<bool>(lpParameter);
if(bAutosave)
{
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame);

View file

@ -123,7 +123,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
void IUIScene_StartGame::handleSelectionChanged(F64 selectedId)
{
m_iSetTexturePackDescription = (int)selectedId;
m_iSetTexturePackDescription = static_cast<int>(selectedId);
if(!m_texturePackDescDisplayed)
{
@ -254,7 +254,7 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot)
int IUIScene_StartGame::TrialTexturePackWarningReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
IUIScene_StartGame* pScene = static_cast<IUIScene_StartGame *>(pParam);
if(result==C4JStorage::EMessage_ResultAccept)
{
@ -269,7 +269,7 @@ int IUIScene_StartGame::TrialTexturePackWarningReturned(void *pParam,int iPad,C4
int IUIScene_StartGame::UnlockTexturePackReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
IUIScene_StartGame* pScene = static_cast<IUIScene_StartGame *>(pParam);
if(result==C4JStorage::EMessage_ResultAccept)
{
@ -311,7 +311,7 @@ int IUIScene_StartGame::UnlockTexturePackReturned(void *pParam,int iPad,C4JStora
int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
IUIScene_StartGame *pClass = (IUIScene_StartGame *)pParam;
IUIScene_StartGame *pClass = static_cast<IUIScene_StartGame *>(pParam);
#ifdef _XBOX

View file

@ -53,42 +53,42 @@ void UIAbstractBitmapFont::registerFont()
IggyFontMetrics * RADLINK UIAbstractBitmapFont::GetFontMetrics_Callback(void *user_context,IggyFontMetrics *metrics)
{
return ((UIAbstractBitmapFont *) user_context)->GetFontMetrics(metrics);
return static_cast<UIAbstractBitmapFont *>(user_context)->GetFontMetrics(metrics);
}
S32 RADLINK UIAbstractBitmapFont::GetCodepointGlyph_Callback(void *user_context,U32 codepoint)
{
return ((UIAbstractBitmapFont *) user_context)->GetCodepointGlyph(codepoint);
return static_cast<UIAbstractBitmapFont *>(user_context)->GetCodepointGlyph(codepoint);
}
IggyGlyphMetrics * RADLINK UIAbstractBitmapFont::GetGlyphMetrics_Callback(void *user_context,S32 glyph,IggyGlyphMetrics *metrics)
{
return ((UIAbstractBitmapFont *) user_context)->GetGlyphMetrics(glyph,metrics);
return static_cast<UIAbstractBitmapFont *>(user_context)->GetGlyphMetrics(glyph,metrics);
}
rrbool RADLINK UIAbstractBitmapFont::IsGlyphEmpty_Callback(void *user_context,S32 glyph)
{
return ((UIAbstractBitmapFont *) user_context)->IsGlyphEmpty(glyph);
return static_cast<UIAbstractBitmapFont *>(user_context)->IsGlyphEmpty(glyph);
}
F32 RADLINK UIAbstractBitmapFont::GetKerningForGlyphPair_Callback(void *user_context,S32 first_glyph,S32 second_glyph)
{
return ((UIAbstractBitmapFont *) user_context)->GetKerningForGlyphPair(first_glyph,second_glyph);
return static_cast<UIAbstractBitmapFont *>(user_context)->GetKerningForGlyphPair(first_glyph,second_glyph);
}
rrbool RADLINK UIAbstractBitmapFont::CanProvideBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale)
{
return ((UIAbstractBitmapFont *) user_context)->CanProvideBitmap(glyph,pixel_scale);
return static_cast<UIAbstractBitmapFont *>(user_context)->CanProvideBitmap(glyph,pixel_scale);
}
rrbool RADLINK UIAbstractBitmapFont::GetGlyphBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale,IggyBitmapCharacter *bitmap)
{
return ((UIAbstractBitmapFont *) user_context)->GetGlyphBitmap(glyph,pixel_scale,bitmap);
return static_cast<UIAbstractBitmapFont *>(user_context)->GetGlyphBitmap(glyph,pixel_scale,bitmap);
}
void RADLINK UIAbstractBitmapFont::FreeGlyphBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale,IggyBitmapCharacter *bitmap)
{
return ((UIAbstractBitmapFont *) user_context)->FreeGlyphBitmap(glyph,pixel_scale,bitmap);
return static_cast<UIAbstractBitmapFont *>(user_context)->FreeGlyphBitmap(glyph,pixel_scale,bitmap);
}
UIBitmapFont::UIBitmapFont( SFontData &sfontdata )
@ -321,7 +321,7 @@ rrbool UIBitmapFont::GetGlyphBitmap(S32 glyph,F32 pixel_scale,IggyBitmapCharacte
// 4J-PB - this was chopping off the top of the characters, so accented ones were losing a couple of pixels at the top
// DaveK has reduced the height of the accented capitalised characters, and we've dropped this from 0.65 to 0.64
bitmap->top_left_y = -((S32) m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent;
bitmap->top_left_y = -static_cast<S32>(m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent;
bitmap->oversample = 0;
bitmap->point_sample = true;

View file

@ -96,15 +96,15 @@ void UIComponent_Chat::render(S32 width, S32 height, C4JRender::eViewportType vi
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
}
ui.setupRenderPosition(xPos, yPos);
@ -118,14 +118,14 @@ void UIComponent_Chat::render(S32 width, S32 height, C4JRender::eViewportType vi
{
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
tileHeight = static_cast<S32>(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:

View file

@ -10,7 +10,7 @@ UIComponent_DebugUIMarketingGuide::UIComponent_DebugUIMarketingGuide(int iPad, v
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (F64)0; // WIN64
value[0].number = static_cast<F64>(0); // WIN64
#if defined _XBOX
value[0].number = (F64)1;
#elif defined _DURANGO
@ -22,7 +22,7 @@ UIComponent_DebugUIMarketingGuide::UIComponent_DebugUIMarketingGuide(int iPad, v
#elif defined __PSVITA__
value[0].number = (F64)5;
#elif defined _WINDOWS64
value[0].number = (F64)0;
value[0].number = static_cast<F64>(0);
#endif
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetPlatform , 1 , value );
}

View file

@ -42,15 +42,15 @@ void UIComponent_MenuBackground::render(S32 width, S32 height, C4JRender::eViewp
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
}
ui.setupRenderPosition(xPos, yPos);
@ -64,14 +64,14 @@ void UIComponent_MenuBackground::render(S32 width, S32 height, C4JRender::eViewp
{
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
tileHeight = static_cast<S32>(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:

View file

@ -85,10 +85,10 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp
switch( viewport )
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
yPos = (S32)(ui.getScreenHeight() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
break;
}
ui.setupRenderPosition(xPos, yPos);
@ -99,7 +99,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp
S32 tileXStart = 0;
S32 tileYStart = 0;
S32 tileWidth = width;
S32 tileHeight = (S32)(ui.getScreenHeight());
S32 tileHeight = static_cast<S32>(ui.getScreenHeight());
IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight );

View file

@ -154,8 +154,8 @@ void UIComponent_Tooltips::tick()
{
if(uiOpacityTimer<10)
{
float fStep=(80.0f-(float)ucAlpha)/10.0f;
fVal=0.01f*(80.0f-((10.0f-(float)uiOpacityTimer)*fStep));
float fStep=(80.0f-static_cast<float>(ucAlpha))/10.0f;
fVal=0.01f*(80.0f-((10.0f-static_cast<float>(uiOpacityTimer))*fStep));
}
else
{
@ -164,7 +164,7 @@ void UIComponent_Tooltips::tick()
}
else
{
fVal=0.01f*(float)ucAlpha;
fVal=0.01f*static_cast<float>(ucAlpha);
}
}
else
@ -174,7 +174,7 @@ void UIComponent_Tooltips::tick()
{
ucAlpha=15;
}
fVal=0.01f*(float)ucAlpha;
fVal=0.01f*static_cast<float>(ucAlpha);
}
setOpacity(fVal);
@ -206,15 +206,15 @@ void UIComponent_Tooltips::render(S32 width, S32 height, C4JRender::eViewportTyp
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
}
ui.setupRenderPosition(xPos, yPos);
@ -228,14 +228,14 @@ void UIComponent_Tooltips::render(S32 width, S32 height, C4JRender::eViewportTyp
{
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = (S32)(ui.getScreenHeight());
tileHeight = static_cast<S32>(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = (S32)(ui.getScreenWidth());
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = (S32)(ui.getScreenWidth());
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:

View file

@ -219,13 +219,13 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
m_iconItem = nullptr;
wstring openTag(L"{*ICON*}");
wstring closeTag(L"{*/ICON*}");
int iconTagStartPos = (int)temp.find(openTag);
int iconStartPos = iconTagStartPos + (int)openTag.length();
if( iconTagStartPos > 0 && iconStartPos < (int)temp.length() )
int iconTagStartPos = static_cast<int>(temp.find(openTag));
int iconStartPos = iconTagStartPos + static_cast<int>(openTag.length());
if( iconTagStartPos > 0 && iconStartPos < static_cast<int>(temp.length()) )
{
int iconEndPos = (int)temp.find( closeTag, iconStartPos );
int iconEndPos = static_cast<int>(temp.find(closeTag, iconStartPos));
if(iconEndPos > iconStartPos && iconEndPos < (int)temp.length() )
if(iconEndPos > iconStartPos && iconEndPos < static_cast<int>(temp.length()) )
{
wstring id = temp.substr(iconStartPos, iconEndPos - iconStartPos);
@ -479,20 +479,20 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo
switch( viewport )
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(ui.getScreenHeight() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
break;
}
//Adjust for safezone
@ -538,7 +538,7 @@ void UIComponent_TutorialPopup::setupIconHolder(EIcons icon)
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (F64)icon;
value[0].number = static_cast<F64>(icon);
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetupIconHolder , 1 , value );
m_iconType = icon;

View file

@ -34,10 +34,10 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &fheight );
m_x = (S32)fx;
m_y = (S32)fy;
m_width = (S32)Math::round(fwidth);
m_height = (S32)Math::round(fheight);
m_x = static_cast<S32>(fx);
m_y = static_cast<S32>(fy);
m_width = static_cast<S32>(Math::round(fwidth));
m_height = static_cast<S32>(Math::round(fheight));
return res;
}
@ -49,10 +49,10 @@ void UIControl::UpdateControl()
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , NULL , &fy );
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &fheight );
m_x = (S32)fx;
m_y = (S32)fy;
m_width = (S32)Math::round(fwidth);
m_height = (S32)Math::round(fheight);
m_x = static_cast<S32>(fx);
m_y = static_cast<S32>(fy);
m_width = static_cast<S32>(Math::round(fwidth));
m_height = static_cast<S32>(Math::round(fheight));
}
void UIControl::ReInit()

View file

@ -90,7 +90,7 @@ void UIControl_Base::setAllPossibleLabels(int labelCount, wchar_t labels[][256])
for(unsigned int i = 0; i < labelCount; ++i)
{
stringVal[i].string = (IggyUTF16 *)labels[i];
stringVal[i].string = static_cast<IggyUTF16 *>(labels[i]);
stringVal[i].length = wcslen(labels[i]);
value[i].type = IGGY_DATATYPE_string_UTF16;
value[i].string16 = stringVal[i];

View file

@ -82,7 +82,7 @@ void UIControl_ButtonList::addItem(const string &label, int data)
IggyStringUTF8 stringVal;
stringVal.string = (char*)label.c_str();
stringVal.length = (S32)label.length();
stringVal.length = static_cast<S32>(label.length());
value[0].type = IGGY_DATATYPE_string_UTF8;
value[0].string8 = stringVal;

View file

@ -20,7 +20,7 @@ void UIControl_DLCList::addItem(const string &label, bool showTick, int iId)
IggyStringUTF8 stringVal;
stringVal.string = (char*)label.c_str();
stringVal.length = (S32)label.length();
stringVal.length = static_cast<S32>(label.length());
value[0].type = IGGY_DATATYPE_string_UTF8;
value[0].string8 = stringVal;
@ -41,7 +41,7 @@ void UIControl_DLCList::addItem(const wstring &label, bool showTick, int iId)
IggyStringUTF16 stringVal;
stringVal.string = (IggyUTF16 *)label.c_str();
stringVal.length = (S32)label.length();
stringVal.length = static_cast<S32>(label.length());
value[0].type = IGGY_DATATYPE_string_UTF16;
value[0].string16 = stringVal;

View file

@ -79,7 +79,7 @@ S32 UIControl_DynamicLabel::GetRealWidth()
S32 iRealWidth = m_width;
if(result.type == IGGY_DATATYPE_number)
{
iRealWidth = (S32)result.number;
iRealWidth = static_cast<S32>(result.number);
}
return iRealWidth;
}
@ -92,7 +92,7 @@ S32 UIControl_DynamicLabel::GetRealHeight()
S32 iRealHeight = m_height;
if(result.type == IGGY_DATATYPE_number)
{
iRealHeight = (S32)result.number;
iRealHeight = static_cast<S32>(result.number);
}
return iRealHeight;
}

View file

@ -73,7 +73,7 @@ void UIControl_EnchantmentBook::render(IggyCustomDrawCallbackRegion *region)
{
// Share the model the the EnchantTableRenderer
EnchantTableRenderer *etr = (EnchantTableRenderer*)TileEntityRenderDispatcher::instance->getRenderer(eTYPE_ENCHANTMENTTABLEENTITY);
EnchantTableRenderer *etr = static_cast<EnchantTableRenderer *>(TileEntityRenderDispatcher::instance->getRenderer(eTYPE_ENCHANTMENTTABLEENTITY));
if(etr != NULL)
{
model = etr->bookModel;
@ -96,7 +96,7 @@ void UIControl_EnchantmentBook::render(IggyCustomDrawCallbackRegion *region)
void UIControl_EnchantmentBook::tickBook()
{
UIScene_EnchantingMenu *m_containerScene = (UIScene_EnchantingMenu *)m_parentScene;
UIScene_EnchantingMenu *m_containerScene = static_cast<UIScene_EnchantingMenu *>(m_parentScene);
EnchantmentMenu *menu = m_containerScene->getMenu();
shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem();
if (!ItemInstance::matches(current, last))

View file

@ -55,7 +55,7 @@ void UIControl_EnchantmentButton::tick()
void UIControl_EnchantmentButton::render(IggyCustomDrawCallbackRegion *region)
{
UIScene_EnchantingMenu *enchantingScene = (UIScene_EnchantingMenu *)m_parentScene;
UIScene_EnchantingMenu *enchantingScene = static_cast<UIScene_EnchantingMenu *>(m_parentScene);
EnchantmentMenu *menu = enchantingScene->getMenu();
float width = region->x1 - region->x0;
@ -108,7 +108,7 @@ void UIControl_EnchantmentButton::render(IggyCustomDrawCallbackRegion *region)
if (pMinecraft->localplayers[enchantingScene->getPad()]->experienceLevel < cost && !pMinecraft->localplayers[enchantingScene->getPad()]->abilities.instabuild)
{
col = m_textDisabledColour;
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (float)m_height/ss);
font->drawWordWrap(m_enchantmentString, 0, 0, static_cast<float>(m_width)/ss, col, static_cast<float>(m_height)/ss);
font = pMinecraft->font;
//col = (0x80ff20 & 0xfefefe) >> 1;
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
@ -120,7 +120,7 @@ void UIControl_EnchantmentButton::render(IggyCustomDrawCallbackRegion *region)
//col = 0xffff80;
col = m_textFocusColour;
}
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (float)m_height/ss);
font->drawWordWrap(m_enchantmentString, 0, 0, static_cast<float>(m_width)/ss, col, static_cast<float>(m_height)/ss);
font = pMinecraft->font;
//col = 0x80ff20;
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
@ -137,7 +137,7 @@ void UIControl_EnchantmentButton::render(IggyCustomDrawCallbackRegion *region)
void UIControl_EnchantmentButton::updateState()
{
UIScene_EnchantingMenu *enchantingScene = (UIScene_EnchantingMenu *)m_parentScene;
UIScene_EnchantingMenu *enchantingScene = static_cast<UIScene_EnchantingMenu *>(m_parentScene);
EnchantmentMenu *menu = enchantingScene->getMenu();
EState state = eState_Inactive;
@ -182,7 +182,7 @@ void UIControl_EnchantmentButton::updateState()
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (int)state;
value[0].number = static_cast<int>(state);
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcChangeState , 1 , value );
if(out == IGGY_RESULT_SUCCESS) m_lastState = state;

View file

@ -84,7 +84,7 @@ S32 UIControl_HTMLLabel::GetRealWidth()
S32 iRealWidth = m_width;
if(result.type == IGGY_DATATYPE_number)
{
iRealWidth = (S32)result.number;
iRealWidth = static_cast<S32>(result.number);
}
return iRealWidth;
}
@ -97,7 +97,7 @@ S32 UIControl_HTMLLabel::GetRealHeight()
S32 iRealHeight = m_height;
if(result.type == IGGY_DATATYPE_number)
{
iRealHeight = (S32)result.number;
iRealHeight = static_cast<S32>(result.number);
}
return iRealHeight;
}

View file

@ -27,10 +27,10 @@ UIControl_MinecraftHorse::UIControl_MinecraftHorse()
Minecraft *pMinecraft=Minecraft::GetInstance();
ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
m_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(float)ssc.rawHeight;
m_fScreenWidth=static_cast<float>(pMinecraft->width_phys);
m_fRawWidth=static_cast<float>(ssc.rawWidth);
m_fScreenHeight=static_cast<float>(pMinecraft->height_phys);
m_fRawHeight=static_cast<float>(ssc.rawHeight);
}
void UIControl_MinecraftHorse::render(IggyCustomDrawCallbackRegion *region)
@ -49,7 +49,7 @@ void UIControl_MinecraftHorse::render(IggyCustomDrawCallbackRegion *region)
glTranslatef(xo, yo - (height / 7.5f), 50.0f);
//UIScene_InventoryMenu *containerMenu = (UIScene_InventoryMenu *)m_parentScene;
UIScene_HorseInventoryMenu *containerMenu = (UIScene_HorseInventoryMenu *)m_parentScene;
UIScene_HorseInventoryMenu *containerMenu = static_cast<UIScene_HorseInventoryMenu *>(m_parentScene);
shared_ptr<LivingEntity> entityHorse = containerMenu->m_horse;

View file

@ -19,10 +19,10 @@ UIControl_MinecraftPlayer::UIControl_MinecraftPlayer()
Minecraft *pMinecraft=Minecraft::GetInstance();
ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
m_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(float)ssc.rawHeight;
m_fScreenWidth=static_cast<float>(pMinecraft->width_phys);
m_fRawWidth=static_cast<float>(ssc.rawWidth);
m_fScreenHeight=static_cast<float>(pMinecraft->height_phys);
m_fRawHeight=static_cast<float>(ssc.rawHeight);
}
void UIControl_MinecraftPlayer::render(IggyCustomDrawCallbackRegion *region)
@ -49,7 +49,7 @@ void UIControl_MinecraftPlayer::render(IggyCustomDrawCallbackRegion *region)
glScalef(-ss, ss, ss);
glRotatef(180, 0, 0, 1);
UIScene_InventoryMenu *containerMenu = (UIScene_InventoryMenu *)m_parentScene;
UIScene_InventoryMenu *containerMenu = static_cast<UIScene_InventoryMenu *>(m_parentScene);
float oybr = pMinecraft->localplayers[containerMenu->getPad()]->yBodyRot;
float oyr = pMinecraft->localplayers[containerMenu->getPad()]->yRot;

View file

@ -21,7 +21,7 @@ void UIControl_PlayerList::addItem(const wstring &label, int iPlayerIcon, int iV
IggyStringUTF16 stringVal;
stringVal.string = (IggyUTF16*)label.c_str();
stringVal.length = (S32)label.length();
stringVal.length = static_cast<S32>(label.length());
value[0].type = IGGY_DATATYPE_string_UTF16;
value[0].string16 = stringVal;

View file

@ -23,10 +23,10 @@ UIControl_PlayerSkinPreview::UIControl_PlayerSkinPreview()
Minecraft *pMinecraft=Minecraft::GetInstance();
ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
m_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(float)ssc.rawHeight;
m_fScreenWidth=static_cast<float>(pMinecraft->width_phys);
m_fRawWidth=static_cast<float>(ssc.rawWidth);
m_fScreenHeight=static_cast<float>(pMinecraft->height_phys);
m_fRawHeight=static_cast<float>(ssc.rawHeight);
m_customTextureUrl = L"default";
m_backupTexture = TN_MOB_CHAR;
@ -167,7 +167,7 @@ void UIControl_PlayerSkinPreview::SetFacing(ESkinPreviewFacing facing, bool bAni
void UIControl_PlayerSkinPreview::CycleNextAnimation()
{
m_currentAnimation = (ESkinPreviewAnimations)(m_currentAnimation + 1);
m_currentAnimation = static_cast<ESkinPreviewAnimations>(m_currentAnimation + 1);
if(m_currentAnimation >= e_SkinPreviewAnimation_Count) m_currentAnimation = e_SkinPreviewAnimation_Walking;
m_swingTime = 0.0f;
@ -175,8 +175,8 @@ void UIControl_PlayerSkinPreview::CycleNextAnimation()
void UIControl_PlayerSkinPreview::CyclePreviousAnimation()
{
m_currentAnimation = (ESkinPreviewAnimations)(m_currentAnimation - 1);
if(m_currentAnimation < e_SkinPreviewAnimation_Walking) m_currentAnimation = (ESkinPreviewAnimations)(e_SkinPreviewAnimation_Count - 1);
m_currentAnimation = static_cast<ESkinPreviewAnimations>(m_currentAnimation - 1);
if(m_currentAnimation < e_SkinPreviewAnimation_Walking) m_currentAnimation = static_cast<ESkinPreviewAnimations>(e_SkinPreviewAnimation_Count - 1);
m_swingTime = 0.0f;
}
@ -210,7 +210,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion *region)
Lighting::turnOn();
//glRotatef(-45 - 90, 0, 1, 0);
glRotatef(-(float)m_xRot, 1, 0, 0);
glRotatef(-static_cast<float>(m_xRot), 1, 0, 0);
// 4J Stu - Turning on hideGui while we do this stops the name rendering in split-screen
bool wasHidingGui = pMinecraft->options->hideGui;
@ -257,7 +257,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
glPushMatrix();
glDisable(GL_CULL_FACE);
HumanoidModel *model = (HumanoidModel *)renderer->getModel();
HumanoidModel *model = static_cast<HumanoidModel *>(renderer->getModel());
//getAttackAnim(mob, a);
//if (armor != NULL) armor->attackTime = model->attackTime;
@ -292,7 +292,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
{
m_swingTime = 0;
}
model->attackTime = m_swingTime / (float) (Player::SWING_DURATION * 3);
model->attackTime = m_swingTime / static_cast<float>(Player::SWING_DURATION * 3);
break;
default:
break;
@ -306,7 +306,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
//setupPosition(mob, x, y, z);
// is equivalent to
glTranslatef((float) x, (float) y, (float) z);
glTranslatef(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
//float bob = getBob(mob, a);
#ifdef SKIN_PREVIEW_BOB_ANIM
@ -383,11 +383,11 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
double xa = sin(yr * PI / 180);
double za = -cos(yr * PI / 180);
float flap = (float) yd * 10;
float flap = static_cast<float>(yd) * 10;
if (flap < -6) flap = -6;
if (flap > 32) flap = 32;
float lean = (float) (xd * xa + zd * za) * 100;
float lean2 = (float) (xd * za - zd * xa) * 100;
float lean = static_cast<float>(xd * xa + zd * za) * 100;
float lean2 = static_cast<float>(xd * za - zd * xa) * 100;
if (lean < 0) lean = 0;
//float pow = 1;//mob->oBob + (bob - mob->oBob) * a;

View file

@ -53,7 +53,7 @@ void UIControl_Progress::setProgress(int current)
{
m_current = current;
float percent = (float)((m_current-m_min))/(m_max-m_min);
float percent = static_cast<float>((m_current - m_min))/(m_max-m_min);
if(percent != m_lastPercent)
{

View file

@ -52,7 +52,7 @@ void UIControl_SaveList::addItem(const string &label, const wstring &iconName, i
IggyStringUTF8 stringVal;
stringVal.string = (char*)label.c_str();
stringVal.length = (S32)label.length();
stringVal.length = static_cast<S32>(label.length());
value[0].type = IGGY_DATATYPE_string_UTF8;
value[0].string8 = stringVal;
@ -74,7 +74,7 @@ void UIControl_SaveList::addItem(const wstring &label, const wstring &iconName,
IggyStringUTF16 stringVal;
stringVal.string = (IggyUTF16*)label.c_str();
stringVal.length = (S32)label.length();
stringVal.length = static_cast<S32>(label.length());
value[0].type = IGGY_DATATYPE_string_UTF16;
value[0].string16 = stringVal;

View file

@ -97,7 +97,7 @@ S32 UIControl_Slider::GetRealWidth()
S32 iRealWidth = m_width;
if(result.type == IGGY_DATATYPE_number)
{
iRealWidth = (S32)result.number;
iRealWidth = static_cast<S32>(result.number);
}
return iRealWidth;
}

View file

@ -63,7 +63,7 @@ void UIControl_SpaceIndicatorBar::reset()
void UIControl_SpaceIndicatorBar::addSave(__int64 size)
{
float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min);
float startPercent = static_cast<float>((m_currentTotal - m_min))/(m_max-m_min);
m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) );
@ -90,7 +90,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size)
{
m_currentSave = size;
float percent = (float)((m_currentSave-m_min))/(m_max-m_min);
float percent = static_cast<float>((m_currentSave - m_min))/(m_max-m_min);
IggyDataValue result;
IggyDataValue value[1];
@ -101,7 +101,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size)
void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size)
{
float percent = (float)((m_currentTotal-m_min))/(m_max-m_min);
float percent = static_cast<float>((m_currentTotal - m_min))/(m_max-m_min);
IggyDataValue result;
IggyDataValue value[1];

View file

@ -125,7 +125,7 @@ bool UIControl_TexturePackList::CanTouchTrigger(S32 iX, S32 iY)
S32 bCanTouchTrigger = false;
if(result.type == IGGY_DATATYPE_boolean)
{
bCanTouchTrigger = (bool)result.boolval;
bCanTouchTrigger = static_cast<bool>(result.boolval);
}
return bCanTouchTrigger;
}
@ -138,7 +138,7 @@ S32 UIControl_TexturePackList::GetRealHeight()
S32 iRealHeight = m_height;
if(result.type == IGGY_DATATYPE_number)
{
iRealHeight = (S32)result.number;
iRealHeight = static_cast<S32>(result.number);
}
return iRealHeight;
}

View file

@ -65,7 +65,7 @@ static UIControl_Slider *FindSliderById(UIScene *pScene, int sliderId)
{
UIControl *ctrl = (*controls)[i];
if (ctrl && ctrl->getControlType() == UIControl::eSlider && ctrl->getId() == sliderId)
return (UIControl_Slider *)ctrl;
return static_cast<UIControl_Slider *>(ctrl);
}
return NULL;
}
@ -147,7 +147,7 @@ __int64 UIController::iggyAllocCount = 0;
static unordered_map<void *,size_t> allocations;
static void * RADLINK AllocateFunction ( void * alloc_callback_user_data , size_t size_requested , size_t * size_returned )
{
UIController *controller = (UIController *)alloc_callback_user_data;
UIController *controller = static_cast<UIController *>(alloc_callback_user_data);
EnterCriticalSection(&controller->m_Allocatorlock);
#ifdef EXCLUDE_IGGY_ALLOCATIONS_FROM_HEAP_INSPECTOR
void *alloc = __real_malloc(size_requested);
@ -164,7 +164,7 @@ static void * RADLINK AllocateFunction ( void * alloc_callback_user_data , size_
static void RADLINK DeallocateFunction ( void * alloc_callback_user_data , void * ptr )
{
UIController *controller = (UIController *)alloc_callback_user_data;
UIController *controller = static_cast<UIController *>(alloc_callback_user_data);
EnterCriticalSection(&controller->m_Allocatorlock);
size_t size = allocations[ptr];
UIController::iggyAllocCount -= size;
@ -267,7 +267,7 @@ void UIController::SetSysUIShowing(bool bVal)
void UIController::SetSystemUIShowing(LPVOID lpParam,bool bVal)
{
UIController *pClass=(UIController *)lpParam;
UIController *pClass=static_cast<UIController *>(lpParam);
pClass->SetSysUIShowing(bVal);
}
@ -307,7 +307,7 @@ void UIController::postInit()
for(unsigned int i = 0; i < eUIGroup_COUNT; ++i)
{
m_groups[i] = new UIGroup((EUIGroup)i,i-1);
m_groups[i] = new UIGroup(static_cast<EUIGroup>(i),i-1);
}
@ -689,7 +689,7 @@ void UIController::StartReloadSkinThread()
int UIController::reloadSkinThreadProc(void* lpParam)
{
EnterCriticalSection(&ms_reloadSkinCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded
UIController *controller = (UIController *)lpParam;
UIController *controller = static_cast<UIController *>(lpParam);
// Load new skin
controller->loadSkins();
@ -802,8 +802,8 @@ void UIController::tickInput()
Iggy *movie = pScene->getMovie();
int rawMouseX = g_KBMInput.GetMouseX();
int rawMouseY = g_KBMInput.GetMouseY();
F32 mouseX = (F32)rawMouseX;
F32 mouseY = (F32)rawMouseY;
F32 mouseX = static_cast<F32>(rawMouseX);
F32 mouseY = static_cast<F32>(rawMouseY);
extern HWND g_hWnd;
if (g_hWnd)
@ -814,8 +814,8 @@ void UIController::tickInput()
int winH = rc.bottom - rc.top;
if (winW > 0 && winH > 0)
{
mouseX = mouseX * (m_fScreenWidth / (F32)winW);
mouseY = mouseY * (m_fScreenHeight / (F32)winH);
mouseX = mouseX * (m_fScreenWidth / static_cast<F32>(winW));
mouseY = mouseY * (m_fScreenHeight / static_cast<F32>(winH));
}
}
@ -861,8 +861,8 @@ void UIController::tickInput()
pScene->GetParentLayer()->getRenderDimensions(displayWidth, displayHeight);
if (displayWidth > 0 && displayHeight > 0)
{
sceneMouseX = mouseX * ((F32)pScene->getRenderWidth() / (F32)displayWidth);
sceneMouseY = mouseY * ((F32)pScene->getRenderHeight() / (F32)displayHeight);
sceneMouseX = mouseX * (static_cast<F32>(pScene->getRenderWidth()) / static_cast<F32>(displayWidth));
sceneMouseY = mouseY * (static_cast<F32>(pScene->getRenderHeight()) / static_cast<F32>(displayHeight));
}
}
@ -896,7 +896,7 @@ void UIController::tickInput()
if (!ctrl || ctrl->getControlType() != UIControl::eSlider || !ctrl->getVisible())
continue;
UIControl_Slider *pSlider = (UIControl_Slider *)ctrl;
UIControl_Slider *pSlider = static_cast<UIControl_Slider *>(ctrl);
pSlider->UpdateControl();
S32 cx = pSlider->getXPos() + panelOffsetX;
S32 cy = pSlider->getYPos() + panelOffsetY;
@ -925,7 +925,7 @@ void UIController::tickInput()
S32 sliderWidth = pSlider->GetRealWidth();
if (sliderWidth > 0)
{
float fNewSliderPos = (sceneMouseX - (float)sliderX) / (float)sliderWidth;
float fNewSliderPos = (sceneMouseX - static_cast<float>(sliderX)) / static_cast<float>(sliderWidth);
if (fNewSliderPos < 0.0f) fNewSliderPos = 0.0f;
if (fNewSliderPos > 1.0f) fNewSliderPos = 1.0f;
pSlider->SetSliderTouchPos(fNewSliderPos);
@ -1347,7 +1347,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
bool handled = false;
// Send the key to the fullscreen group first
m_groups[(int)eUIGroup_Fullscreen]->handleInput(iPad, key, repeat, pressed, released, handled);
m_groups[static_cast<int>(eUIGroup_Fullscreen)]->handleInput(iPad, key, repeat, pressed, released, handled);
if(!handled)
{
// If it's not been handled yet, then pass the event onto the players specific group
@ -1358,7 +1358,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
rrbool RADLINK UIController::ExternalFunctionCallback( void * user_callback_data , Iggy * player , IggyExternalFunctionCallUTF16 * call)
{
UIScene *scene = (UIScene *)IggyPlayerGetUserdata(player);
UIScene *scene = static_cast<UIScene *>(IggyPlayerGetUserdata(player));
if(scene != NULL)
{
@ -1425,25 +1425,25 @@ void UIController::getRenderDimensions(C4JRender::eViewportType viewport, S32 &w
switch( viewport )
{
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
width = (S32)(getScreenWidth());
height = (S32)(getScreenHeight());
width = static_cast<S32>(getScreenWidth());
height = static_cast<S32>(getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
width = (S32)(getScreenWidth() / 2);
height = (S32)(getScreenHeight() / 2);
width = static_cast<S32>(getScreenWidth() / 2);
height = static_cast<S32>(getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
width = (S32)(getScreenWidth() / 2);
height = (S32)(getScreenHeight() / 2);
width = static_cast<S32>(getScreenWidth() / 2);
height = static_cast<S32>(getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
width = (S32)(getScreenWidth() / 2);
height = (S32)(getScreenHeight() / 2);
width = static_cast<S32>(getScreenWidth() / 2);
height = static_cast<S32>(getScreenHeight() / 2);
break;
}
}
@ -1459,30 +1459,30 @@ void UIController::setupRenderPosition(C4JRender::eViewportType viewport)
switch( viewport )
{
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
xPos = (S32)(getScreenWidth() / 4);
xPos = static_cast<S32>(getScreenWidth() / 4);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
xPos = (S32)(getScreenWidth() / 4);
yPos = (S32)(getScreenHeight() / 2);
xPos = static_cast<S32>(getScreenWidth() / 4);
yPos = static_cast<S32>(getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
yPos = (S32)(getScreenHeight() / 4);
yPos = static_cast<S32>(getScreenHeight() / 4);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
xPos = (S32)(getScreenWidth() / 2);
yPos = (S32)(getScreenHeight() / 4);
xPos = static_cast<S32>(getScreenWidth() / 2);
yPos = static_cast<S32>(getScreenHeight() / 4);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = (S32)(getScreenWidth() / 2);
xPos = static_cast<S32>(getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = (S32)(getScreenHeight() / 2);
yPos = static_cast<S32>(getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = (S32)(getScreenWidth() / 2);
yPos = (S32)(getScreenHeight() / 2);
xPos = static_cast<S32>(getScreenWidth() / 2);
yPos = static_cast<S32>(getScreenHeight() / 2);
break;
}
m_tileOriginX = xPos;
@ -1547,8 +1547,8 @@ void UIController::setupCustomDrawMatrices(UIScene *scene, CustomDrawData *custo
Minecraft *pMinecraft=Minecraft::GetInstance();
// Clear just the region required for this control.
float sceneWidth = (float)scene->getRenderWidth();
float sceneHeight = (float)scene->getRenderHeight();
float sceneWidth = static_cast<float>(scene->getRenderWidth());
float sceneHeight = static_cast<float>(scene->getRenderHeight());
LONG left, right, top, bottom;
#ifdef __PS3__
@ -1578,8 +1578,8 @@ void UIController::setupCustomDrawMatrices(UIScene *scene, CustomDrawData *custo
Minecraft *pMinecraft=Minecraft::GetInstance();
if(pMinecraft != NULL)
{
m_fScreenWidth=(float)pMinecraft->width_phys;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fScreenWidth=static_cast<float>(pMinecraft->width_phys);
m_fScreenHeight=static_cast<float>(pMinecraft->height_phys);
m_bScreenWidthSetup = true;
}
}
@ -1623,7 +1623,7 @@ void UIController::endCustomDrawGameStateAndMatrices()
void RADLINK UIController::CustomDrawCallback(void *user_callback_data, Iggy *player, IggyCustomDrawCallbackRegion *region)
{
UIScene *scene = (UIScene *)IggyPlayerGetUserdata(player);
UIScene *scene = static_cast<UIScene *>(IggyPlayerGetUserdata(player));
if(scene != NULL)
{
@ -1670,7 +1670,7 @@ GDrawTexture * RADLINK UIController::TextureSubstitutionCreateCallback ( void *
#endif
*destroy_callback_data = (void *)id;
app.DebugPrintf("Found substitution texture %ls (%d) - %dx%d\n", (wchar_t *)texture_name, id, image.getWidth(), image.getHeight());
app.DebugPrintf("Found substitution texture %ls (%d) - %dx%d\n", static_cast<wchar_t *>(texture_name), id, image.getWidth(), image.getHeight());
return ui.getSubstitutionTexture(id);
}
else
@ -1680,7 +1680,7 @@ GDrawTexture * RADLINK UIController::TextureSubstitutionCreateCallback ( void *
}
else
{
app.DebugPrintf("Could not find substitution texture %ls\n", (wchar_t *)texture_name);
app.DebugPrintf("Could not find substitution texture %ls\n", static_cast<wchar_t *>(texture_name));
return NULL;
}
}
@ -1691,7 +1691,7 @@ void RADLINK UIController::TextureSubstitutionDestroyCallback ( void * user_call
{
// Orbis complains about casting a pointer to an int
LONGLONG llVal=(LONGLONG)destroy_callback_data;
int id=(int)llVal;
int id=static_cast<int>(llVal);
app.DebugPrintf("Destroying iggy texture %d\n", id);
ui.destroySubstitutionTexture(user_callback_data, handle);
@ -1791,7 +1791,7 @@ bool UIController::NavigateToScene(int iPad, EUIScene scene, void *initData, EUI
if( ( iPad != 255 ) && ( iPad >= 0 ) )
{
menuDisplayedPad = iPad;
group = (EUIGroup)(iPad+1);
group = static_cast<EUIGroup>(iPad + 1);
}
else group = eUIGroup_Fullscreen;
}
@ -1806,7 +1806,7 @@ bool UIController::NavigateToScene(int iPad, EUIScene scene, void *initData, EUI
EnterCriticalSection(&m_navigationLock);
SetMenuDisplayed(menuDisplayedPad,true);
bool success = m_groups[(int)group]->NavigateToScene(iPad, scene, initData, layer);
bool success = m_groups[static_cast<int>(group)]->NavigateToScene(iPad, scene, initData, layer);
if(success && group == eUIGroup_Fullscreen) setFullscreenMenuDisplayed(true);
LeaveCriticalSection(&m_navigationLock);
@ -1821,18 +1821,18 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI
bool navComplete = false;
if( app.GetGameStarted() )
{
bool navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
bool navComplete = m_groups[static_cast<int>(eUIGroup_Fullscreen)]->NavigateBack(iPad, eScene, eLayer);
if(!navComplete && ( iPad != 255 ) && ( iPad >= 0 ) )
{
EUIGroup group = (EUIGroup)(iPad+1);
navComplete = m_groups[(int)group]->NavigateBack(iPad, eScene, eLayer);
if(!m_groups[(int)group]->GetMenuDisplayed())SetMenuDisplayed(iPad,false);
EUIGroup group = static_cast<EUIGroup>(iPad + 1);
navComplete = m_groups[static_cast<int>(group)]->NavigateBack(iPad, eScene, eLayer);
if(!m_groups[static_cast<int>(group)]->GetMenuDisplayed())SetMenuDisplayed(iPad,false);
}
// 4J-PB - autosave in fullscreen doesn't clear the menuDisplayed flag
else
{
if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed())
if(!m_groups[static_cast<int>(eUIGroup_Fullscreen)]->GetMenuDisplayed())
{
setFullscreenMenuDisplayed(false);
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
@ -1844,8 +1844,8 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI
}
else
{
navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false);
navComplete = m_groups[static_cast<int>(eUIGroup_Fullscreen)]->NavigateBack(iPad, eScene, eLayer);
if(!m_groups[static_cast<int>(eUIGroup_Fullscreen)]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false);
}
return navComplete;
}
@ -1870,7 +1870,7 @@ void UIController::NavigateToHomeMenu()
if(pTexPack->hasAudio())
{
// get the dlc texture pack, and store it
pDLCTexPack=(DLCTexturePack *)pTexPack;
pDLCTexPack=static_cast<DLCTexturePack *>(pTexPack);
}
// change to the default texture pack
@ -1925,7 +1925,7 @@ UIScene *UIController::GetTopScene(int iPad, EUILayer layer, EUIGroup group)
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) )
{
group = (EUIGroup)(iPad+1);
group = static_cast<EUIGroup>(iPad + 1);
}
else group = eUIGroup_Fullscreen;
}
@ -1935,7 +1935,7 @@ UIScene *UIController::GetTopScene(int iPad, EUILayer layer, EUIGroup group)
group = eUIGroup_Fullscreen;
}
}
return m_groups[(int)group]->GetTopScene(layer);
return m_groups[static_cast<int>(group)]->GetTopScene(layer);
}
size_t UIController::RegisterForCallbackId(UIScene *scene)
@ -1983,7 +1983,7 @@ void UIController::LeaveCallbackIdCriticalSection()
void UIController::CloseAllPlayersScenes()
{
m_groups[(int)eUIGroup_Fullscreen]->getTooltips()->SetTooltips(-1);
m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getTooltips()->SetTooltips(-1);
for(unsigned int i = 0; i < eUIGroup_COUNT; ++i)
{
//m_bCloseAllScenes[i] = true;
@ -2006,7 +2006,7 @@ void UIController::CloseUIScenes(int iPad, bool forceIPad)
if( app.GetGameStarted() || forceIPad )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
@ -2014,22 +2014,22 @@ void UIController::CloseUIScenes(int iPad, bool forceIPad)
group = eUIGroup_Fullscreen;
}
m_groups[(int)group]->closeAllScenes();
m_groups[(int)group]->getTooltips()->SetTooltips(-1);
m_groups[static_cast<int>(group)]->closeAllScenes();
m_groups[static_cast<int>(group)]->getTooltips()->SetTooltips(-1);
// This should cause the popup to dissappear
TutorialPopupInfo popupInfo;
if(m_groups[(int)group]->getTutorialPopup()) m_groups[(int)group]->getTutorialPopup()->SetTutorialDescription(&popupInfo);
if(m_groups[static_cast<int>(group)]->getTutorialPopup()) m_groups[static_cast<int>(group)]->getTutorialPopup()->SetTutorialDescription(&popupInfo);
if(group==eUIGroup_Fullscreen) setFullscreenMenuDisplayed(false);
SetMenuDisplayed((group == eUIGroup_Fullscreen ? XUSER_INDEX_ANY : iPad), m_groups[(int)group]->GetMenuDisplayed());
SetMenuDisplayed((group == eUIGroup_Fullscreen ? XUSER_INDEX_ANY : iPad), m_groups[static_cast<int>(group)]->GetMenuDisplayed());
}
void UIController::setFullscreenMenuDisplayed(bool displayed)
{
// Show/hide the tooltips for the fullscreen group
m_groups[(int)eUIGroup_Fullscreen]->showComponent(ProfileManager.GetPrimaryPad(),eUIComponent_Tooltips,eUILayer_Tooltips,displayed);
m_groups[static_cast<int>(eUIGroup_Fullscreen)]->showComponent(ProfileManager.GetPrimaryPad(),eUIComponent_Tooltips,eUILayer_Tooltips,displayed);
// Show/hide tooltips for the other layers
for(unsigned int i = (eUIGroup_Fullscreen+1); i < eUIGroup_COUNT; ++i)
@ -2044,14 +2044,14 @@ bool UIController::IsPauseMenuDisplayed(int iPad)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
return m_groups[(int)group]->IsPauseMenuDisplayed();
return m_groups[static_cast<int>(group)]->IsPauseMenuDisplayed();
}
bool UIController::IsContainerMenuDisplayed(int iPad)
@ -2060,14 +2060,14 @@ bool UIController::IsContainerMenuDisplayed(int iPad)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
return m_groups[(int)group]->IsContainerMenuDisplayed();
return m_groups[static_cast<int>(group)]->IsContainerMenuDisplayed();
}
bool UIController::IsIgnorePlayerJoinMenuDisplayed(int iPad)
@ -2076,14 +2076,14 @@ bool UIController::IsIgnorePlayerJoinMenuDisplayed(int iPad)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
return m_groups[(int)group]->IsIgnorePlayerJoinMenuDisplayed();
return m_groups[static_cast<int>(group)]->IsIgnorePlayerJoinMenuDisplayed();
}
bool UIController::IsIgnoreAutosaveMenuDisplayed(int iPad)
@ -2092,14 +2092,14 @@ bool UIController::IsIgnoreAutosaveMenuDisplayed(int iPad)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
return m_groups[(int)eUIGroup_Fullscreen]->IsIgnoreAutosaveMenuDisplayed() || (group != eUIGroup_Fullscreen && m_groups[(int)group]->IsIgnoreAutosaveMenuDisplayed());
return m_groups[static_cast<int>(eUIGroup_Fullscreen)]->IsIgnoreAutosaveMenuDisplayed() || (group != eUIGroup_Fullscreen && m_groups[static_cast<int>(group)]->IsIgnoreAutosaveMenuDisplayed());
}
void UIController::SetIgnoreAutosaveMenuDisplayed(int iPad, bool displayed)
@ -2113,14 +2113,14 @@ bool UIController::IsSceneInStack(int iPad, EUIScene eScene)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
return m_groups[(int)group]->IsSceneInStack(eScene);
return m_groups[static_cast<int>(group)]->IsSceneInStack(eScene);
}
bool UIController::GetMenuDisplayed(int iPad)
@ -2201,14 +2201,14 @@ void UIController::SetTooltipText( unsigned int iPad, unsigned int tooltip, int
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->SetTooltipText(tooltip, iTextID);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->SetTooltipText(tooltip, iTextID);
}
void UIController::SetEnableTooltips( unsigned int iPad, BOOL bVal )
@ -2217,14 +2217,14 @@ void UIController::SetEnableTooltips( unsigned int iPad, BOOL bVal )
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->SetEnableTooltips(bVal);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->SetEnableTooltips(bVal);
}
void UIController::ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show )
@ -2233,14 +2233,14 @@ void UIController::ShowTooltip( unsigned int iPad, unsigned int tooltip, bool sh
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->ShowTooltip(tooltip,show);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->ShowTooltip(tooltip,show);
}
void UIController::SetTooltips( unsigned int iPad, int iA, int iB, int iX, int iY, int iLT, int iRT, int iLB, int iRB, int iLS, int iRS, int iBack, bool forceUpdate)
@ -2262,14 +2262,14 @@ void UIController::SetTooltips( unsigned int iPad, int iA, int iB, int iX, int i
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->SetTooltips(iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS, iBack, forceUpdate);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->SetTooltips(iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS, iBack, forceUpdate);
}
void UIController::EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable )
@ -2278,14 +2278,14 @@ void UIController::EnableTooltip( unsigned int iPad, unsigned int tooltip, bool
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->EnableTooltip(tooltip,enable);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->EnableTooltip(tooltip,enable);
}
void UIController::RefreshTooltips(unsigned int iPad)
@ -2304,7 +2304,7 @@ void UIController::AnimateKeyPress(int iPad, int iAction, bool bRepeat, bool bPr
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
@ -2312,7 +2312,7 @@ void UIController::AnimateKeyPress(int iPad, int iAction, bool bRepeat, bool bPr
group = eUIGroup_Fullscreen;
}
bool handled = false;
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->handleInput(iPad, iAction, bRepeat, bPressed, bReleased, handled);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->handleInput(iPad, iAction, bRepeat, bPressed, bReleased, handled);
}
void UIController::OverrideSFX(int iPad, int iAction,bool bVal)
@ -2322,7 +2322,7 @@ void UIController::OverrideSFX(int iPad, int iAction,bool bVal)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
@ -2330,7 +2330,7 @@ void UIController::OverrideSFX(int iPad, int iAction,bool bVal)
group = eUIGroup_Fullscreen;
}
bool handled = false;
if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->overrideSFX(iPad, iAction,bVal);
if(m_groups[static_cast<int>(group)]->getTooltips()) m_groups[static_cast<int>(group)]->getTooltips()->overrideSFX(iPad, iAction,bVal);
}
void UIController::PlayUISFX(ESoundEffect eSound)
@ -2352,13 +2352,13 @@ void UIController::DisplayGamertag(unsigned int iPad, bool show)
{
show = false;
}
EUIGroup group = (EUIGroup)(iPad+1);
if(m_groups[(int)group]->getHUD()) m_groups[(int)group]->getHUD()->ShowDisplayName(show);
EUIGroup group = static_cast<EUIGroup>(iPad + 1);
if(m_groups[static_cast<int>(group)]->getHUD()) m_groups[static_cast<int>(group)]->getHUD()->ShowDisplayName(show);
// Update TutorialPopup in Splitscreen if no container is displayed (to make sure the Popup does not overlap with the Gamertag!)
if(app.GetLocalPlayerCount() > 1 && m_groups[(int)group]->getTutorialPopup() && !m_groups[(int)group]->IsContainerMenuDisplayed())
if(app.GetLocalPlayerCount() > 1 && m_groups[static_cast<int>(group)]->getTutorialPopup() && !m_groups[static_cast<int>(group)]->IsContainerMenuDisplayed())
{
m_groups[(int)group]->getTutorialPopup()->UpdateTutorialPopup();
m_groups[static_cast<int>(group)]->getTutorialPopup()->UpdateTutorialPopup();
}
}
@ -2369,7 +2369,7 @@ void UIController::SetSelectedItem(unsigned int iPad, const wstring &name)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
@ -2377,7 +2377,7 @@ void UIController::SetSelectedItem(unsigned int iPad, const wstring &name)
group = eUIGroup_Fullscreen;
}
bool handled = false;
if(m_groups[(int)group]->getHUD()) m_groups[(int)group]->getHUD()->SetSelectedLabel(name);
if(m_groups[static_cast<int>(group)]->getHUD()) m_groups[static_cast<int>(group)]->getHUD()->SetSelectedLabel(name);
}
void UIController::UpdateSelectedItemPos(unsigned int iPad)
@ -2430,7 +2430,7 @@ void UIController::HandleInventoryUpdated(int iPad)
EUIGroup group = eUIGroup_Fullscreen;
if( app.GetGameStarted() && ( iPad != 255 ) && ( iPad >= 0 ) )
{
group = (EUIGroup)(iPad+1);
group = static_cast<EUIGroup>(iPad + 1);
}
m_groups[group]->HandleMessage(eUIMessage_InventoryUpdated, NULL);
@ -2452,14 +2452,14 @@ void UIController::SetTutorial(int iPad, Tutorial *tutorial)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTutorialPopup()) m_groups[(int)group]->getTutorialPopup()->SetTutorial(tutorial);
if(m_groups[static_cast<int>(group)]->getTutorialPopup()) m_groups[static_cast<int>(group)]->getTutorialPopup()->SetTutorial(tutorial);
}
void UIController::SetTutorialDescription(int iPad, TutorialPopupInfo *info)
@ -2468,7 +2468,7 @@ void UIController::SetTutorialDescription(int iPad, TutorialPopupInfo *info)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
@ -2476,11 +2476,11 @@ void UIController::SetTutorialDescription(int iPad, TutorialPopupInfo *info)
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTutorialPopup())
if(m_groups[static_cast<int>(group)]->getTutorialPopup())
{
// tutorial popup needs to know if a container menu is being displayed
m_groups[(int)group]->getTutorialPopup()->SetContainerMenuVisible(m_groups[(int)group]->IsContainerMenuDisplayed());
m_groups[(int)group]->getTutorialPopup()->SetTutorialDescription(info);
m_groups[static_cast<int>(group)]->getTutorialPopup()->SetContainerMenuVisible(m_groups[static_cast<int>(group)]->IsContainerMenuDisplayed());
m_groups[static_cast<int>(group)]->getTutorialPopup()->SetTutorialDescription(info);
}
}
@ -2488,9 +2488,9 @@ void UIController::SetTutorialDescription(int iPad, TutorialPopupInfo *info)
void UIController::RemoveInteractSceneReference(int iPad, UIScene *scene)
{
EUIGroup group;
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
if(m_groups[(int)group]->getTutorialPopup()) m_groups[(int)group]->getTutorialPopup()->RemoveInteractSceneReference(scene);
if(m_groups[static_cast<int>(group)]->getTutorialPopup()) m_groups[static_cast<int>(group)]->getTutorialPopup()->RemoveInteractSceneReference(scene);
}
#endif
@ -2500,14 +2500,14 @@ void UIController::SetTutorialVisible(int iPad, bool visible)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
{
group = eUIGroup_Fullscreen;
}
if(m_groups[(int)group]->getTutorialPopup()) m_groups[(int)group]->getTutorialPopup()->SetVisible(visible);
if(m_groups[static_cast<int>(group)]->getTutorialPopup()) m_groups[static_cast<int>(group)]->getTutorialPopup()->SetVisible(visible);
}
bool UIController::IsTutorialVisible(int iPad)
@ -2516,7 +2516,7 @@ bool UIController::IsTutorialVisible(int iPad)
if( app.GetGameStarted() )
{
// If the game isn't running treat as user 0, otherwise map index directly from pad
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = (EUIGroup)(iPad+1);
if( ( iPad != 255 ) && ( iPad >= 0 ) ) group = static_cast<EUIGroup>(iPad + 1);
else group = eUIGroup_Fullscreen;
}
else
@ -2524,7 +2524,7 @@ bool UIController::IsTutorialVisible(int iPad)
group = eUIGroup_Fullscreen;
}
bool visible = false;
if(m_groups[(int)group]->getTutorialPopup()) visible = m_groups[(int)group]->getTutorialPopup()->IsVisible();
if(m_groups[static_cast<int>(group)]->getTutorialPopup()) visible = m_groups[static_cast<int>(group)]->getTutorialPopup()->IsVisible();
return visible;
}
@ -2544,7 +2544,7 @@ void UIController::UpdatePlayerBasePositions()
{
DisplayGamertag(idx,true);
}
m_groups[idx+1]->SetViewportType((C4JRender::eViewportType)pMinecraft->localplayers[idx]->m_iScreenSection);
m_groups[idx+1]->SetViewportType(static_cast<C4JRender::eViewportType>(pMinecraft->localplayers[idx]->m_iScreenSection));
}
else
{
@ -2577,7 +2577,7 @@ void UIController::ShowOtherPlayersBaseScene(unsigned int iPad, bool show)
void UIController::ShowTrialTimer(bool show)
{
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->showTrialTimer(show);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->showTrialTimer(show);
}
void UIController::SetTrialTimerLimitSecs(unsigned int uiSeconds)
@ -2589,7 +2589,7 @@ void UIController::UpdateTrialTimer(unsigned int iPad)
{
WCHAR wcTime[20];
DWORD dwTimeTicks=(DWORD)app.getTrialTimer();
DWORD dwTimeTicks=static_cast<DWORD>(app.getTrialTimer());
if(dwTimeTicks>m_dwTrialTimerLimitSecs)
{
@ -2608,11 +2608,11 @@ void UIController::UpdateTrialTimer(unsigned int iPad)
int iMins=dwTimeTicks/60;
int iSeconds=dwTimeTicks%60;
swprintf( wcTime, 20, L"%d:%02d",iMins,iSeconds);
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(wcTime);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(wcTime);
}
else
{
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(L"");
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(L"");
}
// are we out of time?
@ -2631,7 +2631,7 @@ void UIController::UpdateTrialTimer(unsigned int iPad)
void UIController::ReduceTrialTimerValue()
{
DWORD dwTimeTicks=(int)app.getTrialTimer();
DWORD dwTimeTicks=static_cast<int>(app.getTrialTimer());
if(dwTimeTicks>m_dwTrialTimerLimitSecs)
{
@ -2643,7 +2643,7 @@ void UIController::ReduceTrialTimerValue()
void UIController::ShowAutosaveCountdownTimer(bool show)
{
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->showTrialTimer(show);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->showTrialTimer(show);
}
void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds)
@ -2651,7 +2651,7 @@ void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds)
#if !(defined(_XBOX_ONE) || defined(__ORBIS__))
WCHAR wcAutosaveCountdown[100];
swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds);
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown);
#endif
}
@ -2668,12 +2668,12 @@ void UIController::ShowSavingMessage(unsigned int iPad, C4JStorage::ESavingMessa
show = true;
break;
}
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->showSaveIcon(show);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->showSaveIcon(show);
}
void UIController::ShowPlayerDisplayname(bool show)
{
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->showPlayerDisplayName(show);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->showPlayerDisplayName(show);
}
void UIController::SetWinUserIndex(unsigned int iPad)
@ -2692,7 +2692,7 @@ void UIController::ShowUIDebugConsole(bool show)
if(show)
{
m_uiDebugConsole = (UIComponent_DebugUIConsole *)m_groups[eUIGroup_Fullscreen]->addComponent(0, eUIComponent_DebugUIConsole, eUILayer_Debug);
m_uiDebugConsole = static_cast<UIComponent_DebugUIConsole *>(m_groups[eUIGroup_Fullscreen]->addComponent(0, eUIComponent_DebugUIConsole, eUILayer_Debug));
}
else
{
@ -2708,7 +2708,7 @@ void UIController::ShowUIDebugMarketingGuide(bool show)
if(show)
{
m_uiDebugMarketingGuide = (UIComponent_DebugUIMarketingGuide *)m_groups[eUIGroup_Fullscreen]->addComponent(0, eUIComponent_DebugUIMarketingGuide, eUILayer_Debug);
m_uiDebugMarketingGuide = static_cast<UIComponent_DebugUIMarketingGuide *>(m_groups[eUIGroup_Fullscreen]->addComponent(0, eUIComponent_DebugUIMarketingGuide, eUILayer_Debug));
}
else
{
@ -2731,13 +2731,13 @@ bool UIController::PressStartPlaying(unsigned int iPad)
void UIController::ShowPressStart(unsigned int iPad)
{
m_iPressStartQuadrantsMask|=1<<iPad;
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->showPressStart(iPad, true);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->showPressStart(iPad, true);
}
void UIController::HidePressStart()
{
ClearPressStart();
if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->showPressStart(0, false);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->showPressStart(0, false);
}
void UIController::ClearPressStart()

View file

@ -23,22 +23,22 @@ UIGroup::UIGroup(EUIGroup group, int iPad)
#endif
}
m_tooltips = (UIComponent_Tooltips *)m_layers[(int)eUILayer_Tooltips]->addComponent(0, eUIComponent_Tooltips);
m_tooltips = (UIComponent_Tooltips *)m_layers[static_cast<int>(eUILayer_Tooltips)]->addComponent(0, eUIComponent_Tooltips);
m_tutorialPopup = NULL;
m_hud = NULL;
m_pressStartToPlay = NULL;
if(m_group != eUIGroup_Fullscreen)
{
m_tutorialPopup = (UIComponent_TutorialPopup *)m_layers[(int)eUILayer_Popup]->addComponent(m_iPad, eUIComponent_TutorialPopup);
m_tutorialPopup = (UIComponent_TutorialPopup *)m_layers[static_cast<int>(eUILayer_Popup)]->addComponent(m_iPad, eUIComponent_TutorialPopup);
m_hud = (UIScene_HUD *)m_layers[(int)eUILayer_HUD]->addComponent(m_iPad, eUIScene_HUD);
m_hud = (UIScene_HUD *)m_layers[static_cast<int>(eUILayer_HUD)]->addComponent(m_iPad, eUIScene_HUD);
//m_layers[(int)eUILayer_Chat]->addComponent(m_iPad, eUIComponent_Chat);
}
else
{
m_pressStartToPlay = (UIComponent_PressStartToPlay *)m_layers[(int)eUILayer_Tooltips]->addComponent(0, eUIComponent_PressStartToPlay);
m_pressStartToPlay = (UIComponent_PressStartToPlay *)m_layers[static_cast<int>(eUILayer_Tooltips)]->addComponent(0, eUIComponent_PressStartToPlay);
}
// 4J Stu - Pre-allocate this for cached rendering in scenes. It's horribly slow to do dynamically, but we should only need one
@ -65,7 +65,7 @@ void UIGroup::ReloadAll()
if(highestRenderable < eUILayer_Fullscreen) highestRenderable = eUILayer_Fullscreen;
for(; highestRenderable >= 0; --highestRenderable)
{
if(highestRenderable < eUILayer_COUNT) m_layers[highestRenderable]->ReloadAll(highestRenderable != (int)eUILayer_Fullscreen);
if(highestRenderable < eUILayer_COUNT) m_layers[highestRenderable]->ReloadAll(highestRenderable != static_cast<int>(eUILayer_Fullscreen));
}
}
@ -127,7 +127,7 @@ void UIGroup::getRenderDimensions(S32 &width, S32 &height)
// NAVIGATION
bool UIGroup::NavigateToScene(int iPad, EUIScene scene, void *initData, EUILayer layer)
{
bool succeeded = m_layers[(int)layer]->NavigateToScene(iPad, scene, initData);
bool succeeded = m_layers[static_cast<int>(layer)]->NavigateToScene(iPad, scene, initData);
updateStackStates();
return succeeded;
}
@ -153,7 +153,7 @@ void UIGroup::closeAllScenes()
{
if(pMinecraft != NULL && pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(true);
@ -163,14 +163,14 @@ void UIGroup::closeAllScenes()
for(unsigned int i = 0; i < eUILayer_COUNT; ++i)
{
// Ignore the error layer
if(i != (int)eUILayer_Error) m_layers[i]->closeAllScenes();
if(i != static_cast<int>(eUILayer_Error)) m_layers[i]->closeAllScenes();
}
updateStackStates();
}
UIScene *UIGroup::GetTopScene(EUILayer layer)
{
return m_layers[(int)layer]->GetTopScene();
return m_layers[static_cast<int>(layer)]->GetTopScene();
}
bool UIGroup::GetMenuDisplayed()

View file

@ -728,7 +728,7 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
if (pop > 0)
{
glPushMatrix();
float squeeze = 1 + pop / (float) Inventory::POP_TIME_DURATION;
float squeeze = 1 + pop / static_cast<float>(Inventory::POP_TIME_DURATION);
float sx = x;
float sy = y;
float sxoffs = 8 * scaleX;
@ -757,15 +757,15 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
{
glPushMatrix();
glScalef(scaleX, scaleY, 1.0f);
int iX= (int)(0.5f+((float)x)/scaleX);
int iY= (int)(0.5f+((float)y)/scaleY);
int iX= static_cast<int>(0.5f + ((float)x) / scaleX);
int iY= static_cast<int>(0.5f + ((float)y) / scaleY);
m_pItemRenderer->renderGuiItemDecorations(pMinecraft->font, pMinecraft->textures, item, iX, iY, fAlpha);
glPopMatrix();
}
else
{
m_pItemRenderer->renderGuiItemDecorations(pMinecraft->font, pMinecraft->textures, item, (int)x, (int)y, fAlpha);
m_pItemRenderer->renderGuiItemDecorations(pMinecraft->font, pMinecraft->textures, item, static_cast<int>(x), static_cast<int>(y), fAlpha);
}
}
@ -902,7 +902,7 @@ void UIScene::sendInputToMovie(int key, bool repeat, bool pressed, bool released
}
IggyEvent keyEvent;
// 4J Stu - Keyloc is always standard as we don't care about shift/alt
IggyMakeEventKey( &keyEvent, pressed?IGGY_KEYEVENT_Down:IGGY_KEYEVENT_Up, (IggyKeycode)iggyKeyCode, IGGY_KEYLOC_Standard );
IggyMakeEventKey( &keyEvent, pressed?IGGY_KEYEVENT_Down:IGGY_KEYEVENT_Up, static_cast<IggyKeycode>(iggyKeyCode), IGGY_KEYLOC_Standard );
IggyEventResult result;
IggyPlayerDispatchEventRS ( swf , &keyEvent , &result );
@ -1191,8 +1191,8 @@ bool UIScene::hasRegisteredSubstitutionTexture(const wstring &textureName)
void UIScene::_handleFocusChange(F64 controlId, F64 childId)
{
m_iFocusControl = (int)controlId;
m_iFocusChild = (int)childId;
m_iFocusControl = static_cast<int>(controlId);
m_iFocusChild = static_cast<int>(childId);
handleFocusChange(controlId, childId);
ui.PlayUISFX(eSFX_Focus);
@ -1200,8 +1200,8 @@ void UIScene::_handleFocusChange(F64 controlId, F64 childId)
void UIScene::_handleInitFocus(F64 controlId, F64 childId)
{
m_iFocusControl = (int)controlId;
m_iFocusChild = (int)childId;
m_iFocusControl = static_cast<int>(controlId);
m_iFocusChild = static_cast<int>(childId);
//handleInitFocus(controlId, childId);
handleFocusChange(controlId, childId);

View file

@ -51,7 +51,7 @@ void UIScene_AbstractContainerMenu::handleDestroy()
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
}
@ -187,8 +187,8 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
IggyEvent mouseEvent;
S32 width, height;
m_parentLayer->getRenderDimensions(width, height);
S32 x = m_pointerPos.x*((float)width/m_movieWidth);
S32 y = m_pointerPos.y*((float)height/m_movieHeight);
S32 x = m_pointerPos.x*(static_cast<float>(width)/m_movieWidth);
S32 y = m_pointerPos.y*(static_cast<float>(height)/m_movieHeight);
IggyMakeEventMouseMove( &mouseEvent, x, y);
IggyEventResult result;
@ -212,8 +212,8 @@ void UIScene_AbstractContainerMenu::tick()
S32 width, height;
m_parentLayer->getRenderDimensions(width, height);
S32 x = (S32)(m_pointerPos.x * ((float)width / m_movieWidth));
S32 y = (S32)(m_pointerPos.y * ((float)height / m_movieHeight));
S32 x = static_cast<S32>(m_pointerPos.x * ((float)width / m_movieWidth));
S32 y = static_cast<S32>(m_pointerPos.y * ((float)height / m_movieHeight));
IggyMakeEventMouseMove( &mouseEvent, x, y);
@ -265,7 +265,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg
}
else
{
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
if (slotId == -1)
{
app.DebugPrintf("This is not the control we are looking for\n");

View file

@ -16,13 +16,13 @@ UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void *_initData, UILayer *parentL
m_labelAnvil.init( app.GetString(IDS_REPAIR_AND_NAME) );
AnvilScreenInput *initData = (AnvilScreenInput *)_initData;
AnvilScreenInput *initData = static_cast<AnvilScreenInput *>(_initData);
m_inventory = initData->inventory;
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Anvil_Menu, this);
}
@ -309,7 +309,7 @@ UIControl *UIScene_AnvilMenu::getSection(ESceneSection eSection)
int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
// 4J HEG - No reason to set value if keyboard was cancelled
UIScene_AnvilMenu *pClass=(UIScene_AnvilMenu *)lpParam;
UIScene_AnvilMenu *pClass=static_cast<UIScene_AnvilMenu *>(lpParam);
pClass->setIgnoreInput(false);
if (bRes)
@ -342,7 +342,7 @@ void UIScene_AnvilMenu::handleEditNamePressed()
break;
}
#else
InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),static_cast<DWORD>(m_iPad),30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
#endif
}

View file

@ -21,12 +21,12 @@ UIScene_BeaconMenu::UIScene_BeaconMenu(int iPad, void *_initData, UILayer *paren
m_buttonsPowers[eControl_Secondary1].setVisible(false);
m_buttonsPowers[eControl_Secondary2].setVisible(false);
BeaconScreenInput *initData = (BeaconScreenInput *)_initData;
BeaconScreenInput *initData = static_cast<BeaconScreenInput *>(_initData);
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Beacon_Menu, this);
}
@ -328,7 +328,7 @@ void UIScene_BeaconMenu::customDraw(IggyCustomDrawCallbackRegion *region)
shared_ptr<ItemInstance> item = nullptr;
int slotId = -1;
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
if(slotId >= 0 && slotId >= m_menu->getSize() )
{

View file

@ -14,7 +14,7 @@ UIScene_BrewingStandMenu::UIScene_BrewingStandMenu(int iPad, void *_initData, UI
m_progressBrewingArrow.init(L"",0,0,PotionBrewing::BREWING_TIME_SECONDS * SharedConstants::TICKS_PER_SECOND,0);
m_progressBrewingBubbles.init(L"",0,0,30,0);
BrewingScreenInput *initData = (BrewingScreenInput *)_initData;
BrewingScreenInput *initData = static_cast<BrewingScreenInput *>(_initData);
m_brewingStand = initData->brewingStand;
m_labelBrewingStand.init( m_brewingStand->getName() );
@ -22,7 +22,7 @@ UIScene_BrewingStandMenu::UIScene_BrewingStandMenu(int iPad, void *_initData, UI
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Brewing_Menu, this);
}

View file

@ -15,7 +15,7 @@ UIScene_ConnectingProgress::UIScene_ConnectingProgress(int iPad, void *_initData
m_progressBar.setVisible( false );
m_labelTip.setVisible( false );
ConnectionProgressParams *param = (ConnectionProgressParams *)_initData;
ConnectionProgressParams *param = static_cast<ConnectionProgressParams *>(_initData);
if( param->stringId >= 0 )
{
@ -245,7 +245,7 @@ void UIScene_ConnectingProgress::handleInput(int iPad, int key, bool repeat, boo
void UIScene_ConnectingProgress::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_Confirm:
if(m_showingButton)

View file

@ -13,7 +13,7 @@
UIScene_ContainerMenu::UIScene_ContainerMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene_AbstractContainerMenu(iPad, parentLayer)
{
ContainerScreenInput *initData = (ContainerScreenInput *)_initData;
ContainerScreenInput *initData = static_cast<ContainerScreenInput *>(_initData);
m_bLargeChest = (initData->container->getContainerSize() > 3*9)?true:false;
// Setup all the Iggy references we need for this scene
@ -26,7 +26,7 @@ UIScene_ContainerMenu::UIScene_ContainerMenu(int iPad, void *_initData, UILayer
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Container_Menu, this);
}

View file

@ -13,7 +13,7 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
#if defined(_XBOX) || defined(_WIN64)
value[0].number = (F64)0;
value[0].number = static_cast<F64>(0);
#elif defined(_DURANGO)
value[0].number = (F64)1;
#elif defined(__PS3__)
@ -84,7 +84,7 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (F64)m_iCurrentNavigatedControlsLayout;
value[0].number = static_cast<F64>(m_iCurrentNavigatedControlsLayout);
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetControllerLayout , 1 , value );
}
@ -180,7 +180,7 @@ void UIScene_ControlsMenu::handleInput(int iPad, int key, bool repeat, bool pres
void UIScene_ControlsMenu::handleCheckboxToggled(F64 controlId, bool selected)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_InvertLook:
app.SetGameSettings(m_iPad,eGameSetting_ControlInvertLook,(unsigned char)( selected ) );
@ -194,13 +194,13 @@ void UIScene_ControlsMenu::handleCheckboxToggled(F64 controlId, bool selected)
void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId)
{
int control = (int)controlId;
int control = static_cast<int>(controlId);
switch(control)
{
case eControl_Button0:
case eControl_Button1:
case eControl_Button2:
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,(unsigned char)control);
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,static_cast<unsigned char>(control));
LPWSTR layoutString = new wchar_t[ 128 ];
swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[control]));
#ifdef __ORBIS__
@ -216,7 +216,7 @@ void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId)
void UIScene_ControlsMenu::handleFocusChange(F64 controlId, F64 childId)
{
int control = (int)controlId;
int control = static_cast<int>(controlId);
switch(control)
{
case eControl_Button0:

View file

@ -14,7 +14,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p
{
m_bIgnoreKeyPresses = false;
CraftingPanelScreenInput* initData = (CraftingPanelScreenInput*)_initData;
CraftingPanelScreenInput* initData = static_cast<CraftingPanelScreenInput *>(_initData);
m_iContainerType=initData->iContainerType;
m_pPlayer=initData->player;
m_bSplitscreen=initData->bSplitscreen;
@ -111,7 +111,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
if(m_iContainerType==RECIPE_TYPE_2x2)
{
@ -192,7 +192,7 @@ void UIScene_CraftingMenu::handleDestroy()
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
}
@ -443,7 +443,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
float alpha = 1.0f;
bool decorations = true;
bool inventoryItem = false;
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
if (slotId == -1)
{
app.DebugPrintf("This is not the control we are looking for\n");
@ -471,7 +471,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_vSlotsInfo[iIndex].show)
{
item = m_vSlotsInfo[iIndex].item;
alpha = ((float)m_vSlotsInfo[iIndex].alpha)/31.0f;
alpha = static_cast<float>(m_vSlotsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId >= CRAFTING_H_SLOT_START && slotId < (CRAFTING_H_SLOT_START + m_iCraftablesMaxHSlotC) )
@ -481,7 +481,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_hSlotsInfo[iIndex].show)
{
item = m_hSlotsInfo[iIndex].item;
alpha = ((float)m_hSlotsInfo[iIndex].alpha)/31.0f;
alpha = static_cast<float>(m_hSlotsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId >= CRAFTING_INGREDIENTS_LAYOUT_START && slotId < (CRAFTING_INGREDIENTS_LAYOUT_START + m_iIngredientsMaxSlotC) )
@ -490,7 +490,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_ingredientsSlotsInfo[iIndex].show)
{
item = m_ingredientsSlotsInfo[iIndex].item;
alpha = ((float)m_ingredientsSlotsInfo[iIndex].alpha)/31.0f;
alpha = static_cast<float>(m_ingredientsSlotsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId >= CRAFTING_INGREDIENTS_DESCRIPTION_START && slotId < (CRAFTING_INGREDIENTS_DESCRIPTION_START + 4) )
@ -499,7 +499,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_ingredientsInfo[iIndex].show)
{
item = m_ingredientsInfo[iIndex].item;
alpha = ((float)m_ingredientsInfo[iIndex].alpha)/31.0f;
alpha = static_cast<float>(m_ingredientsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId == CRAFTING_OUTPUT_SLOT_START )
@ -507,7 +507,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_craftingOutputSlotInfo.show)
{
item = m_craftingOutputSlotInfo.item;
alpha = ((float)m_craftingOutputSlotInfo.alpha)/31.0f;
alpha = static_cast<float>(m_craftingOutputSlotInfo.alpha)/31.0f;
}
}

View file

@ -317,7 +317,7 @@ void UIScene_CreateWorldMenu::tick()
m_iDirectEditCooldown = 4; // absorb the matching ACTION_MENU_OK that follows
m_editWorldName.setLabel(m_worldName.c_str());
}
else if ((int)m_worldName.length() < 25)
else if (static_cast<int>(m_worldName.length()) < 25)
{
m_worldName += ch;
changed = true;
@ -470,7 +470,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_EditWorldName:
{
@ -519,7 +519,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
break;
case eControl_TexturePackList:
{
UpdateCurrentTexturePack((int)childId);
UpdateCurrentTexturePack(static_cast<int>(childId));
}
break;
case eControl_NewWorld:
@ -615,7 +615,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
{
// texture pack hasn't been set yet, so check what it will be
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack;
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(pTexturePack);
m_pDLCPack=pDLCTexPack->getDLCInfoParentPack();
// do we have a license?
@ -686,8 +686,8 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
WCHAR TempString[256];
int value = (int)currentValue;
switch((int)sliderId)
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
{
case eControl_Difficulty:
m_sliderDifficulty.handleSliderMove(value);
@ -801,7 +801,7 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack)
int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes)
{
UIScene_CreateWorldMenu *pClass=(UIScene_CreateWorldMenu *)lpParam;
UIScene_CreateWorldMenu *pClass=static_cast<UIScene_CreateWorldMenu *>(lpParam);
pClass->m_bIgnoreInput=false;
// 4J HEG - No reason to set value if keyboard was cancelled
if (bRes)
@ -1173,7 +1173,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
if (wSeed.length() != 0)
{
__int64 value = 0;
unsigned int len = (unsigned int)wSeed.length();
unsigned int len = static_cast<unsigned int>(wSeed.length());
//Check if the input string contains a numerical value
bool isNumber = true;
@ -1247,8 +1247,8 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false);
#ifdef _LARGE_WORLDS
app.SetGameHostOption(eGameHostOption_WorldSize, pClass->m_MoreOptionsParams.worldSize+1 ); // 0 is GAME_HOST_OPTION_WORLDSIZE_UNKNOWN
pClass->m_MoreOptionsParams.currentWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1);
pClass->m_MoreOptionsParams.newWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1);
pClass->m_MoreOptionsParams.currentWorldSize = static_cast<EGameHostOptionWorldSize>(pClass->m_MoreOptionsParams.worldSize + 1);
pClass->m_MoreOptionsParams.newWorldSize = static_cast<EGameHostOptionWorldSize>(pClass->m_MoreOptionsParams.worldSize + 1);
#endif
g_NetworkManager.HostGame(dwLocalUsersMask,isClientSide,isPrivate,MINECRAFT_NET_MAX_PLAYERS,0);
@ -1290,7 +1290,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = (LPVOID)param;
loadingParams->lpParam = static_cast<LPVOID>(param);
// Reset the autosave time
app.SetAutosaveTimerTime();
@ -1308,7 +1308,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
UIScene_CreateWorldMenu* pClass = static_cast<UIScene_CreateWorldMenu *>(pParam);
if(bContinue==true)
{
@ -1416,7 +1416,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu
int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
UIScene_CreateWorldMenu* pClass = static_cast<UIScene_CreateWorldMenu *>(pParam);
if(result==C4JStorage::EMessage_ResultAccept)
{

View file

@ -19,7 +19,7 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p
// Setup all the Iggy references we need for this scene
initialiseMovie();
InventoryScreenInput *initData = (InventoryScreenInput *)_initData;
InventoryScreenInput *initData = static_cast<InventoryScreenInput *>(_initData);
shared_ptr<SimpleContainer> creativeContainer = shared_ptr<SimpleContainer>(new SimpleContainer( 0, L"", false, TabSpec::MAX_SIZE ));
itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory);
@ -44,7 +44,7 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Creative_Inventory_Menu, this);
}
@ -144,7 +144,7 @@ void UIScene_CreativeMenu::handleOtherClicked(int iPad, ESceneSection eSection,
case eSectionInventoryCreativeTab_6:
case eSectionInventoryCreativeTab_7:
{
ECreativeInventoryTabs tab = (ECreativeInventoryTabs)((int)eCreativeInventoryTab_BuildingBlocks + (int)eSection - (int)eSectionInventoryCreativeTab_0);
ECreativeInventoryTabs tab = static_cast<ECreativeInventoryTabs>((int)eCreativeInventoryTab_BuildingBlocks + (int)eSection - (int)eSectionInventoryCreativeTab_0);
if(tab != m_curTab)
{
switchTab(tab);
@ -193,8 +193,8 @@ void UIScene_CreativeMenu::handleInput(int iPad, int key, bool repeat, bool pres
// Fall through intentional
case VK_PAD_RSHOULDER:
{
ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir);
if (tab < 0) tab = (ECreativeInventoryTabs)(eCreativeInventoryTab_COUNT - 1);
ECreativeInventoryTabs tab = static_cast<ECreativeInventoryTabs>(m_curTab + dir);
if (tab < 0) tab = static_cast<ECreativeInventoryTabs>(eCreativeInventoryTab_COUNT - 1);
if (tab >= eCreativeInventoryTab_COUNT) tab = eCreativeInventoryTab_BuildingBlocks;
switchTab(tab);
ui.PlayUISFX(eSFX_Focus);
@ -220,7 +220,7 @@ void UIScene_CreativeMenu::updateTabHighlightAndText(ECreativeInventoryTabs tab)
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (F64)tab;
value[0].number = static_cast<F64>(tab);
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ) , m_funcSetActiveTab , 1 , value );
@ -468,10 +468,10 @@ void UIScene_CreativeMenu::updateScrollCurrentPage(int currentPage, int pageCoun
IggyDataValue value[2];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (F64)pageCount;
value[0].number = static_cast<F64>(pageCount);
value[1].type = IGGY_DATATYPE_number;
value[1].number = (F64)currentPage - 1;
value[1].number = static_cast<F64>(currentPage) - 1;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ) , m_funcSetScrollBar , 2 , value );
}

View file

@ -597,7 +597,7 @@ void UIScene_Credits::tick()
{
if ( pDef->m_iStringID[0] == CREDIT_ICON )
{
addImage((ECreditIcons)pDef->m_iStringID[1]);
addImage(static_cast<ECreditIcons>(pDef->m_iStringID[1]));
}
else // using additional translated string.
{
@ -670,7 +670,7 @@ void UIScene_Credits::setNextLabel(const wstring &label, ECreditTextTypes size)
value[0].string16 = stringVal;
value[1].type = IGGY_DATATYPE_number;
value[1].number = (int)size;
value[1].number = static_cast<int>(size);
value[2].type = IGGY_DATATYPE_boolean;
value[2].boolval = (m_iCurrDefIndex == (m_iNumTextDefs - 1));
@ -684,7 +684,7 @@ void UIScene_Credits::addImage(ECreditIcons icon)
IggyDataValue value[2];
value[0].type = IGGY_DATATYPE_number;
value[0].number = (int)icon;
value[0].number = static_cast<int>(icon);
value[1].type = IGGY_DATATYPE_boolean;
value[1].boolval = (m_iCurrDefIndex == (m_iNumTextDefs - 1));

View file

@ -121,11 +121,11 @@ void UIScene_DLCMainMenu::handleInput(int iPad, int key, bool repeat, bool press
void UIScene_DLCMainMenu::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_OffersList:
{
int iIndex = (int)childId;
int iIndex = static_cast<int>(childId);
DLCOffersParam *param = new DLCOffersParam();
param->iPad = m_iPad;
@ -134,7 +134,7 @@ void UIScene_DLCMainMenu::handlePress(F64 controlId, F64 childId)
// Xbox One will have requested the marketplace content - there is only that type
#ifndef _XBOX_ONE
app.AddDLCRequest((eDLCMarketplaceType)iIndex, true);
app.AddDLCRequest(static_cast<eDLCMarketplaceType>(iIndex), true);
#endif
killTimer(PLAYER_ONLINE_TIMER_ID);
ui.NavigateToScene(m_iPad, eUIScene_DLCOffersMenu, param);
@ -166,7 +166,7 @@ void UIScene_DLCMainMenu::handleTimerComplete(int id)
int UIScene_DLCMainMenu::ExitDLCMainMenu(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_DLCMainMenu* pClass = (UIScene_DLCMainMenu*)pParam;
UIScene_DLCMainMenu* pClass = static_cast<UIScene_DLCMainMenu *>(pParam);
#if defined __ORBIS__ || defined __PSVITA__
app.GetCommerce()->HidePsStoreIcon();

View file

@ -16,7 +16,7 @@
UIScene_DLCOffersMenu::UIScene_DLCOffersMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
{
m_bProductInfoShown=false;
DLCOffersParam *param=(DLCOffersParam *)initData;
DLCOffersParam *param=static_cast<DLCOffersParam *>(initData);
m_iProductInfoIndex=param->iType;
m_iCurrentDLC=0;
m_iTotalDLC=0;
@ -103,7 +103,7 @@ void UIScene_DLCOffersMenu::handleTimerComplete(int id)
int UIScene_DLCOffersMenu::ExitDLCOffersMenu(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_DLCOffersMenu* pClass = (UIScene_DLCOffersMenu*)pParam;
UIScene_DLCOffersMenu* pClass = static_cast<UIScene_DLCOffersMenu *>(pParam);
#if defined __ORBIS__ || defined __PSVITA__
app.GetCommerce()->HidePsStoreIcon();
@ -217,7 +217,7 @@ void UIScene_DLCOffersMenu::handleInput(int iPad, int key, bool repeat, bool pre
void UIScene_DLCOffersMenu::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_OffersList:
{
@ -263,7 +263,7 @@ void UIScene_DLCOffersMenu::handlePress(F64 controlId, F64 childId)
int iIndex = (int)childId;
StorageManager.InstallOffer(1,StorageManager.GetOffer(iIndex).wszProductID,NULL,NULL);
#else
int iIndex = (int)childId;
int iIndex = static_cast<int>(childId);
ULONGLONG ullIndexA[1];
ullIndexA[0]=StorageManager.GetOffer(iIndex).qwOfferID;

View file

@ -20,7 +20,7 @@ UIScene_DeathMenu::UIScene_DeathMenu(int iPad, void *initData, UILayer *parentLa
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != NULL && pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[iPad]);
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(false);
@ -32,7 +32,7 @@ UIScene_DeathMenu::~UIScene_DeathMenu()
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != NULL && pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(true);
@ -81,7 +81,7 @@ void UIScene_DeathMenu::handleInput(int iPad, int key, bool repeat, bool pressed
void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_Respawn:
m_bIgnoreInput = true;
@ -106,7 +106,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId)
int playTime = -1;
if( pMinecraft->localplayers[m_iPad] != NULL )
{
playTime = (int)pMinecraft->localplayers[m_iPad]->getSessionTimer();
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
}
TelemetryManager->RecordLevelExit(m_iPad, eSen_LevelExitStatus_Failed);

View file

@ -67,7 +67,7 @@ void UIScene_DebugCreateSchematic::handleInput(int iPad, int key, bool repeat, b
void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_Create:
{
@ -112,7 +112,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId)
case eControl_EndX:
case eControl_EndY:
case eControl_EndZ:
m_keyboardCallbackControl = (eControls)((int)controlId);
m_keyboardCallbackControl = static_cast<eControls>((int)controlId);
InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
break;
};
@ -120,7 +120,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId)
void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId, bool selected)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_SaveMobs:
m_data->bSaveMobs = selected;
@ -136,7 +136,7 @@ void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId, bool sel
int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
UIScene_DebugCreateSchematic *pClass=(UIScene_DebugCreateSchematic *)lpParam;
UIScene_DebugCreateSchematic *pClass=static_cast<UIScene_DebugCreateSchematic *>(lpParam);
uint16_t pchText[128];
ZeroMemory(pchText, 128 * sizeof(uint16_t) );

View file

@ -23,11 +23,11 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa
Minecraft *pMinecraft = Minecraft::GetInstance();
WCHAR TempString[256];
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)pMinecraft->gameRenderer->GetFovVal());
m_sliderFov.init(TempString,eControl_FOV,0,100,(int)pMinecraft->gameRenderer->GetFovVal());
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", static_cast<int>(pMinecraft->gameRenderer->GetFovVal()));
m_sliderFov.init(TempString,eControl_FOV,0,100,static_cast<int>(pMinecraft->gameRenderer->GetFovVal()));
float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000;
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime);
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", static_cast<int>(currentTime));
m_sliderTime.init(TempString,eControl_Time,0,240,currentTime/100);
m_buttonRain.init(L"Toggle Rain",eControl_Rain);
@ -140,7 +140,7 @@ void UIScene_DebugOverlay::customDraw(IggyCustomDrawCallbackRegion *region)
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
int itemId = -1;
swscanf((wchar_t*)region->name,L"item_%d",&itemId);
swscanf(static_cast<wchar_t *>(region->name),L"item_%d",&itemId);
if (itemId == -1 || itemId > Item::ITEM_NUM_COUNT || Item::items[itemId] == NULL)
{
app.DebugPrintf("This is not the control we are looking for\n");
@ -181,7 +181,7 @@ void UIScene_DebugOverlay::handleInput(int iPad, int key, bool repeat, bool pres
void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_Items:
{
@ -252,7 +252,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue)
{
switch((int)sliderId)
switch(static_cast<int>(sliderId))
{
case eControl_Time:
{
@ -266,17 +266,17 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue)
WCHAR TempString[256];
float currentTime = currentValue * 100;
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime);
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", static_cast<int>(currentTime));
m_sliderTime.setLabel(TempString);
}
break;
case eControl_FOV:
{
Minecraft *pMinecraft = Minecraft::GetInstance();
pMinecraft->gameRenderer->SetFovVal((float)currentValue);
pMinecraft->gameRenderer->SetFovVal(static_cast<float>(currentValue));
WCHAR TempString[256];
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)currentValue);
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", static_cast<int>(currentValue));
m_sliderFov.setLabel(TempString);
}
break;

View file

@ -88,7 +88,7 @@ void UIScene_DebugSetCamera::handleInput(int iPad, int key, bool repeat, bool pr
void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_Teleport:
app.SetXuiServerAction( ProfileManager.GetPrimaryPad(),
@ -100,7 +100,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
case eControl_CamZ:
case eControl_YRot:
case eControl_Elevation:
m_keyboardCallbackControl = (eControls)((int)controlId);
m_keyboardCallbackControl = static_cast<eControls>((int)controlId);
InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugSetCamera::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
break;
};
@ -108,7 +108,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_LockPlayer:
app.SetFreezePlayers(selected);
@ -118,7 +118,7 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected)
int UIScene_DebugSetCamera::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
UIScene_DebugSetCamera *pClass=(UIScene_DebugSetCamera *)lpParam;
UIScene_DebugSetCamera *pClass=static_cast<UIScene_DebugSetCamera *>(lpParam);
uint16_t pchText[2048];//[128];
ZeroMemory(pchText, 2048/*128*/ * sizeof(uint16_t) );
InputManager.GetText(pchText);

View file

@ -10,14 +10,14 @@ UIScene_DispenserMenu::UIScene_DispenserMenu(int iPad, void *_initData, UILayer
// Setup all the Iggy references we need for this scene
initialiseMovie();
TrapScreenInput *initData = (TrapScreenInput *)_initData;
TrapScreenInput *initData = static_cast<TrapScreenInput *>(_initData);
m_labelDispenser.init(initData->trap->getName());
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Trap_Menu, this);
}

View file

@ -132,7 +132,7 @@ void UIScene_EULA::handleInput(int iPad, int key, bool repeat, bool pressed, boo
void UIScene_EULA::handlePress(F64 controlId, F64 childId)
{
switch((int)controlId)
switch(static_cast<int>(controlId))
{
case eControl_Confirm:
//CD - Added for audio

View file

@ -14,14 +14,14 @@ UIScene_EnchantingMenu::UIScene_EnchantingMenu(int iPad, void *_initData, UILaye
m_enchantButton[1].init(1);
m_enchantButton[2].init(2);
EnchantingScreenInput *initData = (EnchantingScreenInput *)_initData;
EnchantingScreenInput *initData = static_cast<EnchantingScreenInput *>(_initData);
m_labelEnchant.init( initData->name.empty() ? app.GetString(IDS_ENCHANT) : initData->name );
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Enchanting_Menu, this);
}
@ -264,7 +264,7 @@ void UIScene_EnchantingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
else
{
int slotId = -1;
swscanf((wchar_t*)region->name,L"slot_Button%d",&slotId);
swscanf(static_cast<wchar_t *>(region->name),L"slot_Button%d",&slotId);
if(slotId >= 0)
{
// Setup GDraw, normal game render states and matrices

View file

@ -191,7 +191,7 @@ void UIScene_EndPoem::handleDestroy()
void UIScene_EndPoem::handleRequestMoreData(F64 startIndex, bool up)
{
m_requestedLabel = (int)startIndex;
m_requestedLabel = static_cast<int>(startIndex);
}
void UIScene_EndPoem::updateNoise()
@ -221,13 +221,13 @@ void UIScene_EndPoem::updateNoise()
{
if (ui.UsingBitmapFont())
{
randomChar = SharedConstants::acceptableLetters[random->nextInt((int)SharedConstants::acceptableLetters.length())];
randomChar = SharedConstants::acceptableLetters[random->nextInt(static_cast<int>(SharedConstants::acceptableLetters.length()))];
}
else
{
// 4J-JEV: It'd be nice to avoid null characters when using asian languages.
static wstring acceptableLetters = L"!\"#$%&'()*+,-./0123456789:;<=>?@[\\]^_'|}~";
randomChar = acceptableLetters[ random->nextInt((int)acceptableLetters.length()) ];
randomChar = acceptableLetters[ random->nextInt(static_cast<int>(acceptableLetters.length())) ];
}
wstring randomCharStr = L"";

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