Merge with upstream
This commit is contained in:
commit
ad1a4ecc68
2031 changed files with 40476 additions and 27116 deletions
|
|
@ -8,8 +8,9 @@
|
|||
#include "..\Minecraft.World\File.h"
|
||||
#include "..\Minecraft.World\StringHelpers.h"
|
||||
#include "Minimap.h"
|
||||
#include "Common/UI/UI.h"
|
||||
|
||||
TexturePack *TexturePackRepository::DEFAULT_TEXTURE_PACK = NULL;
|
||||
TexturePack *TexturePackRepository::DEFAULT_TEXTURE_PACK = nullptr;
|
||||
|
||||
TexturePackRepository::TexturePackRepository(File workingDirectory, Minecraft *minecraft)
|
||||
{
|
||||
|
|
@ -17,7 +18,7 @@ TexturePackRepository::TexturePackRepository(File workingDirectory, Minecraft *m
|
|||
|
||||
// 4J - added
|
||||
usingWeb = false;
|
||||
selected = NULL;
|
||||
selected = nullptr;
|
||||
texturePacks = new vector<TexturePack *>;
|
||||
|
||||
this->minecraft = minecraft;
|
||||
|
|
@ -28,9 +29,9 @@ TexturePackRepository::TexturePackRepository(File workingDirectory, Minecraft *m
|
|||
|
||||
DEFAULT_TEXTURE_PACK->loadColourTable();
|
||||
|
||||
m_dummyTexturePack = NULL;
|
||||
m_dummyDLCTexturePack = NULL;
|
||||
lastSelected = NULL;
|
||||
m_dummyTexturePack = nullptr;
|
||||
m_dummyDLCTexturePack = nullptr;
|
||||
lastSelected = nullptr;
|
||||
|
||||
updateList();
|
||||
}
|
||||
|
|
@ -49,13 +50,13 @@ void TexturePackRepository::addDebugPacks()
|
|||
{
|
||||
DLCPack *pack = app.m_dlcManager.getPack(L"DLCTestPack");
|
||||
|
||||
if( pack != NULL && pack->IsCorrupt() )
|
||||
if( pack != nullptr && pack->IsCorrupt() )
|
||||
{
|
||||
app.m_dlcManager.removePack(pack);
|
||||
pack = NULL;
|
||||
pack = nullptr;
|
||||
}
|
||||
|
||||
if(pack == NULL)
|
||||
if(pack == nullptr)
|
||||
{
|
||||
wprintf(L"Pack \"%ls\" is not installed, so adding it\n", L"DLCTestPack");
|
||||
pack = new DLCPack(L"DLCTestPack",0xffffffff);
|
||||
|
|
@ -164,7 +165,7 @@ void TexturePackRepository::updateList()
|
|||
currentPacks->push_back(m_dummyTexturePack);
|
||||
cacheById[m_dummyTexturePack->getId()] = m_dummyTexturePack;
|
||||
|
||||
if(m_dummyDLCTexturePack != NULL)
|
||||
if(m_dummyDLCTexturePack != nullptr)
|
||||
{
|
||||
currentPacks->push_back(m_dummyDLCTexturePack);
|
||||
cacheById[m_dummyDLCTexturePack->getId()] = m_dummyDLCTexturePack;
|
||||
|
|
@ -268,7 +269,7 @@ wstring TexturePackRepository::getIdOrNull(File file)
|
|||
return file.getName() + ":folder:" + file.lastModified();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#endif
|
||||
return L"";
|
||||
}
|
||||
|
|
@ -398,17 +399,17 @@ TexturePack *TexturePackRepository::getTexturePackById(DWORD id)
|
|||
return it->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TexturePack *TexturePackRepository::addTexturePackFromDLC(DLCPack *dlcPack, DWORD id)
|
||||
{
|
||||
TexturePack *newPack = NULL;
|
||||
TexturePack *newPack = nullptr;
|
||||
// 4J-PB - The City texture pack went out with a child id for the texture pack of 1 instead of zero
|
||||
// we need to mask off the child id here to deal with this
|
||||
DWORD dwParentID=id&0xFFFFFF; // child id is <<24 and Or'd with parent
|
||||
|
||||
if(dlcPack != NULL)
|
||||
if(dlcPack != nullptr)
|
||||
{
|
||||
newPack = new DLCTexturePack(dwParentID, dlcPack, DEFAULT_TEXTURE_PACK);
|
||||
texturePacks->push_back(newPack);
|
||||
|
|
@ -449,7 +450,7 @@ void TexturePackRepository::removeTexturePackById(DWORD id)
|
|||
texturePacks->erase(it2);
|
||||
if(lastSelected == oldPack)
|
||||
{
|
||||
lastSelected = NULL;
|
||||
lastSelected = nullptr;
|
||||
}
|
||||
}
|
||||
m_texturePacksToDelete.push_back(oldPack);
|
||||
|
|
@ -458,19 +459,19 @@ void TexturePackRepository::removeTexturePackById(DWORD id)
|
|||
|
||||
void TexturePackRepository::updateUI()
|
||||
{
|
||||
if(lastSelected != NULL && lastSelected != selected)
|
||||
if(lastSelected != nullptr && lastSelected != selected)
|
||||
{
|
||||
lastSelected->unloadUI();
|
||||
selected->loadUI();
|
||||
Minimap::reloadColours();
|
||||
ui.StartReloadSkinThread();
|
||||
lastSelected = NULL;
|
||||
lastSelected = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool TexturePackRepository::needsUIUpdate()
|
||||
{
|
||||
return lastSelected != NULL && lastSelected != selected;
|
||||
return lastSelected != nullptr && lastSelected != selected;
|
||||
}
|
||||
|
||||
unsigned int TexturePackRepository::getTexturePackCount()
|
||||
|
|
@ -480,7 +481,7 @@ unsigned int TexturePackRepository::getTexturePackCount()
|
|||
|
||||
TexturePack *TexturePackRepository::getTexturePackByIndex(unsigned int index)
|
||||
{
|
||||
TexturePack *pack = NULL;
|
||||
TexturePack *pack = nullptr;
|
||||
if(index < texturePacks->size())
|
||||
{
|
||||
pack = texturePacks->at(index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue