Revert "Project modernization (#630)"

This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.

This reverts commit a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -12,7 +12,7 @@ public:
virtual void StartReloadSkinThread() = 0;
virtual bool IsReloadingSkin() = 0;
virtual void CleanUpSkinReload() = 0;
virtual bool NavigateToScene(int iPad, EUIScene scene, void *initData = nullptr, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD) = 0;
virtual bool NavigateToScene(int iPad, EUIScene scene, void *initData = NULL, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD) = 0;
virtual bool NavigateBack(int iPad, bool forceUsePad = false, EUIScene eScene = eUIScene_COUNT, EUILayer eLayer = eUILayer_COUNT) = 0;
virtual void CloseUIScenes(int iPad, bool forceIPad = false) = 0;
virtual void CloseAllPlayersScenes() = 0;

View File

@@ -2,7 +2,6 @@
#include "IUIScene_AbstractContainerMenu.h"
#include "UI.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.crafting.h"
@@ -22,9 +21,9 @@ SavedInventoryCursorPos g_savedInventoryCursorPos = { 0.0f, 0.0f, false };
IUIScene_AbstractContainerMenu::IUIScene_AbstractContainerMenu()
{
m_menu = nullptr;
m_menu = NULL;
m_autoDeleteMenu = false;
m_lastPointerLabelSlot = nullptr;
m_lastPointerLabelSlot = NULL;
m_pointerPos.x = 0.0f;
m_pointerPos.y = 0.0f;
@@ -42,7 +41,7 @@ IUIScene_AbstractContainerMenu::~IUIScene_AbstractContainerMenu()
void IUIScene_AbstractContainerMenu::Initialize(int iPad, AbstractContainerMenu* menu, bool autoDeleteMenu, int startIndex,ESceneSection firstSection,ESceneSection maxSection, bool bNavigateBack)
{
assert( menu != nullptr );
assert( menu != NULL );
m_menu = menu;
m_autoDeleteMenu = autoDeleteMenu;
@@ -268,10 +267,10 @@ void IUIScene_AbstractContainerMenu::UpdateTooltips()
void IUIScene_AbstractContainerMenu::onMouseTick()
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[getPad()] != nullptr)
if( pMinecraft->localgameModes[getPad()] != NULL)
{
Tutorial *tutorial = pMinecraft->localgameModes[getPad()]->getTutorial();
if(tutorial != nullptr)
if(tutorial != NULL)
{
if(ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(ACTION_MENU_UP))
{
@@ -297,8 +296,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
int iPad = getPad();
bool bStickInput = false;
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
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
#ifdef __ORBIS__
// should have sensitivity for the touchpad
@@ -407,7 +406,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if ( m_iConsectiveInputTicks < MAX_INPUT_TICKS_FOR_SCALING )
{
++m_iConsectiveInputTicks;
fInputScale = ( static_cast<float>(m_iConsectiveInputTicks) / static_cast<float>((MAX_INPUT_TICKS_FOR_SCALING)) );
fInputScale = ( (float)( m_iConsectiveInputTicks) / (float)(MAX_INPUT_TICKS_FOR_SCALING) );
}
#ifdef TAP_DETECTION
else if ( m_iConsectiveInputTicks < MAX_INPUT_TICKS_FOR_TAPPING )
@@ -495,11 +494,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if (winW > 0 && winH > 0)
{
float scaleX = static_cast<float>(getMovieWidth()) / static_cast<float>(winW);
float scaleY = static_cast<float>(getMovieHeight()) / static_cast<float>(winH);
float scaleX = (float)getMovieWidth() / (float)winW;
float scaleY = (float)getMovieHeight() / (float)winH;
vPointerPos.x += static_cast<float>(deltaX) * scaleX;
vPointerPos.y += static_cast<float>(deltaY) * scaleY;
vPointerPos.x += (float)deltaX * scaleX;
vPointerPos.y += (float)deltaY * scaleY;
}
if (deltaX != 0 || deltaY != 0)
@@ -528,7 +527,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
}
else if ( eSectionUnderPointer == eSectionNone )
{
ESceneSection eSection = static_cast<ESceneSection>(iSection);
ESceneSection eSection = ( ESceneSection )( iSection );
// Get position of this section.
UIVec2D sectionPos;
@@ -759,17 +758,17 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
// What are we carrying on pointer.
shared_ptr<LocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
shared_ptr<ItemInstance> carriedItem = nullptr;
if(player != nullptr) carriedItem = player->inventory->getCarried();
if(player != NULL) carriedItem = player->inventory->getCarried();
shared_ptr<ItemInstance> slotItem = nullptr;
Slot *slot = nullptr;
Slot *slot = NULL;
int slotIndex = 0;
if(bPointerIsOverSlot)
{
slotIndex = iNewSlotIndex + getSectionStartOffset( eSectionUnderPointer );
slot = m_menu->getSlot(slotIndex);
}
bool bIsItemCarried = carriedItem != nullptr;
bool bIsItemCarried = carriedItem != NULL;
int iCarriedCount = 0;
bool bCarriedIsSameAsSlot = false; // Indicates if same item is carried on pointer as is in slot under pointer.
if ( bIsItemCarried )
@@ -789,7 +788,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
if ( bPointerIsOverSlot )
{
slotItem = slot->getItem();
bSlotHasItem = slotItem != nullptr;
bSlotHasItem = slotItem != NULL;
if ( bSlotHasItem )
{
iSlotCount = slotItem->GetCount();
@@ -830,13 +829,13 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
{
vector<HtmlString> *desc = GetSectionHoverText(eSectionUnderPointer);
SetPointerText(desc, false);
m_lastPointerLabelSlot = nullptr;
m_lastPointerLabelSlot = NULL;
delete desc;
}
else
{
SetPointerText(nullptr, false);
m_lastPointerLabelSlot = nullptr;
SetPointerText(NULL, false);
m_lastPointerLabelSlot = NULL;
}
EToolTipItem buttonA, buttonX, buttonY, buttonRT, buttonBack;
@@ -1022,7 +1021,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
// Get the info on this item.
shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
bool bValidFuel = FurnaceTileEntity::isFuel(item);
bool bValidIngredient = FurnaceRecipes::getInstance()->getResult(item->getItem()->id) != nullptr;
bool bValidIngredient = FurnaceRecipes::getInstance()->getResult(item->getItem()->id) != NULL;
if(bValidIngredient)
{
@@ -1037,7 +1036,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
}
else
{
if(FurnaceRecipes::getInstance()->getResult(item->id)==nullptr)
if(FurnaceRecipes::getInstance()->getResult(item->id)==NULL)
{
buttonY = eToolTipQuickMove;
}
@@ -1077,7 +1076,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
}
else
{
if(FurnaceRecipes::getInstance()->getResult(item->id)==nullptr)
if(FurnaceRecipes::getInstance()->getResult(item->id)==NULL)
{
buttonY = eToolTipQuickMove;
}
@@ -1310,9 +1309,9 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
}
vPointerPos.x = floor(vPointerPos.x);
vPointerPos.x += ( static_cast<int>(vPointerPos.x)%2);
vPointerPos.x += ( (int)vPointerPos.x%2);
vPointerPos.y = floor(vPointerPos.y);
vPointerPos.y += ( static_cast<int>(vPointerPos.y)%2);
vPointerPos.y += ( (int)vPointerPos.y%2);
m_pointerPos = vPointerPos;
adjustPointerForSafeZone();
@@ -1323,10 +1322,10 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
bool bHandled = false;
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[getPad()] != nullptr )
if( pMinecraft->localgameModes[getPad()] != NULL )
{
Tutorial *tutorial = pMinecraft->localgameModes[getPad()]->getTutorial();
if(tutorial != nullptr)
if(tutorial != NULL)
{
tutorial->handleUIInput(iAction);
if(ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(iAction))
@@ -1528,20 +1527,20 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
if ( bSlotHasItem )
{
shared_ptr<ItemInstance> item = getSlotItem(m_eCurrSection, currentIndex);
if( Minecraft::GetInstance()->localgameModes[iPad] != nullptr )
if( Minecraft::GetInstance()->localgameModes[iPad] != NULL )
{
Tutorial::PopupMessageDetails *message = new Tutorial::PopupMessageDetails;
message->m_messageId = item->getUseDescriptionId();
if(Item::items[item->id] != nullptr) message->m_titleString = Item::items[item->id]->getHoverName(item);
if(Item::items[item->id] != NULL) message->m_titleString = Item::items[item->id]->getHoverName(item);
message->m_titleId = item->getDescriptionId();
message->m_icon = item->id;
message->m_iAuxVal = item->getAuxValue();
message->m_forceDisplay = true;
TutorialMode *gameMode = static_cast<TutorialMode *>(Minecraft::GetInstance()->localgameModes[iPad]);
gameMode->getTutorial()->setMessage(nullptr, message);
TutorialMode *gameMode = (TutorialMode *)Minecraft::GetInstance()->localgameModes[iPad];
gameMode->getTutorial()->setMessage(NULL, message);
ui.PlayUISFX(eSFX_Press);
}
}
@@ -1643,7 +1642,7 @@ void IUIScene_AbstractContainerMenu::handleSlotListClicked(ESceneSection eSectio
void IUIScene_AbstractContainerMenu::slotClicked(int slotId, int buttonNum, bool quickKey)
{
// 4J Stu - Removed this line as unused
//if (slot != nullptr) slotId = slot->index;
//if (slot != NULL) slotId = slot->index;
Minecraft *pMinecraft = Minecraft::GetInstance();
pMinecraft->localgameModes[getPad()]->handleInventoryMouseClick(m_menu->containerId, slotId, buttonNum, quickKey, pMinecraft->localplayers[getPad()] );
@@ -1660,7 +1659,7 @@ int IUIScene_AbstractContainerMenu::getCurrentIndex(ESceneSection eSection)
bool IUIScene_AbstractContainerMenu::IsSameItemAs(shared_ptr<ItemInstance> itemA, shared_ptr<ItemInstance> itemB)
{
if(itemA == nullptr || itemB == nullptr) return false;
if(itemA == NULL || itemB == NULL) return false;
return (itemA->id == itemB->id && (!itemB->isStackedByData() || itemB->getAuxValue() == itemA->getAuxValue()) && ItemInstance::tagMatches(itemB, itemA) );
}
@@ -1669,7 +1668,7 @@ int IUIScene_AbstractContainerMenu::GetEmptyStackSpace(Slot *slot)
{
int iResult = 0;
if(slot != nullptr && slot->hasItem())
if(slot != NULL && slot->hasItem())
{
shared_ptr<ItemInstance> item = slot->getItem();
if ( item->isStackable() )
@@ -1688,7 +1687,7 @@ int IUIScene_AbstractContainerMenu::GetEmptyStackSpace(Slot *slot)
vector<HtmlString> *IUIScene_AbstractContainerMenu::GetItemDescription(Slot *slot)
{
if(slot == nullptr) return nullptr;
if(slot == NULL) return NULL;
vector<HtmlString> *lines = slot->getItem()->getHoverText(nullptr, false);
@@ -1708,5 +1707,5 @@ vector<HtmlString> *IUIScene_AbstractContainerMenu::GetItemDescription(Slot *slo
vector<HtmlString> *IUIScene_AbstractContainerMenu::GetSectionHoverText(ESceneSection eSection)
{
return nullptr;
return NULL;
}

View File

@@ -10,7 +10,7 @@
IUIScene_AnvilMenu::IUIScene_AnvilMenu()
{
m_inventory = nullptr;
m_repairMenu = nullptr;
m_repairMenu = NULL;
m_itemName = L"";
}
@@ -231,7 +231,7 @@ void IUIScene_AnvilMenu::handleTick()
void IUIScene_AnvilMenu::updateItemName()
{
Slot *slot = m_repairMenu->getSlot(AnvilMenu::INPUT_SLOT);
if (slot != nullptr && slot->hasItem())
if (slot != NULL && slot->hasItem())
{
if (!slot->getItem()->hasCustomHoverName() && m_itemName.compare(slot->getItem()->getHoverName())==0)
{
@@ -245,7 +245,7 @@ void IUIScene_AnvilMenu::updateItemName()
ByteArrayOutputStream baos;
DataOutputStream dos(&baos);
dos.writeUTF(m_itemName);
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(std::make_shared<CustomPayloadPacket>(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray()));
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray())));
}
void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector<shared_ptr<ItemInstance> > *items)
@@ -257,10 +257,10 @@ void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotI
{
if (slotIndex == AnvilMenu::INPUT_SLOT)
{
m_itemName = item == nullptr ? L"" : item->getHoverName();
m_itemName = item == NULL ? L"" : item->getHoverName();
setEditNameValue(m_itemName);
setEditNameEditable(item != nullptr);
if (item != nullptr)
setEditNameEditable(item != NULL);
if (item != NULL)
{
updateItemName();
}

View File

@@ -216,13 +216,13 @@ void IUIScene_BeaconMenu::handleOtherClicked(int iPad, ESceneSection eSection, i
{
case eSectionBeaconConfirm:
{
if( (m_beacon->getItem(0) == nullptr) || (m_beacon->getPrimaryPower() <= 0) ) return;
if( (m_beacon->getItem(0) == NULL) || (m_beacon->getPrimaryPower() <= 0) ) return;
ByteArrayOutputStream baos;
DataOutputStream dos(&baos);
dos.writeInt(m_beacon->getPrimaryPower());
dos.writeInt(m_beacon->getSecondaryPower());
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(std::make_shared<CustomPayloadPacket>(CustomPayloadPacket::SET_BEACON_PACKET, baos.toByteArray()));
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_BEACON_PACKET, baos.toByteArray())));
if (m_beacon->getPrimaryPower() > 0)
{
@@ -286,7 +286,7 @@ void IUIScene_BeaconMenu::handleTick()
for (int c = 0; c < count; c++)
{
if(BeaconTileEntity::BEACON_EFFECTS[tier][c] == nullptr) continue;
if(BeaconTileEntity::BEACON_EFFECTS[tier][c] == NULL) continue;
int effectId = BeaconTileEntity::BEACON_EFFECTS[tier][c]->id;
int icon = BeaconTileEntity::BEACON_EFFECTS[tier][c]->getIcon();
@@ -315,7 +315,7 @@ void IUIScene_BeaconMenu::handleTick()
for (int c = 0; c < count - 1; c++)
{
if(BeaconTileEntity::BEACON_EFFECTS[tier][c] == nullptr) continue;
if(BeaconTileEntity::BEACON_EFFECTS[tier][c] == NULL) continue;
int effectId = BeaconTileEntity::BEACON_EFFECTS[tier][c]->id;
int icon = BeaconTileEntity::BEACON_EFFECTS[tier][c]->getIcon();
@@ -355,7 +355,7 @@ void IUIScene_BeaconMenu::handleTick()
}
}
SetConfirmButtonEnabled( (m_beacon->getItem(0) != nullptr) && (m_beacon->getPrimaryPower() > 0) );
SetConfirmButtonEnabled( (m_beacon->getItem(0) != NULL) && (m_beacon->getPrimaryPower() > 0) );
}
int IUIScene_BeaconMenu::GetId(int tier, int effectId)
@@ -365,7 +365,7 @@ int IUIScene_BeaconMenu::GetId(int tier, int effectId)
vector<HtmlString> *IUIScene_BeaconMenu::GetSectionHoverText(ESceneSection eSection)
{
vector<HtmlString> *desc = nullptr;
vector<HtmlString> *desc = NULL;
switch(eSection)
{
case eSectionBeaconSecondaryTwo:

View File

@@ -20,6 +20,6 @@ void IUIScene_CommandBlockMenu::ConfirmButtonClicked()
dos.writeInt(m_commandBlock->z);
dos.writeUTF(GetCommand());
Minecraft::GetInstance()->localplayers[GetPad()]->connection->send(std::make_shared<CustomPayloadPacket>(CustomPayloadPacket::SET_ADVENTURE_COMMAND_PACKET, baos.toByteArray()));
Minecraft::GetInstance()->localplayers[GetPad()]->connection->send(shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_ADVENTURE_COMMAND_PACKET, baos.toByteArray())));
}

View File

@@ -6,8 +6,6 @@
#include "..\..\LocalPlayer.h"
#include "IUIScene_CraftingMenu.h"
#include "UI.h"
Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA[IUIScene_CraftingMenu::m_iMaxGroup2x2]=
{
Recipy::eGroupType_Structure,
@@ -156,10 +154,10 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[getPad()] != nullptr )
if( pMinecraft->localgameModes[getPad()] != NULL )
{
Tutorial *tutorial = pMinecraft->localgameModes[getPad()]->getTutorial();
if(tutorial != nullptr)
if(tutorial != NULL)
{
tutorial->handleUIInput(iAction);
if(ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(iAction))
@@ -213,10 +211,10 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
if( pMinecraft->localgameModes[iPad] != nullptr)
if( pMinecraft->localgameModes[iPad] != NULL)
{
Tutorial *tutorial = pMinecraft->localgameModes[iPad]->getTutorial();
if(tutorial != nullptr)
if(tutorial != NULL)
{
tutorial->onCrafted(pTempItemInst);
}
@@ -249,10 +247,10 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
if( pMinecraft->localgameModes[iPad] != nullptr )
if( pMinecraft->localgameModes[iPad] != NULL )
{
Tutorial *tutorial = pMinecraft->localgameModes[iPad]->getTutorial();
if(tutorial != nullptr)
if(tutorial != NULL)
{
tutorial->createItemSelected(pTempItemInst, pRecipeIngredientsRequired[iRecipe].bCanMake[iPad]);
}
@@ -290,12 +288,12 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
}
// 4J Stu - Fix for #13097 - Bug: Milk Buckets are removed when crafting Cake
if (ingItemInst != nullptr)
if (ingItemInst != NULL)
{
if (ingItemInst->getItem()->hasCraftingRemainingItem())
{
// replace item with remaining result
m_pPlayer->inventory->add(std::make_shared<ItemInstance>(ingItemInst->getItem()->getCraftingRemainingItem()));
m_pPlayer->inventory->add( shared_ptr<ItemInstance>( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) );
}
}
@@ -610,7 +608,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
// dump out the inventory
/* for (unsigned int k = 0; k < m_pPlayer->inventory->items.length; k++)
{
if (m_pPlayer->inventory->items[k] != nullptr)
if (m_pPlayer->inventory->items[k] != NULL)
{
wstring itemstring=m_pPlayer->inventory->items[k]->toString();
@@ -622,15 +620,15 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
*/
RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies();
Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray();
int iRecipeC=static_cast<int>(recipes->size());
int iRecipeC=(int)recipes->size();
auto itRecipe = recipes->begin();
// dump out the recipe products
// for (int i = 0; i < iRecipeC; i++)
// {
// shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr);
// if (pTempItemInst != nullptr)
// shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL);
// if (pTempItemInst != NULL)
// {
// wstring itemstring=pTempItemInst->toString();
//
@@ -685,7 +683,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
// Does the player have this ingredient?
for (unsigned int k = 0; k < m_pPlayer->inventory->items.length; k++)
{
if (m_pPlayer->inventory->items[k] != nullptr)
if (m_pPlayer->inventory->items[k] != NULL)
{
// do they have the ingredient, and the aux value matches, and enough off it?
if((m_pPlayer->inventory->items[k]->id == pRecipeIngredientsRequired[i].iIngIDA[j]) &&
@@ -705,7 +703,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
for(unsigned int l=0;l<m_pPlayer->inventory->items.length;l++)
{
if (m_pPlayer->inventory->items[l] != nullptr)
if (m_pPlayer->inventory->items[l] != NULL)
{
if(
(m_pPlayer->inventory->items[l]->id == pRecipeIngredientsRequired[i].iIngIDA[j]) &&
@@ -1073,7 +1071,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
int iAuxVal=pRecipeIngredientsRequired[iRecipe].iIngAuxValA[i];
Item *item = Item::items[id];
shared_ptr<ItemInstance> itemInst= std::make_shared<ItemInstance>(item, pRecipeIngredientsRequired[iRecipe].iIngValA[i], iAuxVal);
shared_ptr<ItemInstance> itemInst= shared_ptr<ItemInstance>(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal));
// 4J-PB - a very special case - the bed can use any kind of wool, so we can't use the item description
// and the same goes for the painting
@@ -1158,7 +1156,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
{
iAuxVal = 1;
}
shared_ptr<ItemInstance> itemInst= std::make_shared<ItemInstance>(id, 1, iAuxVal);
shared_ptr<ItemInstance> itemInst= shared_ptr<ItemInstance>(new ItemInstance(id,1,iAuxVal));
setIngredientSlotItem(getPad(),index,itemInst);
// show the ingredients we don't have if we can't make the recipe
if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_CraftAnything))

View File

@@ -1,7 +1,6 @@
#include "stdafx.h"
#include "IUIScene_CreativeMenu.h"
#include "UI.h"
#include "..\..\Minecraft.h"
#include "..\..\MultiplayerLocalPlayer.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
@@ -14,7 +13,7 @@
#include "..\..\..\Minecraft.World\JavaMath.h"
// 4J JEV - Images for each tab.
IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = nullptr;
IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL;
vector< shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount];
@@ -22,6 +21,7 @@ vector< shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreati
#define ITEM_AUX(id, aux) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, aux)) );
#define DEF(index) list = &categoryGroups[index];
void IUIScene_CreativeMenu::staticCtor()
{
vector< shared_ptr<ItemInstance> > *list;
@@ -488,14 +488,14 @@ void IUIScene_CreativeMenu::staticCtor()
for(unsigned int i = 0; i < Enchantment::enchantments.length; ++i)
{
Enchantment *enchantment = Enchantment::enchantments[i];
if (enchantment == nullptr || enchantment->category == nullptr) continue;
if (enchantment == NULL || enchantment->category == NULL) continue;
list->push_back(Item::enchantedBook->createForEnchantment(new EnchantmentInstance(enchantment, enchantment->getMaxLevel())));
}
#ifndef _CONTENT_PACKAGE
if(app.DebugSettingsOn())
{
shared_ptr<ItemInstance> debugSword = std::make_shared<ItemInstance>(Item::sword_diamond_Id, 1, 0);
shared_ptr<ItemInstance> debugSword = shared_ptr<ItemInstance>(new ItemInstance(Item::sword_diamond_Id, 1, 0));
debugSword->enchant( Enchantment::damageBonus, 50 );
debugSword->setHoverName(L"Sword of Debug");
list->push_back(debugSword);
@@ -673,7 +673,7 @@ void IUIScene_CreativeMenu::staticCtor()
#ifndef _CONTENT_PACKAGE
ECreative_Inventory_Groups decorationsGroup[] = {eCreativeInventory_Decoration};
ECreative_Inventory_Groups debugDecorationsGroup[] = {eCreativeInventory_ArtToolsDecorations};
specs[eCreativeInventoryTab_Decorations] = new TabSpec(L"Decoration", IDS_GROUPNAME_DECORATIONS, 1, decorationsGroup, 0, nullptr, 1, debugDecorationsGroup);
specs[eCreativeInventoryTab_Decorations] = new TabSpec(L"Decoration", IDS_GROUPNAME_DECORATIONS, 1, decorationsGroup, 0, NULL, 1, debugDecorationsGroup);
#else
ECreative_Inventory_Groups decorationsGroup[] = {eCreativeInventory_Decoration};
specs[eCreativeInventoryTab_Decorations] = new TabSpec(L"Decoration", IDS_GROUPNAME_DECORATIONS, 1, decorationsGroup);
@@ -707,7 +707,7 @@ void IUIScene_CreativeMenu::staticCtor()
#ifndef _CONTENT_PACKAGE
ECreative_Inventory_Groups miscGroup[] = {eCreativeInventory_Misc};
ECreative_Inventory_Groups debugMiscGroup[] = {eCreativeInventory_ArtToolsMisc};
specs[eCreativeInventoryTab_Misc] = new TabSpec(L"Misc", IDS_GROUPNAME_MISCELLANEOUS, 1, miscGroup, 0, nullptr, 1, debugMiscGroup);
specs[eCreativeInventoryTab_Misc] = new TabSpec(L"Misc", IDS_GROUPNAME_MISCELLANEOUS, 1, miscGroup, 0, NULL, 1, debugMiscGroup);
#else
ECreative_Inventory_Groups miscGroup[] = {eCreativeInventory_Misc};
specs[eCreativeInventoryTab_Misc] = new TabSpec(L"Misc", IDS_GROUPNAME_MISCELLANEOUS, 1, miscGroup);
@@ -766,12 +766,12 @@ void IUIScene_CreativeMenu::ScrollBar(UIVec2D pointerPos)
// 4J JEV - Tab Spec Struct
IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups, int debugGroupsCount /*= 0*/, ECreative_Inventory_Groups *debugGroups /*= nullptr*/)
IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups, int debugGroupsCount /*= 0*/, ECreative_Inventory_Groups *debugGroups /*= NULL*/)
: m_icon(icon), m_descriptionId(descriptionId), m_staticGroupsCount(staticGroupsCount), m_dynamicGroupsCount(dynamicGroupsCount), m_debugGroupsCount(debugGroupsCount)
{
m_pages = 0;
m_staticGroupsA = nullptr;
m_staticGroupsA = NULL;
unsigned int dynamicItems = 0;
m_staticItems = 0;
@@ -786,7 +786,7 @@ IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int sta
}
}
m_debugGroupsA = nullptr;
m_debugGroupsA = NULL;
m_debugItems = 0;
if(debugGroupsCount > 0)
{
@@ -798,8 +798,8 @@ IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int sta
}
}
m_dynamicGroupsA = nullptr;
if(dynamicGroupsCount > 0 && dynamicGroups != nullptr)
m_dynamicGroupsA = NULL;
if(dynamicGroupsCount > 0 && dynamicGroups != NULL)
{
m_dynamicGroupsA = new ECreative_Inventory_Groups[dynamicGroupsCount];
for(int i = 0; i < dynamicGroupsCount; ++i)
@@ -816,9 +816,9 @@ IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int sta
IUIScene_CreativeMenu::TabSpec::~TabSpec()
{
if(m_staticGroupsA != nullptr) delete [] m_staticGroupsA;
if(m_dynamicGroupsA != nullptr) delete [] m_dynamicGroupsA;
if(m_debugGroupsA != nullptr) delete [] m_debugGroupsA;
if(m_staticGroupsA != NULL) delete [] m_staticGroupsA;
if(m_dynamicGroupsA != NULL) delete [] m_dynamicGroupsA;
if(m_debugGroupsA != NULL) delete [] m_debugGroupsA;
}
void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu *menu, int dynamicIndex, unsigned int page)
@@ -826,7 +826,7 @@ void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu *menu, i
int lastSlotIndex = 0;
// Fill the dynamic group
if(m_dynamicGroupsCount > 0 && m_dynamicGroupsA != nullptr)
if(m_dynamicGroupsCount > 0 && m_dynamicGroupsA != NULL)
{
for (auto it = categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin(); it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() && lastSlotIndex < MAX_SIZE; ++it)
{
@@ -957,7 +957,7 @@ IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( shared_ptr<SimpleContaine
//int startLength = slots->size();
Slot *slot = nullptr;
Slot *slot = NULL;
for (int i = 0; i < TabSpec::MAX_SIZE; i++)
{
// 4J JEV - These values get set by addSlot anyway.
@@ -1036,11 +1036,11 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu
{
shared_ptr<ItemInstance> newItem = m_menu->getSlot(i)->getItem();
if(newItem != nullptr)
if(newItem != NULL)
{
m_menu->getSlot(i)->set(nullptr);
// call this function to synchronize multiplayer item bar
pMinecraft->localgameModes[iPad]->handleCreativeModeItemAdd(nullptr, i - static_cast<int>(m_menu->slots.size()) + 9 + InventoryMenu::USE_ROW_SLOT_START);
pMinecraft->localgameModes[iPad]->handleCreativeModeItemAdd(nullptr, i - (int)m_menu->slots.size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
}
}
return true;
@@ -1054,7 +1054,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[iPad]->inventory;
if (playerInventory->getCarried() != nullptr)
if (playerInventory->getCarried() != NULL)
{
if (buttonNum == 0)
{
@@ -1082,8 +1082,8 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction)
// Fall through intentional
case ACTION_MENU_RIGHT_SCROLL:
{
ECreativeInventoryTabs tab = static_cast<ECreativeInventoryTabs>(m_curTab + dir);
if (tab < 0) tab = static_cast<ECreativeInventoryTabs>(eCreativeInventoryTab_COUNT - 1);
ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir);
if (tab < 0) tab = (ECreativeInventoryTabs)(eCreativeInventoryTab_COUNT - 1);
if (tab >= eCreativeInventoryTab_COUNT) tab = eCreativeInventoryTab_BuildingBlocks;
switchTab(tab);
ui.PlayUISFX(eSFX_Focus);
@@ -1143,7 +1143,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
shared_ptr<ItemInstance> carried = playerInventory->getCarried();
shared_ptr<ItemInstance> clicked = m_menu->getSlot(currentIndex)->getItem();
if (clicked != nullptr)
if (clicked != NULL)
{
playerInventory->setCarried(ItemInstance::clone(clicked));
carried = playerInventory->getCarried();
@@ -1176,7 +1176,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 - static_cast<int>(m_menu->slots.size()) + 9 + InventoryMenu::USE_ROW_SLOT_START);
pMinecraft->localgameModes[getPad()]->handleCreativeModeItemAdd(newItem, currentIndex - (int)m_menu->slots.size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
if(m_bCarryingCreativeItem)
{
@@ -1224,7 +1224,7 @@ bool IUIScene_CreativeMenu::getEmptyInventorySlot(shared_ptr<ItemInstance> item,
for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
{
shared_ptr<ItemInstance> slotItem = m_menu->getSlot(i)->getItem();
if( slotItem != nullptr && slotItem->sameItemWithTags(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() ))
if( slotItem != NULL && slotItem->sameItemWithTags(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() ))
{
sameItemFound = true;
slotX = i - TabSpec::MAX_SIZE;
@@ -1237,7 +1237,7 @@ bool IUIScene_CreativeMenu::getEmptyInventorySlot(shared_ptr<ItemInstance> item,
// Find an empty slot
for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
{
if( m_menu->getSlot(i)->getItem() == nullptr )
if( m_menu->getSlot(i)->getItem() == NULL )
{
slotX = i - TabSpec::MAX_SIZE;
emptySlotFound = true;
@@ -1316,7 +1316,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *lis
// diamonds give trails
if (trail) expTag->putBoolean(FireworksItem::TAG_E_TRAIL, true);
intArray colorArray(static_cast<unsigned int>(colors.size()));
intArray colorArray(colors.size());
for (int i = 0; i < colorArray.length; i++)
{
colorArray[i] = colors.at(i);
@@ -1335,7 +1335,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *lis
vector<int> colors;
colors.push_back(DyePowderItem::COLOR_RGB[fadeColor]);
intArray colorArray(static_cast<unsigned int>(colors.size()));
intArray colorArray(colors.size());
for (int i = 0; i < colorArray.length; i++)
{
colorArray[i] = colors.at(i);
@@ -1350,7 +1350,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *lis
shared_ptr<ItemInstance> firework;
{
firework = std::make_shared<ItemInstance>(Item::fireworks);
firework = shared_ptr<ItemInstance>( new ItemInstance(Item::fireworks) );
CompoundTag *itemTag = new CompoundTag();
CompoundTag *fireTag = new CompoundTag(FireworksItem::TAG_FIREWORKS);
ListTag<CompoundTag> *expTags = new ListTag<CompoundTag>(FireworksItem::TAG_EXPLOSIONS);
@@ -1358,7 +1358,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *lis
expTags->add(expTag);
fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags);
fireTag->putByte(FireworksItem::TAG_FLIGHT, static_cast<byte>(sulphur));
fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphur);
itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag);

View File

@@ -69,7 +69,7 @@ public:
unsigned int m_debugItems;
public:
TabSpec( LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount = 0, ECreative_Inventory_Groups *dynamicGroups = nullptr, int debugGroupsCount = 0, ECreative_Inventory_Groups *debugGroups = nullptr );
TabSpec( LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount = 0, ECreative_Inventory_Groups *dynamicGroups = NULL, int debugGroupsCount = 0, ECreative_Inventory_Groups *debugGroups = NULL );
~TabSpec();
void populateMenu(AbstractContainerMenu *menu, int dynamicIndex, unsigned int page);

View File

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

View File

@@ -7,8 +7,6 @@
#include "..\..\..\Minecraft.World\net.minecraft.world.entity.monster.h"
#include "IUIScene_HUD.h"
#include "UI.h"
IUIScene_HUD::IUIScene_HUD()
{
m_lastActiveSlot = -1;
@@ -81,7 +79,7 @@ void IUIScene_HUD::updateFrameTick()
{
//SetRidingHorse(false, 0);
shared_ptr<Entity> riding = pMinecraft->localplayers[iPad]->riding;
if(riding == nullptr)
if(riding == NULL)
{
SetRidingHorse(false, false, 0);
}
@@ -148,8 +146,8 @@ void IUIScene_HUD::updateFrameTick()
{
if(uiOpacityTimer<10)
{
float fStep=(80.0f-static_cast<float>(ucAlpha))/10.0f;
fVal=0.01f*(80.0f-((10.0f-static_cast<float>(uiOpacityTimer))*fStep));
float fStep=(80.0f-(float)ucAlpha)/10.0f;
fVal=0.01f*(80.0f-((10.0f-(float)uiOpacityTimer)*fStep));
}
else
{
@@ -158,7 +156,7 @@ void IUIScene_HUD::updateFrameTick()
}
else
{
fVal=0.01f*static_cast<float>(ucAlpha);
fVal=0.01f*(float)ucAlpha;
}
}
else
@@ -168,12 +166,12 @@ void IUIScene_HUD::updateFrameTick()
{
ucAlpha=15;
}
fVal=0.01f*static_cast<float>(ucAlpha);
fVal=0.01f*(float)ucAlpha;
}
SetOpacity(fVal);
bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(iPad) && !(app.GetXuiAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(iPad,eGameSetting_DisplayHUD)!=0;
if(bDisplayGui && pMinecraft->localplayers[iPad] != nullptr)
if(bDisplayGui && pMinecraft->localplayers[iPad] != NULL)
{
SetVisible(true);
}
@@ -200,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 = static_cast<float>(maxHealthAttribute->getValue());
float maxHealth = (float)maxHealthAttribute->getValue();
float totalAbsorption = pMinecraft->localplayers[iPad]->getAbsorptionAmount();
// Update armour
@@ -221,7 +219,7 @@ void IUIScene_HUD::renderPlayerHealth()
shared_ptr<Entity> riding = pMinecraft->localplayers[iPad]->riding;
if(riding == nullptr || riding && !riding->instanceof(eTYPE_LIVINGENTITY))
if(riding == NULL || riding && !riding->instanceof(eTYPE_LIVINGENTITY))
{
SetRidingHorse(false, false, 0);
@@ -244,8 +242,8 @@ void IUIScene_HUD::renderPlayerHealth()
if (pMinecraft->localplayers[iPad]->isUnderLiquid(Material::water))
{
ShowAir(true);
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;
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;
SetAir(count, extra);
}
else
@@ -256,7 +254,7 @@ void IUIScene_HUD::renderPlayerHealth()
else if(riding->instanceof(eTYPE_LIVINGENTITY) )
{
shared_ptr<LivingEntity> living = dynamic_pointer_cast<LivingEntity>(riding);
int riderCurrentHealth = static_cast<int>(ceil(living->getHealth()));
int riderCurrentHealth = (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=static_cast<DLCTexturePack *>(tPack);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))
@@ -229,7 +229,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4
{
// 4J-PB - need to check this user can access the store
bool bContentRestricted;
ProfileManager.GetChatAndContentRestrictions(iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL);
if(bContentRestricted)
{
UINT uiIDA[1];
@@ -248,7 +248,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4
app.DebugPrintf("Texture Pack - %s\n",pchPackName);
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName);
if(pSONYDLCInfo!=nullptr)
if(pSONYDLCInfo!=NULL)
{
char chName[42];
char chSkuID[SCE_NP_COMMERCE2_SKU_ID_LEN];
@@ -300,7 +300,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4
DLC_INFO *pDLCInfo=app.GetDLCInfoForProductName((WCHAR *)pDLCPack->getName().c_str());
StorageManager.InstallOffer(1,(WCHAR *)pDLCInfo->wsProductId.c_str(),nullptr,nullptr);
StorageManager.InstallOffer(1,(WCHAR *)pDLCInfo->wsProductId.c_str(),NULL,NULL);
// the license change coming in when the offer has been installed will cause this scene to refresh
}
@@ -336,7 +336,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4
// need to allow downloads here, or the player would need to quit the game to let the download of a texture pack happen. This might affect the network traffic, since the download could take all the bandwidth...
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
StorageManager.InstallOffer(1,ullIndexA,nullptr,nullptr);
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
}
}
else
@@ -352,7 +352,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4
int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter )
{
bool bAutosave=static_cast<bool>(lpParameter);
bool bAutosave=(bool)lpParameter;
if(bAutosave)
{
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame);
@@ -421,7 +421,7 @@ void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter)
bool saveStats = true;
if (pMinecraft->isClientSide() || g_NetworkManager.IsInSession())
{
if(lpParameter != nullptr )
if(lpParameter != NULL )
{
// 4J-PB - check if we have lost connection to Live
if(ProfileManager.GetLiveConnectionStatus()!=XONLINE_S_LOGON_CONNECTION_ESTABLISHED )
@@ -522,17 +522,17 @@ void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter)
exitReasonStringId = -1;
// 4J - Force a disconnection, this handles the situation that the server has already disconnected
if( pMinecraft->levels[0] != nullptr ) pMinecraft->levels[0]->disconnect(false);
if( pMinecraft->levels[1] != nullptr ) pMinecraft->levels[1]->disconnect(false);
if( pMinecraft->levels[2] != nullptr ) pMinecraft->levels[2]->disconnect(false);
if( pMinecraft->levels[0] != NULL ) pMinecraft->levels[0]->disconnect(false);
if( pMinecraft->levels[1] != NULL ) pMinecraft->levels[1]->disconnect(false);
if( pMinecraft->levels[2] != NULL ) pMinecraft->levels[2]->disconnect(false);
}
else
{
exitReasonStringId = IDS_EXITING_GAME;
pMinecraft->progressRenderer->progressStartNoAbort( IDS_EXITING_GAME );
if( pMinecraft->levels[0] != nullptr ) pMinecraft->levels[0]->disconnect();
if( pMinecraft->levels[1] != nullptr ) pMinecraft->levels[1]->disconnect();
if( pMinecraft->levels[2] != nullptr ) pMinecraft->levels[2]->disconnect();
if( pMinecraft->levels[0] != NULL ) pMinecraft->levels[0]->disconnect();
if( pMinecraft->levels[1] != NULL ) pMinecraft->levels[1]->disconnect();
if( pMinecraft->levels[2] != NULL ) pMinecraft->levels[2]->disconnect();
}
// 4J Stu - This only does something if we actually have a server, so don't need to do any other checks
@@ -548,7 +548,7 @@ void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter)
}
else
{
if(lpParameter != nullptr && ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()) )
if(lpParameter != NULL && ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()) )
{
switch( app.GetDisconnectReason() )
{
@@ -625,7 +625,7 @@ void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter)
{
Sleep(1);
}
pMinecraft->setLevel(nullptr,exitReasonStringId,nullptr,saveStats);
pMinecraft->setLevel(NULL,exitReasonStringId,nullptr,saveStats);
TelemetryManager->Flush();

View File

@@ -45,7 +45,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
// 4J-PB - there may be texture packs we don't have, so use the info from TMS for this
// REMOVE UNTIL WORKING
DLC_INFO *pDLCInfo=nullptr;
DLC_INFO *pDLCInfo=NULL;
// first pass - look to see if there are any that are not in the list
bool bTexturePackAlreadyListed;
@@ -86,7 +86,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
// add a TMS request for them
app.DebugPrintf("+++ Adding TMSPP request for texture pack data\n");
app.AddTMSPPFileTypeRequest(e_DLC_TexturePackData);
if(m_iConfigA!=nullptr)
if(m_iConfigA!=NULL)
{
delete m_iConfigA;
}
@@ -123,7 +123,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
void IUIScene_StartGame::handleSelectionChanged(F64 selectedId)
{
m_iSetTexturePackDescription = static_cast<int>(selectedId);
m_iSetTexturePackDescription = (int)selectedId;
if(!m_texturePackDescDisplayed)
{
@@ -135,13 +135,13 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
{
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackByIndex(index);
if(tp==nullptr)
if(tp==NULL)
{
#if TO_BE_IMPLEMENTED
// this is probably a texture pack icon added from TMS
DWORD dwBytes=0,dwFileBytes=0;
PBYTE pbData=nullptr,pbFileData=nullptr;
PBYTE pbData=NULL,pbFileData=NULL;
CXuiCtrl4JList::LIST_ITEM_INFO ListItem;
// get the current index of the list, and then get the data
@@ -171,7 +171,7 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
}
else
{
m_texturePackComparison->UseBrush(nullptr);
m_texturePackComparison->UseBrush(NULL);
}
#endif
}
@@ -214,7 +214,7 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot)
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackByIndex(m_currentTexturePackIndex);
// if the texture pack is null, you don't have it yet
if(tp==nullptr)
if(tp==NULL)
{
#if TO_BE_IMPLEMENTED
// Upsell
@@ -254,7 +254,7 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot)
int IUIScene_StartGame::TrialTexturePackWarningReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
IUIScene_StartGame* pScene = static_cast<IUIScene_StartGame *>(pParam);
IUIScene_StartGame* pScene = (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 = static_cast<IUIScene_StartGame *>(pParam);
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
@@ -279,7 +279,7 @@ int IUIScene_StartGame::UnlockTexturePackReturned(void *pParam,int iPad,C4JStora
ULONGLONG ullIndexA[1];
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId());
if(pDLCInfo!=nullptr)
if(pDLCInfo!=NULL)
{
ullIndexA[0]=pDLCInfo->ullOfferID_Full;
}
@@ -289,9 +289,9 @@ int IUIScene_StartGame::UnlockTexturePackReturned(void *pParam,int iPad,C4JStora
}
StorageManager.InstallOffer(1,ullIndexA,nullptr,nullptr);
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
#elif defined _XBOX_ONE
//StorageManager.InstallOffer(1,StorageManager.GetOffer(iIndex).wszProductID,nullptr,nullptr);
//StorageManager.InstallOffer(1,StorageManager.GetOffer(iIndex).wszProductID,NULL,NULL);
#endif
// the license change coming in when the offer has been installed will cause this scene to refresh
@@ -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 = static_cast<IUIScene_StartGame *>(pParam);
IUIScene_StartGame *pClass = (IUIScene_StartGame *)pParam;
#ifdef _XBOX
@@ -332,7 +332,7 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora
if( result==C4JStorage::EMessage_ResultAccept ) // Full version
{
ullIndexA[0]=ullOfferID_Full;
StorageManager.InstallOffer(1,ullIndexA,nullptr,nullptr);
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
}
else // trial version
@@ -343,7 +343,7 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora
{
ullIndexA[0]=pDLCInfo->ullOfferID_Trial;
StorageManager.InstallOffer(1,ullIndexA,nullptr,nullptr);
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
}
}
}
@@ -360,7 +360,7 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora
app.GetDLCFullOfferIDForPackID(pClass->m_MoreOptionsParams.dwTexturePack,ProductId);
StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),nullptr,nullptr);
StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL);
// the license change coming in when the offer has been installed will cause this scene to refresh
}

View File

@@ -8,14 +8,12 @@
#include "..\..\ClientConnection.h"
#include "IUIScene_TradingMenu.h"
#include "UI.h"
IUIScene_TradingMenu::IUIScene_TradingMenu()
{
m_validOffersCount = 0;
m_selectedSlot = 0;
m_offersStartIndex = 0;
m_menu = nullptr;
m_menu = NULL;
m_bHasUpdatedOnce = false;
}
@@ -33,10 +31,10 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[getPad()] != nullptr )
if( pMinecraft->localgameModes[getPad()] != NULL )
{
Tutorial *tutorial = pMinecraft->localgameModes[getPad()]->getTutorial();
if(tutorial != nullptr)
if(tutorial != NULL)
{
tutorial->handleUIInput(iAction);
if(ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(iAction))
@@ -78,7 +76,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
int buyAMatches = player->inventory->countMatches(buyAItem);
int buyBMatches = player->inventory->countMatches(buyBItem);
if( (buyAItem != nullptr && buyAMatches >= buyAItem->count) && (buyBItem == nullptr || buyBMatches >= buyBItem->count) )
if( (buyAItem != NULL && buyAMatches >= buyAItem->count) && (buyBItem == NULL || buyBMatches >= buyBItem->count) )
{
// 4J-JEV: Fix for PS4 #7111: [PATCH 1.12] Trading Librarian villagers for multiple <20>Enchanted Books<6B> will cause the title to crash.
int actualShopItem = m_activeOffers.at(selectedShopItem).second;
@@ -97,7 +95,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
}
// Send a packet to the server
player->connection->send(std::make_shared<TradeItemPacket>(m_menu->containerId, actualShopItem));
player->connection->send( shared_ptr<TradeItemPacket>( new TradeItemPacket(m_menu->containerId, actualShopItem) ) );
updateDisplay();
}
@@ -154,7 +152,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
ByteArrayOutputStream rawOutput;
DataOutputStream output(&rawOutput);
output.writeInt(actualShopItem);
Minecraft::GetInstance()->getConnection(getPad())->send(std::make_shared<CustomPayloadPacket>(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()));
Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
}
}
return handled;
@@ -164,7 +162,7 @@ void IUIScene_TradingMenu::handleTick()
{
int offerCount = 0;
MerchantRecipeList *offers = m_merchant->getOffers(Minecraft::GetInstance()->localplayers[getPad()]);
if (offers != nullptr)
if (offers != NULL)
{
offerCount = offers->size();
@@ -183,7 +181,7 @@ void IUIScene_TradingMenu::updateDisplay()
int iA = -1;
MerchantRecipeList *unfilteredOffers = m_merchant->getOffers(Minecraft::GetInstance()->localplayers[getPad()]);
if (unfilteredOffers != nullptr)
if (unfilteredOffers != NULL)
{
m_activeOffers.clear();
int unfilteredIndex = 0;
@@ -207,7 +205,7 @@ void IUIScene_TradingMenu::updateDisplay()
ByteArrayOutputStream rawOutput;
DataOutputStream output(&rawOutput);
output.writeInt(firstValidTrade);
Minecraft::GetInstance()->getConnection(getPad())->send(std::make_shared<CustomPayloadPacket>(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()));
Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
}
}
@@ -243,7 +241,7 @@ void IUIScene_TradingMenu::updateDisplay()
// 4J-PB - need to get the villager type here
wsTemp = app.GetString(IDS_VILLAGER_OFFERS_ITEM);
wsTemp = replaceAll(wsTemp,L"{*VILLAGER_TYPE*}",m_merchant->getDisplayName());
size_t iPos=wsTemp.find(L"%s");
int iPos=wsTemp.find(L"%s");
wsTemp.replace(iPos,2,activeRecipe->getSellItem()->getHoverName());
setTitle(wsTemp.c_str());
@@ -257,10 +255,10 @@ void IUIScene_TradingMenu::updateDisplay()
setRequest1Item(buyAItem);
setRequest2Item(buyBItem);
if(buyAItem != nullptr) setRequest1Name(buyAItem->getHoverName());
if(buyAItem != NULL) setRequest1Name(buyAItem->getHoverName());
else setRequest1Name(L"");
if(buyBItem != nullptr) setRequest2Name(buyBItem->getHoverName());
if(buyBItem != NULL) setRequest2Name(buyBItem->getHoverName());
else setRequest2Name(L"");
bool canMake = true;
@@ -286,15 +284,15 @@ void IUIScene_TradingMenu::updateDisplay()
}
else
{
if(buyBItem!=nullptr)
if(buyBItem!=NULL)
{
setRequest2RedBox(true);
canMake = false;
}
else
{
setRequest2RedBox(buyBItem != nullptr);
canMake = canMake && buyBItem == nullptr;
setRequest2RedBox(buyBItem != NULL);
canMake = canMake && buyBItem == NULL;
}
}
@@ -322,7 +320,7 @@ void IUIScene_TradingMenu::updateDisplay()
bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
{
bool canMake = false;
if (recipe != nullptr)
if (recipe != NULL)
{
if(recipe->isDeprecated()) return false;
@@ -337,7 +335,7 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
}
else
{
canMake = buyAItem == nullptr;
canMake = buyAItem == NULL;
}
int buyBMatches = player->inventory->countMatches(buyBItem);
@@ -347,7 +345,7 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
}
else
{
canMake = canMake && buyBItem == nullptr;
canMake = canMake && buyBItem == NULL;
}
}
return canMake;

View File

@@ -123,6 +123,4 @@
#include "UIScene_TeleportMenu.h"
#include "UIScene_EndPoem.h"
#include "UIScene_EULA.h"
#include "UIScene_NewUpdateMessage.h"
extern ConsoleUIController ui;
#include "UIScene_NewUpdateMessage.h"

View File

@@ -53,42 +53,42 @@ void UIAbstractBitmapFont::registerFont()
IggyFontMetrics * RADLINK UIAbstractBitmapFont::GetFontMetrics_Callback(void *user_context,IggyFontMetrics *metrics)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->GetFontMetrics(metrics);
return ((UIAbstractBitmapFont *) user_context)->GetFontMetrics(metrics);
}
S32 RADLINK UIAbstractBitmapFont::GetCodepointGlyph_Callback(void *user_context,U32 codepoint)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->GetCodepointGlyph(codepoint);
return ((UIAbstractBitmapFont *) user_context)->GetCodepointGlyph(codepoint);
}
IggyGlyphMetrics * RADLINK UIAbstractBitmapFont::GetGlyphMetrics_Callback(void *user_context,S32 glyph,IggyGlyphMetrics *metrics)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->GetGlyphMetrics(glyph,metrics);
return ((UIAbstractBitmapFont *) user_context)->GetGlyphMetrics(glyph,metrics);
}
rrbool RADLINK UIAbstractBitmapFont::IsGlyphEmpty_Callback(void *user_context,S32 glyph)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->IsGlyphEmpty(glyph);
return ((UIAbstractBitmapFont *) user_context)->IsGlyphEmpty(glyph);
}
F32 RADLINK UIAbstractBitmapFont::GetKerningForGlyphPair_Callback(void *user_context,S32 first_glyph,S32 second_glyph)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->GetKerningForGlyphPair(first_glyph,second_glyph);
return ((UIAbstractBitmapFont *) user_context)->GetKerningForGlyphPair(first_glyph,second_glyph);
}
rrbool RADLINK UIAbstractBitmapFont::CanProvideBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->CanProvideBitmap(glyph,pixel_scale);
return ((UIAbstractBitmapFont *) user_context)->CanProvideBitmap(glyph,pixel_scale);
}
rrbool RADLINK UIAbstractBitmapFont::GetGlyphBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale,IggyBitmapCharacter *bitmap)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->GetGlyphBitmap(glyph,pixel_scale,bitmap);
return ((UIAbstractBitmapFont *) user_context)->GetGlyphBitmap(glyph,pixel_scale,bitmap);
}
void RADLINK UIAbstractBitmapFont::FreeGlyphBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale,IggyBitmapCharacter *bitmap)
{
return static_cast<UIAbstractBitmapFont *>(user_context)->FreeGlyphBitmap(glyph,pixel_scale,bitmap);
return ((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 = -static_cast<S32>(m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent;
bitmap->top_left_y = -((S32) m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent;
bitmap->oversample = 0;
bitmap->point_sample = true;
@@ -351,7 +351,7 @@ rrbool UIBitmapFont::GetGlyphBitmap(S32 glyph,F32 pixel_scale,IggyBitmapCharacte
bitmap->stride_in_bytes = m_cFontData->getFontData()->m_uiGlyphMapX;
// 4J-JEV: Additional information needed to release memory afterwards.
bitmap->user_context_for_free = nullptr;
bitmap->user_context_for_free = NULL;
return true;
}

View File

@@ -46,7 +46,7 @@ void UIComponent_Chat::handleTimerComplete(int id)
Minecraft *pMinecraft = Minecraft::GetInstance();
bool anyVisible = false;
if(pMinecraft->localplayers[m_iPad]!= nullptr)
if(pMinecraft->localplayers[m_iPad]!= NULL)
{
Gui *pGui = pMinecraft->gui;
//DWORD messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) );
@@ -102,15 +102,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 = static_cast<S32>(ui.getScreenHeight() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
}
ui.setupRenderPosition(xPos, yPos);
@@ -124,14 +124,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 = static_cast<S32>(ui.getScreenHeight());
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (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 = static_cast<F64>(0); // WIN64
value[0].number = (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 = static_cast<F64>(0);
value[0].number = (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 = static_cast<S32>(ui.getScreenHeight() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (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 = static_cast<S32>(ui.getScreenHeight());
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:

View File

@@ -45,7 +45,7 @@ void UIComponent_Panorama::tick()
Minecraft *pMinecraft = Minecraft::GetInstance();
EnterCriticalSection(&pMinecraft->m_setLevelCS);
if(pMinecraft->level!=nullptr)
if(pMinecraft->level!=NULL)
{
int64_t i64TimeOfDay =0;
// are we in the Nether? - Leave the time as 0 if we are, so we show daylight
@@ -85,10 +85,10 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp
switch( viewport )
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
xPos = (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 = static_cast<S32>(ui.getScreenHeight());
S32 tileHeight = (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-static_cast<float>(ucAlpha))/10.0f;
fVal=0.01f*(80.0f-((10.0f-static_cast<float>(uiOpacityTimer))*fStep));
float fStep=(80.0f-(float)ucAlpha)/10.0f;
fVal=0.01f*(80.0f-((10.0f-(float)uiOpacityTimer)*fStep));
}
else
{
@@ -164,7 +164,7 @@ void UIComponent_Tooltips::tick()
}
else
{
fVal=0.01f*static_cast<float>(ucAlpha);
fVal=0.01f*(float)ucAlpha;
}
}
else
@@ -174,7 +174,7 @@ void UIComponent_Tooltips::tick()
{
ucAlpha=15;
}
fVal=0.01f*static_cast<float>(ucAlpha);
fVal=0.01f*(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 = static_cast<S32>(ui.getScreenHeight() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (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 = static_cast<S32>(ui.getScreenHeight());
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
@@ -351,7 +351,7 @@ void UIComponent_Tooltips::_SetTooltip(unsigned int iToolTipId, UIString label,
void UIComponent_Tooltips::_Relayout()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcUpdateLayout, 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcUpdateLayout, 0 , NULL );
#ifdef __PSVITA__
// rebuild touchboxes

View File

@@ -12,8 +12,8 @@ UIComponent_TutorialPopup::UIComponent_TutorialPopup(int iPad, void *initData, U
// Setup all the Iggy references we need for this scene
initialiseMovie();
m_interactScene = nullptr;
m_lastInteractSceneMoved = nullptr;
m_interactScene = NULL;
m_lastInteractSceneMoved = NULL;
m_lastSceneMovedLeft = false;
m_bAllowFade = false;
m_iconItem = nullptr;
@@ -90,7 +90,7 @@ void UIComponent_TutorialPopup::RemoveInteractSceneReference(UIScene *scene)
{
if( m_interactScene == scene )
{
m_interactScene = nullptr;
m_interactScene = NULL;
}
}
@@ -132,7 +132,7 @@ void UIComponent_TutorialPopup::_SetDescription(UIScene *interactScene, const ws
{
m_interactScene = interactScene;
app.DebugPrintf("Setting m_interactScene to %08x\n", m_interactScene);
if( interactScene != m_lastInteractSceneMoved ) m_lastInteractSceneMoved = nullptr;
if( interactScene != m_lastInteractSceneMoved ) m_lastInteractSceneMoved = NULL;
if(desc.empty())
{
SetVisible( false );
@@ -212,20 +212,20 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
if( icon != TUTORIAL_NO_ICON )
{
m_iconIsFoil = false;
m_iconItem = std::make_shared<ItemInstance>(icon, 1, iAuxVal);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal));
}
else
{
m_iconItem = nullptr;
wstring openTag(L"{*ICON*}");
wstring closeTag(L"{*/ICON*}");
size_t iconTagStartPos = temp.find(openTag);
size_t iconStartPos = iconTagStartPos + openTag.length();
if( iconTagStartPos > 0 && iconStartPos < temp.length() )
int iconTagStartPos = (int)temp.find(openTag);
int iconStartPos = iconTagStartPos + (int)openTag.length();
if( iconTagStartPos > 0 && iconStartPos < (int)temp.length() )
{
size_t iconEndPos = temp.find(closeTag, iconStartPos);
int iconEndPos = (int)temp.find( closeTag, iconStartPos );
if(iconEndPos > iconStartPos && iconEndPos < temp.length() )
if(iconEndPos > iconStartPos && iconEndPos < (int)temp.length() )
{
wstring id = temp.substr(iconStartPos, iconEndPos - iconStartPos);
@@ -241,7 +241,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
{
iAuxVal = 0;
}
m_iconItem = std::make_shared<ItemInstance>(iconId, 1, iAuxVal);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal));
temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L"");
}
@@ -250,63 +250,63 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
// remove any icon text
else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::workBench_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::workBench_Id,1,0));
}
else if(temp.find(L"{*SticksIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::stick_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::stick_Id,1,0));
}
else if(temp.find(L"{*PlanksIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::wood_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::wood_Id,1,0));
}
else if(temp.find(L"{*WoodenShovelIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::shovel_wood_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::shovel_wood_Id,1,0));
}
else if(temp.find(L"{*WoodenHatchetIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::hatchet_wood_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::hatchet_wood_Id,1,0));
}
else if(temp.find(L"{*WoodenPickaxeIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::pickAxe_wood_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::pickAxe_wood_Id,1,0));
}
else if(temp.find(L"{*FurnaceIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::furnace_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::furnace_Id,1,0));
}
else if(temp.find(L"{*WoodenDoorIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::door_wood, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::door_wood,1,0));
}
else if(temp.find(L"{*TorchIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::torch_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::torch_Id,1,0));
}
else if(temp.find(L"{*BoatIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::boat_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::boat_Id,1,0));
}
else if(temp.find(L"{*FishingRodIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::fishingRod_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod_Id,1,0));
}
else if(temp.find(L"{*FishIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::fish_raw_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::fish_raw_Id,1,0));
}
else if(temp.find(L"{*MinecartIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Item::minecart_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::minecart_Id,1,0));
}
else if(temp.find(L"{*RailIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::rail_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::rail_Id,1,0));
}
else if(temp.find(L"{*PoweredRailIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::goldenRail_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::goldenRail_Id,1,0));
}
else if(temp.find(L"{*StructuresIcon*}")!=wstring::npos)
{
@@ -320,15 +320,15 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
}
else if(temp.find(L"{*StoneIcon*}")!=wstring::npos)
{
m_iconItem = std::make_shared<ItemInstance>(Tile::stone_Id, 1, 0);
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::stone_Id,1,0));
}
else
{
m_iconItem = nullptr;
}
}
if(!isFixedIcon && m_iconItem != nullptr) setupIconHolder(e_ICON_TYPE_IGGY);
m_controlIconHolder.setVisible( isFixedIcon || m_iconItem != nullptr);
if(!isFixedIcon && m_iconItem != NULL) setupIconHolder(e_ICON_TYPE_IGGY);
m_controlIconHolder.setVisible( isFixedIcon || m_iconItem != NULL);
return temp;
}
@@ -341,13 +341,13 @@ wstring UIComponent_TutorialPopup::_SetImage(wstring &desc)
wstring openTag(L"{*IMAGE*}");
wstring closeTag(L"{*/IMAGE*}");
size_t imageTagStartPos = desc.find(openTag);
size_t imageStartPos = imageTagStartPos + openTag.length();
if( imageTagStartPos > 0 && imageStartPos < desc.length() )
int imageTagStartPos = (int)desc.find(openTag);
int imageStartPos = imageTagStartPos + (int)openTag.length();
if( imageTagStartPos > 0 && imageStartPos < (int)desc.length() )
{
size_t imageEndPos = desc.find( closeTag, imageStartPos );
int imageEndPos = (int)desc.find( closeTag, imageStartPos );
if(imageEndPos > imageStartPos && imageEndPos < desc.length() )
if(imageEndPos > imageStartPos && imageEndPos < (int)desc.length() )
{
wstring id = desc.substr(imageStartPos, imageEndPos - imageStartPos);
m_image.SetImagePath( id.c_str() );
@@ -425,7 +425,7 @@ wstring UIComponent_TutorialPopup::ParseDescription(int iPad, wstring &text)
void UIComponent_TutorialPopup::UpdateInteractScenePosition(bool visible)
{
if( m_interactScene == nullptr ) return;
if( m_interactScene == NULL ) return;
// 4J-PB - check this players screen section to see if we should allow the animation
bool bAllowAnim=false;
@@ -479,20 +479,20 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo
switch( viewport )
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
yPos = (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 = static_cast<S32>(ui.getScreenWidth() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
}
//Adjust for safezone
@@ -529,7 +529,7 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo
void UIComponent_TutorialPopup::customDraw(IggyCustomDrawCallbackRegion *region)
{
if(m_iconItem != nullptr) customDrawSlotControl(region,m_iPad,m_iconItem,1.0f,m_iconItem->isFoil() || m_iconIsFoil,false);
if(m_iconItem != NULL) customDrawSlotControl(region,m_iPad,m_iconItem,1.0f,m_iconItem->isFoil() || m_iconIsFoil,false);
}
void UIComponent_TutorialPopup::setupIconHolder(EIcons icon)
@@ -538,7 +538,7 @@ void UIComponent_TutorialPopup::setupIconHolder(EIcons icon)
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = static_cast<F64>(icon);
value[0].number = (F64)icon;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetupIconHolder , 1 , value );
m_iconType = icon;

View File

@@ -6,7 +6,7 @@
UIControl::UIControl()
{
m_parentScene = nullptr;
m_parentScene = NULL;
m_lastOpacity = 1.0f;
m_controlName = "";
m_isVisible = true;
@@ -31,15 +31,15 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
m_nameVisible = registerFastName(L"visible");
F64 fx, fy, fwidth, fheight;
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , nullptr , &fx );
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , nullptr , &fy );
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , nullptr , &fwidth );
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , nullptr , &fheight );
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , NULL , &fx );
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , NULL , &fy );
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &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));
m_x = (S32)fx;
m_y = (S32)fy;
m_width = (S32)Math::round(fwidth);
m_height = (S32)Math::round(fheight);
return res;
}
@@ -47,14 +47,14 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
void UIControl::UpdateControl()
{
F64 fx, fy, fwidth, fheight;
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , nullptr , &fx );
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , nullptr , &fy );
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , nullptr , &fwidth );
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , nullptr , &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));
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , NULL , &fx );
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);
}
void UIControl::ReInit()
@@ -76,7 +76,7 @@ void UIControl::ReInit()
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, m_parentScene->m_rootPath , m_funcSetAlpha , 2 , value );
}
IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, nullptr, m_isVisible );
IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, NULL, m_isVisible );
}
IggyValuePath *UIControl::getIggyValuePath()
@@ -130,7 +130,7 @@ void UIControl::setVisible(bool visible)
{
if(visible != m_isVisible)
{
rrbool succ = IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, nullptr, visible );
rrbool succ = IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, NULL, visible );
if(succ) m_isVisible = visible;
else app.DebugPrintf("Failed to set visibility for control\n");
}
@@ -140,7 +140,7 @@ bool UIControl::getVisible()
{
rrbool bVisible = false;
IggyResult result = IggyValueGetBooleanRS ( getIggyValuePath() , m_nameVisible, nullptr, &bVisible );
IggyResult result = IggyValueGetBooleanRS ( getIggyValuePath() , m_nameVisible, NULL, &bVisible );
m_isVisible = bVisible;

View File

@@ -72,7 +72,7 @@ void UIControl_Base::setLabel(UIString label, bool instant, bool force)
const wchar_t* UIControl_Base::getLabel()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcGetLabel, 0, nullptr);
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcGetLabel, 0, NULL);
if(result.type == IGGY_DATATYPE_string_UTF16)
{
@@ -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 = static_cast<IggyUTF16 *>(labels[i]);
stringVal[i].string = (IggyUTF16 *)labels[i];
stringVal[i].length = wcslen(labels[i]);
value[i].type = IGGY_DATATYPE_string_UTF16;
value[i].string16 = stringVal[i];

View File

@@ -60,7 +60,7 @@ void UIControl_ButtonList::ReInit()
void UIControl_ButtonList::clearList()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_removeAllItemsFunc , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_removeAllItemsFunc , 0 , NULL );
m_itemCount = 0;
}
@@ -82,7 +82,7 @@ void UIControl_ButtonList::addItem(const string &label, int data)
IggyStringUTF8 stringVal;
stringVal.string = (char*)label.c_str();
stringVal.length = static_cast<S32>(label.length());
stringVal.length = (S32)label.length();
value[0].type = IGGY_DATATYPE_string_UTF8;
value[0].string8 = stringVal;

View File

@@ -60,7 +60,7 @@ void UIControl_CheckBox::init(UIString label, int id, bool checked)
bool UIControl_CheckBox::IsChecked()
{
rrbool checked = false;
IggyResult result = IggyValueGetBooleanRS ( &m_iggyPath , m_checkedProp, nullptr, &checked );
IggyResult result = IggyValueGetBooleanRS ( &m_iggyPath , m_checkedProp, NULL, &checked );
m_bChecked = checked;
return checked;
}

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 = static_cast<S32>(label.length());
stringVal.length = (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 = static_cast<S32>(label.length());
stringVal.length = (S32)label.length();
value[0].type = IGGY_DATATYPE_string_UTF16;
value[0].string16 = stringVal;

View File

@@ -74,12 +74,12 @@ void UIControl_DynamicLabel::TouchScroll(S32 iY, bool bActive)
S32 UIControl_DynamicLabel::GetRealWidth()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealWidth, 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealWidth, 0 , NULL );
S32 iRealWidth = m_width;
if(result.type == IGGY_DATATYPE_number)
{
iRealWidth = static_cast<S32>(result.number);
iRealWidth = (S32)result.number;
}
return iRealWidth;
}
@@ -87,12 +87,12 @@ S32 UIControl_DynamicLabel::GetRealWidth()
S32 UIControl_DynamicLabel::GetRealHeight()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealHeight, 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealHeight, 0 , NULL );
S32 iRealHeight = m_height;
if(result.type == IGGY_DATATYPE_number)
{
iRealHeight = static_cast<S32>(result.number);
iRealHeight = (S32)result.number;
}
return iRealHeight;
}

View File

@@ -12,7 +12,7 @@
UIControl_EnchantmentBook::UIControl_EnchantmentBook()
{
UIControl::setControlType(UIControl::eEnchantmentBook);
model = nullptr;
model = NULL;
last = nullptr;
time = 0;
@@ -69,12 +69,12 @@ void UIControl_EnchantmentBook::render(IggyCustomDrawCallbackRegion *region)
glEnable(GL_CULL_FACE);
if(model == nullptr)
if(model == NULL)
{
// Share the model the the EnchantTableRenderer
EnchantTableRenderer *etr = static_cast<EnchantTableRenderer *>(TileEntityRenderDispatcher::instance->getRenderer(eTYPE_ENCHANTMENTTABLEENTITY));
if(etr != nullptr)
EnchantTableRenderer *etr = (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 = static_cast<UIScene_EnchantingMenu *>(m_parentScene);
UIScene_EnchantingMenu *m_containerScene = (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 = static_cast<UIScene_EnchantingMenu *>(m_parentScene);
UIScene_EnchantingMenu *enchantingScene = (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, static_cast<float>(m_width)/ss, col, static_cast<float>(m_height)/ss);
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (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, static_cast<float>(m_width)/ss, col, static_cast<float>(m_height)/ss);
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (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 = static_cast<UIScene_EnchantingMenu *>(m_parentScene);
UIScene_EnchantingMenu *enchantingScene = (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 = static_cast<int>(state);
value[0].number = (int)state;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcChangeState , 1 , value );
if(out == IGGY_RESULT_SUCCESS) m_lastState = state;

View File

@@ -23,7 +23,7 @@ bool UIControl_HTMLLabel::setupControl(UIScene *scene, IggyValuePath *parent, co
void UIControl_HTMLLabel::startAutoScroll()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcStartAutoScroll , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcStartAutoScroll , 0 , NULL );
}
void UIControl_HTMLLabel::ReInit()
@@ -79,12 +79,12 @@ void UIControl_HTMLLabel::TouchScroll(S32 iY, bool bActive)
S32 UIControl_HTMLLabel::GetRealWidth()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealWidth, 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealWidth, 0 , NULL );
S32 iRealWidth = m_width;
if(result.type == IGGY_DATATYPE_number)
{
iRealWidth = static_cast<S32>(result.number);
iRealWidth = (S32)result.number;
}
return iRealWidth;
}
@@ -92,12 +92,12 @@ S32 UIControl_HTMLLabel::GetRealWidth()
S32 UIControl_HTMLLabel::GetRealHeight()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealHeight, 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealHeight, 0 , NULL );
S32 iRealHeight = m_height;
if(result.type == IGGY_DATATYPE_number)
{
iRealHeight = static_cast<S32>(result.number);
iRealHeight = (S32)result.number;
}
return iRealHeight;
}

View File

@@ -45,7 +45,7 @@ void UIControl_LeaderboardList::ReInit()
void UIControl_LeaderboardList::clearList()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_funcResetLeaderboard , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_funcResetLeaderboard , 0 , NULL );
}
void UIControl_LeaderboardList::setupTitles(const wstring &rank, const wstring &gamertag)

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=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_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(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 = static_cast<UIScene_HorseInventoryMenu *>(m_parentScene);
UIScene_HorseInventoryMenu *containerMenu = (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=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_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(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 = static_cast<UIScene_InventoryMenu *>(m_parentScene);
UIScene_InventoryMenu *containerMenu = (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 = static_cast<S32>(label.length());
stringVal.length = (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=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_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(float)ssc.rawHeight;
m_customTextureUrl = L"default";
m_backupTexture = TN_MOB_CHAR;
@@ -55,7 +55,7 @@ UIControl_PlayerSkinPreview::UIControl_PlayerSkinPreview()
m_fOriginalRotation = 0.0f;
m_framesAnimatingRotation = 0;
m_bAnimatingToFacing = false;
m_pvAdditionalModelParts=nullptr;
m_pvAdditionalModelParts=NULL;
m_uiAnimOverrideBitmask=0L;
}
@@ -167,7 +167,7 @@ void UIControl_PlayerSkinPreview::SetFacing(ESkinPreviewFacing facing, bool bAni
void UIControl_PlayerSkinPreview::CycleNextAnimation()
{
m_currentAnimation = static_cast<ESkinPreviewAnimations>(m_currentAnimation + 1);
m_currentAnimation = (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 = static_cast<ESkinPreviewAnimations>(m_currentAnimation - 1);
if(m_currentAnimation < e_SkinPreviewAnimation_Walking) m_currentAnimation = static_cast<ESkinPreviewAnimations>(e_SkinPreviewAnimation_Count - 1);
m_currentAnimation = (ESkinPreviewAnimations)(m_currentAnimation - 1);
if(m_currentAnimation < e_SkinPreviewAnimation_Walking) m_currentAnimation = (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(-static_cast<float>(m_xRot), 1, 0, 0);
glRotatef(-(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;
@@ -218,7 +218,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion *region)
//EntityRenderDispatcher::instance->render(pMinecraft->localplayers[0], 0, 0, 0, 0, 1);
EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_LOCALPLAYER);
if (renderer != nullptr)
if (renderer != NULL)
{
// 4J-PB - any additional parts to turn on for this player (skin dependent)
//vector<ModelPart *> *pAdditionalModelParts=mob->GetAdditionalModelParts();
@@ -257,12 +257,12 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
glPushMatrix();
glDisable(GL_CULL_FACE);
HumanoidModel *model = static_cast<HumanoidModel *>(renderer->getModel());
HumanoidModel *model = (HumanoidModel *)renderer->getModel();
//getAttackAnim(mob, a);
//if (armor != nullptr) armor->attackTime = model->attackTime;
//if (armor != NULL) armor->attackTime = model->attackTime;
//model->riding = mob->isRiding();
//if (armor != nullptr) armor->riding = model->riding;
//if (armor != NULL) armor->riding = model->riding;
// 4J Stu - Remember to reset these values once the rendering is done if you add another one
model->attackTime = 0;
@@ -292,7 +292,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
{
m_swingTime = 0;
}
model->attackTime = m_swingTime / static_cast<float>(Player::SWING_DURATION * 3);
model->attackTime = m_swingTime / (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(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
glTranslatef((float) x, (float) y, (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 = static_cast<float>(yd) * 10;
float flap = (float) yd * 10;
if (flap < -6) flap = -6;
if (flap > 32) flap = 32;
float lean = static_cast<float>(xd * xa + zd * za) * 100;
float lean2 = static_cast<float>(xd * za - zd * xa) * 100;
float lean = (float) (xd * xa + zd * za) * 100;
float lean2 = (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 = static_cast<float>((m_current - m_min))/(m_max-m_min);
float percent = (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 = static_cast<S32>(label.length());
stringVal.length = (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 = static_cast<S32>(label.length());
stringVal.length = (S32)label.length();
value[0].type = IGGY_DATATYPE_string_UTF16;
value[0].string16 = stringVal;

View File

@@ -92,12 +92,12 @@ void UIControl_Slider::SetSliderTouchPos(float fTouchPos)
S32 UIControl_Slider::GetRealWidth()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealWidth , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealWidth , 0 , NULL );
S32 iRealWidth = m_width;
if(result.type == IGGY_DATATYPE_number)
{
iRealWidth = static_cast<S32>(result.number);
iRealWidth = (S32)result.number;
}
return iRealWidth;
}

View File

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

View File

@@ -83,7 +83,7 @@ void UIControl_TexturePackList::selectSlot(int id)
void UIControl_TexturePackList::clearSlots()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_clearSlotsFunc ,0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_clearSlotsFunc ,0 , NULL );
}
void UIControl_TexturePackList::setEnabled(bool enable)
@@ -125,7 +125,7 @@ bool UIControl_TexturePackList::CanTouchTrigger(S32 iX, S32 iY)
S32 bCanTouchTrigger = false;
if(result.type == IGGY_DATATYPE_boolean)
{
bCanTouchTrigger = static_cast<bool>(result.boolval);
bCanTouchTrigger = (bool)result.boolval;
}
return bCanTouchTrigger;
}
@@ -133,12 +133,12 @@ bool UIControl_TexturePackList::CanTouchTrigger(S32 iX, S32 iY)
S32 UIControl_TexturePackList::GetRealHeight()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealHeight, 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcGetRealHeight, 0 , NULL );
S32 iRealHeight = m_height;
if(result.type == IGGY_DATATYPE_number)
{
iRealHeight = static_cast<S32>(result.number);
iRealHeight = (S32)result.number;
}
return iRealHeight;
}

File diff suppressed because it is too large Load Diff

View File

@@ -293,7 +293,7 @@ protected:
static GDrawTexture * RADLINK TextureSubstitutionCreateCallback( void * user_callback_data , IggyUTF16 * texture_name , S32 * width , S32 * height , void **destroy_callback_data );
static void RADLINK TextureSubstitutionDestroyCallback( void * user_callback_data , void * destroy_callback_data , GDrawTexture * handle );
virtual GDrawTexture *getSubstitutionTexture(int textureId) { return nullptr; }
virtual GDrawTexture *getSubstitutionTexture(int textureId) { return NULL; }
virtual void destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle) {}
public:
@@ -302,7 +302,7 @@ public:
public:
// NAVIGATION
bool NavigateToScene(int iPad, EUIScene scene, void *initData = nullptr, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD);
bool NavigateToScene(int iPad, EUIScene scene, void *initData = NULL, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD);
bool NavigateBack(int iPad, bool forceUsePad = false, EUIScene eScene = eUIScene_COUNT, EUILayer eLayer = eUILayer_COUNT);
void NavigateToHomeMenu();
UIScene *GetTopScene(int iPad, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD);
@@ -382,14 +382,14 @@ public:
virtual void HidePressStart();
void ClearPressStart();
virtual C4JStorage::EMessageResult RequestAlertMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=nullptr,LPVOID lpParam=nullptr, WCHAR *pwchFormatString=nullptr);
virtual C4JStorage::EMessageResult RequestErrorMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=nullptr,LPVOID lpParam=nullptr, WCHAR *pwchFormatString=nullptr);
virtual C4JStorage::EMessageResult RequestAlertMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, WCHAR *pwchFormatString=NULL);
virtual C4JStorage::EMessageResult RequestErrorMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, WCHAR *pwchFormatString=NULL);
private:
virtual C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad,int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, WCHAR *pwchFormatString,DWORD dwFocusButton, bool bIsError);
public:
C4JStorage::EMessageResult RequestUGCMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = nullptr, LPVOID lpParam = nullptr);
C4JStorage::EMessageResult RequestContentRestrictedMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = nullptr, LPVOID lpParam = nullptr);
C4JStorage::EMessageResult RequestUGCMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = NULL, LPVOID lpParam = NULL);
C4JStorage::EMessageResult RequestContentRestrictedMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = NULL, LPVOID lpParam = NULL);
virtual void SetWinUserIndex(unsigned int iPad);
unsigned int GetWinUserIndex();

View File

@@ -145,9 +145,9 @@ CFontData::CFontData()
{
m_unicodeMap = unordered_map<unsigned int, unsigned short>();
m_sFontData = nullptr;
m_kerningTable = nullptr;
m_pbRawImage = nullptr;
m_sFontData = NULL;
m_kerningTable = NULL;
m_pbRawImage = NULL;
}
CFontData::CFontData(SFontData &sFontData, int *pbRawImage)

View File

@@ -1,8 +1,6 @@
#include "stdafx.h"
#include "UIGroup.h"
#include "UI.h"
UIGroup::UIGroup(EUIGroup group, int iPad)
{
m_group = group;
@@ -25,22 +23,22 @@ UIGroup::UIGroup(EUIGroup group, int iPad)
#endif
}
m_tooltips = (UIComponent_Tooltips *)m_layers[static_cast<int>(eUILayer_Tooltips)]->addComponent(0, eUIComponent_Tooltips);
m_tooltips = (UIComponent_Tooltips *)m_layers[(int)eUILayer_Tooltips]->addComponent(0, eUIComponent_Tooltips);
m_tutorialPopup = nullptr;
m_hud = nullptr;
m_pressStartToPlay = nullptr;
m_tutorialPopup = NULL;
m_hud = NULL;
m_pressStartToPlay = NULL;
if(m_group != eUIGroup_Fullscreen)
{
m_tutorialPopup = (UIComponent_TutorialPopup *)m_layers[static_cast<int>(eUILayer_Popup)]->addComponent(m_iPad, eUIComponent_TutorialPopup);
m_tutorialPopup = (UIComponent_TutorialPopup *)m_layers[(int)eUILayer_Popup]->addComponent(m_iPad, eUIComponent_TutorialPopup);
m_hud = (UIScene_HUD *)m_layers[static_cast<int>(eUILayer_HUD)]->addComponent(m_iPad, eUIScene_HUD);
m_hud = (UIScene_HUD *)m_layers[(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[static_cast<int>(eUILayer_Tooltips)]->addComponent(0, eUIComponent_PressStartToPlay);
m_pressStartToPlay = (UIComponent_PressStartToPlay *)m_layers[(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
@@ -67,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 != static_cast<int>(eUILayer_Fullscreen));
if(highestRenderable < eUILayer_COUNT) m_layers[highestRenderable]->ReloadAll(highestRenderable != (int)eUILayer_Fullscreen);
}
}
@@ -129,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[static_cast<int>(layer)]->NavigateToScene(iPad, scene, initData);
bool succeeded = m_layers[(int)layer]->NavigateToScene(iPad, scene, initData);
updateStackStates();
return succeeded;
}
@@ -153,9 +151,9 @@ void UIGroup::closeAllScenes()
Minecraft *pMinecraft = Minecraft::GetInstance();
if( m_iPad >= 0 )
{
if(pMinecraft != nullptr && pMinecraft->localgameModes[m_iPad] != nullptr )
if(pMinecraft != NULL && pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(true);
@@ -165,14 +163,14 @@ void UIGroup::closeAllScenes()
for(unsigned int i = 0; i < eUILayer_COUNT; ++i)
{
// Ignore the error layer
if(i != static_cast<int>(eUILayer_Error)) m_layers[i]->closeAllScenes();
if(i != (int)eUILayer_Error) m_layers[i]->closeAllScenes();
}
updateStackStates();
}
UIScene *UIGroup::GetTopScene(EUILayer layer)
{
return m_layers[static_cast<int>(layer)]->GetTopScene();
return m_layers[(int)layer]->GetTopScene();
}
bool UIGroup::GetMenuDisplayed()
@@ -216,10 +214,10 @@ UIScene *UIGroup::getCurrentScene()
{
pScene=m_layers[i]->getCurrentScene();
if(pScene!=nullptr) return pScene;
if(pScene!=NULL) return pScene;
}
return nullptr;
return NULL;
}
#endif
@@ -414,16 +412,16 @@ int UIGroup::getCommandBufferList()
return m_commandBufferList;
}
// Returns the first scene of given type if it exists, nullptr otherwise
// Returns the first scene of given type if it exists, NULL otherwise
UIScene *UIGroup::FindScene(EUIScene sceneType)
{
UIScene *pScene = nullptr;
UIScene *pScene = NULL;
for (int i = 0; i < eUILayer_COUNT; i++)
{
pScene = m_layers[i]->FindScene(sceneType);
#ifdef __PS3__
if (pScene != nullptr) return pScene;
if (pScene != NULL) return pScene;
#else
if (pScene != nullptr) return pScene;
#endif

View File

@@ -102,7 +102,7 @@ void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport)
bool UILayer::IsSceneInStack(EUIScene scene)
{
bool inStack = false;
for(size_t i = (int)m_sceneStack.size() - 1;i >= 0; --i)
for(int i = m_sceneStack.size() - 1;i >= 0; --i)
{
if(m_sceneStack[i]->getSceneType() == scene)
{
@@ -118,7 +118,7 @@ bool UILayer::HasFocus(int iPad)
bool hasFocus = false;
if(m_hasFocus)
{
for(size_t i = (int)m_sceneStack.size() - 1;i >= 0; --i)
for(int i = m_sceneStack.size() - 1;i >= 0; --i)
{
if(m_sceneStack[i]->stealsFocus() )
{
@@ -146,7 +146,7 @@ bool UILayer::hidesLowerScenes()
}
if(!hidesScenes && !m_sceneStack.empty())
{
for(size_t i = (int)m_sceneStack.size() - 1;i >= 0; --i)
for(int i = m_sceneStack.size() - 1;i >= 0; --i)
{
if(m_sceneStack[i]->hidesLowerScenes())
{
@@ -197,7 +197,7 @@ bool UILayer::GetMenuDisplayed()
bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData)
{
UIScene *newScene = nullptr;
UIScene *newScene = NULL;
switch(scene)
{
// Debug
@@ -424,7 +424,7 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData)
break;
};
if(newScene == nullptr)
if(newScene == NULL)
{
app.DebugPrintf("WARNING: Scene %d was not created. Add it to UILayer::NavigateToScene\n", scene);
return false;
@@ -451,7 +451,7 @@ bool UILayer::NavigateBack(int iPad, EUIScene eScene)
bool navigated = false;
if(eScene < eUIScene_COUNT)
{
UIScene *scene = nullptr;
UIScene *scene = NULL;
do
{
scene = m_sceneStack.back();
@@ -523,9 +523,9 @@ UIScene *UILayer::addComponent(int iPad, EUIScene scene, void *initData)
return itComp;
}
}
return nullptr;
return NULL;
}
UIScene *newScene = nullptr;
UIScene *newScene = NULL;
switch(scene)
{
@@ -573,7 +573,7 @@ UIScene *UILayer::addComponent(int iPad, EUIScene scene, void *initData)
break;
};
if(newScene == nullptr) return nullptr;
if(newScene == NULL) return NULL;
m_components.push_back(newScene);
@@ -661,12 +661,12 @@ void UILayer::closeAllScenes()
}
}
// Get top scene on stack (or nullptr if stack is empty)
// Get top scene on stack (or NULL if stack is empty)
UIScene *UILayer::GetTopScene()
{
if(m_sceneStack.size() == 0)
{
return nullptr;
return NULL;
}
else
{
@@ -789,7 +789,7 @@ UIScene *UILayer::getCurrentScene()
}
}
return nullptr;
return NULL;
}
#endif
@@ -894,10 +894,10 @@ void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic)
totalDynamic += layerDynamic;
}
// Returns the first scene of given type if it exists, nullptr otherwise
// Returns the first scene of given type if it exists, NULL otherwise
UIScene *UILayer::FindScene(EUIScene sceneType)
{
for (size_t i = 0; i < m_sceneStack.size(); i++)
for (int i = 0; i < m_sceneStack.size(); i++)
{
if (m_sceneStack[i]->getSceneType() == sceneType)
{
@@ -905,5 +905,5 @@ UIScene *UILayer::FindScene(EUIScene sceneType)
}
}
return nullptr;
return NULL;
}

View File

@@ -61,7 +61,7 @@ public:
// E.g. you can keep a component active while performing navigation with other scenes on this layer
void showComponent(int iPad, EUIScene scene, bool show);
bool isComponentVisible(EUIScene scene);
UIScene *addComponent(int iPad, EUIScene scene, void *initData = nullptr);
UIScene *addComponent(int iPad, EUIScene scene, void *initData = NULL);
void removeComponent(EUIScene scene);
// INPUT

View File

@@ -11,8 +11,8 @@ UIScene::UIScene(int iPad, UILayer *parentLayer)
{
m_parentLayer = parentLayer;
m_iPad = iPad;
swf = nullptr;
m_pItemRenderer = nullptr;
swf = NULL;
m_pItemRenderer = NULL;
bHasFocus = false;
m_hasTickedOnce = false;
@@ -26,7 +26,7 @@ UIScene::UIScene(int iPad, UILayer *parentLayer)
m_lastOpacity = 1.0f;
m_bUpdateOpacity = false;
m_backScene = nullptr;
m_backScene = NULL;
m_cacheSlotRenders = false;
m_needsCacheRendered = true;
@@ -49,14 +49,14 @@ UIScene::~UIScene()
ui.UnregisterCallbackId(m_callbackUniqueId);
}
if(m_pItemRenderer != nullptr) delete m_pItemRenderer;
if(m_pItemRenderer != NULL) delete m_pItemRenderer;
}
void UIScene::destroyMovie()
{
/* Destroy the Iggy player. */
IggyPlayerDestroy( swf );
swf = nullptr;
swf = NULL;
// Clear out the controls collection (doesn't delete the controls, and they get re-setup later)
m_controls.clear();
@@ -115,7 +115,7 @@ bool UIScene::needsReloaded()
bool UIScene::hasMovie()
{
return swf != nullptr;
return swf != NULL;
}
F64 UIScene::getSafeZoneHalfHeight()
@@ -330,7 +330,7 @@ void UIScene::loadMovie()
byteArray baFile = ui.getMovieData(moviePath.c_str());
int64_t beforeLoad = ui.iggyAllocCount;
swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, nullptr);
swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, NULL);
int64_t afterLoad = ui.iggyAllocCount;
IggyPlayerInitializeAndTickRS ( swf );
int64_t afterTick = ui.iggyAllocCount;
@@ -365,7 +365,7 @@ void UIScene::loadMovie()
int64_t totalStatic = 0;
int64_t totalDynamic = 0;
while(res = IggyDebugGetMemoryUseInfo ( swf ,
nullptr ,
NULL ,
0 ,
0 ,
iteration ,
@@ -389,22 +389,21 @@ void UIScene::loadMovie()
void UIScene::getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUseInfo &memoryInfo)
{
rrbool res;
IggyMemoryUseInfo internalMemoryInfo;
int internalIteration = 0;
while (res = IggyDebugGetMemoryUseInfo(swf,
0,
memoryInfo.subcategory,
memoryInfo.subcategory_stringlen,
internalIteration,
&internalMemoryInfo))
{
app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), internalMemoryInfo.subcategory_stringlen, internalMemoryInfo.subcategory,
internalMemoryInfo.static_allocation_bytes, internalMemoryInfo.static_allocation_count, internalMemoryInfo.dynamic_allocation_bytes, internalMemoryInfo.dynamic_allocation_count);
++internalIteration;
if (internalMemoryInfo.subcategory_stringlen > memoryInfo.subcategory_stringlen)
getDebugMemoryUseRecursive(moviePath, internalMemoryInfo);
}
rrbool res;
IggyMemoryUseInfo internalMemoryInfo;
int internalIteration = 0;
while(res = IggyDebugGetMemoryUseInfo ( swf ,
NULL ,
memoryInfo.subcategory ,
memoryInfo.subcategory_stringlen ,
internalIteration ,
&internalMemoryInfo ))
{
app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), internalMemoryInfo.subcategory_stringlen, internalMemoryInfo.subcategory,
internalMemoryInfo.static_allocation_bytes, internalMemoryInfo.static_allocation_count, internalMemoryInfo.dynamic_allocation_bytes, internalMemoryInfo.dynamic_allocation_count);
++internalIteration;
if(internalMemoryInfo.subcategory_stringlen > memoryInfo.subcategory_stringlen) getDebugMemoryUseRecursive(moviePath, internalMemoryInfo);
}
}
void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic)
@@ -417,7 +416,7 @@ void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic)
int64_t sceneStatic = 0;
int64_t sceneDynamic = 0;
while(res = IggyDebugGetMemoryUseInfo ( swf ,
0 ,
NULL ,
"" ,
0 ,
iteration ,
@@ -465,7 +464,7 @@ void UIScene::tick()
UIControl* UIScene::GetMainPanel()
{
return nullptr;
return NULL;
}
#ifdef _WINDOWS64
@@ -667,19 +666,19 @@ void UIScene::removeControl( UIControl_Base *control, bool centreScene)
void UIScene::slideLeft()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSlideLeft , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSlideLeft , 0 , NULL );
}
void UIScene::slideRight()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSlideRight , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSlideRight , 0 , NULL );
}
void UIScene::doHorizontalResizeCheck()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcHorizontalResizeCheck , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcHorizontalResizeCheck , 0 , NULL );
}
void UIScene::render(S32 width, S32 height, C4JRender::eViewportType viewport)
@@ -722,7 +721,7 @@ void UIScene::customDraw(IggyCustomDrawCallbackRegion *region)
void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations)
{
if (item!= nullptr)
if (item!= NULL)
{
if(m_cacheSlotRenders)
{
@@ -850,7 +849,7 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
if (pop > 0)
{
glPushMatrix();
float squeeze = 1 + pop / static_cast<float>(Inventory::POP_TIME_DURATION);
float squeeze = 1 + pop / (float) Inventory::POP_TIME_DURATION;
float sx = x;
float sy = y;
float sxoffs = 8 * scaleX;
@@ -861,7 +860,7 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
}
PIXBeginNamedEvent(0,"Render and decorate");
if(m_pItemRenderer == nullptr) m_pItemRenderer = new ItemRenderer();
if(m_pItemRenderer == NULL) m_pItemRenderer = new ItemRenderer();
RenderManager.StateSetBlendEnable(true);
RenderManager.StateSetBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
RenderManager.StateSetBlendFactor(0xffffffff);
@@ -879,15 +878,15 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
{
glPushMatrix();
glScalef(scaleX, scaleY, 1.0f);
int iX= static_cast<int>(0.5f + ((float)x) / scaleX);
int iY= static_cast<int>(0.5f + ((float)y) / scaleY);
int iX= (int)(0.5f+((float)x)/scaleX);
int iY= (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, static_cast<int>(x), static_cast<int>(y), fAlpha);
m_pItemRenderer->renderGuiItemDecorations(pMinecraft->font, pMinecraft->textures, item, (int)x, (int)y, fAlpha);
}
}
@@ -898,9 +897,9 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
// 4J Stu - Not threadsafe
//void UIScene::navigateForward(int iPad, EUIScene scene, void *initData)
//{
// if(m_parentLayer == nullptr)
// if(m_parentLayer == NULL)
// {
// app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is nullptr!\n");
// app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is NULL!\n");
//#ifndef _CONTENT_PACKAGE
// __debugbreak();
//#endif
@@ -918,9 +917,9 @@ void UIScene::navigateBack()
ui.NavigateBack(m_iPad);
if(m_parentLayer == nullptr)
if(m_parentLayer == NULL)
{
// app.DebugPrintf("A scene is trying to navigate back, but it's parent layer is nullptr!\n");
// app.DebugPrintf("A scene is trying to navigate back, but it's parent layer is NULL!\n");
#ifndef _CONTENT_PACKAGE
// __debugbreak();
#endif
@@ -1043,7 +1042,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, static_cast<IggyKeycode>(iggyKeyCode), IGGY_KEYLOC_Standard );
IggyMakeEventKey( &keyEvent, pressed?IGGY_KEYEVENT_Down:IGGY_KEYEVENT_Up, (IggyKeycode)iggyKeyCode, IGGY_KEYLOC_Standard );
IggyEventResult result;
IggyPlayerDispatchEventRS ( swf , &keyEvent , &result );
@@ -1332,8 +1331,8 @@ bool UIScene::hasRegisteredSubstitutionTexture(const wstring &textureName)
void UIScene::_handleFocusChange(F64 controlId, F64 childId)
{
m_iFocusControl = static_cast<int>(controlId);
m_iFocusChild = static_cast<int>(childId);
m_iFocusControl = (int)controlId;
m_iFocusChild = (int)childId;
handleFocusChange(controlId, childId);
ui.PlayUISFX(eSFX_Focus);
@@ -1341,8 +1340,8 @@ void UIScene::_handleFocusChange(F64 controlId, F64 childId)
void UIScene::_handleInitFocus(F64 controlId, F64 childId)
{
m_iFocusControl = static_cast<int>(controlId);
m_iFocusChild = static_cast<int>(childId);
m_iFocusControl = (int)controlId;
m_iFocusChild = (int)childId;
//handleInitFocus(controlId, childId);
handleFocusChange(controlId, childId);

View File

@@ -265,7 +265,7 @@ public:
// NAVIGATION
protected:
//void navigateForward(int iPad, EUIScene scene, void *initData = nullptr);
//void navigateForward(int iPad, EUIScene scene, void *initData = NULL);
void navigateBack();
public:

View File

@@ -49,15 +49,15 @@ void UIScene_AbstractContainerMenu::handleDestroy()
#endif
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[m_iPad] != nullptr )
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
if(gameMode != nullptr) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
}
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(pMinecraft->localplayers[m_iPad] != nullptr && pMinecraft->localplayers[m_iPad]->containerMenu->containerId == m_menu->containerId)
if(pMinecraft->localplayers[m_iPad] != NULL && pMinecraft->localplayers[m_iPad]->containerMenu->containerId == m_menu->containerId)
{
pMinecraft->localplayers[m_iPad]->closeContainer();
}
@@ -149,8 +149,8 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
m_fPointerMaxX = m_fPanelMaxX + fPointerWidth;
m_fPointerMaxY = m_fPanelMaxY + (fPointerHeight/2);
// m_hPointerText=nullptr;
// m_hPointerTextBkg=nullptr;
// m_hPointerText=NULL;
// m_hPointerTextBkg=NULL;
// Put the pointer over first item in use row to start with.
UIVec2D itemPos;
@@ -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*(static_cast<float>(width)/m_movieWidth);
S32 y = m_pointerPos.y*(static_cast<float>(height)/m_movieHeight);
S32 x = m_pointerPos.x*((float)width/m_movieWidth);
S32 y = m_pointerPos.y*((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 = static_cast<S32>(m_pointerPos.x * ((float)width / m_movieWidth));
S32 y = static_cast<S32>(m_pointerPos.y * ((float)height / m_movieHeight));
S32 x = (S32)(m_pointerPos.x * ((float)width / m_movieWidth));
S32 y = (S32)(m_pointerPos.y * ((float)height / m_movieHeight));
IggyMakeEventMouseMove( &mouseEvent, x, y);
@@ -254,7 +254,7 @@ void UIScene_AbstractContainerMenu::render(S32 width, S32 height, C4JRender::eVi
void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
shared_ptr<ItemInstance> item = nullptr;
int slotId = -1;
@@ -265,7 +265,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg
}
else
{
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
if (slotId == -1)
{
app.DebugPrintf("This is not the control we are looking for\n");
@@ -278,7 +278,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg
}
}
if(item != nullptr) customDrawSlotControl(region,m_iPad,item,m_menu->isValidIngredient(item, slotId)?1.0f:0.5f,item->isFoil(),true);
if(item != NULL) customDrawSlotControl(region,m_iPad,item,m_menu->isValidIngredient(item, slotId)?1.0f:0.5f,item->isFoil(),true);
}
void UIScene_AbstractContainerMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
@@ -337,7 +337,7 @@ Slot *UIScene_AbstractContainerMenu::getSlot(ESceneSection eSection, int iSlot)
{
Slot *slot = m_menu->getSlot( getSectionStartOffset(eSection) + iSlot );
if(slot) return slot;
else return nullptr;
else return NULL;
}
bool UIScene_AbstractContainerMenu::isSlotEmpty(ESceneSection eSection, int iSlot)

View File

@@ -53,7 +53,7 @@ protected:
virtual bool isSlotEmpty(ESceneSection eSection, int iSlot);
virtual void adjustPointerForSafeZone();
virtual UIControl *getSection(ESceneSection eSection) { return nullptr; }
virtual UIControl *getSection(ESceneSection eSection) { return NULL; }
virtual int GetBaseSlotCount() { return 0; }
public:

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 = static_cast<AnvilScreenInput *>(_initData);
AnvilScreenInput *initData = (AnvilScreenInput *)_initData;
m_inventory = initData->inventory;
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[iPad] != nullptr )
if( pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Anvil_Menu, this);
}
@@ -263,7 +263,7 @@ void UIScene_AnvilMenu::setSectionSelectedSlot(ESceneSection eSection, int x, in
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionAnvilItem1:
@@ -291,7 +291,7 @@ void UIScene_AnvilMenu::setSectionSelectedSlot(ESceneSection eSection, int x, in
UIControl *UIScene_AnvilMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionAnvilItem1:
@@ -334,7 +334,7 @@ void UIScene_AnvilMenu::onDirectEditFinished(UIControl_TextInput *input, UIContr
int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
UIScene_AnvilMenu *pClass=static_cast<UIScene_AnvilMenu *>(lpParam);
UIScene_AnvilMenu *pClass=(UIScene_AnvilMenu *)lpParam;
pClass->setIgnoreInput(false);
if (bRes)
@@ -343,8 +343,8 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
uint16_t pchText[128];
ZeroMemory(pchText, 128 * sizeof(uint16_t));
Win64_GetKeyboardText(pchText, 128);
pClass->setEditNameValue(reinterpret_cast<wchar_t *>(pchText));
pClass->m_itemName = reinterpret_cast<wchar_t *>(pchText);
pClass->setEditNameValue((wchar_t *)pchText);
pClass->m_itemName = (wchar_t *)pchText;
pClass->updateItemName();
#else
uint16_t pchText[128];
@@ -395,7 +395,7 @@ void UIScene_AnvilMenu::handleEditNamePressed()
break;
}
#else
InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),static_cast<DWORD>(m_iPad),30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
#endif
#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 = static_cast<BeaconScreenInput *>(_initData);
BeaconScreenInput *initData = (BeaconScreenInput *)_initData;
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Beacon_Menu, this);
}
@@ -254,7 +254,7 @@ void UIScene_BeaconMenu::setSectionSelectedSlot(ESceneSection eSection, int x, i
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionBeaconItem:
@@ -276,7 +276,7 @@ void UIScene_BeaconMenu::setSectionSelectedSlot(ESceneSection eSection, int x, i
UIControl *UIScene_BeaconMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionBeaconItem:
@@ -324,11 +324,11 @@ UIControl *UIScene_BeaconMenu::getSection(ESceneSection eSection)
void UIScene_BeaconMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
shared_ptr<ItemInstance> item = nullptr;
int slotId = -1;
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
if(slotId >= 0 && slotId >= m_menu->getSize() )
{
@@ -336,22 +336,22 @@ void UIScene_BeaconMenu::customDraw(IggyCustomDrawCallbackRegion *region)
switch(icon)
{
case 0:
item = std::make_shared<ItemInstance>(Item::emerald);
item = shared_ptr<ItemInstance>(new ItemInstance(Item::emerald) );
break;
case 1:
item = std::make_shared<ItemInstance>(Item::diamond);
item = shared_ptr<ItemInstance>(new ItemInstance(Item::diamond) );
break;
case 2:
item = std::make_shared<ItemInstance>(Item::goldIngot);
item = shared_ptr<ItemInstance>(new ItemInstance(Item::goldIngot) );
break;
case 3:
item = std::make_shared<ItemInstance>(Item::ironIngot);
item = shared_ptr<ItemInstance>(new ItemInstance(Item::ironIngot) );
break;
default:
assert(false);
break;
};
if(item != nullptr) customDrawSlotControl(region,m_iPad,item,1.0f,item->isFoil(),true);
if(item != NULL) customDrawSlotControl(region,m_iPad,item,1.0f,item->isFoil(),true);
}
else
{

View File

@@ -14,15 +14,15 @@ 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 = static_cast<BrewingScreenInput *>(_initData);
BrewingScreenInput *initData = (BrewingScreenInput *)_initData;
m_brewingStand = initData->brewingStand;
m_labelBrewingStand.init( m_brewingStand->getName() );
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Brewing_Menu, this);
}
@@ -249,7 +249,7 @@ void UIScene_BrewingStandMenu::setSectionSelectedSlot(ESceneSection eSection, in
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionBrewingBottle1:
@@ -280,7 +280,7 @@ void UIScene_BrewingStandMenu::setSectionSelectedSlot(ESceneSection eSection, in
UIControl *UIScene_BrewingStandMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionBrewingBottle1:

View File

@@ -15,7 +15,7 @@ UIScene_ConnectingProgress::UIScene_ConnectingProgress(int iPad, void *_initData
m_progressBar.setVisible( false );
m_labelTip.setVisible( false );
ConnectionProgressParams *param = static_cast<ConnectionProgressParams *>(_initData);
ConnectionProgressParams *param = (ConnectionProgressParams *)_initData;
if( param->stringId >= 0 )
{
@@ -210,7 +210,7 @@ void UIScene_ConnectingProgress::handleInput(int iPad, int key, bool repeat, boo
// 4J-PB - Removed the option to cancel join - it didn't work anyway
// case ACTION_MENU_CANCEL:
// {
// if(m_cancelFunc != nullptr)
// if(m_cancelFunc != NULL)
// {
// m_cancelFunc(m_cancelFuncParam);
// }
@@ -245,7 +245,7 @@ void UIScene_ConnectingProgress::handleInput(int iPad, int key, bool repeat, boo
void UIScene_ConnectingProgress::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((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 = static_cast<ContainerScreenInput *>(_initData);
ContainerScreenInput *initData = (ContainerScreenInput *)_initData;
m_bLargeChest = (initData->container->getContainerSize() > 3*9)?true:false;
// Setup all the Iggy references we need for this scene
@@ -24,9 +24,9 @@ UIScene_ContainerMenu::UIScene_ContainerMenu(int iPad, void *_initData, UILayer
ContainerMenu* menu = new ContainerMenu( initData->inventory, initData->container );
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[iPad] != nullptr )
if( pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Container_Menu, this);
}
@@ -181,7 +181,7 @@ void UIScene_ContainerMenu::setSectionSelectedSlot(ESceneSection eSection, int x
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionContainerChest:
@@ -203,7 +203,7 @@ void UIScene_ContainerMenu::setSectionSelectedSlot(ESceneSection eSection, int x
UIControl *UIScene_ContainerMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionContainerChest:

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 = static_cast<F64>(0);
value[0].number = (F64)0;
#elif defined(_DURANGO)
value[0].number = (F64)1;
#elif defined(__PS3__)
@@ -25,7 +25,7 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa
#endif
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetPlatform , 1 , value );
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
@@ -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 = static_cast<F64>(m_iCurrentNavigatedControlsLayout);
value[0].number = (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(static_cast<int>(controlId))
switch((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 = static_cast<int>(controlId);
int control = (int)controlId;
switch(control)
{
case eControl_Button0:
case eControl_Button1:
case eControl_Button2:
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,static_cast<unsigned char>(control));
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,(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 = static_cast<int>(controlId);
int control = (int)controlId;
switch(control)
{
case eControl_Button0:

View File

@@ -22,7 +22,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p
#endif
m_bIgnoreKeyPresses = false;
CraftingPanelScreenInput* initData = static_cast<CraftingPanelScreenInput *>(_initData);
CraftingPanelScreenInput* initData = (CraftingPanelScreenInput*)_initData;
m_iContainerType=initData->iContainerType;
m_pPlayer=initData->player;
m_bSplitscreen=initData->bSplitscreen;
@@ -117,9 +117,9 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p
// Update the tutorial state
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[m_iPad] != nullptr )
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
if(m_iContainerType==RECIPE_TYPE_2x2)
{
@@ -198,14 +198,14 @@ void UIScene_CraftingMenu::handleDestroy()
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[m_iPad] != nullptr )
if( pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
if(gameMode != nullptr) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState);
}
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
if(Minecraft::GetInstance()->localplayers[m_iPad] != nullptr && Minecraft::GetInstance()->localplayers[m_iPad]->containerMenu->containerId == m_menu->containerId)
if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL && Minecraft::GetInstance()->localplayers[m_iPad]->containerMenu->containerId == m_menu->containerId)
{
Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer();
}
@@ -525,14 +525,14 @@ void UIScene_CraftingMenu::handleReload()
void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
shared_ptr<ItemInstance> item = nullptr;
int slotId = -1;
float alpha = 1.0f;
bool decorations = true;
bool inventoryItem = false;
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
if (slotId == -1)
{
app.DebugPrintf("This is not the control we are looking for\n");
@@ -560,7 +560,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_vSlotsInfo[iIndex].show)
{
item = m_vSlotsInfo[iIndex].item;
alpha = static_cast<float>(m_vSlotsInfo[iIndex].alpha)/31.0f;
alpha = ((float)m_vSlotsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId >= CRAFTING_H_SLOT_START && slotId < (CRAFTING_H_SLOT_START + m_iCraftablesMaxHSlotC) )
@@ -596,7 +596,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_hSlotsInfo[iIndex].show)
{
item = m_hSlotsInfo[iIndex].item;
alpha = static_cast<float>(m_hSlotsInfo[iIndex].alpha)/31.0f;
alpha = ((float)m_hSlotsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId >= CRAFTING_INGREDIENTS_LAYOUT_START && slotId < (CRAFTING_INGREDIENTS_LAYOUT_START + m_iIngredientsMaxSlotC) )
@@ -605,7 +605,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_ingredientsSlotsInfo[iIndex].show)
{
item = m_ingredientsSlotsInfo[iIndex].item;
alpha = static_cast<float>(m_ingredientsSlotsInfo[iIndex].alpha)/31.0f;
alpha = ((float)m_ingredientsSlotsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId >= CRAFTING_INGREDIENTS_DESCRIPTION_START && slotId < (CRAFTING_INGREDIENTS_DESCRIPTION_START + 4) )
@@ -614,7 +614,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_ingredientsInfo[iIndex].show)
{
item = m_ingredientsInfo[iIndex].item;
alpha = static_cast<float>(m_ingredientsInfo[iIndex].alpha)/31.0f;
alpha = ((float)m_ingredientsInfo[iIndex].alpha)/31.0f;
}
}
else if(slotId == CRAFTING_OUTPUT_SLOT_START )
@@ -622,11 +622,11 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
if(m_craftingOutputSlotInfo.show)
{
item = m_craftingOutputSlotInfo.item;
alpha = static_cast<float>(m_craftingOutputSlotInfo.alpha)/31.0f;
alpha = ((float)m_craftingOutputSlotInfo.alpha)/31.0f;
}
}
if(item != nullptr)
if(item != NULL)
{
if(!inventoryItem)
{
@@ -742,7 +742,7 @@ void UIScene_CraftingMenu::setCraftingOutputSlotItem(int iPad, shared_ptr<ItemIn
{
m_craftingOutputSlotInfo.item = item;
m_craftingOutputSlotInfo.alpha = 31;
m_craftingOutputSlotInfo.show = item != nullptr;
m_craftingOutputSlotInfo.show = item != NULL;
}
void UIScene_CraftingMenu::setCraftingOutputSlotRedBox(bool show)
@@ -754,7 +754,7 @@ void UIScene_CraftingMenu::setIngredientSlotItem(int iPad, int index, shared_ptr
{
m_ingredientsSlotsInfo[index].item = item;
m_ingredientsSlotsInfo[index].alpha = 31;
m_ingredientsSlotsInfo[index].show = item != nullptr;
m_ingredientsSlotsInfo[index].show = item != NULL;
}
void UIScene_CraftingMenu::setIngredientSlotRedBox(int index, bool show)
@@ -766,7 +766,7 @@ void UIScene_CraftingMenu::setIngredientDescriptionItem(int iPad, int index, sha
{
m_ingredientsInfo[index].item = item;
m_ingredientsInfo[index].alpha = 31;
m_ingredientsInfo[index].show = item != nullptr;
m_ingredientsInfo[index].show = item != NULL;
IggyDataValue result;
IggyDataValue value[2];

View File

@@ -82,7 +82,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
m_bGameModeCreative = false;
m_iGameModeId = GameType::SURVIVAL->getId();
m_pDLCPack = nullptr;
m_pDLCPack = NULL;
m_bRebuildTouchBoxes = false;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
@@ -96,7 +96,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
// #ifdef __PS3__
// if(ProfileManager.IsSignedInLive( m_iPad ))
// {
// ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,nullptr);
// ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,NULL);
// }
// #endif
@@ -184,7 +184,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
#if TO_BE_IMPLEMENTED
// 4J-PB - there may be texture packs we don't have, so use the info from TMS for this
DLC_INFO *pDLCInfo=nullptr;
DLC_INFO *pDLCInfo=NULL;
// first pass - look to see if there are any that are not in the list
bool bTexturePackAlreadyListed;
@@ -289,6 +289,7 @@ void UIScene_CreateWorldMenu::tick()
{
UIScene::tick();
if(m_iSetTexturePackDescription >= 0 )
{
UpdateTexturePackDescription( m_iSetTexturePackDescription );
@@ -431,7 +432,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_EditWorldName:
{
@@ -481,7 +482,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
break;
case eControl_TexturePackList:
{
UpdateCurrentTexturePack(static_cast<int>(childId));
UpdateCurrentTexturePack((int)childId);
}
break;
case eControl_NewWorld:
@@ -527,7 +528,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);
if(pTexturePack==nullptr)
if(pTexturePack==NULL)
{
#if TO_BE_IMPLEMENTED
// They've selected a texture pack they don't have yet
@@ -577,7 +578,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=static_cast<DLCTexturePack *>(pTexturePack);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack;
m_pDLCPack=pDLCTexPack->getDLCInfoParentPack();
// do we have a license?
@@ -605,7 +606,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId());
ULONGLONG ullOfferID_Full;
if(pDLCInfo!=nullptr)
if(pDLCInfo!=NULL)
{
ullOfferID_Full=pDLCInfo->ullOfferID_Full;
}
@@ -648,8 +649,8 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
WCHAR TempString[256];
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
int value = (int)currentValue;
switch((int)sliderId)
{
case eControl_Difficulty:
m_sliderDifficulty.handleSliderMove(value);
@@ -724,7 +725,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
if(m_iConfigA[i]!=-1)
{
DWORD dwBytes=0;
PBYTE pbData=nullptr;
PBYTE pbData=NULL;
//app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]);
app.GetTPD(m_iConfigA[i],&pbData,&dwBytes);
@@ -733,7 +734,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
if(dwBytes > 0 && pbData)
{
DWORD dwImageBytes=0;
PBYTE pbImageData=nullptr;
PBYTE pbImageData=NULL;
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
ListInfo.fEnabled = TRUE;
@@ -763,7 +764,7 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack)
int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes)
{
UIScene_CreateWorldMenu *pClass=static_cast<UIScene_CreateWorldMenu *>(lpParam);
UIScene_CreateWorldMenu *pClass=(UIScene_CreateWorldMenu *)lpParam;
pClass->m_bIgnoreInput=false;
// 4J HEG - No reason to set value if keyboard was cancelled
if (bRes)
@@ -890,7 +891,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -910,7 +911,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
return;
}
}
@@ -950,7 +951,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
#if defined(__PS3__) || defined(__PSVITA__)
if(isOnlineGame && isSignedInLive)
{
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,NULL,&bContentRestricted,NULL);
}
#endif
@@ -979,7 +980,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -997,7 +998,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
}
#endif
@@ -1039,7 +1040,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -1061,7 +1062,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
}
#endif
@@ -1071,7 +1072,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
if(isOnlineGame)
{
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
@@ -1135,7 +1136,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
if (wSeed.length() != 0)
{
int64_t value = 0;
unsigned int len = static_cast<unsigned int>(wSeed.length());
unsigned int len = (unsigned int)wSeed.length();
//Check if the input string contains a numerical value
bool isNumber = true;
@@ -1173,7 +1174,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
param->seed = seedValue;
param->saveData = nullptr;
param->saveData = NULL;
param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack;
Minecraft *pMinecraft = Minecraft::GetInstance();
@@ -1209,8 +1210,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 = static_cast<EGameHostOptionWorldSize>(pClass->m_MoreOptionsParams.worldSize + 1);
pClass->m_MoreOptionsParams.newWorldSize = static_cast<EGameHostOptionWorldSize>(pClass->m_MoreOptionsParams.worldSize + 1);
pClass->m_MoreOptionsParams.currentWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1);
pClass->m_MoreOptionsParams.newWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1);
#endif
g_NetworkManager.HostGame(dwLocalUsersMask,isClientSide,isPrivate,MINECRAFT_NET_MAX_PLAYERS,0);
@@ -1252,7 +1253,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
loadingParams->lpParam = (LPVOID)param;
// Reset the autosave time
app.SetAutosaveTimerTime();
@@ -1270,7 +1271,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_CreateWorldMenu* pClass = static_cast<UIScene_CreateWorldMenu *>(pParam);
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
if(bContinue==true)
{
@@ -1378,7 +1379,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu
int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_CreateWorldMenu* pClass = static_cast<UIScene_CreateWorldMenu *>(pParam);
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
@@ -1431,7 +1432,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
if(isOnlineGame)
{
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );

View File

@@ -19,9 +19,9 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p
// Setup all the Iggy references we need for this scene
initialiseMovie();
InventoryScreenInput *initData = static_cast<InventoryScreenInput *>(_initData);
InventoryScreenInput *initData = (InventoryScreenInput *)_initData;
shared_ptr<SimpleContainer> creativeContainer = std::make_shared<SimpleContainer>(0, L"", false, TabSpec::MAX_SIZE);
shared_ptr<SimpleContainer> creativeContainer = shared_ptr<SimpleContainer>(new SimpleContainer( 0, L"", false, TabSpec::MAX_SIZE ));
itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory);
Initialize( initData->iPad, itemPickerMenu, false, -1, eSectionInventoryCreativeUsing, eSectionInventoryCreativeMax, initData->bNavigateBack);
@@ -42,9 +42,9 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p
}
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (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 = static_cast<ECreativeInventoryTabs>((int)eCreativeInventoryTab_BuildingBlocks + (int)eSection - (int)eSectionInventoryCreativeTab_0);
ECreativeInventoryTabs tab = (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 = static_cast<ECreativeInventoryTabs>(m_curTab + dir);
if (tab < 0) tab = static_cast<ECreativeInventoryTabs>(eCreativeInventoryTab_COUNT - 1);
ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir);
if (tab < 0) tab = (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 = static_cast<F64>(tab);
value[0].number = (F64)tab;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ) , m_funcSetActiveTab , 1 , value );
@@ -400,7 +400,7 @@ void UIScene_CreativeMenu::setSectionSelectedSlot(ESceneSection eSection, int x,
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionInventoryCreativeSelector:
@@ -419,7 +419,7 @@ void UIScene_CreativeMenu::setSectionSelectedSlot(ESceneSection eSection, int x,
UIControl *UIScene_CreativeMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionInventoryCreativeSelector:
@@ -468,10 +468,10 @@ void UIScene_CreativeMenu::updateScrollCurrentPage(int currentPage, int pageCoun
IggyDataValue value[2];
value[0].type = IGGY_DATATYPE_number;
value[0].number = static_cast<F64>(pageCount);
value[0].number = (F64)pageCount;
value[1].type = IGGY_DATATYPE_number;
value[1].number = static_cast<F64>(currentPage) - 1;
value[1].number = (F64)currentPage - 1;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ) , m_funcSetScrollBar , 2 , value );
}

View File

@@ -593,11 +593,11 @@ void UIScene_Credits::tick()
}
// Set up the new text element.
if(pDef->m_Text!=nullptr) // 4J-PB - think the RAD logo ones aren't set up yet and are coming is as null
if(pDef->m_Text!=NULL) // 4J-PB - think the RAD logo ones aren't set up yet and are coming is as null
{
if ( pDef->m_iStringID[0] == CREDIT_ICON )
{
addImage(static_cast<ECreditIcons>(pDef->m_iStringID[1]));
addImage((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 = static_cast<int>(size);
value[1].number = (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 = static_cast<int>(icon);
value[0].number = (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(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_OffersList:
{
int iIndex = static_cast<int>(childId);
int iIndex = (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(static_cast<eDLCMarketplaceType>(iIndex), true);
app.AddDLCRequest((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 = static_cast<UIScene_DLCMainMenu *>(pParam);
UIScene_DLCMainMenu* pClass = (UIScene_DLCMainMenu*)pParam;
#if defined __ORBIS__ || defined __PSVITA__
app.GetCommerce()->HidePsStoreIcon();

View File

@@ -16,12 +16,12 @@
UIScene_DLCOffersMenu::UIScene_DLCOffersMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
{
m_bProductInfoShown=false;
DLCOffersParam *param=static_cast<DLCOffersParam *>(initData);
DLCOffersParam *param=(DLCOffersParam *)initData;
m_iProductInfoIndex=param->iType;
m_iCurrentDLC=0;
m_iTotalDLC=0;
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
m_pvProductInfo=nullptr;
m_pvProductInfo=NULL;
#endif
m_bAddAllDLCButtons=true;
@@ -51,7 +51,7 @@ UIScene_DLCOffersMenu::UIScene_DLCOffersMenu(int iPad, void *initData, UILayer *
}
#ifdef _DURANGO
m_pNoImageFor_DLC = nullptr;
m_pNoImageFor_DLC = NULL;
// If we don't yet have this DLC, we need to display a timer
m_bDLCRequiredIsRetrieved=false;
m_bIgnorePress=true;
@@ -103,7 +103,7 @@ void UIScene_DLCOffersMenu::handleTimerComplete(int id)
int UIScene_DLCOffersMenu::ExitDLCOffersMenu(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_DLCOffersMenu* pClass = static_cast<UIScene_DLCOffersMenu *>(pParam);
UIScene_DLCOffersMenu* pClass = (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(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_OffersList:
{
@@ -261,13 +261,13 @@ void UIScene_DLCOffersMenu::handlePress(F64 controlId, F64 childId)
#endif // __PS3__
#elif defined _XBOX_ONE
int iIndex = (int)childId;
StorageManager.InstallOffer(1,StorageManager.GetOffer(iIndex).wszProductID,nullptr,nullptr);
StorageManager.InstallOffer(1,StorageManager.GetOffer(iIndex).wszProductID,NULL,NULL);
#else
int iIndex = static_cast<int>(childId);
int iIndex = (int)childId;
ULONGLONG ullIndexA[1];
ullIndexA[0]=StorageManager.GetOffer(iIndex).qwOfferID;
StorageManager.InstallOffer(1,ullIndexA,nullptr,nullptr);
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
#endif
}
break;
@@ -343,10 +343,10 @@ void UIScene_DLCOffersMenu::tick()
{
m_bAddAllDLCButtons=false;
// add the categories to the list box
if(m_pvProductInfo==nullptr)
if(m_pvProductInfo==NULL)
{
m_pvProductInfo=app.GetProductList(m_iProductInfoIndex);
if(m_pvProductInfo==nullptr)
if(m_pvProductInfo==NULL)
{
m_iTotalDLC=0;
// need to display text to say no downloadable content available yet
@@ -690,7 +690,7 @@ void UIScene_DLCOffersMenu::GetDLCInfo( int iOfferC, bool bUpdateOnly )
// Check that this is in the list of known DLC
DLC_INFO *pDLC=app.GetDLCInfoForFullOfferID(xOffer.wszProductID);
if(pDLC!=nullptr)
if(pDLC!=NULL)
{
OrderA[uiDLCCount].uiContentIndex=i;
OrderA[uiDLCCount++].uiSortIndex=pDLC->uiSortIndex;
@@ -710,7 +710,7 @@ void UIScene_DLCOffersMenu::GetDLCInfo( int iOfferC, bool bUpdateOnly )
// Check that this is in the list of known DLC
DLC_INFO *pDLC=app.GetDLCInfoForFullOfferID(xOffer.wszProductID);
if(pDLC==nullptr)
if(pDLC==NULL)
{
// skip this one
app.DebugPrintf("Unknown offer - %ls\n",xOffer.wszOfferName);
@@ -736,7 +736,7 @@ void UIScene_DLCOffersMenu::GetDLCInfo( int iOfferC, bool bUpdateOnly )
// find the DLC in the installed packages
XCONTENT_DATA *pContentData=StorageManager.GetInstalledDLC(xOffer.wszProductID);
if(pContentData!=nullptr)
if(pContentData!=NULL)
{
m_buttonListOffers.addItem(wstrTemp,!pContentData->bTrialLicense,OrderA[i].uiContentIndex);
}
@@ -809,7 +809,7 @@ bool UIScene_DLCOffersMenu::UpdateDisplay(MARKETPLACE_CONTENTOFFER_INFO& xOffer)
DLC_INFO *dlc = app.GetDLCInfoForFullOfferID(xOffer.wszOfferName);
#endif
if (dlc != nullptr)
if (dlc != NULL)
{
WCHAR *cString = dlc->wchBanner;
@@ -844,7 +844,7 @@ bool UIScene_DLCOffersMenu::UpdateDisplay(MARKETPLACE_CONTENTOFFER_INFO& xOffer)
{
if(hasRegisteredSubstitutionTexture(cString)==false)
{
BYTE *pData=nullptr;
BYTE *pData=NULL;
DWORD dwSize=0;
app.GetMemFileDetails(cString,&pData,&dwSize);
// set the image

View File

@@ -18,9 +18,9 @@ UIScene_DeathMenu::UIScene_DeathMenu(int iPad, void *initData, UILayer *parentLa
m_bIgnoreInput = false;
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != nullptr && pMinecraft->localgameModes[iPad] != nullptr )
if(pMinecraft != NULL && pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[iPad];
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(false);
@@ -30,9 +30,9 @@ UIScene_DeathMenu::UIScene_DeathMenu(int iPad, void *initData, UILayer *parentLa
UIScene_DeathMenu::~UIScene_DeathMenu()
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != nullptr && pMinecraft->localgameModes[m_iPad] != nullptr )
if(pMinecraft != NULL && pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
TutorialMode *gameMode = (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(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Respawn:
m_bIgnoreInput = true;
@@ -104,9 +104,9 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId)
{
UINT uiIDA[3];
int playTime = -1;
if( pMinecraft->localplayers[m_iPad] != nullptr )
if( pMinecraft->localplayers[m_iPad] != NULL )
{
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
playTime = (int)pMinecraft->localplayers[m_iPad]->getSessionTimer();
}
TelemetryManager->RecordLevelExit(m_iPad, eSen_LevelExitStatus_Failed);

View File

@@ -132,96 +132,82 @@ void UIScene_DebugCreateSchematic::handleInput(int iPad, int key, bool repeat, b
void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId)
{
#ifdef _WINDOWS64
if (isDirectEditBlocking())
return;
if (isDirectEditBlocking()) return;
#endif
switch((int)controlId)
{
case eControl_Create:
{
// We want the start to be even
if(m_data->startX > 0 && m_data->startX%2 != 0)
m_data->startX-=1;
else if(m_data->startX < 0 && m_data->startX%2 !=0)
m_data->startX-=1;
if(m_data->startY < 0) m_data->startY = 0;
else if(m_data->startY > 0 && m_data->startY%2 != 0)
m_data->startY-=1;
if(m_data->startZ > 0 && m_data->startZ%2 != 0)
m_data->startZ-=1;
else if(m_data->startZ < 0 && m_data->startZ%2 !=0)
m_data->startZ-=1;
switch (static_cast<int>(controlId))
{
case eControl_Create:
{
// We want the start to be even
if (m_data->startX > 0 && m_data->startX % 2 != 0)
m_data->startX -= 1;
else if (m_data->startX < 0 && m_data->startX % 2 != 0)
m_data->startX -= 1;
// We want the end to be odd to have a total size that is even
if(m_data->endX > 0 && m_data->endX%2 == 0)
m_data->endX+=1;
else if(m_data->endX < 0 && m_data->endX%2 ==0)
m_data->endX+=1;
if(m_data->endY > Level::maxBuildHeight)
m_data->endY = Level::maxBuildHeight;
else if(m_data->endY > 0 && m_data->endY%2 == 0)
m_data->endY+=1;
else if(m_data->endY < 0 && m_data->endY%2 ==0)
m_data->endY+=1;
if(m_data->endZ > 0 && m_data->endZ%2 == 0)
m_data->endZ+=1;
else if(m_data->endZ < 0 && m_data->endZ%2 ==0)
m_data->endZ+=1;
if (m_data->startY < 0)
m_data->startY = 0;
else if (m_data->startY > 0 && m_data->startY % 2 != 0)
m_data->startY -= 1;
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(), eXuiServerAction_ExportSchematic, (void *)m_data);
if (m_data->startZ > 0 && m_data->startZ % 2 != 0)
m_data->startZ -= 1;
else if (m_data->startZ < 0 && m_data->startZ % 2 != 0)
m_data->startZ -= 1;
// We want the end to be odd to have a total size that is even
if (m_data->endX > 0 && m_data->endX % 2 == 0)
m_data->endX += 1;
else if (m_data->endX < 0 && m_data->endX % 2 == 0)
m_data->endX += 1;
if (m_data->endY > Level::maxBuildHeight)
m_data->endY = Level::maxBuildHeight;
else if (m_data->endY > 0 && m_data->endY % 2 == 0)
m_data->endY += 1;
else if (m_data->endY < 0 && m_data->endY % 2 == 0)
m_data->endY += 1;
if (m_data->endZ > 0 && m_data->endZ % 2 == 0)
m_data->endZ += 1;
else if (m_data->endZ < 0 && m_data->endZ % 2 == 0)
m_data->endZ += 1;
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(), eXuiServerAction_ExportSchematic, static_cast<void*>(m_data));
navigateBack();
}
break;
case eControl_Name:
case eControl_StartX:
case eControl_StartY:
case eControl_StartZ:
case eControl_EndX:
case eControl_EndY:
case eControl_EndZ:
{
m_keyboardCallbackControl = static_cast<eControls>(static_cast<int>(controlId));
navigateBack();
}
break;
case eControl_Name:
case eControl_StartX:
case eControl_StartY:
case eControl_StartZ:
case eControl_EndX:
case eControl_EndY:
case eControl_EndZ:
{
m_keyboardCallbackControl = (eControls)((int)controlId);
#ifdef _WINDOWS64
if (g_KBMInput.IsKBMActive())
{
UIControl_TextInput* input = getTextInputForControl(m_keyboardCallbackControl);
if (input) input->beginDirectEdit(25);
}
else
{
UIKeyboardInitData kbData;
kbData.title = L"Enter something";
kbData.defaultText = L"";
kbData.maxChars = 25;
kbData.callback = &UIScene_DebugCreateSchematic::KeyboardCompleteCallback;
kbData.lpParam = this;
ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen);
}
if (g_KBMInput.IsKBMActive())
{
UIControl_TextInput* input = getTextInputForControl(m_keyboardCallbackControl);
if (input) input->beginDirectEdit(25);
}
else
{
UIKeyboardInitData kbData;
kbData.title = L"Enter something";
kbData.defaultText = L"";
kbData.maxChars = 25;
kbData.callback = &UIScene_DebugCreateSchematic::KeyboardCompleteCallback;
kbData.lpParam = this;
ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen);
}
#else
InputManager.RequestKeyboard(
L"Enter something",
L"",
static_cast<DWORD>(0),
25,
&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,
this,
C_4JInput::EKeyboardMode_Default);
InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
#endif
}
break;
}
}
break;
};
}
void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId, bool selected)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_SaveMobs:
m_data->bSaveMobs = selected;
@@ -237,7 +223,7 @@ void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId, bool sel
int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
UIScene_DebugCreateSchematic *pClass=static_cast<UIScene_DebugCreateSchematic *>(lpParam);
UIScene_DebugCreateSchematic *pClass=(UIScene_DebugCreateSchematic *)lpParam;
#ifdef _WINDOWS64
uint16_t pchText[128];

View File

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

View File

@@ -17,7 +17,7 @@ UIScene_DebugSetCamera::UIScene_DebugSetCamera(int iPad, void *initData, UILayer
currentPosition->player = playerNo;
Minecraft *pMinecraft = Minecraft::GetInstance();
if (pMinecraft != nullptr)
if (pMinecraft != NULL)
{
Vec3 *vec = pMinecraft->localplayers[playerNo]->getPos(1.0);
@@ -143,7 +143,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
#ifdef _WINDOWS64
if (isDirectEditBlocking()) return;
#endif
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Teleport:
app.SetXuiServerAction( ProfileManager.GetPrimaryPad(),
@@ -155,7 +155,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
case eControl_CamZ:
case eControl_YRot:
case eControl_Elevation:
m_keyboardCallbackControl = static_cast<eControls>(static_cast<int>(controlId));
m_keyboardCallbackControl = (eControls)((int)controlId);
#ifdef _WINDOWS64
if (g_KBMInput.IsKBMActive())
{
@@ -173,7 +173,6 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen);
}
#else
>>>>>>> origin/main
InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugSetCamera::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
#endif
break;
@@ -182,7 +181,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_LockPlayer:
app.SetFreezePlayers(selected);
@@ -192,19 +191,18 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected)
int UIScene_DebugSetCamera::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
UIScene_DebugSetCamera *pClass=static_cast<UIScene_DebugSetCamera *>(lpParam);
UIScene_DebugSetCamera *pClass=(UIScene_DebugSetCamera *)lpParam;
uint16_t pchText[2048];
ZeroMemory(pchText, 2048 * sizeof(uint16_t));
#ifdef _WINDOWS64
Win64_GetKeyboardText(pchText, 2048);
#else
>>>>>>> origin/main
InputManager.GetText(pchText);
#endif
if(pchText[0]!=0)
{
wstring value = reinterpret_cast<wchar_t*>(pchText);
wstring value = (wchar_t *)pchText;
double val = 0;
if(!value.empty()) val = _fromString<double>( value );
switch(pClass->m_keyboardCallbackControl)

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 = static_cast<TrapScreenInput *>(_initData);
TrapScreenInput *initData = (TrapScreenInput *)_initData;
m_labelDispenser.init(initData->trap->getName());
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Trap_Menu, this);
}
@@ -156,7 +156,7 @@ void UIScene_DispenserMenu::setSectionSelectedSlot(ESceneSection eSection, int x
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionTrapTrap:
@@ -177,7 +177,7 @@ void UIScene_DispenserMenu::setSectionSelectedSlot(ESceneSection eSection, int x
UIControl *UIScene_DispenserMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionTrapTrap:

View File

@@ -48,8 +48,8 @@ UIScene_EULA::UIScene_EULA(int iPad, void *initData, UILayer *parentLayer) : UIS
#endif
vector<wstring> paragraphs;
size_t lastIndex = 0;
for ( size_t index = EULA.find(L"\r\n", lastIndex, 2);
int lastIndex = 0;
for ( int index = EULA.find(L"\r\n", lastIndex, 2);
index != wstring::npos;
index = EULA.find(L"\r\n", lastIndex, 2)
)
@@ -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(static_cast<int>(controlId))
switch((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 = static_cast<EnchantingScreenInput *>(_initData);
EnchantingScreenInput *initData = (EnchantingScreenInput *)_initData;
m_labelEnchant.init( initData->name.empty() ? app.GetString(IDS_ENCHANT) : initData->name );
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Enchanting_Menu, this);
}
@@ -194,7 +194,7 @@ void UIScene_EnchantingMenu::setSectionSelectedSlot(ESceneSection eSection, int
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionEnchantSlot:
@@ -216,7 +216,7 @@ void UIScene_EnchantingMenu::setSectionSelectedSlot(ESceneSection eSection, int
UIControl *UIScene_EnchantingMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionEnchantSlot:
@@ -247,7 +247,7 @@ UIControl *UIScene_EnchantingMenu::getSection(ESceneSection eSection)
void UIScene_EnchantingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
if(wcscmp((wchar_t *)region->name,L"EnchantmentBook")==0)
@@ -264,7 +264,7 @@ void UIScene_EnchantingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
else
{
int slotId = -1;
swscanf(static_cast<wchar_t *>(region->name),L"slot_Button%d",&slotId);
swscanf((wchar_t*)region->name,L"slot_Button%d",&slotId);
if(slotId >= 0)
{
// Setup GDraw, normal game render states and matrices

View File

@@ -50,7 +50,7 @@ UIScene_EndPoem::UIScene_EndPoem(int iPad, void *initData, UILayer *parentLayer)
Minecraft *pMinecraft = Minecraft::GetInstance();
wstring playerName = L"";
if(pMinecraft->localplayers[ui.GetWinUserIndex()] != nullptr)
if(pMinecraft->localplayers[ui.GetWinUserIndex()] != NULL)
{
playerName = escapeXML( pMinecraft->localplayers[ui.GetWinUserIndex()]->getDisplayName() );
}
@@ -159,14 +159,14 @@ void UIScene_EndPoem::handleInput(int iPad, int key, bool repeat, bool pressed,
Minecraft *pMinecraft = Minecraft::GetInstance();
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
{
if(pMinecraft->localplayers[i] != nullptr)
if(pMinecraft->localplayers[i] != NULL)
{
app.SetAction(i,eAppAction_Respawn);
}
}
// This just allows it to be shown
if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != nullptr) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(true);
if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != NULL) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(true);
updateTooltips();
navigateBack();
@@ -191,7 +191,7 @@ void UIScene_EndPoem::handleDestroy()
void UIScene_EndPoem::handleRequestMoreData(F64 startIndex, bool up)
{
m_requestedLabel = static_cast<int>(startIndex);
m_requestedLabel = (int)startIndex;
}
void UIScene_EndPoem::updateNoise()
@@ -221,13 +221,13 @@ void UIScene_EndPoem::updateNoise()
{
if (ui.UsingBitmapFont())
{
randomChar = SharedConstants::acceptableLetters[random->nextInt(static_cast<int>(SharedConstants::acceptableLetters.length()))];
randomChar = SharedConstants::acceptableLetters[random->nextInt((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(static_cast<int>(acceptableLetters.length())) ];
randomChar = acceptableLetters[ random->nextInt((int)acceptableLetters.length()) ];
}
wstring randomCharStr = L"";

View File

@@ -11,14 +11,14 @@ UIScene_FireworksMenu::UIScene_FireworksMenu(int iPad, void *_initData, UILayer
// Setup all the Iggy references we need for this scene
initialiseMovie();
FireworksScreenInput *initData = static_cast<FireworksScreenInput *>(_initData);
FireworksScreenInput *initData = (FireworksScreenInput *)_initData;
m_labelFireworks.init(app.GetString(IDS_HOW_TO_PLAY_MENU_FIREWORKS));
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Fireworks_Menu, this);
}
@@ -174,7 +174,7 @@ void UIScene_FireworksMenu::setSectionSelectedSlot(ESceneSection eSection, int x
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionFireworksIngredients:
@@ -198,7 +198,7 @@ void UIScene_FireworksMenu::setSectionSelectedSlot(ESceneSection eSection, int x
UIControl *UIScene_FireworksMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionFireworksIngredients:

View File

@@ -4,6 +4,7 @@
#include "..\..\Minecraft.h"
#include "..\..\ProgressRenderer.h"
UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
{
// Setup all the Iggy references we need for this scene
@@ -26,7 +27,7 @@ UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData,
m_buttonConfirm.init( app.GetString( IDS_CONFIRM_OK ), eControl_Confirm );
m_buttonConfirm.setVisible(false);
LoadingInputParams *params = static_cast<LoadingInputParams *>(initData);
LoadingInputParams *params = (LoadingInputParams *)initData;
m_CompletionData = params->completionData;
m_iPad=params->completionData->iPad;
@@ -101,7 +102,7 @@ void UIScene_FullscreenProgress::handleDestroy()
DWORD exitcode = *((DWORD *)&code);
// If we're active, have a cancel func, and haven't already cancelled, call cancel func
if( exitcode == STILL_ACTIVE && m_cancelFunc != nullptr && !m_bWasCancelled)
if( exitcode == STILL_ACTIVE && m_cancelFunc != NULL && !m_bWasCancelled)
{
m_bWasCancelled = true;
m_cancelFunc(m_cancelFuncParam);
@@ -223,7 +224,7 @@ void UIScene_FullscreenProgress::tick()
// This just allows it to be shown
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != nullptr) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(true);
if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != NULL) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(true);
ui.UpdatePlayerBasePositions();
navigateBack();
}
@@ -285,7 +286,7 @@ void UIScene_FullscreenProgress::handleInput(int iPad, int key, bool repeat, boo
break;
case ACTION_MENU_B:
case ACTION_MENU_CANCEL:
if( pressed && m_cancelFunc != nullptr && !m_bWasCancelled )
if( pressed && m_cancelFunc != NULL && !m_bWasCancelled )
{
m_bWasCancelled = true;
m_cancelFunc( m_cancelFuncParam );
@@ -297,7 +298,7 @@ void UIScene_FullscreenProgress::handleInput(int iPad, int key, bool repeat, boo
void UIScene_FullscreenProgress::handlePress(F64 controlId, F64 childId)
{
if(m_threadCompleted && static_cast<int>(controlId) == eControl_Confirm)
if(m_threadCompleted && (int)controlId == eControl_Confirm)
{
// This assumes all buttons can only be pressed with the A button
ui.AnimateKeyPress(m_iPad, ACTION_MENU_A, false, true, false);

View File

@@ -10,7 +10,7 @@ UIScene_FurnaceMenu::UIScene_FurnaceMenu(int iPad, void *_initData, UILayer *par
// Setup all the Iggy references we need for this scene
initialiseMovie();
FurnaceScreenInput *initData = static_cast<FurnaceScreenInput *>(_initData);
FurnaceScreenInput *initData = (FurnaceScreenInput *)_initData;
m_furnace = initData->furnace;
m_labelFurnace.init(m_furnace->getName());
@@ -21,9 +21,9 @@ UIScene_FurnaceMenu::UIScene_FurnaceMenu(int iPad, void *_initData, UILayer *par
m_progressFurnaceArrow.init(L"",0,0,24,0);
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Furnace_Menu, this);
}
@@ -202,7 +202,7 @@ void UIScene_FurnaceMenu::setSectionSelectedSlot(ESceneSection eSection, int x,
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionFurnaceResult:
@@ -230,7 +230,7 @@ void UIScene_FurnaceMenu::setSectionSelectedSlot(ESceneSection eSection, int x,
UIControl *UIScene_FurnaceMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionFurnaceResult:

View File

@@ -114,7 +114,7 @@ void UIScene_HUD::tick()
if(getMovie() && app.GetGameStarted())
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr)
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL)
{
return;
}
@@ -155,10 +155,10 @@ void UIScene_HUD::tick()
void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
int slot = -1;
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slot);
swscanf((wchar_t*)region->name,L"slot_%d",&slot);
if (slot == -1)
{
app.DebugPrintf("This is not the control we are looking for\n");
@@ -167,7 +167,7 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion *region)
{
Slot *invSlot = pMinecraft->localplayers[m_iPad]->inventoryMenu->getSlot(InventoryMenu::USE_ROW_SLOT_START + slot);
shared_ptr<ItemInstance> item = invSlot->getItem();
if(item != nullptr)
if(item != NULL)
{
unsigned char ucAlpha=app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_InterfaceOpacity);
float fVal;
@@ -180,8 +180,8 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion *region)
{
if(uiOpacityTimer<10)
{
float fStep=(80.0f-static_cast<float>(ucAlpha))/10.0f;
fVal=0.01f*(80.0f-((10.0f-static_cast<float>(uiOpacityTimer))*fStep));
float fStep=(80.0f-(float)ucAlpha)/10.0f;
fVal=0.01f*(80.0f-((10.0f-(float)uiOpacityTimer)*fStep));
}
else
{
@@ -190,12 +190,12 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion *region)
}
else
{
fVal=0.01f*static_cast<float>(ucAlpha);
fVal=0.01f*(float)ucAlpha;
}
}
else
{
fVal=0.01f*static_cast<float>(ucAlpha);
fVal=0.01f*(float)ucAlpha;
}
customDrawSlotControl(region,m_iPad,item,fVal,item->isFoil(),true);
}
@@ -254,7 +254,7 @@ void UIScene_HUD::handleReload()
int iGuiScale;
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localplayers[m_iPad]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN)
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localplayers[m_iPad]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN)
{
iGuiScale=app.GetGameSettings(m_iPad,eGameSetting_UISize);
}
@@ -595,7 +595,7 @@ void UIScene_HUD::SetSelectedLabel(const wstring &label)
void UIScene_HUD::HideSelectedLabel()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcHideSelectedLabel , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcHideSelectedLabel , 0 , NULL );
}
@@ -679,15 +679,15 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor
{
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
xPos = (S32)(ui.getScreenWidth() / 2);
yPos = (S32)(ui.getScreenHeight() / 2);
break;
}
ui.setupRenderPosition(xPos, yPos);
@@ -701,14 +701,14 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor
{
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
tileHeight = static_cast<S32>(ui.getScreenHeight());
tileHeight = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
tileWidth = static_cast<S32>(ui.getScreenWidth());
tileWidth = (S32)(ui.getScreenWidth());
tileYStart = (S32)(m_movieHeight / 2);
break;
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
@@ -744,7 +744,7 @@ void UIScene_HUD::handleTimerComplete(int id)
Minecraft *pMinecraft = Minecraft::GetInstance();
bool anyVisible = false;
if(pMinecraft->localplayers[m_iPad]!= nullptr)
if(pMinecraft->localplayers[m_iPad]!= NULL)
{
Gui *pGui = pMinecraft->gui;
//DWORD messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) );
@@ -802,11 +802,11 @@ void UIScene_HUD::repositionHud()
{
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
height = static_cast<S32>(ui.getScreenHeight());
height = (S32)(ui.getScreenHeight());
break;
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
width = static_cast<S32>(ui.getScreenWidth());
width = (S32)(ui.getScreenWidth());
break;
}
@@ -865,7 +865,7 @@ void UIScene_HUD::handleGameTick()
if(getMovie() && app.GetGameStarted())
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr)
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL)
{
m_parentLayer->showComponent(m_iPad, eUIScene_HUD,false);
return;

View File

@@ -8,7 +8,7 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void *initData,
// Setup all the Iggy references we need for this scene
initialiseMovie();
m_bNotInGame=(Minecraft::GetInstance()->level==nullptr);
m_bNotInGame=(Minecraft::GetInstance()->level==NULL);
m_buttons[BUTTON_HAO_CHANGESKIN].init(IDS_CHANGE_SKIN,BUTTON_HAO_CHANGESKIN);
m_buttons[BUTTON_HAO_HOWTOPLAY].init(IDS_HOW_TO_PLAY,BUTTON_HAO_HOWTOPLAY);
@@ -41,7 +41,7 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void *initData,
// 4J-PB - do not need a storage device to see this menu - just need one when you choose to re-install them
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
// any content to be re-installed?
if(m_iPad==ProfileManager.GetPrimaryPad() && bNotInGame)
@@ -103,7 +103,7 @@ void UIScene_HelpAndOptionsMenu::updateTooltips()
void UIScene_HelpAndOptionsMenu::updateComponents()
{
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
@@ -128,7 +128,7 @@ void UIScene_HelpAndOptionsMenu::handleReload()
#endif
// 4J-PB - do not need a storage device to see this menu - just need one when you choose to re-install them
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
// any content to be re-installed?
if(m_iPad==ProfileManager.GetPrimaryPad() && bNotInGame)
@@ -207,7 +207,7 @@ void UIScene_HelpAndOptionsMenu::handleInput(int iPad, int key, bool repeat, boo
void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case BUTTON_HAO_CHANGESKIN:
ui.NavigateToScene(m_iPad, eUIScene_SkinSelectMenu);

View File

@@ -10,14 +10,14 @@ UIScene_HopperMenu::UIScene_HopperMenu(int iPad, void *_initData, UILayer *paren
// Setup all the Iggy references we need for this scene
initialiseMovie();
HopperScreenInput *initData = static_cast<HopperScreenInput *>(_initData);
HopperScreenInput *initData = (HopperScreenInput *)_initData;
m_labelDispenser.init(initData->hopper->getName());
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Hopper_Menu, this);
}
@@ -156,7 +156,7 @@ void UIScene_HopperMenu::setSectionSelectedSlot(ESceneSection eSection, int x, i
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionHopperContents:
@@ -177,7 +177,7 @@ void UIScene_HopperMenu::setSectionSelectedSlot(ESceneSection eSection, int x, i
UIControl *UIScene_HopperMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionHopperContents:

View File

@@ -11,16 +11,16 @@ UIScene_HorseInventoryMenu::UIScene_HorseInventoryMenu(int iPad, void *_initData
// Setup all the Iggy references we need for this scene
initialiseMovie();
HorseScreenInput *initData = static_cast<HorseScreenInput *>(_initData);
HorseScreenInput *initData = (HorseScreenInput *)_initData;
m_labelHorse.init( initData->container->getName() );
m_inventory = initData->inventory;
m_horse = initData->horse;
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[iPad] != nullptr )
if( pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Horse_Menu, this);
}
@@ -240,7 +240,7 @@ void UIScene_HorseInventoryMenu::setSectionSelectedSlot(ESceneSection eSection,
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionHorseArmor:
@@ -268,7 +268,7 @@ void UIScene_HorseInventoryMenu::setSectionSelectedSlot(ESceneSection eSection,
UIControl *UIScene_HorseInventoryMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionHorseArmor:
@@ -296,7 +296,7 @@ UIControl *UIScene_HorseInventoryMenu::getSection(ESceneSection eSection)
void UIScene_HorseInventoryMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
if(wcscmp((wchar_t *)region->name,L"horse")==0)
{

View File

@@ -136,7 +136,7 @@ UIScene_HowToPlay::UIScene_HowToPlay(int iPad, void *initData, UILayer *parentLa
// Extract pad and required page from init data. We just put the data into the pointer rather than using it as an address.
size_t uiInitData = ( size_t )( initData );
EHowToPlayPage eStartPage = static_cast<EHowToPlayPage>((uiInitData >> 16) & 0xFFF); // Ignores MSB which is set to 1!
EHowToPlayPage eStartPage = ( EHowToPlayPage )( ( uiInitData >> 16 ) & 0xFFF ); // Ignores MSB which is set to 1!
TelemetryManager->RecordMenuShown(m_iPad, eUIScene_HowToPlay, (ETelemetry_HowToPlay_SubMenuId)eStartPage);
@@ -216,10 +216,10 @@ void UIScene_HowToPlay::handleInput(int iPad, int key, bool repeat, bool pressed
if(pressed)
{
// Next page
int iNextPage = static_cast<int>(m_eCurrPage) + 1;
int iNextPage = ( int )( m_eCurrPage ) + 1;
if ( iNextPage != eHowToPlay_NumPages )
{
StartPage( static_cast<EHowToPlayPage>(iNextPage) );
StartPage( ( EHowToPlayPage )( iNextPage ) );
ui.PlayUISFX(eSFX_Press);
}
handled = true;
@@ -229,7 +229,7 @@ void UIScene_HowToPlay::handleInput(int iPad, int key, bool repeat, bool pressed
if(pressed)
{
// Previous page
int iPrevPage = static_cast<int>(m_eCurrPage) - 1;
int iPrevPage = ( int )( m_eCurrPage ) - 1;
// 4J Stu - Add back for future platforms
#if 0
@@ -247,7 +247,7 @@ void UIScene_HowToPlay::handleInput(int iPad, int key, bool repeat, bool pressed
{
if ( iPrevPage >= 0 )
{
StartPage( static_cast<EHowToPlayPage>(iPrevPage) );
StartPage( ( EHowToPlayPage )( iPrevPage ) );
ui.PlayUISFX(eSFX_Press);
}
@@ -300,8 +300,8 @@ void UIScene_HowToPlay::StartPage( EHowToPlayPage ePage )
finalText = startTags + finalText;
vector<wstring> paragraphs;
size_t lastIndex = 0;
for ( size_t index = finalText.find(L"\r\n", lastIndex, 2);
int lastIndex = 0;
for ( int index = finalText.find(L"\r\n", lastIndex, 2);
index != wstring::npos;
index = finalText.find(L"\r\n", lastIndex, 2)
)
@@ -318,7 +318,7 @@ void UIScene_HowToPlay::StartPage( EHowToPlayPage ePage )
IggyStringUTF16 * stringVal = new IggyStringUTF16[paragraphs.size()];
value[0].type = IGGY_DATATYPE_number;
value[0].number = gs_pageToFlashMapping[static_cast<int>(ePage)];
value[0].number = gs_pageToFlashMapping[(int)ePage];
for(unsigned int i = 0; i < paragraphs.size(); ++i)
{

View File

@@ -122,7 +122,7 @@ void UIScene_HowToPlayMenu::updateTooltips()
void UIScene_HowToPlayMenu::updateComponents()
{
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
@@ -191,13 +191,13 @@ void UIScene_HowToPlayMenu::handleInput(int iPad, int key, bool repeat, bool pre
void UIScene_HowToPlayMenu::handlePress(F64 controlId, F64 childId)
{
if( static_cast<int>(controlId) == eControl_Buttons)
if( (int)controlId == eControl_Buttons)
{
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
unsigned int uiInitData;
uiInitData = ( ( 1 << 31 ) | ( m_uiHTPSceneA[static_cast<int>(childId)] << 16 ) | static_cast<short>(m_iPad) );
uiInitData = ( ( 1 << 31 ) | ( m_uiHTPSceneA[(int)childId] << 16 ) | ( short )( m_iPad ) );
ui.NavigateToScene(m_iPad, eUIScene_HowToPlay, ( void* )( uiInitData ) );
}
}

View File

@@ -126,7 +126,7 @@ void UIScene_InGameHostOptionsMenu::handleInput(int iPad, int key, bool repeat,
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player->connection)
{
player->connection->send(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions));
player->connection->send( shared_ptr<ServerSettingsChangedPacket>( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) );
}
}
@@ -153,7 +153,7 @@ void UIScene_InGameHostOptionsMenu::handlePress(F64 controlId, F64 childId)
TeleportMenuInitData *initData = new TeleportMenuInitData();
initData->iPad = m_iPad;
initData->teleportToPlayer = false;
if( static_cast<int>(controlId) == eControl_TeleportToPlayer )
if( (int)controlId == eControl_TeleportToPlayer )
{
initData->teleportToPlayer = true;
}

View File

@@ -23,7 +23,7 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer
{
INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i );
if( player != nullptr )
if( player != NULL )
{
PlayerInfo *info = BuildPlayerInfo(player);
@@ -36,7 +36,7 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer
INetworkPlayer *thisPlayer = g_NetworkManager.GetLocalPlayerByUserIndex( m_iPad );
m_isHostPlayer = false;
if(thisPlayer != nullptr) m_isHostPlayer = thisPlayer->IsHost() == TRUE;
if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE;
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
@@ -109,7 +109,7 @@ void UIScene_InGameInfoMenu::updateTooltips()
{
keyA = IDS_TOOLTIPS_SELECT;
}
else if( selectedPlayer != nullptr)
else if( selectedPlayer != NULL)
{
bool editingHost = selectedPlayer->IsHost();
if( (cheats && (m_isHostPlayer || !editingHost ) ) || (!trust && (m_isHostPlayer || !editingHost))
@@ -134,7 +134,7 @@ void UIScene_InGameInfoMenu::updateTooltips()
if(!m_buttonGameOptions.hasFocus())
{
// if the player is me, then view gamer profile
if(selectedPlayer != nullptr && selectedPlayer->IsLocal() && selectedPlayer->GetUserIndex()==m_iPad)
if(selectedPlayer != NULL && selectedPlayer->IsLocal() && selectedPlayer->GetUserIndex()==m_iPad)
{
ikeyY = IDS_TOOLTIPS_VIEW_GAMERPROFILE;
}
@@ -172,7 +172,7 @@ void UIScene_InGameInfoMenu::handleReload()
{
INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i );
if( player != nullptr )
if( player != NULL )
{
PlayerInfo *info = BuildPlayerInfo(player);
@@ -183,7 +183,7 @@ void UIScene_InGameInfoMenu::handleReload()
INetworkPlayer *thisPlayer = g_NetworkManager.GetLocalPlayerByUserIndex( m_iPad );
m_isHostPlayer = false;
if(thisPlayer != nullptr) m_isHostPlayer = thisPlayer->IsHost() == TRUE;
if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE;
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
@@ -209,7 +209,7 @@ void UIScene_InGameInfoMenu::tick()
{
INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i );
if(player != nullptr)
if(player != NULL)
{
PlayerInfo *info = BuildPlayerInfo(player);
@@ -283,7 +283,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
if(pressed && m_playerList.hasFocus() && (m_playerList.getItemCount() > 0) && (m_playerList.getCurrentSelection() < m_players.size()) )
{
INetworkPlayer *player = g_NetworkManager.GetPlayerBySmallId(m_players[m_playerList.getCurrentSelection()]->m_smallId);
if( player != nullptr )
if( player != NULL )
{
PlayerUID uid = player->GetUID();
if( uid != INVALID_XUID )
@@ -327,14 +327,14 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
void UIScene_InGameInfoMenu::handlePress(F64 controlId, F64 childId)
{
app.DebugPrintf("Pressed = %d, %d\n", static_cast<int>(controlId), static_cast<int>(childId));
switch(static_cast<int>(controlId))
app.DebugPrintf("Pressed = %d, %d\n", (int)controlId, (int)childId);
switch((int)controlId)
{
case eControl_GameOptions:
ui.NavigateToScene(m_iPad,eUIScene_InGameHostOptionsMenu);
break;
case eControl_GamePlayers:
int currentSelection = static_cast<int>(childId);
int currentSelection = (int)childId;
INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId(m_players[currentSelection]->m_smallId);
Minecraft *pMinecraft = Minecraft::GetInstance();
@@ -344,7 +344,7 @@ void UIScene_InGameInfoMenu::handlePress(F64 controlId, F64 childId)
bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0;
bool trust = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0;
if( isOp && selectedPlayer != nullptr)
if( isOp && selectedPlayer != NULL)
{
bool editingHost = selectedPlayer->IsHost();
if( (cheats && (m_isHostPlayer || !editingHost ) ) || (!trust && (m_isHostPlayer || !editingHost))
@@ -377,10 +377,10 @@ void UIScene_InGameInfoMenu::handlePress(F64 controlId, F64 childId)
void UIScene_InGameInfoMenu::handleFocusChange(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_GamePlayers:
m_playerList.updateChildFocus( static_cast<int>(childId) );
m_playerList.updateChildFocus( (int) childId );
};
updateTooltips();
}
@@ -389,7 +389,7 @@ void UIScene_InGameInfoMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer
{
app.DebugPrintf("<UIScene_InGameInfoMenu::OnPlayerChanged> Player \"%ls\" %s (smallId: %d)\n", pPlayer->GetOnlineName(), leaving ? "leaving" : "joining", pPlayer->GetSmallId());
UIScene_InGameInfoMenu *scene = static_cast<UIScene_InGameInfoMenu *>(callbackParam);
UIScene_InGameInfoMenu *scene = (UIScene_InGameInfoMenu *)callbackParam;
bool playerFound = false;
int foundIndex = 0;
for(int i = 0; i < scene->m_players.size(); ++i)
@@ -439,7 +439,7 @@ void UIScene_InGameInfoMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer
int UIScene_InGameInfoMenu::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
BYTE smallId = *static_cast<BYTE *>(pParam);
BYTE smallId = *(BYTE *)pParam;
delete pParam;
if(result==C4JStorage::EMessage_ResultAccept)
@@ -448,7 +448,7 @@ int UIScene_InGameInfoMenu::KickPlayerReturned(void *pParam,int iPad,C4JStorage:
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[iPad];
if(localPlayer->connection)
{
localPlayer->connection->send(std::make_shared<KickPlayerPacket>(smallId));
localPlayer->connection->send( shared_ptr<KickPlayerPacket>( new KickPlayerPacket(smallId) ) );
}
}
@@ -473,7 +473,7 @@ UIScene_InGameInfoMenu::PlayerInfo *UIScene_InGameInfoMenu::BuildPlayerInfo(INet
}
int voiceStatus = 0;
if(player != nullptr && player->HasVoice() )
if(player != NULL && player->HasVoice() )
{
if( player->IsMutedByLocalUser(m_iPad) )
{

View File

@@ -6,6 +6,7 @@
#include "..\..\ClientConnection.h"
#include "..\..\..\Minecraft.World\net.minecraft.network.packet.h"
#define CHECKBOXES_TIMER_ID 0
#define CHECKBOXES_TIMER_TIME 100
@@ -16,21 +17,21 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(int iPad, void
m_bShouldNavBack = false;
InGamePlayerOptionsInitData *initData = static_cast<InGamePlayerOptionsInitData *>(_initData);
InGamePlayerOptionsInitData *initData = (InGamePlayerOptionsInitData *)_initData;
m_networkSmallId = initData->networkSmallId;
m_playerPrivileges = initData->playerPrivileges;
INetworkPlayer *localPlayer = g_NetworkManager.GetLocalPlayerByUserIndex( m_iPad );
INetworkPlayer *editingPlayer = g_NetworkManager.GetPlayerBySmallId(m_networkSmallId);
if(editingPlayer != nullptr)
if(editingPlayer != NULL)
{
m_labelGamertag.init(editingPlayer->GetDisplayName());
}
bool trustPlayers = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0;
bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0;
m_editingSelf = (localPlayer != nullptr && localPlayer == editingPlayer);
m_editingSelf = (localPlayer != NULL && localPlayer == editingPlayer);
if( m_editingSelf || trustPlayers || editingPlayer->IsHost())
{
@@ -240,7 +241,7 @@ void UIScene_InGamePlayerOptionsMenu::handleReload()
bool trustPlayers = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0;
bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0;
m_editingSelf = (localPlayer != nullptr && localPlayer == editingPlayer);
m_editingSelf = (localPlayer != NULL && localPlayer == editingPlayer);
if( m_editingSelf || trustPlayers || editingPlayer->IsHost())
{
@@ -371,7 +372,7 @@ void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key, bool repeat
else
{
INetworkPlayer *editingPlayer = g_NetworkManager.GetPlayerBySmallId(m_networkSmallId);
if(!trustPlayers && (editingPlayer != nullptr && !editingPlayer->IsHost() ) )
if(!trustPlayers && (editingPlayer != NULL && !editingPlayer->IsHost() ) )
{
Player::setPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CannotMine,!m_checkboxes[eControl_BuildAndMine].IsChecked());
Player::setPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CannotBuild,!m_checkboxes[eControl_BuildAndMine].IsChecked());
@@ -404,7 +405,7 @@ void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key, bool repeat
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player->connection)
{
player->connection->send(std::make_shared<PlayerInfoPacket>(m_networkSmallId, -1, m_playerPrivileges));
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) );
}
}
navigateBack();
@@ -427,7 +428,7 @@ void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key, bool repeat
void UIScene_InGamePlayerOptionsMenu::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Kick:
{
@@ -445,7 +446,7 @@ void UIScene_InGamePlayerOptionsMenu::handlePress(F64 controlId, F64 childId)
int UIScene_InGamePlayerOptionsMenu::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
BYTE smallId = *static_cast<BYTE *>(pParam);
BYTE smallId = *(BYTE *)pParam;
delete pParam;
if(result==C4JStorage::EMessage_ResultAccept)
@@ -454,7 +455,7 @@ int UIScene_InGamePlayerOptionsMenu::KickPlayerReturned(void *pParam,int iPad,C4
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[iPad];
if(localPlayer->connection)
{
localPlayer->connection->send(std::make_shared<KickPlayerPacket>(smallId));
localPlayer->connection->send( shared_ptr<KickPlayerPacket>( new KickPlayerPacket(smallId) ) );
}
// Fix for #61494 - [CRASH]: TU7: Code: Multiplayer: Title may crash while kicking a player from an online game.
@@ -469,12 +470,12 @@ int UIScene_InGamePlayerOptionsMenu::KickPlayerReturned(void *pParam,int iPad,C4
void UIScene_InGamePlayerOptionsMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer *pPlayer, bool leaving)
{
app.DebugPrintf("UIScene_InGamePlayerOptionsMenu::OnPlayerChanged");
UIScene_InGamePlayerOptionsMenu *scene = static_cast<UIScene_InGamePlayerOptionsMenu *>(callbackParam);
UIScene_InGamePlayerOptionsMenu *scene = (UIScene_InGamePlayerOptionsMenu *)callbackParam;
UIScene_InGameInfoMenu *infoScene = static_cast<UIScene_InGameInfoMenu *>(scene->getBackScene());
if(infoScene != nullptr) UIScene_InGameInfoMenu::OnPlayerChanged(infoScene,pPlayer,leaving);
UIScene_InGameInfoMenu *infoScene = (UIScene_InGameInfoMenu *)scene->getBackScene();
if(infoScene != NULL) UIScene_InGameInfoMenu::OnPlayerChanged(infoScene,pPlayer,leaving);
if(leaving && pPlayer != nullptr && pPlayer->GetSmallId() == scene->m_networkSmallId)
if(leaving && pPlayer != NULL && pPlayer->GetSmallId() == scene->m_networkSmallId)
{
scene->m_bShouldNavBack = true;
}
@@ -496,7 +497,7 @@ void UIScene_InGamePlayerOptionsMenu::resetCheatCheckboxes()
void UIScene_InGamePlayerOptionsMenu::handleCheckboxToggled(F64 controlId, bool selected)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Op:
// flag that the moderator state has changed

View File

@@ -8,7 +8,7 @@
int UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
{
UIScene_InGameSaveManagementMenu *pClass= static_cast<UIScene_InGameSaveManagementMenu *>(lpParam);
UIScene_InGameSaveManagementMenu *pClass= (UIScene_InGameSaveManagementMenu *)lpParam;
app.DebugPrintf("Received data for save thumbnail\n");
@@ -20,9 +20,9 @@ int UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(LPVOID lpPar
}
else
{
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = nullptr;
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = NULL;
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].dwThumbnailSize = 0;
app.DebugPrintf("Save thumbnail data is nullptr, or has size 0\n");
app.DebugPrintf("Save thumbnail data is NULL, or has size 0\n");
}
pClass->m_bSaveThumbnailReady = true;
@@ -55,9 +55,9 @@ UIScene_InGameSaveManagementMenu::UIScene_InGameSaveManagementMenu(int iPad, voi
m_bRetrievingSaveThumbnails = false;
m_bSaveThumbnailReady = false;
m_bExitScene=false;
m_pSaveDetails=nullptr;
m_pSaveDetails=NULL;
m_bSavesDisplayed=false;
m_saveDetails = nullptr;
m_saveDetails = NULL;
m_iSaveDetailsCount = 0;
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) || defined(_DURANGO)
@@ -198,17 +198,17 @@ void UIScene_InGameSaveManagementMenu::tick()
if(!m_bSavesDisplayed)
{
m_pSaveDetails=StorageManager.ReturnSavesInfo();
if(m_pSaveDetails!=nullptr)
if(m_pSaveDetails!=NULL)
{
m_spaceIndicatorSaves.reset();
m_bSavesDisplayed=true;
if(m_saveDetails!=nullptr)
if(m_saveDetails!=NULL)
{
for(unsigned int i = 0; i < m_pSaveDetails->iSaveC; ++i)
{
if(m_saveDetails[i].pbThumbnailData!=nullptr)
if(m_saveDetails[i].pbThumbnailData!=NULL)
{
delete m_saveDetails[i].pbThumbnailData;
}
@@ -371,9 +371,9 @@ void UIScene_InGameSaveManagementMenu::GetSaveInfo( )
m_controlSavesTimer.setVisible(true);
m_pSaveDetails=StorageManager.ReturnSavesInfo();
if(m_pSaveDetails==nullptr)
if(m_pSaveDetails==NULL)
{
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,nullptr,this,"save");
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save");
}
@@ -418,12 +418,12 @@ void UIScene_InGameSaveManagementMenu::handleInput(int iPad, int key, bool repea
void UIScene_InGameSaveManagementMenu::handleInitFocus(F64 controlId, F64 childId)
{
app.DebugPrintf(app.USER_SR, "UIScene_InGameSaveManagementMenu::handleInitFocus - %d , %d\n", static_cast<int>(controlId), static_cast<int>(childId));
app.DebugPrintf(app.USER_SR, "UIScene_InGameSaveManagementMenu::handleInitFocus - %d , %d\n", (int)controlId, (int)childId);
}
void UIScene_InGameSaveManagementMenu::handleFocusChange(F64 controlId, F64 childId)
{
app.DebugPrintf(app.USER_SR, "UIScene_InGameSaveManagementMenu::handleFocusChange - %d , %d\n", static_cast<int>(controlId), static_cast<int>(childId));
app.DebugPrintf(app.USER_SR, "UIScene_InGameSaveManagementMenu::handleFocusChange - %d , %d\n", (int)controlId, (int)childId);
m_iSaveListIndex = childId;
if(m_bSavesDisplayed) m_bUpdateSaveSize = true;
updateTooltips();
@@ -431,7 +431,7 @@ void UIScene_InGameSaveManagementMenu::handleFocusChange(F64 controlId, F64 chil
void UIScene_InGameSaveManagementMenu::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_SavesList:
{
@@ -452,7 +452,7 @@ void UIScene_InGameSaveManagementMenu::handlePress(F64 controlId, F64 childId)
int UIScene_InGameSaveManagementMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_InGameSaveManagementMenu* pClass = static_cast<UIScene_InGameSaveManagementMenu *>(pParam);
UIScene_InGameSaveManagementMenu* pClass = (UIScene_InGameSaveManagementMenu*)pParam;
// results switched for this dialog
if(result==C4JStorage::EMessage_ResultDecline)
@@ -477,7 +477,7 @@ int UIScene_InGameSaveManagementMenu::DeleteSaveDialogReturned(void *pParam,int
int UIScene_InGameSaveManagementMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes)
{
UIScene_InGameSaveManagementMenu* pClass = static_cast<UIScene_InGameSaveManagementMenu *>(lpParam);
UIScene_InGameSaveManagementMenu* pClass = (UIScene_InGameSaveManagementMenu*)lpParam;
if(bRes)
{

View File

@@ -23,17 +23,17 @@ UIScene_InventoryMenu::UIScene_InventoryMenu(int iPad, void *_initData, UILayer
// Setup all the Iggy references we need for this scene
initialiseMovie();
InventoryScreenInput *initData = static_cast<InventoryScreenInput *>(_initData);
InventoryScreenInput *initData = (InventoryScreenInput *)_initData;
Minecraft *pMinecraft = Minecraft::GetInstance();
if( pMinecraft->localgameModes[initData->iPad] != nullptr )
if( pMinecraft->localgameModes[initData->iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Inventory_Menu, this);
}
InventoryMenu *menu = static_cast<InventoryMenu *>(initData->player->inventoryMenu);
InventoryMenu *menu = (InventoryMenu *)initData->player->inventoryMenu;
initData->player->awardStat(GenericStats::openInventory(),GenericStats::param_openInventory());
@@ -182,7 +182,7 @@ void UIScene_InventoryMenu::setSectionSelectedSlot(ESceneSection eSection, int x
int index = (y * cols) + x;
UIControl_SlotList *slotList = nullptr;
UIControl_SlotList *slotList = NULL;
switch( eSection )
{
case eSectionInventoryArmor:
@@ -201,7 +201,7 @@ void UIScene_InventoryMenu::setSectionSelectedSlot(ESceneSection eSection, int x
UIControl *UIScene_InventoryMenu::getSection(ESceneSection eSection)
{
UIControl *control = nullptr;
UIControl *control = NULL;
switch( eSection )
{
case eSectionInventoryArmor:
@@ -220,7 +220,7 @@ UIControl *UIScene_InventoryMenu::getSection(ESceneSection eSection)
void UIScene_InventoryMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
if(wcscmp((wchar_t *)region->name,L"player")==0)
{
@@ -253,7 +253,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay()
Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> player = pMinecraft->localplayers[m_iPad];
if(player == nullptr) return;
if(player == NULL) return;
vector<MobEffectInstance *> *activeEffects = player->getActiveEffects();

View File

@@ -16,7 +16,7 @@ UIScene_JoinMenu::UIScene_JoinMenu(int iPad, void *_initData, UILayer *parentLay
// Setup all the Iggy references we need for this scene
initialiseMovie();
JoinMenuInitData *initData = static_cast<JoinMenuInitData *>(_initData);
JoinMenuInitData *initData = (JoinMenuInitData *)_initData;
m_selectedSession = initData->selectedSession;
m_friendInfoUpdatedOK = false;
m_friendInfoUpdatedERROR = false;
@@ -62,7 +62,7 @@ void UIScene_JoinMenu::tick()
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
for( int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++ )
{
if( m_selectedSession->data.players[i] != nullptr )
if( m_selectedSession->data.players[i] != NULL )
{
#ifndef _CONTENT_PACKAGE
if(app.DebugSettingsOn() && (app.GetGameSettingsDebugMask()&(1L<<eDebugSetting_DebugLeaderboards)))
@@ -88,7 +88,7 @@ void UIScene_JoinMenu::tick()
}
else
{
// Leave the loop when we hit the first nullptr player
// Leave the loop when we hit the first NULL player
break;
}
}
@@ -224,7 +224,7 @@ void UIScene_JoinMenu::tick()
void UIScene_JoinMenu::friendSessionUpdated(bool success, void *pParam)
{
UIScene_JoinMenu *scene = static_cast<UIScene_JoinMenu *>(pParam);
UIScene_JoinMenu *scene = (UIScene_JoinMenu *)pParam;
ui.NavigateBack(scene->m_iPad);
if( success )
{
@@ -238,7 +238,7 @@ void UIScene_JoinMenu::friendSessionUpdated(bool success, void *pParam)
int UIScene_JoinMenu::ErrorDialogReturned(void *pParam, int iPad, const C4JStorage::EMessageResult)
{
UIScene_JoinMenu *scene = static_cast<UIScene_JoinMenu *>(pParam);
UIScene_JoinMenu *scene = (UIScene_JoinMenu *)pParam;
ui.NavigateBack(scene->m_iPad);
return 0;
@@ -272,7 +272,7 @@ void UIScene_JoinMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
break;
#ifdef _DURANGO
case ACTION_MENU_Y:
if(m_selectedSession != nullptr && getControlFocus() == eControl_GamePlayers && m_buttonListPlayers.getItemCount() > 0)
if(m_selectedSession != NULL && getControlFocus() == eControl_GamePlayers && m_buttonListPlayers.getItemCount() > 0)
{
PlayerUID uid = m_selectedSession->searchResult.m_playerXuids[m_buttonListPlayers.getCurrentSelection()];
if( uid != INVALID_XUID ) ProfileManager.ShowProfileCard(ProfileManager.GetLockedProfile(),uid);
@@ -301,7 +301,7 @@ void UIScene_JoinMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
void UIScene_JoinMenu::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_JoinGame:
{
@@ -324,10 +324,10 @@ void UIScene_JoinMenu::handlePress(F64 controlId, F64 childId)
void UIScene_JoinMenu::handleFocusChange(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_GamePlayers:
m_buttonListPlayers.updateChildFocus( static_cast<int>(childId) );
m_buttonListPlayers.updateChildFocus( (int) childId );
};
updateTooltips();
}
@@ -370,7 +370,7 @@ void UIScene_JoinMenu::StartSharedLaunchFlow()
int UIScene_JoinMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_JoinMenu* pClass = static_cast<UIScene_JoinMenu *>(ui.GetSceneFromCallbackId((size_t)pParam));
UIScene_JoinMenu* pClass = (UIScene_JoinMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
if(pClass)
{
@@ -473,7 +473,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
#if defined(__PS3__) || defined(__PSVITA__)
if(isSignedInLive)
{
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&noUGC,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&noUGC,NULL,NULL);
}
#else
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
@@ -511,7 +511,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
{
#if defined(__ORBIS__) || defined(__PSVITA__)
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
@@ -608,7 +608,7 @@ void UIScene_JoinMenu::handleTimerComplete(int id)
int selectedIndex = 0;
for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
{
if( m_selectedSession->data.players[i] != nullptr )
if( m_selectedSession->data.players[i] != NULL )
{
if(m_selectedSession->data.players[i] == selectedPlayerXUID) selectedIndex = i;
playersList.InsertItems(i,1);
@@ -625,7 +625,7 @@ void UIScene_JoinMenu::handleTimerComplete(int id)
}
else
{
// Leave the loop when we hit the first nullptr player
// Leave the loop when we hit the first NULL player
break;
}
}

View File

@@ -17,8 +17,8 @@ UIScene_Keyboard::UIScene_Keyboard(int iPad, void *initData, UILayer *parentLaye
initialiseMovie();
#ifdef _WINDOWS64
m_win64Callback = nullptr;
m_win64CallbackParam = nullptr;
m_win64Callback = NULL;
m_win64CallbackParam = NULL;
m_win64TextBuffer = L"";
m_win64MaxChars = 25;
@@ -28,7 +28,7 @@ UIScene_Keyboard::UIScene_Keyboard(int iPad, void *initData, UILayer *parentLaye
m_bPCMode = false;
if (initData)
{
UIKeyboardInitData* kbData = static_cast<UIKeyboardInitData *>(initData);
UIKeyboardInitData* kbData = (UIKeyboardInitData*)initData;
m_win64Callback = kbData->callback;
m_win64CallbackParam = kbData->lpParam;
if (kbData->title) titleText = kbData->title;
@@ -105,11 +105,11 @@ UIScene_Keyboard::UIScene_Keyboard(int iPad, void *initData, UILayer *parentLaye
};
IggyName nameVisible = registerFastName(L"visible");
IggyValuePath* root = IggyPlayerRootPath(getMovie());
for (int i = 0; i < static_cast<int>(sizeof(s_keyNames) / sizeof(s_keyNames[0])); ++i)
for (int i = 0; i < (int)(sizeof(s_keyNames) / sizeof(s_keyNames[0])); ++i)
{
IggyValuePath keyPath;
if (IggyValuePathMakeNameRef(&keyPath, root, s_keyNames[i]))
IggyValueSetBooleanRS(&keyPath, nameVisible, nullptr, false);
IggyValueSetBooleanRS(&keyPath, nameVisible, NULL, false);
}
}
#endif
@@ -192,7 +192,7 @@ void UIScene_Keyboard::tick()
m_bKeyboardDonePressed = true;
}
}
else if (static_cast<int>(m_win64TextBuffer.length()) < m_win64MaxChars)
else if ((int)m_win64TextBuffer.length() < m_win64MaxChars)
{
m_win64TextBuffer += ch;
changed = true;
@@ -229,33 +229,33 @@ void UIScene_Keyboard::handleInput(int iPad, int key, bool repeat, bool pressed,
handled = true;
break;
case ACTION_MENU_X: // X
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcBackspaceButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcBackspaceButtonPressed, 0 , NULL );
handled = true;
break;
case ACTION_MENU_PAGEUP: // LT
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSymbolButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSymbolButtonPressed, 0 , NULL );
handled = true;
break;
case ACTION_MENU_Y: // Y
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSpaceButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSpaceButtonPressed, 0 , NULL );
handled = true;
break;
case ACTION_MENU_STICK_PRESS: // LS
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcCapsButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcCapsButtonPressed, 0 , NULL );
handled = true;
break;
case ACTION_MENU_LEFT_SCROLL: // LB
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcCursorLeftButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcCursorLeftButtonPressed, 0 , NULL );
handled = true;
break;
case ACTION_MENU_RIGHT_SCROLL: // RB
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcCursorRightButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcCursorRightButtonPressed, 0 , NULL );
handled = true;
break;
case ACTION_MENU_PAUSEMENU: // Start
if(!m_bKeyboardDonePressed)
{
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcDoneButtonPressed, 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcDoneButtonPressed, 0 , NULL );
// kick off done timer
addTimer(KEYBOARD_DONE_TIMER_ID,KEYBOARD_DONE_TIMER_TIME);
@@ -281,7 +281,7 @@ void UIScene_Keyboard::handleInput(int iPad, int key, bool repeat, bool pressed,
void UIScene_Keyboard::handlePress(F64 controlId, F64 childId)
{
if(static_cast<int>(controlId) == 0)
if((int)controlId == 0)
{
// Done has been pressed. At this point we can query for the input string and pass it on to wherever it is needed.
// we can not query for m_KeyboardTextInput.getLabel() here because we're in an iggy callback so we need to wait a frame.

View File

@@ -58,7 +58,7 @@ void UIScene_LanguageSelector::updateTooltips()
void UIScene_LanguageSelector::updateComponents()
{
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
@@ -112,14 +112,14 @@ void UIScene_LanguageSelector::handleInput(int iPad, int key, bool repeat, bool
void UIScene_LanguageSelector::handlePress(F64 controlId, F64 childId)
{
if( static_cast<int>(controlId) == eControl_Buttons )
if( (int)controlId == eControl_Buttons )
{
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
int newLanguage, newLocale;
newLanguage = uiLangMap[static_cast<int>(childId)];
newLocale = uiLocaleMap[static_cast<int>(childId)];
newLanguage = uiLangMap[(int)childId];
newLocale = uiLocaleMap[(int)childId];
app.SetMinecraftLanguage(m_iPad, newLanguage);
app.SetMinecraftLocale(m_iPad, newLocale);

View File

@@ -20,7 +20,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
// Setup all the Iggy references we need for this scene
initialiseMovie();
m_params = static_cast<LaunchMoreOptionsMenuInitData *>(initData);
m_params = (LaunchMoreOptionsMenuInitData *)initData;
m_labelWorldOptions.init(app.GetString(IDS_WORLD_OPTIONS));
@@ -116,9 +116,9 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
if(m_params->currentWorldSize != e_worldSize_Unknown)
{
m_labelWorldResize.init(app.GetString(IDS_INCREASE_WORLD_SIZE));
int min= static_cast<int>(m_params->currentWorldSize)-1;
int min= int(m_params->currentWorldSize)-1;
int max=3;
int curr = static_cast<int>(m_params->newWorldSize)-1;
int curr = int(m_params->newWorldSize)-1;
m_sliderWorldResize.init(app.GetString(m_iWorldSizeTitleA[curr]),eControl_WorldResize,min,max,curr);
m_checkboxes[eLaunchCheckbox_WorldResizeType].init(app.GetString(IDS_INCREASE_WORLD_SIZE_OVERWRITE_EDGES),eLaunchCheckbox_WorldResizeType,m_params->newWorldSizeOverwriteEdges);
}
@@ -308,7 +308,7 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat,
m_tabIndex = m_tabIndex == 0 ? 1 : 0;
updateTooltips();
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , NULL );
}
break;
}
@@ -330,7 +330,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S
m_tabIndex = iNewTabIndex;
updateTooltips();
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , NULL );
}
ui.TouchBoxRebuild(this);
break;
@@ -354,7 +354,7 @@ void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool se
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
switch(static_cast<EControls>((int)controlId))
switch((EControls)((int)controlId))
{
case eLaunchCheckbox_Online:
m_params->bOnlineGame = selected;
@@ -428,7 +428,7 @@ void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool se
void UIScene_LaunchMoreOptionsMenu::handleFocusChange(F64 controlId, F64 childId)
{
int stringId = 0;
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eLaunchCheckbox_Online:
stringId = IDS_GAMEOPTION_ONLINE;
@@ -549,7 +549,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id)
int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,bool bRes)
{
UIScene_LaunchMoreOptionsMenu *pClass=static_cast<UIScene_LaunchMoreOptionsMenu *>(lpParam);
UIScene_LaunchMoreOptionsMenu *pClass=(UIScene_LaunchMoreOptionsMenu *)lpParam;
pClass->m_bIgnoreInput=false;
if (bRes)
{
@@ -595,7 +595,7 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId)
if (isDirectEditBlocking()) return;
#endif
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_EditSeed:
{
@@ -642,8 +642,8 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId)
void UIScene_LaunchMoreOptionsMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
int value = (int)currentValue;
switch((int)sliderId)
{
case eControl_WorldSize:
#ifdef _LARGE_WORLDS
@@ -654,11 +654,11 @@ void UIScene_LaunchMoreOptionsMenu::handleSliderMove(F64 sliderId, F64 currentVa
break;
case eControl_WorldResize:
#ifdef _LARGE_WORLDS
EGameHostOptionWorldSize changedSize = static_cast<EGameHostOptionWorldSize>(value + 1);
EGameHostOptionWorldSize changedSize = EGameHostOptionWorldSize(value+1);
if(changedSize >= m_params->currentWorldSize)
{
m_sliderWorldResize.handleSliderMove(value);
m_params->newWorldSize = static_cast<EGameHostOptionWorldSize>(value + 1);
m_params->newWorldSize = EGameHostOptionWorldSize(value+1);
m_sliderWorldResize.setLabel(app.GetString(m_iWorldSizeTitleA[value]));
}
#endif

View File

@@ -9,12 +9,12 @@
#define PLAYER_ONLINE_TIMER_TIME 100
// if the value is greater than 32000, it's an xzp icon that needs displayed, rather than the game icon
const int UIScene_LeaderboardsMenu::TitleIcons[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][7] =
const int UIScene_LeaderboardsMenu::TitleIcons[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][7] =
{
{UIControl_LeaderboardList::e_ICON_TYPE_WALKED, UIControl_LeaderboardList::e_ICON_TYPE_FALLEN, Item::minecart_Id, Item::boat_Id, -1},
{Tile::dirt_Id, Tile::cobblestone_Id, Tile::sand_Id, Tile::stone_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id},
{Item::egg_Id, Item::wheat_Id, Tile::mushroom_brown_Id, Tile::reeds_Id, Item::bucket_milk_Id, Tile::pumpkin_Id, -1},
{UIControl_LeaderboardList::e_ICON_TYPE_ZOMBIE, UIControl_LeaderboardList::e_ICON_TYPE_SKELETON, UIControl_LeaderboardList::e_ICON_TYPE_CREEPER, UIControl_LeaderboardList::e_ICON_TYPE_SPIDER, UIControl_LeaderboardList::e_ICON_TYPE_SPIDERJOKEY, UIControl_LeaderboardList::e_ICON_TYPE_ZOMBIEPIGMAN, UIControl_LeaderboardList::e_ICON_TYPE_SLIME},
{ UIControl_LeaderboardList::e_ICON_TYPE_WALKED, UIControl_LeaderboardList::e_ICON_TYPE_FALLEN, Item::minecart_Id, Item::boat_Id, NULL },
{ Tile::dirt_Id, Tile::cobblestone_Id, Tile::sand_Id, Tile::stone_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id },
{ Item::egg_Id, Item::wheat_Id, Tile::mushroom_brown_Id, Tile::reeds_Id, Item::bucket_milk_Id, Tile::pumpkin_Id, NULL },
{ UIControl_LeaderboardList::e_ICON_TYPE_ZOMBIE, UIControl_LeaderboardList::e_ICON_TYPE_SKELETON, UIControl_LeaderboardList::e_ICON_TYPE_CREEPER, UIControl_LeaderboardList::e_ICON_TYPE_SPIDER, UIControl_LeaderboardList::e_ICON_TYPE_SPIDERJOKEY, UIControl_LeaderboardList::e_ICON_TYPE_ZOMBIEPIGMAN, UIControl_LeaderboardList::e_ICON_TYPE_SLIME },
};
const UIScene_LeaderboardsMenu::LeaderboardDescriptor UIScene_LeaderboardsMenu::LEADERBOARD_DESCRIPTORS[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][4] = {
{
@@ -438,7 +438,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex)
}
else
{
m_newEntryIndex = static_cast<unsigned int>(startIndex);
m_newEntryIndex = (unsigned int)startIndex;
// m_newReadSize = min((int)READ_SIZE, (int)m_leaderboard.m_totalEntryCount-(startIndex-1));
}
@@ -462,7 +462,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex)
{
m_interface.ReadStats_TopRank(
this,
m_currentDifficulty, static_cast<LeaderboardManager::EStatsType>(m_currentLeaderboard),
m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
m_newEntryIndex, m_newReadSize
);
}
@@ -472,7 +472,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex)
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(),&uid, true);
m_interface.ReadStats_MyScore( this,
m_currentDifficulty, static_cast<LeaderboardManager::EStatsType>(m_currentLeaderboard),
m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
uid /*ignored on PS3*/,
m_newReadSize
);
@@ -483,7 +483,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex)
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(),&uid, true);
m_interface.ReadStats_Friends( this,
m_currentDifficulty, static_cast<LeaderboardManager::EStatsType>(m_currentLeaderboard),
m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard,
uid /*ignored on PS3*/,
m_newEntryIndex, m_newReadSize
);
@@ -558,7 +558,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats()
else
{
m_leaderboard.m_entries[entryIndex].m_columns[i] = UINT_MAX;
swprintf(m_leaderboard.m_entries[entryIndex].m_wcColumns[i], 12, L"%.1fkm", static_cast<float>(m_leaderboard.m_entries[entryIndex].m_columns[i])/100.f/1000.f);
swprintf(m_leaderboard.m_entries[entryIndex].m_wcColumns[i], 12, L"%.1fkm", ((float)m_leaderboard.m_entries[entryIndex].m_columns[i])/100.f/1000.f);
}
}
@@ -576,7 +576,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats()
return true;
}
//assert( LeaderboardManager::Instance()->GetStats() != nullptr );
//assert( LeaderboardManager::Instance()->GetStats() != NULL );
//PXUSER_STATS_READ_RESULTS stats = LeaderboardManager::Instance()->GetStats();
//if( m_currentFilter == LeaderboardManager::eFM_Friends ) LeaderboardManager::Instance()->SortFriendStats();
@@ -781,7 +781,7 @@ void UIScene_LeaderboardsMenu::CopyLeaderboardEntry(LeaderboardManager::ReadScor
else if(iDigitC<8)
{
// km with a .X
swprintf(leaderboardEntry->m_wcColumns[i], 12, L"%.1fkm", static_cast<float>(leaderboardEntry->m_columns[i])/1000.f);
swprintf(leaderboardEntry->m_wcColumns[i], 12, L"%.1fkm", ((float)leaderboardEntry->m_columns[i])/1000.f);
#ifdef _DEBUG
//app.DebugPrintf("Display - %.1fkm\n", ((float)leaderboardEntry->m_columns[i])/1000.f);
#endif
@@ -789,7 +789,7 @@ void UIScene_LeaderboardsMenu::CopyLeaderboardEntry(LeaderboardManager::ReadScor
else
{
// bigger than that, so no decimal point
swprintf(leaderboardEntry->m_wcColumns[i], 12, L"%.0fkm", static_cast<float>(leaderboardEntry->m_columns[i])/1000.f);
swprintf(leaderboardEntry->m_wcColumns[i], 12, L"%.0fkm", ((float)leaderboardEntry->m_columns[i])/1000.f);
#ifdef _DEBUG
//app.DebugPrintf("Display - %.0fkm\n", ((float)leaderboardEntry->m_columns[i])/1000.f);
#endif
@@ -964,14 +964,14 @@ int UIScene_LeaderboardsMenu::SetLeaderboardTitleIcons()
void UIScene_LeaderboardsMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
int slotId = -1;
swscanf(static_cast<wchar_t *>(region->name),L"slot_%d",&slotId);
swscanf((wchar_t*)region->name,L"slot_%d",&slotId);
if (slotId == -1)
{
//app.DebugPrintf("This is not the control we are looking for\n");
}
else
{
shared_ptr<ItemInstance> item = std::make_shared<ItemInstance>(TitleIcons[m_currentLeaderboard][slotId], 1, 0);
shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>( new ItemInstance(TitleIcons[m_currentLeaderboard][slotId], 1, 0) );
customDrawSlotControl(region,m_iPad,item,1.0f,false,false);
}
}
@@ -979,14 +979,14 @@ void UIScene_LeaderboardsMenu::customDraw(IggyCustomDrawCallbackRegion *region)
void UIScene_LeaderboardsMenu::handleSelectionChanged(F64 selectedId)
{
ui.PlayUISFX(eSFX_Focus);
m_newSel = static_cast<int>(selectedId);
m_newSel = (int)selectedId;
updateTooltips();
}
// Handle a request from Iggy for more data
void UIScene_LeaderboardsMenu::handleRequestMoreData(F64 startIndex, bool up)
{
unsigned int item = static_cast<int>(startIndex);
unsigned int item = (int)startIndex;
if( m_leaderboard.m_totalEntryCount > 0 && (item+1) < GetEntryStartIndex() )
{
@@ -995,7 +995,7 @@ void UIScene_LeaderboardsMenu::handleRequestMoreData(F64 startIndex, bool up)
int readIndex = (GetEntryStartIndex() + 1) - READ_SIZE;
if( readIndex <= 0 )
readIndex = 1;
assert( readIndex >= 1 && readIndex <= static_cast<int>(m_leaderboard.m_totalEntryCount));
assert( readIndex >= 1 && readIndex <= (int)m_leaderboard.m_totalEntryCount );
ReadStats(readIndex);
}
}
@@ -1004,7 +1004,7 @@ void UIScene_LeaderboardsMenu::handleRequestMoreData(F64 startIndex, bool up)
if( LeaderboardManager::Instance()->isIdle() )
{
int readIndex = (GetEntryStartIndex() + 1) + m_leaderboard.m_entries.size();
assert( readIndex >= 1 && readIndex <= static_cast<int>(m_leaderboard.m_totalEntryCount));
assert( readIndex >= 1 && readIndex <= (int)m_leaderboard.m_totalEntryCount );
ReadStats(readIndex);
}
}
@@ -1033,7 +1033,7 @@ void UIScene_LeaderboardsMenu::handleTimerComplete(int id)
int UIScene_LeaderboardsMenu::ExitLeaderboards(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LeaderboardsMenu* pClass = static_cast<UIScene_LeaderboardsMenu *>(pParam);
UIScene_LeaderboardsMenu* pClass = (UIScene_LeaderboardsMenu*)pParam;
pClass->navigateBack();

View File

@@ -34,7 +34,7 @@ int UIScene_LoadMenu::m_iDifficultyTitleSettingA[4]=
int UIScene_LoadMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
{
UIScene_LoadMenu *pClass= static_cast<UIScene_LoadMenu *>(ui.GetSceneFromCallbackId((size_t)lpParam));
UIScene_LoadMenu *pClass= (UIScene_LoadMenu *)ui.GetSceneFromCallbackId((size_t)lpParam);
if(pClass)
{
@@ -50,7 +50,7 @@ int UIScene_LoadMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumb
}
else
{
app.DebugPrintf("Thumbnail data is nullptr, or has size 0\n");
app.DebugPrintf("Thumbnail data is NULL, or has size 0\n");
pClass->m_bThumbnailGetFailed = true;
}
pClass->m_bRetrievingSaveThumbnail = false;
@@ -64,7 +64,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
// Setup all the Iggy references we need for this scene
initialiseMovie();
LoadMenuInitData *params = static_cast<LoadMenuInitData *>(initData);
LoadMenuInitData *params = (LoadMenuInitData *)initData;
m_labelGameName.init(app.GetString(IDS_WORLD_NAME));
m_labelSeed.init(L"");
@@ -102,7 +102,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
m_bSaveThumbnailReady = false;
m_bRetrievingSaveThumbnail = true;
m_bShowTimer = false;
m_pDLCPack = nullptr;
m_pDLCPack = NULL;
m_bAvailableTexturePacksChecked=false;
m_bRequestQuadrantSignin = false;
m_iTexturePacksNotInstalled=0;
@@ -249,7 +249,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
#endif
#endif
#ifdef _WINDOWS64
if (params->saveDetails != nullptr && params->saveDetails->UTF8SaveName[0] != '\0')
if (params->saveDetails != NULL && params->saveDetails->UTF8SaveName[0] != '\0')
{
wchar_t wSaveName[128];
ZeroMemory(wSaveName, sizeof(wSaveName));
@@ -305,7 +305,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
if(!m_bAvailableTexturePacksChecked)
#endif
{
DLC_INFO *pDLCInfo=nullptr;
DLC_INFO *pDLCInfo=NULL;
// first pass - look to see if there are any that are not in the list
bool bTexturePackAlreadyListed;
@@ -451,9 +451,9 @@ void UIScene_LoadMenu::tick()
// #ifdef _DEBUG
// // dump out the thumbnail
// HANDLE hThumbnail = CreateFile("GAME:\\thumbnail.png", GENERIC_WRITE, 0, nullptr, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, nullptr);
// HANDLE hThumbnail = CreateFile("GAME:\\thumbnail.png", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL);
// DWORD dwBytes;
// WriteFile(hThumbnail,pbImageData,dwImageBytes,&dwBytes,nullptr);
// WriteFile(hThumbnail,pbImageData,dwImageBytes,&dwBytes,NULL);
// XCloseHandle(hThumbnail);
// #endif
@@ -477,7 +477,7 @@ void UIScene_LoadMenu::tick()
m_MoreOptionsParams.bTNT = app.GetGameHostOption(uiHostOptions,eGameHostOption_TNT)>0?TRUE:FALSE;
m_MoreOptionsParams.bHostPrivileges = app.GetGameHostOption(uiHostOptions,eGameHostOption_CheatsEnabled)>0?TRUE:FALSE;
m_MoreOptionsParams.bDisableSaving = app.GetGameHostOption(uiHostOptions,eGameHostOption_DisableSaving)>0?TRUE:FALSE;
m_MoreOptionsParams.currentWorldSize = static_cast<EGameHostOptionWorldSize>(app.GetGameHostOption(uiHostOptions, eGameHostOption_WorldSize));
m_MoreOptionsParams.currentWorldSize = (EGameHostOptionWorldSize)app.GetGameHostOption(uiHostOptions,eGameHostOption_WorldSize);
m_MoreOptionsParams.newWorldSize = m_MoreOptionsParams.currentWorldSize;
m_MoreOptionsParams.bMobGriefing = app.GetGameHostOption(uiHostOptions, eGameHostOption_MobGriefing);
@@ -696,7 +696,7 @@ void UIScene_LoadMenu::handlePress(F64 controlId, F64 childId)
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_GameMode:
switch(m_iGameModeId)
@@ -725,7 +725,7 @@ void UIScene_LoadMenu::handlePress(F64 controlId, F64 childId)
break;
case eControl_TexturePackList:
{
UpdateCurrentTexturePack(static_cast<int>(childId));
UpdateCurrentTexturePack((int)childId);
}
break;
case eControl_LoadWorld:
@@ -771,7 +771,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow()
// texture pack hasn't been set yet, so check what it will be
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
if(pTexturePack==nullptr)
if(pTexturePack==NULL)
{
#if TO_BE_IMPLEMENTED
// They've selected a texture pack they don't have yet
@@ -821,7 +821,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow()
{
// texture pack hasn't been set yet, so check what it will be
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(pTexturePack);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack;
m_pDLCPack=pDLCTexPack->getDLCInfoParentPack();
// do we have a license?
@@ -849,7 +849,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow()
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId());
ULONGLONG ullOfferID_Full;
if(pDLCInfo!=nullptr)
if(pDLCInfo!=NULL)
{
ullOfferID_Full=pDLCInfo->ullOfferID_Full;
}
@@ -946,8 +946,8 @@ void UIScene_LoadMenu::StartSharedLaunchFlow()
void UIScene_LoadMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
WCHAR TempString[256];
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
int value = (int)currentValue;
switch((int)sliderId)
{
case eControl_Difficulty:
m_sliderDifficulty.handleSliderMove(value);
@@ -1107,7 +1107,7 @@ void UIScene_LoadMenu::LaunchGame(void)
// inform them that leaderboard writes and achievements will be disabled
//ui.RequestMessageBox(IDS_TITLE_START_GAME, IDS_CONFIRM_START_SAVEDINCREATIVE_CONTINUE, uiIDA, 1, m_iPad,&CScene_LoadGameSettings::ConfirmLoadReturned,this,app.GetStringTable());
if(m_levelGen != nullptr)
if(m_levelGen != NULL)
{
m_bIsCorrupt = false;
LoadDataComplete(this);
@@ -1150,7 +1150,7 @@ void UIScene_LoadMenu::LaunchGame(void)
}
else
{
if(m_levelGen != nullptr)
if(m_levelGen != NULL)
{
m_bIsCorrupt = false;
LoadDataComplete(this);
@@ -1182,7 +1182,7 @@ void UIScene_LoadMenu::LaunchGame(void)
int UIScene_LoadMenu::CheckResetNetherReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
// results switched for this dialog
if(result==C4JStorage::EMessage_ResultDecline)
@@ -1206,11 +1206,11 @@ int UIScene_LoadMenu::CheckResetNetherReturned(void *pParam,int iPad,C4JStorage:
int UIScene_LoadMenu::ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
if(pClass->m_levelGen != nullptr)
if(pClass->m_levelGen != NULL)
{
pClass->m_bIsCorrupt = false;
pClass->LoadDataComplete(pClass);
@@ -1246,7 +1246,7 @@ int UIScene_LoadMenu::ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMes
int UIScene_LoadMenu::LoadDataComplete(void *pParam)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
if(!pClass->m_bIsCorrupt)
{
@@ -1312,7 +1312,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
#if defined(__PS3__) || defined(__PSVITA__)
if(isOnlineGame)
{
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,NULL,&bContentRestricted,NULL);
}
#endif
@@ -1362,7 +1362,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return 0;
}
@@ -1381,7 +1381,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),NULL,0,false);
}
#endif
@@ -1392,7 +1392,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
if(isOnlineGame)
{
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
@@ -1431,7 +1431,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return 0;
}
@@ -1450,7 +1450,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),NULL,0,false);
}
#endif
else
@@ -1484,7 +1484,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
int UIScene_LoadMenu::LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bIsOwner)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
pClass->m_bIsCorrupt=bIsCorrupt;
@@ -1520,13 +1520,13 @@ int UIScene_LoadMenu::LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bI
int UIScene_LoadMenu::TrophyDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
return LoadDataComplete(pClass);
}
int UIScene_LoadMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
// results switched for this dialog
if(result==C4JStorage::EMessage_ResultDecline)
@@ -1543,7 +1543,7 @@ int UIScene_LoadMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage:
int UIScene_LoadMenu::DeleteSaveDataReturned(void *pParam,bool bSuccess)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
app.SetCorruptSaveDeleted(true);
pClass->navigateBack();
@@ -1554,7 +1554,7 @@ int UIScene_LoadMenu::DeleteSaveDataReturned(void *pParam,bool bSuccess)
// 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not
void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocalUsersMask)
{
if(pClass->m_levelGen == nullptr)
if(pClass->m_levelGen == NULL)
{
INT saveOrCheckpointId = 0;
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
@@ -1582,7 +1582,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocal
NetworkGameInitData *param = new NetworkGameInitData();
param->seed = pClass->m_seed;
param->saveData = nullptr;
param->saveData = NULL;
param->levelGen = pClass->m_levelGen;
param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack;
param->levelName = pClass->m_levelName;
@@ -1642,7 +1642,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocal
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
loadingParams->lpParam = (LPVOID)param;
// Reset the autosave time
app.SetAutosaveTimerTime();
@@ -1676,7 +1676,7 @@ void UIScene_LoadMenu::checkStateAndStartGame()
int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_LoadMenu* pClass = static_cast<UIScene_LoadMenu *>(pParam);
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
if(bContinue==true)
{
@@ -1779,7 +1779,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int
if(ProfileManager.IsSignedInLive(i))
{
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(i,false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(i,false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, i );

View File

@@ -36,13 +36,13 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath)
if (slashPos != wstring::npos)
{
wstring sidecarPath = filePath.substr(0, slashPos + 1) + L"worldname.txt";
FILE *fr = nullptr;
FILE *fr = NULL;
if (_wfopen_s(&fr, sidecarPath.c_str(), L"r") == 0 && fr)
{
char buf[128] = {};
if (fgets(buf, sizeof(buf), fr))
{
int len = static_cast<int>(strlen(buf));
int len = (int)strlen(buf);
while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r' || buf[len-1] == ' '))
buf[--len] = '\0';
fclose(fr);
@@ -57,15 +57,15 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath)
}
}
HANDLE hFile = CreateFileW(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
HANDLE hFile = CreateFileW(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (hFile == INVALID_HANDLE_VALUE) return L"";
DWORD fileSize = GetFileSize(hFile, nullptr);
DWORD fileSize = GetFileSize(hFile, NULL);
if (fileSize < 12 || fileSize == INVALID_FILE_SIZE) { CloseHandle(hFile); return L""; }
unsigned char *rawData = new unsigned char[fileSize];
DWORD bytesRead = 0;
if (!ReadFile(hFile, rawData, fileSize, &bytesRead, nullptr) || bytesRead != fileSize)
if (!ReadFile(hFile, rawData, fileSize, &bytesRead, NULL) || bytesRead != fileSize)
{
CloseHandle(hFile);
delete[] rawData;
@@ -73,7 +73,7 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath)
}
CloseHandle(hFile);
unsigned char *saveData = nullptr;
unsigned char *saveData = NULL;
unsigned int saveSize = 0;
bool freeSaveData = false;
@@ -120,10 +120,10 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath)
ba.data = (byte*)(saveData + off);
ba.length = len;
CompoundTag *root = NbtIo::decompress(ba);
if (root != nullptr)
if (root != NULL)
{
CompoundTag *dataTag = root->getCompound(L"Data");
if (dataTag != nullptr)
if (dataTag != NULL)
result = dataTag->getString(L"LevelName");
delete root;
}
@@ -172,7 +172,7 @@ C4JStorage::SAVETRANSFER_FILE_DETAILS UIScene_LoadOrJoinMenu::m_debugTransferDet
int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
{
UIScene_LoadOrJoinMenu *pClass= static_cast<UIScene_LoadOrJoinMenu *>(lpParam);
UIScene_LoadOrJoinMenu *pClass= (UIScene_LoadOrJoinMenu *)lpParam;
app.DebugPrintf("Received data for save thumbnail\n");
@@ -184,9 +184,9 @@ int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE p
}
else
{
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = nullptr;
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = NULL;
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].dwThumbnailSize = 0;
app.DebugPrintf("Save thumbnail data is nullptr, or has size 0\n");
app.DebugPrintf("Save thumbnail data is NULL, or has size 0\n");
}
pClass->m_bSaveThumbnailReady = true;
@@ -215,7 +215,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
m_bIgnoreInput = false;
m_bShowingPartyGamesOnly = false;
m_bInParty = false;
m_currentSessions = nullptr;
m_currentSessions = NULL;
m_iState=e_SavesIdle;
//m_bRetrievingSaveInfo=false;
@@ -239,9 +239,9 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
m_bRetrievingSaveThumbnails = false;
m_bSaveThumbnailReady = false;
m_bExitScene=false;
m_pSaveDetails=nullptr;
m_pSaveDetails=NULL;
m_bSavesDisplayed=false;
m_saveDetails = nullptr;
m_saveDetails = NULL;
m_iSaveDetailsCount = 0;
m_iTexturePacksNotInstalled = 0;
m_bCopying = false;
@@ -320,7 +320,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
#ifdef _XBOX
// 4J-PB - there may be texture packs we don't have, so use the info from TMS for this
DLC_INFO *pDLCInfo=nullptr;
DLC_INFO *pDLCInfo=NULL;
// first pass - look to see if there are any that are not in the list
bool bTexturePackAlreadyListed;
@@ -399,11 +399,11 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu()
{
g_NetworkManager.SetSessionsUpdatedCallback( nullptr, nullptr );
g_NetworkManager.SetSessionsUpdatedCallback( NULL, NULL );
app.SetLiveLinkRequired( false );
delete m_currentSessions;
m_currentSessions = nullptr;
m_currentSessions = NULL;
#if TO_BE_IMPLEMENTED
// Reset the background downloading, in case we changed it by attempting to download a texture pack
@@ -705,7 +705,7 @@ void UIScene_LoadOrJoinMenu::tick()
if(!m_bSavesDisplayed)
{
m_pSaveDetails=StorageManager.ReturnSavesInfo();
if(m_pSaveDetails!=nullptr)
if(m_pSaveDetails!=NULL)
{
//CD - Fix - Adding define for ORBIS/XBOXONE
#if defined(_XBOX_ONE) || defined(__ORBIS__)
@@ -716,11 +716,11 @@ void UIScene_LoadOrJoinMenu::tick()
m_bSavesDisplayed=true;
UpdateGamesList();
if(m_saveDetails!=nullptr)
if(m_saveDetails!=NULL)
{
for(unsigned int i = 0; i < m_iSaveDetailsCount; ++i)
{
if(m_saveDetails[i].pbThumbnailData!=nullptr)
if(m_saveDetails[i].pbThumbnailData!=NULL)
{
delete m_saveDetails[i].pbThumbnailData;
}
@@ -1000,9 +1000,9 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo()
#ifdef __ORBIS__
// We need to make sure this is non-null so that we have an idea of free space
m_pSaveDetails=StorageManager.ReturnSavesInfo();
if(m_pSaveDetails==nullptr)
if(m_pSaveDetails==NULL)
{
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,nullptr,this,"save");
C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save");
}
#endif
@@ -1015,7 +1015,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo()
if( savesDir.exists() )
{
m_saves = savesDir.listFiles();
uiSaveC = static_cast<unsigned int>(m_saves->size());
uiSaveC = (unsigned int)m_saves->size();
}
// add the New Game and Tutorial after the saves list is retrieved, if there are any saves
@@ -1049,10 +1049,10 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo()
m_controlSavesTimer.setVisible(true);
m_pSaveDetails=StorageManager.ReturnSavesInfo();
if(m_pSaveDetails==nullptr)
if(m_pSaveDetails==NULL)
{
char savename[] = "save";
C4JStorage::ESaveGameState eSGIStatus = StorageManager.GetSavesInfo(m_iPad, nullptr, this, savename);
C4JStorage::ESaveGameState eSGIStatus = StorageManager.GetSavesInfo(m_iPad, NULL, this, savename);
}
#if TO_BE_IMPLEMENTED
@@ -1391,7 +1391,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr
int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes)
{
// 4J HEG - No reason to set value if keyboard was cancelled
UIScene_LoadOrJoinMenu *pClass=static_cast<UIScene_LoadOrJoinMenu *>(lpParam);
UIScene_LoadOrJoinMenu *pClass=(UIScene_LoadOrJoinMenu *)lpParam;
pClass->m_bIgnoreInput=false;
if (bRes)
{
@@ -1416,7 +1416,7 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo
// Convert the ui16Text input to a wide string
wchar_t wNewName[128] = {};
for (int k = 0; k < 127 && ui16Text[k]; k++)
wNewName[k] = static_cast<wchar_t>(ui16Text[k]);
wNewName[k] = (wchar_t)ui16Text[k];
// Convert to narrow for storage and in-memory update
char narrowName[128] = {};
@@ -1427,7 +1427,7 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo
mbstowcs(wFilename, pClass->m_saveDetails[listPos].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
wstring sidecarPath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\worldname.txt");
FILE *fw = nullptr;
FILE *fw = NULL;
if (_wfopen_s(&fw, sidecarPath.c_str(), L"w") == 0 && fw)
{
fputs(narrowName, fw);
@@ -1460,18 +1460,18 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo
}
void UIScene_LoadOrJoinMenu::handleInitFocus(F64 controlId, F64 childId)
{
app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleInitFocus - %d , %d\n", static_cast<int>(controlId), static_cast<int>(childId));
app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleInitFocus - %d , %d\n", (int)controlId, (int)childId);
}
void UIScene_LoadOrJoinMenu::handleFocusChange(F64 controlId, F64 childId)
{
app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleFocusChange - %d , %d\n", static_cast<int>(controlId), static_cast<int>(childId));
app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleFocusChange - %d , %d\n", (int)controlId, (int)childId);
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_GamesList:
m_iGameListIndex = childId;
m_buttonListGames.updateChildFocus( static_cast<int>(childId) );
m_buttonListGames.updateChildFocus( (int) childId );
break;
case eControl_SavesList:
m_iSaveListIndex = childId;
@@ -1493,18 +1493,18 @@ void UIScene_LoadOrJoinMenu::remoteStorageGetSaveCallback(LPVOID lpParam, SonyRe
void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_SavesList:
{
m_bIgnoreInput=true;
int lGenID = static_cast<int>(childId) - 1;
int lGenID = (int)childId - 1;
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
if(static_cast<int>(childId) == JOIN_LOAD_CREATE_BUTTON_INDEX)
if((int)childId == JOIN_LOAD_CREATE_BUTTON_INDEX)
{
app.SetTutorialMode( false );
@@ -1535,7 +1535,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
params->iSaveGameInfoIndex=-1;
//params->pbSaveRenamed=&m_bSaveRenamed;
params->levelGen = levelGen;
params->saveDetails = nullptr;
params->saveDetails = NULL;
// navigate to the settings scene
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_LoadMenu, params);
@@ -1546,7 +1546,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
#ifdef __ORBIS__
// check if this is a damaged save
PSAVE_INFO pSaveInfo = &m_pSaveDetails->SaveInfoA[((int)childId)-m_iDefaultButtonsC];
if(pSaveInfo->thumbnailData == nullptr && pSaveInfo->modifiedTime == 0) // no thumbnail data and time of zero and zero blocks useset for corrupt files
if(pSaveInfo->thumbnailData == NULL && pSaveInfo->modifiedTime == 0) // no thumbnail data and time of zero and zero blocks useset for corrupt files
{
// give the option to delete the save
UINT uiIDA[2];
@@ -1562,17 +1562,17 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled())
{
LoadSaveFromDisk(m_saves->at(static_cast<int>(childId)-m_iDefaultButtonsC));
LoadSaveFromDisk(m_saves->at((int)childId-m_iDefaultButtonsC));
}
else
{
LoadMenuInitData *params = new LoadMenuInitData();
params->iPad = m_iPad;
// need to get the iIndex from the list item, since the position in the list doesn't correspond to the GetSaveGameInfo list because of sorting
params->iSaveGameInfoIndex=m_saveDetails[static_cast<int>(childId)-m_iDefaultButtonsC].saveId;
params->iSaveGameInfoIndex=m_saveDetails[((int)childId)-m_iDefaultButtonsC].saveId;
//params->pbSaveRenamed=&m_bSaveRenamed;
params->levelGen = nullptr;
params->saveDetails = &m_saveDetails[ static_cast<int>(childId)-m_iDefaultButtonsC ];
params->levelGen = NULL;
params->saveDetails = &m_saveDetails[ ((int)childId)-m_iDefaultButtonsC ];
#ifdef _XBOX_ONE
// On XB1, saves might need syncing, in which case inform the user so they can decide whether they want to wait for this to happen
@@ -1606,7 +1606,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
ui.PlayUISFX(eSFX_Press);
{
int nIndex = static_cast<int>(childId);
int nIndex = (int)childId;
m_iGameListIndex = nIndex;
CheckAndJoinGame(nIndex);
}
@@ -1626,7 +1626,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
bool bContentRestricted=false;
// we're online, since we are joining a game
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&noUGC,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&noUGC,&bContentRestricted,NULL);
#ifdef __ORBIS__
// 4J Stu - On PS4 we don't restrict playing multiplayer based on chat restriction, so remove this check
@@ -1670,7 +1670,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
// Not allowed to play online
ui.RequestAlertMessage(IDS_ONLINE_GAME, IDS_CHAT_RESTRICTION_UGC, uiIDA, 1, m_iPad,nullptr,this);
ui.RequestAlertMessage(IDS_ONLINE_GAME, IDS_CHAT_RESTRICTION_UGC, uiIDA, 1, m_iPad,NULL,this);
#else
// Not allowed to play online
ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, 0 );
@@ -1715,7 +1715,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -1735,7 +1735,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
// UINT uiIDA[2];
// uiIDA[0]=IDS_CONFIRM_OK;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadOrJoinMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadOrJoinMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
m_bIgnoreInput=false;
return;
@@ -1837,7 +1837,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
NetworkGameInitData *param = new NetworkGameInitData();
param->seed = 0;
param->saveData = nullptr;
param->saveData = NULL;
param->settings = app.GetGameHostOption( eGameHostOption_Tutorial );
param->levelGen = levelGen;
@@ -1856,7 +1856,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
loadingParams->lpParam = (LPVOID)param;
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground=TRUE;
@@ -1870,9 +1870,9 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
void UIScene_LoadOrJoinMenu::UpdateGamesListCallback(LPVOID pParam)
{
if(pParam != nullptr)
if(pParam != NULL)
{
UIScene_LoadOrJoinMenu *pScene = static_cast<UIScene_LoadOrJoinMenu *>(pParam);
UIScene_LoadOrJoinMenu *pScene = (UIScene_LoadOrJoinMenu *)pParam;
pScene->UpdateGamesList();
}
}
@@ -1892,7 +1892,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
}
FriendSessionInfo *pSelectedSession = nullptr;
FriendSessionInfo *pSelectedSession = NULL;
if(DoesGamesListHaveFocus() && m_buttonListGames.getItemCount() > 0)
{
unsigned int nIndex = m_buttonListGames.getCurrentSelection();
@@ -1901,8 +1901,8 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
SessionID selectedSessionId;
ZeroMemory(&selectedSessionId,sizeof(SessionID));
if( pSelectedSession != nullptr )selectedSessionId = pSelectedSession->sessionId;
pSelectedSession = nullptr;
if( pSelectedSession != NULL )selectedSessionId = pSelectedSession->sessionId;
pSelectedSession = NULL;
m_controlJoinTimer.setVisible( false );
@@ -1917,7 +1917,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
// Update the xui list displayed
unsigned int xuiListSize = m_buttonListGames.getItemCount();
unsigned int filteredListSize = static_cast<unsigned int>(m_currentSessions->size());
unsigned int filteredListSize = (unsigned int)m_currentSessions->size();
BOOL gamesListHasFocus = DoesGamesListHaveFocus();
@@ -1968,12 +1968,12 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
HRESULT hr;
DWORD dwImageBytes=0;
PBYTE pbImageData=nullptr;
PBYTE pbImageData=NULL;
if(tp==nullptr)
if(tp==NULL)
{
DWORD dwBytes=0;
PBYTE pbData=nullptr;
PBYTE pbData=NULL;
app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes);
// is it in the tpd data ?
@@ -2174,7 +2174,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save
int64_t fileSize = saveFile->length();
FileInputStream fis(*saveFile);
byteArray ba(static_cast<unsigned int>(fileSize));
byteArray ba(fileSize);
fis.read(ba);
fis.close();
@@ -2208,7 +2208,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
loadingParams->lpParam = (LPVOID)param;
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground=TRUE;
@@ -2314,7 +2314,7 @@ static bool Win64_DeleteSaveDirectory(const wchar_t* wPath)
int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadOrJoinMenu* pClass = static_cast<UIScene_LoadOrJoinMenu *>(pParam);
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
// results switched for this dialog
// Check that we have a valid save selected (can get a bad index if the save list has been refreshed)
@@ -2336,7 +2336,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JSt
if (pClass->m_saveDetails && displayIdx >= 0 && pClass->m_saveDetails[displayIdx].UTF8SaveFilename[0])
{
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH] = {};
mbstowcs_s(nullptr, wFilename, MAX_SAVEFILENAME_LENGTH, pClass->m_saveDetails[displayIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
mbstowcs_s(NULL, wFilename, MAX_SAVEFILENAME_LENGTH, pClass->m_saveDetails[displayIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
wchar_t wFolderPath[MAX_PATH] = {};
swprintf_s(wFolderPath, MAX_PATH, L"Windows64\\GameHDD\\%s", wFilename);
bSuccess = Win64_DeleteSaveDirectory(wFolderPath);
@@ -2360,7 +2360,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JSt
int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes)
{
ui.EnterCallbackIdCriticalSection();
UIScene_LoadOrJoinMenu* pClass = static_cast<UIScene_LoadOrJoinMenu *>(ui.GetSceneFromCallbackId((size_t)lpParam));
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)ui.GetSceneFromCallbackId((size_t)lpParam);
if(pClass)
{
@@ -2380,7 +2380,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes)
int UIScene_LoadOrJoinMenu::RenameSaveDataReturned(LPVOID lpParam,bool bRes)
{
UIScene_LoadOrJoinMenu* pClass = static_cast<UIScene_LoadOrJoinMenu *>(lpParam);
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
if(bRes)
{
@@ -2412,7 +2412,7 @@ void UIScene_LoadOrJoinMenu::LoadRemoteFileFromDisk(char* remoteFilename)
int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadOrJoinMenu* pClass = static_cast<UIScene_LoadOrJoinMenu *>(pParam);
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
// results switched for this dialog
// EMessage_ResultAccept means cancel
@@ -2425,7 +2425,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JS
{
wchar_t wSaveName[128];
ZeroMemory(wSaveName, 128 * sizeof(wchar_t));
mbstowcs_s(nullptr, wSaveName, 128, pClass->m_saveDetails[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC].UTF8SaveName, _TRUNCATE);
mbstowcs_s(NULL, wSaveName, 128, pClass->m_saveDetails[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC].UTF8SaveName, _TRUNCATE);
UIKeyboardInitData kbData;
kbData.title = app.GetString(IDS_RENAME_WORLD_TITLE);
kbData.defaultText = wSaveName;
@@ -2542,7 +2542,7 @@ int UIScene_LoadOrJoinMenu::MustSignInReturnedTexturePack(void *pParam,bool bCon
if(bContinue==true)
{
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo(pClass->m_initData->selectedSession->data.texturePackParentId);
if(pSONYDLCInfo!=nullptr)
if(pSONYDLCInfo!=NULL)
{
char chName[42];
char chKeyName[20];
@@ -2551,7 +2551,7 @@ int UIScene_LoadOrJoinMenu::MustSignInReturnedTexturePack(void *pParam,bool bCon
memset(chSkuID,0,SCE_NP_COMMERCE2_SKU_ID_LEN);
// we have to retrieve the skuid from the store info, it can't be hardcoded since Sony may change it.
// So we assume the first sku for the product is the one we want
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a nullptr terminating char
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a NULL terminating char
memset(chKeyName, 0, sizeof(chKeyName));
strncpy(chKeyName, pSONYDLCInfo->chDLCKeyname, 16);
@@ -2583,7 +2583,7 @@ int UIScene_LoadOrJoinMenu::MustSignInReturnedTexturePack(void *pParam,bool bCon
int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_LoadOrJoinMenu *pClass = static_cast<UIScene_LoadOrJoinMenu *>(pParam);
UIScene_LoadOrJoinMenu *pClass = (UIScene_LoadOrJoinMenu *)pParam;
// Exit with or without saving
if(result==C4JStorage::EMessage_ResultAccept)
@@ -2605,7 +2605,7 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
#endif
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo(pClass->m_initData->selectedSession->data.texturePackParentId);
if(pSONYDLCInfo!=nullptr)
if(pSONYDLCInfo!=NULL)
{
char chName[42];
char chKeyName[20];
@@ -2614,7 +2614,7 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
memset(chSkuID,0,SCE_NP_COMMERCE2_SKU_ID_LEN);
// we have to retrieve the skuid from the store info, it can't be hardcoded since Sony may change it.
// So we assume the first sku for the product is the one we want
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a nullptr terminating char
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a NULL terminating char
memset(chKeyName, 0, sizeof(chKeyName));
strncpy(chKeyName, pSONYDLCInfo->chDLCKeyname, 16);
@@ -2648,7 +2648,7 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
wstring ProductId;
app.GetDLCFullOfferIDForPackID(pClass->m_initData->selectedSession->data.texturePackParentId,ProductId);
StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),nullptr,nullptr);
StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL);
}
else
{
@@ -2840,7 +2840,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
pMinecraft->progressRenderer->progressStart(IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD);
pMinecraft->progressRenderer->progressStage( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD );
ConsoleSaveFile* pSave = nullptr;
ConsoleSaveFile* pSave = NULL;
pClass->m_eSaveTransferState = eSaveTransfer_GetRemoteSaveInfo;
@@ -2895,10 +2895,10 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
const char* pNameUTF8 = app.getRemoteStorage()->getSaveNameUTF8();
mbstowcs(wSaveName, pNameUTF8, strlen(pNameUTF8)+1); // plus null
StorageManager.SetSaveTitle(wSaveName);
PBYTE pbThumbnailData=nullptr;
PBYTE pbThumbnailData=NULL;
DWORD dwThumbnailDataSize=0;
PBYTE pbDataSaveImage=nullptr;
PBYTE pbDataSaveImage=NULL;
DWORD dwDataSizeSaveImage=0;
StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t
@@ -3059,10 +3059,10 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter
StorageManager.ResetSaveData();
{
PBYTE pbThumbnailData=nullptr;
PBYTE pbThumbnailData=NULL;
DWORD dwThumbnailDataSize=0;
PBYTE pbDataSaveImage=nullptr;
PBYTE pbDataSaveImage=NULL;
DWORD dwDataSizeSaveImage=0;
StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t
@@ -3270,7 +3270,7 @@ void UIScene_LoadOrJoinMenu::SaveTransferReturned(LPVOID lpParam, SonyRemoteStor
}
ConsoleSaveFile* UIScene_LoadOrJoinMenu::SonyCrossSaveConvert()
{
return nullptr;
return NULL;
}
void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(LPVOID lpParam)
@@ -3493,7 +3493,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
SaveTransferStateContainer *pStateContainer = (SaveTransferStateContainer *) lpParameter;
Minecraft *pMinecraft=Minecraft::GetInstance();
ConsoleSaveFile* pSave = nullptr;
ConsoleSaveFile* pSave = NULL;
while(StorageManager.SaveTransferClearState()!=C4JStorage::eSaveTransfer_Idle)
{
@@ -3595,7 +3595,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter )
int iTextMetadataBytes = app.CreateImageTextData(bTextMetadata, seedVal, true, uiHostOptions, dwTexturePack);
// set the icon and save image
StorageManager.SetSaveImages(ba.data, ba.length, nullptr, 0, bTextMetadata, iTextMetadataBytes);
StorageManager.SetSaveImages(ba.data, ba.length, NULL, 0, bTextMetadata, iTextMetadataBytes);
delete ba.data;
}
@@ -3758,12 +3758,12 @@ void UIScene_LoadOrJoinMenu::RequestFileData( SaveTransferStateContainer *pClass
File targetFile( wstring(L"FakeTMSPP\\").append(filename) );
if(targetFile.exists())
{
HANDLE hSaveFile = CreateFile( targetFile.getPath().c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, nullptr);
HANDLE hSaveFile = CreateFile( targetFile.getPath().c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL);
m_debugTransferDetails.pbData = new BYTE[m_debugTransferDetails.ulFileLen];
DWORD numberOfBytesRead = 0;
ReadFile( hSaveFile,m_debugTransferDetails.pbData,m_debugTransferDetails.ulFileLen,&numberOfBytesRead,nullptr);
ReadFile( hSaveFile,m_debugTransferDetails.pbData,m_debugTransferDetails.ulFileLen,&numberOfBytesRead,NULL);
assert(numberOfBytesRead == m_debugTransferDetails.ulFileLen);
CloseHandle(hSaveFile);
@@ -3791,7 +3791,7 @@ int UIScene_LoadOrJoinMenu::SaveTransferReturned(LPVOID lpParam,C4JStorage::SAVE
app.DebugPrintf("Save Transfer - size is %d\n",pSaveTransferDetails->ulFileLen);
// if the file data is null, then assume this is the file size retrieval
if(pSaveTransferDetails->pbData==nullptr)
if(pSaveTransferDetails->pbData==NULL)
{
pClass->m_eSaveTransferState=C4JStorage::eSaveTransfer_FileSizeRetrieved;
UIScene_LoadOrJoinMenu::s_ulFileSize=pSaveTransferDetails->ulFileLen;

View File

@@ -12,7 +12,7 @@
Random *UIScene_MainMenu::random = new Random();
EUIScene UIScene_MainMenu::eNavigateWhenReady = static_cast<EUIScene>(-1);
EUIScene UIScene_MainMenu::eNavigateWhenReady = (EUIScene) -1;
UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
{
@@ -33,29 +33,29 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye
m_bIgnorePress=false;
m_buttons[static_cast<int>(eControl_PlayGame)].init(IDS_PLAY_GAME,eControl_PlayGame);
m_buttons[(int)eControl_PlayGame].init(IDS_PLAY_GAME,eControl_PlayGame);
#ifdef _XBOX_ONE
if(!ProfileManager.IsFullVersion()) m_buttons[(int)eControl_PlayGame].setLabel(IDS_PLAY_TRIAL_GAME);
app.SetReachedMainMenu();
#endif
m_buttons[static_cast<int>(eControl_Leaderboards)].init(IDS_LEADERBOARDS,eControl_Leaderboards);
m_buttons[static_cast<int>(eControl_Achievements)].init( (UIString)IDS_ACHIEVEMENTS,eControl_Achievements);
m_buttons[static_cast<int>(eControl_HelpAndOptions)].init(IDS_HELP_AND_OPTIONS,eControl_HelpAndOptions);
m_buttons[(int)eControl_Leaderboards].init(IDS_LEADERBOARDS,eControl_Leaderboards);
m_buttons[(int)eControl_Achievements].init( (UIString)IDS_ACHIEVEMENTS,eControl_Achievements);
m_buttons[(int)eControl_HelpAndOptions].init(IDS_HELP_AND_OPTIONS,eControl_HelpAndOptions);
if(ProfileManager.IsFullVersion())
{
m_bTrialVersion=false;
m_buttons[static_cast<int>(eControl_UnlockOrDLC)].init(IDS_DOWNLOADABLECONTENT,eControl_UnlockOrDLC);
m_buttons[(int)eControl_UnlockOrDLC].init(IDS_DOWNLOADABLECONTENT,eControl_UnlockOrDLC);
}
else
{
m_bTrialVersion=true;
m_buttons[static_cast<int>(eControl_UnlockOrDLC)].init(IDS_UNLOCK_FULL_GAME,eControl_UnlockOrDLC);
m_buttons[(int)eControl_UnlockOrDLC].init(IDS_UNLOCK_FULL_GAME,eControl_UnlockOrDLC);
}
#ifndef _DURANGO
m_buttons[static_cast<int>(eControl_Exit)].init(app.GetString(IDS_EXIT_GAME),eControl_Exit);
m_buttons[(int)eControl_Exit].init(app.GetString(IDS_EXIT_GAME),eControl_Exit);
#else
m_buttons[(int)eControl_XboxHelp].init(IDS_XBOX_HELP_APP, eControl_XboxHelp);
#endif
@@ -104,7 +104,7 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye
m_bLoadTrialOnNetworkManagerReady = false;
// 4J Stu - Clear out any loaded game rules
app.setLevelGenerationOptions(nullptr);
app.setLevelGenerationOptions(NULL);
// 4J Stu - Reset the leaving game flag so that we correctly handle signouts while in the menus
g_NetworkManager.ResetLeavingGame();
@@ -182,7 +182,7 @@ void UIScene_MainMenu::handleGainFocus(bool navBack)
if(navBack && ProfileManager.IsFullVersion())
{
// Replace the Unlock Full Game with Downloadable Content
m_buttons[static_cast<int>(eControl_UnlockOrDLC)].setLabel(IDS_DOWNLOADABLECONTENT);
m_buttons[(int)eControl_UnlockOrDLC].setLabel(IDS_DOWNLOADABLECONTENT);
}
#if TO_BE_IMPLEMENTED
@@ -196,7 +196,7 @@ void UIScene_MainMenu::handleGainFocus(bool navBack)
#ifdef __PSVITA__
int splashIndex = eSplashRandomStart + 2 + random->nextInt( (int)m_splashes.size() - (eSplashRandomStart + 2) );
#else
int splashIndex = eSplashRandomStart + 1 + random->nextInt( static_cast<int>(m_splashes.size()) - (eSplashRandomStart + 1) );
int splashIndex = eSplashRandomStart + 1 + random->nextInt( (int)m_splashes.size() - (eSplashRandomStart + 1) );
#endif
// Override splash text on certain dates
@@ -303,12 +303,12 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
int primaryPad = ProfileManager.GetPrimaryPad();
#ifdef _XBOX_ONE
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad, const int iController) = nullptr;
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad, const int iController) = NULL;
#else
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = nullptr;
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL;
#endif
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_PlayGame:
#ifdef __ORBIS__
@@ -396,7 +396,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
bool confirmUser = false;
// Note: if no sign in returned func, assume this isn't required
if (signInReturnedFunc != nullptr)
if (signInReturnedFunc != NULL)
{
if(ProfileManager.IsSignedIn(primaryPad))
{
@@ -466,10 +466,10 @@ void UIScene_MainMenu::customDrawSplash(IggyCustomDrawCallbackRegion *region)
// 4J Stu - Move this to the ctor when the main menu is not the first scene we navigate to
ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
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_fScreenWidth=(float)pMinecraft->width_phys;
m_fRawWidth=(float)ssc.rawWidth;
m_fScreenHeight=(float)pMinecraft->height_phys;
m_fRawHeight=(float)ssc.rawHeight;
// Setup GDraw, normal game render states and matrices
@@ -513,7 +513,7 @@ void UIScene_MainMenu::customDrawSplash(IggyCustomDrawCallbackRegion *region)
int UIScene_MainMenu::MustSignInReturned(void *pParam, int iPad, C4JStorage::EMessageResult result)
{
UIScene_MainMenu* pClass = static_cast<UIScene_MainMenu *>(pParam);
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
@@ -643,7 +643,7 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void *pParam,bool bContinue,
int UIScene_MainMenu::HelpAndOptions_SignInReturned(void *pParam,bool bContinue,int iPad)
#endif
{
UIScene_MainMenu *pClass = static_cast<UIScene_MainMenu *>(pParam);
UIScene_MainMenu *pClass = (UIScene_MainMenu *)pParam;
if(bContinue)
{
@@ -714,7 +714,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, int iPad)
#endif
{
UIScene_MainMenu* pClass = static_cast<UIScene_MainMenu *>(pParam);
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
if(bContinue)
{
@@ -916,7 +916,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in
int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,int iPad)
#endif
{
UIScene_MainMenu *pClass = static_cast<UIScene_MainMenu *>(pParam);
UIScene_MainMenu *pClass = (UIScene_MainMenu *)pParam;
if(bContinue)
{
@@ -940,7 +940,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in
{
bool bContentRestricted=false;
#if defined(__PS3__) || defined(__PSVITA__)
ProfileManager.GetChatAndContentRestrictions(iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL);
#endif
if(bContentRestricted)
{
@@ -986,7 +986,7 @@ int UIScene_MainMenu::Achievements_SignInReturned(void *pParam,bool bContinue,in
int UIScene_MainMenu::Achievements_SignInReturned(void *pParam,bool bContinue,int iPad)
#endif
{
UIScene_MainMenu *pClass = static_cast<UIScene_MainMenu *>(pParam);
UIScene_MainMenu *pClass = (UIScene_MainMenu *)pParam;
if (bContinue)
{
@@ -1020,7 +1020,7 @@ int UIScene_MainMenu::UnlockFullGame_SignInReturned(void *pParam,bool bContinue,
int UIScene_MainMenu::UnlockFullGame_SignInReturned(void *pParam,bool bContinue,int iPad)
#endif
{
UIScene_MainMenu* pClass = static_cast<UIScene_MainMenu *>(pParam);
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
if (bContinue)
{
@@ -1098,7 +1098,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void *
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = nullptr;
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL;
// 4J-PB - Check if there is a patch for the game
pClass->m_errorCode = ProfileManager.getNPAvailability(ProfileManager.GetPrimaryPad());
@@ -1141,7 +1141,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void *
// UINT uiIDA[1];
// uiIDA[0]=IDS_OK;
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,nullptr,pClass);
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,NULL,pClass);
}
// Check if PSN is unavailable because of age restriction
@@ -1157,7 +1157,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void *
bool confirmUser = false;
// Note: if no sign in returned func, assume this isn't required
if (signInReturnedFunc != nullptr)
if (signInReturnedFunc != NULL)
{
if(ProfileManager.IsSignedIn(primaryPad))
{
@@ -1187,7 +1187,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = nullptr;
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL;
// 4J-PB - Check if there is a patch for the game
pClass->m_errorCode = ProfileManager.getNPAvailability(ProfileManager.GetPrimaryPad());
@@ -1228,7 +1228,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo
// UINT uiIDA[1];
// uiIDA[0]=IDS_OK;
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,nullptr,pClass);
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,NULL,pClass);
}
bool confirmUser = false;
@@ -1247,7 +1247,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo
}
// Note: if no sign in returned func, assume this isn't required
if (signInReturnedFunc != nullptr)
if (signInReturnedFunc != NULL)
{
if(ProfileManager.IsSignedIn(primaryPad))
{
@@ -1600,7 +1600,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad)
bool bContentRestricted=false;
#if defined(__PS3__) || defined(__PSVITA__)
ProfileManager.GetChatAndContentRestrictions(iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL);
#endif
if(bContentRestricted)
{
@@ -1608,7 +1608,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad)
// you can't see leaderboards
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),nullptr,this);
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this);
#endif
}
else
@@ -1669,7 +1669,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
// UINT uiIDA[1];
// uiIDA[0]=IDS_OK;
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,nullptr,this);
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,NULL,this);
return;
}
@@ -1704,7 +1704,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
{
bool bContentRestricted=false;
#if defined(__PS3__) || defined(__PSVITA__)
ProfileManager.GetChatAndContentRestrictions(iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL);
#endif
if(bContentRestricted)
{
@@ -1713,7 +1713,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
// you can't see the store
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),nullptr,this);
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this);
#endif
}
else
@@ -1898,7 +1898,7 @@ void UIScene_MainMenu::tick()
{
app.DebugPrintf("[MainMenu] Navigating away from MainMenu.\n");
ui.NavigateToScene(lockedProfile, eNavigateWhenReady);
eNavigateWhenReady = static_cast<EUIScene>(-1);
eNavigateWhenReady = (EUIScene) -1;
}
#ifdef _DURANGO
else
@@ -1925,7 +1925,7 @@ void UIScene_MainMenu::tick()
// 4J-PB - need to check this user can access the store
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL);
if(bContentRestricted)
{
UINT uiIDA[1];
@@ -2102,7 +2102,7 @@ void UIScene_MainMenu::LoadTrial(void)
NetworkGameInitData *param = new NetworkGameInitData();
param->seed = 0;
param->saveData = nullptr;
param->saveData = NULL;
param->settings = app.GetGameHostOption( eGameHostOption_Tutorial ) | app.GetGameHostOption(eGameHostOption_DisableSaving);
vector<LevelGenerationOptions *> *generators = app.getLevelGenerators();
@@ -2110,7 +2110,7 @@ void UIScene_MainMenu::LoadTrial(void)
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
loadingParams->lpParam = (LPVOID)param;
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground=TRUE;
@@ -2129,7 +2129,7 @@ void UIScene_MainMenu::LoadTrial(void)
void UIScene_MainMenu::handleUnlockFullVersion()
{
m_buttons[static_cast<int>(eControl_UnlockOrDLC)].setLabel(IDS_DOWNLOADABLECONTENT,true);
m_buttons[(int)eControl_UnlockOrDLC].setLabel(IDS_DOWNLOADABLECONTENT,true);
}

View File

@@ -7,7 +7,7 @@ UIScene_MessageBox::UIScene_MessageBox(int iPad, void *initData, UILayer *parent
// Setup all the Iggy references we need for this scene
initialiseMovie();
MessageBoxInfo *param = static_cast<MessageBoxInfo *>(initData);
MessageBoxInfo *param = (MessageBoxInfo *)initData;
m_buttonCount = param->uiOptionC;
@@ -41,7 +41,7 @@ UIScene_MessageBox::UIScene_MessageBox(int iPad, void *initData, UILayer *parent
m_labelTitle.init(app.GetString(param->uiTitle));
m_labelContent.init(app.GetString(param->uiText));
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcAutoResize , 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcAutoResize , 0 , NULL );
m_Func = param->Func;
m_lpParam = param->lpParam;
@@ -84,10 +84,10 @@ void UIScene_MessageBox::handleReload()
value[0].number = m_buttonCount;
value[1].type = IGGY_DATATYPE_number;
value[1].number = static_cast<F64>(getControlFocus());
value[1].number = (F64)getControlFocus();
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcInit , 2 , value );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcAutoResize , 0 , nullptr );
out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcAutoResize , 0 , NULL );
}
void UIScene_MessageBox::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
@@ -120,7 +120,7 @@ void UIScene_MessageBox::handleInput(int iPad, int key, bool repeat, bool presse
void UIScene_MessageBox::handlePress(F64 controlId, F64 childId)
{
C4JStorage::EMessageResult result = C4JStorage::EMessage_Cancelled;
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case 0:
result = C4JStorage::EMessage_ResultAccept;

View File

@@ -19,8 +19,8 @@ UIScene_NewUpdateMessage::UIScene_NewUpdateMessage(int iPad, void *initData, UIL
message=app.FormatHTMLString(m_iPad,message);
vector<wstring> paragraphs;
size_t lastIndex = 0;
for ( size_t index = message.find(L"\r\n", lastIndex, 2);
int lastIndex = 0;
for ( int index = message.find(L"\r\n", lastIndex, 2);
index != wstring::npos;
index = message.find(L"\r\n", lastIndex, 2)
)
@@ -100,7 +100,7 @@ void UIScene_NewUpdateMessage::handleInput(int iPad, int key, bool repeat, bool
void UIScene_NewUpdateMessage::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Confirm:
{

View File

@@ -101,9 +101,9 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
TelemetryManager->RecordPauseOrInactive(m_iPad);
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != nullptr && pMinecraft->localgameModes[iPad] != nullptr )
if(pMinecraft != NULL && pMinecraft->localgameModes[iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[iPad];
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(false);
@@ -114,9 +114,9 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
UIScene_PauseMenu::~UIScene_PauseMenu()
{
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != nullptr && pMinecraft->localgameModes[m_iPad] != nullptr )
if(pMinecraft != NULL && pMinecraft->localgameModes[m_iPad] != NULL )
{
TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[m_iPad]);
TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad];
// This just allows it to be shown
gameMode->getTutorial()->showTutorialPopup(true);
@@ -506,7 +506,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
{
if(m_bIgnoreInput) return;
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case BUTTON_PAUSE_RESUMEGAME:
if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() )
@@ -593,7 +593,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
{
bool bContentRestricted=false;
#if defined(__PS3__) || defined(__PSVITA__)
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,NULL,&bContentRestricted,NULL);
#endif
if(bContentRestricted)
{
@@ -654,9 +654,9 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
if(m_iPad==ProfileManager.GetPrimaryPad())
{
int playTime = -1;
if( pMinecraft->localplayers[m_iPad] != nullptr )
if( pMinecraft->localplayers[m_iPad] != NULL )
{
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
playTime = (int)pMinecraft->localplayers[m_iPad]->getSessionTimer();
}
#if defined(_XBOX_ONE) || defined(__ORBIS__)
@@ -723,9 +723,9 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
else
{
int playTime = -1;
if( pMinecraft->localplayers[m_iPad] != nullptr )
if( pMinecraft->localplayers[m_iPad] != NULL )
{
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
playTime = (int)pMinecraft->localplayers[m_iPad]->getSessionTimer();
}
TelemetryManager->RecordLevelExit(m_iPad, eSen_LevelExitStatus_Exited);
@@ -741,9 +741,9 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
if(m_iPad==ProfileManager.GetPrimaryPad())
{
int playTime = -1;
if( pMinecraft->localplayers[m_iPad] != nullptr )
if( pMinecraft->localplayers[m_iPad] != NULL )
{
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
playTime = (int)pMinecraft->localplayers[m_iPad]->getSessionTimer();
}
// adjust the trial time played
@@ -759,9 +759,9 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
else
{
int playTime = -1;
if( pMinecraft->localplayers[m_iPad] != nullptr )
if( pMinecraft->localplayers[m_iPad] != NULL )
{
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
playTime = (int)pMinecraft->localplayers[m_iPad]->getSessionTimer();
}
TelemetryManager->RecordLevelExit(m_iPad, eSen_LevelExitStatus_Exited);
@@ -839,7 +839,7 @@ void UIScene_PauseMenu::PerformActionSaveGame()
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
{
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(tPack);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
m_pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
@@ -979,7 +979,7 @@ int UIScene_PauseMenu::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::
// 4J-PB - need to check this user can access the store
#if defined(__PS3__) || defined(__PSVITA__)
bool bContentRestricted;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL);
if(bContentRestricted)
{
UINT uiIDA[1];
@@ -1003,7 +1003,7 @@ int UIScene_PauseMenu::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::
int UIScene_PauseMenu::SaveGame_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_PauseMenu* pClass = static_cast<UIScene_PauseMenu *>(ui.GetSceneFromCallbackId((size_t)pParam));
UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
if(pClass) pClass->SetIgnoreInput(false);
if(bContinue==true)
@@ -1112,7 +1112,7 @@ int UIScene_PauseMenu::ViewLeaderboards_SignInReturned(void *pParam,bool bContin
{
#ifndef __ORBIS__
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(pClass->m_iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(pClass->m_iPad,true,NULL,&bContentRestricted,NULL);
if(bContentRestricted)
{
// you can't see leaderboards
@@ -1183,7 +1183,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J
#ifndef __ORBIS__
// 4J-PB - need to check this user can access the store
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL);
if(bContentRestricted)
{
UINT uiIDA[1];
@@ -1203,7 +1203,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J
app.DebugPrintf("Texture Pack - %s\n",pchPackName);
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName);
if(pSONYDLCInfo!=nullptr)
if(pSONYDLCInfo!=NULL)
{
char chName[42];
char chKeyName[20];
@@ -1214,7 +1214,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J
// we have to retrieve the skuid from the store info, it can't be hardcoded since Sony may change it.
// So we assume the first sku for the product is the one we want
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a nullptr terminating char
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a NULL terminating char
memset(chKeyName, 0, sizeof(chKeyName));
strncpy(chKeyName, pSONYDLCInfo->chDLCKeyname, 16);
@@ -1260,7 +1260,7 @@ int UIScene_PauseMenu::BuyTexturePack_SignInReturned(void *pParam,bool bContinue
#ifndef __ORBIS__
// 4J-PB - need to check this user can access the store
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(iPad,true,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL);
if(bContentRestricted)
{
UINT uiIDA[1];
@@ -1280,7 +1280,7 @@ int UIScene_PauseMenu::BuyTexturePack_SignInReturned(void *pParam,bool bContinue
app.DebugPrintf("Texture Pack - %s\n",pchPackName);
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName);
if(pSONYDLCInfo!=nullptr)
if(pSONYDLCInfo!=NULL)
{
char chName[42];
char chKeyName[20];
@@ -1291,7 +1291,7 @@ int UIScene_PauseMenu::BuyTexturePack_SignInReturned(void *pParam,bool bContinue
// we have to retrieve the skuid from the store info, it can't be hardcoded since Sony may change it.
// So we assume the first sku for the product is the one we want
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a nullptr terminating char
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a NULL terminating char
memset(chKeyName, 0, sizeof(chKeyName));
strncpy(chKeyName, pSONYDLCInfo->chDLCKeyname, 16);

View File

@@ -11,7 +11,7 @@ UIScene_QuadrantSignin::UIScene_QuadrantSignin(int iPad, void *_initData, UILaye
// Setup all the Iggy references we need for this scene
initialiseMovie();
m_signInInfo = *static_cast<SignInInfo *>(_initData);
m_signInInfo = *((SignInInfo *)_initData);
m_bIgnoreInput = false;
@@ -167,7 +167,7 @@ int UIScene_QuadrantSignin::SignInReturned(void *pParam,bool bContinue, int iPad
{
app.DebugPrintf("SignInReturned for pad %d\n", iPad);
UIScene_QuadrantSignin *pClass = static_cast<UIScene_QuadrantSignin *>(pParam);
UIScene_QuadrantSignin *pClass = (UIScene_QuadrantSignin *)pParam;
#ifdef _XBOX_ONE
if(bContinue && pClass->m_signInInfo.requireOnline && ProfileManager.IsSignedIn(iPad))
@@ -264,7 +264,7 @@ void UIScene_QuadrantSignin::setControllerState(int iPad, EControllerStatus stat
value[0].number = iPad;
value[1].type = IGGY_DATATYPE_number;
value[1].number = static_cast<int>(state);
value[1].number = (int)state;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetControllerStatus , 2 , value );
}
@@ -272,9 +272,9 @@ void UIScene_QuadrantSignin::setControllerState(int iPad, EControllerStatus stat
int UIScene_QuadrantSignin::AvatarReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
{
UIScene_QuadrantSignin *pClass = static_cast<UIScene_QuadrantSignin *>(lpParam);
UIScene_QuadrantSignin *pClass = (UIScene_QuadrantSignin *)lpParam;
app.DebugPrintf(app.USER_SR,"AvatarReturned callback\n");
if(pbThumbnail != nullptr)
if(pbThumbnail != NULL)
{
// 4J-JEV - Added to ensure each new texture gets a unique name.
static unsigned int quadrantImageCount = 0;

View File

@@ -36,7 +36,7 @@ void UIScene_ReinstallMenu::updateTooltips()
void UIScene_ReinstallMenu::updateComponents()
{
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);

View File

@@ -19,7 +19,7 @@ UIScene_SaveMessage::UIScene_SaveMessage(int iPad, void *initData, UILayer *pare
IggyDataValue result;
// Russian needs to resize the box
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcAutoResize , 0 , nullptr );
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcAutoResize , 0 , NULL );
// 4J-PB - If we have a signed in user connected, let's get the DLC now
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
@@ -101,7 +101,7 @@ void UIScene_SaveMessage::handleInput(int iPad, int key, bool repeat, bool press
void UIScene_SaveMessage::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_Confirm:

View File

@@ -47,7 +47,7 @@ void UIScene_SettingsAudioMenu::updateTooltips()
void UIScene_SettingsAudioMenu::updateComponents()
{
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
@@ -93,8 +93,8 @@ void UIScene_SettingsAudioMenu::handleInput(int iPad, int key, bool repeat, bool
void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
WCHAR TempString[256];
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
int value = (int)currentValue;
switch((int)sliderId)
{
case eControl_Music:
m_sliderMusic.handleSliderMove(value);

View File

@@ -47,7 +47,7 @@ void UIScene_SettingsControlMenu::updateTooltips()
void UIScene_SettingsControlMenu::updateComponents()
{
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
if(bNotInGame)
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
@@ -93,8 +93,8 @@ void UIScene_SettingsControlMenu::handleInput(int iPad, int key, bool repeat, bo
void UIScene_SettingsControlMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
WCHAR TempString[256];
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
int value = (int)currentValue;
switch((int)sliderId)
{
case eControl_SensitivityInGame:
m_sliderSensitivityInGame.handleSliderMove(value);

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