refactor: unglob std::wstring

This commit is contained in:
Tropical
2026-03-06 11:50:22 -06:00
parent 41db813a6d
commit cdc08700e4
581 changed files with 2156 additions and 2154 deletions
@@ -4,7 +4,7 @@
#include "../../../Minecraft.World/IO/Streams/InputOutputStream.h"
#include "../../../Minecraft.World/Util/StringHelpers.h"
AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name)
AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const std::wstring &name, TexturePack *fallback) : id(id), name(name)
{
// 4J init
textureId = -1;
@@ -25,7 +25,7 @@ AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &na
//loadDescription();
}
wstring AbstractTexturePack::trim(wstring line)
std::wstring AbstractTexturePack::trim(std::wstring line)
{
if (!line.empty() && line.length() > 34)
{
@@ -101,7 +101,7 @@ void AbstractTexturePack::loadName()
{
}
InputStream *AbstractTexturePack::getResource(const wstring &name, bool allowFallback) //throws IOException
InputStream *AbstractTexturePack::getResource(const std::wstring &name, bool allowFallback) //throws IOException
{
app.DebugPrintf("texture - %ls\n",name.c_str());
InputStream *is = getResourceImplementation(name);
@@ -114,7 +114,7 @@ InputStream *AbstractTexturePack::getResource(const wstring &name, bool allowFal
}
// 4J Currently removed due to override in TexturePack class
//InputStream *AbstractTexturePack::getResource(const wstring &name) //throws IOException
//InputStream *AbstractTexturePack::getResource(const std::wstring &name) //throws IOException
//{
// return getResource(name, true);
//}
@@ -145,7 +145,7 @@ void AbstractTexturePack::load(Textures *textures)
}
}
bool AbstractTexturePack::hasFile(const wstring &name, bool allowFallback)
bool AbstractTexturePack::hasFile(const std::wstring &name, bool allowFallback)
{
bool hasFile = this->hasFile(name);
@@ -157,34 +157,34 @@ DWORD AbstractTexturePack::getId()
return id;
}
wstring AbstractTexturePack::getName()
std::wstring AbstractTexturePack::getName()
{
return texname;
}
wstring AbstractTexturePack::getWorldName()
std::wstring AbstractTexturePack::getWorldName()
{
return m_wsWorldName;
}
wstring AbstractTexturePack::getDesc1()
std::wstring AbstractTexturePack::getDesc1()
{
return desc1;
}
wstring AbstractTexturePack::getDesc2()
std::wstring AbstractTexturePack::getDesc2()
{
return desc2;
}
wstring AbstractTexturePack::getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback)
std::wstring AbstractTexturePack::getAnimationString(const std::wstring &textureName, const std::wstring &path, bool allowFallback)
{
return getAnimationString(textureName, path);
}
wstring AbstractTexturePack::getAnimationString(const wstring &textureName, const wstring &path)
std::wstring AbstractTexturePack::getAnimationString(const std::wstring &textureName, const std::wstring &path)
{
wstring animationDefinitionFile = textureName + L".txt";
std::wstring animationDefinitionFile = textureName + L".txt";
bool requiresFallback = !hasFile(L"\\" + textureName + L".png", false);
@@ -197,9 +197,9 @@ wstring AbstractTexturePack::getAnimationString(const wstring &textureName, cons
InputStreamReader isr(fileStream);
BufferedReader br(&isr);
wstring result = L"";
std::wstring result = L"";
wstring line = br.readLine();
std::wstring line = br.readLine();
while (!line.empty())
{
line = trimString(line);
@@ -215,7 +215,7 @@ wstring AbstractTexturePack::getAnimationString(const wstring &textureName, cons
return result;
}
BufferedImage *AbstractTexturePack::getImageResource(const wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/)
BufferedImage *AbstractTexturePack::getImageResource(const std::wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const std::wstring &drive /*=L""*/)
{
const char *pchTexture=wstringtofilename(File);
app.DebugPrintf("AbstractTexturePack::getImageResource - %s, drive is %s\n",pchTexture, wstringtofilename(drive));
@@ -361,7 +361,7 @@ void AbstractTexturePack::unloadUI()
// Do nothing
}
wstring AbstractTexturePack::getXuiRootPath()
std::wstring AbstractTexturePack::getXuiRootPath()
{
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
@@ -9,15 +9,15 @@ class AbstractTexturePack : public TexturePack
{
private:
const DWORD id;
const wstring name;
const std::wstring name;
protected:
File *file;
wstring texname;
wstring m_wsWorldName;
std::wstring texname;
std::wstring m_wsWorldName;
wstring desc1;
wstring desc2;
std::wstring desc1;
std::wstring desc2;
PBYTE m_iconData;
DWORD m_iconSize;
@@ -36,10 +36,10 @@ private:
int textureId;
protected:
AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback);
AbstractTexturePack(DWORD id, File *file, const std::wstring &name, TexturePack *fallback);
private:
static wstring trim(wstring line);
static std::wstring trim(std::wstring line);
protected:
virtual void loadIcon();
@@ -48,29 +48,29 @@ protected:
virtual void loadName();
public:
virtual InputStream *getResource(const wstring &name, bool allowFallback); //throws IOException
virtual InputStream *getResource(const std::wstring &name, bool allowFallback); //throws IOException
// 4J Removed do to current override in TexturePack class
//virtual InputStream *getResource(const wstring &name); //throws IOException
//virtual InputStream *getResource(const std::wstring &name); //throws IOException
virtual DLCPack * getDLCPack() =0;
protected:
virtual InputStream *getResourceImplementation(const wstring &name) = 0; // throws IOException;
virtual InputStream *getResourceImplementation(const std::wstring &name) = 0; // throws IOException;
public:
virtual void unload(Textures *textures);
virtual void load(Textures *textures);
virtual bool hasFile(const wstring &name, bool allowFallback);
virtual bool hasFile(const wstring &name) = 0;
virtual bool hasFile(const std::wstring &name, bool allowFallback);
virtual bool hasFile(const std::wstring &name) = 0;
virtual DWORD getId();
virtual wstring getName();
virtual wstring getDesc1();
virtual wstring getDesc2();
virtual wstring getWorldName();
virtual std::wstring getName();
virtual std::wstring getDesc1();
virtual std::wstring getDesc2();
virtual std::wstring getWorldName();
virtual wstring getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback);
virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path, bool allowFallback);
protected:
virtual wstring getAnimationString(const wstring &textureName, const wstring &path);
virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path);
void loadDefaultUI();
void loadDefaultColourTable();
void loadDefaultHTMLColourTable();
@@ -79,11 +79,11 @@ protected:
#endif
public:
virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L"");
virtual BufferedImage *getImageResource(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L"");
virtual void loadColourTable();
virtual void loadUI();
virtual void unloadUI();
virtual wstring getXuiRootPath();
virtual std::wstring getXuiRootPath();
virtual PBYTE getPackIcon(DWORD &dwImageBytes);
virtual PBYTE getPackComparison(DWORD &dwImageBytes);
virtual unsigned int getDLCParentPackId();
@@ -101,7 +101,7 @@ void DLCTexturePack::loadDescription()
}
}
wstring DLCTexturePack::getResource(const wstring& name)
std::wstring DLCTexturePack::getResource(const std::wstring& name)
{
// 4J Stu - We should never call this function
#ifndef __CONTENT_PACKAGE
@@ -110,7 +110,7 @@ wstring DLCTexturePack::getResource(const wstring& name)
return L"";
}
InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //throws IOException
InputStream *DLCTexturePack::getResourceImplementation(const std::wstring &name) //throws IOException
{
// 4J Stu - We should never call this function
#ifndef _CONTENT_PACKAGE
@@ -120,7 +120,7 @@ InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //th
return NULL; //resource;
}
bool DLCTexturePack::hasFile(const wstring &name)
bool DLCTexturePack::hasFile(const std::wstring &name)
{
bool hasFile = false;
if(m_dlcDataPack != NULL) hasFile = m_dlcDataPack->doesPackContainFile(DLCManager::e_DLCType_Texture, name);
@@ -132,16 +132,16 @@ bool DLCTexturePack::isTerrainUpdateCompatible()
return true;
}
wstring DLCTexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
std::wstring DLCTexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
{
return L"";
}
wstring DLCTexturePack::getAnimationString(const wstring &textureName, const wstring &path)
std::wstring DLCTexturePack::getAnimationString(const std::wstring &textureName, const std::wstring &path)
{
wstring result = L"";
std::wstring result = L"";
wstring fullpath = L"res/" + path + textureName + L".png";
std::wstring fullpath = L"res/" + path + textureName + L".png";
if(hasFile(fullpath))
{
result = m_dlcDataPack->getFile(DLCManager::e_DLCType_Texture, fullpath)->getParameterAsString(DLCManager::e_DLCParamType_Anim);
@@ -150,7 +150,7 @@ wstring DLCTexturePack::getAnimationString(const wstring &textureName, const wst
return result;
}
BufferedImage *DLCTexturePack::getImageResource(const wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/)
BufferedImage *DLCTexturePack::getImageResource(const std::wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const std::wstring &drive /*=L""*/)
{
if(m_dlcDataPack) return new BufferedImage(m_dlcDataPack, L"/" + File, filenameHasExtension);
else return fallback->getImageResource(File, filenameHasExtension, bTitleUpdateTexture, drive);
@@ -267,7 +267,7 @@ void DLCTexturePack::loadData()
wstring DLCTexturePack::getFilePath(DWORD packId, wstring filename, bool bAddDataFolder)
std::wstring DLCTexturePack::getFilePath(DWORD packId, std::wstring filename, bool bAddDataFolder)
{
return app.getFilePath(packId,filename,bAddDataFolder);
}
@@ -288,7 +288,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
texturePack->setHasAudio(false);
DWORD dwFilesProcessed = 0;
// Load the DLC textures
wstring dataFilePath = texturePack->m_dlcInfoPack->getFullDataPath();
std::wstring dataFilePath = texturePack->m_dlcInfoPack->getFullDataPath();
if(!dataFilePath.empty())
{
if(!app.m_dlcManager.readDLCDataFile(dwFilesProcessed, getFilePath(texturePack->m_dlcInfoPack->GetPackID(), dataFilePath),texturePack->m_dlcDataPack))
@@ -301,7 +301,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
if(texturePack->m_dlcDataPack != NULL)
{
#ifdef _XBOX
File xzpPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"TexturePack.xzp") ) );
File xzpPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"TexturePack.xzp") ) );
if(xzpPath.exists())
{
@@ -332,7 +332,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
}
}
#else
File archivePath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"media.arc") ) );
File archivePath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"media.arc") ) );
if(archivePath.exists()) texturePack->m_archiveFile = new ArchiveFile(archivePath);
#endif
@@ -355,7 +355,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
if (grf.exists())
{
#if defined(_UNICODE) && !defined(__linux__)
wstring path = grf.getPath();
std::wstring path = grf.getPath();
const WCHAR *pchFilename=path.c_str();
HANDLE fileHandle = CreateFile(
pchFilename, // file name
@@ -407,7 +407,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
if (grf.exists())
{
#if defined(_UNICODE) && !defined(__linux__)
wstring path = grf.getPath();
std::wstring path = grf.getPath();
const WCHAR *pchFilename=path.c_str();
HANDLE fileHandle = CreateFile(
pchFilename, // file name
@@ -452,8 +452,8 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen
// any audio data?
#ifdef _XBOX
File audioXSBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"MashUp.xsb") ) );
File audioXWBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"MashUp.xwb") ) );
File audioXSBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"MashUp.xsb") ) );
File audioXWBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"MashUp.xwb") ) );
if(audioXSBPath.exists() && audioXWBPath.exists())
{
@@ -584,9 +584,9 @@ void DLCTexturePack::unloadUI()
bUILoaded = false;
}
wstring DLCTexturePack::getXuiRootPath()
std::wstring DLCTexturePack::getXuiRootPath()
{
wstring path = L"";
std::wstring path = L"";
if(m_dlcDataPack != NULL && m_dlcDataPack->doesPackContainFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp"))
{
DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp");
@@ -25,7 +25,7 @@ public:
DLCTexturePack(DWORD id, DLCPack *pack, TexturePack *fallback);
~DLCTexturePack();
virtual wstring getResource(const wstring& name);
virtual std::wstring getResource(const std::wstring& name);
virtual DLCPack * getDLCPack();
// Added for sound banks with MashUp packs
#ifdef _XBOX
@@ -38,31 +38,31 @@ protected:
void loadComparison();
void loadName();
void loadDescription();
InputStream *getResourceImplementation(const wstring &name); //throws IOException
InputStream *getResourceImplementation(const std::wstring &name); //throws IOException
public:
//@Override
bool hasFile(const wstring &name);
bool hasFile(const std::wstring &name);
bool isTerrainUpdateCompatible();
// 4J Added
virtual wstring getPath(bool bTitleUpdateTexture = false);
virtual wstring getAnimationString(const wstring &textureName, const wstring &path);
virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L"");
virtual std::wstring getPath(bool bTitleUpdateTexture = false);
virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path);
virtual BufferedImage *getImageResource(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L"");
virtual void loadColourTable();
virtual bool hasData() { return m_bHasLoadedData; }
virtual bool isLoadingData() { return m_bLoadingData; }
private:
static wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder);
static wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder=true);
static std::wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder);
static std::wstring getFilePath(DWORD packId, std::wstring filename, bool bAddDataFolder=true);
public:
static int packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask);
virtual void loadData();
virtual void loadUI();
virtual void unloadUI();
virtual wstring getXuiRootPath();
virtual std::wstring getXuiRootPath();
virtual ArchiveFile *getArchiveFile() { return m_archiveFile; }
virtual unsigned int getDLCParentPackId();
@@ -45,7 +45,7 @@ void DefaultTexturePack::loadName()
texname = L"Minecraft";
}
bool DefaultTexturePack::hasFile(const wstring &name)
bool DefaultTexturePack::hasFile(const std::wstring &name)
{
// return DefaultTexturePack::class->getResourceAsStream(name) != null;
return true;
@@ -56,9 +56,9 @@ bool DefaultTexturePack::isTerrainUpdateCompatible()
return true;
}
InputStream *DefaultTexturePack::getResourceImplementation(const wstring &name)// throws FileNotFoundException
InputStream *DefaultTexturePack::getResourceImplementation(const std::wstring &name)// throws FileNotFoundException
{
wstring wDrive = L"";
std::wstring wDrive = L"";
// Make the content package point to to the UPDATE: drive is needed
#ifdef _XBOX
#ifdef _TU_BUILD
@@ -84,14 +84,14 @@ InputStream *DefaultTexturePack::getResourceImplementation(const wstring &name)/
}
wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
wDrive = wstr + L"\\Common\\res\\TitleUpdate\\res";
#elif __PSVITA__
/*
char *pchUsrDir=getUsrDirPath();
wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
wDrive = wstr + L"Common\\res\\TitleUpdate\\res";
*/
@@ -15,14 +15,14 @@ protected:
public:
//@Override
bool hasFile(const wstring &name);
bool hasFile(const std::wstring &name);
bool isTerrainUpdateCompatible();
wstring getDesc1() {return app.GetString(IDS_DEFAULT_TEXTUREPACK);}
std::wstring getDesc1() {return app.GetString(IDS_DEFAULT_TEXTUREPACK);}
protected:
//@Override
InputStream *getResourceImplementation(const wstring &name); // throws FileNotFoundException
InputStream *getResourceImplementation(const std::wstring &name); // throws FileNotFoundException
public:
virtual bool hasData() { return true; }
@@ -24,7 +24,7 @@ void FileTexturePack::unload(Textures *textures)
#endif
}
InputStream *FileTexturePack::getResourceImplementation(const wstring &name) //throws IOException
InputStream *FileTexturePack::getResourceImplementation(const std::wstring &name) //throws IOException
{
#if 0
loadZipFile();
@@ -39,7 +39,7 @@ InputStream *FileTexturePack::getResourceImplementation(const wstring &name) //t
return NULL;
}
bool FileTexturePack::hasFile(const wstring &name)
bool FileTexturePack::hasFile(const std::wstring &name)
{
#if 0
try {
@@ -18,11 +18,11 @@ public:
void unload(Textures *textures);
protected:
InputStream *getResourceImplementation(const wstring &name); //throws IOException
InputStream *getResourceImplementation(const std::wstring &name); //throws IOException
public:
//@Override
bool hasFile(const wstring &name);
bool hasFile(const std::wstring &name);
private:
void loadZipFile(); //throws IOException
@@ -1,7 +1,7 @@
#include "../../Build/stdafx.h"
#include "FolderTexturePack.h"
FolderTexturePack::FolderTexturePack(DWORD id, const wstring &name, File *folder, TexturePack *fallback) : AbstractTexturePack(id, folder, name, fallback)
FolderTexturePack::FolderTexturePack(DWORD id, const std::wstring &name, File *folder, TexturePack *fallback) : AbstractTexturePack(id, folder, name, fallback)
{
// 4J Stu - These calls need to be in the most derived version of the class
loadIcon();
@@ -11,7 +11,7 @@ FolderTexturePack::FolderTexturePack(DWORD id, const wstring &name, File *folder
bUILoaded = false;
}
InputStream *FolderTexturePack::getResourceImplementation(const wstring &name) //throws IOException
InputStream *FolderTexturePack::getResourceImplementation(const std::wstring &name) //throws IOException
{
#if 0
final File file = new File(this.file, name.substring(1));
@@ -22,7 +22,7 @@ InputStream *FolderTexturePack::getResourceImplementation(const wstring &name) /
return new BufferedInputStream(new FileInputStream(file));
#endif
wstring wDrive = L"";
std::wstring wDrive = L"";
// Make the content package point to to the UPDATE: drive is needed
#ifdef _XBOX
wDrive=L"GAME:\\DummyTexturePack\\res";
@@ -40,7 +40,7 @@ InputStream *FolderTexturePack::getResourceImplementation(const wstring &name) /
return resource;
}
bool FolderTexturePack::hasFile(const wstring &name)
bool FolderTexturePack::hasFile(const std::wstring &name)
{
File file = File( getPath() + name);
return file.exists() && file.isFile();
@@ -58,9 +58,9 @@ bool FolderTexturePack::isTerrainUpdateCompatible()
return true;
}
wstring FolderTexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
std::wstring FolderTexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
{
wstring wDrive;
std::wstring wDrive;
#ifdef _XBOX
wDrive=L"GAME:\\" + file->getPath() + L"\\";
#else
@@ -8,19 +8,19 @@ private:
bool bUILoaded;
public:
FolderTexturePack(DWORD id, const wstring &name, File *folder, TexturePack *fallback);
FolderTexturePack(DWORD id, const std::wstring &name, File *folder, TexturePack *fallback);
protected:
//@Override
InputStream *getResourceImplementation(const wstring &name); //throws IOException
InputStream *getResourceImplementation(const std::wstring &name); //throws IOException
public:
//@Override
bool hasFile(const wstring &name);
bool hasFile(const std::wstring &name);
bool isTerrainUpdateCompatible();
// 4J Added
virtual wstring getPath(bool bTitleUpdateTexture = false);
virtual std::wstring getPath(bool bTitleUpdateTexture = false);
virtual void loadUI();
virtual void unloadUI();
};
@@ -1,9 +1,9 @@
#include "../../Build/stdafx.h"
#include "TexturePack.h"
wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
std::wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
{
wstring wDrive;
std::wstring wDrive;
#ifdef _XBOX
if(bTitleUpdateTexture)
{
@@ -27,7 +27,7 @@ wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
char *pchUsrDir=getUsrDirPath();
wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
if(bTitleUpdateTexture)
{
@@ -42,7 +42,7 @@ wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/)
#elif __PSVITA__
char *pchUsrDir="";//getUsrDirPath();
wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir));
if(bTitleUpdateTexture)
{
+11 -11
View File
@@ -19,16 +19,16 @@ public:
virtual void loadData() {}
virtual void unload(Textures *textures) = 0;
virtual void load(Textures *textures) = 0;
virtual InputStream *getResource(const wstring &name, bool allowFallback) = 0;// throws IOException;
//virtual InputStream *getResource(const wstring &name) = 0;// throws IOException;
virtual InputStream *getResource(const std::wstring &name, bool allowFallback) = 0;// throws IOException;
//virtual InputStream *getResource(const std::wstring &name) = 0;// throws IOException;
virtual DWORD getId() = 0;
virtual wstring getName() = 0;
virtual wstring getDesc1() = 0;
virtual wstring getDesc2() = 0;
virtual bool hasFile(const wstring &name, bool allowFallback) = 0;
virtual std::wstring getName() = 0;
virtual std::wstring getDesc1() = 0;
virtual std::wstring getDesc2() = 0;
virtual bool hasFile(const std::wstring &name, bool allowFallback) = 0;
virtual bool isTerrainUpdateCompatible() = 0;
virtual wstring getResource(const wstring& name) // 4J - changed to just return a name rather than an input stream
virtual std::wstring getResource(const std::wstring& name) // 4J - changed to just return a name rather than an input stream
{
/* 4J - TODO
return TexturePack.class.getResourceAsStream(name);
@@ -39,13 +39,13 @@ public:
// 4J Added
virtual wstring getPath(bool bTitleUpdateTexture = false);
virtual wstring getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback) = 0;
virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L"") = 0;
virtual std::wstring getPath(bool bTitleUpdateTexture = false);
virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path, bool allowFallback) = 0;
virtual BufferedImage *getImageResource(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L"") = 0;
virtual void loadColourTable() = 0;
virtual void loadUI() = 0;
virtual void unloadUI() = 0;
virtual wstring getXuiRootPath() = 0;
virtual std::wstring getXuiRootPath() = 0;
virtual PBYTE getPackIcon(DWORD &dwImageBytes) = 0;
virtual PBYTE getPackComparison(DWORD &dwImageBytes) = 0;
virtual unsigned int getDLCParentPackId() = 0;
@@ -105,7 +105,7 @@ bool TexturePackRepository::selectSkin(TexturePack *skin)
return true;
}
void TexturePackRepository::selectWebSkin(const wstring &url)
void TexturePackRepository::selectWebSkin(const std::wstring &url)
{
app.DebugPrintf("TexturePackRepository::selectWebSkin is not implemented\n");
#if 0
@@ -117,7 +117,7 @@ void TexturePackRepository::selectWebSkin(const wstring &url)
#endif
}
void TexturePackRepository::downloadWebSkin(const wstring &url, File file)
void TexturePackRepository::downloadWebSkin(const std::wstring &url, File file)
{
app.DebugPrintf("TexturePackRepository::selectWebSkin is not implemented\n");
#if 0
@@ -219,7 +219,7 @@ void TexturePackRepository::updateList()
#endif
}
wstring TexturePackRepository::getIdOrNull(File file)
std::wstring TexturePackRepository::getIdOrNull(File file)
{
app.DebugPrintf("TexturePackRepository::getIdOrNull is not implemented\n");
#if 0
@@ -291,14 +291,14 @@ bool TexturePackRepository::canUseWebSkin()
return false;
}
vector< pair<DWORD,wstring> > *TexturePackRepository::getTexturePackIdNames()
vector< pair<DWORD,std::wstring> > *TexturePackRepository::getTexturePackIdNames()
{
vector< pair<DWORD,wstring> > *packList = new vector< pair<DWORD,wstring> >();
vector< pair<DWORD,std::wstring> > *packList = new vector< pair<DWORD,std::wstring> >();
for(AUTO_VAR(it,texturePacks->begin()); it != texturePacks->end(); ++it)
{
TexturePack *pack = *it;
packList->push_back( pair<DWORD,wstring>(pack->getId(),pack->getName()) );
packList->push_back( pair<DWORD,std::wstring>(pack->getId(),pack->getName()) );
}
return packList;
}
@@ -37,10 +37,10 @@ private:
public:
bool selectSkin(TexturePack *skin);
void selectWebSkin(const wstring &url);
void selectWebSkin(const std::wstring &url);
private:
void downloadWebSkin(const wstring &url, File file);
void downloadWebSkin(const std::wstring &url, File file);
public:
bool isUsingWebSkin();
@@ -48,7 +48,7 @@ public:
void updateList();
private:
wstring getIdOrNull(File file);
std::wstring getIdOrNull(File file);
vector<File> getWorkDirContents();
public:
@@ -60,7 +60,7 @@ public:
bool isUsingDefaultSkin() { return selected == DEFAULT_TEXTURE_PACK; } // 4J Added
TexturePack *getDefault() { return DEFAULT_TEXTURE_PACK; } // 4J Added
vector< pair<DWORD,wstring> > *getTexturePackIdNames();
vector< pair<DWORD,std::wstring> > *getTexturePackIdNames();
bool selectTexturePackById(DWORD id); // 4J Added
TexturePack *getTexturePackById(DWORD id); // 4J Added