refactor: nuke all widestrings and widechars everywhere

This commit is contained in:
Tropical 2026-04-07 23:20:09 -05:00
parent f1f1d116b3
commit 2912e9ae2e
1323 changed files with 23207 additions and 23399 deletions

View file

@ -8,7 +8,7 @@ AppGameServices::AppGameServices(Game& game, IMenuService& menus)
// -- Strings -- // -- Strings --
const wchar_t* AppGameServices::getString(int id) { const char* AppGameServices::getString(int id) {
return Game::GetString(id); return Game::GetString(id);
} }
@ -61,23 +61,23 @@ LevelRuleset* AppGameServices::getGameRuleDefinitions() {
// -- Texture cache -- // -- Texture cache --
void AppGameServices::addMemoryTextureFile(const std::wstring& name, void AppGameServices::addMemoryTextureFile(const std::string& name,
std::uint8_t* data, std::uint8_t* data,
unsigned int size) { unsigned int size) {
game_.AddMemoryTextureFile(name, data, size); game_.AddMemoryTextureFile(name, data, size);
} }
void AppGameServices::removeMemoryTextureFile(const std::wstring& name) { void AppGameServices::removeMemoryTextureFile(const std::string& name) {
game_.RemoveMemoryTextureFile(name); game_.RemoveMemoryTextureFile(name);
} }
void AppGameServices::getMemFileDetails(const std::wstring& name, void AppGameServices::getMemFileDetails(const std::string& name,
std::uint8_t** data, std::uint8_t** data,
unsigned int* size) { unsigned int* size) {
game_.GetMemFileDetails(name, data, size); game_.GetMemFileDetails(name, data, size);
} }
bool AppGameServices::isFileInMemoryTextures(const std::wstring& name) { bool AppGameServices::isFileInMemoryTextures(const std::string& name) {
return game_.IsFileInMemoryTextures(name); return game_.IsFileInMemoryTextures(name);
} }
@ -208,7 +208,7 @@ void AppGameServices::setTMSAction(int iPad, eTMSAction action) {
// -- Skin / cape / animation -- // -- Skin / cape / animation --
std::wstring AppGameServices::getPlayerSkinName(int iPad) { std::string AppGameServices::getPlayerSkinName(int iPad) {
return game_.GetPlayerSkinName(iPad); return game_.GetPlayerSkinName(iPad);
} }
@ -216,7 +216,7 @@ std::uint32_t AppGameServices::getPlayerSkinId(int iPad) {
return game_.GetPlayerSkinId(iPad); return game_.GetPlayerSkinId(iPad);
} }
std::wstring AppGameServices::getPlayerCapeName(int iPad) { std::string AppGameServices::getPlayerCapeName(int iPad) {
return game_.GetPlayerCapeName(iPad); return game_.GetPlayerCapeName(iPad);
} }
@ -259,11 +259,11 @@ unsigned int AppGameServices::getAnimOverrideBitmask(
return game_.GetAnimOverrideBitmask(dwSkinID); return game_.GetAnimOverrideBitmask(dwSkinID);
} }
std::uint32_t AppGameServices::getSkinIdFromPath(const std::wstring& skin) { std::uint32_t AppGameServices::getSkinIdFromPath(const std::string& skin) {
return Game::getSkinIdFromPath(skin); return Game::getSkinIdFromPath(skin);
} }
std::wstring AppGameServices::getSkinPathFromId(std::uint32_t skinId) { std::string AppGameServices::getSkinPathFromId(std::uint32_t skinId) {
return Game::getSkinPathFromId(skinId); return Game::getSkinPathFromId(skinId);
} }
@ -340,12 +340,12 @@ void AppGameServices::loadDefaultGameRules() {
// -- Archive / resources -- // -- Archive / resources --
bool AppGameServices::hasArchiveFile(const std::wstring& filename) { bool AppGameServices::hasArchiveFile(const std::string& filename) {
return game_.hasArchiveFile(filename); return game_.hasArchiveFile(filename);
} }
std::vector<std::uint8_t> AppGameServices::getArchiveFile( std::vector<std::uint8_t> AppGameServices::getArchiveFile(
const std::wstring& filename) { const std::string& filename) {
return game_.getArchiveFile(filename); return game_.getArchiveFile(filename);
} }
@ -355,11 +355,11 @@ int AppGameServices::getHTMLColour(eMinecraftColour colour) {
return game_.GetHTMLColour(colour); return game_.GetHTMLColour(colour);
} }
std::wstring AppGameServices::getEntityName(EntityTypeId type) { std::string AppGameServices::getEntityName(EntityTypeId type) {
return game_.getEntityName(static_cast<eINSTANCEOF>(type)); return game_.getEntityName(static_cast<eINSTANCEOF>(type));
} }
const wchar_t* AppGameServices::getGameRulesString(const std::wstring& key) { const char* AppGameServices::getGameRulesString(const std::string& key) {
return game_.GetGameRulesString(key); return game_.GetGameRulesString(key);
} }
@ -371,10 +371,10 @@ unsigned int AppGameServices::createImageTextData(std::uint8_t* textMetadata,
uiHostOptions, uiTexturePackId); uiHostOptions, uiTexturePackId);
} }
std::wstring AppGameServices::getFilePath(std::uint32_t packId, std::string AppGameServices::getFilePath(std::uint32_t packId,
std::wstring filename, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::wstring mountPoint) { std::string mountPoint) {
return game_.getFilePath(packId, filename, bAddDataFolder, mountPoint); return game_.getFilePath(packId, filename, bAddDataFolder, mountPoint);
} }
@ -413,7 +413,7 @@ void AppGameServices::debugPrintf(const char* msg) {
// -- DLC -- // -- DLC --
DLCSkinFile* AppGameServices::getDLCSkinFile(const std::wstring& name) { DLCSkinFile* AppGameServices::getDLCSkinFile(const std::string& name) {
return game_.m_dlcManager.getSkinFile(name); return game_.m_dlcManager.getSkinFile(name);
} }
bool AppGameServices::dlcNeedsCorruptCheck() { bool AppGameServices::dlcNeedsCorruptCheck() {
@ -423,7 +423,7 @@ unsigned int AppGameServices::dlcCheckForCorrupt(bool showMessage) {
return game_.m_dlcManager.checkForCorruptDLCAndAlert(showMessage); return game_.m_dlcManager.checkForCorruptDLCAndAlert(showMessage);
} }
bool AppGameServices::dlcReadDataFile(unsigned int& filesProcessed, bool AppGameServices::dlcReadDataFile(unsigned int& filesProcessed,
const std::wstring& path, const std::string& path,
DLCPack* pack, bool fromArchive) { DLCPack* pack, bool fromArchive) {
return game_.m_dlcManager.readDLCDataFile(filesProcessed, path, pack, return game_.m_dlcManager.readDLCDataFile(filesProcessed, path, pack,
fromArchive); fromArchive);
@ -450,7 +450,7 @@ void AppGameServices::setLevelGenerationOptions(LevelGenerationOptions* levelGen
// -- Shared data -- // -- Shared data --
std::vector<std::wstring>& AppGameServices::getSkinNames() { std::vector<std::string>& AppGameServices::getSkinNames() {
return game_.vSkinNames; return game_.vSkinNames;
} }

View file

@ -10,7 +10,7 @@ public:
AppGameServices(Game& game, IMenuService& menus); AppGameServices(Game& game, IMenuService& menus);
// -- Strings -- // -- Strings --
const wchar_t* getString(int id) override; const char* getString(int id) override;
// -- Debug settings -- // -- Debug settings --
bool debugSettingsOn() override; bool debugSettingsOn() override;
@ -30,12 +30,12 @@ public:
LevelRuleset* getGameRuleDefinitions() override; LevelRuleset* getGameRuleDefinitions() override;
// -- Texture cache -- // -- Texture cache --
void addMemoryTextureFile(const std::wstring& name, std::uint8_t* data, void addMemoryTextureFile(const std::string& name, std::uint8_t* data,
unsigned int size) override; unsigned int size) override;
void removeMemoryTextureFile(const std::wstring& name) override; void removeMemoryTextureFile(const std::string& name) override;
void getMemFileDetails(const std::wstring& name, std::uint8_t** data, void getMemFileDetails(const std::string& name, std::uint8_t** data,
unsigned int* size) override; unsigned int* size) override;
bool isFileInMemoryTextures(const std::wstring& name) override; bool isFileInMemoryTextures(const std::string& name) override;
// -- Player settings -- // -- Player settings --
unsigned char getGameSettings(int iPad, int setting) override; unsigned char getGameSettings(int iPad, int setting) override;
@ -86,9 +86,9 @@ public:
void setTMSAction(int iPad, eTMSAction action) override; void setTMSAction(int iPad, eTMSAction action) override;
// -- Skin / cape / animation -- // -- Skin / cape / animation --
std::wstring getPlayerSkinName(int iPad) override; std::string getPlayerSkinName(int iPad) override;
std::uint32_t getPlayerSkinId(int iPad) override; std::uint32_t getPlayerSkinId(int iPad) override;
std::wstring getPlayerCapeName(int iPad) override; std::string getPlayerCapeName(int iPad) override;
std::uint32_t getPlayerCapeId(int iPad) override; std::uint32_t getPlayerCapeId(int iPad) override;
std::uint32_t getAdditionalModelPartsForPad(int iPad) override; std::uint32_t getAdditionalModelPartsForPad(int iPad) override;
void setAdditionalSkinBoxes(std::uint32_t dwSkinID, SKIN_BOX* boxA, void setAdditionalSkinBoxes(std::uint32_t dwSkinID, SKIN_BOX* boxA,
@ -102,8 +102,8 @@ public:
void setAnimOverrideBitmask(std::uint32_t dwSkinID, void setAnimOverrideBitmask(std::uint32_t dwSkinID,
unsigned int bitmask) override; unsigned int bitmask) override;
unsigned int getAnimOverrideBitmask(std::uint32_t dwSkinID) override; unsigned int getAnimOverrideBitmask(std::uint32_t dwSkinID) override;
std::uint32_t getSkinIdFromPath(const std::wstring& skin) override; std::uint32_t getSkinIdFromPath(const std::string& skin) override;
std::wstring getSkinPathFromId(std::uint32_t skinId) override; std::string getSkinPathFromId(std::uint32_t skinId) override;
bool defaultCapeExists() override; bool defaultCapeExists() override;
bool isXuidNotch(PlayerUID xuid) override; bool isXuidNotch(PlayerUID xuid) override;
bool isXuidDeadmau5(PlayerUID xuid) override; bool isXuidDeadmau5(PlayerUID xuid) override;
@ -131,21 +131,21 @@ public:
void loadDefaultGameRules() override; void loadDefaultGameRules() override;
// -- Archive / resources -- // -- Archive / resources --
bool hasArchiveFile(const std::wstring& filename) override; bool hasArchiveFile(const std::string& filename) override;
std::vector<std::uint8_t> getArchiveFile( std::vector<std::uint8_t> getArchiveFile(
const std::wstring& filename) override; const std::string& filename) override;
// -- Strings / formatting / misc queries -- // -- Strings / formatting / misc queries --
int getHTMLColour(eMinecraftColour colour) override; int getHTMLColour(eMinecraftColour colour) override;
std::wstring getEntityName(EntityTypeId type) override; std::string getEntityName(EntityTypeId type) override;
const wchar_t* getGameRulesString(const std::wstring& key) override; const char* getGameRulesString(const std::string& key) override;
unsigned int createImageTextData(std::uint8_t* textMetadata, unsigned int createImageTextData(std::uint8_t* textMetadata,
int64_t seed, bool hasSeed, int64_t seed, bool hasSeed,
unsigned int uiHostOptions, unsigned int uiHostOptions,
unsigned int uiTexturePackId) override; unsigned int uiTexturePackId) override;
std::wstring getFilePath(std::uint32_t packId, std::wstring filename, std::string getFilePath(std::uint32_t packId, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::wstring mountPoint) override; std::string mountPoint) override;
char* getUniqueMapName() override; char* getUniqueMapName() override;
void setUniqueMapName(char* name) override; void setUniqueMapName(char* name) override;
unsigned int getOpacityTimer(int iPad) override; unsigned int getOpacityTimer(int iPad) override;
@ -157,11 +157,11 @@ public:
void debugPrintf(const char* msg) override; void debugPrintf(const char* msg) override;
// -- DLC -- // -- DLC --
DLCSkinFile* getDLCSkinFile(const std::wstring& name) override; DLCSkinFile* getDLCSkinFile(const std::string& name) override;
bool dlcNeedsCorruptCheck() override; bool dlcNeedsCorruptCheck() override;
unsigned int dlcCheckForCorrupt(bool showMessage) override; unsigned int dlcCheckForCorrupt(bool showMessage) override;
bool dlcReadDataFile(unsigned int& filesProcessed, bool dlcReadDataFile(unsigned int& filesProcessed,
const std::wstring& path, DLCPack* pack, const std::string& path, DLCPack* pack,
bool fromArchive) override; bool fromArchive) override;
void dlcRemovePack(DLCPack* pack) override; void dlcRemovePack(DLCPack* pack) override;
@ -173,7 +173,7 @@ public:
void setLevelGenerationOptions(LevelGenerationOptions* levelGen) override; void setLevelGenerationOptions(LevelGenerationOptions* levelGen) override;
// -- Shared data -- // -- Shared data --
std::vector<std::wstring>& getSkinNames() override; std::vector<std::string>& getSkinNames() override;
std::vector<FEATURE_DATA*>& getTerrainFeatures() override; std::vector<FEATURE_DATA*>& getTerrainFeatures() override;
// -- Menu service -- // -- Menu service --

View file

@ -13,7 +13,7 @@
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
typedef struct { typedef struct {
wchar_t* wchFilename; char* wchFilename;
eFileExtensionType eEXT; eFileExtensionType eEXT;
eTMSFileType eTMSType; eTMSFileType eTMSType;
std::uint8_t* pbData; std::uint8_t* pbData;
@ -150,8 +150,8 @@ typedef struct {
uint64_t ullOfferID_Full; uint64_t ullOfferID_Full;
uint64_t ullOfferID_Trial; uint64_t ullOfferID_Trial;
wchar_t wchBanner[MAX_BANNERNAME_SIZE]; char wchBanner[MAX_BANNERNAME_SIZE];
wchar_t wchDataFile[MAX_BANNERNAME_SIZE]; char wchDataFile[MAX_BANNERNAME_SIZE];
int iGender; int iGender;
int iConfig; int iConfig;
unsigned int uiSortIndex; unsigned int uiSortIndex;
@ -176,7 +176,7 @@ typedef struct _TMSPPRequest {
// char szFilename[MAX_TMSFILENAME_SIZE]; // char szFilename[MAX_TMSFILENAME_SIZE];
int (*CallbackFunc)(void*, int, int, IPlatformStorage::PTMSPP_FILEDATA, int (*CallbackFunc)(void*, int, int, IPlatformStorage::PTMSPP_FILEDATA,
const char* szFilename); const char* szFilename);
wchar_t wchFilename[MAX_TMSFILENAME_SIZE]; char wchFilename[MAX_TMSFILENAME_SIZE];
void* lpCallbackParam; void* lpCallbackParam;
} TMSPPRequest; } TMSPPRequest;

View file

@ -16,18 +16,18 @@ ArchiveManager::ArchiveManager()
: m_mediaArchive(nullptr), m_dwRequiredTexturePackID(0) {} : m_mediaArchive(nullptr), m_dwRequiredTexturePackID(0) {}
void ArchiveManager::loadMediaArchive() { void ArchiveManager::loadMediaArchive() {
std::wstring mediapath = L""; std::string mediapath = "";
#if _WINDOWS64 #if _WINDOWS64
mediapath = L"Common\\Media\\MediaWindows64.arc"; mediapath = "Common\\Media\\MediaWindows64.arc";
#elif __linux__ #elif __linux__
mediapath = L"app/common/Media/MediaLinux.arc"; mediapath = "app/common/Media/MediaLinux.arc";
#endif #endif
if (!mediapath.empty()) { if (!mediapath.empty()) {
#if defined(__linux__) #if defined(__linux__)
std::wstring exeDirW = PlatformFilesystem.getBasePath().wstring(); std::string exeDirW = PlatformFilesystem.getBasePath().string();
std::wstring candidate = exeDirW + File::pathSeparator + mediapath; std::string candidate = exeDirW + File::pathSeparator + mediapath;
if (File(candidate).exists()) { if (File(candidate).exists()) {
m_mediaArchive = new ArchiveFile(File(candidate)); m_mediaArchive = new ArchiveFile(File(candidate));
} else { } else {
@ -39,7 +39,7 @@ void ArchiveManager::loadMediaArchive() {
} }
} }
int ArchiveManager::getArchiveFileSize(const std::wstring& filename) { int ArchiveManager::getArchiveFileSize(const std::string& filename) {
TexturePack* tPack = nullptr; TexturePack* tPack = nullptr;
Minecraft* pMinecraft = Minecraft::GetInstance(); Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft && pMinecraft->skins) if (pMinecraft && pMinecraft->skins)
@ -51,7 +51,7 @@ int ArchiveManager::getArchiveFileSize(const std::wstring& filename) {
return m_mediaArchive->getFileSize(filename); return m_mediaArchive->getFileSize(filename);
} }
bool ArchiveManager::hasArchiveFile(const std::wstring& filename) { bool ArchiveManager::hasArchiveFile(const std::string& filename) {
TexturePack* tPack = nullptr; TexturePack* tPack = nullptr;
Minecraft* pMinecraft = Minecraft::GetInstance(); Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft && pMinecraft->skins) if (pMinecraft && pMinecraft->skins)
@ -64,7 +64,7 @@ bool ArchiveManager::hasArchiveFile(const std::wstring& filename) {
} }
std::vector<uint8_t> ArchiveManager::getArchiveFile( std::vector<uint8_t> ArchiveManager::getArchiveFile(
const std::wstring& filename) { const std::string& filename) {
TexturePack* tPack = nullptr; TexturePack* tPack = nullptr;
Minecraft* pMinecraft = Minecraft::GetInstance(); Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft && pMinecraft->skins) if (pMinecraft && pMinecraft->skins)
@ -102,7 +102,7 @@ void ArchiveManager::removeMemoryTPDFile(int iConfig) {
} }
} }
int ArchiveManager::getTPConfigVal(wchar_t* pwchDataFile) { return -1; } int ArchiveManager::getTPConfigVal(char* pwchDataFile) { return -1; }
bool ArchiveManager::isFileInTPD(int iConfig) { bool ArchiveManager::isFileInTPD(int iConfig) {
bool val = false; bool val = false;

View file

@ -17,9 +17,9 @@ public:
void loadMediaArchive(); void loadMediaArchive();
ArchiveFile* getMediaArchive() const { return m_mediaArchive; } ArchiveFile* getMediaArchive() const { return m_mediaArchive; }
int getArchiveFileSize(const std::wstring& filename); int getArchiveFileSize(const std::string& filename);
bool hasArchiveFile(const std::wstring& filename); bool hasArchiveFile(const std::string& filename);
std::vector<uint8_t> getArchiveFile(const std::wstring& filename); std::vector<uint8_t> getArchiveFile(const std::string& filename);
// Texture Pack Data files (icon, banner, comparison shot & text) // Texture Pack Data files (icon, banner, comparison shot & text)
void addMemoryTPDFile(int iConfig, std::uint8_t* pbData, void addMemoryTPDFile(int iConfig, std::uint8_t* pbData,
@ -28,7 +28,7 @@ public:
bool isFileInTPD(int iConfig); bool isFileInTPD(int iConfig);
void getTPD(int iConfig, std::uint8_t** ppbData, unsigned int* pByteCount); void getTPD(int iConfig, std::uint8_t** ppbData, unsigned int* pByteCount);
int getTPDSize() { return m_MEM_TPD.size(); } int getTPDSize() { return m_MEM_TPD.size(); }
int getTPConfigVal(wchar_t* pwchDataFile); int getTPConfigVal(char* pwchDataFile);
void setRequiredTexturePackID(std::uint32_t texturePackId) { void setRequiredTexturePackID(std::uint32_t texturePackId) {
m_dwRequiredTexturePackID = texturePackId; m_dwRequiredTexturePackID = texturePackId;

View file

@ -33,7 +33,7 @@ public:
virtual void destroy() = 0; virtual void destroy() = 0;
virtual void play(int iSound, float x, float y, float z, float volume, virtual void play(int iSound, float x, float y, float z, float volume,
float pitch) = 0; float pitch) = 0;
virtual void playStreaming(const std::wstring& name, float x, float y, virtual void playStreaming(const std::string& name, float x, float y,
float z, float volume, float pitch, float z, float volume, float pitch,
bool bMusicDelay = true) = 0; bool bMusicDelay = true) = 0;
virtual void playUI(int iSound, float volume, float pitch) = 0; virtual void playUI(int iSound, float volume, float pitch) = 0;
@ -41,10 +41,10 @@ public:
virtual void updateSystemMusicPlaying(bool isPlaying) = 0; virtual void updateSystemMusicPlaying(bool isPlaying) = 0;
virtual void updateSoundEffectVolume(float fVal) = 0; virtual void updateSoundEffectVolume(float fVal) = 0;
virtual void init(Options*) = 0; virtual void init(Options*) = 0;
virtual void add(const std::wstring& name, File* file) = 0; virtual void add(const std::string& name, File* file) = 0;
virtual void addMusic(const std::wstring& name, File* file) = 0; virtual void addMusic(const std::string& name, File* file) = 0;
virtual void addStreaming(const std::wstring& name, File* file) = 0; virtual void addStreaming(const std::string& name, File* file) = 0;
virtual char* ConvertSoundPathToName(const std::wstring& name, virtual char* ConvertSoundPathToName(const std::string& name,
bool bConvertSpaces) = 0; bool bConvertSpaces) = 0;
virtual void playMusicTick() = 0; virtual void playMusicTick() = 0;
@ -57,8 +57,8 @@ public:
virtual void SetIsPlayingEndMusic(bool bVal); virtual void SetIsPlayingEndMusic(bool bVal);
virtual void SetIsPlayingNetherMusic(bool bVal); virtual void SetIsPlayingNetherMusic(bool bVal);
static const wchar_t* wchSoundNames[eSoundType_MAX]; static const char* wchSoundNames[eSoundType_MAX];
static const wchar_t* wchUISoundNames[eSFX_MAX]; static const char* wchUISoundNames[eSFX_MAX];
public: public:
void tick(); void tick();

View file

@ -117,13 +117,6 @@ char SoundEngine::m_szRedistName[] = {"redist64"};
// Linux specific functions // Linux specific functions
#if defined(__linux__) #if defined(__linux__)
std::wstring stws(const char* utf8) {
size_t len = std::mbstowcs(nullptr, utf8, 0);
if (len == static_cast<size_t>(-1)) return L"";
std::wstring result(len, L'\0');
std::mbstowcs(&result[0], utf8, len);
return result;
}
SoundEngine::SoundEngine() {} SoundEngine::SoundEngine() {}
std::vector<MiniAudioSound*> m_activeSounds; std::vector<MiniAudioSound*> m_activeSounds;
void SoundEngine::init(Options* pOptions) { void SoundEngine::init(Options* pOptions) {
@ -179,7 +172,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
float pitch) { float pitch) {
if (iSound == -1) return; if (iSound == -1) return;
char szId[256]; char szId[256];
wcstombs(szId, wchSoundNames[iSound], 255); strncpy(szId, wchSoundNames[iSound], 255);
for (int i = 0; szId[i]; i++) for (int i = 0; szId[i]; i++)
if (szId[i] == '.') szId[i] = '/'; if (szId[i] == '.') szId[i] = '/';
@ -245,9 +238,9 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
void SoundEngine::playUI(int iSound, float volume, float pitch) { void SoundEngine::playUI(int iSound, float volume, float pitch) {
char szIdentifier[256]; char szIdentifier[256];
if (iSound >= eSFX_MAX) if (iSound >= eSFX_MAX)
wcstombs(szIdentifier, wchSoundNames[iSound], 255); strncpy(szIdentifier, wchSoundNames[iSound], 255);
else else
wcstombs(szIdentifier, wchUISoundNames[iSound], 255); strncpy(szIdentifier, wchUISoundNames[iSound], 255);
for (int i = 0; szIdentifier[i]; i++) for (int i = 0; szIdentifier[i]; i++)
if (szIdentifier[i] == '.') szIdentifier[i] = '/'; if (szIdentifier[i] == '.') szIdentifier[i] = '/';
std::string base = PlatformFilesystem.getBasePath().string() + "/"; std::string base = PlatformFilesystem.getBasePath().string() + "/";
@ -341,12 +334,12 @@ int SoundEngine::getMusicID(int iDomain) {
} }
} }
int SoundEngine::getMusicID(const std::wstring& name) { int SoundEngine::getMusicID(const std::string& name) {
int iCD = 0; int iCD = 0;
for (size_t i = 0; i < 12; i++) { for (size_t i = 0; i < 12; i++) {
std::wstring fileNameW = stws(m_szStreamFileA[i + eStream_CD_1]); std::string fileName = m_szStreamFileA[i + eStream_CD_1];
if (name == fileNameW) { if (name == fileName) {
iCD = static_cast<int>(i); iCD = static_cast<int>(i);
break; break;
} }
@ -354,7 +347,7 @@ int SoundEngine::getMusicID(const std::wstring& name) {
return iCD + m_iStream_CD_1; return iCD + m_iStream_CD_1;
} }
void SoundEngine::playStreaming(const std::wstring& name, float x, float y, void SoundEngine::playStreaming(const std::string& name, float x, float y,
float z, float volume, float pitch, float z, float volume, float pitch,
bool bMusicDelay) { bool bMusicDelay) {
m_StreamingAudioInfo.x = x; m_StreamingAudioInfo.x = x;
@ -1201,7 +1194,7 @@ void SoundEngine::destroy() {}
#if defined(_DEBUG) #if defined(_DEBUG)
void SoundEngine::GetSoundName(char* szSoundName, int iSound) { void SoundEngine::GetSoundName(char* szSoundName, int iSound) {
strcpy((char*)szSoundName, "Minecraft/"); strcpy((char*)szSoundName, "Minecraft/");
std::wstring name = wchSoundNames[iSound]; std::string name = wchSoundNames[iSound];
char* SoundName = (char*)ConvertSoundPathToName(name); char* SoundName = (char*)ConvertSoundPathToName(name);
strcat((char*)szSoundName, SoundName); strcat((char*)szSoundName, SoundName);
} }
@ -1224,7 +1217,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
/* // if we are already playing loads of this sounds ignore this one /* // if we are already playing loads of this sounds ignore this one
if(CurrentSoundsPlaying[iSound+eSFX_MAX]>MAX_SAME_SOUNDS_PLAYING) if(CurrentSoundsPlaying[iSound+eSFX_MAX]>MAX_SAME_SOUNDS_PLAYING)
{ {
// std::wstring name = wchSoundNames[iSound]; // std::string name = wchSoundNames[iSound];
// char *SoundName = (char *)ConvertSoundPathToName(name); // char *SoundName = (char *)ConvertSoundPathToName(name);
// app.DebugPrintf("Too many %s sounds playing!\n",SoundName); // app.DebugPrintf("Too many %s sounds playing!\n",SoundName);
return; return;
@ -1236,9 +1229,9 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
strcpy((char*)szSoundName, "Minecraft/"); strcpy((char*)szSoundName, "Minecraft/");
#if defined(DISTORTION_TEST) #if defined(DISTORTION_TEST)
std::wstring name = wchSoundNames[eSoundType_MOB_ENDERDRAGON_GROWL]; std::string name = wchSoundNames[eSoundType_MOB_ENDERDRAGON_GROWL];
#else #else
std::wstring name = wchSoundNames[iSound]; std::string name = wchSoundNames[iSound];
#endif #endif
char* SoundName = (char*)ConvertSoundPathToName(name); char* SoundName = (char*)ConvertSoundPathToName(name);
@ -1272,7 +1265,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
///////////////////////////////////////////// /////////////////////////////////////////////
void SoundEngine::playUI(int iSound, float volume, float pitch) { void SoundEngine::playUI(int iSound, float volume, float pitch) {
U8 szSoundName[256]; U8 szSoundName[256];
std::wstring name; std::string name;
// we have some game sounds played as UI sounds... // we have some game sounds played as UI sounds...
// Not the best way to do this, but it seems to only be the portal sounds // Not the best way to do this, but it seems to only be the portal sounds
@ -1331,7 +1324,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch) {
// playStreaming // playStreaming
// //
///////////////////////////////////////////// /////////////////////////////////////////////
void SoundEngine::playStreaming(const std::wstring& name, float x, float y, void SoundEngine::playStreaming(const std::string& name, float x, float y,
float z, float volume, float pitch, float z, float volume, float pitch,
bool bMusicDelay) { bool bMusicDelay) {
// This function doesn't actually play a streaming sound, just sets states // This function doesn't actually play a streaming sound, just sets states
@ -1462,10 +1455,10 @@ void SoundEngine::playMusicUpdate() {
m_MusicType = eMusicType_Game; m_MusicType = eMusicType_Game;
m_StreamingAudioInfo.bIs3D = false; m_StreamingAudioInfo.bIs3D = false;
std::wstring& wstrSoundName = std::string& wstrSoundName =
dlcAudioFile->GetSoundName(m_musicID); dlcAudioFile->GetSoundName(m_musicID);
char szName[255]; char szName[255];
wcstombs(szName, wstrSoundName.c_str(), 255); strncpy(szName, wstrSoundName.c_str(), 255);
std::string strFile = std::string strFile =
"TPACK:\\Data\\" + string(szName) + ".binka"; "TPACK:\\Data\\" + string(szName) + ".binka";
@ -1508,7 +1501,7 @@ void SoundEngine::playMusicUpdate() {
strcat((char*)m_szStreamName, ".binka"); strcat((char*)m_szStreamName, ".binka");
} }
// std::wstring name = // std::string name =
// m_szStreamFileA[m_musicID];char*SoundName=(char // m_szStreamFileA[m_musicID];char*SoundName=(char
// *)ConvertSoundPathToName(name);strcat((char // *)ConvertSoundPathToName(name);strcat((char
// *)szStreamName,SoundName); // *)szStreamName,SoundName);
@ -1910,14 +1903,14 @@ float SoundEngine::getMasterMusicVolume() {
return m_MasterMusicVolume; return m_MasterMusicVolume;
} }
} }
void SoundEngine::add(const std::wstring& name, File* file) {} void SoundEngine::add(const std::string& name, File* file) {}
void SoundEngine::addMusic(const std::wstring& name, File* file) {} void SoundEngine::addMusic(const std::string& name, File* file) {}
void SoundEngine::addStreaming(const std::wstring& name, File* file) {} void SoundEngine::addStreaming(const std::string& name, File* file) {}
bool SoundEngine::isStreamingWavebankReady() { return true; } bool SoundEngine::isStreamingWavebankReady() { return true; }
// This is unused by the linux version, it'll need to be changed // This is unused by the linux version, it'll need to be changed
char* SoundEngine::ConvertSoundPathToName(const std::wstring& name, char* SoundEngine::ConvertSoundPathToName(const std::string& name,
bool bConvertSpaces) { bool bConvertSpaces) {
return nullptr; return nullptr;
} }

View file

@ -105,7 +105,7 @@ public:
#endif #endif
virtual void play(int iSound, float x, float y, float z, float volume, virtual void play(int iSound, float x, float y, float z, float volume,
float pitch); float pitch);
virtual void playStreaming(const std::wstring& name, float x, float y, virtual void playStreaming(const std::string& name, float x, float y,
float z, float volume, float pitch, float z, float volume, float pitch,
bool bMusicDelay = true); bool bMusicDelay = true);
virtual void playUI(int iSound, float volume, float pitch); virtual void playUI(int iSound, float volume, float pitch);
@ -117,14 +117,14 @@ public:
virtual void tick(std::shared_ptr<Mob>* players, virtual void tick(std::shared_ptr<Mob>* players,
float a); // 4J - updated to take array of local players float a); // 4J - updated to take array of local players
// rather than single one // rather than single one
virtual void add(const std::wstring& name, File* file); virtual void add(const std::string& name, File* file);
virtual void addMusic(const std::wstring& name, File* file); virtual void addMusic(const std::string& name, File* file);
virtual void addStreaming(const std::wstring& name, File* file); virtual void addStreaming(const std::string& name, File* file);
virtual char* ConvertSoundPathToName(const std::wstring& name, virtual char* ConvertSoundPathToName(const std::string& name,
bool bConvertSpaces = false); bool bConvertSpaces = false);
bool isStreamingWavebankReady(); // 4J Added bool isStreamingWavebankReady(); // 4J Added
int getMusicID(int iDomain); int getMusicID(int iDomain);
int getMusicID(const std::wstring& name); int getMusicID(const std::string& name);
void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, void SetStreamingSounds(int iOverworldMin, int iOverWorldMax,
int iNetherMin, int iNetherMax, int iEndMin, int iNetherMin, int iNetherMax, int iEndMin,
int iEndMax, int iCD1); int iEndMax, int iCD1);
@ -161,7 +161,7 @@ private:
int m_StreamState; int m_StreamState;
int m_MusicType; int m_MusicType;
AUDIO_INFO m_StreamingAudioInfo; AUDIO_INFO m_StreamingAudioInfo;
std::wstring m_CDMusic; std::string m_CDMusic;
bool m_bSystemMusicPlaying; bool m_bSystemMusicPlaying;
float m_MasterMusicVolume; float m_MasterMusicVolume;
float m_MasterEffectsVolume; float m_MasterEffectsVolume;

View file

@ -1,228 +1,228 @@
#include "Consoles_SoundEngine.h" #include "Consoles_SoundEngine.h"
#include "minecraft/sounds/SoundTypes.h" #include "minecraft/sounds/SoundTypes.h"
const wchar_t* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = { const char* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = {
L"mob/chicken/chicken", // eSoundType_MOB_CHICKEN_AMBIENT "mob/chicken/chicken", // eSoundType_MOB_CHICKEN_AMBIENT
L"mob/chicken/chickenhurt", // eSoundType_MOB_CHICKEN_HURT "mob/chicken/chickenhurt", // eSoundType_MOB_CHICKEN_HURT
L"mob/chicken/chickenplop", // eSoundType_MOB_CHICKENPLOP "mob/chicken/chickenplop", // eSoundType_MOB_CHICKENPLOP
L"mob/cow/say", // eSoundType_MOB_COW_AMBIENT "mob/cow/say", // eSoundType_MOB_COW_AMBIENT
L"mob/cow/hurt", // eSoundType_MOB_COW_HURT "mob/cow/hurt", // eSoundType_MOB_COW_HURT
L"mob/pig/pig", // eSoundType_MOB_PIG_AMBIENT "mob/pig/pig", // eSoundType_MOB_PIG_AMBIENT
L"mob/pig/pigdeath", // eSoundType_MOB_PIG_DEATH "mob/pig/pigdeath", // eSoundType_MOB_PIG_DEATH
L"mob/sheep/sheep", // eSoundType_MOB_SHEEP_AMBIENT "mob/sheep/sheep", // eSoundType_MOB_SHEEP_AMBIENT
L"mob/wolf/growl", // eSoundType_MOB_WOLF_GROWL "mob/wolf/growl", // eSoundType_MOB_WOLF_GROWL
L"mob/wolf/whine", // eSoundType_MOB_WOLF_WHINE "mob/wolf/whine", // eSoundType_MOB_WOLF_WHINE
L"mob/wolf/panting", // eSoundType_MOB_WOLF_PANTING "mob/wolf/panting", // eSoundType_MOB_WOLF_PANTING
L"mob/wolf/bark", // eSoundType_MOB_WOLF_BARK "mob/wolf/bark", // eSoundType_MOB_WOLF_BARK
L"mob/wolf/hurt", // eSoundType_MOB_WOLF_HURT "mob/wolf/hurt", // eSoundType_MOB_WOLF_HURT
L"mob/wolf/death", // eSoundType_MOB_WOLF_DEATH "mob/wolf/death", // eSoundType_MOB_WOLF_DEATH
L"mob/wolf/shake", // eSoundType_MOB_WOLF_SHAKE "mob/wolf/shake", // eSoundType_MOB_WOLF_SHAKE
L"mob/blaze/breathe", // eSoundType_MOB_BLAZE_BREATHE "mob/blaze/breathe", // eSoundType_MOB_BLAZE_BREATHE
L"mob/blaze/hit", // eSoundType_MOB_BLAZE_HURT "mob/blaze/hit", // eSoundType_MOB_BLAZE_HURT
L"mob/blaze/death", // eSoundType_MOB_BLAZE_DEATH "mob/blaze/death", // eSoundType_MOB_BLAZE_DEATH
L"mob/ghast/moan", // eSoundType_MOB_GHAST_MOAN "mob/ghast/moan", // eSoundType_MOB_GHAST_MOAN
L"mob/ghast/scream", // eSoundType_MOB_GHAST_SCREAM "mob/ghast/scream", // eSoundType_MOB_GHAST_SCREAM
L"mob/ghast/death", // eSoundType_MOB_GHAST_DEATH "mob/ghast/death", // eSoundType_MOB_GHAST_DEATH
L"mob/ghast/fireball", // eSoundType_MOB_GHAST_FIREBALL "mob/ghast/fireball", // eSoundType_MOB_GHAST_FIREBALL
L"mob/ghast/charge", // eSoundType_MOB_GHAST_CHARGE "mob/ghast/charge", // eSoundType_MOB_GHAST_CHARGE
L"mob/endermen/idle", // eSoundType_MOB_ENDERMEN_IDLE "mob/endermen/idle", // eSoundType_MOB_ENDERMEN_IDLE
L"mob/endermen/hit", // eSoundType_MOB_ENDERMEN_HIT "mob/endermen/hit", // eSoundType_MOB_ENDERMEN_HIT
L"mob/endermen/death", // eSoundType_MOB_ENDERMEN_DEATH "mob/endermen/death", // eSoundType_MOB_ENDERMEN_DEATH
L"mob/endermen/portal", // eSoundType_MOB_ENDERMEN_PORTAL "mob/endermen/portal", // eSoundType_MOB_ENDERMEN_PORTAL
L"mob/zombiepig/zpig", // eSoundType_MOB_ZOMBIEPIG_AMBIENT "mob/zombiepig/zpig", // eSoundType_MOB_ZOMBIEPIG_AMBIENT
L"mob/zombiepig/zpighurt", // eSoundType_MOB_ZOMBIEPIG_HURT "mob/zombiepig/zpighurt", // eSoundType_MOB_ZOMBIEPIG_HURT
L"mob/zombiepig/zpigdeath", // eSoundType_MOB_ZOMBIEPIG_DEATH "mob/zombiepig/zpigdeath", // eSoundType_MOB_ZOMBIEPIG_DEATH
L"mob/zombiepig/zpigangry", // eSoundType_MOB_ZOMBIEPIG_ZPIGANGRY "mob/zombiepig/zpigangry", // eSoundType_MOB_ZOMBIEPIG_ZPIGANGRY
L"mob/silverfish/say", // eSoundType_MOB_SILVERFISH_AMBIENT, "mob/silverfish/say", // eSoundType_MOB_SILVERFISH_AMBIENT,
L"mob/silverfish/hit", // eSoundType_MOB_SILVERFISH_HURT "mob/silverfish/hit", // eSoundType_MOB_SILVERFISH_HURT
L"mob/silverfish/kill", // eSoundType_MOB_SILVERFISH_DEATH, "mob/silverfish/kill", // eSoundType_MOB_SILVERFISH_DEATH,
L"mob/silverfish/step", // eSoundType_MOB_SILVERFISH_STEP, "mob/silverfish/step", // eSoundType_MOB_SILVERFISH_STEP,
L"mob/skeleton/skeleton", // eSoundType_MOB_SKELETON_AMBIENT, "mob/skeleton/skeleton", // eSoundType_MOB_SKELETON_AMBIENT,
L"mob/skeleton/skeletonhurt", // eSoundType_MOB_SKELETON_HURT, "mob/skeleton/skeletonhurt", // eSoundType_MOB_SKELETON_HURT,
L"mob/spider/spider", // eSoundType_MOB_SPIDER_AMBIENT, "mob/spider/spider", // eSoundType_MOB_SPIDER_AMBIENT,
L"mob/spider/spiderdeath", // eSoundType_MOB_SPIDER_DEATH, "mob/spider/spiderdeath", // eSoundType_MOB_SPIDER_DEATH,
L"mob/slime/slime", // eSoundType_MOB_SLIME, "mob/slime/slime", // eSoundType_MOB_SLIME,
L"mob/slime/slimeattack", // eSoundType_MOB_SLIME_ATTACK, "mob/slime/slimeattack", // eSoundType_MOB_SLIME_ATTACK,
L"mob/creeper/creeper", // eSoundType_MOB_CREEPER_HURT, "mob/creeper/creeper", // eSoundType_MOB_CREEPER_HURT,
L"mob/creeper/creeperdeath", // eSoundType_MOB_CREEPER_DEATH, "mob/creeper/creeperdeath", // eSoundType_MOB_CREEPER_DEATH,
L"mob/zombie/zombie", // eSoundType_MOB_ZOMBIE_AMBIENT, "mob/zombie/zombie", // eSoundType_MOB_ZOMBIE_AMBIENT,
L"mob/zombie/zombiehurt", // eSoundType_MOB_ZOMBIE_HURT, "mob/zombie/zombiehurt", // eSoundType_MOB_ZOMBIE_HURT,
L"mob/zombie/zombiedeath", // eSoundType_MOB_ZOMBIE_DEATH, "mob/zombie/zombiedeath", // eSoundType_MOB_ZOMBIE_DEATH,
L"mob/zombie/wood", // eSoundType_MOB_ZOMBIE_WOOD, "mob/zombie/wood", // eSoundType_MOB_ZOMBIE_WOOD,
L"mob/zombie/woodbreak", // eSoundType_MOB_ZOMBIE_WOOD_BREAK, "mob/zombie/woodbreak", // eSoundType_MOB_ZOMBIE_WOOD_BREAK,
L"mob/zombie/metal", // eSoundType_MOB_ZOMBIE_METAL, "mob/zombie/metal", // eSoundType_MOB_ZOMBIE_METAL,
L"mob/magmacube/big", // eSoundType_MOB_MAGMACUBE_BIG, "mob/magmacube/big", // eSoundType_MOB_MAGMACUBE_BIG,
L"mob/magmacube/small", // eSoundType_MOB_MAGMACUBE_SMALL, "mob/magmacube/small", // eSoundType_MOB_MAGMACUBE_SMALL,
L"mob/cat/purr", // eSoundType_MOB_CAT_PURR "mob/cat/purr", // eSoundType_MOB_CAT_PURR
L"mob/cat/purreow", // eSoundType_MOB_CAT_PURREOW "mob/cat/purreow", // eSoundType_MOB_CAT_PURREOW
L"mob/cat/meow", // eSoundType_MOB_CAT_MEOW "mob/cat/meow", // eSoundType_MOB_CAT_MEOW
// 4J-PB - correct the name of the event for hitting ocelots // 4J-PB - correct the name of the event for hitting ocelots
L"mob/cat/hitt", // eSoundType_MOB_CAT_HITT "mob/cat/hitt", // eSoundType_MOB_CAT_HITT
// L"mob.irongolem.throw", // // "mob.irongolem.throw", //
// eSoundType_MOB_IRONGOLEM_THROW L"mob.irongolem.hit", // eSoundType_MOB_IRONGOLEM_THROW "mob.irongolem.hit",
//// eSoundType_MOB_IRONGOLEM_HIT L"mob.irongolem.death", //// eSoundType_MOB_IRONGOLEM_HIT "mob.irongolem.death",
//// eSoundType_MOB_IRONGOLEM_DEATH L"mob.irongolem.walk", //// eSoundType_MOB_IRONGOLEM_DEATH "mob.irongolem.walk",
//// eSoundType_MOB_IRONGOLEM_WALK //// eSoundType_MOB_IRONGOLEM_WALK
L"random/bow", // eSoundType_RANDOM_BOW, "random/bow", // eSoundType_RANDOM_BOW,
L"random/bowhit", // eSoundType_RANDOM_BOW_HIT, "random/bowhit", // eSoundType_RANDOM_BOW_HIT,
L"random/explode", // eSoundType_RANDOM_EXPLODE, "random/explode", // eSoundType_RANDOM_EXPLODE,
L"random/fizz", // eSoundType_RANDOM_FIZZ, "random/fizz", // eSoundType_RANDOM_FIZZ,
L"random/pop", // eSoundType_RANDOM_POP, "random/pop", // eSoundType_RANDOM_POP,
L"random/fuse", // eSoundType_RANDOM_FUSE, "random/fuse", // eSoundType_RANDOM_FUSE,
L"random/drink", // eSoundType_RANDOM_DRINK, "random/drink", // eSoundType_RANDOM_DRINK,
L"random/eat", // eSoundType_RANDOM_EAT, "random/eat", // eSoundType_RANDOM_EAT,
L"random/burp", // eSoundType_RANDOM_BURP, "random/burp", // eSoundType_RANDOM_BURP,
L"random/splash", // eSoundType_RANDOM_SPLASH, "random/splash", // eSoundType_RANDOM_SPLASH,
L"random/click", // eSoundType_RANDOM_CLICK, "random/click", // eSoundType_RANDOM_CLICK,
L"random/glass", // eSoundType_RANDOM_GLASS, "random/glass", // eSoundType_RANDOM_GLASS,
L"random/orb", // eSoundType_RANDOM_ORB, "random/orb", // eSoundType_RANDOM_ORB,
L"random/break", // eSoundType_RANDOM_BREAK, "random/break", // eSoundType_RANDOM_BREAK,
L"random/chestopen", // eSoundType_RANDOM_CHEST_OPEN, "random/chestopen", // eSoundType_RANDOM_CHEST_OPEN,
L"random/chestclosed", // eSoundType_RANDOM_CHEST_CLOSE, "random/chestclosed", // eSoundType_RANDOM_CHEST_CLOSE,
L"random/door_open", // eSoundType_RANDOM_DOOR_OPEN, "random/door_open", // eSoundType_RANDOM_DOOR_OPEN,
L"random/door_close", // eSoundType_RANDOM_DOOR_CLOSE, "random/door_close", // eSoundType_RANDOM_DOOR_CLOSE,
L"ambient/weather/rain", // eSoundType_AMBIENT_WEATHER_RAIN, "ambient/weather/rain", // eSoundType_AMBIENT_WEATHER_RAIN,
L"ambient/weather/thunder", // eSoundType_AMBIENT_WEATHER_THUNDER, "ambient/weather/thunder", // eSoundType_AMBIENT_WEATHER_THUNDER,
L"ambient/cave/cave", // eSoundType_CAVE_CAVE, DON'T USE FOR XBOX 360!!! "ambient/cave/cave", // eSoundType_CAVE_CAVE, DON'T USE FOR XBOX 360!!!
L"portal/portal", // eSoundType_PORTAL_PORTAL, "portal/portal", // eSoundType_PORTAL_PORTAL,
// 4J-PB - added a couple that were still using std::wstring // 4J-PB - added a couple that were still using std::string
L"portal/trigger", // eSoundType_PORTAL_TRIGGER "portal/trigger", // eSoundType_PORTAL_TRIGGER
L"portal/travel", // eSoundType_PORTAL_TRAVEL "portal/travel", // eSoundType_PORTAL_TRAVEL
L"fire/ignite", // eSoundType_FIRE_IGNITE, "fire/ignite", // eSoundType_FIRE_IGNITE,
L"fire/fire", // eSoundType_FIRE_FIRE, "fire/fire", // eSoundType_FIRE_FIRE,
L"damage/hit", // eSoundType_DAMAGE_HURT, "damage/hit", // eSoundType_DAMAGE_HURT,
L"damage/fallsmall", // eSoundType_DAMAGE_FALL_SMALL, "damage/fallsmall", // eSoundType_DAMAGE_FALL_SMALL,
L"damage/fallbig", // eSoundType_DAMAGE_FALL_BIG, "damage/fallbig", // eSoundType_DAMAGE_FALL_BIG,
L"note/harp", // eSoundType_NOTE_HARP, "note/harp", // eSoundType_NOTE_HARP,
L"note/bd", // eSoundType_NOTE_BD, "note/bd", // eSoundType_NOTE_BD,
L"note/snare", // eSoundType_NOTE_SNARE, "note/snare", // eSoundType_NOTE_SNARE,
L"note/hat", // eSoundType_NOTE_HAT, "note/hat", // eSoundType_NOTE_HAT,
L"note/bassattack", // eSoundType_NOTE_BASSATTACK, "note/bassattack", // eSoundType_NOTE_BASSATTACK,
L"tile/piston.in", // eSoundType_TILE_PISTON_IN, "tile/piston.in", // eSoundType_TILE_PISTON_IN,
L"tile/piston.out", // eSoundType_TILE_PISTON_OUT, "tile/piston.out", // eSoundType_TILE_PISTON_OUT,
L"liquid/water", // eSoundType_LIQUID_WATER, "liquid/water", // eSoundType_LIQUID_WATER,
L"liquid/lavapop", // eSoundType_LIQUID_LAVA_POP, "liquid/lavapop", // eSoundType_LIQUID_LAVA_POP,
L"liquid/lava", // eSoundType_LIQUID_LAVA, "liquid/lava", // eSoundType_LIQUID_LAVA,
L"step/stone", // eSoundType_STEP_STONE, "step/stone", // eSoundType_STEP_STONE,
L"step/wood", // eSoundType_STEP_WOOD, "step/wood", // eSoundType_STEP_WOOD,
L"step/gravel", // eSoundType_STEP_GRAVEL, "step/gravel", // eSoundType_STEP_GRAVEL,
L"step/grass", // eSoundType_STEP_GRASS, "step/grass", // eSoundType_STEP_GRASS,
L"step/metal", // eSoundType_STEP_METAL, "step/metal", // eSoundType_STEP_METAL,
L"step/cloth", // eSoundType_STEP_CLOTH, "step/cloth", // eSoundType_STEP_CLOTH,
L"step/sand", // eSoundType_STEP_SAND, "step/sand", // eSoundType_STEP_SAND,
// below this are the additional sounds from the second soundbank // below this are the additional sounds from the second soundbank
L"mob/enderdragon/end", // eSoundType_MOB_ENDERDRAGON_END "mob/enderdragon/end", // eSoundType_MOB_ENDERDRAGON_END
L"mob/enderdragon/growl", // eSoundType_MOB_ENDERDRAGON_GROWL "mob/enderdragon/growl", // eSoundType_MOB_ENDERDRAGON_GROWL
L"mob/enderdragon/hit", // eSoundType_MOB_ENDERDRAGON_HIT "mob/enderdragon/hit", // eSoundType_MOB_ENDERDRAGON_HIT
L"mob/enderdragon/wings", // eSoundType_MOB_ENDERDRAGON_MOVE "mob/enderdragon/wings", // eSoundType_MOB_ENDERDRAGON_MOVE
L"mob/irongolem/throw", // eSoundType_MOB_IRONGOLEM_THROW "mob/irongolem/throw", // eSoundType_MOB_IRONGOLEM_THROW
L"mob/irongolem/hit", // eSoundType_MOB_IRONGOLEM_HIT "mob/irongolem/hit", // eSoundType_MOB_IRONGOLEM_HIT
L"mob/irongolem/death", // eSoundType_MOB_IRONGOLEM_DEATH "mob/irongolem/death", // eSoundType_MOB_IRONGOLEM_DEATH
L"mob/irongolem/walk", // eSoundType_MOB_IRONGOLEM_WALK "mob/irongolem/walk", // eSoundType_MOB_IRONGOLEM_WALK
// TU14 // TU14
L"damage/thorns", // eSoundType_DAMAGE_THORNS "damage/thorns", // eSoundType_DAMAGE_THORNS
L"random/anvil_break", // eSoundType_RANDOM_ANVIL_BREAK "random/anvil_break", // eSoundType_RANDOM_ANVIL_BREAK
L"random/anvil_land", // eSoundType_RANDOM_ANVIL_LAND "random/anvil_land", // eSoundType_RANDOM_ANVIL_LAND
L"random/anvil_use", // eSoundType_RANDOM_ANVIL_USE "random/anvil_use", // eSoundType_RANDOM_ANVIL_USE
L"mob/villager/haggle", // eSoundType_MOB_VILLAGER_HAGGLE "mob/villager/haggle", // eSoundType_MOB_VILLAGER_HAGGLE
L"mob/villager/idle", // eSoundType_MOB_VILLAGER_IDLE "mob/villager/idle", // eSoundType_MOB_VILLAGER_IDLE
L"mob/villager/hit", // eSoundType_MOB_VILLAGER_HIT "mob/villager/hit", // eSoundType_MOB_VILLAGER_HIT
L"mob/villager/death", // eSoundType_MOB_VILLAGER_DEATH "mob/villager/death", // eSoundType_MOB_VILLAGER_DEATH
L"mob/villager/yes", // eSoundType_MOB_VILLAGER_YES "mob/villager/yes", // eSoundType_MOB_VILLAGER_YES
L"mob/villager/no", // eSoundType_MOB_VILLAGER_NO "mob/villager/no", // eSoundType_MOB_VILLAGER_NO
L"mob/zombie/infect", // eSoundType_MOB_ZOMBIE_INFECT "mob/zombie/infect", // eSoundType_MOB_ZOMBIE_INFECT
L"mob/zombie/unfect", // eSoundType_MOB_ZOMBIE_UNFECT "mob/zombie/unfect", // eSoundType_MOB_ZOMBIE_UNFECT
L"mob/zombie/remedy", // eSoundType_MOB_ZOMBIE_REMEDY "mob/zombie/remedy", // eSoundType_MOB_ZOMBIE_REMEDY
L"step/snow", // eSoundType_STEP_SNOW "step/snow", // eSoundType_STEP_SNOW
L"step/ladder", // eSoundType_STEP_LADDER "step/ladder", // eSoundType_STEP_LADDER
L"dig/cloth", // eSoundType_DIG_CLOTH "dig/cloth", // eSoundType_DIG_CLOTH
L"dig/grass", // eSoundType_DIG_GRASS "dig/grass", // eSoundType_DIG_GRASS
L"dig/gravel", // eSoundType_DIG_GRAVEL "dig/gravel", // eSoundType_DIG_GRAVEL
L"dig/sand", // eSoundType_DIG_SAND "dig/sand", // eSoundType_DIG_SAND
L"dig/snow", // eSoundType_DIG_SNOW "dig/snow", // eSoundType_DIG_SNOW
L"dig/stone", // eSoundType_DIG_STONE "dig/stone", // eSoundType_DIG_STONE
L"dig/wood", // eSoundType_DIG_WOOD "dig/wood", // eSoundType_DIG_WOOD
// 1.6.4 // 1.6.4
L"fireworks/launch", // eSoundType_FIREWORKS_LAUNCH, "fireworks/launch", // eSoundType_FIREWORKS_LAUNCH,
L"fireworks/blast", // eSoundType_FIREWORKS_BLAST, "fireworks/blast", // eSoundType_FIREWORKS_BLAST,
L"fireworks/blast_far", // eSoundType_FIREWORKS_BLAST_FAR, "fireworks/blast_far", // eSoundType_FIREWORKS_BLAST_FAR,
L"fireworks/large_blast", // eSoundType_FIREWORKS_LARGE_BLAST, "fireworks/large_blast", // eSoundType_FIREWORKS_LARGE_BLAST,
L"fireworks/large_blast_far", // eSoundType_FIREWORKS_LARGE_BLAST_FAR, "fireworks/large_blast_far", // eSoundType_FIREWORKS_LARGE_BLAST_FAR,
L"fireworks/twinkle", // eSoundType_FIREWORKS_TWINKLE, "fireworks/twinkle", // eSoundType_FIREWORKS_TWINKLE,
L"fireworks/twinkle_far", // eSoundType_FIREWORKS_TWINKLE_FAR, "fireworks/twinkle_far", // eSoundType_FIREWORKS_TWINKLE_FAR,
L"mob/bat/idle", // eSoundType_MOB_BAT_IDLE, "mob/bat/idle", // eSoundType_MOB_BAT_IDLE,
L"mob/bat/hurt", // eSoundType_MOB_BAT_HURT, "mob/bat/hurt", // eSoundType_MOB_BAT_HURT,
L"mob/bat/death", // eSoundType_MOB_BAT_DEATH, "mob/bat/death", // eSoundType_MOB_BAT_DEATH,
L"mob/bat/takeoff", // eSoundType_MOB_BAT_TAKEOFF, "mob/bat/takeoff", // eSoundType_MOB_BAT_TAKEOFF,
L"mob/wither/spawn", // eSoundType_MOB_WITHER_SPAWN, "mob/wither/spawn", // eSoundType_MOB_WITHER_SPAWN,
L"mob/wither/idle", // eSoundType_MOB_WITHER_IDLE, "mob/wither/idle", // eSoundType_MOB_WITHER_IDLE,
L"mob/wither/hurt", // eSoundType_MOB_WITHER_HURT, "mob/wither/hurt", // eSoundType_MOB_WITHER_HURT,
L"mob/wither/death", // eSoundType_MOB_WITHER_DEATH, "mob/wither/death", // eSoundType_MOB_WITHER_DEATH,
L"mob/wither/shoot", // eSoundType_MOB_WITHER_SHOOT, "mob/wither/shoot", // eSoundType_MOB_WITHER_SHOOT,
L"mob/cow/step", // eSoundType_MOB_COW_STEP, "mob/cow/step", // eSoundType_MOB_COW_STEP,
L"mob/chicken/step", // eSoundType_MOB_CHICKEN_STEP, "mob/chicken/step", // eSoundType_MOB_CHICKEN_STEP,
L"mob/pig/step", // eSoundType_MOB_PIG_STEP, "mob/pig/step", // eSoundType_MOB_PIG_STEP,
L"mob/enderman/stare", // eSoundType_MOB_ENDERMAN_STARE, "mob/enderman/stare", // eSoundType_MOB_ENDERMAN_STARE,
L"mob/enderman/scream", // eSoundType_MOB_ENDERMAN_SCREAM, "mob/enderman/scream", // eSoundType_MOB_ENDERMAN_SCREAM,
L"mob/sheep/shear", // eSoundType_MOB_SHEEP_SHEAR, "mob/sheep/shear", // eSoundType_MOB_SHEEP_SHEAR,
L"mob/sheep/step", // eSoundType_MOB_SHEEP_STEP, "mob/sheep/step", // eSoundType_MOB_SHEEP_STEP,
L"mob/skeleton.death", // eSoundType_MOB_SKELETON_DEATH, "mob/skeleton.death", // eSoundType_MOB_SKELETON_DEATH,
L"mob/skeleton/step", // eSoundType_MOB_SKELETON_STEP, "mob/skeleton/step", // eSoundType_MOB_SKELETON_STEP,
L"mob/spider/step", // eSoundType_MOB_SPIDER_STEP, "mob/spider/step", // eSoundType_MOB_SPIDER_STEP,
L"mob/wolf/step", // eSoundType_MOB_WOLF_STEP, "mob/wolf/step", // eSoundType_MOB_WOLF_STEP,
L"mob/zombie/step", // eSoundType_MOB_ZOMBIE_STEP, "mob/zombie/step", // eSoundType_MOB_ZOMBIE_STEP,
L"liquid/swim", // eSoundType_LIQUID_SWIM, "liquid/swim", // eSoundType_LIQUID_SWIM,
L"mob/horse/land", // eSoundType_MOB_HORSE_LAND, "mob/horse/land", // eSoundType_MOB_HORSE_LAND,
L"mob/horse/armor", // eSoundType_MOB_HORSE_ARMOR, "mob/horse/armor", // eSoundType_MOB_HORSE_ARMOR,
L"mob/horse/leather", // eSoundType_MOB_HORSE_LEATHER, "mob/horse/leather", // eSoundType_MOB_HORSE_LEATHER,
L"mob/horse/zombie.death", // eSoundType_MOB_HORSE_ZOMBIE_DEATH, "mob/horse/zombie.death", // eSoundType_MOB_HORSE_ZOMBIE_DEATH,
L"mob/horse/skeleton.death", // eSoundType_MOB_HORSE_SKELETON_DEATH, "mob/horse/skeleton.death", // eSoundType_MOB_HORSE_SKELETON_DEATH,
L"mob/horse/donkey.death", // eSoundType_MOB_HORSE_DONKEY_DEATH, "mob/horse/donkey.death", // eSoundType_MOB_HORSE_DONKEY_DEATH,
L"mob/horse/death", // eSoundType_MOB_HORSE_DEATH, "mob/horse/death", // eSoundType_MOB_HORSE_DEATH,
L"mob/horse/zombie.hit", // eSoundType_MOB_HORSE_ZOMBIE_HIT, "mob/horse/zombie.hit", // eSoundType_MOB_HORSE_ZOMBIE_HIT,
L"mob/horse/skeleton.hit", // eSoundType_MOB_HORSE_SKELETON_HIT, "mob/horse/skeleton.hit", // eSoundType_MOB_HORSE_SKELETON_HIT,
L"mob/horse/donkey.hit", // eSoundType_MOB_HORSE_DONKEY_HIT, "mob/horse/donkey.hit", // eSoundType_MOB_HORSE_DONKEY_HIT,
L"mob/horse/hit", // eSoundType_MOB_HORSE_HIT, "mob/horse/hit", // eSoundType_MOB_HORSE_HIT,
L"mob/horse/zombie.idle", // eSoundType_MOB_HORSE_ZOMBIE_IDLE, "mob/horse/zombie.idle", // eSoundType_MOB_HORSE_ZOMBIE_IDLE,
L"mob/horse/skeleton.idle", // eSoundType_MOB_HORSE_SKELETON_IDLE, "mob/horse/skeleton.idle", // eSoundType_MOB_HORSE_SKELETON_IDLE,
L"mob/horse/donkey.idle", // eSoundType_MOB_HORSE_DONKEY_IDLE, "mob/horse/donkey.idle", // eSoundType_MOB_HORSE_DONKEY_IDLE,
L"mob/horse/idle", // eSoundType_MOB_HORSE_IDLE, "mob/horse/idle", // eSoundType_MOB_HORSE_IDLE,
L"mob/horse/donkey.angry", // eSoundType_MOB_HORSE_DONKEY_ANGRY, "mob/horse/donkey.angry", // eSoundType_MOB_HORSE_DONKEY_ANGRY,
L"mob/horse/angry", // eSoundType_MOB_HORSE_ANGRY, "mob/horse/angry", // eSoundType_MOB_HORSE_ANGRY,
L"mob/horse/gallop", // eSoundType_MOB_HORSE_GALLOP, "mob/horse/gallop", // eSoundType_MOB_HORSE_GALLOP,
L"mob/horse/breathe", // eSoundType_MOB_HORSE_BREATHE, "mob/horse/breathe", // eSoundType_MOB_HORSE_BREATHE,
L"mob/horse/wood", // eSoundType_MOB_HORSE_WOOD, "mob/horse/wood", // eSoundType_MOB_HORSE_WOOD,
L"mob/horse/soft", // eSoundType_MOB_HORSE_SOFT, "mob/horse/soft", // eSoundType_MOB_HORSE_SOFT,
L"mob/horse/jump", // eSoundType_MOB_HORSE_JUMP, "mob/horse/jump", // eSoundType_MOB_HORSE_JUMP,
L"mob/witch/idle", // eSoundType_MOB_WITCH_IDLE, <--- "mob/witch/idle", // eSoundType_MOB_WITCH_IDLE, <---
// missing // missing
L"mob/witch/hurt", // eSoundType_MOB_WITCH_HURT, <--- "mob/witch/hurt", // eSoundType_MOB_WITCH_HURT, <---
// missing // missing
L"mob/witch/death", // eSoundType_MOB_WITCH_DEATH, <--- "mob/witch/death", // eSoundType_MOB_WITCH_DEATH, <---
// missing // missing
L"mob/slime/big", // eSoundType_MOB_SLIME_BIG, "mob/slime/big", // eSoundType_MOB_SLIME_BIG,
L"mob/slime/small", // eSoundType_MOB_SLIME_SMALL, "mob/slime/small", // eSoundType_MOB_SLIME_SMALL,
L"eating", // eSoundType_EATING <--- missing "eating", // eSoundType_EATING <--- missing
L"random/levelup", // eSoundType_RANDOM_LEVELUP "random/levelup", // eSoundType_RANDOM_LEVELUP
// 4J-PB - Some sounds were updated, but we can't do that for the 360 or we // 4J-PB - Some sounds were updated, but we can't do that for the 360 or we
// have to do a new sound bank instead, we'll add the sounds as new ones and // have to do a new sound bank instead, we'll add the sounds as new ones and
// change the code to reference them // change the code to reference them
L"fire/new_ignite", "fire/new_ignite",
}; };
const wchar_t* ConsoleSoundEngine::wchUISoundNames[eSFX_MAX] = { const char* ConsoleSoundEngine::wchUISoundNames[eSFX_MAX] = {
L"back", L"craft", L"craftfail", L"focus", L"press", L"scroll", "back", "craft", "craftfail", "focus", "press", "scroll",
}; };

View file

@ -56,7 +56,7 @@ void BannedListManager::addLevel(int iPad, PlayerUID xuid,
// 4J-PB - write to TMS++ now // 4J-PB - write to TMS++ now
// bool // bool
// bRes=PlatformStorage.WriteTMSFile(iPad,IPlatformStorage::eGlobalStorage_TitleUser,L"BannedList",(std::uint8_t*)pBannedList, // bRes=PlatformStorage.WriteTMSFile(iPad,IPlatformStorage::eGlobalStorage_TitleUser,"BannedList",(std::uint8_t*)pBannedList,
// dwDataBytes); // dwDataBytes);
delete[] pBannedList; delete[] pBannedList;

View file

@ -14,7 +14,7 @@
#define VER_FILEVERSION_STRING "1.6" #define VER_FILEVERSION_STRING "1.6"
#define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING #define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING
#define VER_FILEVERSION_STRING_W L"1.6" #define VER_FILEVERSION_STRING_W "1.6"
#define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W #define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W
#define VER_FILEBETA_STR "" #define VER_FILEBETA_STR ""
#undef VER_FILEVERSION #undef VER_FILEVERSION
@ -27,25 +27,25 @@
#if (VER_PRODUCTBUILD < 10) #if (VER_PRODUCTBUILD < 10)
#define VER_FILEBPAD "000" #define VER_FILEBPAD "000"
#define VER_FILEBPAD_W L"000" #define VER_FILEBPAD_W "000"
#elif (VER_PRODUCTBUILD < 100) #elif (VER_PRODUCTBUILD < 100)
#define VER_FILEBPAD "00" #define VER_FILEBPAD "00"
#define VER_FILEBPAD_W L"00" #define VER_FILEBPAD_W "00"
#elif (VER_PRODUCTBUILD < 1000) #elif (VER_PRODUCTBUILD < 1000)
#define VER_FILEBPAD "0" #define VER_FILEBPAD "0"
#define VER_FILEBPAD_W L"0" #define VER_FILEBPAD_W "0"
#else #else
#define VER_FILEBPAD #define VER_FILEBPAD
#define VER_FILEBPAD_W #define VER_FILEBPAD_W
#endif #endif
#define VER_WIDE_PREFIX(x) L##x #define VER_WIDE_PREFIX(x) x
#define VER_FILEVERSION_STR2(x, y) \ #define VER_FILEVERSION_STR2(x, y) \
VER_FILEVERSION_STRING "." VER_FILEBPAD #x "." #y VER_FILEVERSION_STRING "." VER_FILEBPAD #x "." #y
#define VER_FILEVERSION_STR2_W(x, y) \ #define VER_FILEVERSION_STR2_W(x, y) \
VER_FILEVERSION_STRING_W L"." VER_FILEBPAD_W VER_WIDE_PREFIX( \ VER_FILEVERSION_STRING_W "." VER_FILEBPAD_W VER_WIDE_PREFIX( \
#x) L"." VER_WIDE_PREFIX(#y) #x) "." VER_WIDE_PREFIX(#y)
#define VER_FILEVERSION_STR1(x, y) VER_FILEVERSION_STR2(x, y) #define VER_FILEVERSION_STR1(x, y) VER_FILEVERSION_STR2(x, y)
#define VER_FILEVERSION_STR1_W(x, y) VER_FILEVERSION_STR2_W(x, y) #define VER_FILEVERSION_STR1_W(x, y) VER_FILEVERSION_STR2_W(x, y)

View file

@ -9,330 +9,330 @@
#include "java/InputOutputStream/ByteArrayInputStream.h" #include "java/InputOutputStream/ByteArrayInputStream.h"
#include "java/InputOutputStream/DataInputStream.h" #include "java/InputOutputStream/DataInputStream.h"
std::unordered_map<std::wstring, eMinecraftColour> std::unordered_map<std::string, eMinecraftColour>
ColourTable::s_colourNamesMap; ColourTable::s_colourNamesMap;
const wchar_t* ColourTable::ColourTableElements[eMinecraftColour_COUNT] = { const char* ColourTable::ColourTableElements[eMinecraftColour_COUNT] = {
L"NOTSET", "NOTSET",
L"Foliage_Evergreen", "Foliage_Evergreen",
L"Foliage_Birch", "Foliage_Birch",
L"Foliage_Default", "Foliage_Default",
L"Foliage_Common", "Foliage_Common",
L"Foliage_Ocean", "Foliage_Ocean",
L"Foliage_Plains", "Foliage_Plains",
L"Foliage_Desert", "Foliage_Desert",
L"Foliage_ExtremeHills", "Foliage_ExtremeHills",
L"Foliage_Forest", "Foliage_Forest",
L"Foliage_Taiga", "Foliage_Taiga",
L"Foliage_Swampland", "Foliage_Swampland",
L"Foliage_River", "Foliage_River",
L"Foliage_Hell", "Foliage_Hell",
L"Foliage_Sky", "Foliage_Sky",
L"Foliage_FrozenOcean", "Foliage_FrozenOcean",
L"Foliage_FrozenRiver", "Foliage_FrozenRiver",
L"Foliage_IcePlains", "Foliage_IcePlains",
L"Foliage_IceMountains", "Foliage_IceMountains",
L"Foliage_MushroomIsland", "Foliage_MushroomIsland",
L"Foliage_MushroomIslandShore", "Foliage_MushroomIslandShore",
L"Foliage_Beach", "Foliage_Beach",
L"Foliage_DesertHills", "Foliage_DesertHills",
L"Foliage_ForestHills", "Foliage_ForestHills",
L"Foliage_TaigaHills", "Foliage_TaigaHills",
L"Foliage_ExtremeHillsEdge", "Foliage_ExtremeHillsEdge",
L"Foliage_Jungle", "Foliage_Jungle",
L"Foliage_JungleHills", "Foliage_JungleHills",
L"Grass_Common", "Grass_Common",
L"Grass_Ocean", "Grass_Ocean",
L"Grass_Plains", "Grass_Plains",
L"Grass_Desert", "Grass_Desert",
L"Grass_ExtremeHills", "Grass_ExtremeHills",
L"Grass_Forest", "Grass_Forest",
L"Grass_Taiga", "Grass_Taiga",
L"Grass_Swampland", "Grass_Swampland",
L"Grass_River", "Grass_River",
L"Grass_Hell", "Grass_Hell",
L"Grass_Sky", "Grass_Sky",
L"Grass_FrozenOcean", "Grass_FrozenOcean",
L"Grass_FrozenRiver", "Grass_FrozenRiver",
L"Grass_IcePlains", "Grass_IcePlains",
L"Grass_IceMountains", "Grass_IceMountains",
L"Grass_MushroomIsland", "Grass_MushroomIsland",
L"Grass_MushroomIslandShore", "Grass_MushroomIslandShore",
L"Grass_Beach", "Grass_Beach",
L"Grass_DesertHills", "Grass_DesertHills",
L"Grass_ForestHills", "Grass_ForestHills",
L"Grass_TaigaHills", "Grass_TaigaHills",
L"Grass_ExtremeHillsEdge", "Grass_ExtremeHillsEdge",
L"Grass_Jungle", "Grass_Jungle",
L"Grass_JungleHills", "Grass_JungleHills",
L"Water_Ocean", "Water_Ocean",
L"Water_Plains", "Water_Plains",
L"Water_Desert", "Water_Desert",
L"Water_ExtremeHills", "Water_ExtremeHills",
L"Water_Forest", "Water_Forest",
L"Water_Taiga", "Water_Taiga",
L"Water_Swampland", "Water_Swampland",
L"Water_River", "Water_River",
L"Water_Hell", "Water_Hell",
L"Water_Sky", "Water_Sky",
L"Water_FrozenOcean", "Water_FrozenOcean",
L"Water_FrozenRiver", "Water_FrozenRiver",
L"Water_IcePlains", "Water_IcePlains",
L"Water_IceMountains", "Water_IceMountains",
L"Water_MushroomIsland", "Water_MushroomIsland",
L"Water_MushroomIslandShore", "Water_MushroomIslandShore",
L"Water_Beach", "Water_Beach",
L"Water_DesertHills", "Water_DesertHills",
L"Water_ForestHills", "Water_ForestHills",
L"Water_TaigaHills", "Water_TaigaHills",
L"Water_ExtremeHillsEdge", "Water_ExtremeHillsEdge",
L"Water_Jungle", "Water_Jungle",
L"Water_JungleHills", "Water_JungleHills",
L"Sky_Ocean", "Sky_Ocean",
L"Sky_Plains", "Sky_Plains",
L"Sky_Desert", "Sky_Desert",
L"Sky_ExtremeHills", "Sky_ExtremeHills",
L"Sky_Forest", "Sky_Forest",
L"Sky_Taiga", "Sky_Taiga",
L"Sky_Swampland", "Sky_Swampland",
L"Sky_River", "Sky_River",
L"Sky_Hell", "Sky_Hell",
L"Sky_Sky", "Sky_Sky",
L"Sky_FrozenOcean", "Sky_FrozenOcean",
L"Sky_FrozenRiver", "Sky_FrozenRiver",
L"Sky_IcePlains", "Sky_IcePlains",
L"Sky_IceMountains", "Sky_IceMountains",
L"Sky_MushroomIsland", "Sky_MushroomIsland",
L"Sky_MushroomIslandShore", "Sky_MushroomIslandShore",
L"Sky_Beach", "Sky_Beach",
L"Sky_DesertHills", "Sky_DesertHills",
L"Sky_ForestHills", "Sky_ForestHills",
L"Sky_TaigaHills", "Sky_TaigaHills",
L"Sky_ExtremeHillsEdge", "Sky_ExtremeHillsEdge",
L"Sky_Jungle", "Sky_Jungle",
L"Sky_JungleHills", "Sky_JungleHills",
L"Tile_RedstoneDust", "Tile_RedstoneDust",
L"Tile_RedstoneDustUnlit", "Tile_RedstoneDustUnlit",
L"Tile_RedstoneDustLitMin", "Tile_RedstoneDustLitMin",
L"Tile_RedstoneDustLitMax", "Tile_RedstoneDustLitMax",
L"Tile_StemMin", "Tile_StemMin",
L"Tile_StemMax", "Tile_StemMax",
L"Tile_WaterLily", "Tile_WaterLily",
L"Sky_Dawn_Dark", "Sky_Dawn_Dark",
L"Sky_Dawn_Bright", "Sky_Dawn_Bright",
L"Material_None", "Material_None",
L"Material_Grass", "Material_Grass",
L"Material_Sand", "Material_Sand",
L"Material_Cloth", "Material_Cloth",
L"Material_Fire", "Material_Fire",
L"Material_Ice", "Material_Ice",
L"Material_Metal", "Material_Metal",
L"Material_Plant", "Material_Plant",
L"Material_Snow", "Material_Snow",
L"Material_Clay", "Material_Clay",
L"Material_Dirt", "Material_Dirt",
L"Material_Stone", "Material_Stone",
L"Material_Water", "Material_Water",
L"Material_Wood", "Material_Wood",
L"Material_Emerald", "Material_Emerald",
L"Particle_Note_00", "Particle_Note_00",
L"Particle_Note_01", "Particle_Note_01",
L"Particle_Note_02", "Particle_Note_02",
L"Particle_Note_03", "Particle_Note_03",
L"Particle_Note_04", "Particle_Note_04",
L"Particle_Note_05", "Particle_Note_05",
L"Particle_Note_06", "Particle_Note_06",
L"Particle_Note_07", "Particle_Note_07",
L"Particle_Note_08", "Particle_Note_08",
L"Particle_Note_09", "Particle_Note_09",
L"Particle_Note_10", "Particle_Note_10",
L"Particle_Note_11", "Particle_Note_11",
L"Particle_Note_12", "Particle_Note_12",
L"Particle_Note_13", "Particle_Note_13",
L"Particle_Note_14", "Particle_Note_14",
L"Particle_Note_15", "Particle_Note_15",
L"Particle_Note_16", "Particle_Note_16",
L"Particle_Note_17", "Particle_Note_17",
L"Particle_Note_18", "Particle_Note_18",
L"Particle_Note_19", "Particle_Note_19",
L"Particle_Note_20", "Particle_Note_20",
L"Particle_Note_21", "Particle_Note_21",
L"Particle_Note_22", "Particle_Note_22",
L"Particle_Note_23", "Particle_Note_23",
L"Particle_Note_24", "Particle_Note_24",
L"Particle_NetherPortal", "Particle_NetherPortal",
L"Particle_EnderPortal", "Particle_EnderPortal",
L"Particle_Smoke", "Particle_Smoke",
L"Particle_Ender", "Particle_Ender",
L"Particle_Explode", "Particle_Explode",
L"Particle_HugeExplosion", "Particle_HugeExplosion",
L"Particle_DripWater", "Particle_DripWater",
L"Particle_DripLavaStart", "Particle_DripLavaStart",
L"Particle_DripLavaEnd", "Particle_DripLavaEnd",
L"Particle_EnchantmentTable", "Particle_EnchantmentTable",
L"Particle_DragonBreathMin", "Particle_DragonBreathMin",
L"Particle_DragonBreathMax", "Particle_DragonBreathMax",
L"Particle_Suspend", "Particle_Suspend",
L"Particle_CritStart", // arrow in air "Particle_CritStart", // arrow in air
L"Particle_CritEnd", // arrow in air "Particle_CritEnd", // arrow in air
L"Effect_MovementSpeed", "Effect_MovementSpeed",
L"Effect_MovementSlowDown", "Effect_MovementSlowDown",
L"Effect_DigSpeed", "Effect_DigSpeed",
L"Effect_DigSlowdown", "Effect_DigSlowdown",
L"Effect_DamageBoost", "Effect_DamageBoost",
L"Effect_Heal", "Effect_Heal",
L"Effect_Harm", "Effect_Harm",
L"Effect_Jump", "Effect_Jump",
L"Effect_Confusion", "Effect_Confusion",
L"Effect_Regeneration", "Effect_Regeneration",
L"Effect_DamageResistance", "Effect_DamageResistance",
L"Effect_FireResistance", "Effect_FireResistance",
L"Effect_WaterBreathing", "Effect_WaterBreathing",
L"Effect_Invisiblity", "Effect_Invisiblity",
L"Effect_Blindness", "Effect_Blindness",
L"Effect_NightVision", "Effect_NightVision",
L"Effect_Hunger", "Effect_Hunger",
L"Effect_Weakness", "Effect_Weakness",
L"Effect_Poison", "Effect_Poison",
L"Effect_Wither", "Effect_Wither",
L"Effect_HealthBoost", "Effect_HealthBoost",
L"Effect_Absorption", "Effect_Absorption",
L"Effect_Saturation", "Effect_Saturation",
L"Potion_BaseColour", "Potion_BaseColour",
L"Mob_Creeper_Colour1", "Mob_Creeper_Colour1",
L"Mob_Creeper_Colour2", "Mob_Creeper_Colour2",
L"Mob_Skeleton_Colour1", "Mob_Skeleton_Colour1",
L"Mob_Skeleton_Colour2", "Mob_Skeleton_Colour2",
L"Mob_Spider_Colour1", "Mob_Spider_Colour1",
L"Mob_Spider_Colour2", "Mob_Spider_Colour2",
L"Mob_Zombie_Colour1", "Mob_Zombie_Colour1",
L"Mob_Zombie_Colour2", "Mob_Zombie_Colour2",
L"Mob_Slime_Colour1", "Mob_Slime_Colour1",
L"Mob_Slime_Colour2", "Mob_Slime_Colour2",
L"Mob_Ghast_Colour1", "Mob_Ghast_Colour1",
L"Mob_Ghast_Colour2", "Mob_Ghast_Colour2",
L"Mob_PigZombie_Colour1", "Mob_PigZombie_Colour1",
L"Mob_PigZombie_Colour2", "Mob_PigZombie_Colour2",
L"Mob_Enderman_Colour1", "Mob_Enderman_Colour1",
L"Mob_Enderman_Colour2", "Mob_Enderman_Colour2",
L"Mob_CaveSpider_Colour1", "Mob_CaveSpider_Colour1",
L"Mob_CaveSpider_Colour2", "Mob_CaveSpider_Colour2",
L"Mob_Silverfish_Colour1", "Mob_Silverfish_Colour1",
L"Mob_Silverfish_Colour2", "Mob_Silverfish_Colour2",
L"Mob_Blaze_Colour1", "Mob_Blaze_Colour1",
L"Mob_Blaze_Colour2", "Mob_Blaze_Colour2",
L"Mob_LavaSlime_Colour1", "Mob_LavaSlime_Colour1",
L"Mob_LavaSlime_Colour2", "Mob_LavaSlime_Colour2",
L"Mob_Pig_Colour1", "Mob_Pig_Colour1",
L"Mob_Pig_Colour2", "Mob_Pig_Colour2",
L"Mob_Sheep_Colour1", "Mob_Sheep_Colour1",
L"Mob_Sheep_Colour2", "Mob_Sheep_Colour2",
L"Mob_Cow_Colour1", "Mob_Cow_Colour1",
L"Mob_Cow_Colour2", "Mob_Cow_Colour2",
L"Mob_Chicken_Colour1", "Mob_Chicken_Colour1",
L"Mob_Chicken_Colour2", "Mob_Chicken_Colour2",
L"Mob_Squid_Colour1", "Mob_Squid_Colour1",
L"Mob_Squid_Colour2", "Mob_Squid_Colour2",
L"Mob_Wolf_Colour1", "Mob_Wolf_Colour1",
L"Mob_Wolf_Colour2", "Mob_Wolf_Colour2",
L"Mob_MushroomCow_Colour1", "Mob_MushroomCow_Colour1",
L"Mob_MushroomCow_Colour2", "Mob_MushroomCow_Colour2",
L"Mob_Ocelot_Colour1", "Mob_Ocelot_Colour1",
L"Mob_Ocelot_Colour2", "Mob_Ocelot_Colour2",
L"Mob_Villager_Colour1", "Mob_Villager_Colour1",
L"Mob_Villager_Colour2", "Mob_Villager_Colour2",
L"Mob_Bat_Colour1", "Mob_Bat_Colour1",
L"Mob_Bat_Colour2", "Mob_Bat_Colour2",
L"Mob_Witch_Colour1", "Mob_Witch_Colour1",
L"Mob_Witch_Colour2", "Mob_Witch_Colour2",
L"Mob_Horse_Colour1", "Mob_Horse_Colour1",
L"Mob_Horse_Colour2", "Mob_Horse_Colour2",
L"Armour_Default_Leather_Colour", "Armour_Default_Leather_Colour",
L"Under_Water_Clear_Colour", "Under_Water_Clear_Colour",
L"Under_Lava_Clear_Colour", "Under_Lava_Clear_Colour",
L"In_Cloud_Base_Colour", "In_Cloud_Base_Colour",
L"Under_Water_Fog_Colour", "Under_Water_Fog_Colour",
L"Under_Lava_Fog_Colour", "Under_Lava_Fog_Colour",
L"In_Cloud_Fog_Colour", "In_Cloud_Fog_Colour",
L"Default_Fog_Colour", "Default_Fog_Colour",
L"Nether_Fog_Colour", "Nether_Fog_Colour",
L"End_Fog_Colour", "End_Fog_Colour",
L"Sign_Text", "Sign_Text",
L"Map_Text", "Map_Text",
L"Leash_Light_Colour", "Leash_Light_Colour",
L"Leash_Dark_Colour", "Leash_Dark_Colour",
L"Fire_Overlay", "Fire_Overlay",
L"HTMLColor_0", "HTMLColor_0",
L"HTMLColor_1", "HTMLColor_1",
L"HTMLColor_2", "HTMLColor_2",
L"HTMLColor_3", "HTMLColor_3",
L"HTMLColor_4", "HTMLColor_4",
L"HTMLColor_5", "HTMLColor_5",
L"HTMLColor_6", "HTMLColor_6",
L"HTMLColor_7", "HTMLColor_7",
L"HTMLColor_8", "HTMLColor_8",
L"HTMLColor_9", "HTMLColor_9",
L"HTMLColor_a", "HTMLColor_a",
L"HTMLColor_b", "HTMLColor_b",
L"HTMLColor_c", "HTMLColor_c",
L"HTMLColor_d", "HTMLColor_d",
L"HTMLColor_e", "HTMLColor_e",
L"HTMLColor_f", "HTMLColor_f",
L"HTMLColor_dark_0", "HTMLColor_dark_0",
L"HTMLColor_dark_1", "HTMLColor_dark_1",
L"HTMLColor_dark_2", "HTMLColor_dark_2",
L"HTMLColor_dark_3", "HTMLColor_dark_3",
L"HTMLColor_dark_4", "HTMLColor_dark_4",
L"HTMLColor_dark_5", "HTMLColor_dark_5",
L"HTMLColor_dark_6", "HTMLColor_dark_6",
L"HTMLColor_dark_7", "HTMLColor_dark_7",
L"HTMLColor_dark_8", "HTMLColor_dark_8",
L"HTMLColor_dark_9", "HTMLColor_dark_9",
L"HTMLColor_dark_a", "HTMLColor_dark_a",
L"HTMLColor_dark_b", "HTMLColor_dark_b",
L"HTMLColor_dark_c", "HTMLColor_dark_c",
L"HTMLColor_dark_d", "HTMLColor_dark_d",
L"HTMLColor_dark_e", "HTMLColor_dark_e",
L"HTMLColor_dark_f", "HTMLColor_dark_f",
L"HTMLColor_T1", "HTMLColor_T1",
L"HTMLColor_T2", "HTMLColor_T2",
L"HTMLColor_T3", "HTMLColor_T3",
L"HTMLColor_Black", "HTMLColor_Black",
L"HTMLColor_White", "HTMLColor_White",
L"Color_EnchantText", "Color_EnchantText",
L"Color_EnchantTextFocus", "Color_EnchantTextFocus",
L"Color_EnchantTextDisabled", "Color_EnchantTextDisabled",
L"Color_RenamedItemTitle", "Color_RenamedItemTitle",
}; };
void ColourTable::staticCtor() { void ColourTable::staticCtor() {
for (unsigned int i = eMinecraftColour_NOT_SET; i < eMinecraftColour_COUNT; for (unsigned int i = eMinecraftColour_NOT_SET; i < eMinecraftColour_COUNT;
++i) { ++i) {
s_colourNamesMap.insert( s_colourNamesMap.insert(
std::unordered_map<std::wstring, eMinecraftColour>::value_type( std::unordered_map<std::string, eMinecraftColour>::value_type(
ColourTableElements[i], (eMinecraftColour)i)); ColourTableElements[i], (eMinecraftColour)i));
} }
} }
@ -359,7 +359,7 @@ void ColourTable::loadColoursFromData(std::uint8_t* pbData,
int coloursCount = dis.readInt(); int coloursCount = dis.readInt();
for (int i = 0; i < coloursCount; ++i) { for (int i = 0; i < coloursCount; ++i) {
std::wstring colourId = dis.readUTF(); std::string colourId = dis.readUTF();
int colourValue = dis.readInt(); int colourValue = dis.readInt();
setColour(colourId, colourValue); setColour(colourId, colourValue);
auto it = s_colourNamesMap.find(colourId); auto it = s_colourNamesMap.find(colourId);
@ -368,15 +368,15 @@ void ColourTable::loadColoursFromData(std::uint8_t* pbData,
bais.reset(); bais.reset();
} }
void ColourTable::setColour(const std::wstring& colourName, int value) { void ColourTable::setColour(const std::string& colourName, int value) {
auto it = s_colourNamesMap.find(colourName); auto it = s_colourNamesMap.find(colourName);
if (it != s_colourNamesMap.end()) { if (it != s_colourNamesMap.end()) {
m_colourValues[(int)it->second] = value; m_colourValues[(int)it->second] = value;
} }
} }
void ColourTable::setColour(const std::wstring& colourName, void ColourTable::setColour(const std::string& colourName,
const std::wstring& value) { const std::string& value) {
setColour(colourName, fromHexWString<int>(value)); setColour(colourName, fromHexWString<int>(value));
} }

View file

@ -9,8 +9,8 @@ class ColourTable {
private: private:
unsigned int m_colourValues[eMinecraftColour_COUNT]; unsigned int m_colourValues[eMinecraftColour_COUNT];
static const wchar_t* ColourTableElements[eMinecraftColour_COUNT]; static const char* ColourTableElements[eMinecraftColour_COUNT];
static std::unordered_map<std::wstring, eMinecraftColour> s_colourNamesMap; static std::unordered_map<std::string, eMinecraftColour> s_colourNamesMap;
public: public:
static void staticCtor(); static void staticCtor();
@ -23,6 +23,6 @@ public:
unsigned int getColor(eMinecraftColour id) { return getColour(id); } unsigned int getColor(eMinecraftColour id) { return getColour(id); }
void loadColoursFromData(std::uint8_t* pbData, std::uint32_t dataLength); void loadColoursFromData(std::uint8_t* pbData, std::uint32_t dataLength);
void setColour(const std::wstring& colourName, int value); void setColour(const std::string& colourName, int value);
void setColour(const std::wstring& colourName, const std::wstring& value); void setColour(const std::string& colourName, const std::string& value);
}; };

View file

@ -11,6 +11,7 @@
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "util/StringHelpers.h"
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
#include "app/windows/XML/ATGXmlParser.h" #include "app/windows/XML/ATGXmlParser.h"
#include "app/windows/XML/xmlFilesCallback.h" #include "app/windows/XML/xmlFilesCallback.h"
@ -69,7 +70,7 @@ inline std::wstring ReadAudioParamString(const std::uint8_t* data,
} }
} // namespace } // namespace
DLCAudioFile::DLCAudioFile(const std::wstring& path) DLCAudioFile::DLCAudioFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_Audio, path) { : DLCFile(DLCManager::e_DLCType_Audio, path) {
m_pbData = nullptr; m_pbData = nullptr;
m_dataBytes = 0; m_dataBytes = 0;
@ -92,8 +93,7 @@ const wchar_t* DLCAudioFile::wchTypeNamesA[] = {
L"CREDIT", L"CREDIT",
}; };
DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType( DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const std::wstring& paramName) {
const std::wstring& paramName) {
EAudioParameterType type = e_AudioParamType_Invalid; EAudioParameterType type = e_AudioParamType_Invalid;
for (int i = 0; i < e_AudioParamType_Max; ++i) { for (int i = 0; i < e_AudioParamType_Max; ++i) {
@ -107,7 +107,7 @@ DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(
} }
void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype,
const std::wstring& value) { const std::string& value) {
switch (ptype) { switch (ptype) {
case e_AudioParamType_Credit: // If this parameter exists, then mark case e_AudioParamType_Credit: // If this parameter exists, then mark
// this as free // this as free
@ -136,14 +136,14 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype,
maximumChars = 35; maximumChars = 35;
break; break;
} }
std::wstring creditValue = value; std::string creditValue = value;
while (creditValue.length() > maximumChars) { while (creditValue.length() > maximumChars) {
unsigned int i = 1; unsigned int i = 1;
while (i < creditValue.length() && while (i < creditValue.length() &&
(i + 1) <= maximumChars) { (i + 1) <= maximumChars) {
i++; i++;
} }
int iLast = (int)creditValue.find_last_of(L" ", i); int iLast = (int)creditValue.find_last_of(" ", i);
switch (XGetLanguage()) { switch (XGetLanguage()) {
case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_JAPANESE:
case XC_LANGUAGE_TCHINESE: case XC_LANGUAGE_TCHINESE:
@ -151,7 +151,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype,
iLast = maximumChars; iLast = maximumChars;
break; break;
default: default:
iLast = (int)creditValue.find_last_of(L" ", i); iLast = (int)creditValue.find_last_of(" ", i);
break; break;
} }
@ -238,7 +238,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData,
if (it != parameterMapping.end()) { if (it != parameterMapping.end()) {
addParameter(type, (EAudioParameterType)paramBuf.dwType, addParameter(type, (EAudioParameterType)paramBuf.dwType,
ReadAudioParamString(pbTemp, 0)); wstringtofilename(ReadAudioParamString(pbTemp, 0)));
} }
pbTemp += AudioParamAdvance(paramBuf.dwWchCount); pbTemp += AudioParamAdvance(paramBuf.dwWchCount);
ReadAudioDlcStruct(&paramBuf, pbTemp); ReadAudioDlcStruct(&paramBuf, pbTemp);
@ -257,7 +257,7 @@ int DLCAudioFile::GetCountofType(DLCAudioFile::EAudioType eType) {
return m_parameters[eType].size(); return m_parameters[eType].size();
} }
std::wstring& DLCAudioFile::GetSoundName(int iIndex) { std::string& DLCAudioFile::GetSoundName(int iIndex) {
int iWorldType = e_AudioType_Overworld; int iWorldType = e_AudioType_Overworld;
while (iIndex >= m_parameters[iWorldType].size()) { while (iIndex >= m_parameters[iWorldType].size()) {
iIndex -= m_parameters[iWorldType].size(); iIndex -= m_parameters[iWorldType].size();

View file

@ -29,14 +29,14 @@ public:
}; };
static const wchar_t* wchTypeNamesA[e_AudioParamType_Max]; static const wchar_t* wchTypeNamesA[e_AudioParamType_Max];
DLCAudioFile(const std::wstring& path); DLCAudioFile(const std::string& path);
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);
virtual std::uint8_t* getData(std::uint32_t& dataBytes); virtual std::uint8_t* getData(std::uint32_t& dataBytes);
bool processDLCDataFile(std::uint8_t* pbData, std::uint32_t dataLength); bool processDLCDataFile(std::uint8_t* pbData, std::uint32_t dataLength);
int GetCountofType(DLCAudioFile::EAudioType ptype); int GetCountofType(DLCAudioFile::EAudioType ptype);
std::wstring& GetSoundName(int iIndex); std::string& GetSoundName(int iIndex);
private: private:
using DLCFile::addParameter; using DLCFile::addParameter;
@ -44,13 +44,13 @@ private:
std::uint8_t* m_pbData; std::uint8_t* m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
static const int CURRENT_AUDIO_VERSION_NUM = 1; static const int CURRENT_AUDIO_VERSION_NUM = 1;
// std::unordered_map<int, std::wstring> m_parameters; // std::unordered_map<int, std::string> m_parameters;
std::vector<std::wstring> m_parameters[e_AudioType_Max]; std::vector<std::string> m_parameters[e_AudioType_Max];
// use the EAudioType to order these // use the EAudioType to order these
void addParameter(DLCAudioFile::EAudioType type, void addParameter(DLCAudioFile::EAudioType type,
DLCAudioFile::EAudioParameterType ptype, DLCAudioFile::EAudioParameterType ptype,
const std::wstring& value); const std::string& value);
DLCAudioFile::EAudioParameterType getParameterType( DLCAudioFile::EAudioParameterType getParameterType(
const std::wstring& paramName); const std::wstring& paramName);
}; };

View file

@ -4,7 +4,7 @@
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
DLCCapeFile::DLCCapeFile(const std::wstring& path) DLCCapeFile::DLCCapeFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_Cape, path) {} : DLCFile(DLCManager::e_DLCType_Cape, path) {}
void DLCCapeFile::addData(std::uint8_t* pbData, std::uint32_t dataBytes) { void DLCCapeFile::addData(std::uint8_t* pbData, std::uint32_t dataBytes) {

View file

@ -6,7 +6,7 @@
class DLCCapeFile : public DLCFile { class DLCCapeFile : public DLCFile {
public: public:
DLCCapeFile(const std::wstring& path); DLCCapeFile(const std::string& path);
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);
}; };

View file

@ -8,7 +8,7 @@
#include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
DLCColourTableFile::DLCColourTableFile(const std::wstring& path) DLCColourTableFile::DLCColourTableFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_ColourTable, path) { : DLCFile(DLCManager::e_DLCType_ColourTable, path) {
m_colourTable = nullptr; m_colourTable = nullptr;
} }

View file

@ -11,7 +11,7 @@ private:
ColourTable* m_colourTable; ColourTable* m_colourTable;
public: public:
DLCColourTableFile(const std::wstring& path); DLCColourTableFile(const std::string& path);
~DLCColourTableFile(); ~DLCColourTableFile();
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);

View file

@ -5,17 +5,17 @@
#include "app/common/Minecraft_Macros.h" #include "app/common/Minecraft_Macros.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
DLCFile::DLCFile(DLCManager::EDLCType type, const std::wstring& path) { DLCFile::DLCFile(DLCManager::EDLCType type, const std::string& path) {
m_type = type; m_type = type;
m_path = path; m_path = path;
// store the id // store the id
bool dlcSkin = path.substr(0, 3).compare(L"dlc") == 0; bool dlcSkin = path.substr(0, 3).compare("dlc") == 0;
if (dlcSkin) { if (dlcSkin) {
std::wstring skinValue = path.substr(7, path.size()); std::string skinValue = path.substr(7, path.size());
skinValue = skinValue.substr(0, skinValue.find_first_of(L'.')); skinValue = skinValue.substr(0, skinValue.find_first_of('.'));
std::wstringstream ss; std::stringstream ss;
ss << std::dec << skinValue.c_str(); ss << std::dec << skinValue.c_str();
ss >> m_dwSkinId; ss >> m_dwSkinId;
m_dwSkinId = MAKE_SKIN_BITMASK(true, m_dwSkinId); m_dwSkinId = MAKE_SKIN_BITMASK(true, m_dwSkinId);

View file

@ -7,15 +7,15 @@
class DLCFile { class DLCFile {
protected: protected:
DLCManager::EDLCType m_type; DLCManager::EDLCType m_type;
std::wstring m_path; std::string m_path;
std::uint32_t m_dwSkinId; std::uint32_t m_dwSkinId;
public: public:
DLCFile(DLCManager::EDLCType type, const std::wstring& path); DLCFile(DLCManager::EDLCType type, const std::string& path);
virtual ~DLCFile() {} virtual ~DLCFile() {}
DLCManager::EDLCType getType() { return m_type; } DLCManager::EDLCType getType() { return m_type; }
std::wstring getPath() { return m_path; } std::string getPath() { return m_path; }
std::uint32_t getSkinID() { return m_dwSkinId; } std::uint32_t getSkinID() { return m_dwSkinId; }
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes) {} virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes) {}
@ -24,11 +24,11 @@ public:
return nullptr; return nullptr;
} }
virtual void addParameter(DLCManager::EDLCParameterType type, virtual void addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value) {} const std::string& value) {}
virtual std::wstring getParameterAsString( virtual std::string getParameterAsString(
DLCManager::EDLCParameterType type) { DLCManager::EDLCParameterType type) {
return L""; return "";
} }
virtual bool getParameterAsBool(DLCManager::EDLCParameterType type) { virtual bool getParameterAsBool(DLCManager::EDLCParameterType type) {
return false; return false;

View file

@ -5,6 +5,6 @@
class DLCGameRules : public DLCFile { class DLCGameRules : public DLCFile {
public: public:
DLCGameRules(DLCManager::EDLCType type, const std::wstring& path) DLCGameRules(DLCManager::EDLCType type, const std::string& path)
: DLCFile(type, path) {} : DLCFile(type, path) {}
}; };

View file

@ -3,7 +3,7 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "app/common/DLC/DLCGameRules.h" #include "app/common/DLC/DLCGameRules.h"
DLCGameRulesFile::DLCGameRulesFile(const std::wstring& path) DLCGameRulesFile::DLCGameRulesFile(const std::string& path)
: DLCGameRules(DLCManager::e_DLCType_GameRules, path) { : DLCGameRules(DLCManager::e_DLCType_GameRules, path) {
m_pbData = nullptr; m_pbData = nullptr;
m_dataBytes = 0; m_dataBytes = 0;

View file

@ -10,7 +10,7 @@ private:
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
public: public:
DLCGameRulesFile(const std::wstring& path); DLCGameRulesFile(const std::string& path);
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);
virtual std::uint8_t* getData(std::uint32_t& dataBytes); virtual std::uint8_t* getData(std::uint32_t& dataBytes);

View file

@ -9,14 +9,14 @@
class StringTable; class StringTable;
DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring& path) DLCGameRulesHeader::DLCGameRulesHeader(const std::string& path)
: DLCGameRules(DLCManager::e_DLCType_GameRulesHeader, path) { : DLCGameRules(DLCManager::e_DLCType_GameRulesHeader, path) {
m_pbData = nullptr; m_pbData = nullptr;
m_dataBytes = 0; m_dataBytes = 0;
m_hasData = false; m_hasData = false;
m_grfPath = path.substr(0, path.length() - 4) + L".grf"; m_grfPath = path.substr(0, path.length() - 4) + ".grf";
lgo = nullptr; lgo = nullptr;
} }

View file

@ -21,26 +21,26 @@ public:
virtual std::uint32_t getRequiredTexturePackId() { virtual std::uint32_t getRequiredTexturePackId() {
return m_requiredTexturePackId; return m_requiredTexturePackId;
} }
virtual std::wstring getDefaultSaveName() { return m_defaultSaveName; } virtual std::string getDefaultSaveName() { return m_defaultSaveName; }
virtual const wchar_t* getWorldName() { return m_worldName.c_str(); } virtual const char* getWorldName() { return m_worldName.c_str(); }
virtual const wchar_t* getDisplayName() { return m_displayName.c_str(); } virtual const char* getDisplayName() { return m_displayName.c_str(); }
virtual std::wstring getGrfPath() { return L"GameRules.grf"; } virtual std::string getGrfPath() { return "GameRules.grf"; }
virtual void setRequiresTexturePack(bool x) { m_bRequiresTexturePack = x; } virtual void setRequiresTexturePack(bool x) { m_bRequiresTexturePack = x; }
virtual void setRequiredTexturePackId(std::uint32_t x) { virtual void setRequiredTexturePackId(std::uint32_t x) {
m_requiredTexturePackId = x; m_requiredTexturePackId = x;
} }
virtual void setDefaultSaveName(const std::wstring& x) { virtual void setDefaultSaveName(const std::string& x) {
m_defaultSaveName = x; m_defaultSaveName = x;
} }
virtual void setWorldName(const std::wstring& x) { m_worldName = x; } virtual void setWorldName(const std::string& x) { m_worldName = x; }
virtual void setDisplayName(const std::wstring& x) { m_displayName = x; } virtual void setDisplayName(const std::string& x) { m_displayName = x; }
virtual void setGrfPath(const std::wstring& x) { m_grfPath = x; } virtual void setGrfPath(const std::string& x) { m_grfPath = x; }
LevelGenerationOptions* lgo; LevelGenerationOptions* lgo;
public: public:
DLCGameRulesHeader(const std::wstring& path); DLCGameRulesHeader(const std::string& path);
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);
virtual std::uint8_t* getData(std::uint32_t& dataBytes); virtual std::uint8_t* getData(std::uint32_t& dataBytes);

View file

@ -4,7 +4,7 @@
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
#include "app/common/Localisation/StringTable.h" #include "app/common/Localisation/StringTable.h"
DLCLocalisationFile::DLCLocalisationFile(const std::wstring& path) DLCLocalisationFile::DLCLocalisationFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_LocalisationData, path) { : DLCFile(DLCManager::e_DLCType_LocalisationData, path) {
m_strings = nullptr; m_strings = nullptr;
} }

View file

@ -11,7 +11,7 @@ private:
StringTable* m_strings; StringTable* m_strings;
public: public:
DLCLocalisationFile(const std::wstring& path); DLCLocalisationFile(const std::string& path);
DLCLocalisationFile( DLCLocalisationFile(
std::uint8_t* pbData, std::uint8_t* pbData,
std::uint32_t dataBytes); // when we load in a texture pack details std::uint32_t dataBytes); // when we load in a texture pack details

View file

@ -31,10 +31,10 @@
static const std::size_t DLC_WCHAR_BIN_SIZE = 2; static const std::size_t DLC_WCHAR_BIN_SIZE = 2;
#if WCHAR_MAX > 0xFFFF #if WCHAR_MAX > 0xFFFF
// than sizeof(wchar_t) != DLC_WCHAR_BIN_SIZE // than sizeof(char) != DLC_WCHAR_BIN_SIZE
// e.g. Linux and all Posix/Unix systems with wchar_t beeing 4B/32bit // e.g. Linux and all Posix/Unix systems with char beeing 4B/32bit
static_assert(sizeof(wchar_t) == 4, static_assert(sizeof(wchar_t) == 4,
"wchar_t is not 4bytes but larger than 2bytes ???"); "char is not 4bytes but larger than 2bytes ???");
static inline std::wstring dlc_read_wstring(const void* data) { static inline std::wstring dlc_read_wstring(const void* data) {
const std::uint16_t* p = static_cast<const std::uint16_t*>(data); const std::uint16_t* p = static_cast<const std::uint16_t*>(data);
@ -64,7 +64,7 @@ static inline std::wstring dlc_read_wstring(const void* data) {
// just in case. // just in case.
static_assert(sizeof(wchar_t) == 2, static_assert(sizeof(wchar_t) == 2,
"How did we get here? wide char smaller than 2 bytes"); "How did we get here? wide char smaller than 2 bytes");
// perfectly fine scince wchar_t will be 2 bytes (UCS-2/UTF-16) // perfectly fine scince char will be 2 bytes (UCS-2/UTF-16)
#define DLC_WSTRING(ptr) std::wstring((wchar_t*)(ptr)) #define DLC_WSTRING(ptr) std::wstring((wchar_t*)(ptr))
#endif #endif
@ -86,13 +86,13 @@ void ReadDlcStruct(T* out, const std::uint8_t* data, unsigned int offset = 0) {
std::memcpy(out, data + offset, sizeof(*out)); std::memcpy(out, data + offset, sizeof(*out));
} }
std::wstring getMountedDlcReadPath(const std::string& path) { std::string getMountedDlcReadPath(const std::string& path) {
std::wstring readPath = convStringToWstring(path); std::string readPath = path;
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
const std::string mountedPath = PlatformStorage.GetMountedPath(path.c_str()); const std::string mountedPath = PlatformStorage.GetMountedPath(path.c_str());
if (!mountedPath.empty()) { if (!mountedPath.empty()) {
readPath = convStringToWstring(mountedPath); readPath = mountedPath;
} }
#endif #endif
@ -104,7 +104,7 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData,
*ppData = nullptr; *ppData = nullptr;
*pBytesRead = 0; *pBytesRead = 0;
const std::wstring readPath = getMountedDlcReadPath(path); const std::string readPath = getMountedDlcReadPath(path);
const std::size_t fSize = PlatformFilesystem.fileSize(readPath); const std::size_t fSize = PlatformFilesystem.fileSize(readPath);
if (fSize == 0 || fSize > std::numeric_limits<unsigned int>::max()) { if (fSize == 0 || fSize > std::numeric_limits<unsigned int>::max()) {
return false; return false;
@ -207,13 +207,13 @@ void DLCManager::LanguageChanged(void) {
} }
} }
DLCPack* DLCManager::getPack(const std::wstring& name) { DLCPack* DLCManager::getPack(const std::string& name) {
DLCPack* pack = nullptr; DLCPack* pack = nullptr;
// uint32_t currentIndex = 0; // uint32_t currentIndex = 0;
DLCPack* currentPack = nullptr; DLCPack* currentPack = nullptr;
for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
currentPack = *it; currentPack = *it;
std::wstring wsName = currentPack->getName(); std::string wsName = currentPack->getName();
if (wsName.compare(name) == 0) { if (wsName.compare(name) == 0) {
pack = currentPack; pack = currentPack;
@ -290,7 +290,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
return foundIndex; return foundIndex;
} }
unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path, unsigned int DLCManager::getPackIndexContainingSkin(const std::string& path,
bool& found) { bool& found) {
unsigned int foundIndex = 0; unsigned int foundIndex = 0;
found = false; found = false;
@ -309,7 +309,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
return foundIndex; return foundIndex;
} }
DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) { DLCPack* DLCManager::getPackContainingSkin(const std::string& path) {
DLCPack* foundPack = nullptr; DLCPack* foundPack = nullptr;
for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
@ -323,7 +323,7 @@ DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
return foundPack; return foundPack;
} }
DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) { DLCSkinFile* DLCManager::getSkinFile(const std::string& path) {
DLCSkinFile* foundSkinfile = nullptr; DLCSkinFile* foundSkinfile = nullptr;
for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { for (auto it = m_packs.begin(); it != m_packs.end(); ++it) {
DLCPack* pack = *it; DLCPack* pack = *it;
@ -355,8 +355,8 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
uiIDA[0] = IDS_CONFIRM_OK; uiIDA[0] = IDS_CONFIRM_OK;
if (corruptDLCCount == 1 && firstCorruptPack != nullptr) { if (corruptDLCCount == 1 && firstCorruptPack != nullptr) {
// pass in the pack format string // pass in the pack format string
wchar_t wchFormat[132]; char wchFormat[132];
swprintf(wchFormat, 132, L"%ls\n\n%%ls", snprintf(wchFormat, 132, "%s\n\n%%s",
firstCorruptPack->getName().c_str()); firstCorruptPack->getName().c_str());
IPlatformStorage::EMessageResult result = ui.RequestErrorMessage( IPlatformStorage::EMessageResult result = ui.RequestErrorMessage(
@ -375,18 +375,18 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
return corruptDLCCount; return corruptDLCCount;
} }
bool DLCManager::readDLCDataFile(unsigned int& dwFilesProcessed, // bool DLCManager::readDLCDataFile(unsigned int& dwFilesProcessed,
const std::wstring& path, DLCPack* pack, // const std::string& path, DLCPack* pack,
bool fromArchive) { // bool fromArchive) {
return readDLCDataFile(dwFilesProcessed, // return readDLCDataFile(dwFilesProcessed,
std::filesystem::path(path).string(), pack, // std::filesystem::path(path).string(), pack,
fromArchive); // fromArchive);
} // }
bool DLCManager::readDLCDataFile(unsigned int& dwFilesProcessed, bool DLCManager::readDLCDataFile(unsigned int& dwFilesProcessed,
const std::string& path, DLCPack* pack, const std::string& path, DLCPack* pack,
bool fromArchive) { bool fromArchive) {
std::wstring wPath = convStringToWstring(path); std::string wPath = path;
if (fromArchive && app.getArchiveFileSize(wPath) >= 0) { if (fromArchive && app.getArchiveFileSize(wPath) >= 0) {
std::vector<uint8_t> bytes = app.getArchiveFile(wPath); std::vector<uint8_t> bytes = app.getArchiveFile(wPath);
return processDLCDataFile(dwFilesProcessed, bytes.data(), bytes.size(), return processDLCDataFile(dwFilesProcessed, bytes.data(), bytes.size(),
@ -510,7 +510,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
new DLCPack(pack->getName(), pack->getLicenseMask()); new DLCPack(pack->getName(), pack->getLicenseMask());
} else if (type != e_DLCType_PackConfig) { } else if (type != e_DLCType_PackConfig) {
dlcFile = dlcFile =
pack->addFile(type, DLC_DETAIL_WSTR(pbData, uiCurrentByte)); pack->addFile(type, wstringtofilename(DLC_DETAIL_WSTR(pbData, uiCurrentByte)));
} }
// Params // Params
@ -527,14 +527,14 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
if (it != parameterMapping.end()) { if (it != parameterMapping.end()) {
if (type == e_DLCType_PackConfig) { if (type == e_DLCType_PackConfig) {
pack->addParameter(it->second, DLC_PARAM_WSTR(pbTemp, 0)); pack->addParameter(it->second, wstringtofilename(DLC_PARAM_WSTR(pbTemp, 0)));
} else { } else {
if (dlcFile != nullptr) if (dlcFile != nullptr)
dlcFile->addParameter(it->second, dlcFile->addParameter(it->second,
DLC_PARAM_WSTR(pbTemp, 0)); wstringtofilename(DLC_PARAM_WSTR(pbTemp, 0)));
else if (dlcTexturePack != nullptr) else if (dlcTexturePack != nullptr)
dlcTexturePack->addParameter(it->second, dlcTexturePack->addParameter(it->second,
DLC_PARAM_WSTR(pbTemp, 0)); wstringtofilename(DLC_PARAM_WSTR(pbTemp, 0)));
} }
} }
pbTemp += DLC_PARAM_ADV(parBuf.dwWchCount); pbTemp += DLC_PARAM_ADV(parBuf.dwWchCount);
@ -571,7 +571,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
switch (fileBuf.dwType) { switch (fileBuf.dwType) {
case DLCManager::e_DLCType_Skin: case DLCManager::e_DLCType_Skin:
app.vSkinNames.push_back( app.vSkinNames.push_back(
DLC_DETAIL_WSTR(pbData, uiCurrentByte)); wstringtofilename(DLC_DETAIL_WSTR(pbData, uiCurrentByte)));
break; break;
} }

View file

@ -77,23 +77,23 @@ public:
void removeAllPacks(void); void removeAllPacks(void);
void LanguageChanged(void); void LanguageChanged(void);
DLCPack* getPack(const std::wstring& name); DLCPack* getPack(const std::string& name);
DLCPack* getPack(unsigned int index, EDLCType type = e_DLCType_All); DLCPack* getPack(unsigned int index, EDLCType type = e_DLCType_All);
unsigned int getPackIndex(DLCPack* pack, bool& found, unsigned int getPackIndex(DLCPack* pack, bool& found,
EDLCType type = e_DLCType_All); EDLCType type = e_DLCType_All);
DLCSkinFile* getSkinFile( DLCSkinFile* getSkinFile(
const std::wstring& path); // Will hunt all packs of type skin to find const std::string& path); // Will hunt all packs of type skin to find
// the right skinfile // the right skinfile
DLCPack* getPackContainingSkin(const std::wstring& path); DLCPack* getPackContainingSkin(const std::string& path);
unsigned int getPackIndexContainingSkin(const std::wstring& path, unsigned int getPackIndexContainingSkin(const std::string& path,
bool& found); bool& found);
unsigned int checkForCorruptDLCAndAlert(bool showMessage = true); unsigned int checkForCorruptDLCAndAlert(bool showMessage = true);
bool readDLCDataFile(unsigned int& dwFilesProcessed, // bool readDLCDataFile(unsigned int& dwFilesProcessed,
const std::wstring& path, DLCPack* pack, // const std::wstring& path, DLCPack* pack,
bool fromArchive = false); // bool fromArchive = false);
bool readDLCDataFile(unsigned int& dwFilesProcessed, bool readDLCDataFile(unsigned int& dwFilesProcessed,
const std::string& path, DLCPack* pack, const std::string& path, DLCPack* pack,
bool fromArchive = false); bool fromArchive = false);

View file

@ -24,8 +24,8 @@
#include "app/linux/Stubs/winapi_stubs.h" #include "app/linux/Stubs/winapi_stubs.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
DLCPack::DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask) { DLCPack::DLCPack(const std::string& name, std::uint32_t dwLicenseMask) {
m_dataPath = L""; m_dataPath = "";
m_packName = name; m_packName = name;
m_dwLicenseMask = dwLicenseMask; m_dwLicenseMask = dwLicenseMask;
m_ullFullOfferId = 0LL; m_ullFullOfferId = 0LL;
@ -55,7 +55,7 @@ DLCPack::~DLCPack() {
// invalidates ALL of it's children. // invalidates ALL of it's children.
if (m_data) { if (m_data) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
wprintf(L"Deleting data for DLC pack %ls\n", m_packName.c_str()); printf("Deleting data for DLC pack %s\n", m_packName.c_str());
#endif #endif
// For the same reason, don't delete data pointer for any child pack as // For the same reason, don't delete data pointer for any child pack as
// it just points to a region within the parent pack that has already // it just points to a region within the parent pack that has already
@ -96,12 +96,12 @@ void DLCPack::addChildPack(DLCPack* childPack) {
void DLCPack::setParentPack(DLCPack* parentPack) { m_parentPack = parentPack; } void DLCPack::setParentPack(DLCPack* parentPack) { m_parentPack = parentPack; }
void DLCPack::addParameter(DLCManager::EDLCParameterType type, void DLCPack::addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value) { const std::string& value) {
switch (type) { switch (type) {
case DLCManager::e_DLCParamType_PackId: { case DLCManager::e_DLCParamType_PackId: {
std::uint32_t packId = 0; std::uint32_t packId = 0;
std::wstringstream ss; std::stringstream ss;
// 4J Stu - numbered using decimal to make it easier for // 4J Stu - numbered using decimal to make it easier for
// artists/people to number manually // artists/people to number manually
ss << std::dec << value.c_str(); ss << std::dec << value.c_str();
@ -112,7 +112,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type,
case DLCManager::e_DLCParamType_PackVersion: { case DLCManager::e_DLCParamType_PackVersion: {
std::uint32_t version = 0; std::uint32_t version = 0;
std::wstringstream ss; std::stringstream ss;
// 4J Stu - numbered using decimal to make it easier for // 4J Stu - numbered using decimal to make it easier for
// artists/people to number manually // artists/people to number manually
ss << std::dec << value.c_str(); ss << std::dec << value.c_str();
@ -140,7 +140,7 @@ bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type,
case DLCManager::e_DLCParamType_NetherParticleColour: case DLCManager::e_DLCParamType_NetherParticleColour:
case DLCManager::e_DLCParamType_EnchantmentTextColour: case DLCManager::e_DLCParamType_EnchantmentTextColour:
case DLCManager::e_DLCParamType_EnchantmentTextFocusColour: { case DLCManager::e_DLCParamType_EnchantmentTextFocusColour: {
std::wstringstream ss; std::stringstream ss;
ss << std::hex << it->second.c_str(); ss << std::hex << it->second.c_str();
ss >> param; ss >> param;
} break; } break;
@ -152,13 +152,13 @@ bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type,
return false; return false;
} }
DLCFile* DLCPack::addFile(DLCManager::EDLCType type, const std::wstring& path) { DLCFile* DLCPack::addFile(DLCManager::EDLCType type, const std::string& path) {
DLCFile* newFile = nullptr; DLCFile* newFile = nullptr;
switch (type) { switch (type) {
case DLCManager::e_DLCType_Skin: { case DLCManager::e_DLCType_Skin: {
std::vector<std::wstring> splitPath = stringSplit(path, L'/'); std::vector<std::string> splitPath = stringSplit(path, '/');
std::wstring strippedPath = splitPath.back(); std::string strippedPath = splitPath.back();
newFile = new DLCSkinFile(strippedPath); newFile = new DLCSkinFile(strippedPath);
@ -170,8 +170,8 @@ DLCFile* DLCPack::addFile(DLCManager::EDLCType type, const std::wstring& path) {
} }
} break; } break;
case DLCManager::e_DLCType_Cape: { case DLCManager::e_DLCType_Cape: {
std::vector<std::wstring> splitPath = stringSplit(path, L'/'); std::vector<std::string> splitPath = stringSplit(path, '/');
std::wstring strippedPath = splitPath.back(); std::string strippedPath = splitPath.back();
newFile = new DLCCapeFile(strippedPath); newFile = new DLCCapeFile(strippedPath);
} break; } break;
case DLCManager::e_DLCType_Texture: case DLCManager::e_DLCType_Texture:
@ -208,13 +208,13 @@ DLCFile* DLCPack::addFile(DLCManager::EDLCType type, const std::wstring& path) {
// MGH - added this comp func, as the embedded func in find_if was confusing the // MGH - added this comp func, as the embedded func in find_if was confusing the
// PS3 compiler // PS3 compiler
static const std::wstring* g_pathCmpString = nullptr; static const std::string* g_pathCmpString = nullptr;
static bool pathCmp(DLCFile* val) { static bool pathCmp(DLCFile* val) {
return (g_pathCmpString->compare(val->getPath()) == 0); return (g_pathCmpString->compare(val->getPath()) == 0);
} }
bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, bool DLCPack::doesPackContainFile(DLCManager::EDLCType type,
const std::wstring& path) { const std::string& path) {
bool hasFile = false; bool hasFile = false;
if (type == DLCManager::e_DLCType_All) { if (type == DLCManager::e_DLCType_All) {
for (DLCManager::EDLCType currentType = (DLCManager::EDLCType)0; for (DLCManager::EDLCType currentType = (DLCManager::EDLCType)0;
@ -253,7 +253,7 @@ DLCFile* DLCPack::getFile(DLCManager::EDLCType type, unsigned int index) {
return file; return file;
} }
DLCFile* DLCPack::getFile(DLCManager::EDLCType type, const std::wstring& path) { DLCFile* DLCPack::getFile(DLCManager::EDLCType type, const std::string& path) {
DLCFile* file = nullptr; DLCFile* file = nullptr;
if (type == DLCManager::e_DLCType_All) { if (type == DLCManager::e_DLCType_All) {
for (DLCManager::EDLCType currentType = (DLCManager::EDLCType)0; for (DLCManager::EDLCType currentType = (DLCManager::EDLCType)0;
@ -298,7 +298,7 @@ unsigned int DLCPack::getDLCItemsCount(
}; };
unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type, unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type,
const std::wstring& path, bool& found) { const std::string& path, bool& found) {
if (type == DLCManager::e_DLCType_All) { if (type == DLCManager::e_DLCType_All) {
app.DebugPrintf("Unimplemented\n"); app.DebugPrintf("Unimplemented\n");
#if !defined(__CONTENT_PACKAGE) #if !defined(__CONTENT_PACKAGE)
@ -323,7 +323,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type,
} }
bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type,
const std::wstring& path) { const std::string& path) {
if (type == DLCManager::e_DLCType_All) { if (type == DLCManager::e_DLCType_All) {
app.DebugPrintf("Unimplemented\n"); app.DebugPrintf("Unimplemented\n");
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
@ -350,7 +350,7 @@ void DLCPack::UpdateLanguage() {
// find the language file // find the language file
if (m_files[DLCManager::e_DLCType_LocalisationData].size() > 0) { if (m_files[DLCManager::e_DLCType_LocalisationData].size() > 0) {
DLCLocalisationFile* localisationFile = (DLCLocalisationFile*)getFile( DLCLocalisationFile* localisationFile = (DLCLocalisationFile*)getFile(
DLCManager::e_DLCType_LocalisationData, L"languages.loc"); DLCManager::e_DLCType_LocalisationData, "languages.loc");
StringTable* strTable = localisationFile->getStringTable(); StringTable* strTable = localisationFile->getStringTable();
strTable->ReloadStringTable(); strTable->ReloadStringTable();
} }

View file

@ -18,10 +18,10 @@ private:
std::vector<DLCPack*> m_childPacks; std::vector<DLCPack*> m_childPacks;
DLCPack* m_parentPack; DLCPack* m_parentPack;
std::unordered_map<int, std::wstring> m_parameters; std::unordered_map<int, std::string> m_parameters;
std::wstring m_packName; std::string m_packName;
std::wstring m_dataPath; std::string m_dataPath;
std::uint32_t m_dwLicenseMask; std::uint32_t m_dwLicenseMask;
int m_dlcMountIndex; int m_dlcMountIndex;
XCONTENTDEVICEID m_dlcDeviceID; XCONTENTDEVICEID m_dlcDeviceID;
@ -34,10 +34,10 @@ private:
m_data; // This pointer is for all the data used for this pack, so m_data; // This pointer is for all the data used for this pack, so
// deleting it invalidates ALL of it's children. // deleting it invalidates ALL of it's children.
public: public:
DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask); DLCPack(const std::string& name, std::uint32_t dwLicenseMask);
~DLCPack(); ~DLCPack();
std::wstring getFullDataPath() { return m_dataPath; } std::string getFullDataPath() { return m_dataPath; }
void SetDataPointer(std::uint8_t* pbData) { m_data = pbData; } void SetDataPointer(std::uint8_t* pbData) { m_data = pbData; }
@ -62,7 +62,7 @@ public:
void setParentPack(DLCPack* parentPack); void setParentPack(DLCPack* parentPack);
void addParameter(DLCManager::EDLCParameterType type, void addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value); const std::string& value);
bool getParameterAsUInt(DLCManager::EDLCParameterType type, bool getParameterAsUInt(DLCManager::EDLCParameterType type,
unsigned int& param); unsigned int& param);
@ -71,38 +71,38 @@ public:
} }
std::uint32_t getLicenseMask() { return m_dwLicenseMask; } std::uint32_t getLicenseMask() { return m_dwLicenseMask; }
std::wstring getName() { return m_packName; } std::string getName() { return m_packName; }
void UpdateLanguage(); void UpdateLanguage();
uint64_t getPurchaseOfferId() { return m_ullFullOfferId; } uint64_t getPurchaseOfferId() { return m_ullFullOfferId; }
DLCFile* addFile(DLCManager::EDLCType type, const std::wstring& path); DLCFile* addFile(DLCManager::EDLCType type, const std::string& path);
DLCFile* getFile(DLCManager::EDLCType type, unsigned int index); DLCFile* getFile(DLCManager::EDLCType type, unsigned int index);
DLCFile* getFile(DLCManager::EDLCType type, const std::wstring& path); DLCFile* getFile(DLCManager::EDLCType type, const std::string& path);
unsigned int getDLCItemsCount( unsigned int getDLCItemsCount(
DLCManager::EDLCType type = DLCManager::e_DLCType_All); DLCManager::EDLCType type = DLCManager::e_DLCType_All);
unsigned int getFileIndexAt(DLCManager::EDLCType type, unsigned int getFileIndexAt(DLCManager::EDLCType type,
const std::wstring& path, bool& found); const std::string& path, bool& found);
bool doesPackContainFile(DLCManager::EDLCType type, bool doesPackContainFile(DLCManager::EDLCType type,
const std::wstring& path); const std::string& path);
std::uint32_t GetPackID() { return m_packId; } std::uint32_t GetPackID() { return m_packId; }
unsigned int getSkinCount() { unsigned int getSkinCount() {
return getDLCItemsCount(DLCManager::e_DLCType_Skin); return getDLCItemsCount(DLCManager::e_DLCType_Skin);
} }
unsigned int getSkinIndexAt(const std::wstring& path, bool& found) { unsigned int getSkinIndexAt(const std::string& path, bool& found) {
return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found);
} }
DLCSkinFile* getSkinFile(const std::wstring& path) { DLCSkinFile* getSkinFile(const std::string& path) {
return (DLCSkinFile*)getFile(DLCManager::e_DLCType_Skin, path); return (DLCSkinFile*)getFile(DLCManager::e_DLCType_Skin, path);
} }
DLCSkinFile* getSkinFile(unsigned int index) { DLCSkinFile* getSkinFile(unsigned int index) {
return (DLCSkinFile*)getFile(DLCManager::e_DLCType_Skin, index); return (DLCSkinFile*)getFile(DLCManager::e_DLCType_Skin, index);
} }
bool doesPackContainSkin(const std::wstring& path) { bool doesPackContainSkin(const std::string& path) {
return doesPackContainFile(DLCManager::e_DLCType_Skin, path); return doesPackContainFile(DLCManager::e_DLCType_Skin, path);
} }
bool hasPurchasedFile(DLCManager::EDLCType type, const std::wstring& path); bool hasPurchasedFile(DLCManager::EDLCType type, const std::string& path);
}; };

View file

@ -10,11 +10,11 @@
#include "minecraft/client/model/SkinBox.h" #include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
DLCSkinFile::DLCSkinFile(const std::wstring& path) DLCSkinFile::DLCSkinFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_Skin, path) { : DLCFile(DLCManager::e_DLCType_Skin, path) {
m_displayName = L""; m_displayName = "";
m_themeName = L""; m_themeName = "";
m_cape = L""; m_cape = "";
m_bIsFree = false; m_bIsFree = false;
m_uiAnimOverrideBitmask = 0L; m_uiAnimOverrideBitmask = 0L;
} }
@ -24,13 +24,13 @@ void DLCSkinFile::addData(std::uint8_t* pbData, std::uint32_t dataBytes) {
} }
void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value) { const std::string& value) {
switch (type) { switch (type) {
case DLCManager::e_DLCParamType_DisplayName: { case DLCManager::e_DLCParamType_DisplayName: {
// 4J Stu - In skin pack 2, the name for Zap is mis-spelt with two // 4J Stu - In skin pack 2, the name for Zap is mis-spelt with two
// p's as Zapp dlcskin00000109.png // p's as Zapp dlcskin00000109.png
if (m_path.compare(L"dlcskin00000109.png") == 0) { if (m_path.compare("dlcskin00000109.png") == 0) {
m_displayName = L"Zap"; m_displayName = "Zap";
} else { } else {
m_displayName = value; m_displayName = value;
} }
@ -52,7 +52,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
{ {
if (app.AlreadySeenCreditText(value)) break; if (app.AlreadySeenCreditText(value)) break;
// first add a blank string for spacing // first add a blank string for spacing
app.AddCreditText(L""); app.AddCreditText("");
int maximumChars = 55; int maximumChars = 55;
@ -72,14 +72,14 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
default: default:
break; break;
} }
std::wstring creditValue = value; std::string creditValue = value;
while (creditValue.length() > maximumChars) { while (creditValue.length() > maximumChars) {
unsigned int i = 1; unsigned int i = 1;
while (i < creditValue.length() && while (i < creditValue.length() &&
(i + 1) <= maximumChars) { (i + 1) <= maximumChars) {
i++; i++;
} }
int iLast = (int)creditValue.find_last_of(L" ", i); int iLast = (int)creditValue.find_last_of(" ", i);
switch (XGetLanguage()) { switch (XGetLanguage()) {
case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_JAPANESE:
case XC_LANGUAGE_TCHINESE: case XC_LANGUAGE_TCHINESE:
@ -87,7 +87,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
iLast = maximumChars; iLast = maximumChars;
break; break;
default: default:
iLast = (int)creditValue.find_last_of(L" ", i); iLast = (int)creditValue.find_last_of(" ", i);
break; break;
} }
@ -106,25 +106,25 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
m_cape = value; m_cape = value;
break; break;
case DLCManager::e_DLCParamType_Box: { case DLCManager::e_DLCParamType_Box: {
wchar_t wchBodyPart[10]; char wchBodyPart[10];
SKIN_BOX* pSkinBox = new SKIN_BOX; SKIN_BOX* pSkinBox = new SKIN_BOX;
memset(pSkinBox, 0, sizeof(SKIN_BOX)); memset(pSkinBox, 0, sizeof(SKIN_BOX));
swscanf(value.c_str(), L"%9ls%f%f%f%f%f%f%f%f", wchBodyPart, 10, sscanf(value.c_str(), "%9ls%f%f%f%f%f%f%f%f", wchBodyPart, 10,
&pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW, &pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW,
&pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV); &pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV);
if (wcscmp(wchBodyPart, L"HEAD") == 0) { if (strcmp(wchBodyPart, "HEAD") == 0) {
pSkinBox->ePart = eBodyPart_Head; pSkinBox->ePart = eBodyPart_Head;
} else if (wcscmp(wchBodyPart, L"BODY") == 0) { } else if (strcmp(wchBodyPart, "BODY") == 0) {
pSkinBox->ePart = eBodyPart_Body; pSkinBox->ePart = eBodyPart_Body;
} else if (wcscmp(wchBodyPart, L"ARM0") == 0) { } else if (strcmp(wchBodyPart, "ARM0") == 0) {
pSkinBox->ePart = eBodyPart_Arm0; pSkinBox->ePart = eBodyPart_Arm0;
} else if (wcscmp(wchBodyPart, L"ARM1") == 0) { } else if (strcmp(wchBodyPart, "ARM1") == 0) {
pSkinBox->ePart = eBodyPart_Arm1; pSkinBox->ePart = eBodyPart_Arm1;
} else if (wcscmp(wchBodyPart, L"LEG0") == 0) { } else if (strcmp(wchBodyPart, "LEG0") == 0) {
pSkinBox->ePart = eBodyPart_Leg0; pSkinBox->ePart = eBodyPart_Leg0;
} else if (wcscmp(wchBodyPart, L"LEG1") == 0) { } else if (strcmp(wchBodyPart, "LEG1") == 0) {
pSkinBox->ePart = eBodyPart_Leg1; pSkinBox->ePart = eBodyPart_Leg1;
} }
@ -132,7 +132,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
m_AdditionalBoxes.push_back(pSkinBox); m_AdditionalBoxes.push_back(pSkinBox);
} break; } break;
case DLCManager::e_DLCParamType_Anim: { case DLCManager::e_DLCParamType_Anim: {
swscanf(value.c_str(), L"%X", &m_uiAnimOverrideBitmask, sscanf(value.c_str(), "%X", &m_uiAnimOverrideBitmask,
sizeof(unsigned int)); sizeof(unsigned int));
uint32_t skinId = app.getSkinIdFromPath(m_path); uint32_t skinId = app.getSkinIdFromPath(m_path);
app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask); app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask);
@ -155,7 +155,7 @@ std::vector<SKIN_BOX*>* DLCSkinFile::getAdditionalBoxes() {
return &m_AdditionalBoxes; return &m_AdditionalBoxes;
} }
std::wstring DLCSkinFile::getParameterAsString( std::string DLCSkinFile::getParameterAsString(
DLCManager::EDLCParameterType type) { DLCManager::EDLCParameterType type) {
switch (type) { switch (type) {
case DLCManager::e_DLCParamType_DisplayName: case DLCManager::e_DLCParamType_DisplayName:
@ -165,7 +165,7 @@ std::wstring DLCSkinFile::getParameterAsString(
case DLCManager::e_DLCParamType_Cape: case DLCManager::e_DLCParamType_Cape:
return m_cape; return m_cape;
default: default:
return L""; return "";
} }
} }

View file

@ -11,21 +11,21 @@
class DLCSkinFile : public DLCFile { class DLCSkinFile : public DLCFile {
private: private:
std::wstring m_displayName; std::string m_displayName;
std::wstring m_themeName; std::string m_themeName;
std::wstring m_cape; std::string m_cape;
unsigned int m_uiAnimOverrideBitmask; unsigned int m_uiAnimOverrideBitmask;
bool m_bIsFree; bool m_bIsFree;
std::vector<SKIN_BOX*> m_AdditionalBoxes; std::vector<SKIN_BOX*> m_AdditionalBoxes;
public: public:
DLCSkinFile(const std::wstring& path); DLCSkinFile(const std::string& path);
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);
virtual void addParameter(DLCManager::EDLCParameterType type, virtual void addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value); const std::string& value);
virtual std::wstring getParameterAsString( virtual std::string getParameterAsString(
DLCManager::EDLCParameterType type); DLCManager::EDLCParameterType type);
virtual bool getParameterAsBool(DLCManager::EDLCParameterType type); virtual bool getParameterAsBool(DLCManager::EDLCParameterType type);
std::vector<SKIN_BOX*>* getAdditionalBoxes(); std::vector<SKIN_BOX*>* getAdditionalBoxes();

View file

@ -3,10 +3,10 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
DLCTextureFile::DLCTextureFile(const std::wstring& path) DLCTextureFile::DLCTextureFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_Texture, path) { : DLCFile(DLCManager::e_DLCType_Texture, path) {
m_bIsAnim = false; m_bIsAnim = false;
m_animString = L""; m_animString = "";
m_pbData = nullptr; m_pbData = nullptr;
m_dataBytes = 0; m_dataBytes = 0;
@ -24,7 +24,7 @@ std::uint8_t* DLCTextureFile::getData(std::uint32_t& dataBytes) {
} }
void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type, void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value) { const std::string& value) {
switch (type) { switch (type) {
case DLCManager::e_DLCParamType_Anim: case DLCManager::e_DLCParamType_Anim:
m_animString = value; m_animString = value;
@ -36,13 +36,13 @@ void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type,
} }
} }
std::wstring DLCTextureFile::getParameterAsString( std::string DLCTextureFile::getParameterAsString(
DLCManager::EDLCParameterType type) { DLCManager::EDLCParameterType type) {
switch (type) { switch (type) {
case DLCManager::e_DLCParamType_Anim: case DLCManager::e_DLCParamType_Anim:
return m_animString; return m_animString;
default: default:
return L""; return "";
} }
} }

View file

@ -8,21 +8,21 @@
class DLCTextureFile : public DLCFile { class DLCTextureFile : public DLCFile {
private: private:
bool m_bIsAnim; bool m_bIsAnim;
std::wstring m_animString; std::string m_animString;
std::uint8_t* m_pbData; std::uint8_t* m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
public: public:
DLCTextureFile(const std::wstring& path); DLCTextureFile(const std::string& path);
virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t* pbData, std::uint32_t dataBytes);
virtual std::uint8_t* getData(std::uint32_t& dataBytes); virtual std::uint8_t* getData(std::uint32_t& dataBytes);
virtual void addParameter(DLCManager::EDLCParameterType type, virtual void addParameter(DLCManager::EDLCParameterType type,
const std::wstring& value); const std::string& value);
virtual std::wstring getParameterAsString( virtual std::string getParameterAsString(
DLCManager::EDLCParameterType type); DLCManager::EDLCParameterType type);
virtual bool getParameterAsBool(DLCManager::EDLCParameterType type); virtual bool getParameterAsBool(DLCManager::EDLCParameterType type);
}; };

View file

@ -4,7 +4,7 @@
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
DLCUIDataFile::DLCUIDataFile(const std::wstring& path) DLCUIDataFile::DLCUIDataFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_UIData, path) { : DLCFile(DLCManager::e_DLCType_UIData, path) {
m_pbData = nullptr; m_pbData = nullptr;
m_dataBytes = 0; m_dataBytes = 0;

View file

@ -11,7 +11,7 @@ private:
bool m_canDeleteData; bool m_canDeleteData;
public: public:
DLCUIDataFile(const std::wstring& path); DLCUIDataFile(const std::string& path);
~DLCUIDataFile(); ~DLCUIDataFile();
using DLCFile::addData; using DLCFile::addData;

View file

@ -37,7 +37,7 @@ std::unordered_map<PlayerUID, MOJANG_DATA*> DLCController::MojangData;
std::unordered_map<int, uint64_t> DLCController::DLCTextures_PackID; std::unordered_map<int, uint64_t> DLCController::DLCTextures_PackID;
std::unordered_map<uint64_t, DLC_INFO*> DLCController::DLCInfo_Trial; std::unordered_map<uint64_t, DLC_INFO*> DLCController::DLCInfo_Trial;
std::unordered_map<uint64_t, DLC_INFO*> DLCController::DLCInfo_Full; std::unordered_map<uint64_t, DLC_INFO*> DLCController::DLCInfo_Full;
std::unordered_map<std::wstring, uint64_t> DLCController::DLCInfo_SkinName; std::unordered_map<std::string, uint64_t> DLCController::DLCInfo_SkinName;
std::uint32_t DLCController::m_dwContentTypeA[e_Marketplace_MAX] = { std::uint32_t DLCController::m_dwContentTypeA[e_Marketplace_MAX] = {
XMARKETPLACE_OFFERING_TYPE_CONTENT, XMARKETPLACE_OFFERING_TYPE_CONTENT,
@ -143,14 +143,14 @@ int DLCController::dlcMountedCallback(int iPad, std::uint32_t dwErr,
if (pack != nullptr && pack->IsCorrupt()) { if (pack != nullptr && pack->IsCorrupt()) {
app.DebugPrintf( app.DebugPrintf(
"Pack '%ls' is corrupt, removing it from the DLC Manager.\n", "Pack '%s' is corrupt, removing it from the DLC Manager.\n",
CONTENT_DATA_DISPLAY_NAME(ContentData)); CONTENT_DATA_DISPLAY_NAME(ContentData));
app.m_dlcManager.removePack(pack); app.m_dlcManager.removePack(pack);
pack = nullptr; pack = nullptr;
} }
if (pack == nullptr) { if (pack == nullptr) {
app.DebugPrintf("Pack \"%ls\" is not installed, so adding it\n", app.DebugPrintf("Pack \"%s\" is not installed, so adding it\n",
CONTENT_DATA_DISPLAY_NAME(ContentData)); CONTENT_DATA_DISPLAY_NAME(ContentData));
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
@ -169,7 +169,7 @@ int DLCController::dlcMountedCallback(int iPad, std::uint32_t dwErr,
} }
} else { } else {
app.DebugPrintf( app.DebugPrintf(
"Pack \"%ls\" is already installed. Updating license to %u\n", "Pack \"%s\" is already installed. Updating license to %u\n",
CONTENT_DATA_DISPLAY_NAME(ContentData), dwLicenceMask); CONTENT_DATA_DISPLAY_NAME(ContentData), dwLicenceMask);
pack->SetDLCMountIndex(m_iTotalDLCInstalled); pack->SetDLCMountIndex(m_iTotalDLCInstalled);
@ -199,25 +199,25 @@ void DLCController::handleDLC(DLCPack* pack) {
if (dwFilesProcessed == 0) app.m_dlcManager.removePack(pack); if (dwFilesProcessed == 0) app.m_dlcManager.removePack(pack);
} }
void DLCController::addCreditText(const wchar_t* lpStr) { void DLCController::addCreditText(const char* lpStr) {
app.DebugPrintf("ADDING CREDIT - %ls\n", lpStr); app.DebugPrintf("ADDING CREDIT - %s\n", lpStr);
SCreditTextItemDef* pCreditStruct = new SCreditTextItemDef; SCreditTextItemDef* pCreditStruct = new SCreditTextItemDef;
pCreditStruct->m_eType = eSmallText; pCreditStruct->m_eType = eSmallText;
pCreditStruct->m_iStringID[0] = NO_TRANSLATED_STRING; pCreditStruct->m_iStringID[0] = NO_TRANSLATED_STRING;
pCreditStruct->m_iStringID[1] = NO_TRANSLATED_STRING; pCreditStruct->m_iStringID[1] = NO_TRANSLATED_STRING;
pCreditStruct->m_Text = new wchar_t[wcslen(lpStr) + 1]; pCreditStruct->m_Text = new char[strlen(lpStr) + 1];
wcscpy((wchar_t*)pCreditStruct->m_Text, lpStr); strcpy((char*)pCreditStruct->m_Text, lpStr);
vDLCCredits.push_back(pCreditStruct); vDLCCredits.push_back(pCreditStruct);
} }
bool DLCController::alreadySeenCreditText(const std::wstring& wstemp) { bool DLCController::alreadySeenCreditText(const std::string& wstemp) {
for (unsigned int i = 0; i < m_vCreditText.size(); i++) { for (unsigned int i = 0; i < m_vCreditText.size(); i++) {
std::wstring temp = m_vCreditText.at(i); std::string temp = m_vCreditText.at(i);
if (temp.compare(wstemp) == 0) { if (temp.compare(wstemp) == 0) {
return true; return true;
} }
} }
m_vCreditText.push_back((wchar_t*)wstemp.c_str()); m_vCreditText.push_back((char*)wstemp.c_str());
return false; return false;
} }
@ -230,12 +230,12 @@ SCreditTextItemDef* DLCController::getDLCCredits(int iIndex) {
} }
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName, int32_t DLCController::registerDLCData(char* pType, char* pBannerName,
int iGender, uint64_t ullOfferID_Full, int iGender, uint64_t ullOfferID_Full,
uint64_t ullOfferID_Trial, uint64_t ullOfferID_Trial,
wchar_t* pFirstSkin, char* pFirstSkin,
unsigned int uiSortIndex, int iConfig, unsigned int uiSortIndex, int iConfig,
wchar_t* pDataFile) { char* pDataFile) {
int32_t hr = 0; int32_t hr = 0;
DLC_INFO* pDLCData = new DLC_INFO; DLC_INFO* pDLCData = new DLC_INFO;
memset(pDLCData, 0, sizeof(DLC_INFO)); memset(pDLCData, 0, sizeof(DLC_INFO));
@ -246,7 +246,7 @@ int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName,
pDLCData->uiSortIndex = uiSortIndex; pDLCData->uiSortIndex = uiSortIndex;
pDLCData->iConfig = iConfig; pDLCData->iConfig = iConfig;
if (pBannerName != L"") { if (pBannerName != "") {
wcsncpy_s(pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE); wcsncpy_s(pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE);
} }
if (pDataFile[0] != 0) { if (pDataFile[0] != 0) {
@ -254,18 +254,18 @@ int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName,
} }
if (pType != nullptr) { if (pType != nullptr) {
if (wcscmp(pType, L"Skin") == 0) { if (strcmp(pType, "Skin") == 0) {
pDLCData->eDLCType = e_DLC_SkinPack; pDLCData->eDLCType = e_DLC_SkinPack;
} else if (wcscmp(pType, L"Gamerpic") == 0) { } else if (strcmp(pType, "Gamerpic") == 0) {
pDLCData->eDLCType = e_DLC_Gamerpics; pDLCData->eDLCType = e_DLC_Gamerpics;
} else if (wcscmp(pType, L"Theme") == 0) { } else if (strcmp(pType, "Theme") == 0) {
pDLCData->eDLCType = e_DLC_Themes; pDLCData->eDLCType = e_DLC_Themes;
} else if (wcscmp(pType, L"Avatar") == 0) { } else if (strcmp(pType, "Avatar") == 0) {
pDLCData->eDLCType = e_DLC_AvatarItems; pDLCData->eDLCType = e_DLC_AvatarItems;
} else if (wcscmp(pType, L"MashUpPack") == 0) { } else if (strcmp(pType, "MashUpPack") == 0) {
pDLCData->eDLCType = e_DLC_MashupPacks; pDLCData->eDLCType = e_DLC_MashupPacks;
DLCTextures_PackID[pDLCData->iConfig] = ullOfferID_Full; DLCTextures_PackID[pDLCData->iConfig] = ullOfferID_Full;
} else if (wcscmp(pType, L"TexturePack") == 0) { } else if (strcmp(pType, "TexturePack") == 0) {
pDLCData->eDLCType = e_DLC_TexturePacks; pDLCData->eDLCType = e_DLC_TexturePacks;
DLCTextures_PackID[pDLCData->iConfig] = ullOfferID_Full; DLCTextures_PackID[pDLCData->iConfig] = ullOfferID_Full;
} }
@ -278,12 +278,12 @@ int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName,
return hr; return hr;
} }
#elif defined(__linux__) #elif defined(__linux__)
int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName, int32_t DLCController::registerDLCData(char* pType, char* pBannerName,
int iGender, uint64_t ullOfferID_Full, int iGender, uint64_t ullOfferID_Full,
uint64_t ullOfferID_Trial, uint64_t ullOfferID_Trial,
wchar_t* pFirstSkin, char* pFirstSkin,
unsigned int uiSortIndex, int iConfig, unsigned int uiSortIndex, int iConfig,
wchar_t* pDataFile) { char* pDataFile) {
fprintf(stderr, fprintf(stderr,
"warning: DLCController::registerDLCData unimplemented for " "warning: DLCController::registerDLCData unimplemented for "
"platform `__linux__`\n"); "platform `__linux__`\n");
@ -291,7 +291,7 @@ int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName,
} }
#endif #endif
bool DLCController::getDLCFullOfferIDForSkinID(const std::wstring& FirstSkin, bool DLCController::getDLCFullOfferIDForSkinID(const std::string& FirstSkin,
uint64_t* pullVal) { uint64_t* pullVal) {
auto it = DLCInfo_SkinName.find(FirstSkin); auto it = DLCInfo_SkinName.find(FirstSkin);
if (it == DLCInfo_SkinName.end()) { if (it == DLCInfo_SkinName.end()) {
@ -585,7 +585,7 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
for (auto it = m_TMSPPDownloadQueue.begin(); for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) { it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
if (wcscmp(pDLC->wchDataFile, if (strcmp(pDLC->wchDataFile,
pCurrent->wchFilename) == 0) { pCurrent->wchFilename) == 0) {
bAlreadyInQueue = true; bAlreadyInQueue = true;
break; break;
@ -603,7 +603,7 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
IPlatformStorage::TMS_FILETYPE_BINARY; IPlatformStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename, memcpy(pTMSPPreq->wchFilename,
pDLC->wchDataFile, pDLC->wchDataFile,
sizeof(wchar_t) * MAX_BANNERNAME_SIZE); sizeof(char) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = e_DLC_TexturePackData; pTMSPPreq->eType = e_DLC_TexturePackData;
pTMSPPreq->eState = e_TMS_ContentState_Queued; pTMSPPreq->eState = e_TMS_ContentState_Queued;
m_bAllTMSContentRetrieved = false; m_bAllTMSContentRetrieved = false;
@ -623,7 +623,7 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
for (int i = 0; i < iCount; i++) { for (int i = 0; i < iCount; i++) {
DLC_INFO* pDLC = getDLCInfoFullOffer(i); DLC_INFO* pDLC = getDLCInfoFullOffer(i);
if (pDLC->eDLCType == eType) { if (pDLC->eDLCType == eType) {
wchar_t* cString = pDLC->wchBanner; char* cString = pDLC->wchBanner;
{ {
bool bPresent = app.IsFileInMemoryTextures(cString); bool bPresent = app.IsFileInMemoryTextures(cString);
@ -632,7 +632,7 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
for (auto it = m_TMSPPDownloadQueue.begin(); for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) { it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
if (wcscmp(pDLC->wchBanner, if (strcmp(pDLC->wchBanner,
pCurrent->wchFilename) == 0) { pCurrent->wchFilename) == 0) {
bAlreadyInQueue = true; bAlreadyInQueue = true;
break; break;
@ -650,13 +650,13 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
pTMSPPreq->eFileTypeVal = pTMSPPreq->eFileTypeVal =
IPlatformStorage::TMS_FILETYPE_BINARY; IPlatformStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename, pDLC->wchBanner, memcpy(pTMSPPreq->wchFilename, pDLC->wchBanner,
sizeof(wchar_t) * MAX_BANNERNAME_SIZE); sizeof(char) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = eType; pTMSPPreq->eType = eType;
pTMSPPreq->eState = e_TMS_ContentState_Queued; pTMSPPreq->eState = e_TMS_ContentState_Queued;
m_bAllTMSContentRetrieved = false; m_bAllTMSContentRetrieved = false;
m_TMSPPDownloadQueue.push_back(pTMSPPreq); m_TMSPPDownloadQueue.push_back(pTMSPPreq);
app.DebugPrintf( app.DebugPrintf(
"===m_TMSPPDownloadQueue Adding %ls, q size is " "===m_TMSPPDownloadQueue Adding %s, q size is "
"%d\n", "%d\n",
pTMSPPreq->wchFilename, pTMSPPreq->wchFilename,
m_TMSPPDownloadQueue.size()); m_TMSPPDownloadQueue.size());
@ -682,7 +682,7 @@ int DLCController::tmsPPFileReturned(void* pParam, int iPad, int iUserData,
TMSPPRequest* pCurrent = *it; TMSPPRequest* pCurrent = *it;
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
char szFile[MAX_TMSFILENAME_SIZE]; char szFile[MAX_TMSFILENAME_SIZE];
wcstombs(szFile, pCurrent->wchFilename, MAX_TMSFILENAME_SIZE); strncpy(szFile, pCurrent->wchFilename, MAX_TMSFILENAME_SIZE);
if (strcmp(szFilename, szFile) == 0) if (strcmp(szFilename, szFile) == 0)
#endif #endif
@ -692,7 +692,7 @@ int DLCController::tmsPPFileReturned(void* pParam, int iPad, int iUserData,
if (pFileData != nullptr) { if (pFileData != nullptr) {
switch (pCurrent->eType) { switch (pCurrent->eType) {
case e_DLC_TexturePackData: { case e_DLC_TexturePackData: {
app.DebugPrintf("--- Got texturepack data %ls\n", app.DebugPrintf("--- Got texturepack data %s\n",
pCurrent->wchFilename); pCurrent->wchFilename);
int iConfig = int iConfig =
app.GetTPConfigVal(pCurrent->wchFilename); app.GetTPConfigVal(pCurrent->wchFilename);
@ -700,7 +700,7 @@ int DLCController::tmsPPFileReturned(void* pParam, int iPad, int iUserData,
pFileData->size); pFileData->size);
} break; } break;
default: default:
app.DebugPrintf("--- Got image data - %ls\n", app.DebugPrintf("--- Got image data - %s\n",
pCurrent->wchFilename); pCurrent->wchFilename);
app.AddMemoryTextureFile(pCurrent->wchFilename, app.AddMemoryTextureFile(pCurrent->wchFilename,
pFileData->pbData, pFileData->pbData,

View file

@ -36,10 +36,10 @@ public:
int iPad); int iPad);
// DLC info registration // DLC info registration
static int32_t registerDLCData(wchar_t*, wchar_t*, int, uint64_t, uint64_t, static int32_t registerDLCData(char*, char*, int, uint64_t, uint64_t,
wchar_t*, unsigned int, int, char*, unsigned int, int,
wchar_t* pDataFile); char* pDataFile);
bool getDLCFullOfferIDForSkinID(const std::wstring& FirstSkin, bool getDLCFullOfferIDForSkinID(const std::string& FirstSkin,
uint64_t* pullVal); uint64_t* pullVal);
bool getDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal); bool getDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal);
DLC_INFO* getDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial); DLC_INFO* getDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial);
@ -77,8 +77,8 @@ public:
const char* szFilename); const char* szFilename);
// Credit text // Credit text
void addCreditText(const wchar_t* lpStr); void addCreditText(const char* lpStr);
bool alreadySeenCreditText(const std::wstring& wstemp); bool alreadySeenCreditText(const std::string& wstemp);
unsigned int getDLCCreditsCount(); unsigned int getDLCCreditsCount();
SCreditTextItemDef* getDLCCredits(int iIndex); SCreditTextItemDef* getDLCCredits(int iIndex);
@ -100,7 +100,7 @@ public:
void setTickTMSDLCFiles(bool bVal) { m_bTickTMSDLCFiles = bVal; } void setTickTMSDLCFiles(bool bVal) { m_bTickTMSDLCFiles = bVal; }
// Public data needed by other parts // Public data needed by other parts
std::vector<std::wstring> m_vCreditText; std::vector<std::string> m_vCreditText;
std::uint8_t* m_pDLCFileBuffer; std::uint8_t* m_pDLCFileBuffer;
unsigned int m_dwDLCFileSize; unsigned int m_dwDLCFileSize;
@ -113,7 +113,7 @@ public:
static std::unordered_map<int, uint64_t> DLCTextures_PackID; static std::unordered_map<int, uint64_t> DLCTextures_PackID;
static std::unordered_map<uint64_t, DLC_INFO*> DLCInfo_Trial; static std::unordered_map<uint64_t, DLC_INFO*> DLCInfo_Trial;
static std::unordered_map<uint64_t, DLC_INFO*> DLCInfo_Full; static std::unordered_map<uint64_t, DLC_INFO*> DLCInfo_Full;
static std::unordered_map<std::wstring, uint64_t> DLCInfo_SkinName; static std::unordered_map<std::string, uint64_t> DLCInfo_SkinName;
static std::uint32_t m_dwContentTypeA[e_Marketplace_MAX]; static std::uint32_t m_dwContentTypeA[e_Marketplace_MAX];
private: private:

View file

@ -175,9 +175,9 @@ void Game::DebugPrintf(int user, const char* szFormat, ...) {
#endif #endif
} }
const wchar_t* Game::GetString(int iID) { const char* Game::GetString(int iID) {
// return L"Değişiklikler ve Yenilikler"; // return "Değişiklikler ve Yenilikler";
// return L"ÕÕÕÕÖÖÖÖ"; // return "ÕÕÕÕÖÖÖÖ";
return app.m_localizationManager.getString(iID); return app.m_localizationManager.getString(iID);
} }
@ -306,7 +306,7 @@ int Game::GetLocalPlayerCount(void) {
// // we only attempt to install the cape once per launch of the // // we only attempt to install the cape once per launch of the
// game m_bDefaultCapeInstallAttempted=true; // game m_bDefaultCapeInstallAttempted=true;
// //
// std::wstring wTemp=L"Default_Cape.png"; // std::string wTemp="Default_Cape.png";
// bool bRes=app.IsFileInMemoryTextures(wTemp); // bool bRes=app.IsFileInMemoryTextures(wTemp);
// // if the file is not already in the memory textures, then read // // if the file is not already in the memory textures, then read
// it from TMS if(!bRes) // it from TMS if(!bRes)
@ -317,7 +317,7 @@ int Game::GetLocalPlayerCount(void) {
// birthday cape #ifdef _CONTENT_PACKAGE // birthday cape #ifdef _CONTENT_PACKAGE
// IPlatformStorage::ETMSStatus eTMSStatus; // IPlatformStorage::ETMSStatus eTMSStatus;
// eTMSStatus=PlatformStorage.ReadTMSFile(PlatformProfile.GetPrimaryPad(),IPlatformStorage::eGlobalStorage_Title,IPlatformStorage::eTMS_FileType_Graphic, // eTMSStatus=PlatformStorage.ReadTMSFile(PlatformProfile.GetPrimaryPad(),IPlatformStorage::eGlobalStorage_Title,IPlatformStorage::eTMS_FileType_Graphic,
// L"Default_Cape.png",&pBuffer, &dwSize); // "Default_Cape.png",&pBuffer, &dwSize);
// if(eTMSStatus==IPlatformStorage::ETMSStatus_Idle) // if(eTMSStatus==IPlatformStorage::ETMSStatus_Idle)
// { // {
// app.AddMemoryTextureFile(wTemp,pBuffer,dwSize); // app.AddMemoryTextureFile(wTemp,pBuffer,dwSize);
@ -438,7 +438,7 @@ void Game::setLevelGenerationOptions(
m_gameRules.setLevelGenerationOptions(levelGen); m_gameRules.setLevelGenerationOptions(levelGen);
} }
const wchar_t* Game::GetGameRulesString(const std::wstring& key) { const char* Game::GetGameRulesString(const std::string& key) {
return m_gameRules.GetGameRulesString(key); return m_gameRules.GetGameRulesString(key);
} }
@ -453,7 +453,7 @@ const wchar_t* Game::GetGameRulesString(const std::wstring& key) {
std::wstring Game::getEntityName(eINSTANCEOF type) { std::string Game::getEntityName(eINSTANCEOF type) {
switch (type) { switch (type) {
case eTYPE_WOLF: case eTYPE_WOLF:
return app.GetString(IDS_WOLF); return app.GetString(IDS_WOLF);
@ -502,7 +502,7 @@ std::wstring Game::getEntityName(eINSTANCEOF type) {
break; break;
}; };
return L""; return "";
} }
// m_dwContentTypeA moved to DLCController // m_dwContentTypeA moved to DLCController
@ -511,18 +511,18 @@ std::wstring Game::getEntityName(eINSTANCEOF type) {
int32_t Game::RegisterMojangData(wchar_t* pXuidName, PlayerUID xuid, int32_t Game::RegisterMojangData(char* pXuidName, PlayerUID xuid,
wchar_t* pSkin, wchar_t* pCape) { char* pSkin, char* pCape) {
int32_t hr = 0; int32_t hr = 0;
eXUID eTempXuid = eXUID_Undefined; eXUID eTempXuid = eXUID_Undefined;
MOJANG_DATA* pMojangData = nullptr; MOJANG_DATA* pMojangData = nullptr;
// ignore the names if we don't recognize them // ignore the names if we don't recognize them
if (pXuidName != nullptr) { if (pXuidName != nullptr) {
if (wcscmp(pXuidName, L"XUID_NOTCH") == 0) { if (strcmp(pXuidName, "XUID_NOTCH") == 0) {
eTempXuid = eTempXuid =
eXUID_Notch; // might be needed for the apple at some point eXUID_Notch; // might be needed for the apple at some point
} else if (wcscmp(pXuidName, L"XUID_DEADMAU5") == 0) { } else if (strcmp(pXuidName, "XUID_DEADMAU5") == 0) {
eTempXuid = eXUID_Deadmau5; // Needed for the deadmau5 ears eTempXuid = eXUID_Deadmau5; // Needed for the deadmau5 ears
} else { } else {
eTempXuid = eXUID_NoName; eTempXuid = eXUID_NoName;
@ -534,8 +534,8 @@ int32_t Game::RegisterMojangData(wchar_t* pXuidName, PlayerUID xuid,
memset(pMojangData, 0, sizeof(MOJANG_DATA)); memset(pMojangData, 0, sizeof(MOJANG_DATA));
pMojangData->eXuid = eTempXuid; pMojangData->eXuid = eTempXuid;
wcsncpy(pMojangData->wchSkin, pSkin, MAX_CAPENAME_SIZE); strncpy(pMojangData->wchSkin, pSkin, MAX_CAPENAME_SIZE);
wcsncpy(pMojangData->wchCape, pCape, MAX_CAPENAME_SIZE); strncpy(pMojangData->wchCape, pCape, MAX_CAPENAME_SIZE);
DLCController::MojangData[xuid] = pMojangData; DLCController::MojangData[xuid] = pMojangData;
} }
@ -546,13 +546,13 @@ MOJANG_DATA* Game::GetMojangDataForXuid(PlayerUID xuid) {
return DLCController::MojangData[xuid]; return DLCController::MojangData[xuid];
} }
int32_t Game::RegisterConfigValues(wchar_t* pType, int iValue) { int32_t Game::RegisterConfigValues(char* pType, int iValue) {
int32_t hr = 0; int32_t hr = 0;
// #ifdef 0 // #ifdef 0
// if(pType!=nullptr) // if(pType!=nullptr)
// { // {
// if(wcscmp(pType,L"XboxOneTransfer")==0) // if(strcmp(pType,"XboxOneTransfer")==0)
// { // {
// if(iValue>0) // if(iValue>0)
// { // {
@ -563,7 +563,7 @@ int32_t Game::RegisterConfigValues(wchar_t* pType, int iValue) {
// app.m_bTransferSavesToXboxOne=false; // app.m_bTransferSavesToXboxOne=false;
// } // }
// } // }
// else if(wcscmp(pType,L"TransferSlotCount")==0) // else if(strcmp(pType,"TransferSlotCount")==0)
// { // {
// app.m_uiTransferSlotC=iValue; // app.m_uiTransferSlotC=iValue;
// } // }
@ -655,11 +655,11 @@ bool Game::IsLocalMultiplayerAvailable() {
// (moved to manager class) // (moved to manager class)
std::wstring Game::getFilePath(std::uint32_t packId, std::string Game::getFilePath(std::uint32_t packId,
std::wstring filename, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::wstring mountPoint) { std::string mountPoint) {
std::wstring path = std::string path =
getRootPath(packId, true, bAddDataFolder, mountPoint) + filename; getRootPath(packId, true, bAddDataFolder, mountPoint) + filename;
File f(path); File f(path);
if (f.exists()) { if (f.exists()) {
@ -685,19 +685,19 @@ enum ETitleUpdateTexturePacks {
}; };
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
std::wstring titleUpdateTexturePackRoot = L"Windows64\\DLC\\"; std::string titleUpdateTexturePackRoot = "Windows64\\DLC\\";
#else #else
std::wstring titleUpdateTexturePackRoot = L"CU\\DLC\\"; std::string titleUpdateTexturePackRoot = "CU\\DLC\\";
#endif #endif
std::wstring Game::getRootPath(std::uint32_t packId, std::string Game::getRootPath(std::uint32_t packId,
bool allowOverride, bool bAddDataFolder, bool allowOverride, bool bAddDataFolder,
std::wstring mountPoint) { std::string mountPoint) {
std::wstring path = mountPoint; std::string path = mountPoint;
if (allowOverride) { if (allowOverride) {
switch (packId) { switch (packId) {
case eTUTP_Halloween: case eTUTP_Halloween:
path = titleUpdateTexturePackRoot + L"Halloween Texture Pack"; path = titleUpdateTexturePackRoot + "Halloween Texture Pack";
break; break;
}; };
File folder(path); File folder(path);
@ -707,8 +707,8 @@ std::wstring Game::getRootPath(std::uint32_t packId,
} }
if (bAddDataFolder) { if (bAddDataFolder) {
return path + L"\\Data\\"; return path + "\\Data\\";
} else { } else {
return path + L"\\"; return path + "\\";
} }
} }

View file

@ -73,7 +73,7 @@ public:
typedef std::vector<PNOTIFICATION> VNOTIFICATIONS; typedef std::vector<PNOTIFICATION> VNOTIFICATIONS;
// storing skin files - delegated to SkinManager // storing skin files - delegated to SkinManager
std::vector<std::wstring>& vSkinNames = m_skinManager.vSkinNames; std::vector<std::string>& vSkinNames = m_skinManager.vSkinNames;
DLCManager m_dlcManager; DLCManager m_dlcManager;
SaveManager m_saveManager; SaveManager m_saveManager;
BannedListManager m_bannedListManager; BannedListManager m_bannedListManager;
@ -88,7 +88,7 @@ public:
MenuController m_menuController; MenuController m_menuController;
// storing credits text from the DLC - delegated to DLCController // storing credits text from the DLC - delegated to DLCController
std::vector<std::wstring>& m_vCreditText = m_dlcController.m_vCreditText; std::vector<std::string>& m_vCreditText = m_dlcController.m_vCreditText;
// In builds prior to TU5, the size of the GAME_SETTINGS struct was 204 // In builds prior to TU5, the size of the GAME_SETTINGS struct was 204
// bytes. We added a few new values to the internal struct in TU5, and even // bytes. We added a few new values to the internal struct in TU5, and even
@ -168,7 +168,7 @@ public:
} }
bool LoadEnchantingMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadEnchantingMenu(int iPad, std::shared_ptr<Inventory> inventory,
int x, int y, int z, Level* level, int x, int y, int z, Level* level,
const std::wstring& name) { const std::string& name) {
return m_menuController.loadEnchantingMenu(iPad, inventory, x, y, z, level, name); return m_menuController.loadEnchantingMenu(iPad, inventory, x, y, z, level, name);
} }
bool LoadFurnaceMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadFurnaceMenu(int iPad, std::shared_ptr<Inventory> inventory,
@ -208,7 +208,7 @@ public:
} }
bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Merchant> trader, Level* level, std::shared_ptr<Merchant> trader, Level* level,
const std::wstring& name) { const std::string& name) {
return m_menuController.loadTradingMenu(iPad, inventory, trader, level, name); return m_menuController.loadTradingMenu(iPad, inventory, trader, level, name);
} }
@ -241,7 +241,7 @@ public:
m_gameSettingsManager.setSpecialTutorialCompletionFlag(iPad, index); m_gameSettingsManager.setSpecialTutorialCompletionFlag(iPad, index);
} }
static const wchar_t* GetString(int iID); static const char* GetString(int iID);
StringTable* getStringTable() const { return m_localizationManager.getStringTable(); } StringTable* getStringTable() const { return m_localizationManager.getStringTable(); }
eGameMode GetGameMode() { return m_eGameMode; } eGameMode GetGameMode() { return m_eGameMode; }
@ -363,13 +363,13 @@ public:
unsigned char GetGameSettings(eGameSetting eVal) { unsigned char GetGameSettings(eGameSetting eVal) {
return m_gameSettingsManager.getGameSettings(eVal); return m_gameSettingsManager.getGameSettings(eVal);
} }
void SetPlayerSkin(int iPad, const std::wstring& name) { void SetPlayerSkin(int iPad, const std::string& name) {
m_skinManager.setPlayerSkin(iPad, name, GameSettingsA); m_skinManager.setPlayerSkin(iPad, name, GameSettingsA);
} }
void SetPlayerSkin(int iPad, std::uint32_t dwSkinId) { void SetPlayerSkin(int iPad, std::uint32_t dwSkinId) {
m_skinManager.setPlayerSkin(iPad, dwSkinId, GameSettingsA); m_skinManager.setPlayerSkin(iPad, dwSkinId, GameSettingsA);
} }
void SetPlayerCape(int iPad, const std::wstring& name) { void SetPlayerCape(int iPad, const std::string& name) {
m_skinManager.setPlayerCape(iPad, name, GameSettingsA); m_skinManager.setPlayerCape(iPad, name, GameSettingsA);
} }
void SetPlayerCape(int iPad, std::uint32_t dwCapeId) { void SetPlayerCape(int iPad, std::uint32_t dwCapeId) {
@ -432,13 +432,13 @@ public:
} }
public: public:
std::wstring GetPlayerSkinName(int iPad) { std::string GetPlayerSkinName(int iPad) {
return m_skinManager.getPlayerSkinName(iPad, GameSettingsA); return m_skinManager.getPlayerSkinName(iPad, GameSettingsA);
} }
std::uint32_t GetPlayerSkinId(int iPad) { std::uint32_t GetPlayerSkinId(int iPad) {
return m_skinManager.getPlayerSkinId(iPad, GameSettingsA, m_dlcManager); return m_skinManager.getPlayerSkinId(iPad, GameSettingsA, m_dlcManager);
} }
std::wstring GetPlayerCapeName(int iPad) { std::string GetPlayerCapeName(int iPad) {
return m_skinManager.getPlayerCapeName(iPad, GameSettingsA); return m_skinManager.getPlayerCapeName(iPad, GameSettingsA);
} }
std::uint32_t GetPlayerCapeId(int iPad) { std::uint32_t GetPlayerCapeId(int iPad) {
@ -523,7 +523,7 @@ public:
#endif #endif
void SetDebugSequence(const char* pchSeq); void SetDebugSequence(const char* pchSeq);
// bool UploadFileToGlobalStorage(int iQuadrant, // bool UploadFileToGlobalStorage(int iQuadrant,
// IPlatformStorage::eGlobalStorage eStorageFacility, std::wstring *wsFile ); // IPlatformStorage::eGlobalStorage eStorageFacility, std::string *wsFile );
// Installed DLC - delegated to DLCController // Installed DLC - delegated to DLCController
bool StartInstallDLCProcess(int iPad) { return m_dlcController.startInstallDLCProcess(iPad); } bool StartInstallDLCProcess(int iPad) { return m_dlcController.startInstallDLCProcess(iPad); }
@ -544,7 +544,7 @@ public:
return DLCController::marketplaceCountsCallback(pParam, details, iPad); return DLCController::marketplaceCountsCallback(pParam, details, iPad);
} }
bool AlreadySeenCreditText(const std::wstring& wstemp) { bool AlreadySeenCreditText(const std::string& wstemp) {
return m_dlcController.alreadySeenCreditText(wstemp); return m_dlcController.alreadySeenCreditText(wstemp);
} }
@ -563,18 +563,18 @@ public:
} }
bool isXuidDeadmau5(PlayerUID xuid); bool isXuidDeadmau5(PlayerUID xuid);
void AddMemoryTextureFile(const std::wstring& wName, std::uint8_t* pbData, void AddMemoryTextureFile(const std::string& wName, std::uint8_t* pbData,
unsigned int byteCount) { unsigned int byteCount) {
m_skinManager.addMemoryTextureFile(wName, pbData, byteCount); m_skinManager.addMemoryTextureFile(wName, pbData, byteCount);
} }
void RemoveMemoryTextureFile(const std::wstring& wName) { void RemoveMemoryTextureFile(const std::string& wName) {
m_skinManager.removeMemoryTextureFile(wName); m_skinManager.removeMemoryTextureFile(wName);
} }
void GetMemFileDetails(const std::wstring& wName, std::uint8_t** ppbData, void GetMemFileDetails(const std::string& wName, std::uint8_t** ppbData,
unsigned int* pByteCount) { unsigned int* pByteCount) {
m_skinManager.getMemFileDetails(wName, ppbData, pByteCount); m_skinManager.getMemFileDetails(wName, ppbData, pByteCount);
} }
bool IsFileInMemoryTextures(const std::wstring& wName) { bool IsFileInMemoryTextures(const std::string& wName) {
return m_skinManager.isFileInMemoryTextures(wName); return m_skinManager.isFileInMemoryTextures(wName);
} }
@ -593,7 +593,7 @@ public:
m_archiveManager.getTPD(iConfig, ppbData, pByteCount); m_archiveManager.getTPD(iConfig, ppbData, pByteCount);
} }
int GetTPDSize() { return m_archiveManager.getTPDSize(); } int GetTPDSize() { return m_archiveManager.getTPDSize(); }
int GetTPConfigVal(wchar_t* pwchDataFile) { int GetTPConfigVal(char* pwchDataFile) {
return m_archiveManager.getTPConfigVal(pwchDataFile); return m_archiveManager.getTPConfigVal(pwchDataFile);
} }
@ -611,7 +611,7 @@ public:
} }
// Add credits for DLC installed - delegated to DLCController // Add credits for DLC installed - delegated to DLCController
void AddCreditText(const wchar_t* lpStr) { m_dlcController.addCreditText(lpStr); } void AddCreditText(const char* lpStr) { m_dlcController.addCreditText(lpStr); }
private: private:
std::unordered_map<PlayerUID, std::uint8_t*> m_GTS_Files; std::unordered_map<PlayerUID, std::uint8_t*> m_GTS_Files;
@ -665,13 +665,13 @@ public:
} }
public: public:
int getArchiveFileSize(const std::wstring& filename) { int getArchiveFileSize(const std::string& filename) {
return m_archiveManager.getArchiveFileSize(filename); return m_archiveManager.getArchiveFileSize(filename);
} }
bool hasArchiveFile(const std::wstring& filename) { bool hasArchiveFile(const std::string& filename) {
return m_archiveManager.hasArchiveFile(filename); return m_archiveManager.hasArchiveFile(filename);
} }
std::vector<uint8_t> getArchiveFile(const std::wstring& filename) { std::vector<uint8_t> getArchiveFile(const std::string& filename) {
return m_archiveManager.getArchiveFile(filename); return m_archiveManager.getArchiveFile(filename);
} }
@ -793,17 +793,17 @@ public:
int GetHTMLFontSize(EHTMLFontSize size) { int GetHTMLFontSize(EHTMLFontSize size) {
return m_localizationManager.getHTMLFontSize(size); return m_localizationManager.getHTMLFontSize(size);
} }
std::wstring FormatHTMLString(int iPad, const std::wstring& desc, std::string FormatHTMLString(int iPad, const std::string& desc,
int shadowColour = 0xFFFFFFFF) { int shadowColour = 0xFFFFFFFF) {
return m_localizationManager.formatHTMLString(iPad, desc, shadowColour); return m_localizationManager.formatHTMLString(iPad, desc, shadowColour);
} }
std::wstring GetActionReplacement(int iPad, unsigned char ucAction) { std::string GetActionReplacement(int iPad, unsigned char ucAction) {
return m_localizationManager.getActionReplacement(iPad, ucAction); return m_localizationManager.getActionReplacement(iPad, ucAction);
} }
std::wstring GetVKReplacement(unsigned int uiVKey) { std::string GetVKReplacement(unsigned int uiVKey) {
return m_localizationManager.getVKReplacement(uiVKey); return m_localizationManager.getVKReplacement(uiVKey);
} }
std::wstring GetIconReplacement(unsigned int uiIcon) { std::string GetIconReplacement(unsigned int uiIcon) {
return m_localizationManager.getIconReplacement(uiIcon); return m_localizationManager.getIconReplacement(uiIcon);
} }
@ -836,16 +836,16 @@ public:
return m_terrainFeatureManager.getPosition(eType, pX, pZ); return m_terrainFeatureManager.getPosition(eType, pX, pZ);
} }
static int32_t RegisterMojangData(wchar_t*, PlayerUID, wchar_t*, wchar_t*); static int32_t RegisterMojangData(char*, PlayerUID, char*, char*);
MOJANG_DATA* GetMojangDataForXuid(PlayerUID xuid); MOJANG_DATA* GetMojangDataForXuid(PlayerUID xuid);
static int32_t RegisterConfigValues(wchar_t* pType, int iValue); static int32_t RegisterConfigValues(char* pType, int iValue);
static int32_t RegisterDLCData(wchar_t* a, wchar_t* b, int c, uint64_t d, uint64_t e, static int32_t RegisterDLCData(char* a, char* b, int c, uint64_t d, uint64_t e,
wchar_t* f, unsigned int g, int h, char* f, unsigned int g, int h,
wchar_t* pDataFile) { char* pDataFile) {
return DLCController::registerDLCData(a, b, c, d, e, f, g, h, pDataFile); return DLCController::registerDLCData(a, b, c, d, e, f, g, h, pDataFile);
} }
bool GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin, bool GetDLCFullOfferIDForSkinID(const std::string& FirstSkin,
uint64_t* pullVal) { uint64_t* pullVal) {
return m_dlcController.getDLCFullOfferIDForSkinID(FirstSkin, pullVal); return m_dlcController.getDLCFullOfferIDForSkinID(FirstSkin, pullVal);
} }
@ -971,7 +971,7 @@ public:
LevelGenerationOptions* getLevelGenerationOptions() { LevelGenerationOptions* getLevelGenerationOptions() {
return m_gameRules.getLevelGenerationOptions(); return m_gameRules.getLevelGenerationOptions();
} }
const wchar_t* GetGameRulesString(const std::wstring& key); const char* GetGameRulesString(const std::string& key);
// m_playerColours and m_playerGamePrivileges moved to NetworkController // m_playerColours and m_playerGamePrivileges moved to NetworkController
@ -988,7 +988,7 @@ public:
return m_networkController.getPlayerPrivileges(networkSmallId); return m_networkController.getPlayerPrivileges(networkSmallId);
} }
std::wstring getEntityName(eINSTANCEOF type); std::string getEntityName(eINSTANCEOF type);
unsigned int AddDLCRequest(eDLCMarketplaceType eContentType, unsigned int AddDLCRequest(eDLCMarketplaceType eContentType,
bool bPromote = false) { bool bPromote = false) {
@ -1053,11 +1053,11 @@ public:
unsigned int& m_dwDLCFileSize = m_dlcController.m_dwDLCFileSize; unsigned int& m_dwDLCFileSize = m_dlcController.m_dwDLCFileSize;
std::uint8_t*& m_pDLCFileBuffer = m_dlcController.m_pDLCFileBuffer; std::uint8_t*& m_pDLCFileBuffer = m_dlcController.m_pDLCFileBuffer;
// static int CallbackReadXuidsFileFromTMS(void* lpParam, wchar_t // static int CallbackReadXuidsFileFromTMS(void* lpParam, char
// *wchFilename, int iPad, bool bResult, int iAction); static int // *wchFilename, int iPad, bool bResult, int iAction); static int
// CallbackDLCFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, // CallbackDLCFileFromTMS(void* lpParam, char *wchFilename, int iPad,
// bool bResult, int iAction); static int // bool bResult, int iAction); static int
// CallbackBannedListFileFromTMS(void* lpParam, wchar_t *wchFilename, int // CallbackBannedListFileFromTMS(void* lpParam, char *wchFilename, int
// iPad, bool bResult, int iAction); // iPad, bool bResult, int iAction);
// Storing additional model parts per skin texture // Storing additional model parts per skin texture
@ -1083,18 +1083,18 @@ public:
return m_skinManager.getAnimOverrideBitmask(dwSkinID); return m_skinManager.getAnimOverrideBitmask(dwSkinID);
} }
static std::uint32_t getSkinIdFromPath(const std::wstring& skin) { static std::uint32_t getSkinIdFromPath(const std::string& skin) {
return SkinManager::getSkinIdFromPath(skin); return SkinManager::getSkinIdFromPath(skin);
} }
static std::wstring getSkinPathFromId(std::uint32_t skinId) { static std::string getSkinPathFromId(std::uint32_t skinId) {
return SkinManager::getSkinPathFromId(skinId); return SkinManager::getSkinPathFromId(skinId);
} }
int LoadLocalTMSFile(wchar_t* wchTMSFile) override = 0; int LoadLocalTMSFile(char* wchTMSFile) override = 0;
int LoadLocalTMSFile(wchar_t* wchTMSFile, int LoadLocalTMSFile(char* wchTMSFile,
eFileExtensionType eExt) override = 0; eFileExtensionType eExt) override = 0;
void FreeLocalTMSFiles(eTMSFileType eType) override = 0; void FreeLocalTMSFiles(eTMSFileType eType) override = 0;
int GetLocalTMSFileIndex(wchar_t* wchTMSFile, int GetLocalTMSFileIndex(char* wchTMSFile,
bool bFilenameIncludesExtension, bool bFilenameIncludesExtension,
eFileExtensionType eEXT) override = 0; eFileExtensionType eEXT) override = 0;
@ -1133,25 +1133,25 @@ private:
// 4J-PB - language and locale functions // 4J-PB - language and locale functions
public: public:
void LocaleAndLanguageInit() { m_localizationManager.localeAndLanguageInit(); } void LocaleAndLanguageInit() { m_localizationManager.localeAndLanguageInit(); }
void getLocale(std::vector<std::wstring>& vecWstrLocales) { void getLocale(std::vector<std::string>& vecWstrLocales) {
m_localizationManager.getLocale(vecWstrLocales); m_localizationManager.getLocale(vecWstrLocales);
} }
int get_eMCLang(wchar_t* pwchLocale) { int get_eMCLang(char* pwchLocale) {
return m_localizationManager.get_eMCLang(pwchLocale); return m_localizationManager.get_eMCLang(pwchLocale);
} }
int get_xcLang(wchar_t* pwchLocale) { int get_xcLang(char* pwchLocale) {
return m_localizationManager.get_xcLang(pwchLocale); return m_localizationManager.get_xcLang(pwchLocale);
} }
void SetTickTMSDLCFiles(bool bVal) { m_dlcController.setTickTMSDLCFiles(bVal); } void SetTickTMSDLCFiles(bool bVal) { m_dlcController.setTickTMSDLCFiles(bVal); }
std::wstring getFilePath(std::uint32_t packId, std::wstring filename, std::string getFilePath(std::uint32_t packId, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::wstring mountPoint = L"TPACK:"); std::string mountPoint = "TPACK:");
private: private:
std::wstring getRootPath(std::uint32_t packId, bool allowOverride, std::string getRootPath(std::uint32_t packId, bool allowOverride,
bool bAddDataFolder, std::wstring mountPoint); bool bAddDataFolder, std::string mountPoint);
public: public:
#if defined(_WINDOWS64) #if defined(_WINDOWS64)

View file

@ -14,7 +14,7 @@ bool GameMenuService::openCrafting2x2(int iPad, std::shared_ptr<LocalPlayer> pla
bool GameMenuService::openCrafting3x3(int iPad, std::shared_ptr<LocalPlayer> player, int x, int y, int z) { bool GameMenuService::openCrafting3x3(int iPad, std::shared_ptr<LocalPlayer> player, int x, int y, int z) {
return game_.LoadCrafting3x3Menu(iPad, player, x, y, z); return game_.LoadCrafting3x3Menu(iPad, player, x, y, z);
} }
bool GameMenuService::openEnchanting(int iPad, std::shared_ptr<Inventory> inventory, int x, int y, int z, Level* level, const std::wstring& name) { bool GameMenuService::openEnchanting(int iPad, std::shared_ptr<Inventory> inventory, int x, int y, int z, Level* level, const std::string& name) {
return game_.LoadEnchantingMenu(iPad, inventory, x, y, z, level, name); return game_.LoadEnchantingMenu(iPad, inventory, x, y, z, level, name);
} }
bool GameMenuService::openFurnace(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace) { bool GameMenuService::openFurnace(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace) {
@ -38,7 +38,7 @@ bool GameMenuService::openSign(int iPad, std::shared_ptr<SignTileEntity> sign) {
bool GameMenuService::openRepairing(int iPad, std::shared_ptr<Inventory> inventory, Level* level, int x, int y, int z) { bool GameMenuService::openRepairing(int iPad, std::shared_ptr<Inventory> inventory, Level* level, int x, int y, int z) {
return game_.LoadRepairingMenu(iPad, inventory, level, x, y, z); return game_.LoadRepairingMenu(iPad, inventory, level, x, y, z);
} }
bool GameMenuService::openTrading(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level* level, const std::wstring& name) { bool GameMenuService::openTrading(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level* level, const std::string& name) {
return game_.LoadTradingMenu(iPad, inventory, trader, level, name); return game_.LoadTradingMenu(iPad, inventory, trader, level, name);
} }
bool GameMenuService::openCommandBlock(int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) { bool GameMenuService::openCommandBlock(int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) {

View file

@ -18,7 +18,7 @@ public:
int y, int z) override; int y, int z) override;
bool openEnchanting(int iPad, std::shared_ptr<Inventory> inventory, int x, bool openEnchanting(int iPad, std::shared_ptr<Inventory> inventory, int x,
int y, int z, Level* level, int y, int z, Level* level,
const std::wstring& name) override; const std::string& name) override;
bool openFurnace(int iPad, std::shared_ptr<Inventory> inventory, bool openFurnace(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<FurnaceTileEntity> furnace) override; std::shared_ptr<FurnaceTileEntity> furnace) override;
bool openBrewingStand( bool openBrewingStand(
@ -35,7 +35,7 @@ public:
Level* level, int x, int y, int z) override; Level* level, int x, int y, int z) override;
bool openTrading(int iPad, std::shared_ptr<Inventory> inventory, bool openTrading(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Merchant> trader, Level* level, std::shared_ptr<Merchant> trader, Level* level,
const std::wstring& name) override; const std::string& name) override;
bool openCommandBlock( bool openCommandBlock(
int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) override; int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) override;
bool openHopper(int iPad, std::shared_ptr<Inventory> inventory, bool openHopper(int iPad, std::shared_ptr<Inventory> inventory,

View file

@ -29,73 +29,73 @@
#include "minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.h" #include "minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.h"
#include "strings.h" #include "strings.h"
const wchar_t* GameRuleManager::wchTagNameA[] = { const char* GameRuleManager::wchTagNameA[] = {
L"", // eGameRuleType_Root "", // eGameRuleType_Root
L"MapOptions", // eGameRuleType_LevelGenerationOptions "MapOptions", // eGameRuleType_LevelGenerationOptions
L"ApplySchematic", // eGameRuleType_ApplySchematic "ApplySchematic", // eGameRuleType_ApplySchematic
L"GenerateStructure", // eGameRuleType_GenerateStructure "GenerateStructure", // eGameRuleType_GenerateStructure
L"GenerateBox", // eGameRuleType_GenerateBox "GenerateBox", // eGameRuleType_GenerateBox
L"PlaceBlock", // eGameRuleType_PlaceBlock "PlaceBlock", // eGameRuleType_PlaceBlock
L"PlaceContainer", // eGameRuleType_PlaceContainer "PlaceContainer", // eGameRuleType_PlaceContainer
L"PlaceSpawner", // eGameRuleType_PlaceSpawner "PlaceSpawner", // eGameRuleType_PlaceSpawner
L"BiomeOverride", // eGameRuleType_BiomeOverride "BiomeOverride", // eGameRuleType_BiomeOverride
L"StartFeature", // eGameRuleType_StartFeature "StartFeature", // eGameRuleType_StartFeature
L"AddItem", // eGameRuleType_AddItem "AddItem", // eGameRuleType_AddItem
L"AddEnchantment", // eGameRuleType_AddEnchantment "AddEnchantment", // eGameRuleType_AddEnchantment
L"LevelRules", // eGameRuleType_LevelRules "LevelRules", // eGameRuleType_LevelRules
L"NamedArea", // eGameRuleType_NamedArea "NamedArea", // eGameRuleType_NamedArea
L"UseTile", // eGameRuleType_UseTileRule "UseTile", // eGameRuleType_UseTileRule
L"CollectItem", // eGameRuleType_CollectItemRule "CollectItem", // eGameRuleType_CollectItemRule
L"CompleteAll", // eGameRuleType_CompleteAllRule "CompleteAll", // eGameRuleType_CompleteAllRule
L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule "UpdatePlayer", // eGameRuleType_UpdatePlayerRule
}; };
const wchar_t* GameRuleManager::wchAttrNameA[] = { const char* GameRuleManager::wchAttrNameA[] = {
L"descriptionName", // eGameRuleAttr_descriptionName "descriptionName", // eGameRuleAttr_descriptionName
L"promptName", // eGameRuleAttr_promptName "promptName", // eGameRuleAttr_promptName
L"dataTag", // eGameRuleAttr_dataTag "dataTag", // eGameRuleAttr_dataTag
L"enchantmentId", // eGameRuleAttr_enchantmentId "enchantmentId", // eGameRuleAttr_enchantmentId
L"enchantmentLevel", // eGameRuleAttr_enchantmentLevel "enchantmentLevel", // eGameRuleAttr_enchantmentLevel
L"itemId", // eGameRuleAttr_itemId "itemId", // eGameRuleAttr_itemId
L"quantity", // eGameRuleAttr_quantity "quantity", // eGameRuleAttr_quantity
L"auxValue", // eGameRuleAttr_auxValue "auxValue", // eGameRuleAttr_auxValue
L"slot", // eGameRuleAttr_slot "slot", // eGameRuleAttr_slot
L"name", // eGameRuleAttr_name "name", // eGameRuleAttr_name
L"food", // eGameRuleAttr_food "food", // eGameRuleAttr_food
L"health", // eGameRuleAttr_health "health", // eGameRuleAttr_health
L"tileId", // eGameRuleAttr_tileId "tileId", // eGameRuleAttr_tileId
L"useCoords", // eGameRuleAttr_useCoords "useCoords", // eGameRuleAttr_useCoords
L"seed", // eGameRuleAttr_seed "seed", // eGameRuleAttr_seed
L"flatworld", // eGameRuleAttr_flatworld "flatworld", // eGameRuleAttr_flatworld
L"filename", // eGameRuleAttr_filename "filename", // eGameRuleAttr_filename
L"rot", // eGameRuleAttr_rot "rot", // eGameRuleAttr_rot
L"data", // eGameRuleAttr_data "data", // eGameRuleAttr_data
L"block", // eGameRuleAttr_block "block", // eGameRuleAttr_block
L"entity", // eGameRuleAttr_entity "entity", // eGameRuleAttr_entity
L"facing", // eGameRuleAttr_facing "facing", // eGameRuleAttr_facing
L"edgeTile", // eGameRuleAttr_edgeTile "edgeTile", // eGameRuleAttr_edgeTile
L"fillTile", // eGameRuleAttr_fillTile "fillTile", // eGameRuleAttr_fillTile
L"skipAir", // eGameRuleAttr_skipAir "skipAir", // eGameRuleAttr_skipAir
L"x", // eGameRuleAttr_x "x", // eGameRuleAttr_x
L"x0", // eGameRuleAttr_x0 "x0", // eGameRuleAttr_x0
L"x1", // eGameRuleAttr_x1 "x1", // eGameRuleAttr_x1
L"y", // eGameRuleAttr_y "y", // eGameRuleAttr_y
L"y0", // eGameRuleAttr_y0 "y0", // eGameRuleAttr_y0
L"y1", // eGameRuleAttr_y1 "y1", // eGameRuleAttr_y1
L"z", // eGameRuleAttr_z "z", // eGameRuleAttr_z
L"z0", // eGameRuleAttr_z0 "z0", // eGameRuleAttr_z0
L"z1", // eGameRuleAttr_z1 "z1", // eGameRuleAttr_z1
L"chunkX", // eGameRuleAttr_chunkX "chunkX", // eGameRuleAttr_chunkX
L"chunkZ", // eGameRuleAttr_chunkZ "chunkZ", // eGameRuleAttr_chunkZ
L"yRot", // eGameRuleAttr_yRot "yRot", // eGameRuleAttr_yRot
L"spawnX", // eGameRuleAttr_spawnX "spawnX", // eGameRuleAttr_spawnX
L"spawnY", // eGameRuleAttr_spawnY "spawnY", // eGameRuleAttr_spawnY
L"spawnZ", // eGameRuleAttr_spawnZ "spawnZ", // eGameRuleAttr_spawnZ
L"orientation", "orientation",
L"dimension", "dimension",
L"topTileId", // eGameRuleAttr_topTileId "topTileId", // eGameRuleAttr_topTileId
L"biomeId", // eGameRuleAttr_biomeId "biomeId", // eGameRuleAttr_biomeId
L"feature", // eGameRuleAttr_feature "feature", // eGameRuleAttr_feature
}; };
GameRuleManager::GameRuleManager() { GameRuleManager::GameRuleManager() {
@ -107,10 +107,10 @@ void GameRuleManager::loadGameRules(DLCPack* pack) {
StringTable* strings = nullptr; StringTable* strings = nullptr;
if (pack->doesPackContainFile(DLCManager::e_DLCType_LocalisationData, if (pack->doesPackContainFile(DLCManager::e_DLCType_LocalisationData,
L"languages.loc")) { "languages.loc")) {
DLCLocalisationFile* localisationFile = DLCLocalisationFile* localisationFile =
(DLCLocalisationFile*)pack->getFile( (DLCLocalisationFile*)pack->getFile(
DLCManager::e_DLCType_LocalisationData, L"languages.loc"); DLCManager::e_DLCType_LocalisationData, "languages.loc");
strings = localisationFile->getStringTable(); strings = localisationFile->getStringTable();
} }
@ -231,7 +231,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions* lgo, uint8_t* dIn,
dis2.read(bRuleFile); dis2.read(bRuleFile);
// 4J-JEV: I don't believe that the path-name is ever used. // 4J-JEV: I don't believe that the path-name is ever used.
// DLCGameRulesFile *dlcgr = new DLCGameRulesFile(L"__PLACEHOLDER__"); // DLCGameRulesFile *dlcgr = new DLCGameRulesFile("__PLACEHOLDER__");
// dlcgr->addData(bRuleFile.data(),bRuleFile.size()); // dlcgr->addData(bRuleFile.data(),bRuleFile.size());
if (readRuleFile(lgo, bRuleFile.data(), bRuleFile.size(), strings)) { if (readRuleFile(lgo, bRuleFile.data(), bRuleFile.size(), strings)) {
@ -358,11 +358,11 @@ void GameRuleManager::writeRuleFile(DataOutputStream* dos) {
dos->writeUTF(wchAttrNameA[i]); dos->writeUTF(wchAttrNameA[i]);
// Write schematic files. // Write schematic files.
std::unordered_map<std::wstring, ConsoleSchematicFile*>* files; std::unordered_map<std::string, ConsoleSchematicFile*>* files;
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles(); files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
dos->writeInt(files->size()); dos->writeInt(files->size());
for (auto it = files->begin(); it != files->end(); it++) { for (auto it = files->begin(); it != files->end(); it++) {
std::wstring filename = it->first; std::string filename = it->first;
ConsoleSchematicFile* file = it->second; ConsoleSchematicFile* file = it->second;
ByteArrayOutputStream fileBaos; ByteArrayOutputStream fileBaos;
@ -488,7 +488,7 @@ bool GameRuleManager::readRuleFile(
// string lookup. // string lookup.
unsigned int numStrings = contentDis->readInt(); unsigned int numStrings = contentDis->readInt();
std::vector<std::wstring> tagsAndAtts; std::vector<std::string> tagsAndAtts;
for (unsigned int i = 0; i < numStrings; i++) for (unsigned int i = 0; i < numStrings; i++)
tagsAndAtts.push_back(contentDis->readUTF()); tagsAndAtts.push_back(contentDis->readUTF());
@ -525,7 +525,7 @@ bool GameRuleManager::readRuleFile(
// subfile // subfile
unsigned int numFiles = contentDis->readInt(); unsigned int numFiles = contentDis->readInt();
for (unsigned int i = 0; i < numFiles; i++) { for (unsigned int i = 0; i < numFiles; i++) {
std::wstring sFilename = contentDis->readUTF(); std::string sFilename = contentDis->readUTF();
int length = contentDis->readInt(); int length = contentDis->readInt();
std::vector<uint8_t> ba(length); std::vector<uint8_t> ba(length);
@ -550,13 +550,13 @@ bool GameRuleManager::readRuleFile(
if (tagVal == ConsoleGameRules::eGameRuleType_LevelGenerationOptions) { if (tagVal == ConsoleGameRules::eGameRuleType_LevelGenerationOptions) {
rule = levelGenerator; rule = levelGenerator;
levelGenAdded = true; levelGenAdded = true;
// m_levelGenerators.addLevelGenerator(L"",levelGenerator); // m_levelGenerators.addLevelGenerator("",levelGenerator);
lgoID = addLevelGenerationOptions(levelGenerator); lgoID = addLevelGenerationOptions(levelGenerator);
levelGenerator->loadStringTable(strings); levelGenerator->loadStringTable(strings);
} else if (tagVal == ConsoleGameRules::eGameRuleType_LevelRules) { } else if (tagVal == ConsoleGameRules::eGameRuleType_LevelRules) {
rule = gameRules; rule = gameRules;
gameRulesAdded = true; gameRulesAdded = true;
m_levelRules.addLevelRule(L"", gameRules); m_levelRules.addLevelRule("", gameRules);
levelGenerator->setRequiredGameRules(gameRules); levelGenerator->setRequiredGameRules(gameRules);
gameRules->loadStringTable(strings); gameRules->loadStringTable(strings);
} }
@ -593,20 +593,20 @@ LevelGenerationOptions* GameRuleManager::readHeader(DLCGameRulesHeader* grh) {
} }
void GameRuleManager::readAttributes(DataInputStream* dis, void GameRuleManager::readAttributes(DataInputStream* dis,
std::vector<std::wstring>* tagsAndAtts, std::vector<std::string>* tagsAndAtts,
GameRuleDefinition* rule) { GameRuleDefinition* rule) {
int numAttrs = dis->readInt(); int numAttrs = dis->readInt();
for (unsigned int att = 0; att < static_cast<unsigned int>(numAttrs); for (unsigned int att = 0; att < static_cast<unsigned int>(numAttrs);
++att) { ++att) {
int attID = dis->readInt(); int attID = dis->readInt();
std::wstring value = dis->readUTF(); std::string value = dis->readUTF();
if (rule != nullptr) rule->addAttribute(tagsAndAtts->at(attID), value); if (rule != nullptr) rule->addAttribute(tagsAndAtts->at(attID), value);
} }
} }
void GameRuleManager::readChildren( void GameRuleManager::readChildren(
DataInputStream* dis, std::vector<std::wstring>* tagsAndAtts, DataInputStream* dis, std::vector<std::string>* tagsAndAtts,
std::unordered_map<int, ConsoleGameRules::EGameRuleType>* tagIdMap, std::unordered_map<int, ConsoleGameRules::EGameRuleType>* tagIdMap,
GameRuleDefinition* rule) { GameRuleDefinition* rule) {
int numChildren = dis->readInt(); int numChildren = dis->readInt();
@ -643,23 +643,23 @@ void GameRuleManager::processSchematicsLighting(LevelChunk* levelChunk) {
void GameRuleManager::loadDefaultGameRules() { void GameRuleManager::loadDefaultGameRules() {
#if !defined(__linux__) #if !defined(__linux__)
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
File packedTutorialFile(L"Windows64Media\\Tutorial\\Tutorial.pck"); File packedTutorialFile("Windows64Media\\Tutorial\\Tutorial.pck");
if (!packedTutorialFile.exists()) if (!packedTutorialFile.exists())
packedTutorialFile = File(L"Windows64\\Tutorial\\Tutorial.pck"); packedTutorialFile = File("Windows64\\Tutorial\\Tutorial.pck");
#else #else
File packedTutorialFile(L"Tutorial\\Tutorial.pck"); File packedTutorialFile("Tutorial\\Tutorial.pck");
#endif #endif
if (loadGameRulesPack(&packedTutorialFile)) { if (loadGameRulesPack(&packedTutorialFile)) {
m_levelGenerators.getLevelGenerators()->at(0)->setWorldName( m_levelGenerators.getLevelGenerators()->at(0)->setWorldName(
app.GetString(IDS_PLAY_TUTORIAL)); app.GetString(IDS_PLAY_TUTORIAL));
// m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName(L"Tutorial"); // m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName("Tutorial");
m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName( m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName(
app.GetString(IDS_TUTORIALSAVENAME)); app.GetString(IDS_TUTORIALSAVENAME));
} }
#else #else
std::wstring fpTutorial = L"Tutorial.pck"; std::string fpTutorial = "Tutorial.pck";
if (app.getArchiveFileSize(fpTutorial) >= 0) { if (app.getArchiveFileSize(fpTutorial) >= 0) {
DLCPack* pack = new DLCPack(L"", 0xffffffff); DLCPack* pack = new DLCPack("", 0xffffffff);
uint32_t dwFilesProcessed = 0; uint32_t dwFilesProcessed = 0;
if (app.m_dlcManager.readDLCDataFile(dwFilesProcessed, fpTutorial, pack, if (app.m_dlcManager.readDLCDataFile(dwFilesProcessed, fpTutorial, pack,
true)) { true)) {
@ -677,7 +677,7 @@ void GameRuleManager::loadDefaultGameRules() {
bool GameRuleManager::loadGameRulesPack(File* path) { bool GameRuleManager::loadGameRulesPack(File* path) {
bool success = false; bool success = false;
if (path->exists()) { if (path->exists()) {
DLCPack* pack = new DLCPack(L"", 0xffffffff); DLCPack* pack = new DLCPack("", 0xffffffff);
unsigned int dwFilesProcessed = 0; unsigned int dwFilesProcessed = 0;
if (app.m_dlcManager.readDLCDataFile(dwFilesProcessed, path->getPath(), if (app.m_dlcManager.readDLCDataFile(dwFilesProcessed, path->getPath(),
pack)) { pack)) {
@ -707,11 +707,11 @@ void GameRuleManager::setLevelGenerationOptions(
m_currentLevelGenerationOptions->reset_start(); m_currentLevelGenerationOptions->reset_start();
} }
const wchar_t* GameRuleManager::GetGameRulesString(const std::wstring& key) { const char* GameRuleManager::GetGameRulesString(const std::string& key) {
if (m_currentGameRuleDefinitions != nullptr && !key.empty()) { if (m_currentGameRuleDefinitions != nullptr && !key.empty()) {
return m_currentGameRuleDefinitions->getString(key); return m_currentGameRuleDefinitions->getString(key);
} else { } else {
return L""; return "";
} }
} }

View file

@ -27,7 +27,7 @@ class DLCGameRulesHeader;
class File; class File;
class LevelRuleset; class LevelRuleset;
#define GAME_RULE_SAVENAME L"requiredGameRules.grf" #define GAME_RULE_SAVENAME "requiredGameRules.grf"
// 4J-JEV: // 4J-JEV:
#define LEVEL_GEN_ID int #define LEVEL_GEN_ID int
@ -35,8 +35,8 @@ class LevelRuleset;
class GameRuleManager { class GameRuleManager {
public: public:
static const wchar_t* wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; static const char* wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
static const wchar_t* wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count]; static const char* wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];
static const short version_number = 2; static const short version_number = 2;
@ -70,10 +70,10 @@ public:
private: private:
void readAttributes(DataInputStream* dis, void readAttributes(DataInputStream* dis,
std::vector<std::wstring>* tagsAndAtts, std::vector<std::string>* tagsAndAtts,
GameRuleDefinition* rule); GameRuleDefinition* rule);
void readChildren( void readChildren(
DataInputStream* dis, std::vector<std::wstring>* tagsAndAtts, DataInputStream* dis, std::vector<std::string>* tagsAndAtts,
std::unordered_map<int, ConsoleGameRules::EGameRuleType>* tagIdMap, std::unordered_map<int, ConsoleGameRules::EGameRuleType>* tagIdMap,
GameRuleDefinition* rule); GameRuleDefinition* rule);
@ -98,7 +98,7 @@ public:
LevelGenerationOptions* getLevelGenerationOptions() { LevelGenerationOptions* getLevelGenerationOptions() {
return m_currentLevelGenerationOptions; return m_currentLevelGenerationOptions;
} }
const wchar_t* GetGameRulesString(const std::wstring& key); const char* GetGameRulesString(const std::string& key);
// 4J-JEV: // 4J-JEV:
// Properly cleans-up and unloads the current set of gameRules. // Properly cleans-up and unloads the current set of gameRules.

View file

@ -65,8 +65,8 @@ void ApplySchematicRuleDefinition::writeAttributes(DataOutputStream* dos,
} }
void ApplySchematicRuleDefinition::addAttribute( void ApplySchematicRuleDefinition::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"filename") == 0) { if (attributeName.compare("filename") == 0) {
m_schematicName = attributeValue; m_schematicName = attributeValue;
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter // app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
// filename=%s\n",m_schematicName.c_str()); // filename=%s\n",m_schematicName.c_str());
@ -75,28 +75,28 @@ void ApplySchematicRuleDefinition::addAttribute(
if (m_schematicName if (m_schematicName
.substr(m_schematicName.length() - 4, .substr(m_schematicName.length() - 4,
m_schematicName.length()) m_schematicName.length())
.compare(L".sch") != 0) { .compare(".sch") != 0) {
m_schematicName.append(L".sch"); m_schematicName.append(".sch");
} }
m_schematic = m_levelGenOptions->getSchematicFile(m_schematicName); m_schematic = m_levelGenOptions->getSchematicFile(m_schematicName);
} }
} else if (attributeName.compare(L"x") == 0) { } else if (attributeName.compare("x") == 0) {
m_location.x = fromWString<int>(attributeValue); m_location.x = fromWString<int>(attributeValue);
if (((int)std::abs(m_location.x)) % 2 != 0) m_location.x -= 1; if (((int)std::abs(m_location.x)) % 2 != 0) m_location.x -= 1;
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter // app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
// x=%f\n",m_location->x); // x=%f\n",m_location->x);
} else if (attributeName.compare(L"y") == 0) { } else if (attributeName.compare("y") == 0) {
m_location.y = fromWString<int>(attributeValue); m_location.y = fromWString<int>(attributeValue);
if (((int)std::abs(m_location.y)) % 2 != 0) m_location.y -= 1; if (((int)std::abs(m_location.y)) % 2 != 0) m_location.y -= 1;
if (m_location.y < 0) m_location.y = 0; if (m_location.y < 0) m_location.y = 0;
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter // app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
// y=%f\n",m_location->y); // y=%f\n",m_location->y);
} else if (attributeName.compare(L"z") == 0) { } else if (attributeName.compare("z") == 0) {
m_location.z = fromWString<int>(attributeValue); m_location.z = fromWString<int>(attributeValue);
if (((int)std::abs(m_location.z)) % 2 != 0) m_location.z -= 1; if (((int)std::abs(m_location.z)) % 2 != 0) m_location.z -= 1;
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter // app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
// z=%f\n",m_location->z); // z=%f\n",m_location->z);
} else if (attributeName.compare(L"rot") == 0) { } else if (attributeName.compare("rot") == 0) {
int degrees = fromWString<int>(attributeValue); int degrees = fromWString<int>(attributeValue);
while (degrees < 0) degrees += 360; while (degrees < 0) degrees += 360;
@ -122,7 +122,7 @@ void ApplySchematicRuleDefinition::addAttribute(
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter // app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
// rot=%d\n",m_rotation); // rot=%d\n",m_rotation);
} else if (attributeName.compare(L"dim") == 0) { } else if (attributeName.compare("dim") == 0) {
m_dimension = fromWString<int>(attributeValue); m_dimension = fromWString<int>(attributeValue);
if (m_dimension > 1 || m_dimension < -1) m_dimension = 0; if (m_dimension > 1 || m_dimension < -1) m_dimension = 0;
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter // app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
@ -173,7 +173,7 @@ void ApplySchematicRuleDefinition::processSchematic(AABB* chunkBox,
std::min((double)Level::maxBuildHeight, m_locationBox->y1); std::min((double)Level::maxBuildHeight, m_locationBox->y1);
#ifdef _DEBUG #ifdef _DEBUG
app.DebugPrintf("Applying schematic %ls to chunk (%d,%d)\n", app.DebugPrintf("Applying schematic %s to chunk (%d,%d)\n",
m_schematicName.c_str(), chunk->x, chunk->z); m_schematicName.c_str(), chunk->x, chunk->z);
#endif #endif
m_totalBlocksChanged += m_schematic->applyBlocksAndData( m_totalBlocksChanged += m_schematic->applyBlocksAndData(
@ -211,7 +211,7 @@ void ApplySchematicRuleDefinition::processSchematicLighting(AABB* chunkBox,
std::min((double)Level::maxBuildHeight, m_locationBox->y1); std::min((double)Level::maxBuildHeight, m_locationBox->y1);
#ifdef _DEBUG #ifdef _DEBUG
app.DebugPrintf("Applying schematic %ls to chunk (%d,%d)\n", app.DebugPrintf("Applying schematic %s to chunk (%d,%d)\n",
m_schematicName.c_str(), chunk->x, chunk->z); m_schematicName.c_str(), chunk->x, chunk->z);
#endif #endif
m_totalBlocksChangedLighting += m_schematic->applyLighting( m_totalBlocksChangedLighting += m_schematic->applyLighting(

View file

@ -19,7 +19,7 @@ class GRFObject;
class ApplySchematicRuleDefinition : public GameRuleDefinition { class ApplySchematicRuleDefinition : public GameRuleDefinition {
private: private:
LevelGenerationOptions* m_levelGenOptions; LevelGenerationOptions* m_levelGenOptions;
std::wstring m_schematicName; std::string m_schematicName;
ConsoleSchematicFile* m_schematic; ConsoleSchematicFile* m_schematic;
Vec3 m_location; Vec3 m_location;
std::optional<AABB> m_locationBox; std::optional<AABB> m_locationBox;
@ -41,8 +41,8 @@ public:
} }
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
void processSchematic(AABB* chunkBox, LevelChunk* chunk); void processSchematic(AABB* chunkBox, LevelChunk* chunk);
void processSchematicLighting(AABB* chunkBox, LevelChunk* chunk); void processSchematicLighting(AABB* chunkBox, LevelChunk* chunk);
@ -52,7 +52,7 @@ public:
bool isComplete() { return m_completed; } bool isComplete() { return m_completed; }
std::wstring getSchematicName() { return m_schematicName; } std::string getSchematicName() { return m_schematicName; }
/** 4J-JEV: /** 4J-JEV:
* This GameRuleDefinition contains limited game state. * This GameRuleDefinition contains limited game state.

View file

@ -24,18 +24,18 @@ void BiomeOverride::writeAttributes(DataOutputStream* dos,
dos->writeUTF(toWString(m_topTile)); dos->writeUTF(toWString(m_topTile));
} }
void BiomeOverride::addAttribute(const std::wstring& attributeName, void BiomeOverride::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"tileId") == 0) { if (attributeName.compare("tileId") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_tile = value; m_tile = value;
app.DebugPrintf("BiomeOverride: Adding parameter tileId=%d\n", m_tile); app.DebugPrintf("BiomeOverride: Adding parameter tileId=%d\n", m_tile);
} else if (attributeName.compare(L"topTileId") == 0) { } else if (attributeName.compare("topTileId") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_topTile = value; m_topTile = value;
app.DebugPrintf("BiomeOverride: Adding parameter topTileId=%d\n", app.DebugPrintf("BiomeOverride: Adding parameter topTileId=%d\n",
m_topTile); m_topTile);
} else if (attributeName.compare(L"biomeId") == 0) { } else if (attributeName.compare("biomeId") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_biomeId = value; m_biomeId = value;
app.DebugPrintf("BiomeOverride: Adding parameter biomeId=%d\n", app.DebugPrintf("BiomeOverride: Adding parameter biomeId=%d\n",

View file

@ -21,8 +21,8 @@ public:
} }
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool isBiome(int id); bool isBiome(int id);
void getTileValues(std::uint8_t& tile, std::uint8_t& topTile); void getTileValues(std::uint8_t& tile, std::uint8_t& topTile);

View file

@ -51,9 +51,9 @@ GameRuleDefinition* ConsoleGenerateStructure::addChild(
m_actions.push_back((XboxStructureActionPlaceSpawner*)rule); m_actions.push_back((XboxStructureActionPlaceSpawner*)rule);
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"ConsoleGenerateStructure: Attempted to add invalid child rule - " "ConsoleGenerateStructure: Attempted to add invalid child rule - "
L"%d\n", "%d\n",
ruleType); ruleType);
#endif #endif
} }
@ -78,29 +78,29 @@ void ConsoleGenerateStructure::writeAttributes(DataOutputStream* dos,
} }
void ConsoleGenerateStructure::addAttribute( void ConsoleGenerateStructure::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"x") == 0) { if (attributeName.compare("x") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_x = value; m_x = value;
app.DebugPrintf("ConsoleGenerateStructure: Adding parameter x=%d\n", app.DebugPrintf("ConsoleGenerateStructure: Adding parameter x=%d\n",
m_x); m_x);
} else if (attributeName.compare(L"y") == 0) { } else if (attributeName.compare("y") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_y = value; m_y = value;
app.DebugPrintf("ConsoleGenerateStructure: Adding parameter y=%d\n", app.DebugPrintf("ConsoleGenerateStructure: Adding parameter y=%d\n",
m_y); m_y);
} else if (attributeName.compare(L"z") == 0) { } else if (attributeName.compare("z") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_z = value; m_z = value;
app.DebugPrintf("ConsoleGenerateStructure: Adding parameter z=%d\n", app.DebugPrintf("ConsoleGenerateStructure: Adding parameter z=%d\n",
m_z); m_z);
} else if (attributeName.compare(L"orientation") == 0) { } else if (attributeName.compare("orientation") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
orientation = value; orientation = value;
app.DebugPrintf( app.DebugPrintf(
"ConsoleGenerateStructure: Adding parameter orientation=%d\n", "ConsoleGenerateStructure: Adding parameter orientation=%d\n",
orientation); orientation);
} else if (attributeName.compare(L"dim") == 0) { } else if (attributeName.compare("dim") == 0) {
m_dimension = fromWString<int>(attributeValue); m_dimension = fromWString<int>(attributeValue);
if (m_dimension > 1 || m_dimension < -1) m_dimension = 0; if (m_dimension > 1 || m_dimension < -1) m_dimension = 0;
app.DebugPrintf( app.DebugPrintf(

View file

@ -33,8 +33,8 @@ public:
ConsoleGameRules::EGameRuleType ruleType); ConsoleGameRules::EGameRuleType ruleType);
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
// StructurePiece // StructurePiece
virtual BoundingBox* getBoundingBox(); virtual BoundingBox* getBoundingBox();

View file

@ -131,7 +131,7 @@ void ConsoleSchematicFile::load(DataInputStream* dis) {
// 4jcraft, fixed cast of templated List to get the tag list // 4jcraft, fixed cast of templated List to get the tag list
// and cast it to CompoundTag inside the loop // and cast it to CompoundTag inside the loop
CompoundTag* tag = NbtIo::read(dis); CompoundTag* tag = NbtIo::read(dis);
ListTag<Tag>* tileEntityTags = tag->getList(L"TileEntities"); ListTag<Tag>* tileEntityTags = tag->getList("TileEntities");
if (tileEntityTags != nullptr) { if (tileEntityTags != nullptr) {
for (int i = 0; i < tileEntityTags->size(); i++) { for (int i = 0; i < tileEntityTags->size(); i++) {
CompoundTag* teTag = (CompoundTag*)tileEntityTags->get(i); CompoundTag* teTag = (CompoundTag*)tileEntityTags->get(i);
@ -152,23 +152,23 @@ void ConsoleSchematicFile::load(DataInputStream* dis) {
// 4jcraft, fixed cast of templated List to get the tag list // 4jcraft, fixed cast of templated List to get the tag list
// and cast it to CompoundTag inside the loop // and cast it to CompoundTag inside the loop
ListTag<Tag>* entityTags = tag->getList(L"Entities"); ListTag<Tag>* entityTags = tag->getList("Entities");
if (entityTags != nullptr) { if (entityTags != nullptr) {
for (int i = 0; i < entityTags->size(); i++) { for (int i = 0; i < entityTags->size(); i++) {
CompoundTag* eTag = (CompoundTag*)entityTags->get(i); CompoundTag* eTag = (CompoundTag*)entityTags->get(i);
eINSTANCEOF type = EntityIO::getType(eTag->getString(L"id")); eINSTANCEOF type = EntityIO::getType(eTag->getString("id"));
// 4jcraft, same here // 4jcraft, same here
ListTag<Tag>* pos = eTag->getList(L"Pos"); ListTag<Tag>* pos = eTag->getList("Pos");
double x = ((DoubleTag*)pos->get(0))->data; double x = ((DoubleTag*)pos->get(0))->data;
double y = ((DoubleTag*)pos->get(1))->data; double y = ((DoubleTag*)pos->get(1))->data;
double z = ((DoubleTag*)pos->get(2))->data; double z = ((DoubleTag*)pos->get(2))->data;
if (type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME) { if (type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME) {
x = ((IntTag*)eTag->get(L"TileX"))->data; x = ((IntTag*)eTag->get("TileX"))->data;
y = ((IntTag*)eTag->get(L"TileY"))->data; y = ((IntTag*)eTag->get("TileY"))->data;
z = ((IntTag*)eTag->get(L"TileZ"))->data; z = ((IntTag*)eTag->get("TileZ"))->data;
} }
m_entities.push_back(std::pair<Vec3, CompoundTag*>( m_entities.push_back(std::pair<Vec3, CompoundTag*>(
Vec3(x, y, z), (CompoundTag*)eTag->copy())); Vec3(x, y, z), (CompoundTag*)eTag->copy()));
@ -182,7 +182,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
CompoundTag* tag = new CompoundTag(); CompoundTag* tag = new CompoundTag();
ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>(); ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>();
tag->put(L"TileEntities", tileEntityTags); tag->put("TileEntities", tileEntityTags);
for (auto it = m_tileEntities.begin(); it != m_tileEntities.end(); it++) { for (auto it = m_tileEntities.begin(); it != m_tileEntities.end(); it++) {
CompoundTag* cTag = new CompoundTag(); CompoundTag* cTag = new CompoundTag();
@ -191,7 +191,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
} }
ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>(); ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>();
tag->put(L"Entities", entityTags); tag->put("Entities", entityTags);
for (auto it = m_entities.begin(); it != m_entities.end(); it++) for (auto it = m_entities.begin(); it != m_entities.end(); it++)
entityTags->add((CompoundTag*)(*it).second->copy()); entityTags->add((CompoundTag*)(*it).second->copy());
@ -708,7 +708,7 @@ void ConsoleSchematicFile::generateSchematicFile(
CompoundTag tag; CompoundTag tag;
ListTag<CompoundTag>* tileEntitiesTag = ListTag<CompoundTag>* tileEntitiesTag =
new ListTag<CompoundTag>(L"tileEntities"); new ListTag<CompoundTag>("tileEntities");
int xc0 = xStart >> 4; int xc0 = xStart >> 4;
int zc0 = zStart >> 4; int zc0 = zStart >> 4;
@ -738,12 +738,12 @@ void ConsoleSchematicFile::generateSchematicFile(
delete tileEntities; delete tileEntities;
} }
} }
tag.put(L"TileEntities", tileEntitiesTag); tag.put("TileEntities", tileEntitiesTag);
AABB bb(xStart, yStart, zStart, xEnd, yEnd, zEnd); AABB bb(xStart, yStart, zStart, xEnd, yEnd, zEnd);
std::vector<std::shared_ptr<Entity> >* entities = std::vector<std::shared_ptr<Entity> >* entities =
level->getEntities(nullptr, &bb); level->getEntities(nullptr, &bb);
ListTag<CompoundTag>* entitiesTag = new ListTag<CompoundTag>(L"entities"); ListTag<CompoundTag>* entitiesTag = new ListTag<CompoundTag>("entities");
for (auto it = entities->begin(); it != entities->end(); ++it) { for (auto it = entities->begin(); it != entities->end(); ++it) {
std::shared_ptr<Entity> e = *it; std::shared_ptr<Entity> e = *it;
@ -771,16 +771,16 @@ void ConsoleSchematicFile::generateSchematicFile(
CompoundTag* eTag = new CompoundTag(); CompoundTag* eTag = new CompoundTag();
if (e->save(eTag)) { if (e->save(eTag)) {
ListTag<DoubleTag>* pos = ListTag<DoubleTag>* pos =
(ListTag<DoubleTag>*)eTag->getList(L"Pos"); (ListTag<DoubleTag>*)eTag->getList("Pos");
pos->get(0)->data -= xStart; pos->get(0)->data -= xStart;
pos->get(1)->data -= yStart; pos->get(1)->data -= yStart;
pos->get(2)->data -= zStart; pos->get(2)->data -= zStart;
if (e->instanceof(eTYPE_HANGING_ENTITY)) { if (e->instanceof(eTYPE_HANGING_ENTITY)) {
((IntTag*)eTag->get(L"TileX"))->data -= xStart; ((IntTag*)eTag->get("TileX"))->data -= xStart;
((IntTag*)eTag->get(L"TileY"))->data -= yStart; ((IntTag*)eTag->get("TileY"))->data -= yStart;
((IntTag*)eTag->get(L"TileZ"))->data -= zStart; ((IntTag*)eTag->get("TileZ"))->data -= zStart;
} }
entitiesTag->add(eTag); entitiesTag->add(eTag);
@ -788,7 +788,7 @@ void ConsoleSchematicFile::generateSchematicFile(
} }
} }
tag.put(L"Entities", entitiesTag); tag.put("Entities", entitiesTag);
if (dos != nullptr) NbtIo::write(&tag, dos); if (dos != nullptr) NbtIo::write(&tag, dos);
} }

View file

@ -44,7 +44,7 @@ public:
bool shouldDelete() { return m_refCount <= 0; } bool shouldDelete() { return m_refCount <= 0; }
typedef struct _XboxSchematicInitParam { typedef struct _XboxSchematicInitParam {
wchar_t name[64]; char name[64];
int startX; int startX;
int startY; int startY;
int startZ; int startZ;
@ -56,7 +56,7 @@ public:
Compression::ECompressionTypes compressionType; Compression::ECompressionTypes compressionType;
_XboxSchematicInitParam() { _XboxSchematicInitParam() {
memset(name, 0, 64 * (sizeof(wchar_t))); memset(name, 0, 64 * (sizeof(char)));
startX = startY = startZ = endX = endY = endZ = 0; startX = startY = startZ = endX = endY = endZ = 0;
bSaveMobs = false; bSaveMobs = false;
compressionType = Compression::eCompressionType_None; compressionType = Compression::eCompressionType_None;

View file

@ -37,12 +37,12 @@
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
JustGrSource::JustGrSource() { JustGrSource::JustGrSource() {
m_displayName = L"Default_DisplayName"; m_displayName = "Default_DisplayName";
m_worldName = L"Default_WorldName"; m_worldName = "Default_WorldName";
m_defaultSaveName = L"Default_DefaultSaveName"; m_defaultSaveName = "Default_DefaultSaveName";
m_bRequiresTexturePack = false; m_bRequiresTexturePack = false;
m_requiredTexturePackId = 0; m_requiredTexturePackId = 0;
m_grfPath = L"__NO_GRF_PATH__"; m_grfPath = "__NO_GRF_PATH__";
m_bRequiresBaseSave = false; m_bRequiresBaseSave = false;
} }
@ -50,12 +50,12 @@ bool JustGrSource::requiresTexturePack() { return m_bRequiresTexturePack; }
std::uint32_t JustGrSource::getRequiredTexturePackId() { std::uint32_t JustGrSource::getRequiredTexturePackId() {
return m_requiredTexturePackId; return m_requiredTexturePackId;
} }
std::wstring JustGrSource::getDefaultSaveName() { return m_defaultSaveName; } std::string JustGrSource::getDefaultSaveName() { return m_defaultSaveName; }
const wchar_t* JustGrSource::getWorldName() { return m_worldName.c_str(); } const char* JustGrSource::getWorldName() { return m_worldName.c_str(); }
const wchar_t* JustGrSource::getDisplayName() { return m_displayName.c_str(); } const char* JustGrSource::getDisplayName() { return m_displayName.c_str(); }
std::wstring JustGrSource::getGrfPath() { return m_grfPath; } std::string JustGrSource::getGrfPath() { return m_grfPath; }
bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; }; bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; };
std::wstring JustGrSource::getBaseSavePath() { return m_baseSavePath; }; std::string JustGrSource::getBaseSavePath() { return m_baseSavePath; };
void JustGrSource::setRequiresTexturePack(bool x) { void JustGrSource::setRequiresTexturePack(bool x) {
m_bRequiresTexturePack = x; m_bRequiresTexturePack = x;
@ -63,13 +63,13 @@ void JustGrSource::setRequiresTexturePack(bool x) {
void JustGrSource::setRequiredTexturePackId(std::uint32_t x) { void JustGrSource::setRequiredTexturePackId(std::uint32_t x) {
m_requiredTexturePackId = x; m_requiredTexturePackId = x;
} }
void JustGrSource::setDefaultSaveName(const std::wstring& x) { void JustGrSource::setDefaultSaveName(const std::string& x) {
m_defaultSaveName = x; m_defaultSaveName = x;
} }
void JustGrSource::setWorldName(const std::wstring& x) { m_worldName = x; } void JustGrSource::setWorldName(const std::string& x) { m_worldName = x; }
void JustGrSource::setDisplayName(const std::wstring& x) { m_displayName = x; } void JustGrSource::setDisplayName(const std::string& x) { m_displayName = x; }
void JustGrSource::setGrfPath(const std::wstring& x) { m_grfPath = x; } void JustGrSource::setGrfPath(const std::string& x) { m_grfPath = x; }
void JustGrSource::setBaseSavePath(const std::wstring& x) { void JustGrSource::setBaseSavePath(const std::string& x) {
m_baseSavePath = x; m_baseSavePath = x;
m_bRequiresBaseSave = true; m_bRequiresBaseSave = true;
} }
@ -179,88 +179,88 @@ GameRuleDefinition* LevelGenerationOptions::addChild(
m_features.push_back((StartFeature*)rule); m_features.push_back((StartFeature*)rule);
} else { } else {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
wprintf( printf(
L"LevelGenerationOptions: Attempted to add invalid child rule - " "LevelGenerationOptions: Attempted to add invalid child rule - "
L"%d\n", "%d\n",
ruleType); ruleType);
#endif #endif
} }
return rule; return rule;
} }
void LevelGenerationOptions::addAttribute(const std::wstring& attributeName, void LevelGenerationOptions::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"seed") == 0) { if (attributeName.compare("seed") == 0) {
m_seed = fromWString<int64_t>(attributeValue); m_seed = fromWString<int64_t>(attributeValue);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter m_seed=%I64d\n", m_seed); "LevelGenerationOptions: Adding parameter m_seed=%I64d\n", m_seed);
} else if (attributeName.compare(L"spawnX") == 0) { } else if (attributeName.compare("spawnX") == 0) {
if (m_spawnPos == nullptr) m_spawnPos = new Pos(); if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_spawnPos->x = value; m_spawnPos->x = value;
app.DebugPrintf("LevelGenerationOptions: Adding parameter spawnX=%d\n", app.DebugPrintf("LevelGenerationOptions: Adding parameter spawnX=%d\n",
value); value);
} else if (attributeName.compare(L"spawnY") == 0) { } else if (attributeName.compare("spawnY") == 0) {
if (m_spawnPos == nullptr) m_spawnPos = new Pos(); if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_spawnPos->y = value; m_spawnPos->y = value;
app.DebugPrintf("LevelGenerationOptions: Adding parameter spawnY=%d\n", app.DebugPrintf("LevelGenerationOptions: Adding parameter spawnY=%d\n",
value); value);
} else if (attributeName.compare(L"spawnZ") == 0) { } else if (attributeName.compare("spawnZ") == 0) {
if (m_spawnPos == nullptr) m_spawnPos = new Pos(); if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_spawnPos->z = value; m_spawnPos->z = value;
app.DebugPrintf("LevelGenerationOptions: Adding parameter spawnZ=%d\n", app.DebugPrintf("LevelGenerationOptions: Adding parameter spawnZ=%d\n",
value); value);
} else if (attributeName.compare(L"flatworld") == 0) { } else if (attributeName.compare("flatworld") == 0) {
if (attributeValue.compare(L"true") == 0) m_useFlatWorld = true; if (attributeValue.compare("true") == 0) m_useFlatWorld = true;
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter flatworld=%s\n", "LevelGenerationOptions: Adding parameter flatworld=%s\n",
m_useFlatWorld ? "true" : "false"); m_useFlatWorld ? "true" : "false");
} else if (attributeName.compare(L"saveName") == 0) { } else if (attributeName.compare("saveName") == 0) {
std::wstring string(getString(attributeValue)); std::string string(getString(attributeValue));
if (!string.empty()) if (!string.empty())
setDefaultSaveName(string); setDefaultSaveName(string);
else else
setDefaultSaveName(attributeValue); setDefaultSaveName(attributeValue);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter saveName=%ls\n", "LevelGenerationOptions: Adding parameter saveName=%s\n",
getDefaultSaveName().c_str()); getDefaultSaveName().c_str());
} else if (attributeName.compare(L"worldName") == 0) { } else if (attributeName.compare("worldName") == 0) {
std::wstring string(getString(attributeValue)); std::string string(getString(attributeValue));
if (!string.empty()) if (!string.empty())
setWorldName(string); setWorldName(string);
else else
setWorldName(attributeValue); setWorldName(attributeValue);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter worldName=%ls\n", "LevelGenerationOptions: Adding parameter worldName=%s\n",
getWorldName()); getWorldName());
} else if (attributeName.compare(L"displayName") == 0) { } else if (attributeName.compare("displayName") == 0) {
std::wstring string(getString(attributeValue)); std::string string(getString(attributeValue));
if (!string.empty()) if (!string.empty())
setDisplayName(string); setDisplayName(string);
else else
setDisplayName(attributeValue); setDisplayName(attributeValue);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter displayName=%ls\n", "LevelGenerationOptions: Adding parameter displayName=%s\n",
getDisplayName()); getDisplayName());
} else if (attributeName.compare(L"texturePackId") == 0) { } else if (attributeName.compare("texturePackId") == 0) {
setRequiredTexturePackId(fromWString<unsigned int>(attributeValue)); setRequiredTexturePackId(fromWString<unsigned int>(attributeValue));
setRequiresTexturePack(true); setRequiresTexturePack(true);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter texturePackId=%0x\n", "LevelGenerationOptions: Adding parameter texturePackId=%0x\n",
getRequiredTexturePackId()); getRequiredTexturePackId());
} else if (attributeName.compare(L"isTutorial") == 0) { } else if (attributeName.compare("isTutorial") == 0) {
if (attributeValue.compare(L"true") == 0) setSrc(eSrc_tutorial); if (attributeValue.compare("true") == 0) setSrc(eSrc_tutorial);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter isTutorial=%s\n", "LevelGenerationOptions: Adding parameter isTutorial=%s\n",
isTutorial() ? "true" : "false"); isTutorial() ? "true" : "false");
} else if (attributeName.compare(L"baseSaveName") == 0) { } else if (attributeName.compare("baseSaveName") == 0) {
setBaseSavePath(attributeValue); setBaseSavePath(attributeValue);
app.DebugPrintf( app.DebugPrintf(
"LevelGenerationOptions: Adding parameter baseSaveName=%ls\n", "LevelGenerationOptions: Adding parameter baseSaveName=%s\n",
getBaseSavePath().c_str()); getBaseSavePath().c_str());
} else if (attributeName.compare(L"hasBeenInCreative") == 0) { } else if (attributeName.compare("hasBeenInCreative") == 0) {
bool value = fromWString<bool>(attributeValue); bool value = fromWString<bool>(attributeValue);
m_bHasBeenInCreative = value; m_bHasBeenInCreative = value;
app.DebugPrintf( app.DebugPrintf(
@ -435,13 +435,13 @@ void LevelGenerationOptions::clearSchematics() {
void LevelGenerationOptions::clearChunkRuleCache() { m_chunkRuleCache.clear(); } void LevelGenerationOptions::clearChunkRuleCache() { m_chunkRuleCache.clear(); }
ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile( ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile(
const std::wstring& filename, std::uint8_t* pbData, const std::string& filename, std::uint8_t* pbData,
unsigned int dataLength) { unsigned int dataLength) {
// If we have already loaded this, just return // If we have already loaded this, just return
auto it = m_schematics.find(filename); auto it = m_schematics.find(filename);
if (it != m_schematics.end()) { if (it != m_schematics.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
wprintf(L"We have already loaded schematic file %ls\n", printf("We have already loaded schematic file %s\n",
filename.c_str()); filename.c_str());
#endif #endif
it->second->incrementRefCount(); it->second->incrementRefCount();
@ -461,7 +461,7 @@ ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile(
} }
ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile( ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile(
const std::wstring& filename) { const std::string& filename) {
ConsoleSchematicFile* schematic = nullptr; ConsoleSchematicFile* schematic = nullptr;
// If we have already loaded this, just return // If we have already loaded this, just return
auto it = m_schematics.find(filename); auto it = m_schematics.find(filename);
@ -472,7 +472,7 @@ ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile(
} }
void LevelGenerationOptions::releaseSchematicFile( void LevelGenerationOptions::releaseSchematicFile(
const std::wstring& filename) { const std::string& filename) {
// 4J Stu - We don't want to delete them when done, but probably want to // 4J Stu - We don't want to delete them when done, but probably want to
// keep a set of active schematics for the current world // keep a set of active schematics for the current world
// auto it = m_schematics.find(filename); // auto it = m_schematics.find(filename);
@ -492,9 +492,9 @@ void LevelGenerationOptions::loadStringTable(StringTable* table) {
m_stringTable = table; m_stringTable = table;
} }
const wchar_t* LevelGenerationOptions::getString(const std::wstring& key) { const char* LevelGenerationOptions::getString(const std::string& key) {
if (m_stringTable == nullptr) { if (m_stringTable == nullptr) {
return L""; return "";
} else { } else {
return m_stringTable->getString(key); return m_stringTable->getString(key);
} }
@ -527,19 +527,19 @@ bool LevelGenerationOptions::isFeatureChunk(
return isFeature; return isFeature;
} }
std::unordered_map<std::wstring, ConsoleSchematicFile*>* std::unordered_map<std::string, ConsoleSchematicFile*>*
LevelGenerationOptions::getUnfinishedSchematicFiles() { LevelGenerationOptions::getUnfinishedSchematicFiles() {
// Clean schematic rules. // Clean schematic rules.
std::unordered_set<std::wstring> usedFiles = std::unordered_set<std::string> usedFiles =
std::unordered_set<std::wstring>(); std::unordered_set<std::string>();
for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); it++) for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); it++)
if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName()); if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName());
// Clean schematic files. // Clean schematic files.
std::unordered_map<std::wstring, ConsoleSchematicFile*>* out = std::unordered_map<std::string, ConsoleSchematicFile*>* out =
new std::unordered_map<std::wstring, ConsoleSchematicFile*>(); new std::unordered_map<std::string, ConsoleSchematicFile*>();
for (auto it = usedFiles.begin(); it != usedFiles.end(); it++) for (auto it = usedFiles.begin(); it != usedFiles.end(); it++)
out->insert(std::pair<std::wstring, ConsoleSchematicFile*>( out->insert(std::pair<std::string, ConsoleSchematicFile*>(
*it, getSchematicFile(*it))); *it, getSchematicFile(*it)));
return out; return out;
@ -594,7 +594,7 @@ int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
if (!dlcFile->getGrfPath().empty()) { if (!dlcFile->getGrfPath().empty()) {
File grf(app.getFilePath(lgo->m_parentDLCPack->GetPackID(), File grf(app.getFilePath(lgo->m_parentDLCPack->GetPackID(),
dlcFile->getGrfPath(), true, dlcFile->getGrfPath(), true,
L"WPACK:")); "WPACK:"));
if (grf.exists()) { if (grf.exists()) {
uint32_t dwFileSize = grf.length(); uint32_t dwFileSize = grf.length();
if (dwFileSize > 0) { if (dwFileSize > 0) {
@ -620,7 +620,7 @@ int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
} }
if (lgo->requiresBaseSave() && !lgo->getBaseSavePath().empty()) { if (lgo->requiresBaseSave() && !lgo->getBaseSavePath().empty()) {
File save(app.getFilePath(lgo->m_parentDLCPack->GetPackID(), File save(app.getFilePath(lgo->m_parentDLCPack->GetPackID(),
lgo->getBaseSavePath(), true, L"WPACK:")); lgo->getBaseSavePath(), true, "WPACK:"));
if (save.exists()) { if (save.exists()) {
std::size_t dwFileSize = std::size_t dwFileSize =
PlatformFilesystem.fileSize(save.getPath()); PlatformFilesystem.fileSize(save.getPath());
@ -679,7 +679,7 @@ bool LevelGenerationOptions::requiresTexturePack() {
std::uint32_t LevelGenerationOptions::getRequiredTexturePackId() { std::uint32_t LevelGenerationOptions::getRequiredTexturePackId() {
return info()->getRequiredTexturePackId(); return info()->getRequiredTexturePackId();
} }
std::wstring LevelGenerationOptions::getDefaultSaveName() { std::string LevelGenerationOptions::getDefaultSaveName() {
switch (getSrc()) { switch (getSrc()) {
case eSrc_fromSave: case eSrc_fromSave:
return getString(info()->getDefaultSaveName()); return getString(info()->getDefaultSaveName());
@ -690,9 +690,9 @@ std::wstring LevelGenerationOptions::getDefaultSaveName() {
default: default:
break; break;
} }
return L""; return "";
} }
const wchar_t* LevelGenerationOptions::getWorldName() { const char* LevelGenerationOptions::getWorldName() {
switch (getSrc()) { switch (getSrc()) {
case eSrc_fromSave: case eSrc_fromSave:
return getString(info()->getWorldName()); return getString(info()->getWorldName());
@ -703,28 +703,28 @@ const wchar_t* LevelGenerationOptions::getWorldName() {
default: default:
break; break;
} }
return L""; return "";
} }
const wchar_t* LevelGenerationOptions::getDisplayName() { const char* LevelGenerationOptions::getDisplayName() {
switch (getSrc()) { switch (getSrc()) {
case eSrc_fromSave: case eSrc_fromSave:
return getString(info()->getDisplayName()); return getString(info()->getDisplayName());
case eSrc_fromDLC: case eSrc_fromDLC:
return getString(info()->getDisplayName()); return getString(info()->getDisplayName());
case eSrc_tutorial: case eSrc_tutorial:
return L""; return "";
default: default:
break; break;
} }
return L""; return "";
} }
std::wstring LevelGenerationOptions::getGrfPath() { std::string LevelGenerationOptions::getGrfPath() {
return info()->getGrfPath(); return info()->getGrfPath();
} }
bool LevelGenerationOptions::requiresBaseSave() { bool LevelGenerationOptions::requiresBaseSave() {
return info()->requiresBaseSave(); return info()->requiresBaseSave();
} }
std::wstring LevelGenerationOptions::getBaseSavePath() { std::string LevelGenerationOptions::getBaseSavePath() {
return info()->getBaseSavePath(); return info()->getBaseSavePath();
} }
@ -736,19 +736,19 @@ void LevelGenerationOptions::setRequiresTexturePack(bool x) {
void LevelGenerationOptions::setRequiredTexturePackId(std::uint32_t x) { void LevelGenerationOptions::setRequiredTexturePackId(std::uint32_t x) {
info()->setRequiredTexturePackId(x); info()->setRequiredTexturePackId(x);
} }
void LevelGenerationOptions::setDefaultSaveName(const std::wstring& x) { void LevelGenerationOptions::setDefaultSaveName(const std::string& x) {
info()->setDefaultSaveName(x); info()->setDefaultSaveName(x);
} }
void LevelGenerationOptions::setWorldName(const std::wstring& x) { void LevelGenerationOptions::setWorldName(const std::string& x) {
info()->setWorldName(x); info()->setWorldName(x);
} }
void LevelGenerationOptions::setDisplayName(const std::wstring& x) { void LevelGenerationOptions::setDisplayName(const std::string& x) {
info()->setDisplayName(x); info()->setDisplayName(x);
} }
void LevelGenerationOptions::setGrfPath(const std::wstring& x) { void LevelGenerationOptions::setGrfPath(const std::string& x) {
info()->setGrfPath(x); info()->setGrfPath(x);
} }
void LevelGenerationOptions::setBaseSavePath(const std::wstring& x) { void LevelGenerationOptions::setBaseSavePath(const std::string& x) {
info()->setBaseSavePath(x); info()->setBaseSavePath(x);
} }

View file

@ -35,20 +35,20 @@ public:
virtual ~GrSource() {} virtual ~GrSource() {}
virtual bool requiresTexturePack() = 0; virtual bool requiresTexturePack() = 0;
virtual std::uint32_t getRequiredTexturePackId() = 0; virtual std::uint32_t getRequiredTexturePackId() = 0;
virtual std::wstring getDefaultSaveName() = 0; virtual std::string getDefaultSaveName() = 0;
virtual const wchar_t* getWorldName() = 0; virtual const char* getWorldName() = 0;
virtual const wchar_t* getDisplayName() = 0; virtual const char* getDisplayName() = 0;
virtual std::wstring getGrfPath() = 0; virtual std::string getGrfPath() = 0;
virtual bool requiresBaseSave() = 0; virtual bool requiresBaseSave() = 0;
virtual std::wstring getBaseSavePath() = 0; virtual std::string getBaseSavePath() = 0;
virtual void setRequiresTexturePack(bool) = 0; virtual void setRequiresTexturePack(bool) = 0;
virtual void setRequiredTexturePackId(std::uint32_t) = 0; virtual void setRequiredTexturePackId(std::uint32_t) = 0;
virtual void setDefaultSaveName(const std::wstring&) = 0; virtual void setDefaultSaveName(const std::string&) = 0;
virtual void setWorldName(const std::wstring&) = 0; virtual void setWorldName(const std::string&) = 0;
virtual void setDisplayName(const std::wstring&) = 0; virtual void setDisplayName(const std::string&) = 0;
virtual void setGrfPath(const std::wstring&) = 0; virtual void setGrfPath(const std::string&) = 0;
virtual void setBaseSavePath(const std::wstring&) = 0; virtual void setBaseSavePath(const std::string&) = 0;
virtual bool ready() = 0; virtual bool ready() = 0;
@ -57,32 +57,32 @@ public:
class JustGrSource : public GrSource { class JustGrSource : public GrSource {
protected: protected:
std::wstring m_worldName; std::string m_worldName;
std::wstring m_displayName; std::string m_displayName;
std::wstring m_defaultSaveName; std::string m_defaultSaveName;
bool m_bRequiresTexturePack; bool m_bRequiresTexturePack;
std::uint32_t m_requiredTexturePackId; std::uint32_t m_requiredTexturePackId;
std::wstring m_grfPath; std::string m_grfPath;
std::wstring m_baseSavePath; std::string m_baseSavePath;
bool m_bRequiresBaseSave; bool m_bRequiresBaseSave;
public: public:
virtual bool requiresTexturePack(); virtual bool requiresTexturePack();
virtual std::uint32_t getRequiredTexturePackId(); virtual std::uint32_t getRequiredTexturePackId();
virtual std::wstring getDefaultSaveName(); virtual std::string getDefaultSaveName();
virtual const wchar_t* getWorldName(); virtual const char* getWorldName();
virtual const wchar_t* getDisplayName(); virtual const char* getDisplayName();
virtual std::wstring getGrfPath(); virtual std::string getGrfPath();
virtual bool requiresBaseSave(); virtual bool requiresBaseSave();
virtual std::wstring getBaseSavePath(); virtual std::string getBaseSavePath();
virtual void setRequiresTexturePack(bool x); virtual void setRequiresTexturePack(bool x);
virtual void setRequiredTexturePackId(std::uint32_t x); virtual void setRequiredTexturePackId(std::uint32_t x);
virtual void setDefaultSaveName(const std::wstring& x); virtual void setDefaultSaveName(const std::string& x);
virtual void setWorldName(const std::wstring& x); virtual void setWorldName(const std::string& x);
virtual void setDisplayName(const std::wstring& x); virtual void setDisplayName(const std::string& x);
virtual void setGrfPath(const std::wstring& x); virtual void setGrfPath(const std::string& x);
virtual void setBaseSavePath(const std::wstring& x); virtual void setBaseSavePath(const std::string& x);
virtual bool ready(); virtual bool ready();
@ -151,22 +151,22 @@ public:
bool requiresTexturePack(); bool requiresTexturePack();
std::uint32_t getRequiredTexturePackId(); std::uint32_t getRequiredTexturePackId();
std::wstring getDefaultSaveName(); std::string getDefaultSaveName();
const wchar_t* getWorldName(); const char* getWorldName();
const wchar_t* getDisplayName(); const char* getDisplayName();
std::wstring getGrfPath(); std::string getGrfPath();
bool requiresBaseSave(); bool requiresBaseSave();
std::wstring getBaseSavePath(); std::string getBaseSavePath();
void setGrSource(GrSource* grs); void setGrSource(GrSource* grs);
void setRequiresTexturePack(bool x); void setRequiresTexturePack(bool x);
void setRequiredTexturePackId(std::uint32_t x); void setRequiredTexturePackId(std::uint32_t x);
void setDefaultSaveName(const std::wstring& x); void setDefaultSaveName(const std::string& x);
void setWorldName(const std::wstring& x); void setWorldName(const std::string& x);
void setDisplayName(const std::wstring& x); void setDisplayName(const std::string& x);
void setGrfPath(const std::wstring& x); void setGrfPath(const std::string& x);
void setBaseSavePath(const std::wstring& x); void setBaseSavePath(const std::string& x);
bool ready(); bool ready();
@ -188,7 +188,7 @@ private:
std::vector<ConsoleGenerateStructure*> m_structureRules; std::vector<ConsoleGenerateStructure*> m_structureRules;
bool m_bHaveMinY; bool m_bHaveMinY;
int m_minY; int m_minY;
std::unordered_map<std::wstring, ConsoleSchematicFile*> m_schematics; std::unordered_map<std::string, ConsoleSchematicFile*> m_schematics;
std::unordered_map<ChunkRuleCacheKey, ChunkRuleCacheEntry, ChunkRuleCacheKeyHash> std::unordered_map<ChunkRuleCacheKey, ChunkRuleCacheEntry, ChunkRuleCacheKeyHash>
m_chunkRuleCache; m_chunkRuleCache;
std::vector<BiomeOverride*> m_biomeOverrides; std::vector<BiomeOverride*> m_biomeOverrides;
@ -213,8 +213,8 @@ public:
virtual void getChildren(std::vector<GameRuleDefinition*>* children); virtual void getChildren(std::vector<GameRuleDefinition*>* children);
virtual GameRuleDefinition* addChild( virtual GameRuleDefinition* addChild(
ConsoleGameRules::EGameRuleType ruleType); ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
int64_t getLevelSeed(); int64_t getLevelSeed();
int getLevelHasBeenInCreative(); int getLevelHasBeenInCreative();
@ -231,13 +231,13 @@ private:
void clearSchematics(); void clearSchematics();
public: public:
ConsoleSchematicFile* loadSchematicFile(const std::wstring& filename, ConsoleSchematicFile* loadSchematicFile(const std::string& filename,
std::uint8_t* pbData, std::uint8_t* pbData,
unsigned int dataLength); unsigned int dataLength);
public: public:
ConsoleSchematicFile* getSchematicFile(const std::wstring& filename); ConsoleSchematicFile* getSchematicFile(const std::string& filename);
void releaseSchematicFile(const std::wstring& filename); void releaseSchematicFile(const std::string& filename);
bool requiresGameRules(); bool requiresGameRules();
void setRequiredGameRules(LevelRuleset* rules); void setRequiredGameRules(LevelRuleset* rules);
@ -250,9 +250,9 @@ public:
int* orientation = nullptr); int* orientation = nullptr);
void loadStringTable(StringTable* table); void loadStringTable(StringTable* table);
const wchar_t* getString(const std::wstring& key); const char* getString(const std::string& key);
std::unordered_map<std::wstring, ConsoleSchematicFile*>* std::unordered_map<std::string, ConsoleSchematicFile*>*
getUnfinishedSchematicFiles(); getUnfinishedSchematicFiles();
void loadBaseSaveData(); void loadBaseSaveData();

View file

@ -6,7 +6,7 @@
LevelGenerators::LevelGenerators() {} LevelGenerators::LevelGenerators() {}
void LevelGenerators::addLevelGenerator(const std::wstring& displayName, void LevelGenerators::addLevelGenerator(const std::string& displayName,
LevelGenerationOptions* generator) { LevelGenerationOptions* generator) {
if (!displayName.empty()) generator->setDisplayName(displayName); if (!displayName.empty()) generator->setDisplayName(displayName);
m_levelGenerators.push_back(generator); m_levelGenerators.push_back(generator);

View file

@ -14,7 +14,7 @@ private:
public: public:
LevelGenerators(); LevelGenerators();
void addLevelGenerator(const std::wstring& displayName, void addLevelGenerator(const std::string& displayName,
LevelGenerationOptions* generator); LevelGenerationOptions* generator);
void removeLevelGenerator(LevelGenerationOptions* generator); void removeLevelGenerator(LevelGenerationOptions* generator);

View file

@ -27,22 +27,22 @@ void StartFeature::writeAttributes(DataOutputStream* dos,
dos->writeUTF(toWString(m_orientation)); dos->writeUTF(toWString(m_orientation));
} }
void StartFeature::addAttribute(const std::wstring& attributeName, void StartFeature::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"chunkX") == 0) { if (attributeName.compare("chunkX") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_chunkX = value; m_chunkX = value;
app.DebugPrintf("StartFeature: Adding parameter chunkX=%d\n", m_chunkX); app.DebugPrintf("StartFeature: Adding parameter chunkX=%d\n", m_chunkX);
} else if (attributeName.compare(L"chunkZ") == 0) { } else if (attributeName.compare("chunkZ") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_chunkZ = value; m_chunkZ = value;
app.DebugPrintf("StartFeature: Adding parameter chunkZ=%d\n", m_chunkZ); app.DebugPrintf("StartFeature: Adding parameter chunkZ=%d\n", m_chunkZ);
} else if (attributeName.compare(L"orientation") == 0) { } else if (attributeName.compare("orientation") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_orientation = value; m_orientation = value;
app.DebugPrintf("StartFeature: Adding parameter orientation=%d\n", app.DebugPrintf("StartFeature: Adding parameter orientation=%d\n",
m_orientation); m_orientation);
} else if (attributeName.compare(L"feature") == 0) { } else if (attributeName.compare("feature") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_feature = (StructureFeature::EFeatureTypes)value; m_feature = (StructureFeature::EFeatureTypes)value;
app.DebugPrintf("StartFeature: Adding parameter feature=%d\n", app.DebugPrintf("StartFeature: Adding parameter feature=%d\n",

View file

@ -20,8 +20,8 @@ public:
} }
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool isFeatureChunk(int chunkX, int chunkZ, bool isFeatureChunk(int chunkX, int chunkZ,
StructureFeature::EFeatureTypes feature, StructureFeature::EFeatureTypes feature,

View file

@ -40,51 +40,51 @@ void XboxStructureActionGenerateBox::writeAttributes(DataOutputStream* dos,
} }
void XboxStructureActionGenerateBox::addAttribute( void XboxStructureActionGenerateBox::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"x0") == 0) { if (attributeName.compare("x0") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_x0 = value; m_x0 = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter x0=%d\n", m_x0); "XboxStructureActionGenerateBox: Adding parameter x0=%d\n", m_x0);
} else if (attributeName.compare(L"y0") == 0) { } else if (attributeName.compare("y0") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_y0 = value; m_y0 = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter y0=%d\n", m_y0); "XboxStructureActionGenerateBox: Adding parameter y0=%d\n", m_y0);
} else if (attributeName.compare(L"z0") == 0) { } else if (attributeName.compare("z0") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_z0 = value; m_z0 = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter z0=%d\n", m_z0); "XboxStructureActionGenerateBox: Adding parameter z0=%d\n", m_z0);
} else if (attributeName.compare(L"x1") == 0) { } else if (attributeName.compare("x1") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_x1 = value; m_x1 = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter x1=%d\n", m_x1); "XboxStructureActionGenerateBox: Adding parameter x1=%d\n", m_x1);
} else if (attributeName.compare(L"y1") == 0) { } else if (attributeName.compare("y1") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_y1 = value; m_y1 = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter y1=%d\n", m_y1); "XboxStructureActionGenerateBox: Adding parameter y1=%d\n", m_y1);
} else if (attributeName.compare(L"z1") == 0) { } else if (attributeName.compare("z1") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_z1 = value; m_z1 = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter z1=%d\n", m_z1); "XboxStructureActionGenerateBox: Adding parameter z1=%d\n", m_z1);
} else if (attributeName.compare(L"edgeTile") == 0) { } else if (attributeName.compare("edgeTile") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_edgeTile = value; m_edgeTile = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter edgeTile=%d\n", "XboxStructureActionGenerateBox: Adding parameter edgeTile=%d\n",
m_edgeTile); m_edgeTile);
} else if (attributeName.compare(L"fillTile") == 0) { } else if (attributeName.compare("fillTile") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_fillTile = value; m_fillTile = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter fillTile=%d\n", "XboxStructureActionGenerateBox: Adding parameter fillTile=%d\n",
m_fillTile); m_fillTile);
} else if (attributeName.compare(L"skipAir") == 0) { } else if (attributeName.compare("skipAir") == 0) {
if (attributeValue.compare(L"true") == 0) m_skipAir = true; if (attributeValue.compare("true") == 0) m_skipAir = true;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionGenerateBox: Adding parameter skipAir=%s\n", "XboxStructureActionGenerateBox: Adding parameter skipAir=%s\n",
m_skipAir ? "true" : "false"); m_skipAir ? "true" : "false");

View file

@ -25,8 +25,8 @@ public:
virtual int getEndZ() { return m_z1; } virtual int getEndZ() { return m_z1; }
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool generateBoxInLevel(StructurePiece* structure, Level* level, bool generateBoxInLevel(StructurePiece* structure, Level* level,
BoundingBox* chunkBB); BoundingBox* chunkBB);

View file

@ -30,29 +30,29 @@ void XboxStructureActionPlaceBlock::writeAttributes(DataOutputStream* dos,
} }
void XboxStructureActionPlaceBlock::addAttribute( void XboxStructureActionPlaceBlock::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"x") == 0) { if (attributeName.compare("x") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_x = value; m_x = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionPlaceBlock: Adding parameter x=%d\n", m_x); "XboxStructureActionPlaceBlock: Adding parameter x=%d\n", m_x);
} else if (attributeName.compare(L"y") == 0) { } else if (attributeName.compare("y") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_y = value; m_y = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionPlaceBlock: Adding parameter y=%d\n", m_y); "XboxStructureActionPlaceBlock: Adding parameter y=%d\n", m_y);
} else if (attributeName.compare(L"z") == 0) { } else if (attributeName.compare("z") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_z = value; m_z = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionPlaceBlock: Adding parameter z=%d\n", m_z); "XboxStructureActionPlaceBlock: Adding parameter z=%d\n", m_z);
} else if (attributeName.compare(L"block") == 0) { } else if (attributeName.compare("block") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_tile = value; m_tile = value;
app.DebugPrintf( app.DebugPrintf(
"XboxStructureActionPlaceBlock: Adding parameter block=%d\n", "XboxStructureActionPlaceBlock: Adding parameter block=%d\n",
m_tile); m_tile);
} else if (attributeName.compare(L"data") == 0) { } else if (attributeName.compare("data") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_data = value; m_data = value;
app.DebugPrintf( app.DebugPrintf(

View file

@ -24,8 +24,8 @@ public:
virtual int getEndZ() { return m_z; } virtual int getEndZ() { return m_z; }
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool placeBlockInLevel(StructurePiece* structure, Level* level, bool placeBlockInLevel(StructurePiece* structure, Level* level,
BoundingBox* chunkBB); BoundingBox* chunkBB);

View file

@ -45,9 +45,9 @@ GameRuleDefinition* XboxStructureActionPlaceContainer::addChild(
m_items.push_back((AddItemRuleDefinition*)rule); m_items.push_back((AddItemRuleDefinition*)rule);
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"XboxStructureActionPlaceContainer: Attempted to add invalid " "XboxStructureActionPlaceContainer: Attempted to add invalid "
L"child rule - %d\n", "child rule - %d\n",
ruleType); ruleType);
#endif #endif
} }
@ -55,8 +55,8 @@ GameRuleDefinition* XboxStructureActionPlaceContainer::addChild(
} }
void XboxStructureActionPlaceContainer::addAttribute( void XboxStructureActionPlaceContainer::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"facing") == 0) { if (attributeName.compare("facing") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_data = value; m_data = value;
app.DebugPrintf( app.DebugPrintf(

View file

@ -31,8 +31,8 @@ public:
// virtual void writeAttributes(DataOutputStream *dos, uint32_t // virtual void writeAttributes(DataOutputStream *dos, uint32_t
// numAttributes); // numAttributes);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool placeContainerInLevel(StructurePiece* structure, Level* level, bool placeContainerInLevel(StructurePiece* structure, Level* level,
BoundingBox* chunkBB); BoundingBox* chunkBB);

View file

@ -15,7 +15,7 @@
XboxStructureActionPlaceSpawner::XboxStructureActionPlaceSpawner() { XboxStructureActionPlaceSpawner::XboxStructureActionPlaceSpawner() {
m_tile = Tile::mobSpawner_Id; m_tile = Tile::mobSpawner_Id;
m_entityId = L"Pig"; m_entityId = "Pig";
} }
XboxStructureActionPlaceSpawner::~XboxStructureActionPlaceSpawner() {} XboxStructureActionPlaceSpawner::~XboxStructureActionPlaceSpawner() {}
@ -29,12 +29,12 @@ void XboxStructureActionPlaceSpawner::writeAttributes(DataOutputStream* dos,
} }
void XboxStructureActionPlaceSpawner::addAttribute( void XboxStructureActionPlaceSpawner::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"entity") == 0) { if (attributeName.compare("entity") == 0) {
m_entityId = attributeValue; m_entityId = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"XboxStructureActionPlaceSpawner: Adding parameter entity=%ls\n", "XboxStructureActionPlaceSpawner: Adding parameter entity=%s\n",
m_entityId.c_str()); m_entityId.c_str());
#endif #endif
} else { } else {
@ -64,9 +64,9 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(
level->getTileEntity(worldX, worldY, worldZ)); level->getTileEntity(worldX, worldY, worldZ));
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"XboxStructureActionPlaceSpawner - placing a %ls spawner at " "XboxStructureActionPlaceSpawner - placing a %s spawner at "
L"(%d,%d,%d)\n", "(%d,%d,%d)\n",
m_entityId.c_str(), worldX, worldY, worldZ); m_entityId.c_str(), worldX, worldY, worldZ);
#endif #endif
if (entity != nullptr) { if (entity != nullptr) {

View file

@ -12,7 +12,7 @@ class GRFObject;
class XboxStructureActionPlaceSpawner : public XboxStructureActionPlaceBlock { class XboxStructureActionPlaceSpawner : public XboxStructureActionPlaceBlock {
private: private:
std::wstring m_entityId; std::string m_entityId;
public: public:
XboxStructureActionPlaceSpawner(); XboxStructureActionPlaceSpawner();
@ -23,8 +23,8 @@ public:
} }
virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream* dos, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool placeSpawnerInLevel(StructurePiece* structure, Level* level, bool placeSpawnerInLevel(StructurePiece* structure, Level* level,
BoundingBox* chunkBB); BoundingBox* chunkBB);

View file

@ -2,10 +2,10 @@
LevelRules::LevelRules() {} LevelRules::LevelRules() {}
void LevelRules::addLevelRule(const std::wstring& displayName, void LevelRules::addLevelRule(const std::string& displayName,
std::uint8_t* pbData, unsigned int dataLength) {} std::uint8_t* pbData, unsigned int dataLength) {}
void LevelRules::addLevelRule(const std::wstring& displayName, void LevelRules::addLevelRule(const std::string& displayName,
LevelRuleset* rootRule) {} LevelRuleset* rootRule) {}
void LevelRules::removeLevelRule(LevelRuleset* removing) { void LevelRules::removeLevelRule(LevelRuleset* removing) {

View file

@ -9,9 +9,9 @@ class LevelRules {
public: public:
LevelRules(); LevelRules();
void addLevelRule(const std::wstring& displayName, std::uint8_t* pbData, void addLevelRule(const std::string& displayName, std::uint8_t* pbData,
unsigned int dataLength); unsigned int dataLength);
void addLevelRule(const std::wstring& displayName, LevelRuleset* rootRule); void addLevelRule(const std::string& displayName, LevelRuleset* rootRule);
void removeLevelRule(LevelRuleset* removing); void removeLevelRule(LevelRuleset* removing);
}; };

View file

@ -32,8 +32,8 @@ void AddEnchantmentRuleDefinition::writeAttributes(DataOutputStream* dos,
} }
void AddEnchantmentRuleDefinition::addAttribute( void AddEnchantmentRuleDefinition::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"enchantmentId") == 0) { if (attributeName.compare("enchantmentId") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
if (value < 0) value = 0; if (value < 0) value = 0;
if (value >= 256) value = 255; if (value >= 256) value = 255;
@ -41,7 +41,7 @@ void AddEnchantmentRuleDefinition::addAttribute(
app.DebugPrintf( app.DebugPrintf(
"AddEnchantmentRuleDefinition: Adding parameter enchantmentId=%d\n", "AddEnchantmentRuleDefinition: Adding parameter enchantmentId=%d\n",
m_enchantmentId); m_enchantmentId);
} else if (attributeName.compare(L"enchantmentLevel") == 0) { } else if (attributeName.compare("enchantmentLevel") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
if (value < 0) value = 0; if (value < 0) value = 0;
m_enchantmentLevel = value; m_enchantmentLevel = value;

View file

@ -22,8 +22,8 @@ public:
virtual void writeAttributes(DataOutputStream*, unsigned int numAttrs); virtual void writeAttributes(DataOutputStream*, unsigned int numAttrs);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
bool enchantItem(std::shared_ptr<ItemInstance> item); bool enchantItem(std::shared_ptr<ItemInstance> item);
}; };

View file

@ -55,29 +55,29 @@ GameRuleDefinition* AddItemRuleDefinition::addChild(
return rule; return rule;
} }
void AddItemRuleDefinition::addAttribute(const std::wstring& attributeName, void AddItemRuleDefinition::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"itemId") == 0) { if (attributeName.compare("itemId") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_itemId = value; m_itemId = value;
// app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter // app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter
// itemId=%d\n",m_itemId); // itemId=%d\n",m_itemId);
} else if (attributeName.compare(L"quantity") == 0) { } else if (attributeName.compare("quantity") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_quantity = value; m_quantity = value;
// app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter // app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter
// quantity=%d\n",m_quantity); // quantity=%d\n",m_quantity);
} else if (attributeName.compare(L"auxValue") == 0) { } else if (attributeName.compare("auxValue") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_auxValue = value; m_auxValue = value;
// app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter // app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter
// auxValue=%d\n",m_auxValue); // auxValue=%d\n",m_auxValue);
} else if (attributeName.compare(L"dataTag") == 0) { } else if (attributeName.compare("dataTag") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_dataTag = value; m_dataTag = value;
// app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter // app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter
// dataTag=%d\n",m_dataTag); // dataTag=%d\n",m_dataTag);
} else if (attributeName.compare(L"slot") == 0) { } else if (attributeName.compare("slot") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_slot = value; m_slot = value;
// app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter // app.DebugPrintf(2,"AddItemRuleDefinition: Adding parameter

View file

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

View file

@ -34,16 +34,16 @@ void CollectItemRuleDefinition::writeAttributes(DataOutputStream* dos,
} }
void CollectItemRuleDefinition::addAttribute( void CollectItemRuleDefinition::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"itemId") == 0) { if (attributeName.compare("itemId") == 0) {
m_itemId = fromWString<int>(attributeValue); m_itemId = fromWString<int>(attributeValue);
app.DebugPrintf("CollectItemRule: Adding parameter itemId=%d\n", app.DebugPrintf("CollectItemRule: Adding parameter itemId=%d\n",
m_itemId); m_itemId);
} else if (attributeName.compare(L"auxValue") == 0) { } else if (attributeName.compare("auxValue") == 0) {
m_auxValue = fromWString<int>(attributeValue); m_auxValue = fromWString<int>(attributeValue);
app.DebugPrintf("CollectItemRule: Adding parameter m_auxValue=%d\n", app.DebugPrintf("CollectItemRule: Adding parameter m_auxValue=%d\n",
m_auxValue); m_auxValue);
} else if (attributeName.compare(L"quantity") == 0) { } else if (attributeName.compare("quantity") == 0) {
m_quantity = fromWString<int>(attributeValue); m_quantity = fromWString<int>(attributeValue);
app.DebugPrintf("CollectItemRule: Adding parameter m_quantity=%d\n", app.DebugPrintf("CollectItemRule: Adding parameter m_quantity=%d\n",
m_quantity); m_quantity);
@ -55,7 +55,7 @@ void CollectItemRuleDefinition::addAttribute(
int CollectItemRuleDefinition::getGoal() { return m_quantity; } int CollectItemRuleDefinition::getGoal() { return m_quantity; }
int CollectItemRuleDefinition::getProgress(GameRule* rule) { int CollectItemRuleDefinition::getProgress(GameRule* rule) {
GameRule::ValueType value = rule->getParameter(L"iQuantity"); GameRule::ValueType value = rule->getParameter("iQuantity");
return value.i; return value.i;
} }
@ -63,7 +63,7 @@ void CollectItemRuleDefinition::populateGameRule(
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) { GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) {
GameRule::ValueType value; GameRule::ValueType value;
value.i = 0; value.i = 0;
rule->setParameter(L"iQuantity", value); rule->setParameter("iQuantity", value);
GameRuleDefinition::populateGameRule(type, rule); GameRuleDefinition::populateGameRule(type, rule);
} }
@ -75,9 +75,9 @@ bool CollectItemRuleDefinition::onCollectItem(
item->getAuxValue() == m_auxValue && item->getAuxValue() == m_auxValue &&
item->get4JData() == m_4JDataValue) { item->get4JData() == m_4JDataValue) {
if (!getComplete(rule)) { if (!getComplete(rule)) {
GameRule::ValueType value = rule->getParameter(L"iQuantity"); GameRule::ValueType value = rule->getParameter("iQuantity");
int quantityCollected = (value.i += item->count); int quantityCollected = (value.i += item->count);
rule->setParameter(L"iQuantity", value); rule->setParameter("iQuantity", value);
statusChanged = true; statusChanged = true;
@ -102,20 +102,20 @@ bool CollectItemRuleDefinition::onCollectItem(
return statusChanged; return statusChanged;
} }
std::wstring CollectItemRuleDefinition::generateXml( std::string CollectItemRuleDefinition::generateXml(
std::shared_ptr<ItemInstance> item) { std::shared_ptr<ItemInstance> item) {
// 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd // 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd
std::wstring xml = L""; std::string xml = "";
if (item != nullptr) { if (item != nullptr) {
xml = L"<CollectItemRule itemId=\"" + toWString<int>(item->id) + xml = "<CollectItemRule itemId=\"" + toWString<int>(item->id) +
L"\" quantity=\"SET\" descriptionName=\"OPTIONAL\" " "\" quantity=\"SET\" descriptionName=\"OPTIONAL\" "
L"promptName=\"OPTIONAL\""; "promptName=\"OPTIONAL\"";
if (item->getAuxValue() != 0) if (item->getAuxValue() != 0)
xml += xml +=
L" auxValue=\"" + toWString<int>(item->getAuxValue()) + L"\""; " auxValue=\"" + toWString<int>(item->getAuxValue()) + "\"";
if (item->get4JData() != 0) if (item->get4JData() != 0)
xml += L" dataTag=\"" + toWString<int>(item->get4JData()) + L"\""; xml += " dataTag=\"" + toWString<int>(item->get4JData()) + "\"";
xml += L"/>\n"; xml += "/>\n";
} }
return xml; return xml;
} }

View file

@ -27,8 +27,8 @@ public:
} }
virtual void writeAttributes(DataOutputStream*, unsigned int numAttributes); virtual void writeAttributes(DataOutputStream*, unsigned int numAttributes);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
virtual int getGoal(); virtual int getGoal();
virtual int getProgress(GameRule* rule); virtual int getProgress(GameRule* rule);
@ -41,8 +41,8 @@ public:
bool onCollectItem(GameRule* rule, std::shared_ptr<ItemInstance> item); bool onCollectItem(GameRule* rule, std::shared_ptr<ItemInstance> item);
static std::wstring generateXml(std::shared_ptr<ItemInstance> item); static std::string generateXml(std::shared_ptr<ItemInstance> item);
private: private:
// static std::wstring generateXml(CollectItemRuleDefinition *ruleDef); // static std::string generateXml(CollectItemRuleDefinition *ruleDef);
}; };

View file

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

View file

@ -25,8 +25,8 @@ public:
virtual bool onCollectItem(GameRule* rule, virtual bool onCollectItem(GameRule* rule,
std::shared_ptr<ItemInstance> item); std::shared_ptr<ItemInstance> item);
static std::wstring generateDescriptionString( static std::string generateDescriptionString(
const std::wstring& description, void* data, int dataLength); const std::string& description, void* data, int dataLength);
private: private:
void updateStatus(GameRule* rule); void updateStatus(GameRule* rule);

View file

@ -47,9 +47,9 @@ GameRuleDefinition* CompoundGameRuleDefinition::addChild(
rule = new UpdatePlayerRuleDefinition(); rule = new UpdatePlayerRuleDefinition();
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"CompoundGameRuleDefinition: Attempted to add invalid child rule " "CompoundGameRuleDefinition: Attempted to add invalid child rule "
L"- %d\n", "- %d\n",
ruleType); ruleType);
#endif #endif
} }
@ -70,7 +70,7 @@ void CompoundGameRuleDefinition::populateGameRule(
value.isPointer = true; value.isPointer = true;
// Somehow add the newRule to the current rule // Somehow add the newRule to the current rule
rule->setParameter(L"rule" + toWString<int>(i), value); rule->setParameter("rule" + toWString<int>(i), value);
++i; ++i;
} }
GameRuleDefinition::populateGameRule(type, rule); GameRuleDefinition::populateGameRule(type, rule);

View file

@ -20,8 +20,8 @@
class Connection; class Connection;
GameRuleDefinition::GameRuleDefinition() { GameRuleDefinition::GameRuleDefinition() {
m_descriptionId = L""; m_descriptionId = "";
m_promptId = L""; m_promptId = "";
m_4JDataValue = 0; m_4JDataValue = 0;
} }
@ -65,35 +65,35 @@ void GameRuleDefinition::getChildren(
GameRuleDefinition* GameRuleDefinition::addChild( GameRuleDefinition* GameRuleDefinition::addChild(
ConsoleGameRules::EGameRuleType ruleType) { ConsoleGameRules::EGameRuleType ruleType) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"GameRuleDefinition: Attempted to add invalid child rule - %d\n", printf("GameRuleDefinition: Attempted to add invalid child rule - %d\n",
ruleType); ruleType);
#endif #endif
return nullptr; return nullptr;
} }
void GameRuleDefinition::addAttribute(const std::wstring& attributeName, void GameRuleDefinition::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"descriptionName") == 0) { if (attributeName.compare("descriptionName") == 0) {
m_descriptionId = attributeValue; m_descriptionId = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"GameRuleDefinition: Adding parameter descriptionId=%ls\n", printf("GameRuleDefinition: Adding parameter descriptionId=%s\n",
m_descriptionId.c_str()); m_descriptionId.c_str());
#endif #endif
} else if (attributeName.compare(L"promptName") == 0) { } else if (attributeName.compare("promptName") == 0) {
m_promptId = attributeValue; m_promptId = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"GameRuleDefinition: Adding parameter m_promptId=%ls\n", printf("GameRuleDefinition: Adding parameter m_promptId=%s\n",
m_promptId.c_str()); m_promptId.c_str());
#endif #endif
} else if (attributeName.compare(L"dataTag") == 0) { } else if (attributeName.compare("dataTag") == 0) {
m_4JDataValue = fromWString<int>(attributeValue); m_4JDataValue = fromWString<int>(attributeValue);
app.DebugPrintf( app.DebugPrintf(
"GameRuleDefinition: Adding parameter m_4JDataValue=%d\n", "GameRuleDefinition: Adding parameter m_4JDataValue=%d\n",
m_4JDataValue); m_4JDataValue);
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"GameRuleDefinition: Attempted to add invalid attribute: %ls\n", "GameRuleDefinition: Attempted to add invalid attribute: %s\n",
attributeName.c_str()); attributeName.c_str());
#endif #endif
} }
@ -103,20 +103,20 @@ void GameRuleDefinition::populateGameRule(
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) { GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) {
GameRule::ValueType value; GameRule::ValueType value;
value.b = false; value.b = false;
rule->setParameter(L"bComplete", value); rule->setParameter("bComplete", value);
} }
bool GameRuleDefinition::getComplete(GameRule* rule) { bool GameRuleDefinition::getComplete(GameRule* rule) {
GameRule::ValueType value; GameRule::ValueType value;
value = rule->getParameter(L"bComplete"); value = rule->getParameter("bComplete");
return value.b; return value.b;
} }
void GameRuleDefinition::setComplete(GameRule* rule, bool val) { void GameRuleDefinition::setComplete(GameRule* rule, bool val) {
GameRule::ValueType value; GameRule::ValueType value;
value = rule->getParameter(L"bComplete"); value = rule->getParameter("bComplete");
value.b = val; value.b = val;
rule->setParameter(L"bComplete", value); rule->setParameter("bComplete", value);
} }
std::vector<GameRuleDefinition*>* GameRuleDefinition::enumerate() { std::vector<GameRuleDefinition*>* GameRuleDefinition::enumerate() {
@ -151,10 +151,10 @@ GameRulesInstance* GameRuleDefinition::generateNewGameRulesInstance(
return manager; return manager;
} }
std::wstring GameRuleDefinition::generateDescriptionString( std::string GameRuleDefinition::generateDescriptionString(
ConsoleGameRules::EGameRuleType defType, const std::wstring& description, ConsoleGameRules::EGameRuleType defType, const std::string& description,
void* data, int dataLength) { void* data, int dataLength) {
std::wstring formatted = description; std::string formatted = description;
switch (defType) { switch (defType) {
case ConsoleGameRules::eGameRuleType_CompleteAllRule: case ConsoleGameRules::eGameRuleType_CompleteAllRule:
formatted = CompleteAllRuleDefinition::generateDescriptionString( formatted = CompleteAllRuleDefinition::generateDescriptionString(

View file

@ -25,8 +25,8 @@ private:
protected: protected:
// These attributes should map to those in the XSD GameRuleType // These attributes should map to those in the XSD GameRuleType
std::wstring m_descriptionId; std::string m_descriptionId;
std::wstring m_promptId; std::string m_promptId;
int m_4JDataValue; int m_4JDataValue;
public: public:
@ -47,8 +47,8 @@ public:
virtual GameRuleDefinition* addChild( virtual GameRuleDefinition* addChild(
ConsoleGameRules::EGameRuleType ruleType); ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
virtual void populateGameRule( virtual void populateGameRule(
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule); GameRulesInstance::EGameRulesInstanceType type, GameRule* rule);
@ -80,8 +80,8 @@ public:
static GameRulesInstance* generateNewGameRulesInstance( static GameRulesInstance* generateNewGameRulesInstance(
GameRulesInstance::EGameRulesInstanceType type, LevelRuleset* rules, GameRulesInstance::EGameRulesInstanceType type, LevelRuleset* rules,
Connection* connection); Connection* connection);
static std::wstring generateDescriptionString( static std::string generateDescriptionString(
ConsoleGameRules::EGameRuleType defType, ConsoleGameRules::EGameRuleType defType,
const std::wstring& description, void* data = nullptr, const std::string& description, void* data = nullptr,
int dataLength = 0); int dataLength = 0);
}; };

View file

@ -37,15 +37,15 @@ void LevelRuleset::loadStringTable(StringTable* table) {
m_stringTable = table; m_stringTable = table;
} }
const wchar_t* LevelRuleset::getString(const std::wstring& key) { const char* LevelRuleset::getString(const std::string& key) {
if (m_stringTable == nullptr) { if (m_stringTable == nullptr) {
return L""; return "";
} else { } else {
return m_stringTable->getString(key); return m_stringTable->getString(key);
} }
} }
AABB* LevelRuleset::getNamedArea(const std::wstring& areaName) { AABB* LevelRuleset::getNamedArea(const std::string& areaName) {
AABB* area = nullptr; AABB* area = nullptr;
for (auto it = m_areas.begin(); it != m_areas.end(); ++it) { for (auto it = m_areas.begin(); it != m_areas.end(); ++it) {
if ((*it)->getName().compare(areaName) == 0) { if ((*it)->getName().compare(areaName) == 0) {

View file

@ -28,9 +28,9 @@ public:
} }
void loadStringTable(StringTable* table); void loadStringTable(StringTable* table);
const wchar_t* getString(const std::wstring& key); const char* getString(const std::string& key);
AABB* getNamedArea(const std::wstring& areaName); AABB* getNamedArea(const std::string& areaName);
StringTable* getStringTable() { return m_stringTable; } StringTable* getStringTable() { return m_stringTable; }
}; };

View file

@ -9,7 +9,7 @@
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
NamedAreaRuleDefinition::NamedAreaRuleDefinition() { NamedAreaRuleDefinition::NamedAreaRuleDefinition() {
m_name = L""; m_name = "";
m_area = AABB(0, 0, 0, 0, 0, 0); m_area = AABB(0, 0, 0, 0, 0, 0);
} }
@ -35,37 +35,37 @@ void NamedAreaRuleDefinition::writeAttributes(DataOutputStream* dos,
dos->writeUTF(toWString(m_area.z1)); dos->writeUTF(toWString(m_area.z1));
} }
void NamedAreaRuleDefinition::addAttribute(const std::wstring& attributeName, void NamedAreaRuleDefinition::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"name") == 0) { if (attributeName.compare("name") == 0) {
m_name = attributeValue; m_name = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"NamedAreaRuleDefinition: Adding parameter name=%ls\n", printf("NamedAreaRuleDefinition: Adding parameter name=%s\n",
m_name.c_str()); m_name.c_str());
#endif #endif
} else if (attributeName.compare(L"x0") == 0) { } else if (attributeName.compare("x0") == 0) {
m_area.x0 = fromWString<int>(attributeValue); m_area.x0 = fromWString<int>(attributeValue);
app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter x0=%f\n", app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter x0=%f\n",
m_area.x0); m_area.x0);
} else if (attributeName.compare(L"y0") == 0) { } else if (attributeName.compare("y0") == 0) {
m_area.y0 = fromWString<int>(attributeValue); m_area.y0 = fromWString<int>(attributeValue);
if (m_area.y0 < 0) m_area.y0 = 0; if (m_area.y0 < 0) m_area.y0 = 0;
app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter y0=%f\n", app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter y0=%f\n",
m_area.y0); m_area.y0);
} else if (attributeName.compare(L"z0") == 0) { } else if (attributeName.compare("z0") == 0) {
m_area.z0 = fromWString<int>(attributeValue); m_area.z0 = fromWString<int>(attributeValue);
app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter z0=%f\n", app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter z0=%f\n",
m_area.z0); m_area.z0);
} else if (attributeName.compare(L"x1") == 0) { } else if (attributeName.compare("x1") == 0) {
m_area.x1 = fromWString<int>(attributeValue); m_area.x1 = fromWString<int>(attributeValue);
app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter x1=%f\n", app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter x1=%f\n",
m_area.x1); m_area.x1);
} else if (attributeName.compare(L"y1") == 0) { } else if (attributeName.compare("y1") == 0) {
m_area.y1 = fromWString<int>(attributeValue); m_area.y1 = fromWString<int>(attributeValue);
if (m_area.y1 < 0) m_area.y1 = 0; if (m_area.y1 < 0) m_area.y1 = 0;
app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter y1=%f\n", app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter y1=%f\n",
m_area.y1); m_area.y1);
} else if (attributeName.compare(L"z1") == 0) { } else if (attributeName.compare("z1") == 0) {
m_area.z1 = fromWString<int>(attributeValue); m_area.z1 = fromWString<int>(attributeValue);
app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter z1=%f\n", app.DebugPrintf("NamedAreaRuleDefinition: Adding parameter z1=%f\n",
m_area.z1); m_area.z1);

View file

@ -8,7 +8,7 @@
class NamedAreaRuleDefinition : public GameRuleDefinition { class NamedAreaRuleDefinition : public GameRuleDefinition {
private: private:
std::wstring m_name; std::string m_name;
AABB m_area; AABB m_area;
public: public:
@ -21,9 +21,9 @@ public:
return ConsoleGameRules::eGameRuleType_NamedArea; return ConsoleGameRules::eGameRuleType_NamedArea;
} }
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
AABB* getArea() { return &m_area; } AABB* getArea() { return &m_area; }
std::wstring getName() { return m_name; } std::string getName() { return m_name; }
}; };

View file

@ -74,9 +74,9 @@ GameRuleDefinition* UpdatePlayerRuleDefinition::addChild(
m_items.push_back((AddItemRuleDefinition*)rule); m_items.push_back((AddItemRuleDefinition*)rule);
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf( printf(
L"UpdatePlayerRuleDefinition: Attempted to add invalid child rule " "UpdatePlayerRuleDefinition: Attempted to add invalid child rule "
L"- %d\n", "- %d\n",
ruleType); ruleType);
#endif #endif
} }
@ -84,38 +84,38 @@ GameRuleDefinition* UpdatePlayerRuleDefinition::addChild(
} }
void UpdatePlayerRuleDefinition::addAttribute( void UpdatePlayerRuleDefinition::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) { const std::string& attributeName, const std::string& attributeValue) {
if (attributeName.compare(L"spawnX") == 0) { if (attributeName.compare("spawnX") == 0) {
if (m_spawnPos == nullptr) m_spawnPos = new Pos(); if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_spawnPos->x = value; m_spawnPos->x = value;
app.DebugPrintf( app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter spawnX=%d\n", value); "UpdatePlayerRuleDefinition: Adding parameter spawnX=%d\n", value);
} else if (attributeName.compare(L"spawnY") == 0) { } else if (attributeName.compare("spawnY") == 0) {
if (m_spawnPos == nullptr) m_spawnPos = new Pos(); if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_spawnPos->y = value; m_spawnPos->y = value;
app.DebugPrintf( app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter spawnY=%d\n", value); "UpdatePlayerRuleDefinition: Adding parameter spawnY=%d\n", value);
} else if (attributeName.compare(L"spawnZ") == 0) { } else if (attributeName.compare("spawnZ") == 0) {
if (m_spawnPos == nullptr) m_spawnPos = new Pos(); if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_spawnPos->z = value; m_spawnPos->z = value;
app.DebugPrintf( app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter spawnZ=%d\n", value); "UpdatePlayerRuleDefinition: Adding parameter spawnZ=%d\n", value);
} else if (attributeName.compare(L"health") == 0) { } else if (attributeName.compare("health") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_health = value; m_health = value;
m_bUpdateHealth = true; m_bUpdateHealth = true;
app.DebugPrintf( app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter health=%d\n", value); "UpdatePlayerRuleDefinition: Adding parameter health=%d\n", value);
} else if (attributeName.compare(L"food") == 0) { } else if (attributeName.compare("food") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_food = value; m_food = value;
m_bUpdateFood = true; m_bUpdateFood = true;
app.DebugPrintf( app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter health=%d\n", value); "UpdatePlayerRuleDefinition: Adding parameter health=%d\n", value);
} else if (attributeName.compare(L"yRot") == 0) { } else if (attributeName.compare("yRot") == 0) {
float value = fromWString<float>(attributeValue); float value = fromWString<float>(attributeValue);
m_yRot = value; m_yRot = value;
m_bUpdateYRot = true; m_bUpdateYRot = true;

View file

@ -34,8 +34,8 @@ public:
virtual void writeAttributes(DataOutputStream* dos, virtual void writeAttributes(DataOutputStream* dos,
unsigned int numAttributes); unsigned int numAttributes);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
virtual void postProcessPlayer(std::shared_ptr<Player> player); virtual void postProcessPlayer(std::shared_ptr<Player> player);
}; };

View file

@ -31,24 +31,24 @@ void UseTileRuleDefinition::writeAttributes(DataOutputStream* dos,
dos->writeUTF(toWString(m_coordinates.z)); dos->writeUTF(toWString(m_coordinates.z));
} }
void UseTileRuleDefinition::addAttribute(const std::wstring& attributeName, void UseTileRuleDefinition::addAttribute(const std::string& attributeName,
const std::wstring& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare(L"tileId") == 0) { if (attributeName.compare("tileId") == 0) {
m_tileId = fromWString<int>(attributeValue); m_tileId = fromWString<int>(attributeValue);
app.DebugPrintf("UseTileRule: Adding parameter tileId=%d\n", m_tileId); app.DebugPrintf("UseTileRule: Adding parameter tileId=%d\n", m_tileId);
} else if (attributeName.compare(L"useCoords") == 0) { } else if (attributeName.compare("useCoords") == 0) {
m_useCoords = fromWString<bool>(attributeValue); m_useCoords = fromWString<bool>(attributeValue);
app.DebugPrintf("UseTileRule: Adding parameter useCoords=%s\n", app.DebugPrintf("UseTileRule: Adding parameter useCoords=%s\n",
m_useCoords ? "true" : "false"); m_useCoords ? "true" : "false");
} else if (attributeName.compare(L"x") == 0) { } else if (attributeName.compare("x") == 0) {
m_coordinates.x = fromWString<int>(attributeValue); m_coordinates.x = fromWString<int>(attributeValue);
app.DebugPrintf("UseTileRule: Adding parameter x=%d\n", app.DebugPrintf("UseTileRule: Adding parameter x=%d\n",
m_coordinates.x); m_coordinates.x);
} else if (attributeName.compare(L"y") == 0) { } else if (attributeName.compare("y") == 0) {
m_coordinates.y = fromWString<int>(attributeValue); m_coordinates.y = fromWString<int>(attributeValue);
app.DebugPrintf("UseTileRule: Adding parameter y=%d\n", app.DebugPrintf("UseTileRule: Adding parameter y=%d\n",
m_coordinates.y); m_coordinates.y);
} else if (attributeName.compare(L"z") == 0) { } else if (attributeName.compare("z") == 0) {
m_coordinates.z = fromWString<int>(attributeValue); m_coordinates.z = fromWString<int>(attributeValue);
app.DebugPrintf("UseTileRule: Adding parameter z=%d\n", app.DebugPrintf("UseTileRule: Adding parameter z=%d\n",
m_coordinates.z); m_coordinates.z);

View file

@ -23,8 +23,8 @@ public:
virtual void writeAttributes(DataOutputStream* dos, virtual void writeAttributes(DataOutputStream* dos,
unsigned int numAttributes); unsigned int numAttributes);
virtual void addAttribute(const std::wstring& attributeName, virtual void addAttribute(const std::string& attributeName,
const std::wstring& attributeValue); const std::string& attributeValue);
virtual bool onUseTile(GameRule* rule, int tileId, int x, int y, int z); virtual bool onUseTile(GameRule* rule, int tileId, int x, int y, int z);
}; };

View file

@ -29,10 +29,10 @@ GameRule::~GameRule() {
} }
} }
GameRule::ValueType GameRule::getParameter(const std::wstring& parameterName) { GameRule::ValueType GameRule::getParameter(const std::string& parameterName) {
if (m_parameters.find(parameterName) == m_parameters.end()) { if (m_parameters.find(parameterName) == m_parameters.end()) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", printf("WARNING: Parameter %s was not set before being fetched\n",
parameterName.c_str()); parameterName.c_str());
assert(0); assert(0);
#endif #endif
@ -40,15 +40,15 @@ GameRule::ValueType GameRule::getParameter(const std::wstring& parameterName) {
return m_parameters[parameterName]; return m_parameters[parameterName];
} }
void GameRule::setParameter(const std::wstring& parameterName, void GameRule::setParameter(const std::string& parameterName,
ValueType value) { ValueType value) {
if (m_parameters.find(parameterName) == m_parameters.end()) { if (m_parameters.find(parameterName) == m_parameters.end()) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"Adding parameter %ls to GameRule\n", parameterName.c_str()); printf("Adding parameter %s to GameRule\n", parameterName.c_str());
#endif #endif
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"Setting parameter %ls for GameRule\n", parameterName.c_str()); printf("Setting parameter %s for GameRule\n", parameterName.c_str());
#endif #endif
} }
m_parameters[parameterName] = value; m_parameters[parameterName] = value;
@ -67,7 +67,7 @@ void GameRule::write(DataOutputStream* dos) {
// Find required parameters. // Find required parameters.
dos->writeInt(m_parameters.size()); dos->writeInt(m_parameters.size());
for (auto it = m_parameters.begin(); it != m_parameters.end(); it++) { for (auto it = m_parameters.begin(); it != m_parameters.end(); it++) {
std::wstring pName = (*it).first; std::string pName = (*it).first;
ValueType vType = (*it).second; ValueType vType = (*it).second;
dos->writeUTF((*it).first); dos->writeUTF((*it).first);
@ -83,7 +83,7 @@ void GameRule::write(DataOutputStream* dos) {
void GameRule::read(DataInputStream* dis) { void GameRule::read(DataInputStream* dis) {
int savedParams = dis->readInt(); int savedParams = dis->readInt();
for (int i = 0; i < savedParams; i++) { for (int i = 0; i < savedParams; i++) {
std::wstring pNames = dis->readUTF(); std::string pNames = dis->readUTF();
ValueType vType = getParameter(pNames); ValueType vType = getParameter(pNames);

View file

@ -40,7 +40,7 @@ private:
Connection* m_connection; Connection* m_connection;
public: public:
typedef std::unordered_map<std::wstring, ValueType> stringValueMapType; typedef std::unordered_map<std::string, ValueType> stringValueMapType;
stringValueMapType m_parameters; // These are the members of this rule that stringValueMapType m_parameters; // These are the members of this rule that
// maintain it's state // maintain it's state
@ -50,8 +50,8 @@ public:
Connection* getConnection() { return m_connection; } Connection* getConnection() { return m_connection; }
ValueType getParameter(const std::wstring& parameterName); ValueType getParameter(const std::string& parameterName);
void setParameter(const std::wstring& parameterName, ValueType value); void setParameter(const std::string& parameterName, ValueType value);
GameRuleDefinition* getGameRuleDefinition(); GameRuleDefinition* getGameRuleDefinition();
// All the hooks go here // All the hooks go here

View file

@ -5,7 +5,7 @@
WstringLookup::WstringLookup() { numIDs = 0; } WstringLookup::WstringLookup() { numIDs = 0; }
std::wstring WstringLookup::lookup(unsigned int id) { std::string WstringLookup::lookup(unsigned int id) {
// TODO // TODO
// if (id > currentMaxID) // if (id > currentMaxID)
// throw error // throw error
@ -13,10 +13,10 @@ std::wstring WstringLookup::lookup(unsigned int id) {
return int2str.at(id); return int2str.at(id);
} }
unsigned int WstringLookup::lookup(std::wstring str) { unsigned int WstringLookup::lookup(std::string str) {
if (str2int.find(str) == str2int.end()) { if (str2int.find(str) == str2int.end()) {
std::pair<std::wstring, unsigned int> p = std::pair<std::string, unsigned int> p =
std::pair<std::wstring, unsigned int>(str, numIDs); std::pair<std::string, unsigned int>(str, numIDs);
str2int.insert(p); str2int.insert(p);
int2str.push_back(str); int2str.push_back(str);
@ -27,13 +27,13 @@ unsigned int WstringLookup::lookup(std::wstring str) {
} }
} }
void WstringLookup::getTable(std::wstring** lookup, unsigned int* len) { void WstringLookup::getTable(std::string** lookup, unsigned int* len) {
// Outputs // Outputs
std::wstring* out_lookup; std::string* out_lookup;
unsigned int out_len; unsigned int out_len;
// Fill lookup. // Fill lookup.
out_lookup = new std::wstring[int2str.size()]; out_lookup = new std::string[int2str.size()];
for (unsigned int i = 0; i < numIDs; i++) out_lookup[i] = int2str.at(i); for (unsigned int i = 0; i < numIDs; i++) out_lookup[i] = int2str.at(i);
out_len = numIDs; out_len = numIDs;

View file

@ -7,15 +7,15 @@
class WstringLookup { class WstringLookup {
private: private:
unsigned int numIDs; unsigned int numIDs;
std::unordered_map<std::wstring, unsigned int> str2int; std::unordered_map<std::string, unsigned int> str2int;
std::vector<std::wstring> int2str; std::vector<std::string> int2str;
public: public:
WstringLookup(); WstringLookup();
std::wstring lookup(unsigned int id); std::string lookup(unsigned int id);
unsigned int lookup(std::wstring); unsigned int lookup(std::string);
void getTable(std::wstring** lookup, unsigned int* len); void getTable(std::string** lookup, unsigned int* len);
}; };

View file

@ -996,7 +996,7 @@ void Game::HandleXuiActions(void) {
eStream_Overworld_Calm1, eStream_Overworld_piano3, eStream_Overworld_Calm1, eStream_Overworld_piano3,
eStream_Nether1, eStream_Nether4, eStream_Nether1, eStream_Nether4,
eStream_end_dragon, eStream_end_end, eStream_CD_1); eStream_end_dragon, eStream_end_end, eStream_CD_1);
pMinecraft->soundEngine->playStreaming(L"", 0, 0, 0, 1, pMinecraft->soundEngine->playStreaming("", 0, 0, 0, 1,
1); 1);
const unsigned int result = const unsigned int result =
@ -1050,8 +1050,8 @@ void Game::HandleXuiActions(void) {
// change the minecraft player name // change the minecraft player name
Minecraft::GetInstance()->user->name = Minecraft::GetInstance()->user->name =
convStringToWstring(PlatformProfile.GetGamertag( PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad())); PlatformProfile.GetPrimaryPad());
bool success = g_NetworkManager.JoinGameFromInviteInfo( bool success = g_NetworkManager.JoinGameFromInviteInfo(
inviteData->dwUserIndex, // dwUserIndex inviteData->dwUserIndex, // dwUserIndex
@ -1258,7 +1258,7 @@ void Game::HandleXuiActions(void) {
uiIDA[1] = IDS_EXIT_GAME; uiIDA[1] = IDS_EXIT_GAME;
// pass in the gamertag format std::string // pass in the gamertag format std::string
wchar_t wchFormat[40]; char wchFormat[40];
INetworkPlayer* player = INetworkPlayer* player =
g_NetworkManager.GetLocalPlayerByUserIndex(i); g_NetworkManager.GetLocalPlayerByUserIndex(i);
@ -1266,7 +1266,7 @@ void Game::HandleXuiActions(void) {
// banned this level and decided not to unban then we may // banned this level and decided not to unban then we may
// have left the game by now // have left the game by now
if (player) { if (player) {
swprintf(wchFormat, 40, L"%ls\n\n%%ls", snprintf(wchFormat, 40, "%s\n\n%%s",
player->GetOnlineName()); player->GetOnlineName());
IPlatformStorage::EMessageResult result = IPlatformStorage::EMessageResult result =
@ -1303,7 +1303,7 @@ void Game::HandleXuiActions(void) {
// do we have a license? // do we have a license?
if (pDLCPack && if (pDLCPack &&
pDLCPack->hasPurchasedFile( pDLCPack->hasPurchasedFile(
DLCManager::e_DLCType_Texture, L"")) { DLCManager::e_DLCType_Texture, "")) {
purchased = true; purchased = true;
} }
} }
@ -1312,7 +1312,7 @@ void Game::HandleXuiActions(void) {
// to this // to this
if (pMinecraft->skins->getSelected()->hasAudio()) { if (pMinecraft->skins->getSelected()->hasAudio()) {
Minecraft::GetInstance()->soundEngine->playStreaming( Minecraft::GetInstance()->soundEngine->playStreaming(
L"", 0, 0, 0, 1, 1); "", 0, 0, 0, 1, 1);
} }
} break; } break;

View file

@ -20,11 +20,11 @@ public:
virtual void ReadBannedList(int iPad, eTMSAction action = (eTMSAction)0, virtual void ReadBannedList(int iPad, eTMSAction action = (eTMSAction)0,
bool bCallback = false) = 0; bool bCallback = false) = 0;
virtual int LoadLocalTMSFile(wchar_t* wchTMSFile) = 0; virtual int LoadLocalTMSFile(char* wchTMSFile) = 0;
virtual int LoadLocalTMSFile(wchar_t* wchTMSFile, virtual int LoadLocalTMSFile(char* wchTMSFile,
eFileExtensionType eExt) = 0; eFileExtensionType eExt) = 0;
virtual void FreeLocalTMSFiles(eTMSFileType eType) = 0; virtual void FreeLocalTMSFiles(eTMSFileType eType) = 0;
virtual int GetLocalTMSFileIndex(wchar_t* wchTMSFile, virtual int GetLocalTMSFileIndex(char* wchTMSFile,
bool bFilenameIncludesExtension, bool bFilenameIncludesExtension,
eFileExtensionType eEXT) = 0; eFileExtensionType eEXT) = 0;
}; };

View file

@ -3,8 +3,8 @@
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
const std::wstring LeaderboardManager::filterNames[eNumFilterModes] = { const std::string LeaderboardManager::filterNames[eNumFilterModes] = {
L"Friends", L"MyScore", L"TopRank"}; "Friends", "MyScore", "TopRank"};
void LeaderboardManager::DeleteInstance() { void LeaderboardManager::DeleteInstance() {
delete m_instance; delete m_instance;
@ -84,7 +84,7 @@ void LeaderboardManager::printStats(ReadView& view) {
ReadScore score = view.m_queries[i]; ReadScore score = view.m_queries[i];
app.DebugPrintf("\tname='%s'\n", app.DebugPrintf("\tname='%s'\n",
wstringtofilename(std::wstring(score.m_name)).c_str()); score.m_name.c_str());
app.DebugPrintf("\trank='%i'\n", score.m_rank); app.DebugPrintf("\trank='%i'\n", score.m_rank);
app.DebugPrintf("\tstatsData=["); app.DebugPrintf("\tstatsData=[");

View file

@ -6,7 +6,7 @@
class LeaderboardManager : public IPlatformLeaderboard { class LeaderboardManager : public IPlatformLeaderboard {
public: public:
static const std::wstring filterNames[eNumFilterModes]; static const std::string filterNames[eNumFilterModes];
LeaderboardManager(); LeaderboardManager();
virtual ~LeaderboardManager() {} virtual ~LeaderboardManager() {}

View file

@ -32,17 +32,17 @@ void StringTable::ProcessStringTableData(void) {
int versionNumber = dis.readInt(); int versionNumber = dis.readInt();
int languagesCount = dis.readInt(); int languagesCount = dis.readInt();
std::vector<std::pair<std::wstring, int> > langSizeMap; std::vector<std::pair<std::string, int> > langSizeMap;
for (int i = 0; i < languagesCount; ++i) { for (int i = 0; i < languagesCount; ++i) {
std::wstring langId = dis.readUTF(); std::string langId = dis.readUTF();
int langSize = dis.readInt(); int langSize = dis.readInt();
langSizeMap.push_back( langSizeMap.push_back(
std::vector<std::pair<std::wstring, int> >::value_type(langId, std::vector<std::pair<std::string, int> >::value_type(langId,
langSize)); langSize));
} }
std::vector<std::wstring> locales; std::vector<std::string> locales;
app.getLocale(locales); app.getLocale(locales);
bool foundLang = false; bool foundLang = false;
@ -56,7 +56,7 @@ void StringTable::ProcessStringTableData(void) {
for (auto it = langSizeMap.begin(); it != langSizeMap.end(); ++it) { for (auto it = langSizeMap.begin(); it != langSizeMap.end(); ++it) {
if (it->first.compare(*it_locales) == 0) { if (it->first.compare(*it_locales) == 0) {
app.DebugPrintf("StringTable:: Found language '%ls'.\n", app.DebugPrintf("StringTable:: Found language '%s'.\n",
it_locales->c_str()); it_locales->c_str());
dataSize = it->second; dataSize = it->second;
foundLang = true; foundLang = true;
@ -67,7 +67,7 @@ void StringTable::ProcessStringTableData(void) {
} }
if (!foundLang) if (!foundLang)
app.DebugPrintf("StringTable:: Can't find language '%ls'.\n", app.DebugPrintf("StringTable:: Can't find language '%s'.\n",
it_locales->c_str()); it_locales->c_str());
} }
@ -89,7 +89,7 @@ void StringTable::ProcessStringTableData(void) {
if (langVersion > 0) // integers rather than std::wstrings as keys. if (langVersion > 0) // integers rather than std::wstrings as keys.
isStatic = dis2.readBoolean(); isStatic = dis2.readBoolean();
std::wstring langId = dis2.readUTF(); std::string langId = dis2.readUTF();
int totalStrings = dis2.readInt(); int totalStrings = dis2.readInt();
app.DebugPrintf("IsStatic=%d totalStrings = %d\n", isStatic ? 1 : 0, app.DebugPrintf("IsStatic=%d totalStrings = %d\n", isStatic ? 1 : 0,
@ -97,11 +97,11 @@ void StringTable::ProcessStringTableData(void) {
if (!isStatic) { if (!isStatic) {
for (int i = 0; i < totalStrings; ++i) { for (int i = 0; i < totalStrings; ++i) {
std::wstring stringId = dis2.readUTF(); std::string stringId = dis2.readUTF();
std::wstring stringValue = dis2.readUTF(); std::string stringValue = dis2.readUTF();
m_stringsMap.insert( m_stringsMap.insert(
std::unordered_map<std::wstring, std::wstring>::value_type( std::unordered_map<std::string, std::string>::value_type(
stringId, stringValue)); stringId, stringValue));
} }
} else { } else {
@ -134,11 +134,11 @@ void StringTable::getData(std::uint8_t** ppData, unsigned int* pSize) {
*pSize = src.size(); *pSize = src.size();
} }
const wchar_t* StringTable::getString(const std::wstring& id) { const char* StringTable::getString(const std::string& id) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if (isStatic) { if (isStatic) {
assert(0); assert(0);
return L""; return "";
} }
#endif #endif
@ -147,21 +147,21 @@ const wchar_t* StringTable::getString(const std::wstring& id) {
if (it != m_stringsMap.end()) { if (it != m_stringsMap.end()) {
return it->second.c_str(); return it->second.c_str();
} else { } else {
return L""; return "";
} }
} }
const wchar_t* StringTable::getString(int id) { const char* StringTable::getString(int id) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if (!isStatic) { if (!isStatic) {
assert(0); assert(0);
return L""; return "";
} }
#endif #endif
if (id < m_stringsVec.size()) { if (id < m_stringsVec.size()) {
const wchar_t* pwchString = m_stringsVec.at(id).c_str(); const char* pwchString = m_stringsVec.at(id).c_str();
return pwchString; return pwchString;
} else } else
return L""; return "";
} }

View file

@ -11,8 +11,8 @@ class StringTable {
private: private:
bool isStatic; bool isStatic;
std::unordered_map<std::wstring, std::wstring> m_stringsMap; std::unordered_map<std::string, std::string> m_stringsMap;
std::vector<std::wstring> m_stringsVec; std::vector<std::string> m_stringsVec;
std::vector<uint8_t> src; std::vector<uint8_t> src;
@ -60,12 +60,12 @@ public:
void getData(std::uint8_t** ppData, unsigned int* pSize); void getData(std::uint8_t** ppData, unsigned int* pSize);
const wchar_t* getString(const std::wstring& id); const char* getString(const std::string& id);
const wchar_t* getString(int id); const char* getString(int id);
// static const wchar_t* m_wchLocaleCode[LOCALE_COUNT]; // static const char* m_wchLocaleCode[LOCALE_COUNT];
private: private:
// std::wstring getLangId(uint32_t dwLanguage=0); // std::string getLangId(uint32_t dwLanguage=0);
void ProcessStringTableData(void); void ProcessStringTableData(void);
}; };

View file

@ -75,7 +75,7 @@ void LocalizationManager::loadStringTable(ArchiveFile* mediaArchive) {
// we need to unload the current std::string table, this is a reload // we need to unload the current std::string table, this is a reload
delete m_stringTable; delete m_stringTable;
} }
std::wstring localisationFile = L"languages.loc"; std::string localisationFile = "languages.loc";
if (mediaArchive->hasFile(localisationFile)) { if (mediaArchive->hasFile(localisationFile)) {
std::vector<uint8_t> locFile = std::vector<uint8_t> locFile =
mediaArchive->getFile(localisationFile); mediaArchive->getFile(localisationFile);
@ -87,7 +87,7 @@ void LocalizationManager::loadStringTable(ArchiveFile* mediaArchive) {
} }
} }
const wchar_t* LocalizationManager::getString(int iID) const { const char* LocalizationManager::getString(int iID) const {
return m_stringTable->getString(iID); return m_stringTable->getString(iID);
} }
@ -183,154 +183,154 @@ int LocalizationManager::getHTMLFontSize(EHTMLFontSize size) {
return s_iHTMLFontSizesA[size]; return s_iHTMLFontSizesA[size];
} }
std::wstring LocalizationManager::formatHTMLString( std::string LocalizationManager::formatHTMLString(
int iPad, const std::wstring& desc, int shadowColour /*= 0xFFFFFFFF*/) { int iPad, const std::string& desc, int shadowColour /*= 0xFFFFFFFF*/) {
std::wstring text(desc); std::string text(desc);
wchar_t replacements[64]; char replacements[64];
text = replaceAll(text, L"{*B*}", L"<br />"); text = replaceAll(text, "{*B*}", "<br />");
swprintf(replacements, 64, L"<font color=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\">",
getHTMLColour(eHTMLColor_T1)); getHTMLColour(eHTMLColor_T1));
text = replaceAll(text, L"{*T1*}", replacements); text = replaceAll(text, "{*T1*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\">",
getHTMLColour(eHTMLColor_T2)); getHTMLColour(eHTMLColor_T2));
text = replaceAll(text, L"{*T2*}", replacements); text = replaceAll(text, "{*T2*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\">",
getHTMLColour(eHTMLColor_T3)); getHTMLColour(eHTMLColor_T3));
text = replaceAll(text, L"{*T3*}", replacements); text = replaceAll(text, "{*T3*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\">",
getHTMLColour(eHTMLColor_Black)); getHTMLColour(eHTMLColor_Black));
text = replaceAll(text, L"{*ETB*}", replacements); text = replaceAll(text, "{*ETB*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\">",
getHTMLColour(eHTMLColor_White)); getHTMLColour(eHTMLColor_White));
text = replaceAll(text, L"{*ETW*}", replacements); text = replaceAll(text, "{*ETW*}", replacements);
text = replaceAll(text, L"{*EF*}", L"</font>"); text = replaceAll(text, "{*EF*}", "</font>");
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_0), shadowColour); getHTMLColour(eHTMLColor_0), shadowColour);
text = replaceAll(text, L"{*C0*}", replacements); text = replaceAll(text, "{*C0*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_1), shadowColour); getHTMLColour(eHTMLColor_1), shadowColour);
text = replaceAll(text, L"{*C1*}", replacements); text = replaceAll(text, "{*C1*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_2), shadowColour); getHTMLColour(eHTMLColor_2), shadowColour);
text = replaceAll(text, L"{*C2*}", replacements); text = replaceAll(text, "{*C2*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_3), shadowColour); getHTMLColour(eHTMLColor_3), shadowColour);
text = replaceAll(text, L"{*C3*}", replacements); text = replaceAll(text, "{*C3*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_4), shadowColour); getHTMLColour(eHTMLColor_4), shadowColour);
text = replaceAll(text, L"{*C4*}", replacements); text = replaceAll(text, "{*C4*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_5), shadowColour); getHTMLColour(eHTMLColor_5), shadowColour);
text = replaceAll(text, L"{*C5*}", replacements); text = replaceAll(text, "{*C5*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_6), shadowColour); getHTMLColour(eHTMLColor_6), shadowColour);
text = replaceAll(text, L"{*C6*}", replacements); text = replaceAll(text, "{*C6*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_7), shadowColour); getHTMLColour(eHTMLColor_7), shadowColour);
text = replaceAll(text, L"{*C7*}", replacements); text = replaceAll(text, "{*C7*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_8), shadowColour); getHTMLColour(eHTMLColor_8), shadowColour);
text = replaceAll(text, L"{*C8*}", replacements); text = replaceAll(text, "{*C8*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_9), shadowColour); getHTMLColour(eHTMLColor_9), shadowColour);
text = replaceAll(text, L"{*C9*}", replacements); text = replaceAll(text, "{*C9*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_a), shadowColour); getHTMLColour(eHTMLColor_a), shadowColour);
text = replaceAll(text, L"{*CA*}", replacements); text = replaceAll(text, "{*CA*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_b), shadowColour); getHTMLColour(eHTMLColor_b), shadowColour);
text = replaceAll(text, L"{*CB*}", replacements); text = replaceAll(text, "{*CB*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_c), shadowColour); getHTMLColour(eHTMLColor_c), shadowColour);
text = replaceAll(text, L"{*CC*}", replacements); text = replaceAll(text, "{*CC*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_d), shadowColour); getHTMLColour(eHTMLColor_d), shadowColour);
text = replaceAll(text, L"{*CD*}", replacements); text = replaceAll(text, "{*CD*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_e), shadowColour); getHTMLColour(eHTMLColor_e), shadowColour);
text = replaceAll(text, L"{*CE*}", replacements); text = replaceAll(text, "{*CE*}", replacements);
swprintf(replacements, 64, L"<font color=\"#%08x\" shadowcolor=\"#%08x\">", snprintf(replacements, 64, "<font color=\"#%08x\" shadowcolor=\"#%08x\">",
getHTMLColour(eHTMLColor_f), shadowColour); getHTMLColour(eHTMLColor_f), shadowColour);
text = replaceAll(text, L"{*CF*}", replacements); text = replaceAll(text, "{*CF*}", replacements);
// Swap for southpaw. // Swap for southpaw.
if (app.GetGameSettings(iPad, eGameSetting_ControlSouthPaw)) { if (app.GetGameSettings(iPad, eGameSetting_ControlSouthPaw)) {
text = text =
replaceAll(text, L"{*CONTROLLER_ACTION_MOVE*}", replaceAll(text, "{*CONTROLLER_ACTION_MOVE*}",
getActionReplacement(iPad, MINECRAFT_ACTION_LOOK_RIGHT)); getActionReplacement(iPad, MINECRAFT_ACTION_LOOK_RIGHT));
text = replaceAll(text, L"{*CONTROLLER_ACTION_LOOK*}", text = replaceAll(text, "{*CONTROLLER_ACTION_LOOK*}",
getActionReplacement(iPad, MINECRAFT_ACTION_RIGHT)); getActionReplacement(iPad, MINECRAFT_ACTION_RIGHT));
text = replaceAll(text, L"{*CONTROLLER_MENU_NAVIGATE*}", text = replaceAll(text, "{*CONTROLLER_MENU_NAVIGATE*}",
getVKReplacement(VK_PAD_RTHUMB_LEFT)); getVKReplacement(VK_PAD_RTHUMB_LEFT));
} else { } else {
text = replaceAll(text, L"{*CONTROLLER_ACTION_MOVE*}", text = replaceAll(text, "{*CONTROLLER_ACTION_MOVE*}",
getActionReplacement(iPad, MINECRAFT_ACTION_RIGHT)); getActionReplacement(iPad, MINECRAFT_ACTION_RIGHT));
text = text =
replaceAll(text, L"{*CONTROLLER_ACTION_LOOK*}", replaceAll(text, "{*CONTROLLER_ACTION_LOOK*}",
getActionReplacement(iPad, MINECRAFT_ACTION_LOOK_RIGHT)); getActionReplacement(iPad, MINECRAFT_ACTION_LOOK_RIGHT));
text = replaceAll(text, L"{*CONTROLLER_MENU_NAVIGATE*}", text = replaceAll(text, "{*CONTROLLER_MENU_NAVIGATE*}",
getVKReplacement(VK_PAD_LTHUMB_LEFT)); getVKReplacement(VK_PAD_LTHUMB_LEFT));
} }
text = replaceAll(text, L"{*CONTROLLER_ACTION_JUMP*}", text = replaceAll(text, "{*CONTROLLER_ACTION_JUMP*}",
getActionReplacement(iPad, MINECRAFT_ACTION_JUMP)); getActionReplacement(iPad, MINECRAFT_ACTION_JUMP));
text = text =
replaceAll(text, L"{*CONTROLLER_ACTION_SNEAK*}", replaceAll(text, "{*CONTROLLER_ACTION_SNEAK*}",
getActionReplacement(iPad, MINECRAFT_ACTION_SNEAK_TOGGLE)); getActionReplacement(iPad, MINECRAFT_ACTION_SNEAK_TOGGLE));
text = replaceAll(text, L"{*CONTROLLER_ACTION_USE*}", text = replaceAll(text, "{*CONTROLLER_ACTION_USE*}",
getActionReplacement(iPad, MINECRAFT_ACTION_USE)); getActionReplacement(iPad, MINECRAFT_ACTION_USE));
text = replaceAll(text, L"{*CONTROLLER_ACTION_ACTION*}", text = replaceAll(text, "{*CONTROLLER_ACTION_ACTION*}",
getActionReplacement(iPad, MINECRAFT_ACTION_ACTION)); getActionReplacement(iPad, MINECRAFT_ACTION_ACTION));
text = replaceAll(text, L"{*CONTROLLER_ACTION_LEFT_SCROLL*}", text = replaceAll(text, "{*CONTROLLER_ACTION_LEFT_SCROLL*}",
getActionReplacement(iPad, MINECRAFT_ACTION_LEFT_SCROLL)); getActionReplacement(iPad, MINECRAFT_ACTION_LEFT_SCROLL));
text = text =
replaceAll(text, L"{*CONTROLLER_ACTION_RIGHT_SCROLL*}", replaceAll(text, "{*CONTROLLER_ACTION_RIGHT_SCROLL*}",
getActionReplacement(iPad, MINECRAFT_ACTION_RIGHT_SCROLL)); getActionReplacement(iPad, MINECRAFT_ACTION_RIGHT_SCROLL));
text = replaceAll(text, L"{*CONTROLLER_ACTION_INVENTORY*}", text = replaceAll(text, "{*CONTROLLER_ACTION_INVENTORY*}",
getActionReplacement(iPad, MINECRAFT_ACTION_INVENTORY)); getActionReplacement(iPad, MINECRAFT_ACTION_INVENTORY));
text = replaceAll(text, L"{*CONTROLLER_ACTION_CRAFTING*}", text = replaceAll(text, "{*CONTROLLER_ACTION_CRAFTING*}",
getActionReplacement(iPad, MINECRAFT_ACTION_CRAFTING)); getActionReplacement(iPad, MINECRAFT_ACTION_CRAFTING));
text = replaceAll(text, L"{*CONTROLLER_ACTION_DROP*}", text = replaceAll(text, "{*CONTROLLER_ACTION_DROP*}",
getActionReplacement(iPad, MINECRAFT_ACTION_DROP)); getActionReplacement(iPad, MINECRAFT_ACTION_DROP));
text = replaceAll( text = replaceAll(
text, L"{*CONTROLLER_ACTION_CAMERA*}", text, "{*CONTROLLER_ACTION_CAMERA*}",
getActionReplacement(iPad, MINECRAFT_ACTION_RENDER_THIRD_PERSON)); getActionReplacement(iPad, MINECRAFT_ACTION_RENDER_THIRD_PERSON));
text = replaceAll(text, L"{*CONTROLLER_ACTION_MENU_PAGEDOWN*}", text = replaceAll(text, "{*CONTROLLER_ACTION_MENU_PAGEDOWN*}",
getActionReplacement(iPad, ACTION_MENU_PAGEDOWN)); getActionReplacement(iPad, ACTION_MENU_PAGEDOWN));
text = text =
replaceAll(text, L"{*CONTROLLER_ACTION_DISMOUNT*}", replaceAll(text, "{*CONTROLLER_ACTION_DISMOUNT*}",
getActionReplacement(iPad, MINECRAFT_ACTION_SNEAK_TOGGLE)); getActionReplacement(iPad, MINECRAFT_ACTION_SNEAK_TOGGLE));
text = replaceAll(text, L"{*CONTROLLER_VK_A*}", getVKReplacement(VK_PAD_A)); text = replaceAll(text, "{*CONTROLLER_VK_A*}", getVKReplacement(VK_PAD_A));
text = replaceAll(text, L"{*CONTROLLER_VK_B*}", getVKReplacement(VK_PAD_B)); text = replaceAll(text, "{*CONTROLLER_VK_B*}", getVKReplacement(VK_PAD_B));
text = replaceAll(text, L"{*CONTROLLER_VK_X*}", getVKReplacement(VK_PAD_X)); text = replaceAll(text, "{*CONTROLLER_VK_X*}", getVKReplacement(VK_PAD_X));
text = replaceAll(text, L"{*CONTROLLER_VK_Y*}", getVKReplacement(VK_PAD_Y)); text = replaceAll(text, "{*CONTROLLER_VK_Y*}", getVKReplacement(VK_PAD_Y));
text = replaceAll(text, L"{*CONTROLLER_VK_LB*}", text = replaceAll(text, "{*CONTROLLER_VK_LB*}",
getVKReplacement(VK_PAD_LSHOULDER)); getVKReplacement(VK_PAD_LSHOULDER));
text = replaceAll(text, L"{*CONTROLLER_VK_RB*}", text = replaceAll(text, "{*CONTROLLER_VK_RB*}",
getVKReplacement(VK_PAD_RSHOULDER)); getVKReplacement(VK_PAD_RSHOULDER));
text = replaceAll(text, L"{*CONTROLLER_VK_LS*}", text = replaceAll(text, "{*CONTROLLER_VK_LS*}",
getVKReplacement(VK_PAD_LTHUMB_UP)); getVKReplacement(VK_PAD_LTHUMB_UP));
text = replaceAll(text, L"{*CONTROLLER_VK_RS*}", text = replaceAll(text, "{*CONTROLLER_VK_RS*}",
getVKReplacement(VK_PAD_RTHUMB_UP)); getVKReplacement(VK_PAD_RTHUMB_UP));
text = replaceAll(text, L"{*CONTROLLER_VK_LT*}", text = replaceAll(text, "{*CONTROLLER_VK_LT*}",
getVKReplacement(VK_PAD_LTRIGGER)); getVKReplacement(VK_PAD_LTRIGGER));
text = replaceAll(text, L"{*CONTROLLER_VK_RT*}", text = replaceAll(text, "{*CONTROLLER_VK_RT*}",
getVKReplacement(VK_PAD_RTRIGGER)); getVKReplacement(VK_PAD_RTRIGGER));
text = replaceAll(text, L"{*ICON_SHANK_01*}", text = replaceAll(text, "{*ICON_SHANK_01*}",
getIconReplacement(XZP_ICON_SHANK_01)); getIconReplacement(XZP_ICON_SHANK_01));
text = replaceAll(text, L"{*ICON_SHANK_03*}", text = replaceAll(text, "{*ICON_SHANK_03*}",
getIconReplacement(XZP_ICON_SHANK_03)); getIconReplacement(XZP_ICON_SHANK_03));
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_UP*}", text = replaceAll(text, "{*CONTROLLER_ACTION_DPAD_UP*}",
getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_UP)); getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_UP));
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_DOWN*}", text = replaceAll(text, "{*CONTROLLER_ACTION_DPAD_DOWN*}",
getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_DOWN)); getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_DOWN));
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", text = replaceAll(text, "{*CONTROLLER_ACTION_DPAD_RIGHT*}",
getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_RIGHT)); getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_RIGHT));
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_LEFT*}", text = replaceAll(text, "{*CONTROLLER_ACTION_DPAD_LEFT*}",
getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_LEFT)); getActionReplacement(iPad, MINECRAFT_ACTION_DPAD_LEFT));
std::uint32_t dwLanguage = XGetLanguage(); std::uint32_t dwLanguage = XGetLanguage();
@ -338,64 +338,64 @@ std::wstring LocalizationManager::formatHTMLString(
case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_KOREAN:
case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_JAPANESE:
case XC_LANGUAGE_TCHINESE: case XC_LANGUAGE_TCHINESE:
text = replaceAll(text, L"&nbsp;", L""); text = replaceAll(text, "&nbsp;", "");
break; break;
} }
return text; return text;
} }
std::wstring LocalizationManager::getActionReplacement( std::string LocalizationManager::getActionReplacement(
int iPad, unsigned char ucAction) { int iPad, unsigned char ucAction) {
unsigned int input = PlatformInput.GetGameJoypadMaps( unsigned int input = PlatformInput.GetGameJoypadMaps(
PlatformInput.GetJoypadMapVal(iPad), ucAction); PlatformInput.GetJoypadMapVal(iPad), ucAction);
std::wstring replacement = L""; std::string replacement = "";
if (input & _360_JOY_BUTTON_A) if (input & _360_JOY_BUTTON_A)
replacement = L"ButtonA"; replacement = "ButtonA";
else if (input & _360_JOY_BUTTON_B) else if (input & _360_JOY_BUTTON_B)
replacement = L"ButtonB"; replacement = "ButtonB";
else if (input & _360_JOY_BUTTON_X) else if (input & _360_JOY_BUTTON_X)
replacement = L"ButtonX"; replacement = "ButtonX";
else if (input & _360_JOY_BUTTON_Y) else if (input & _360_JOY_BUTTON_Y)
replacement = L"ButtonY"; replacement = "ButtonY";
else if ((input & _360_JOY_BUTTON_LSTICK_UP) || else if ((input & _360_JOY_BUTTON_LSTICK_UP) ||
(input & _360_JOY_BUTTON_LSTICK_DOWN) || (input & _360_JOY_BUTTON_LSTICK_DOWN) ||
(input & _360_JOY_BUTTON_LSTICK_LEFT) || (input & _360_JOY_BUTTON_LSTICK_LEFT) ||
(input & _360_JOY_BUTTON_LSTICK_RIGHT)) { (input & _360_JOY_BUTTON_LSTICK_RIGHT)) {
replacement = L"ButtonLeftStick"; replacement = "ButtonLeftStick";
} else if ((input & _360_JOY_BUTTON_RSTICK_LEFT) || } else if ((input & _360_JOY_BUTTON_RSTICK_LEFT) ||
(input & _360_JOY_BUTTON_RSTICK_RIGHT) || (input & _360_JOY_BUTTON_RSTICK_RIGHT) ||
(input & _360_JOY_BUTTON_RSTICK_UP) || (input & _360_JOY_BUTTON_RSTICK_UP) ||
(input & _360_JOY_BUTTON_RSTICK_DOWN)) { (input & _360_JOY_BUTTON_RSTICK_DOWN)) {
replacement = L"ButtonRightStick"; replacement = "ButtonRightStick";
} else if (input & _360_JOY_BUTTON_DPAD_LEFT) } else if (input & _360_JOY_BUTTON_DPAD_LEFT)
replacement = L"ButtonDpadL"; replacement = "ButtonDpadL";
else if (input & _360_JOY_BUTTON_DPAD_RIGHT) else if (input & _360_JOY_BUTTON_DPAD_RIGHT)
replacement = L"ButtonDpadR"; replacement = "ButtonDpadR";
else if (input & _360_JOY_BUTTON_DPAD_UP) else if (input & _360_JOY_BUTTON_DPAD_UP)
replacement = L"ButtonDpadU"; replacement = "ButtonDpadU";
else if (input & _360_JOY_BUTTON_DPAD_DOWN) else if (input & _360_JOY_BUTTON_DPAD_DOWN)
replacement = L"ButtonDpadD"; replacement = "ButtonDpadD";
else if (input & _360_JOY_BUTTON_LT) else if (input & _360_JOY_BUTTON_LT)
replacement = L"ButtonLeftTrigger"; replacement = "ButtonLeftTrigger";
else if (input & _360_JOY_BUTTON_RT) else if (input & _360_JOY_BUTTON_RT)
replacement = L"ButtonRightTrigger"; replacement = "ButtonRightTrigger";
else if (input & _360_JOY_BUTTON_RB) else if (input & _360_JOY_BUTTON_RB)
replacement = L"ButtonRightBumper"; replacement = "ButtonRightBumper";
else if (input & _360_JOY_BUTTON_LB) else if (input & _360_JOY_BUTTON_LB)
replacement = L"ButtonLeftBumper"; replacement = "ButtonLeftBumper";
else if (input & _360_JOY_BUTTON_BACK) else if (input & _360_JOY_BUTTON_BACK)
replacement = L"ButtonBack"; replacement = "ButtonBack";
else if (input & _360_JOY_BUTTON_START) else if (input & _360_JOY_BUTTON_START)
replacement = L"ButtonStart"; replacement = "ButtonStart";
else if (input & _360_JOY_BUTTON_RTHUMB) else if (input & _360_JOY_BUTTON_RTHUMB)
replacement = L"ButtonRS"; replacement = "ButtonRS";
else if (input & _360_JOY_BUTTON_LTHUMB) else if (input & _360_JOY_BUTTON_LTHUMB)
replacement = L"ButtonLS"; replacement = "ButtonLS";
wchar_t string[128]; char string[128];
#if defined(_WIN64) #if defined(_WIN64)
int size = 45; int size = 45;
@ -404,39 +404,39 @@ std::wstring LocalizationManager::getActionReplacement(
int size = 45; int size = 45;
#endif #endif
swprintf(string, 128, snprintf(string, 128,
L"<img src=\"%ls\" align=\"middle\" height=\"%d\" width=\"%d\"/>", "<img src=\"%s\" align=\"middle\" height=\"%d\" width=\"%d\"/>",
replacement.c_str(), size, size); replacement.c_str(), size, size);
return string; return string;
} }
std::wstring LocalizationManager::getVKReplacement(unsigned int uiVKey) { std::string LocalizationManager::getVKReplacement(unsigned int uiVKey) {
std::wstring replacement = L""; std::string replacement = "";
switch (uiVKey) { switch (uiVKey) {
case VK_PAD_A: case VK_PAD_A:
replacement = L"ButtonA"; replacement = "ButtonA";
break; break;
case VK_PAD_B: case VK_PAD_B:
replacement = L"ButtonB"; replacement = "ButtonB";
break; break;
case VK_PAD_X: case VK_PAD_X:
replacement = L"ButtonX"; replacement = "ButtonX";
break; break;
case VK_PAD_Y: case VK_PAD_Y:
replacement = L"ButtonY"; replacement = "ButtonY";
break; break;
case VK_PAD_LSHOULDER: case VK_PAD_LSHOULDER:
replacement = L"ButtonLeftBumper"; replacement = "ButtonLeftBumper";
break; break;
case VK_PAD_RSHOULDER: case VK_PAD_RSHOULDER:
replacement = L"ButtonRightBumper"; replacement = "ButtonRightBumper";
break; break;
case VK_PAD_LTRIGGER: case VK_PAD_LTRIGGER:
replacement = L"ButtonLeftTrigger"; replacement = "ButtonLeftTrigger";
break; break;
case VK_PAD_RTRIGGER: case VK_PAD_RTRIGGER:
replacement = L"ButtonRightTrigger"; replacement = "ButtonRightTrigger";
break; break;
case VK_PAD_LTHUMB_UP: case VK_PAD_LTHUMB_UP:
case VK_PAD_LTHUMB_DOWN: case VK_PAD_LTHUMB_DOWN:
@ -446,7 +446,7 @@ std::wstring LocalizationManager::getVKReplacement(unsigned int uiVKey) {
case VK_PAD_LTHUMB_UPRIGHT: case VK_PAD_LTHUMB_UPRIGHT:
case VK_PAD_LTHUMB_DOWNRIGHT: case VK_PAD_LTHUMB_DOWNRIGHT:
case VK_PAD_LTHUMB_DOWNLEFT: case VK_PAD_LTHUMB_DOWNLEFT:
replacement = L"ButtonLeftStick"; replacement = "ButtonLeftStick";
break; break;
case VK_PAD_RTHUMB_UP: case VK_PAD_RTHUMB_UP:
case VK_PAD_RTHUMB_DOWN: case VK_PAD_RTHUMB_DOWN:
@ -456,12 +456,12 @@ std::wstring LocalizationManager::getVKReplacement(unsigned int uiVKey) {
case VK_PAD_RTHUMB_UPRIGHT: case VK_PAD_RTHUMB_UPRIGHT:
case VK_PAD_RTHUMB_DOWNRIGHT: case VK_PAD_RTHUMB_DOWNRIGHT:
case VK_PAD_RTHUMB_DOWNLEFT: case VK_PAD_RTHUMB_DOWNLEFT:
replacement = L"ButtonRightStick"; replacement = "ButtonRightStick";
break; break;
default: default:
break; break;
} }
wchar_t string[128]; char string[128];
#if defined(_WIN64) #if defined(_WIN64)
int size = 45; int size = 45;
@ -470,15 +470,15 @@ std::wstring LocalizationManager::getVKReplacement(unsigned int uiVKey) {
int size = 45; int size = 45;
#endif #endif
swprintf(string, 128, snprintf(string, 128,
L"<img src=\"%ls\" align=\"middle\" height=\"%d\" width=\"%d\"/>", "<img src=\"%s\" align=\"middle\" height=\"%d\" width=\"%d\"/>",
replacement.c_str(), size, size); replacement.c_str(), size, size);
return string; return string;
} }
std::wstring LocalizationManager::getIconReplacement(unsigned int uiIcon) { std::string LocalizationManager::getIconReplacement(unsigned int uiIcon) {
wchar_t string[128]; char string[128];
#if defined(_WIN64) #if defined(_WIN64)
int size = 33; int size = 33;
@ -487,11 +487,11 @@ std::wstring LocalizationManager::getIconReplacement(unsigned int uiIcon) {
int size = 33; int size = 33;
#endif #endif
swprintf(string, 128, snprintf(string, 128,
L"<img src=\"Icon_Shank\" align=\"middle\" height=\"%d\" " "<img src=\"Icon_Shank\" align=\"middle\" height=\"%d\" "
L"width=\"%d\"/>", "width=\"%d\"/>",
size, size); size, size);
std::wstring result = L""; std::string result = "";
switch (uiIcon) { switch (uiIcon) {
case XZP_ICON_SHANK_01: case XZP_ICON_SHANK_01:
result = string; result = string;
@ -506,7 +506,7 @@ std::wstring LocalizationManager::getIconReplacement(unsigned int uiIcon) {
} }
void LocalizationManager::getLocale( void LocalizationManager::getLocale(
std::vector<std::wstring>& vecWstrLocales) { std::vector<std::string>& vecWstrLocales) {
std::vector<eMCLang> locales; std::vector<eMCLang> locales;
const unsigned int systemLanguage = XGetLanguage(); const unsigned int systemLanguage = XGetLanguage();
@ -662,201 +662,201 @@ void LocalizationManager::getLocale(
} }
} }
int LocalizationManager::get_eMCLang(wchar_t* pwchLocale) { int LocalizationManager::get_eMCLang(char* pwchLocale) {
return m_eMCLangA[pwchLocale]; return m_eMCLangA[pwchLocale];
} }
int LocalizationManager::get_xcLang(wchar_t* pwchLocale) { int LocalizationManager::get_xcLang(char* pwchLocale) {
return m_xcLangA[pwchLocale]; return m_xcLangA[pwchLocale];
} }
void LocalizationManager::localeAndLanguageInit() { void LocalizationManager::localeAndLanguageInit() {
m_localeA[eMCLang_zhCHT] = L"zh-CHT"; m_localeA[eMCLang_zhCHT] = "zh-CHT";
m_localeA[eMCLang_csCS] = L"cs-CS"; m_localeA[eMCLang_csCS] = "cs-CS";
m_localeA[eMCLang_laLAS] = L"la-LAS"; m_localeA[eMCLang_laLAS] = "la-LAS";
m_localeA[eMCLang_null] = L"en-EN"; m_localeA[eMCLang_null] = "en-EN";
m_localeA[eMCLang_enUS] = L"en-US"; m_localeA[eMCLang_enUS] = "en-US";
m_localeA[eMCLang_enGB] = L"en-GB"; m_localeA[eMCLang_enGB] = "en-GB";
m_localeA[eMCLang_enIE] = L"en-IE"; m_localeA[eMCLang_enIE] = "en-IE";
m_localeA[eMCLang_enAU] = L"en-AU"; m_localeA[eMCLang_enAU] = "en-AU";
m_localeA[eMCLang_enNZ] = L"en-NZ"; m_localeA[eMCLang_enNZ] = "en-NZ";
m_localeA[eMCLang_enCA] = L"en-CA"; m_localeA[eMCLang_enCA] = "en-CA";
m_localeA[eMCLang_jaJP] = L"ja-JP"; m_localeA[eMCLang_jaJP] = "ja-JP";
m_localeA[eMCLang_deDE] = L"de-DE"; m_localeA[eMCLang_deDE] = "de-DE";
m_localeA[eMCLang_deAT] = L"de-AT"; m_localeA[eMCLang_deAT] = "de-AT";
m_localeA[eMCLang_frFR] = L"fr-FR"; m_localeA[eMCLang_frFR] = "fr-FR";
m_localeA[eMCLang_frCA] = L"fr-CA"; m_localeA[eMCLang_frCA] = "fr-CA";
m_localeA[eMCLang_esES] = L"es-ES"; m_localeA[eMCLang_esES] = "es-ES";
m_localeA[eMCLang_esMX] = L"es-MX"; m_localeA[eMCLang_esMX] = "es-MX";
m_localeA[eMCLang_itIT] = L"it-IT"; m_localeA[eMCLang_itIT] = "it-IT";
m_localeA[eMCLang_koKR] = L"ko-KR"; m_localeA[eMCLang_koKR] = "ko-KR";
m_localeA[eMCLang_ptPT] = L"pt-PT"; m_localeA[eMCLang_ptPT] = "pt-PT";
m_localeA[eMCLang_ptBR] = L"pt-BR"; m_localeA[eMCLang_ptBR] = "pt-BR";
m_localeA[eMCLang_ruRU] = L"ru-RU"; m_localeA[eMCLang_ruRU] = "ru-RU";
m_localeA[eMCLang_nlNL] = L"nl-NL"; m_localeA[eMCLang_nlNL] = "nl-NL";
m_localeA[eMCLang_fiFI] = L"fi-FI"; m_localeA[eMCLang_fiFI] = "fi-FI";
m_localeA[eMCLang_svSV] = L"sv-SV"; m_localeA[eMCLang_svSV] = "sv-SV";
m_localeA[eMCLang_daDA] = L"da-DA"; m_localeA[eMCLang_daDA] = "da-DA";
m_localeA[eMCLang_noNO] = L"no-NO"; m_localeA[eMCLang_noNO] = "no-NO";
m_localeA[eMCLang_plPL] = L"pl-PL"; m_localeA[eMCLang_plPL] = "pl-PL";
m_localeA[eMCLang_trTR] = L"tr-TR"; m_localeA[eMCLang_trTR] = "tr-TR";
m_localeA[eMCLang_elEL] = L"el-EL"; m_localeA[eMCLang_elEL] = "el-EL";
m_localeA[eMCLang_zhSG] = L"zh-SG"; m_localeA[eMCLang_zhSG] = "zh-SG";
m_localeA[eMCLang_zhCN] = L"zh-CN"; m_localeA[eMCLang_zhCN] = "zh-CN";
m_localeA[eMCLang_zhHK] = L"zh-HK"; m_localeA[eMCLang_zhHK] = "zh-HK";
m_localeA[eMCLang_zhTW] = L"zh-TW"; m_localeA[eMCLang_zhTW] = "zh-TW";
m_localeA[eMCLang_nlBE] = L"nl-BE"; m_localeA[eMCLang_nlBE] = "nl-BE";
m_localeA[eMCLang_daDK] = L"da-DK"; m_localeA[eMCLang_daDK] = "da-DK";
m_localeA[eMCLang_frBE] = L"fr-BE"; m_localeA[eMCLang_frBE] = "fr-BE";
m_localeA[eMCLang_frCH] = L"fr-CH"; m_localeA[eMCLang_frCH] = "fr-CH";
m_localeA[eMCLang_deCH] = L"de-CH"; m_localeA[eMCLang_deCH] = "de-CH";
m_localeA[eMCLang_nbNO] = L"nb-NO"; m_localeA[eMCLang_nbNO] = "nb-NO";
m_localeA[eMCLang_enGR] = L"en-GR"; m_localeA[eMCLang_enGR] = "en-GR";
m_localeA[eMCLang_enHK] = L"en-HK"; m_localeA[eMCLang_enHK] = "en-HK";
m_localeA[eMCLang_enSA] = L"en-SA"; m_localeA[eMCLang_enSA] = "en-SA";
m_localeA[eMCLang_enHU] = L"en-HU"; m_localeA[eMCLang_enHU] = "en-HU";
m_localeA[eMCLang_enIN] = L"en-IN"; m_localeA[eMCLang_enIN] = "en-IN";
m_localeA[eMCLang_enIL] = L"en-IL"; m_localeA[eMCLang_enIL] = "en-IL";
m_localeA[eMCLang_enSG] = L"en-SG"; m_localeA[eMCLang_enSG] = "en-SG";
m_localeA[eMCLang_enSK] = L"en-SK"; m_localeA[eMCLang_enSK] = "en-SK";
m_localeA[eMCLang_enZA] = L"en-ZA"; m_localeA[eMCLang_enZA] = "en-ZA";
m_localeA[eMCLang_enCZ] = L"en-CZ"; m_localeA[eMCLang_enCZ] = "en-CZ";
m_localeA[eMCLang_enAE] = L"en-AE"; m_localeA[eMCLang_enAE] = "en-AE";
m_localeA[eMCLang_esAR] = L"es-AR"; m_localeA[eMCLang_esAR] = "es-AR";
m_localeA[eMCLang_esCL] = L"es-CL"; m_localeA[eMCLang_esCL] = "es-CL";
m_localeA[eMCLang_esCO] = L"es-CO"; m_localeA[eMCLang_esCO] = "es-CO";
m_localeA[eMCLang_esUS] = L"es-US"; m_localeA[eMCLang_esUS] = "es-US";
m_localeA[eMCLang_svSE] = L"sv-SE"; m_localeA[eMCLang_svSE] = "sv-SE";
m_localeA[eMCLang_csCZ] = L"cs-CZ"; m_localeA[eMCLang_csCZ] = "cs-CZ";
m_localeA[eMCLang_elGR] = L"el-GR"; m_localeA[eMCLang_elGR] = "el-GR";
m_localeA[eMCLang_nnNO] = L"nn-NO"; m_localeA[eMCLang_nnNO] = "nn-NO";
m_localeA[eMCLang_skSK] = L"sk-SK"; m_localeA[eMCLang_skSK] = "sk-SK";
m_localeA[eMCLang_hans] = L"zh-HANS"; m_localeA[eMCLang_hans] = "zh-HANS";
m_localeA[eMCLang_hant] = L"zh-HANT"; m_localeA[eMCLang_hant] = "zh-HANT";
m_eMCLangA[L"zh-CHT"] = eMCLang_zhCHT; m_eMCLangA["zh-CHT"] = eMCLang_zhCHT;
m_eMCLangA[L"cs-CS"] = eMCLang_csCS; m_eMCLangA["cs-CS"] = eMCLang_csCS;
m_eMCLangA[L"la-LAS"] = eMCLang_laLAS; m_eMCLangA["la-LAS"] = eMCLang_laLAS;
m_eMCLangA[L"en-EN"] = eMCLang_null; m_eMCLangA["en-EN"] = eMCLang_null;
m_eMCLangA[L"en-US"] = eMCLang_enUS; m_eMCLangA["en-US"] = eMCLang_enUS;
m_eMCLangA[L"en-GB"] = eMCLang_enGB; m_eMCLangA["en-GB"] = eMCLang_enGB;
m_eMCLangA[L"en-IE"] = eMCLang_enIE; m_eMCLangA["en-IE"] = eMCLang_enIE;
m_eMCLangA[L"en-AU"] = eMCLang_enAU; m_eMCLangA["en-AU"] = eMCLang_enAU;
m_eMCLangA[L"en-NZ"] = eMCLang_enNZ; m_eMCLangA["en-NZ"] = eMCLang_enNZ;
m_eMCLangA[L"en-CA"] = eMCLang_enCA; m_eMCLangA["en-CA"] = eMCLang_enCA;
m_eMCLangA[L"ja-JP"] = eMCLang_jaJP; m_eMCLangA["ja-JP"] = eMCLang_jaJP;
m_eMCLangA[L"de-DE"] = eMCLang_deDE; m_eMCLangA["de-DE"] = eMCLang_deDE;
m_eMCLangA[L"de-AT"] = eMCLang_deAT; m_eMCLangA["de-AT"] = eMCLang_deAT;
m_eMCLangA[L"fr-FR"] = eMCLang_frFR; m_eMCLangA["fr-FR"] = eMCLang_frFR;
m_eMCLangA[L"fr-CA"] = eMCLang_frCA; m_eMCLangA["fr-CA"] = eMCLang_frCA;
m_eMCLangA[L"es-ES"] = eMCLang_esES; m_eMCLangA["es-ES"] = eMCLang_esES;
m_eMCLangA[L"es-MX"] = eMCLang_esMX; m_eMCLangA["es-MX"] = eMCLang_esMX;
m_eMCLangA[L"it-IT"] = eMCLang_itIT; m_eMCLangA["it-IT"] = eMCLang_itIT;
m_eMCLangA[L"ko-KR"] = eMCLang_koKR; m_eMCLangA["ko-KR"] = eMCLang_koKR;
m_eMCLangA[L"pt-PT"] = eMCLang_ptPT; m_eMCLangA["pt-PT"] = eMCLang_ptPT;
m_eMCLangA[L"pt-BR"] = eMCLang_ptBR; m_eMCLangA["pt-BR"] = eMCLang_ptBR;
m_eMCLangA[L"ru-RU"] = eMCLang_ruRU; m_eMCLangA["ru-RU"] = eMCLang_ruRU;
m_eMCLangA[L"nl-NL"] = eMCLang_nlNL; m_eMCLangA["nl-NL"] = eMCLang_nlNL;
m_eMCLangA[L"fi-FI"] = eMCLang_fiFI; m_eMCLangA["fi-FI"] = eMCLang_fiFI;
m_eMCLangA[L"sv-SV"] = eMCLang_svSV; m_eMCLangA["sv-SV"] = eMCLang_svSV;
m_eMCLangA[L"da-DA"] = eMCLang_daDA; m_eMCLangA["da-DA"] = eMCLang_daDA;
m_eMCLangA[L"no-NO"] = eMCLang_noNO; m_eMCLangA["no-NO"] = eMCLang_noNO;
m_eMCLangA[L"pl-PL"] = eMCLang_plPL; m_eMCLangA["pl-PL"] = eMCLang_plPL;
m_eMCLangA[L"tr-TR"] = eMCLang_trTR; m_eMCLangA["tr-TR"] = eMCLang_trTR;
m_eMCLangA[L"el-EL"] = eMCLang_elEL; m_eMCLangA["el-EL"] = eMCLang_elEL;
m_eMCLangA[L"zh-SG"] = eMCLang_zhSG; m_eMCLangA["zh-SG"] = eMCLang_zhSG;
m_eMCLangA[L"zh-CN"] = eMCLang_zhCN; m_eMCLangA["zh-CN"] = eMCLang_zhCN;
m_eMCLangA[L"zh-HK"] = eMCLang_zhHK; m_eMCLangA["zh-HK"] = eMCLang_zhHK;
m_eMCLangA[L"zh-TW"] = eMCLang_zhTW; m_eMCLangA["zh-TW"] = eMCLang_zhTW;
m_eMCLangA[L"nl-BE"] = eMCLang_nlBE; m_eMCLangA["nl-BE"] = eMCLang_nlBE;
m_eMCLangA[L"da-DK"] = eMCLang_daDK; m_eMCLangA["da-DK"] = eMCLang_daDK;
m_eMCLangA[L"fr-BE"] = eMCLang_frBE; m_eMCLangA["fr-BE"] = eMCLang_frBE;
m_eMCLangA[L"fr-CH"] = eMCLang_frCH; m_eMCLangA["fr-CH"] = eMCLang_frCH;
m_eMCLangA[L"de-CH"] = eMCLang_deCH; m_eMCLangA["de-CH"] = eMCLang_deCH;
m_eMCLangA[L"nb-NO"] = eMCLang_nbNO; m_eMCLangA["nb-NO"] = eMCLang_nbNO;
m_eMCLangA[L"en-GR"] = eMCLang_enGR; m_eMCLangA["en-GR"] = eMCLang_enGR;
m_eMCLangA[L"en-HK"] = eMCLang_enHK; m_eMCLangA["en-HK"] = eMCLang_enHK;
m_eMCLangA[L"en-SA"] = eMCLang_enSA; m_eMCLangA["en-SA"] = eMCLang_enSA;
m_eMCLangA[L"en-HU"] = eMCLang_enHU; m_eMCLangA["en-HU"] = eMCLang_enHU;
m_eMCLangA[L"en-IN"] = eMCLang_enIN; m_eMCLangA["en-IN"] = eMCLang_enIN;
m_eMCLangA[L"en-IL"] = eMCLang_enIL; m_eMCLangA["en-IL"] = eMCLang_enIL;
m_eMCLangA[L"en-SG"] = eMCLang_enSG; m_eMCLangA["en-SG"] = eMCLang_enSG;
m_eMCLangA[L"en-SK"] = eMCLang_enSK; m_eMCLangA["en-SK"] = eMCLang_enSK;
m_eMCLangA[L"en-ZA"] = eMCLang_enZA; m_eMCLangA["en-ZA"] = eMCLang_enZA;
m_eMCLangA[L"en-CZ"] = eMCLang_enCZ; m_eMCLangA["en-CZ"] = eMCLang_enCZ;
m_eMCLangA[L"en-AE"] = eMCLang_enAE; m_eMCLangA["en-AE"] = eMCLang_enAE;
m_eMCLangA[L"es-AR"] = eMCLang_esAR; m_eMCLangA["es-AR"] = eMCLang_esAR;
m_eMCLangA[L"es-CL"] = eMCLang_esCL; m_eMCLangA["es-CL"] = eMCLang_esCL;
m_eMCLangA[L"es-CO"] = eMCLang_esCO; m_eMCLangA["es-CO"] = eMCLang_esCO;
m_eMCLangA[L"es-US"] = eMCLang_esUS; m_eMCLangA["es-US"] = eMCLang_esUS;
m_eMCLangA[L"sv-SE"] = eMCLang_svSE; m_eMCLangA["sv-SE"] = eMCLang_svSE;
m_eMCLangA[L"cs-CZ"] = eMCLang_csCZ; m_eMCLangA["cs-CZ"] = eMCLang_csCZ;
m_eMCLangA[L"el-GR"] = eMCLang_elGR; m_eMCLangA["el-GR"] = eMCLang_elGR;
m_eMCLangA[L"nn-NO"] = eMCLang_nnNO; m_eMCLangA["nn-NO"] = eMCLang_nnNO;
m_eMCLangA[L"sk-SK"] = eMCLang_skSK; m_eMCLangA["sk-SK"] = eMCLang_skSK;
m_eMCLangA[L"zh-HANS"] = eMCLang_hans; m_eMCLangA["zh-HANS"] = eMCLang_hans;
m_eMCLangA[L"zh-HANT"] = eMCLang_hant; m_eMCLangA["zh-HANT"] = eMCLang_hant;
m_xcLangA[L"zh-CHT"] = XC_LOCALE_CHINA; m_xcLangA["zh-CHT"] = XC_LOCALE_CHINA;
m_xcLangA[L"cs-CS"] = XC_LOCALE_CHINA; m_xcLangA["cs-CS"] = XC_LOCALE_CHINA;
m_xcLangA[L"en-EN"] = XC_LOCALE_UNITED_STATES; m_xcLangA["en-EN"] = XC_LOCALE_UNITED_STATES;
m_xcLangA[L"en-US"] = XC_LOCALE_UNITED_STATES; m_xcLangA["en-US"] = XC_LOCALE_UNITED_STATES;
m_xcLangA[L"en-GB"] = XC_LOCALE_GREAT_BRITAIN; m_xcLangA["en-GB"] = XC_LOCALE_GREAT_BRITAIN;
m_xcLangA[L"en-IE"] = XC_LOCALE_IRELAND; m_xcLangA["en-IE"] = XC_LOCALE_IRELAND;
m_xcLangA[L"en-AU"] = XC_LOCALE_AUSTRALIA; m_xcLangA["en-AU"] = XC_LOCALE_AUSTRALIA;
m_xcLangA[L"en-NZ"] = XC_LOCALE_NEW_ZEALAND; m_xcLangA["en-NZ"] = XC_LOCALE_NEW_ZEALAND;
m_xcLangA[L"en-CA"] = XC_LOCALE_CANADA; m_xcLangA["en-CA"] = XC_LOCALE_CANADA;
m_xcLangA[L"ja-JP"] = XC_LOCALE_JAPAN; m_xcLangA["ja-JP"] = XC_LOCALE_JAPAN;
m_xcLangA[L"de-DE"] = XC_LOCALE_GERMANY; m_xcLangA["de-DE"] = XC_LOCALE_GERMANY;
m_xcLangA[L"de-AT"] = XC_LOCALE_AUSTRIA; m_xcLangA["de-AT"] = XC_LOCALE_AUSTRIA;
m_xcLangA[L"fr-FR"] = XC_LOCALE_FRANCE; m_xcLangA["fr-FR"] = XC_LOCALE_FRANCE;
m_xcLangA[L"fr-CA"] = XC_LOCALE_CANADA; m_xcLangA["fr-CA"] = XC_LOCALE_CANADA;
m_xcLangA[L"es-ES"] = XC_LOCALE_SPAIN; m_xcLangA["es-ES"] = XC_LOCALE_SPAIN;
m_xcLangA[L"es-MX"] = XC_LOCALE_MEXICO; m_xcLangA["es-MX"] = XC_LOCALE_MEXICO;
m_xcLangA[L"it-IT"] = XC_LOCALE_ITALY; m_xcLangA["it-IT"] = XC_LOCALE_ITALY;
m_xcLangA[L"ko-KR"] = XC_LOCALE_KOREA; m_xcLangA["ko-KR"] = XC_LOCALE_KOREA;
m_xcLangA[L"pt-PT"] = XC_LOCALE_PORTUGAL; m_xcLangA["pt-PT"] = XC_LOCALE_PORTUGAL;
m_xcLangA[L"pt-BR"] = XC_LOCALE_BRAZIL; m_xcLangA["pt-BR"] = XC_LOCALE_BRAZIL;
m_xcLangA[L"ru-RU"] = XC_LOCALE_RUSSIAN_FEDERATION; m_xcLangA["ru-RU"] = XC_LOCALE_RUSSIAN_FEDERATION;
m_xcLangA[L"nl-NL"] = XC_LOCALE_NETHERLANDS; m_xcLangA["nl-NL"] = XC_LOCALE_NETHERLANDS;
m_xcLangA[L"fi-FI"] = XC_LOCALE_FINLAND; m_xcLangA["fi-FI"] = XC_LOCALE_FINLAND;
m_xcLangA[L"sv-SV"] = XC_LOCALE_SWEDEN; m_xcLangA["sv-SV"] = XC_LOCALE_SWEDEN;
m_xcLangA[L"da-DA"] = XC_LOCALE_DENMARK; m_xcLangA["da-DA"] = XC_LOCALE_DENMARK;
m_xcLangA[L"no-NO"] = XC_LOCALE_NORWAY; m_xcLangA["no-NO"] = XC_LOCALE_NORWAY;
m_xcLangA[L"pl-PL"] = XC_LOCALE_POLAND; m_xcLangA["pl-PL"] = XC_LOCALE_POLAND;
m_xcLangA[L"tr-TR"] = XC_LOCALE_TURKEY; m_xcLangA["tr-TR"] = XC_LOCALE_TURKEY;
m_xcLangA[L"el-EL"] = XC_LOCALE_GREECE; m_xcLangA["el-EL"] = XC_LOCALE_GREECE;
m_xcLangA[L"la-LAS"] = XC_LOCALE_LATIN_AMERICA; m_xcLangA["la-LAS"] = XC_LOCALE_LATIN_AMERICA;
m_xcLangA[L"zh-SG"] = XC_LOCALE_SINGAPORE; m_xcLangA["zh-SG"] = XC_LOCALE_SINGAPORE;
m_xcLangA[L"Zh-CN"] = XC_LOCALE_CHINA; m_xcLangA["Zh-CN"] = XC_LOCALE_CHINA;
m_xcLangA[L"zh-HK"] = XC_LOCALE_HONG_KONG; m_xcLangA["zh-HK"] = XC_LOCALE_HONG_KONG;
m_xcLangA[L"zh-TW"] = XC_LOCALE_TAIWAN; m_xcLangA["zh-TW"] = XC_LOCALE_TAIWAN;
m_xcLangA[L"nl-BE"] = XC_LOCALE_BELGIUM; m_xcLangA["nl-BE"] = XC_LOCALE_BELGIUM;
m_xcLangA[L"da-DK"] = XC_LOCALE_DENMARK; m_xcLangA["da-DK"] = XC_LOCALE_DENMARK;
m_xcLangA[L"fr-BE"] = XC_LOCALE_BELGIUM; m_xcLangA["fr-BE"] = XC_LOCALE_BELGIUM;
m_xcLangA[L"fr-CH"] = XC_LOCALE_SWITZERLAND; m_xcLangA["fr-CH"] = XC_LOCALE_SWITZERLAND;
m_xcLangA[L"de-CH"] = XC_LOCALE_SWITZERLAND; m_xcLangA["de-CH"] = XC_LOCALE_SWITZERLAND;
m_xcLangA[L"nb-NO"] = XC_LOCALE_NORWAY; m_xcLangA["nb-NO"] = XC_LOCALE_NORWAY;
m_xcLangA[L"en-GR"] = XC_LOCALE_GREECE; m_xcLangA["en-GR"] = XC_LOCALE_GREECE;
m_xcLangA[L"en-HK"] = XC_LOCALE_HONG_KONG; m_xcLangA["en-HK"] = XC_LOCALE_HONG_KONG;
m_xcLangA[L"en-SA"] = XC_LOCALE_SAUDI_ARABIA; m_xcLangA["en-SA"] = XC_LOCALE_SAUDI_ARABIA;
m_xcLangA[L"en-HU"] = XC_LOCALE_HUNGARY; m_xcLangA["en-HU"] = XC_LOCALE_HUNGARY;
m_xcLangA[L"en-IN"] = XC_LOCALE_INDIA; m_xcLangA["en-IN"] = XC_LOCALE_INDIA;
m_xcLangA[L"en-IL"] = XC_LOCALE_ISRAEL; m_xcLangA["en-IL"] = XC_LOCALE_ISRAEL;
m_xcLangA[L"en-SG"] = XC_LOCALE_SINGAPORE; m_xcLangA["en-SG"] = XC_LOCALE_SINGAPORE;
m_xcLangA[L"en-SK"] = XC_LOCALE_SLOVAK_REPUBLIC; m_xcLangA["en-SK"] = XC_LOCALE_SLOVAK_REPUBLIC;
m_xcLangA[L"en-ZA"] = XC_LOCALE_SOUTH_AFRICA; m_xcLangA["en-ZA"] = XC_LOCALE_SOUTH_AFRICA;
m_xcLangA[L"en-CZ"] = XC_LOCALE_CZECH_REPUBLIC; m_xcLangA["en-CZ"] = XC_LOCALE_CZECH_REPUBLIC;
m_xcLangA[L"en-AE"] = XC_LOCALE_UNITED_ARAB_EMIRATES; m_xcLangA["en-AE"] = XC_LOCALE_UNITED_ARAB_EMIRATES;
m_xcLangA[L"ja-IP"] = XC_LOCALE_JAPAN; m_xcLangA["ja-IP"] = XC_LOCALE_JAPAN;
m_xcLangA[L"es-AR"] = XC_LOCALE_ARGENTINA; m_xcLangA["es-AR"] = XC_LOCALE_ARGENTINA;
m_xcLangA[L"es-CL"] = XC_LOCALE_CHILE; m_xcLangA["es-CL"] = XC_LOCALE_CHILE;
m_xcLangA[L"es-CO"] = XC_LOCALE_COLOMBIA; m_xcLangA["es-CO"] = XC_LOCALE_COLOMBIA;
m_xcLangA[L"es-US"] = XC_LOCALE_UNITED_STATES; m_xcLangA["es-US"] = XC_LOCALE_UNITED_STATES;
m_xcLangA[L"sv-SE"] = XC_LOCALE_SWEDEN; m_xcLangA["sv-SE"] = XC_LOCALE_SWEDEN;
m_xcLangA[L"cs-CZ"] = XC_LOCALE_CZECH_REPUBLIC; m_xcLangA["cs-CZ"] = XC_LOCALE_CZECH_REPUBLIC;
m_xcLangA[L"el-GR"] = XC_LOCALE_GREECE; m_xcLangA["el-GR"] = XC_LOCALE_GREECE;
m_xcLangA[L"sk-SK"] = XC_LOCALE_SLOVAK_REPUBLIC; m_xcLangA["sk-SK"] = XC_LOCALE_SLOVAK_REPUBLIC;
m_xcLangA[L"zh-HANS"] = XC_LOCALE_CHINA; m_xcLangA["zh-HANS"] = XC_LOCALE_CHINA;
m_xcLangA[L"zh-HANT"] = XC_LOCALE_CHINA; m_xcLangA["zh-HANT"] = XC_LOCALE_CHINA;
} }

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