diff --git a/.gitignore b/.gitignore index 319dee2dc..451c76e8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/ + # ----- Build output directories ----- build/ builddir/ diff --git a/4J.Profile/4J_Profile.cpp b/4J.Profile/4J_Profile.cpp index 3776dec6d..33b88d143 100644 --- a/4J.Profile/4J_Profile.cpp +++ b/4J.Profile/4J_Profile.cpp @@ -51,7 +51,7 @@ void C_4JProfile::SetPrimaryPad(int iPad) {} static char s_gamertag[64] = "Player"; char* C_4JProfile::GetGamertag(int iPad) { return s_gamertag; } -wstring C_4JProfile::GetDisplayName(int iPad) { return L"Player"; } +std::wstring C_4JProfile::GetDisplayName(int iPad) { return L"Player"; } bool C_4JProfile::IsFullVersion() { return true; } void C_4JProfile::SetSignInChangeCallback(void(*Func)(LPVOID, bool, unsigned int), LPVOID lpParam) {} void C_4JProfile::SetNotificationsCallback(void(*Func)(LPVOID, DWORD, unsigned int), LPVOID lpParam) {} diff --git a/4J.Profile/4J_Profile.h b/4J.Profile/4J_Profile.h index f1bd85bbe..4e6fc606c 100644 --- a/4J.Profile/4J_Profile.h +++ b/4J.Profile/4J_Profile.h @@ -76,7 +76,7 @@ public: int GetPrimaryPad(); void SetPrimaryPad(int iPad); char* GetGamertag(int iPad); - wstring GetDisplayName(int iPad); + std::wstring GetDisplayName(int iPad); bool IsFullVersion(); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); diff --git a/4J.Storage/4J_Storage.h b/4J.Storage/4J_Storage.h index 7fa3f0745..aa1d74522 100644 --- a/4J.Storage/4J_Storage.h +++ b/4J.Storage/4J_Storage.h @@ -322,7 +322,7 @@ public: C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); - // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); + // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename); // unsigned int CRC(unsigned char *buf, int len); // enum eXBLWS diff --git a/Minecraft.Client/Build/Extrax64Stubs.cpp b/Minecraft.Client/Build/Extrax64Stubs.cpp index a4626cb7b..0d7476e9f 100644 --- a/Minecraft.Client/Build/Extrax64Stubs.cpp +++ b/Minecraft.Client/Build/Extrax64Stubs.cpp @@ -500,7 +500,7 @@ void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); } char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; } #else char* C_4JProfile::GetGamertag(int iPad){ return "PlayerName"; } -wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; } +std::wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; } #endif bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; } void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {} diff --git a/Minecraft.Client/Build/stubs.h b/Minecraft.Client/Build/stubs.h index dcb411079..56756ea6c 100644 --- a/Minecraft.Client/Build/stubs.h +++ b/Minecraft.Client/Build/stubs.h @@ -229,7 +229,7 @@ class ZipFile public: ZipFile(File *file) {} InputStream *getInputStream(ZipEntry *entry) { return NULL; } - ZipEntry *getEntry(const wstring& name) {return NULL;} + ZipEntry *getEntry(const std::wstring& name) {return NULL;} void close() {} }; @@ -245,7 +245,7 @@ public: static void create() {} static void destroy() {} static bool isKeyDown(int) {return false;} - static wstring getKeyName(int) { return L"KEYNAME"; } + static std::wstring getKeyName(int) { return L"KEYNAME"; } static void enableRepeatEvents(bool) {} static const int KEY_A = 0; static const int KEY_B = 1; diff --git a/Minecraft.Client/ClientConstants.cpp b/Minecraft.Client/ClientConstants.cpp index 844d94050..50ba494f7 100644 --- a/Minecraft.Client/ClientConstants.cpp +++ b/Minecraft.Client/ClientConstants.cpp @@ -1,4 +1,4 @@ #include "Build/stdafx.h" #include "ClientConstants.h" -const wstring ClientConstants::VERSION_STRING = wstring(L"Minecraft Xbox ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING; \ No newline at end of file +const std::wstring ClientConstants::VERSION_STRING = std::wstring(L"Minecraft Xbox ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING; \ No newline at end of file diff --git a/Minecraft.Client/ClientConstants.h b/Minecraft.Client/ClientConstants.h index 850eb05e6..62f4e8883 100644 --- a/Minecraft.Client/ClientConstants.h +++ b/Minecraft.Client/ClientConstants.h @@ -12,7 +12,7 @@ class ClientConstants // INTERNAL DEVELOPMENT SETTINGS public: - static const wstring VERSION_STRING; + static const std::wstring VERSION_STRING; static const bool DEADMAU5_CAMERA_CHEATS = false; static const bool IS_DEMO_VERSION = false; diff --git a/Minecraft.Client/GameState/DemoMode.cpp b/Minecraft.Client/GameState/DemoMode.cpp index 390885f6f..d001377e5 100644 --- a/Minecraft.Client/GameState/DemoMode.cpp +++ b/Minecraft.Client/GameState/DemoMode.cpp @@ -32,7 +32,7 @@ void DemoMode::tick() else if (day == 1) { Options *options = minecraft->options; - wstring message; + std::wstring message; if (time == 100) { minecraft.gui.addMessage("Seed: " + minecraft.level.getSeed()); diff --git a/Minecraft.Client/GameState/Options.cpp b/Minecraft.Client/GameState/Options.cpp index a3e58311d..e59ce7406 100644 --- a/Minecraft.Client/GameState/Options.cpp +++ b/Minecraft.Client/GameState/Options.cpp @@ -60,7 +60,7 @@ const Options::Option *Options::Option::getItem(int id) return &options[id]; } -Options::Option::Option(const wstring& captionId, bool hasProgress, bool isBoolean) : _isProgress(hasProgress), _isBoolean(isBoolean), captionId(captionId) +Options::Option::Option(const std::wstring& captionId, bool hasProgress, bool isBoolean) : _isProgress(hasProgress), _isBoolean(isBoolean), captionId(captionId) { } @@ -79,29 +79,29 @@ int Options::Option::getId() const return (int)(this-options); } -wstring Options::Option::getCaptionId() const +std::wstring Options::Option::getCaptionId() const { return captionId; } -const wstring Options::RENDER_DISTANCE_NAMES[] = +const std::wstring Options::RENDER_DISTANCE_NAMES[] = { L"options.renderDistance.far", L"options.renderDistance.normal", L"options.renderDistance.short", L"options.renderDistance.tiny" }; -const wstring Options::DIFFICULTY_NAMES[] = +const std::wstring Options::DIFFICULTY_NAMES[] = { L"options.difficulty.peaceful", L"options.difficulty.easy", L"options.difficulty.normal", L"options.difficulty.hard" }; -const wstring Options::GUI_SCALE[] = +const std::wstring Options::GUI_SCALE[] = { L"options.guiScale.auto", L"options.guiScale.small", L"options.guiScale.normal", L"options.guiScale.large" }; -const wstring Options::FRAMERATE_LIMITS[] = +const std::wstring Options::FRAMERATE_LIMITS[] = { L"performance.max", L"performance.balanced", L"performance.powersaver" }; -const wstring Options::PARTICLES[] = { +const std::wstring Options::PARTICLES[] = { L"options.particles.all", L"options.particles.decreased", L"options.particles.minimal" }; @@ -184,13 +184,13 @@ Options::Options() init(); } -wstring Options::getKeyDescription(int i) +std::wstring Options::getKeyDescription(int i) { Language *language = Language::getInstance(); return language->getElement(keyMappings[i]->name); } -wstring Options::getKeyMessage(int i) +std::wstring Options::getKeyMessage(int i) { int key = keyMappings[i]->key; if (key < 0) { @@ -307,12 +307,12 @@ bool Options::getBooleanValue(const Options::Option *item) return false; } -wstring Options::getMessage(const Options::Option *item) +std::wstring Options::getMessage(const Options::Option *item) { - // 4J TODO, should these wstrings append rather than add? + // 4J TODO, should these std::wstrings append rather than add? Language *language = Language::getInstance(); - wstring caption = language->getElement(item->getCaptionId()) + L": "; + std::wstring caption = language->getElement(item->getCaptionId()) + L": "; if (item->isProgress()) { @@ -411,14 +411,14 @@ void Options::load() // 4J - was new BufferedReader(new FileReader(optionsFile)); BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( optionsFile ) ) ); - wstring line = L""; + std::wstring line = L""; while ((line = br->readLine()) != L"") // 4J - was check against NULL - do we need to distinguish between empty lines and a fail here? { // 4J - removed try/catch // try { - wstring cmds[2]; + std::wstring cmds[2]; int splitpos = (int)line.find(L":"); - if( splitpos == wstring::npos ) + if( splitpos == std::wstring::npos ) { cmds[0] = line; cmds[1] = L""; @@ -469,7 +469,7 @@ void Options::load() } -float Options::readFloat(wstring string) +float Options::readFloat(std::wstring string) { if (string == L"true") return 1; if (string == L"false") return 0; @@ -488,20 +488,20 @@ void Options::save() dos.writeChars(L"music:" + _toString(music) + L"\n"); dos.writeChars(L"sound:" + _toString(sound) + L"\n"); - dos.writeChars(L"invertYMouse:" + wstring(invertYMouse ? L"true" : L"false") + L"\n"); + dos.writeChars(L"invertYMouse:" + std::wstring(invertYMouse ? L"true" : L"false") + L"\n"); dos.writeChars(L"mouseSensitivity:" + _toString(sensitivity)); dos.writeChars(L"fov:" + _toString(fov)); dos.writeChars(L"gamma:" + _toString(gamma)); dos.writeChars(L"viewDistance:" + _toString(viewDistance)); dos.writeChars(L"guiScale:" + _toString(guiScale)); dos.writeChars(L"particles:" + _toString(particles)); - dos.writeChars(L"bobView:" + wstring(bobView ? L"true" : L"false")); - dos.writeChars(L"anaglyph3d:" + wstring(anaglyph3d ? L"true" : L"false")); - dos.writeChars(L"advancedOpengl:" + wstring(advancedOpengl ? L"true" : L"false")); + dos.writeChars(L"bobView:" + std::wstring(bobView ? L"true" : L"false")); + dos.writeChars(L"anaglyph3d:" + std::wstring(anaglyph3d ? L"true" : L"false")); + dos.writeChars(L"advancedOpengl:" + std::wstring(advancedOpengl ? L"true" : L"false")); dos.writeChars(L"fpsLimit:" + _toString(framerateLimit)); dos.writeChars(L"difficulty:" + _toString(difficulty)); - dos.writeChars(L"fancyGraphics:" + wstring(fancyGraphics ? L"true" : L"false")); - dos.writeChars(L"ao:" + wstring(ambientOcclusion ? L"true" : L"false")); + dos.writeChars(L"fancyGraphics:" + std::wstring(fancyGraphics ? L"true" : L"false")); + dos.writeChars(L"ao:" + std::wstring(ambientOcclusion ? L"true" : L"false")); dos.writeChars(L"clouds:" + _toString(renderClouds)); dos.writeChars(L"skin:" + skin); dos.writeChars(L"lastServer:" + lastMpIp); diff --git a/Minecraft.Client/GameState/Options.h b/Minecraft.Client/GameState/Options.h index 8dfe15ed5..56e4a82bc 100644 --- a/Minecraft.Client/GameState/Options.h +++ b/Minecraft.Client/GameState/Options.h @@ -37,24 +37,24 @@ public: private: const bool _isProgress; const bool _isBoolean; - const wstring captionId; + const std::wstring captionId; public: static const Option *getItem(int id); - Option(const wstring& captionId, bool hasProgress, bool isBoolean); + Option(const std::wstring& captionId, bool hasProgress, bool isBoolean); bool isProgress() const; bool isBoolean() const; int getId() const; - wstring getCaptionId() const; + std::wstring getCaptionId() const; }; private: - static const wstring RENDER_DISTANCE_NAMES[]; - static const wstring DIFFICULTY_NAMES[]; - static const wstring GUI_SCALE[]; - static const wstring FRAMERATE_LIMITS[]; - static const wstring PARTICLES[]; + static const std::wstring RENDER_DISTANCE_NAMES[]; + static const std::wstring DIFFICULTY_NAMES[]; + static const std::wstring GUI_SCALE[]; + static const std::wstring FRAMERATE_LIMITS[]; + static const std::wstring PARTICLES[]; public: float music; @@ -69,7 +69,7 @@ public: bool fancyGraphics; bool ambientOcclusion; bool renderClouds; - wstring skin; + std::wstring skin; KeyMapping *keyUp; KeyMapping *keyLeft; @@ -99,7 +99,7 @@ public: bool hideGui; bool thirdPersonView; bool renderDebug; - wstring lastMpIp; + std::wstring lastMpIp; bool isFlying; bool smoothCamera; @@ -114,17 +114,17 @@ public: void init(); // 4J added Options(Minecraft *minecraft, File workingDirectory); Options(); - wstring getKeyDescription(int i); - wstring getKeyMessage(int i); + std::wstring getKeyDescription(int i); + std::wstring getKeyMessage(int i); void setKey(int i, int key); void set(const Options::Option *item, float value); void toggle(const Options::Option *option, int dir); float getProgressValue(const Options::Option *item); bool getBooleanValue(const Options::Option *item); - wstring getMessage(const Options::Option *item); + std::wstring getMessage(const Options::Option *item); void load(); private: - float readFloat(wstring string); + float readFloat(std::wstring string); public: void save(); diff --git a/Minecraft.Client/GameState/Settings.cpp b/Minecraft.Client/GameState/Settings.cpp index 377c812dd..296f8c920 100644 --- a/Minecraft.Client/GameState/Settings.cpp +++ b/Minecraft.Client/GameState/Settings.cpp @@ -15,7 +15,7 @@ void Settings::saveProperties() { } -wstring Settings::getString(const wstring& key, const wstring& defaultValue) +std::wstring Settings::getString(const std::wstring& key, const std::wstring& defaultValue) { if(properties.find(key) == properties.end()) { @@ -25,7 +25,7 @@ wstring Settings::getString(const wstring& key, const wstring& defaultValue) return properties[key]; } -int Settings::getInt(const wstring& key, int defaultValue) +int Settings::getInt(const std::wstring& key, int defaultValue) { if(properties.find(key) == properties.end()) { @@ -35,7 +35,7 @@ int Settings::getInt(const wstring& key, int defaultValue) return _fromString(properties[key]); } -bool Settings::getBoolean(const wstring& key, bool defaultValue) +bool Settings::getBoolean(const std::wstring& key, bool defaultValue) { if(properties.find(key) == properties.end()) { @@ -48,7 +48,7 @@ bool Settings::getBoolean(const wstring& key, bool defaultValue) return retval; } -void Settings::setBooleanAndSave(const wstring& key, bool value) +void Settings::setBooleanAndSave(const std::wstring& key, bool value) { properties[key] = _toString(value); saveProperties(); diff --git a/Minecraft.Client/GameState/Settings.h b/Minecraft.Client/GameState/Settings.h index 68a4fa8bd..fb634cbfe 100644 --- a/Minecraft.Client/GameState/Settings.h +++ b/Minecraft.Client/GameState/Settings.h @@ -7,15 +7,15 @@ class Settings // public static Logger logger = Logger.getLogger("Minecraft"); // private Properties properties = new Properties(); private: - std::unordered_map properties; // 4J - TODO was Properties type, will need to implement something we can serialise/deserialise too + std::unordered_map properties; // 4J - TODO was Properties type, will need to implement something we can serialise/deserialise too //File *file; public: Settings(File *file); void generateNewProperties(); void saveProperties(); - wstring getString(const wstring& key, const wstring& defaultValue); - int getInt(const wstring& key, int defaultValue); - bool getBoolean(const wstring& key, bool defaultValue); - void setBooleanAndSave(const wstring& key, bool value); + std::wstring getString(const std::wstring& key, const std::wstring& defaultValue); + int getInt(const std::wstring& key, int defaultValue); + bool getBoolean(const std::wstring& key, bool defaultValue); + void setBooleanAndSave(const std::wstring& key, bool value); }; diff --git a/Minecraft.Client/GameState/StatsSyncer.h b/Minecraft.Client/GameState/StatsSyncer.h index b3c9d0424..1fadfa71b 100644 --- a/Minecraft.Client/GameState/StatsSyncer.h +++ b/Minecraft.Client/GameState/StatsSyncer.h @@ -28,7 +28,7 @@ private: public: StatsSyncher(User *user, StatsCounter *statsCounter, File *dir); private: - void attemptRename(File *dir, const wstring& name, File *to); + void attemptRename(File *dir, const std::wstring& name, File *to); std::unordered_map *loadStatsFromDisk(File *file, File *tmp, File *old); std::unordered_map *loadStatsFromDisk(File *file); void doSend(std::unordered_map *stats); diff --git a/Minecraft.Client/Input/ConsoleInput.cpp b/Minecraft.Client/Input/ConsoleInput.cpp index 6a36b606b..ff6c3b6a0 100644 --- a/Minecraft.Client/Input/ConsoleInput.cpp +++ b/Minecraft.Client/Input/ConsoleInput.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "ConsoleInput.h" -ConsoleInput::ConsoleInput(const wstring& msg, ConsoleInputSource *source) +ConsoleInput::ConsoleInput(const std::wstring& msg, ConsoleInputSource *source) { this->msg = msg; this->source = source; diff --git a/Minecraft.Client/Input/ConsoleInput.h b/Minecraft.Client/Input/ConsoleInput.h index 1206b24ec..3b8a91eae 100644 --- a/Minecraft.Client/Input/ConsoleInput.h +++ b/Minecraft.Client/Input/ConsoleInput.h @@ -5,8 +5,8 @@ using namespace std; class ConsoleInput { public: - wstring msg; + std::wstring msg; ConsoleInputSource *source; - ConsoleInput(const wstring& msg, ConsoleInputSource *source); + ConsoleInput(const std::wstring& msg, ConsoleInputSource *source); }; \ No newline at end of file diff --git a/Minecraft.Client/Input/ConsoleInputSource.h b/Minecraft.Client/Input/ConsoleInputSource.h index ab2a25877..7d79c0941 100644 --- a/Minecraft.Client/Input/ConsoleInputSource.h +++ b/Minecraft.Client/Input/ConsoleInputSource.h @@ -3,7 +3,7 @@ class ConsoleInputSource { public: - virtual void info(const wstring& string) = 0; - virtual void warn(const wstring& string) = 0; - virtual wstring getConsoleName() = 0; + virtual void info(const std::wstring& string) = 0; + virtual void warn(const std::wstring& string) = 0; + virtual std::wstring getConsoleName() = 0; }; diff --git a/Minecraft.Client/Input/KeyMapping.cpp b/Minecraft.Client/Input/KeyMapping.cpp index 64f4d92bb..ade98f6b5 100644 --- a/Minecraft.Client/Input/KeyMapping.cpp +++ b/Minecraft.Client/Input/KeyMapping.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "KeyMapping.h" -KeyMapping::KeyMapping(const wstring& name, int key) +KeyMapping::KeyMapping(const std::wstring& name, int key) { this->name = name; this->key = key; diff --git a/Minecraft.Client/Input/KeyMapping.h b/Minecraft.Client/Input/KeyMapping.h index 45be54a32..68aff9f0d 100644 --- a/Minecraft.Client/Input/KeyMapping.h +++ b/Minecraft.Client/Input/KeyMapping.h @@ -4,7 +4,7 @@ using namespace std; class KeyMapping { public: - wstring name; + std::wstring name; int key; - KeyMapping(const wstring& name, int key); + KeyMapping(const std::wstring& name, int key); }; \ No newline at end of file diff --git a/Minecraft.Client/Level/DemoLevel.cpp b/Minecraft.Client/Level/DemoLevel.cpp index adab55825..44c5b1f97 100644 --- a/Minecraft.Client/Level/DemoLevel.cpp +++ b/Minecraft.Client/Level/DemoLevel.cpp @@ -11,7 +11,7 @@ LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings( 1.0 ); -DemoLevel::DemoLevel(std::shared_ptr levelStorage, const wstring& levelName) : Level(levelStorage, levelName, &DEMO_LEVEL_SETTINGS) +DemoLevel::DemoLevel(std::shared_ptr levelStorage, const std::wstring& levelName) : Level(levelStorage, levelName, &DEMO_LEVEL_SETTINGS) { } diff --git a/Minecraft.Client/Level/DemoLevel.h b/Minecraft.Client/Level/DemoLevel.h index 7e69ed160..d8639dee7 100644 --- a/Minecraft.Client/Level/DemoLevel.h +++ b/Minecraft.Client/Level/DemoLevel.h @@ -10,7 +10,7 @@ private: static const int DEMO_SPAWN_Z = -731; static LevelSettings DEMO_LEVEL_SETTINGS; public: - DemoLevel(std::shared_ptr levelStorage, const wstring& levelName); + DemoLevel(std::shared_ptr levelStorage, const std::wstring& levelName); DemoLevel(Level *level, Dimension *dimension); protected: virtual void setInitialSpawn(); diff --git a/Minecraft.Client/Level/DerivedServerLevel.cpp b/Minecraft.Client/Level/DerivedServerLevel.cpp index b6f6aabca..525cdb142 100644 --- a/Minecraft.Client/Level/DerivedServerLevel.cpp +++ b/Minecraft.Client/Level/DerivedServerLevel.cpp @@ -3,7 +3,7 @@ #include "../../Minecraft.World/Level/Storage/SavedDataStorage.h" #include "../../Minecraft.World/Level/DerivedLevelData.h" -DerivedServerLevel::DerivedServerLevel(MinecraftServer *server, std::shared_ptr levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped) +DerivedServerLevel::DerivedServerLevel(MinecraftServer *server, std::shared_ptr levelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped) : ServerLevel(server, levelStorage, levelName, dimension, levelSettings) { // 4J-PB - we're going to override the savedDataStorage, so we need to delete the current one diff --git a/Minecraft.Client/Level/DerivedServerLevel.h b/Minecraft.Client/Level/DerivedServerLevel.h index ada362f4b..2c9048563 100644 --- a/Minecraft.Client/Level/DerivedServerLevel.h +++ b/Minecraft.Client/Level/DerivedServerLevel.h @@ -4,7 +4,7 @@ class DerivedServerLevel : public ServerLevel { public: - DerivedServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped); + DerivedServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped); ~DerivedServerLevel(); protected: diff --git a/Minecraft.Client/Level/ServerLevel.cpp b/Minecraft.Client/Level/ServerLevel.cpp index 43448d7f0..7cfa5b743 100644 --- a/Minecraft.Client/Level/ServerLevel.cpp +++ b/Minecraft.Client/Level/ServerLevel.cpp @@ -91,7 +91,7 @@ void ServerLevel::staticCtor() }; -ServerLevel::ServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false) +ServerLevel::ServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false) { InitializeCriticalSection(&m_limiterCS); InitializeCriticalSection(&m_tickNextTickCS); diff --git a/Minecraft.Client/Level/ServerLevel.h b/Minecraft.Client/Level/ServerLevel.h index c4dd4f5ec..93fe297a4 100644 --- a/Minecraft.Client/Level/ServerLevel.h +++ b/Minecraft.Client/Level/ServerLevel.h @@ -41,7 +41,7 @@ private: int activeTileEventsList; public: static void staticCtor(); - ServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings); + ServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings); ~ServerLevel(); void tick(); Biome::MobSpawnerData *getRandomMobSpawnAt(MobCategory *mobCategory, int x, int y, int z); diff --git a/Minecraft.Client/Level/ServerLevelListener.cpp b/Minecraft.Client/Level/ServerLevelListener.cpp index 8201f05ff..f0cd1ab6e 100644 --- a/Minecraft.Client/Level/ServerLevelListener.cpp +++ b/Minecraft.Client/Level/ServerLevelListener.cpp @@ -20,7 +20,7 @@ ServerLevelListener::ServerLevelListener(MinecraftServer *server, ServerLevel *l // 4J removed - /* -void ServerLevelListener::addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) +void ServerLevelListener::addParticle(const std::wstring& name, double x, double y, double z, double xa, double ya, double za) { } */ @@ -98,7 +98,7 @@ void ServerLevelListener::tileLightChanged(int x, int y, int z) { } -void ServerLevelListener::playStreamingMusic(const wstring& name, int x, int y, int z) +void ServerLevelListener::playStreamingMusic(const std::wstring& name, int x, int y, int z) { } diff --git a/Minecraft.Client/Level/ServerLevelListener.h b/Minecraft.Client/Level/ServerLevelListener.h index 339b30e71..d5ba2cbc2 100644 --- a/Minecraft.Client/Level/ServerLevelListener.h +++ b/Minecraft.Client/Level/ServerLevelListener.h @@ -15,7 +15,7 @@ private: public: ServerLevelListener(MinecraftServer *server, ServerLevel *level); - // 4J removed - virtual void addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za); + // 4J removed - virtual void addParticle(const std::wstring& name, double x, double y, double z, double xa, double ya, double za); virtual void addParticle(ePARTICLE_TYPE name, double x, double y, double z, double xa, double ya, double za); // 4J added virtual void allChanged(); virtual void entityAdded(std::shared_ptr entity); @@ -27,7 +27,7 @@ public: virtual void skyColorChanged(); virtual void tileChanged(int x, int y, int z); virtual void tileLightChanged(int x, int y, int z); - virtual void playStreamingMusic(const wstring& name, int x, int y, int z); + virtual void playStreamingMusic(const std::wstring& name, int x, int y, int z); virtual void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data); virtual void destroyTileProgress(int id, int x, int y, int z, int progress); }; diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 5b1f6f59a..e7713b2dc 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -236,7 +236,7 @@ void Minecraft::clearConnectionFailed() app.SetDisconnectReason(DisconnectPacket::eDisconnect_None); } -void Minecraft::connectTo(const wstring& server, int port) +void Minecraft::connectTo(const std::wstring& server, int port) { connectToIp = server; connectToPort = port; @@ -489,7 +489,7 @@ File Minecraft::getWorkingDirectory() return workDir; } -File Minecraft::getWorkingDirectory(const wstring& applicationName) +File Minecraft::getWorkingDirectory(const std::wstring& applicationName) { #if 0 // 4J - original version @@ -514,7 +514,7 @@ File Minecraft::getWorkingDirectory(const wstring& applicationName) if (!workingDirectory.exists()) if (!workingDirectory.mkdirs()) throw new RuntimeException("The working directory could not be created: " + workingDirectory); return workingDirectory; #else - wstring userHome = L"home"; // 4J - TODO + std::wstring userHome = L"home"; // 4J - TODO File workingDirectory(userHome, applicationName); // 4J Removed //if (!workingDirectory.exists()) @@ -620,7 +620,7 @@ void Minecraft::setScreen(Screen *screen) }*/ } -void Minecraft::checkGlError(const wstring& string) +void Minecraft::checkGlError(const std::wstring& string) { // 4J - TODO } @@ -1025,7 +1025,7 @@ void Minecraft::addPendingLocalConnection(int idx, ClientConnection *connection) m_pendingLocalConnections[idx] = connection; } -std::shared_ptr Minecraft::createExtraLocalPlayer(int idx, const wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin) +std::shared_ptr Minecraft::createExtraLocalPlayer(int idx, const std::wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin) { if( clientConnection == NULL) return nullptr; @@ -1037,7 +1037,7 @@ std::shared_ptr Minecraft::createExtraLocalPlayer(int id // A temp player displaying a connecting screen tempScreenSection = localplayers[idx]->m_iScreenSection; } - wstring prevname = user->name; + std::wstring prevname = user->name; user->name = name; // Don't need this any more @@ -3439,7 +3439,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) #endif if( selected || wheel != 0 || (player->ullButtonsPressed&(1LL< selectedItem = player->getSelectedItem(); // Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item int iCount=0; @@ -3782,16 +3782,16 @@ bool Minecraft::isClientSide() return level != NULL && level->isClientSide; } -void Minecraft::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, const wstring& levelName, LevelSettings *levelSettings) +void Minecraft::selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, const std::wstring& levelName, LevelSettings *levelSettings) { } -bool Minecraft::saveSlot(int slot, const wstring& name) +bool Minecraft::saveSlot(int slot, const std::wstring& name) { return false; } -bool Minecraft::loadSlot(const wstring& userName, int slot) +bool Minecraft::loadSlot(const std::wstring& userName, int slot) { return false; } @@ -3835,7 +3835,7 @@ MultiPlayerLevel *Minecraft::getLevel(int dimension) // Also causing ambiguous call for some reason // as it is matching std::shared_ptr from the func below with bool from this one -//void Minecraft::setLevel(Level *level, const wstring& message, bool doForceStatsSave /*= true*/) +//void Minecraft::setLevel(Level *level, const std::wstring& message, bool doForceStatsSave /*= true*/) //{ // setLevel(level, message, NULL, doForceStatsSave); //} @@ -4106,11 +4106,11 @@ void Minecraft::prepareLevel(int title) } } -void Minecraft::fileDownloaded(const wstring& name, File *file) +void Minecraft::fileDownloaded(const std::wstring& name, File *file) { int p = (int)name.find(L"/"); - wstring category = name.substr(0, p); - wstring name2 = name.substr(p + 1); + std::wstring category = name.substr(0, p); + std::wstring name2 = name.substr(p + 1); toLower(category); if (category==L"sound") { @@ -4134,25 +4134,25 @@ void Minecraft::fileDownloaded(const wstring& name, File *file) } } -wstring Minecraft::gatherStats1() +std::wstring Minecraft::gatherStats1() { //return levelRenderer->gatherStats1(); return L"Time to autosave: " + _toString( app.SecondsToAutosave() ) + L"s"; } -wstring Minecraft::gatherStats2() +std::wstring Minecraft::gatherStats2() { return g_NetworkManager.GatherStats(); //return levelRenderer->gatherStats2(); } -wstring Minecraft::gatherStats3() +std::wstring Minecraft::gatherStats3() { return g_NetworkManager.GatherRTTStats(); //return L"P: " + particleEngine->countParticles() + L". T: " + level->gatherStats(); } -wstring Minecraft::gatherStats4() +std::wstring Minecraft::gatherStats4() { return level->gatherChunkSourceStats(); } @@ -4260,15 +4260,15 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) gameRenderer->EnableUpdateThread(); } -void Minecraft::start(const wstring& name, const wstring& sid) +void Minecraft::start(const std::wstring& name, const std::wstring& sid) { startAndConnectTo(name, sid, L""); } -void Minecraft::startAndConnectTo(const wstring& name, const wstring& sid, const wstring& url) +void Minecraft::startAndConnectTo(const std::wstring& name, const std::wstring& sid, const std::wstring& url) { bool fullScreen = false; - wstring userName = name; + std::wstring userName = name; /* 4J - removed window handling things here final Frame frame = new Frame("Minecraft"); @@ -4367,8 +4367,8 @@ int g_iMainThreadId; void Minecraft::main() { - wstring name; - wstring sessionId; + std::wstring name; + std::wstring sessionId; //g_iMainThreadId = GetCurrentThreadId(); @@ -4452,7 +4452,7 @@ bool Minecraft::renderDebug() return (m_instance != NULL && m_instance->options->renderDebug); } -bool Minecraft::handleClientSideCommand(const wstring& chatMessage) +bool Minecraft::handleClientSideCommand(const std::wstring& chatMessage) { /* 4J - TODO if (chatMessage.startsWith("/")) { @@ -4841,7 +4841,7 @@ void Minecraft::tickAllConnections() setLocalPlayerIdx(oldIdx); } -bool Minecraft::addPendingClientTextureRequest(const wstring &textureName) +bool Minecraft::addPendingClientTextureRequest(const std::wstring &textureName) { AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); if( it == m_pendingTextureRequests.end() ) @@ -4852,7 +4852,7 @@ bool Minecraft::addPendingClientTextureRequest(const wstring &textureName) return false; } -void Minecraft::handleClientTextureReceived(const wstring &textureName) +void Minecraft::handleClientTextureReceived(const std::wstring &textureName) { AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); if( it != m_pendingTextureRequests.end() ) diff --git a/Minecraft.Client/Minecraft.h b/Minecraft.Client/Minecraft.h index ea0a6e456..58106a326 100644 --- a/Minecraft.Client/Minecraft.h +++ b/Minecraft.Client/Minecraft.h @@ -56,7 +56,7 @@ private: }; public: - static const wstring VERSION_STRING; + static const std::wstring VERSION_STRING; Minecraft(Component *mouseComponent, Canvas *parent, MinecraftApplet *minecraftApplet, int width, int height, bool fullscreen); void init(); @@ -114,7 +114,7 @@ public: void addPendingLocalConnection(int idx, ClientConnection *connection); void connectionDisconnected(int idx, DisconnectPacket::eDisconnectReason reason) { m_connectionFailed[idx] = true; m_connectionFailedReason[idx] = reason; } - std::shared_ptr createExtraLocalPlayer(int idx, const wstring& name, int pad, int iDimension, ClientConnection *clientConnection = NULL,MultiPlayerLevel *levelpassedin=NULL); + std::shared_ptr createExtraLocalPlayer(int idx, const std::wstring& name, int pad, int iDimension, ClientConnection *clientConnection = NULL,MultiPlayerLevel *levelpassedin=NULL); void createPrimaryLocalPlayer(int iPad); bool setLocalPlayerIdx(int idx); int getLocalPlayerIdx(); @@ -126,7 +126,7 @@ public: std::shared_ptr cameraTargetPlayer; ParticleEngine *particleEngine; User *user; - wstring serverDomain; + std::wstring serverDomain; Canvas *parent; bool appletMode; @@ -181,12 +181,12 @@ public: StatsCounter* stats[4]; private: - wstring connectToIp; + std::wstring connectToIp; int connectToPort; public: void clearConnectionFailed(); - void connectTo(const wstring& server, int port); + void connectTo(const std::wstring& server, int port); private: void renderLoadingScreen(); @@ -199,14 +199,14 @@ private: public: static File getWorkingDirectory(); - static File getWorkingDirectory(const wstring& applicationName); + static File getWorkingDirectory(const std::wstring& applicationName); private: static OS getPlatform(); public: LevelStorageSource *getLevelSource(); void setScreen(Screen *screen); private: - void checkGlError(const wstring& string); + void checkGlError(const std::wstring& string); #ifdef __ORBIS__ PsPlusUpsellWrapper *m_pPsPlusUpsell; @@ -215,7 +215,7 @@ private: public: void destroy(); volatile bool running; - wstring fpsString; + std::wstring fpsString; void run(); // 4J-PB - split the run into 3 parts so we can run it from our xbox game loop static Minecraft *GetInstance(); @@ -269,36 +269,36 @@ private: void reloadSound(); public: bool isClientSide(); - void selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, const wstring& levelName, LevelSettings *levelSettings); + void selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, const std::wstring& levelName, LevelSettings *levelSettings); //void toggleDimension(int targetDimension); - bool saveSlot(int slot, const wstring& name); - bool loadSlot(const wstring& userName, int slot); + bool saveSlot(int slot, const std::wstring& name); + bool loadSlot(const std::wstring& userName, int slot); void releaseLevel(int message); // 4J Stu - Added the doForceStatsSave param //void setLevel(Level *level, bool doForceStatsSave = true); - //void setLevel(Level *level, const wstring& message, bool doForceStatsSave = true); + //void setLevel(Level *level, const std::wstring& message, bool doForceStatsSave = true); void setLevel(MultiPlayerLevel *level, int message = -1, std::shared_ptr forceInsertPlayer = nullptr, bool doForceStatsSave = true,bool bPrimaryPlayerSignedOut=false); // 4J-PB - added to force in the 'other' level when the main player creates the level at game load time void forceaddLevel(MultiPlayerLevel *level); void prepareLevel(int title); // 4J - changed to public - void fileDownloaded(const wstring& name, File *file); + void fileDownloaded(const std::wstring& name, File *file); // OpenGLCapabilities getOpenGLCapabilities(); // 4J - removed - wstring gatherStats1(); - wstring gatherStats2(); - wstring gatherStats3(); - wstring gatherStats4(); + std::wstring gatherStats1(); + std::wstring gatherStats2(); + std::wstring gatherStats3(); + std::wstring gatherStats4(); void respawnPlayer(int iPad,int dimension,int newEntityId); - static void start(const wstring& name, const wstring& sid); - static void startAndConnectTo(const wstring& name, const wstring& sid, const wstring& url); + static void start(const std::wstring& name, const std::wstring& sid); + static void startAndConnectTo(const std::wstring& name, const std::wstring& sid, const std::wstring& url); ClientConnection *getConnection(int iPad); // 4J Stu added iPad param static void main(); static bool renderNames(); static bool useFancyGraphics(); static bool useAmbientOcclusion(); static bool renderDebug(); - bool handleClientSideCommand(const wstring& chatMessage); + bool handleClientSideCommand(const std::wstring& chatMessage); static int maxSupportedTextureSize(); void delayTextureReload(); @@ -331,15 +331,15 @@ public: Level *animateTickLevel; // 4J added // 4J - When a client requests a texture, it should add it to here while we are waiting for it - vector m_pendingTextureRequests; - vector m_pendingGeometryRequests; // additional skin box geometry + vector m_pendingTextureRequests; + vector m_pendingGeometryRequests; // additional skin box geometry // 4J Added - bool addPendingClientTextureRequest(const wstring &textureName); - void handleClientTextureReceived(const wstring &textureName); + bool addPendingClientTextureRequest(const std::wstring &textureName); + void handleClientTextureReceived(const std::wstring &textureName); void clearPendingClientTextureRequests() { m_pendingTextureRequests.clear(); } - bool addPendingClientGeometryRequest(const wstring &textureName); - void handleClientGeometryReceived(const wstring &textureName); + bool addPendingClientGeometryRequest(const std::wstring &textureName); + void handleClientGeometryReceived(const std::wstring &textureName); void clearPendingClientGeometryRequests() { m_pendingGeometryRequests.clear(); } unsigned int getCurrentTexturePackId(); diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 50a4763b9..4256cffff 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -64,7 +64,7 @@ int MinecraftServer::s_slowQueuePlayerIndex = 0; int MinecraftServer::s_slowQueueLastTime = 0; bool MinecraftServer::s_slowQueuePacketSent = false; -std::unordered_map MinecraftServer::ironTimers; +std::unordered_map MinecraftServer::ironTimers; MinecraftServer::MinecraftServer() { @@ -77,7 +77,7 @@ MinecraftServer::MinecraftServer() m_bLoaded = false; stopped = false; tickCount = 0; - wstring progressStatus; + std::wstring progressStatus; progress = 0; motd = L""; @@ -203,8 +203,8 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW __int64 levelNanoTime = System::nanoTime(); - wstring levelName = settings->getString(L"level-name", L"world"); - wstring levelTypeString; + std::wstring levelName = settings->getString(L"level-name", L"world"); + std::wstring levelTypeString; bool gameRuleUseFlatWorld = false; if(app.getLevelGenerationOptions() != NULL) @@ -244,7 +244,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW //settings->setProperty(L"max-build-height", maxBuildHeight); #if 0 - wstring levelSeedString = settings->getString(L"level-seed", L""); + std::wstring levelSeedString = settings->getString(L"level-seed", L""); __int64 levelSeed = (new Random())->nextLong(); if (levelSeedString.length() > 0) { @@ -378,7 +378,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress) DeleteCriticalSection(&m_postProcessCS); } -bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) +bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const std::wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) { // 4J - TODO - do with new save stuff // if (storageSource->requiresConversion(name)) @@ -750,7 +750,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring return true; } -void MinecraftServer::setProgress(const wstring& status, int progress) +void MinecraftServer::setProgress(const std::wstring& status, int progress) { progressStatus = status; this->progress = progress; @@ -1347,7 +1347,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) wchar_t filename[128]; swprintf(filename,128,L"%ls%dx%dx%d.sch",initData->name,(initData->endX - initData->startX + 1), (initData->endY - initData->startY + 1), (initData->endZ - initData->startZ + 1)); - File dataFile = File( targetFileDir, wstring(filename) ); + File dataFile = File( targetFileDir, std::wstring(filename) ); if(dataFile.exists()) dataFile._delete(); FileOutputStream fos = FileOutputStream(dataFile); DataOutputStream dos = DataOutputStream(&fos); @@ -1440,7 +1440,7 @@ void MinecraftServer::broadcastStopSavingPacket() void MinecraftServer::tick() { - vector toRemove; + vector toRemove; for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++ ) { int t = it->second; @@ -1561,7 +1561,7 @@ void MinecraftServer::tick() // } } -void MinecraftServer::handleConsoleInput(const wstring& msg, ConsoleInputSource *source) +void MinecraftServer::handleConsoleInput(const std::wstring& msg, ConsoleInputSource *source) { consoleInput.push_back(new ConsoleInput(msg, source)); } @@ -1599,20 +1599,20 @@ void MinecraftServer::HaltServer(bool bPrimaryPlayerSignedOut) } } -File *MinecraftServer::getFile(const wstring& name) +File *MinecraftServer::getFile(const std::wstring& name) { return new File(name); } -void MinecraftServer::info(const wstring& string) +void MinecraftServer::info(const std::wstring& string) { } -void MinecraftServer::warn(const wstring& string) +void MinecraftServer::warn(const std::wstring& string) { } -wstring MinecraftServer::getConsoleName() +std::wstring MinecraftServer::getConsoleName() { return L"CONSOLE"; } diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h index 7bbd01dbf..944b9775a 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/MinecraftServer.h @@ -24,8 +24,8 @@ typedef struct _LoadSaveDataThreadParam { LPVOID data; __int64 fileSize; - const wstring saveName; - _LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} + const std::wstring saveName; + _LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const std::wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} } LoadSaveDataThreadParam; typedef struct _NetworkGameInitData @@ -60,18 +60,18 @@ using namespace std; class MinecraftServer : public ConsoleInputSource { public: - static const wstring VERSION; + static const std::wstring VERSION; static const int TICK_STATS_SPAN = SharedConstants::TICKS_PER_SECOND * 5; // static Logger logger = Logger.getLogger("Minecraft"); - static std::unordered_map ironTimers; + static std::unordered_map ironTimers; private: static const int DEFAULT_MINECRAFT_PORT = 25565; static const int MS_PER_TICK = 1000 / SharedConstants::TICKS_PER_SECOND; // 4J Stu - Added 1.0.1, Not needed - //wstring localIp; + //std::wstring localIp; //int port; public: ServerConnection *connection; @@ -93,7 +93,7 @@ public: int tickCount; public: - wstring progressStatus; + std::wstring progressStatus; int progress; private: // vector tickables = new ArrayList(); // 4J - removed @@ -105,7 +105,7 @@ public: bool npcs; bool pvp; bool allowFlight; - wstring motd; + std::wstring motd; int maxBuildHeight; private: @@ -127,8 +127,8 @@ private: // 4J Added - LoadSaveDataThreadParam bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); void postProcessTerminate(ProgressRenderer *mcprogress); - bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); - void setProgress(const wstring& status, int progress); + bool loadLevel(LevelStorageSource *storageSource, const std::wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); + void setProgress(const std::wstring& status, int progress); void endProgress(); void saveAllChunks(); void saveGameRules(); @@ -162,16 +162,16 @@ public: private: void tick(); public: - void handleConsoleInput(const wstring& msg, ConsoleInputSource *source); + void handleConsoleInput(const std::wstring& msg, ConsoleInputSource *source); void handleConsoleInputs(); // void addTickable(Tickable tickable); // 4J removed static void main(__int64 seed, void *lpParameter); static void HaltServer(bool bPrimaryPlayerSignedOut=false); - File *getFile(const wstring& name); - void info(const wstring& string); - void warn(const wstring& string); - wstring getConsoleName(); + File *getFile(const std::wstring& name); + void info(const std::wstring& string); + void warn(const std::wstring& string); + std::wstring getConsoleName(); ServerLevel *getLevel(int dimension); void setLevel(int dimension, ServerLevel *level); // 4J added static MinecraftServer *getInstance() { return server; } // 4J added diff --git a/Minecraft.Client/Network/ClientConnection.cpp b/Minecraft.Client/Network/ClientConnection.cpp index b570e0b39..8d36a103e 100644 --- a/Minecraft.Client/Network/ClientConnection.cpp +++ b/Minecraft.Client/Network/ClientConnection.cpp @@ -57,7 +57,7 @@ #include "../../Minecraft.World/Stats/GenericStats.h" #endif -ClientConnection::ClientConnection(Minecraft *minecraft, const wstring& ip, int port) +ClientConnection::ClientConnection(Minecraft *minecraft, const std::wstring& ip, int port) { // 4J Stu - No longer used as we use the socket version below. assert(FALSE); @@ -207,7 +207,7 @@ void ClientConnection::handleLogin(std::shared_ptr packet) // a skin? if(pMojangData->wchSkin[0]!=0L) { - wstring wstr=pMojangData->wchSkin; + std::wstring wstr=pMojangData->wchSkin; // check the file is not already in bRes=app.IsFileInMemoryTextures(wstr); if(!bRes) @@ -229,7 +229,7 @@ void ClientConnection::handleLogin(std::shared_ptr packet) // a cloak? if(pMojangData->wchCape[0]!=0L) { - wstring wstr=pMojangData->wchCape; + std::wstring wstr=pMojangData->wchCape; // check the file is not already in bRes=app.IsFileInMemoryTextures(wstr); if(!bRes) @@ -1277,12 +1277,12 @@ void ClientConnection::handleTakeItemEntity(std::shared_ptr packet) { - wstring message; + std::wstring message; int iPos; bool displayOnGui = true; - wstring playerDisplayName = L""; - wstring sourceDisplayName = L""; + std::wstring playerDisplayName = L""; + std::wstring sourceDisplayName = L""; // On platforms other than Xbox One this just sets display name to gamertag if (packet->m_stringArgs.size() >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]); @@ -3053,7 +3053,7 @@ void ClientConnection::displayPrivilegeChanges(std::shared_ptrm_messageId); if(string != NULL) { - wstring message(string); + std::wstring message(string); message = GameRuleDefinition::generateDescriptionString(packet->m_definitionType,message,packet->m_data.data,packet->m_data.length); if(minecraft->localgameModes[m_userIndex]!=NULL) { @@ -3348,10 +3348,10 @@ int ClientConnection::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage:: } // -wstring ClientConnection::GetDisplayNameByGamertag(wstring gamertag) +std::wstring ClientConnection::GetDisplayNameByGamertag(std::wstring gamertag) { #ifdef _DURANGO - wstring displayName = g_NetworkManager.GetDisplayNameByGamertag(gamertag); + std::wstring displayName = g_NetworkManager.GetDisplayNameByGamertag(gamertag); return displayName; #else return gamertag; diff --git a/Minecraft.Client/Network/ClientConnection.h b/Minecraft.Client/Network/ClientConnection.h index 305b3a21b..1f0aae762 100644 --- a/Minecraft.Client/Network/ClientConnection.h +++ b/Minecraft.Client/Network/ClientConnection.h @@ -21,7 +21,7 @@ private: bool done; Connection *connection; public: - wstring message; + std::wstring message; bool createdOk; // 4J added private: Minecraft *minecraft; @@ -44,7 +44,7 @@ private: DWORD m_userIndex; // 4J Added public: SavedDataStorage *savedDataStorage; - ClientConnection(Minecraft *minecraft, const wstring& ip, int port); + ClientConnection(Minecraft *minecraft, const std::wstring& ip, int port); ClientConnection(Minecraft *minecraft, Socket *socket, int iUserIndex = -1); ~ClientConnection(); void tick(); @@ -90,7 +90,7 @@ public: virtual void handleEntityEvent(std::shared_ptr packet); private: std::shared_ptr getEntity(int entityId); - wstring GetDisplayNameByGamertag(wstring gamertag); + std::wstring GetDisplayNameByGamertag(std::wstring gamertag); public: virtual void handleSetHealth(std::shared_ptr packet); virtual void handleSetExperience(std::shared_ptr packet); diff --git a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp index 93cedcbac..acbef3521 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp @@ -280,12 +280,12 @@ vector *MultiPlayerChunkCache::getMobsAt(MobCategory *m return NULL; } -TilePos *MultiPlayerChunkCache::findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z) +TilePos *MultiPlayerChunkCache::findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z) { return NULL; } -wstring MultiPlayerChunkCache::gatherStats() +std::wstring MultiPlayerChunkCache::gatherStats() { EnterCriticalSection(&m_csLoadCreate); int size = (int)loadedChunkList.size(); diff --git a/Minecraft.Client/Network/MultiPlayerChunkCache.h b/Minecraft.Client/Network/MultiPlayerChunkCache.h index f18681b63..c557cd5d8 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.h +++ b/Minecraft.Client/Network/MultiPlayerChunkCache.h @@ -38,9 +38,9 @@ public: virtual bool tick(); virtual bool shouldSave(); virtual void postProcess(ChunkSource *parent, int x, int z); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z); virtual void dataReceived(int x, int z); // 4J added virtual LevelChunk **getCache() { return cache; } // 4J added diff --git a/Minecraft.Client/Network/PendingConnection.cpp b/Minecraft.Client/Network/PendingConnection.cpp index f30124234..b0b9e869b 100644 --- a/Minecraft.Client/Network/PendingConnection.cpp +++ b/Minecraft.Client/Network/PendingConnection.cpp @@ -20,7 +20,7 @@ Random *PendingConnection::random = new Random(); -PendingConnection::PendingConnection(MinecraftServer *server, Socket *socket, const wstring& id) +PendingConnection::PendingConnection(MinecraftServer *server, Socket *socket, const std::wstring& id) { // 4J - added initialisers done = false; @@ -257,7 +257,7 @@ void PendingConnection::send(std::shared_ptr packet) connection->send(packet); } -wstring PendingConnection::getName() +std::wstring PendingConnection::getName() { return L"Unimplemented"; // if (name != null) return name + " [" + connection.getRemoteAddress().toString() + "]"; diff --git a/Minecraft.Client/Network/PendingConnection.h b/Minecraft.Client/Network/PendingConnection.h index e8c286721..50e9b35d5 100644 --- a/Minecraft.Client/Network/PendingConnection.h +++ b/Minecraft.Client/Network/PendingConnection.h @@ -23,12 +23,12 @@ public: private: MinecraftServer *server; int _tick; - wstring name; + std::wstring name; std::shared_ptr acceptedLogin; - wstring loginKey; + std::wstring loginKey; public: - PendingConnection(MinecraftServer *server, Socket *socket, const wstring& id); + PendingConnection(MinecraftServer *server, Socket *socket, const std::wstring& id); ~PendingConnection(); void tick(); void disconnect(DisconnectPacket::eDisconnectReason reason); @@ -40,7 +40,7 @@ public: virtual void handleKeepAlive(std::shared_ptr packet); virtual void onUnhandledPacket(std::shared_ptr packet); void send(std::shared_ptr packet); - wstring getName(); + std::wstring getName(); virtual bool isServerPacketListener(); private: diff --git a/Minecraft.Client/Network/PlayerConnection.cpp b/Minecraft.Client/Network/PlayerConnection.cpp index f931c8bbc..f5b40adc9 100644 --- a/Minecraft.Client/Network/PlayerConnection.cpp +++ b/Minecraft.Client/Network/PlayerConnection.cpp @@ -638,7 +638,7 @@ void PlayerConnection::handleChat(std::shared_ptr packet) { // 4J - TODO #if 0 - wstring message = packet->message; + std::wstring message = packet->message; if (message.length() > SharedConstants::maxChatLength) { disconnect(L"Chat message too long"); @@ -670,7 +670,7 @@ void PlayerConnection::handleChat(std::shared_ptr packet) #endif } -void PlayerConnection::handleCommand(const wstring& message) +void PlayerConnection::handleCommand(const std::wstring& message) { // 4J - TODO #if 0 @@ -737,19 +737,19 @@ int PlayerConnection::countDelayedPackets() return connection->countDelayedPackets(); } -void PlayerConnection::info(const wstring& string) +void PlayerConnection::info(const std::wstring& string) { // 4J-PB - removed, since it needs to be localised in the language the client is in //send( std::shared_ptr( new ChatPacket(L"§7" + string) ) ); } -void PlayerConnection::warn(const wstring& string) +void PlayerConnection::warn(const std::wstring& string) { // 4J-PB - removed, since it needs to be localised in the language the client is in //send( std::shared_ptr( new ChatPacket(L"§9" + string) ) ); } -wstring PlayerConnection::getConsoleName() +std::wstring PlayerConnection::getConsoleName() { return player->name; } @@ -894,7 +894,7 @@ void PlayerConnection::handleTextureAndGeometry(std::shared_ptrgetAuxValue()); - std::wstring id = wstring(buf); + std::wstring id = std::wstring(buf); if( data == NULL ) { data = std::shared_ptr( new MapItemSavedData(id) ); @@ -1292,7 +1292,7 @@ void PlayerConnection::handleSignUpdate(std::shared_ptr packet std::shared_ptr ste = dynamic_pointer_cast(te); for (int i = 0; i < 4; i++) { - wstring lineText = packet->lines[i].substr(0,15); + std::wstring lineText = packet->lines[i].substr(0,15); ste->SetMessage( i, lineText ); } ste->SetVerified(false); @@ -1498,7 +1498,7 @@ void PlayerConnection::handleCustomPayload(std::shared_ptr { ByteArrayInputStream bais(customPayloadPacket->data); DataInputStream dis(&bais); - wstring name = dis.readUTF(); + std::wstring name = dis.readUTF(); if (name.length() <= 30) { menu->setItemName(name); diff --git a/Minecraft.Client/Network/PlayerConnection.h b/Minecraft.Client/Network/PlayerConnection.h index bc3c376aa..0b8a74dc9 100644 --- a/Minecraft.Client/Network/PlayerConnection.h +++ b/Minecraft.Client/Network/PlayerConnection.h @@ -62,15 +62,15 @@ public: virtual void handleSetCarriedItem(std::shared_ptr packet); virtual void handleChat(std::shared_ptr packet); private: - void handleCommand(const wstring& message); + void handleCommand(const std::wstring& message); public: virtual void handleAnimate(std::shared_ptr packet); virtual void handlePlayerCommand(std::shared_ptr packet); virtual void handleDisconnect(std::shared_ptr packet); int countDelayedPackets(); - virtual void info(const wstring& string); - virtual void warn(const wstring& string); - virtual wstring getConsoleName(); + virtual void info(const std::wstring& string); + virtual void warn(const std::wstring& string); + virtual std::wstring getConsoleName(); virtual void handleInteract(std::shared_ptr packet); bool canHandleAsyncPackets(); virtual void handleClientCommand(std::shared_ptr packet); @@ -120,8 +120,8 @@ public: void closeOnTick() { m_bCloseOnTick = true; } // 4J Added so that we can send on textures that get received after this connection requested them - void handleTextureReceived(const wstring &textureName); - void handleTextureAndGeometryReceived(const wstring &textureName); + void handleTextureReceived(const std::wstring &textureName); + void handleTextureAndGeometryReceived(const std::wstring &textureName); void setShowOnMaps(bool bVal); @@ -133,7 +133,7 @@ public: private: bool m_bCloseOnTick; - vector m_texturesRequested; + vector m_texturesRequested; bool m_bWasKicked; }; diff --git a/Minecraft.Client/Network/PlayerInfo.h b/Minecraft.Client/Network/PlayerInfo.h index 427c78d88..280c9126f 100644 --- a/Minecraft.Client/Network/PlayerInfo.h +++ b/Minecraft.Client/Network/PlayerInfo.h @@ -4,10 +4,10 @@ using namespace std; class PlayerInfo { public: - wstring name; + std::wstring name; int latency; - PlayerInfo(const wstring &name) + PlayerInfo(const std::wstring &name) { this->name = name; latency = 0; diff --git a/Minecraft.Client/Network/PlayerList.cpp b/Minecraft.Client/Network/PlayerList.cpp index bfda41a48..6b2bd0cc8 100644 --- a/Minecraft.Client/Network/PlayerList.cpp +++ b/Minecraft.Client/Network/PlayerList.cpp @@ -439,7 +439,7 @@ void PlayerList::remove(std::shared_ptr player) saveAll(NULL,false); } -std::shared_ptr PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID onlineXuid) +std::shared_ptr PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const std::wstring& userName, PlayerUID xuid, PlayerUID onlineXuid) { if (players.size() >= maxPlayers) { @@ -957,9 +957,9 @@ void PlayerList::broadcastAll(std::shared_ptr packet, int dimension) } } -wstring PlayerList::getPlayerNames() +std::wstring PlayerList::getPlayerNames() { - wstring msg; + std::wstring msg; for (unsigned int i = 0; i < players.size(); i++) { if (i > 0) msg += L", "; @@ -968,12 +968,12 @@ wstring PlayerList::getPlayerNames() return msg; } -bool PlayerList::isWhiteListed(const wstring& name) +bool PlayerList::isWhiteListed(const std::wstring& name) { return true; } -bool PlayerList::isOp(const wstring& name) +bool PlayerList::isOp(const std::wstring& name) { return false; } @@ -989,7 +989,7 @@ bool PlayerList::isOp(std::shared_ptr player) return isOp; } -std::shared_ptr PlayerList::getPlayer(const wstring& name) +std::shared_ptr PlayerList::getPlayer(const std::wstring& name) { for (unsigned int i = 0; i < players.size(); i++) { @@ -1016,7 +1016,7 @@ std::shared_ptr PlayerList::getPlayer(PlayerUID uid) return nullptr; } -void PlayerList::sendMessage(const wstring& name, const wstring& message) +void PlayerList::sendMessage(const std::wstring& name, const std::wstring& message) { std::shared_ptr player = getPlayer(name); if (player != NULL) @@ -1097,7 +1097,7 @@ void PlayerList::broadcast(std::shared_ptr except, double x, double y, d } -void PlayerList::broadcastToAllOps(const wstring& message) +void PlayerList::broadcastToAllOps(const std::wstring& message) { std::shared_ptr chatPacket = std::shared_ptr( new ChatPacket(message) ); for (unsigned int i = 0; i < players.size(); i++) @@ -1110,7 +1110,7 @@ void PlayerList::broadcastToAllOps(const wstring& message) } } -bool PlayerList::sendTo(const wstring& name, std::shared_ptr packet) +bool PlayerList::sendTo(const std::wstring& name, std::shared_ptr packet) { std::shared_ptr player = getPlayer(name); if (player != NULL) @@ -1142,11 +1142,11 @@ void PlayerList::saveAll(ProgressListener *progressListener, bool bDeleteGuestMa } } -void PlayerList::whiteList(const wstring& playerName) +void PlayerList::whiteList(const std::wstring& playerName) { } -void PlayerList::blackList(const wstring& playerName) +void PlayerList::blackList(const std::wstring& playerName) { } diff --git a/Minecraft.Client/Network/PlayerList.h b/Minecraft.Client/Network/PlayerList.h index ce50270d7..58ccd3641 100644 --- a/Minecraft.Client/Network/PlayerList.h +++ b/Minecraft.Client/Network/PlayerList.h @@ -75,7 +75,7 @@ public: void add(std::shared_ptr player); void move(std::shared_ptr player); void remove(std::shared_ptr player); - std::shared_ptr getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid); + std::shared_ptr getPlayerForLogin(PendingConnection *pendingConnection, const std::wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid); std::shared_ptr respawn(std::shared_ptr serverPlayer, int targetDimension, bool keepAllPlayerData); void toggleDimension(std::shared_ptr player, int targetDimension); void tick(); @@ -84,23 +84,23 @@ public: void broadcastAll(std::shared_ptr packet); void broadcastAll(std::shared_ptr packet, int dimension); - wstring getPlayerNames(); + std::wstring getPlayerNames(); public: - bool isWhiteListed(const wstring& name); - bool isOp(const wstring& name); + bool isWhiteListed(const std::wstring& name); + bool isOp(const std::wstring& name); bool isOp(std::shared_ptr player); // 4J Added - std::shared_ptr getPlayer(const wstring& name); + std::shared_ptr getPlayer(const std::wstring& name); std::shared_ptr getPlayer(PlayerUID uid); - void sendMessage(const wstring& name, const wstring& message); + void sendMessage(const std::wstring& name, const std::wstring& message); void broadcast(double x, double y, double z, double range, int dimension, std::shared_ptr packet); void broadcast(std::shared_ptr except, double x, double y, double z, double range, int dimension, std::shared_ptr packet); - void broadcastToAllOps(const wstring& message); - bool sendTo(const wstring& name, std::shared_ptr packet); + void broadcastToAllOps(const std::wstring& message); + bool sendTo(const std::wstring& name, std::shared_ptr packet); // 4J Added ProgressListener *progressListener param and bDeleteGuestMaps param void saveAll(ProgressListener *progressListener, bool bDeleteGuestMaps = false); - void whiteList(const wstring& playerName); - void blackList(const wstring& playerName); + void whiteList(const std::wstring& playerName); + void blackList(const std::wstring& playerName); // Set getWhiteList(); / 4J removed void reloadWhitelist(); void sendLevelInfo(std::shared_ptr player, ServerLevel *level); diff --git a/Minecraft.Client/Network/ServerChunkCache.cpp b/Minecraft.Client/Network/ServerChunkCache.cpp index 7dcfd5ae7..178dd901e 100644 --- a/Minecraft.Client/Network/ServerChunkCache.cpp +++ b/Minecraft.Client/Network/ServerChunkCache.cpp @@ -897,7 +897,7 @@ bool ServerChunkCache::shouldSave() return !level->noSave; } -wstring ServerChunkCache::gatherStats() +std::wstring ServerChunkCache::gatherStats() { return L"ServerChunkCache: ";// + _toString(loadedChunks.size()) + L" Drop: " + _toString(toDrop.size()); } @@ -907,7 +907,7 @@ vector *ServerChunkCache::getMobsAt(MobCategory *mobCat return source->getMobsAt(mobCategory, x, y, z); } -TilePos *ServerChunkCache::findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z) +TilePos *ServerChunkCache::findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z) { return source->findNearestMapFeature(level, featureName, x, y, z); } diff --git a/Minecraft.Client/Network/ServerChunkCache.h b/Minecraft.Client/Network/ServerChunkCache.h index d054050d1..46ed35903 100644 --- a/Minecraft.Client/Network/ServerChunkCache.h +++ b/Minecraft.Client/Network/ServerChunkCache.h @@ -80,10 +80,10 @@ public: virtual bool save(bool force, ProgressListener *progressListener); virtual bool tick(); virtual bool shouldSave(); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z); private: typedef struct _SaveThreadData diff --git a/Minecraft.Client/Network/ServerCommandDispatcher.cpp b/Minecraft.Client/Network/ServerCommandDispatcher.cpp index 736e4209f..b9da8662d 100644 --- a/Minecraft.Client/Network/ServerCommandDispatcher.cpp +++ b/Minecraft.Client/Network/ServerCommandDispatcher.cpp @@ -52,7 +52,7 @@ ServerCommandDispatcher::ServerCommandDispatcher() Command::setLogger(this); } -void ServerCommandDispatcher::logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) +void ServerCommandDispatcher::logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message, int customData, const std::wstring& additionalMessage) { PlayerList *playerList = MinecraftServer::getInstance()->getPlayers(); //for (Player player : MinecraftServer.getInstance().getPlayers().players) diff --git a/Minecraft.Client/Network/ServerCommandDispatcher.h b/Minecraft.Client/Network/ServerCommandDispatcher.h index eaa98679b..8f5261914 100644 --- a/Minecraft.Client/Network/ServerCommandDispatcher.h +++ b/Minecraft.Client/Network/ServerCommandDispatcher.h @@ -7,5 +7,5 @@ class ServerCommandDispatcher : public CommandDispatcher, public AdminLogCommand { public: ServerCommandDispatcher(); - void logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); + void logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message = L"", int customData = -1, const std::wstring& additionalMessage = L""); }; \ No newline at end of file diff --git a/Minecraft.Client/Network/ServerConnection.cpp b/Minecraft.Client/Network/ServerConnection.cpp index a22549f6f..5a8321865 100644 --- a/Minecraft.Client/Network/ServerConnection.cpp +++ b/Minecraft.Client/Network/ServerConnection.cpp @@ -114,7 +114,7 @@ void ServerConnection::tick() } -bool ServerConnection::addPendingTextureRequest(const wstring &textureName) +bool ServerConnection::addPendingTextureRequest(const std::wstring &textureName) { AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); if( it == m_pendingTextureRequests.end() ) @@ -129,7 +129,7 @@ bool ServerConnection::addPendingTextureRequest(const wstring &textureName) return true; } -void ServerConnection::handleTextureReceived(const wstring &textureName) +void ServerConnection::handleTextureReceived(const std::wstring &textureName) { AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); if( it != m_pendingTextureRequests.end() ) @@ -146,7 +146,7 @@ void ServerConnection::handleTextureReceived(const wstring &textureName) } } -void ServerConnection::handleTextureAndGeometryReceived(const wstring &textureName) +void ServerConnection::handleTextureAndGeometryReceived(const std::wstring &textureName) { AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); if( it != m_pendingTextureRequests.end() ) diff --git a/Minecraft.Client/Network/ServerConnection.h b/Minecraft.Client/Network/ServerConnection.h index e4105675f..7d95157e8 100644 --- a/Minecraft.Client/Network/ServerConnection.h +++ b/Minecraft.Client/Network/ServerConnection.h @@ -24,7 +24,7 @@ private: vector< std::shared_ptr > players; // 4J - When the server requests a texture, it should add it to here while we are waiting for it - vector m_pendingTextureRequests; + vector m_pendingTextureRequests; public: MinecraftServer *server; @@ -42,8 +42,8 @@ public: void tick(); // 4J Added - bool addPendingTextureRequest(const wstring &textureName); - void handleTextureReceived(const wstring &textureName); - void handleTextureAndGeometryReceived(const wstring &textureName); + bool addPendingTextureRequest(const std::wstring &textureName); + void handleTextureReceived(const std::wstring &textureName); + void handleTextureAndGeometryReceived(const std::wstring &textureName); void handleServerSettingsChanged(std::shared_ptr packet); }; diff --git a/Minecraft.Client/Network/ServerInterface.h b/Minecraft.Client/Network/ServerInterface.h index b504b3952..9f0988c94 100644 --- a/Minecraft.Client/Network/ServerInterface.h +++ b/Minecraft.Client/Network/ServerInterface.h @@ -3,27 +3,27 @@ using namespace std; class ServerInterface { - virtual int getConfigInt(const wstring &name, int defaultValue) = 0; - virtual wstring getConfigString(const wstring &name, const wstring &defaultValue) = 0; - virtual bool getConfigBoolean(const wstring &name, bool defaultValue) = 0; - virtual void setProperty(wstring &propertyName, void *value) = 0; + virtual int getConfigInt(const std::wstring &name, int defaultValue) = 0; + virtual std::wstring getConfigString(const std::wstring &name, const std::wstring &defaultValue) = 0; + virtual bool getConfigBoolean(const std::wstring &name, bool defaultValue) = 0; + virtual void setProperty(std::wstring &propertyName, void *value) = 0; virtual void configSave() = 0; - virtual wstring getConfigPath() = 0; - virtual wstring getServerIp() = 0; + virtual std::wstring getConfigPath() = 0; + virtual std::wstring getServerIp() = 0; virtual int getServerPort() = 0; - virtual wstring getServerName() = 0; - virtual wstring getServerVersion() = 0; + virtual std::wstring getServerName() = 0; + virtual std::wstring getServerVersion() = 0; virtual int getPlayerCount() = 0; virtual int getMaxPlayers() = 0; - virtual wstring[] getPlayerNames() = 0; - virtual wstring getWorldName() = 0; - virtual wstring getPluginNames() = 0; + virtual std::wstring[] getPlayerNames() = 0; + virtual std::wstring getWorldName() = 0; + virtual std::wstring getPluginNames() = 0; virtual void disablePlugin() = 0; - virtual wstring runCommand(const wstring &command) = 0; + virtual std::wstring runCommand(const std::wstring &command) = 0; virtual bool isDebugging() = 0; // Logging - virtual void info(const wstring &string) = 0; - virtual void warn(const wstring &string) = 0; - virtual void error(const wstring &string) = 0; - virtual void debug(const wstring &string) = 0; + virtual void info(const std::wstring &string) = 0; + virtual void warn(const std::wstring &string) = 0; + virtual void error(const std::wstring &string) = 0; + virtual void debug(const std::wstring &string) = 0; }; \ No newline at end of file diff --git a/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h index be5d57fd7..68fb8bc47 100644 --- a/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h @@ -474,7 +474,7 @@ public: eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int,LPVOID, WCHAR *),LPVOID lpParam, int iUserData); eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int),LPVOID lpParam, int iUserData); eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(LPVOID,int,int,LPVOID,WCHAR *)=NULL,LPVOID lpParam=NULL, int iUserData=0); - bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); + bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename); eTitleStorageState TMSPP_GetTitleStorageState(int iPad); void TMSPP_ClearTitleStorageState(int iPad); diff --git a/Minecraft.Client/Platform/Durango/Durango_App.cpp b/Minecraft.Client/Platform/Durango/Durango_App.cpp index d4105be5d..aa5f518aa 100644 --- a/Minecraft.Client/Platform/Durango/Durango_App.cpp +++ b/Minecraft.Client/Platform/Durango/Durango_App.cpp @@ -169,7 +169,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType) int CConsoleMinecraftApp::LoadLocalDLCImages() { - std::unordered_map *pDLCInfoA=app.GetDLCInfo(); + std::unordered_map *pDLCInfoA=app.GetDLCInfo(); // 4J-PB - Any local graphic files for the Minecraft Store? for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) { @@ -183,7 +183,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImages() void CConsoleMinecraftApp::FreeLocalDLCImages() { // 4J-PB - Any local graphic files for the Minecraft Store? - std::unordered_map *pDLCInfoA=app.GetDLCInfo(); + std::unordered_map *pDLCInfoA=app.GetDLCInfo(); for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) { @@ -263,7 +263,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame app.ClearTerrainFeaturePosition(); - wstring wWorldName = L"TestWorld"; + std::wstring wWorldName = L"TestWorld"; StorageManager.ResetSaveData(); StorageManager.SetSaveTitle(wWorldName.c_str()); diff --git a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.cpp b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.cpp index f4d4978b8..983efb9d4 100644 --- a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.cpp +++ b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.cpp @@ -408,7 +408,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation(); m_statNames->Clear(); - for(wstring name : m_leaderboardStatNames[difficulty][type]) + for(std::wstring name : m_leaderboardStatNames[difficulty][type]) { m_statNames->Append(ref new P::String(name.c_str())); } @@ -548,7 +548,7 @@ void DurangoLeaderboardManager::updateStatsInfo(int userIndex, int difficulty, E } int statIndex = 0, sumScores = 0; - for(wstring statName : m_leaderboardStatNames[difficulty][type]) + for(std::wstring statName : m_leaderboardStatNames[difficulty][type]) { bool found = false; for(auto result : statsResult) @@ -585,7 +585,7 @@ void DurangoLeaderboardManager::GetProfilesCallback(LPVOID param, std::vector 0) { - dlm->m_displayNames = vector(); + dlm->m_displayNames = vector(); for (int i = 0; i < profiles.size(); i++) { dlm->m_displayNames.push_back(profiles[i]->GameDisplayName->Data()); @@ -699,7 +699,7 @@ void DurangoLeaderboardManager::setState(EStatsState newState) LeaveCriticalSection(&m_csStatsState); } -wstring DurangoLeaderboardManager::stateToString(EStatsState eState) +std::wstring DurangoLeaderboardManager::stateToString(EStatsState eState) { switch (eState) { diff --git a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.h b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.h index 3b0c005f6..b04fc6dae 100644 --- a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.h +++ b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoLeaderboardManager.h @@ -35,12 +35,12 @@ private: unsigned int m_maxRank; MXS::XboxLiveContext^ m_xboxLiveContext; - wstring m_leaderboardNames[4][eStatsType_MAX]; - wstring m_socialLeaderboardNames[4][eStatsType_MAX]; - std::vector m_leaderboardStatNames[4][eStatsType_MAX]; + std::wstring m_leaderboardNames[4][eStatsType_MAX]; + std::wstring m_socialLeaderboardNames[4][eStatsType_MAX]; + std::vector m_leaderboardStatNames[4][eStatsType_MAX]; // Display names for the current scores - std::vector m_displayNames; + std::vector m_displayNames; bool m_waitingForProfiles; int m_difficulty; @@ -90,5 +90,5 @@ private: EStatsState getState(); void setState(EStatsState newState); - wstring stateToString(EStatsState eState); + std::wstring stateToString(EStatsState eState); }; diff --git a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp index 03e37e037..dda2cf0db 100644 --- a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp +++ b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp @@ -16,14 +16,14 @@ namespace WFC = Windows::Foundation::Collections; namespace CC = concurrency; -StatParam::StatParam(const wstring &base) +StatParam::StatParam(const std::wstring &base) { m_base = base; //m_numArgs = numArgs; m_args = vector(); unsigned int count=0; - wstring::size_type pos =base.find(L"*"); + std::wstring::size_type pos =base.find(L"*"); while(pos!=string::npos) { count++; @@ -46,14 +46,14 @@ void StatParam::addArgs(int v1, ...) va_end(argptr); } -vector *StatParam::getStats() +vector *StatParam::getStats() { - vector *out = new vector(); + vector *out = new vector(); static const int MAXSIZE = 256; - static const wstring SUBSTR = L"*"; + static const std::wstring SUBSTR = L"*"; - wstring wstr_itr, wstr_num; + std::wstring wstr_itr, wstr_num; if (m_args.size() <= 0 || m_numArgs <= 0) { @@ -69,10 +69,10 @@ vector *StatParam::getStats() { for (int j=0; j *DurangoStatsDebugger::getStats() +vector *DurangoStatsDebugger::getStats() { - vector *out = new vector(); + vector *out = new vector(); for (auto it = m_stats.begin(); it!=m_stats.end(); it++) { - vector *sublist = (*it)->getStats(); + vector *sublist = (*it)->getStats(); out->insert(out->end(), sublist->begin(), sublist->end()); } @@ -322,11 +322,11 @@ void DurangoStatsDebugger::PrintStats(int iPad) { if (instance == NULL) instance = Initialize(); - vector *tmp = instance->getStats(); + vector *tmp = instance->getStats(); instance->m_printQueue.insert(instance->m_printQueue.end(), tmp->begin(), tmp->end()); // app.DebugPrintf("[DEBUG] START\n"); - // for (wstring t : *tmp) app.DebugPrintf("[DEBUG] %s\n", wstringtofilename(t)); + // for (std::wstring t : *tmp) app.DebugPrintf("[DEBUG] %s\n", wstringtofilename(t)); // app.DebugPrintf("[DEBUG] END\n"); instance->retrieveStats(iPad); @@ -407,7 +407,7 @@ void DurangoStatsDebugger::retrieveStats(int iPad) // Create Stat retrieval threads until there is no long any stats to start retrieving. while ( !instance->m_printQueue.empty() ) { - vector *printing = new vector(); + vector *printing = new vector(); if (m_printQueue.size() > R_SIZE) { diff --git a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.h b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.h index 80218c9d2..4c3f5d22b 100644 --- a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.h +++ b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.h @@ -11,17 +11,17 @@ namespace MXSL = Microsoft::Xbox::Services::Leaderboard; class StatParam { private: - wstring m_base; + std::wstring m_base; int m_numArgs; vector m_args; public: - StatParam(const wstring &base); + StatParam(const std::wstring &base); void addArgs(int v1, ...); - vector *getStats(); + vector *getStats(); }; @@ -67,7 +67,7 @@ protected: vector m_stats; - vector *getStats(); + vector *getStats(); public: static DurangoStatsDebugger *Initialize(); @@ -75,15 +75,15 @@ public: static void PrintStats(int iPad); private: - vector m_printQueue; + vector m_printQueue; void retrieveStats(int iPad); typedef struct { int m_iPad; - wstring m_statName; - wstring m_score; + std::wstring m_statName; + std::wstring m_score; } StatResult; CRITICAL_SECTION m_retrievedStatsLock; diff --git a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.cpp b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.cpp index 75226c7c5..f85448526 100644 --- a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.cpp +++ b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.cpp @@ -22,14 +22,14 @@ DQRNetworkManager::ePartyProcessType DQRNetworkManager::m_partyProcess = DQRNetw bool DQRNetworkManager::m_inviteReceived = false; int DQRNetworkManager::m_bootUserIndex; -wstring DQRNetworkManager::m_bootSessionName; -wstring DQRNetworkManager::m_bootServiceConfig; -wstring DQRNetworkManager::m_bootSessionTemplate; +std::wstring DQRNetworkManager::m_bootSessionName; +std::wstring DQRNetworkManager::m_bootServiceConfig; +std::wstring DQRNetworkManager::m_bootSessionTemplate; DQRNetworkManager * DQRNetworkManager::s_pDQRManager = NULL; //using namespace Windows::Xbox::Networking; -DQRNetworkManager::SessionInfo::SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate) +DQRNetworkManager::SessionInfo::SessionInfo(std::wstring& sessionName, std::wstring& serviceConfig, std::wstring& sessionTemplate) { m_detailsValid = true; m_sessionName = sessionName; @@ -782,7 +782,7 @@ DQRNetworkPlayer *DQRNetworkManager::GetPlayerByXuid(PlayerUID xuid) } // Retrieve player display name by gamertag -wstring DQRNetworkManager::GetDisplayNameByGamertag(wstring gamertag) +std::wstring DQRNetworkManager::GetDisplayNameByGamertag(std::wstring gamertag) { if (m_displayNames.find(gamertag) != m_displayNames.end()) { @@ -2184,7 +2184,7 @@ int DQRNetworkManager::HostGameThreadProc() if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i)) { auto user = ProfileManager.GetUser(i); - wstring displayName = ProfileManager.GetDisplayName(i); + std::wstring displayName = ProfileManager.GetDisplayName(i); DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress); pPlayer->SetSmallId(smallId); @@ -3031,7 +3031,7 @@ void DQRNetworkManager::GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Servi } // Set player display name -void DQRNetworkManager::SetDisplayName(PlayerUID xuid, wstring displayName) +void DQRNetworkManager::SetDisplayName(PlayerUID xuid, std::wstring displayName) { EnterCriticalSection(&m_csRoomSyncData); for (int i = 0; i < m_roomSyncData.playerCount; i++) diff --git a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.h b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.h index dc4929852..eee2d5a3b 100644 --- a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.h +++ b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager.h @@ -119,12 +119,12 @@ public: class SessionInfo { public: - SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate); + SessionInfo(std::wstring& sessionName, std::wstring& serviceConfig, std::wstring& sessionTemplate); SessionInfo(); bool m_detailsValid; - wstring m_sessionName; - wstring m_serviceConfig; - wstring m_sessionTemplate; + std::wstring m_sessionName; + std::wstring m_serviceConfig; + std::wstring m_sessionTemplate; }; static const int MAX_LOCAL_PLAYER_COUNT = 4; @@ -153,7 +153,7 @@ public: { public:; DQRNetworkPlayer* m_pPlayer; - wstring m_name; + std::wstring m_name; unsigned int m_sessionAddress; int m_channel; bool m_sync; @@ -181,7 +181,7 @@ public: DQRNetworkPlayer *GetPlayerByIndex(int idx); DQRNetworkPlayer *GetPlayerBySmallId(int idx); DQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid); - wstring GetDisplayNameByGamertag(wstring gamertag); + std::wstring GetDisplayNameByGamertag(std::wstring gamertag); DQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx); DQRNetworkPlayer *GetHostPlayer(); int GetSessionIndex(DQRNetworkPlayer *player); @@ -223,16 +223,16 @@ public: public: SessionSearchResult() { m_extData = NULL; } ~SessionSearchResult() { free(m_extData); } - wstring m_partyId; - wstring m_sessionName; + std::wstring m_partyId; + std::wstring m_sessionName; // These names/xuids reflect the server controlled list of who is actually in the game - wstring m_playerNames[MAX_ONLINE_PLAYER_COUNT]; + std::wstring m_playerNames[MAX_ONLINE_PLAYER_COUNT]; PlayerUID m_playerXuids[MAX_ONLINE_PLAYER_COUNT]; int m_playerCount; // This count & set of xuids reflects the session document list of who is in the game - wstring m_sessionXuids[MAX_ONLINE_PLAYER_COUNT]; + std::wstring m_sessionXuids[MAX_ONLINE_PLAYER_COUNT]; int m_usedSlotCount; void *m_extData; @@ -488,7 +488,7 @@ public: bool JoinPartyFromSearchResult(SessionSearchResult *searchResult, int playerMask); void CancelJoinPartyFromSearchResult(); void RequestDisplayName(DQRNetworkPlayer *player); - void SetDisplayName(PlayerUID xuid, wstring displayName); + void SetDisplayName(PlayerUID xuid, std::wstring displayName); private: __int64 m_playersLeftPartyTime; @@ -509,7 +509,7 @@ private: int m_sessionResultCount; bool m_cancelJoinFromSearchResult; - map m_displayNames; // Player display names by gamertag + map m_displayNames; // Player display names by gamertag @@ -521,9 +521,9 @@ private: } ePartyProcessType; static int m_bootUserIndex; static ePartyProcessType m_partyProcess; - static wstring m_bootSessionName; - static wstring m_bootServiceConfig; - static wstring m_bootSessionTemplate; + static std::wstring m_bootSessionName; + static std::wstring m_bootServiceConfig; + static std::wstring m_bootSessionTemplate; static bool m_inviteReceived; static DQRNetworkManager *s_pDQRManager; diff --git a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_FriendSessions.cpp b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_FriendSessions.cpp index a78ed8853..644bc6c3f 100644 --- a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_FriendSessions.cpp +++ b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_FriendSessions.cpp @@ -421,7 +421,7 @@ int DQRNetworkManager::GetFriendsThreadProc() } for( int j = 0; j < m_sessionSearchResults[i].m_usedSlotCount; j++ ) { - m_sessionSearchResults[i].m_sessionXuids[j] = wstring( newSessionVector[i]->Members->GetAt(j)->XboxUserId->Data() ); + m_sessionSearchResults[i].m_sessionXuids[j] = std::wstring( newSessionVector[i]->Members->GetAt(j)->XboxUserId->Data() ); } m_sessionSearchResults[i].m_extData = malloc( sizeof(GameSessionData) ); diff --git a/Minecraft.Client/Platform/Durango/Network/DQRNetworkPlayer.cpp b/Minecraft.Client/Platform/Durango/Network/DQRNetworkPlayer.cpp index 404c872c2..e25f09aa5 100644 --- a/Minecraft.Client/Platform/Durango/Network/DQRNetworkPlayer.cpp +++ b/Minecraft.Client/Platform/Durango/Network/DQRNetworkPlayer.cpp @@ -192,13 +192,13 @@ void DQRNetworkPlayer::SetName(const wchar_t *name) } // Return display name (if display name is not set, return name instead) -wstring DQRNetworkPlayer::GetDisplayName() +std::wstring DQRNetworkPlayer::GetDisplayName() { return (m_displayName == L"") ? m_name : m_displayName; } // Set display name -void DQRNetworkPlayer::SetDisplayName(wstring displayName) +void DQRNetworkPlayer::SetDisplayName(std::wstring displayName) { m_displayName = displayName; } \ No newline at end of file diff --git a/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.cpp b/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.cpp index 304ad988a..5a2e2a01b 100644 --- a/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.cpp +++ b/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.cpp @@ -97,7 +97,7 @@ const wchar_t *NetworkPlayerDurango::GetOnlineName() return m_dqrPlayer->GetName(); } -wstring NetworkPlayerDurango::GetDisplayName() +std::wstring NetworkPlayerDurango::GetDisplayName() { return m_dqrPlayer->GetDisplayName(); } diff --git a/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.h b/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.h index e4051b1ed..e78d8a973 100644 --- a/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.h +++ b/Minecraft.Client/Platform/Durango/Network/NetworkPlayerDurango.h @@ -28,7 +28,7 @@ public: virtual void SetSocket(Socket *pSocket); virtual Socket *GetSocket(); virtual const wchar_t *GetOnlineName(); - virtual wstring GetDisplayName(); + virtual std::wstring GetDisplayName(); virtual PlayerUID GetUID(); void SetUID(PlayerUID UID); diff --git a/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.cpp b/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.cpp index 74445a433..c2c7a253b 100644 --- a/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.cpp +++ b/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.cpp @@ -744,12 +744,12 @@ bool CPlatformNetworkManagerDurango::SystemFlagGet(INetworkPlayer *pNetworkPlaye return false; } -wstring CPlatformNetworkManagerDurango::GatherStats() +std::wstring CPlatformNetworkManagerDurango::GatherStats() { return L""; } -wstring CPlatformNetworkManagerDurango::GatherRTTStats() +std::wstring CPlatformNetworkManagerDurango::GatherRTTStats() { return L""; } @@ -883,7 +883,7 @@ INetworkPlayer * CPlatformNetworkManagerDurango::GetPlayerBySmallId(unsigned cha return getNetworkPlayer(m_pDQRNet->GetPlayerBySmallId(smallId)); } -wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(wstring gamertag) +std::wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(std::wstring gamertag) { return m_pDQRNet->GetDisplayNameByGamertag(gamertag); } diff --git a/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.h b/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.h index 40d662f00..11a988445 100644 --- a/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.h +++ b/Minecraft.Client/Platform/Durango/Network/PlatformNetworkManagerDurango.h @@ -28,7 +28,7 @@ public: virtual INetworkPlayer *GetPlayerByIndex(int playerIndex); virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid); virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId); - virtual wstring GetDisplayNameByGamertag(wstring gamertag); + virtual std::wstring GetDisplayNameByGamertag(std::wstring gamertag); virtual bool ShouldMessageForFullSession(); virtual INetworkPlayer *GetHostPlayer(); @@ -120,8 +120,8 @@ private: float m_lastPlayerEventTimeStart; public: - wstring GatherStats(); - wstring GatherRTTStats(); + std::wstring GatherStats(); + std::wstring GatherRTTStats(); private: vector friendsSessions[XUSER_MAX_COUNT]; diff --git a/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.cpp b/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.cpp index f53e3f824..c692fe0f5 100644 --- a/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.cpp +++ b/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.cpp @@ -971,9 +971,9 @@ DurangoStats *CDurangoTelemetryManager::durangoStats() return (DurangoStats*) GenericStats::getInstance(); } -wstring CDurangoTelemetryManager::guid2str(LPCGUID guid) +std::wstring CDurangoTelemetryManager::guid2str(LPCGUID guid) { - wstring out = L"GUID<"; + std::wstring out = L"GUID<"; out += _toString(guid->Data1); out += L":"; out += _toString(guid->Data2); diff --git a/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.h b/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.h index c4e6b23aa..2e78162b9 100644 --- a/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.h +++ b/Minecraft.Client/Platform/Durango/Sentient/DurangoTelemetry.h @@ -9,7 +9,7 @@ class CDurangoTelemetryManager : public CTelemetryManager public: static GUID ZERO_GUID; - std::unordered_map m_multiplayerRoundStartTimes; + std::unordered_map m_multiplayerRoundStartTimes; CDurangoTelemetryManager(); @@ -46,5 +46,5 @@ public: protected: DurangoStats *durangoStats(); - wstring guid2str(LPCGUID guid); + std::wstring guid2str(LPCGUID guid); }; \ No newline at end of file diff --git a/Minecraft.Client/Platform/Linux/Linux_App.cpp b/Minecraft.Client/Platform/Linux/Linux_App.cpp index 5c94c4fc8..85421ed0e 100644 --- a/Minecraft.Client/Platform/Linux/Linux_App.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_App.cpp @@ -71,7 +71,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame app.ClearTerrainFeaturePosition(); - wstring wWorldName = L"TestWorld"; + std::wstring wWorldName = L"TestWorld"; StorageManager.ResetSaveData(); StorageManager.SetSaveTitle(wWorldName.c_str()); diff --git a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp index cb4fd70c1..3b4043e55 100644 --- a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp @@ -568,7 +568,7 @@ int StartMinecraftThreadProc( void* lpParameter ) AABB::UseDefaultThreadStorage(); Tesselator::CreateNewThreadStorage(1024*1024); RenderManager.InitialiseContext(); - Minecraft::start(wstring(),wstring()); + Minecraft::start(std::wstring(),std::wstring()); delete Tesselator::getInstance(); return 0; } @@ -991,7 +991,7 @@ Vec3::resetPool(); vector vRichPresenceStrings; -// convert wstring to UTF-8 string +// convert std::wstring to UTF-8 string std::string wstring_to_utf8 (const std::wstring& str) { std::wstring_convert> myconv; diff --git a/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Profile.h index 03651b8fe..cfa964266 100644 --- a/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Profile.h +++ b/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Profile.h @@ -88,7 +88,7 @@ public: int GetPrimaryPad(); void SetPrimaryPad(int iPad); char* GetGamertag(int iPad); - wstring GetDisplayName(int iPad); + std::wstring GetDisplayName(int iPad); bool IsFullVersion(); void SetFullVersion(bool bFull); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); diff --git a/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Storage.h index f586df2cb..230b540b8 100644 --- a/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Orbis/4JLibs/inc/4J_Storage.h @@ -405,7 +405,7 @@ public: void SetDLCProductCode(const char* szProductCode); void SetProductUpgradeKey(const char* szKey); bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam); - void SetDLCInfoMap(std::unordered_map* pSONYDLCMap); + void SetDLCInfoMap(std::unordered_map* pSONYDLCMap); }; extern C4JStorage StorageManager; diff --git a/Minecraft.Client/Platform/Orbis/Leaderboards/OrbisLeaderboardManager.cpp b/Minecraft.Client/Platform/Orbis/Leaderboards/OrbisLeaderboardManager.cpp index 858c85d20..f7556b5d0 100644 --- a/Minecraft.Client/Platform/Orbis/Leaderboards/OrbisLeaderboardManager.cpp +++ b/Minecraft.Client/Platform/Orbis/Leaderboards/OrbisLeaderboardManager.cpp @@ -1005,8 +1005,8 @@ void OrbisLeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRank out.m_uid.setOnlineID( rankData.npId.handle, true ); out.m_rank = rankData.rank; - // Convert to wstring and copy name. - wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str(); + // Convert to std::wstring and copy name. + std::wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str(); //memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE); out.m_name=wstrName; } diff --git a/Minecraft.Client/Platform/Orbis/Orbis_App.cpp b/Minecraft.Client/Platform/Orbis/Orbis_App.cpp index 731803892..2335af057 100644 --- a/Minecraft.Client/Platform/Orbis/Orbis_App.cpp +++ b/Minecraft.Client/Platform/Orbis/Orbis_App.cpp @@ -99,7 +99,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU() SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) { - wstring wstrTemp=convStringToWstring(pchTitle); + std::wstring wstrTemp=convStringToWstring(pchTitle); AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp)); if(it == m_SONYDLCMap.end()) @@ -191,7 +191,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes() // push this into a vector - wstring wstrTemp=convStringToWstring(chDLCTitle); + std::wstring wstrTemp=convStringToWstring(chDLCTitle); m_SONYDLCMap[wstrTemp]=pDLCInfo; } CloseHandle(file); @@ -288,7 +288,7 @@ int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameI int CConsoleMinecraftApp::LoadLocalDLCImages() { // 4J-PB - Any local graphic files for the Minecraft Store? - std::unordered_map*pDLCInfoA=app.GetSonyDLCMap(); + std::unordered_map*pDLCInfoA=app.GetSonyDLCMap(); for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) { SONYDLC * pDLCInfo=(*it).second; @@ -301,7 +301,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImages() void CConsoleMinecraftApp::FreeLocalDLCImages() { // 4J-PB - Any local graphic files for the Minecraft Store? - std::unordered_map*pDLCInfoA=app.GetSonyDLCMap(); + std::unordered_map*pDLCInfoA=app.GetSonyDLCMap(); for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) { SONYDLC * pDLCInfo=(*it).second; @@ -394,7 +394,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame app.ClearTerrainFeaturePosition(); - wstring wWorldName = L"TestWorld"; + std::wstring wWorldName = L"TestWorld"; StorageManager.ResetSaveData(); StorageManager.SetSaveTitle(wWorldName.c_str()); diff --git a/Minecraft.Client/Platform/Orbis/Orbis_App.h b/Minecraft.Client/Platform/Orbis/Orbis_App.h index 69ea7dfbc..d7f395533 100644 --- a/Minecraft.Client/Platform/Orbis/Orbis_App.h +++ b/Minecraft.Client/Platform/Orbis/Orbis_App.h @@ -161,7 +161,7 @@ public: bool DLCAlreadyPurchased(char *pchTitle); char *GetSkuIDFromProductList(); void GetDLCSkuIDFromProductList(char *,char *); - std::unordered_map* GetSonyDLCMap() { return &m_SONYDLCMap; } + std::unordered_map* GetSonyDLCMap() { return &m_SONYDLCMap; } static void CommerceInitCallback(LPVOID lpParam,int err); static void CommerceGetCategoriesCallback(LPVOID lpParam,int err); static void CommerceGetProductListCallback(LPVOID lpParam,int err); @@ -210,7 +210,7 @@ private: // SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed; PRODUCTCODES ProductCodes; - std::unordered_map m_SONYDLCMap; + std::unordered_map m_SONYDLCMap; bool m_bVoiceChatAndUGCRestricted; diff --git a/Minecraft.Client/Platform/Orbis/Orbis_Minecraft.cpp b/Minecraft.Client/Platform/Orbis/Orbis_Minecraft.cpp index 814533725..d88c1c4f1 100644 --- a/Minecraft.Client/Platform/Orbis/Orbis_Minecraft.cpp +++ b/Minecraft.Client/Platform/Orbis/Orbis_Minecraft.cpp @@ -757,7 +757,7 @@ int StartMinecraftThreadProc( void* lpParameter ) AABB::UseDefaultThreadStorage(); Tesselator::CreateNewThreadStorage(1024*1024); RenderManager.InitialiseContext(); - Minecraft::start(wstring(),wstring()); + Minecraft::start(std::wstring(),std::wstring()); delete Tesselator::getInstance(); return 0; } @@ -1462,8 +1462,8 @@ int main(int argc, const char *argv[] ) vector vRichPresenceStrings; -// convert wstring to UTF-8 string -std::string wstring_to_utf8 (const std::wstring& str) +// convert std::wstring to UTF-8 string +std::string std::wstring_to_utf8 (const std::wstring& str) { std::wstring_convert> myconv; return myconv.to_bytes(str); @@ -1475,7 +1475,7 @@ uint8_t *mallocAndCreateUTF8ArrayFromString(int iID) LPCWSTR wchString=app.GetString(iID); std::wstring srcString = wchString; - std::string dstString = wstring_to_utf8(srcString); + std::string dstString = std::wstring_to_utf8(srcString); int dst_len = dstString.size()+1; uint8_t *strUtf8=(uint8_t *)malloc(dst_len); diff --git a/Minecraft.Client/Platform/Orbis/Orbis_PlayerUID.cpp b/Minecraft.Client/Platform/Orbis/Orbis_PlayerUID.cpp index 79a0ce409..633c43187 100644 --- a/Minecraft.Client/Platform/Orbis/Orbis_PlayerUID.cpp +++ b/Minecraft.Client/Platform/Orbis/Orbis_PlayerUID.cpp @@ -41,7 +41,7 @@ PlayerUID::PlayerUID(SceUserServiceUserId userID, SceNpOnlineId& onlineID, bool setOnlineID(onlineID, bSignedInPSN); } -PlayerUID::PlayerUID(wstring fromString) +PlayerUID::PlayerUID(std::wstring fromString) { // create for the format P_5e7ff8372ea9_00000004_Mark_4J @@ -53,14 +53,14 @@ PlayerUID::PlayerUID(wstring fromString) // parse the mac address next for(int i=0;i<6;i++) { - wstring macDigit = fromString.substr(2+(i*2),2); + std::wstring macDigit = fromString.substr(2+(i*2),2); m_macAddress[i] = _fromHEXString(macDigit); } int userIdLen = 0; // parse the userID - wstring userIDDigits = L""; + std::wstring userIDDigits = L""; while(fromString.at(15 + userIdLen) != L'_') { @@ -71,7 +71,7 @@ PlayerUID::PlayerUID(wstring fromString) m_userID = _fromString(userIDDigits); // finally, the onlineID, if there is one - wstring onlineID = fromString.substr(15 + userIdLen + 1); + std::wstring onlineID = fromString.substr(15 + userIdLen + 1); if(onlineID.size() > 0) { wcstombs(m_onlineID, onlineID.c_str(), 16); diff --git a/Minecraft.Client/Platform/PS3/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Platform/PS3/4JLibs/inc/4J_Profile.h index 888c38cc5..288c8cb9e 100644 --- a/Minecraft.Client/Platform/PS3/4JLibs/inc/4J_Profile.h +++ b/Minecraft.Client/Platform/PS3/4JLibs/inc/4J_Profile.h @@ -78,7 +78,7 @@ public: int GetPrimaryPad(); void SetPrimaryPad(int iPad); char* GetGamertag(int iPad); - wstring GetDisplayName(int iPad); + std::wstring GetDisplayName(int iPad); bool IsFullVersion(); void SetFullVersion(bool bFull); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); diff --git a/Minecraft.Client/Platform/PS3/Leaderboards/PS3LeaderboardManager.cpp b/Minecraft.Client/Platform/PS3/Leaderboards/PS3LeaderboardManager.cpp index a00908f7d..1ea484de9 100644 --- a/Minecraft.Client/Platform/PS3/Leaderboards/PS3LeaderboardManager.cpp +++ b/Minecraft.Client/Platform/PS3/Leaderboards/PS3LeaderboardManager.cpp @@ -990,8 +990,8 @@ void PS3LeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRankDa out.m_uid.setOnlineID( rankData.npId.handle, true ); out.m_rank = rankData.rank; - // Convert to wstring and copy name. - wstring wstrName = convStringToWstring( string(rankData.onlineName.data) ).c_str(); + // Convert to std::wstring and copy name. + std::wstring wstrName = convStringToWstring( string(rankData.onlineName.data) ).c_str(); //memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE); out.m_name=wstrName; } diff --git a/Minecraft.Client/Platform/PS3/PS3_App.cpp b/Minecraft.Client/Platform/PS3/PS3_App.cpp index 575336597..80e64602b 100644 --- a/Minecraft.Client/Platform/PS3/PS3_App.cpp +++ b/Minecraft.Client/Platform/PS3/PS3_App.cpp @@ -105,7 +105,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU() SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) { - wstring wstrTemp=convStringToWstring(pchTitle); + std::wstring wstrTemp=convStringToWstring(pchTitle); SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp); return pTemp; @@ -174,7 +174,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes() // push this into a vector - wstring wstrTemp=convStringToWstring(chDLCTitle); + std::wstring wstrTemp=convStringToWstring(chDLCTitle); m_SONYDLCMap[wstrTemp]=pDLCInfo; } CloseHandle(file); @@ -466,7 +466,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType) } -LoadSaveDataThreadParam* LoadSaveFromDisk(const wstring& pathName) +LoadSaveDataThreadParam* LoadSaveFromDisk(const std::wstring& pathName) { File saveFile(pathName); __int64 fileSize = saveFile.length(); @@ -501,7 +501,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame - app.ClearTerrainFeaturePosition(); wstring wWorldName = L"TestWorld"; + app.ClearTerrainFeaturePosition(); std::wstring wWorldName = L"TestWorld"; StorageManager.ResetSaveData(); StorageManager.SetSaveTitle(wWorldName.c_str()); @@ -519,7 +519,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; #ifdef SAVE_GAME_TO_LOAD - param->saveData = LoadSaveFromDisk(wstring(SAVE_GAME_TO_LOAD)); + param->saveData = LoadSaveFromDisk(std::wstring(SAVE_GAME_TO_LOAD)); #else param->saveData = NULL; #endif diff --git a/Minecraft.Client/Platform/PS3/PS3_App.h b/Minecraft.Client/Platform/PS3/PS3_App.h index 1498faf0b..aba7bbaf4 100644 --- a/Minecraft.Client/Platform/PS3/PS3_App.h +++ b/Minecraft.Client/Platform/PS3/PS3_App.h @@ -202,7 +202,7 @@ private: // SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed; PRODUCTCODES ProductCodes; - std::unordered_map m_SONYDLCMap; + std::unordered_map m_SONYDLCMap; bool m_bVoiceChatAndUGCRestricted; diff --git a/Minecraft.Client/Platform/PS3/PS3_Minecraft.cpp b/Minecraft.Client/Platform/PS3/PS3_Minecraft.cpp index b3c9856a2..e1cc711e8 100644 --- a/Minecraft.Client/Platform/PS3/PS3_Minecraft.cpp +++ b/Minecraft.Client/Platform/PS3/PS3_Minecraft.cpp @@ -951,7 +951,7 @@ int main() // 4J-PB - TRC that we need to be able to see the BD in a different titled save from the digital game if(StorageManager.GetBootTypeDisc()) { - wstring wsTemp = app.GetString(IDS_GAMENAME); + std::wstring wsTemp = app.GetString(IDS_GAMENAME); WCHAR wchTemp[64]; wsTemp.append(L" ("); mbstowcs(wchTemp,app.GetDiscProductCode(),64); @@ -991,7 +991,7 @@ int main() delete [] baSaveImage.data; } - wstring wsName=L"Graphics\\SaveChest.png"; + std::wstring wsName=L"Graphics\\SaveChest.png"; byteArray baSaveLoadIcon = app.getArchiveFile(wsName); if(baSaveLoadIcon.data!=NULL) { diff --git a/Minecraft.Client/Platform/PS3/PS3_PlayerUID.cpp b/Minecraft.Client/Platform/PS3/PS3_PlayerUID.cpp index ed5790c56..8a2d75961 100644 --- a/Minecraft.Client/Platform/PS3/PS3_PlayerUID.cpp +++ b/Minecraft.Client/Platform/PS3/PS3_PlayerUID.cpp @@ -30,7 +30,7 @@ PlayerUID::PlayerUID(CellSysutilUserId userID, SceNpOnlineId& onlineID, bool bSi setOnlineID(onlineID, bSignedInPSN); } -PlayerUID::PlayerUID(wstring fromString) +PlayerUID::PlayerUID(std::wstring fromString) { // create for the format P_5e7ff8372ea9_00000004_Mark_4J @@ -42,16 +42,16 @@ PlayerUID::PlayerUID(wstring fromString) // parse the mac address next for(int i=0;i<6;i++) { - wstring macDigit = fromString.substr(2+(i*2),2); + std::wstring macDigit = fromString.substr(2+(i*2),2); m_macAddress[i] = _fromHEXString(macDigit); } // parse the userID - wstring userIDDigits = fromString.substr(15,8); + std::wstring userIDDigits = fromString.substr(15,8); m_userID = _fromString(userIDDigits); // finally, the onlineID, if there is one - wstring onlineID = fromString.substr(24); + std::wstring onlineID = fromString.substr(24); if(onlineID.size() > 0) { wcstombs(m_onlineID, onlineID.c_str(), 16); diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/HugeMushroomTile_SPU.h b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/HugeMushroomTile_SPU.h index 89aad1aa5..5ad1027cd 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/HugeMushroomTile_SPU.h +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/HugeMushroomTile_SPU.h @@ -4,8 +4,8 @@ class HugeMushroomTile_SPU : public Tile_SPU { public: -// static const wstring TEXTURE_STEM; -// static const wstring TEXTURE_INSIDE; +// static const std::wstring TEXTURE_STEM; +// static const std::wstring TEXTURE_INSIDE; private: static const int HUGE_MUSHROOM_TEXTURE_COUNT = 2; diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h index f4ba6ccfa..b40a2b50b 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h @@ -49,7 +49,7 @@ public: return getV0() + (diff * ((float) offset / 16)); //SharedConstants::WORLD_RESOLUTION)); } -// virtual wstring getName() const = 0; +// virtual std::wstring getName() const = 0; // virtual int getSourceWidth() const = 0; // virtual int getSourceHeight() const = 0; }; diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LeafTile_SPU.cpp b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LeafTile_SPU.cpp index 673732652..be7c1d3c1 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LeafTile_SPU.cpp +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LeafTile_SPU.cpp @@ -8,7 +8,7 @@ // IDS_TILE_LEAVES_BIRCH, // }; // -// const wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},}; +// const std::wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},}; // from TransparentTile, since we're no longer inheriting diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp index 41a6b0764..19d27230e 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp @@ -7,10 +7,10 @@ #include "../Common/spu_assert.h" #endif -// const wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava"; -// const wstring LiquidTile::TEXTURE_WATER_STILL = L"water"; -// const wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow"; -// const wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow"; +// const std::wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava"; +// const std::wstring LiquidTile::TEXTURE_WATER_STILL = L"water"; +// const std::wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow"; +// const std::wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow"; #define MATH_PI (3.141592654f) diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/TallGrass_SPU.cpp b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/TallGrass_SPU.cpp index cf849e993..98f356ef4 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/TallGrass_SPU.cpp +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/TallGrass_SPU.cpp @@ -11,7 +11,7 @@ const int TallGrass_SPU::DEAD_SHRUB = 0; const int TallGrass_SPU::TALL_GRASS = 1; const int TallGrass_SPU::FERN = 2; -// const wstring TallGrass::TEXTURE_NAMES[] = {L"deadbush", L"tallgrass", L"fern"}; +// const std::wstring TallGrass::TEXTURE_NAMES[] = {L"deadbush", L"tallgrass", L"fern"}; Icon_SPU *TallGrass_SPU::getTexture(int face, int data) diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp index a11e242f2..eb768ac4c 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp @@ -575,7 +575,7 @@ void Tile_SPU::updateDefaultShape() // return this; // } // -// wstring Tile_SPU::getName() +// std::wstring Tile_SPU::getName() // { // return I18n::get(getDescriptionId() + L".name"); // } @@ -655,12 +655,12 @@ Material_SPU* Tile_SPU::getMaterial() // icon = iconRegister->registerIcon(m_textureName); // } // -// wstring Tile_SPU::getTileItemIconName() +// std::wstring Tile_SPU::getTileItemIconName() // { // return L""; // } // -// Tile *Tile_SPU::setTextureName(const wstring &name) +// Tile *Tile_SPU::setTextureName(const std::wstring &name) // { // m_textureName = name; // return this; diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h index f5c9793ea..b11dd5fc2 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h @@ -223,7 +223,7 @@ private: // unsigned int descriptionId; // unsigned int useDescriptionId; // 4J Added // -// wstring m_textureName; +// std::wstring m_textureName; protected: // Icon *icon; diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h index e298ae2dc..e24f293dc 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h @@ -173,7 +173,7 @@ public: // public: // ZipFile(File *file) {} // InputStream *getInputStream(ZipEntry *entry) { return NULL; } -// ZipEntry *getEntry(const wstring& name) {return NULL;} +// ZipEntry *getEntry(const std::wstring& name) {return NULL;} // void close() {} // }; // @@ -189,7 +189,7 @@ public: // static void create() {} // static void destroy() {} // static bool isKeyDown(int) {return false;} -// static wstring getKeyName(int) { return L"KEYNAME"; } +// static std::wstring getKeyName(int) { return L"KEYNAME"; } // static void enableRepeatEvents(bool) {} // static const int KEY_A = 0; // static const int KEY_B = 1; diff --git a/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Profile.h index 2fc9385a1..244783786 100644 --- a/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Profile.h +++ b/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Profile.h @@ -101,7 +101,7 @@ public: int GetPrimaryPad(); void SetPrimaryPad(int iPad); char* GetGamertag(int iPad); - wstring GetDisplayName(int iPad); + std::wstring GetDisplayName(int iPad); bool IsFullVersion(); void SetFullVersion(bool bFull); diff --git a/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Storage.h index 552c247d4..c8d7d4b5a 100644 --- a/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/PSVita/4JLibs/inc/4J_Storage.h @@ -381,7 +381,7 @@ public: void SetDLCProductCode(const char* szProductCode); void SetProductUpgradeKey(const char* szKey); bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam); - void SetDLCInfoMap(std::unordered_map* pSONYDLCMap); + void SetDLCInfoMap(std::unordered_map* pSONYDLCMap); void EntitlementsCallback(bool bFoundEntitlements); }; diff --git a/Minecraft.Client/Platform/PSVita/Leaderboards/PSVitaLeaderboardManager.cpp b/Minecraft.Client/Platform/PSVita/Leaderboards/PSVitaLeaderboardManager.cpp index e4db28b58..7e3ddf9a7 100644 --- a/Minecraft.Client/Platform/PSVita/Leaderboards/PSVitaLeaderboardManager.cpp +++ b/Minecraft.Client/Platform/PSVita/Leaderboards/PSVitaLeaderboardManager.cpp @@ -1012,8 +1012,8 @@ void PSVitaLeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRan out.m_uid.setOnlineID( rankData.npId.handle, true ); out.m_rank = rankData.rank; - // Convert to wstring and copy name. - wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str(); + // Convert to std::wstring and copy name. + std::wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str(); //memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE); out.m_name=wstrName; } diff --git a/Minecraft.Client/Platform/PSVita/PSVita_App.cpp b/Minecraft.Client/Platform/PSVita/PSVita_App.cpp index 3696778f3..7b903ccae 100644 --- a/Minecraft.Client/Platform/PSVita/PSVita_App.cpp +++ b/Minecraft.Client/Platform/PSVita/PSVita_App.cpp @@ -94,7 +94,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU() SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) { - wstring wstrTemp=convStringToWstring(pchTitle); + std::wstring wstrTemp=convStringToWstring(pchTitle); AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp)); if(it == m_SONYDLCMap.end()) @@ -105,7 +105,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) } return it->second; - /*wstring wstrTemp=convStringToWstring(pchTitle); + /*std::wstring wstrTemp=convStringToWstring(pchTitle); SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp); return pTemp;*/ @@ -172,7 +172,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes() // push this into a vector - wstring wstrTemp=convStringToWstring(chDLCTitle); + std::wstring wstrTemp=convStringToWstring(chDLCTitle); m_SONYDLCMap[wstrTemp]=pDLCInfo; } CloseHandle(file); @@ -304,7 +304,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame app.ClearTerrainFeaturePosition(); - wstring wWorldName = L"TestWorld"; + std::wstring wWorldName = L"TestWorld"; bool isFlat = false; __int64 seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements diff --git a/Minecraft.Client/Platform/PSVita/PSVita_App.h b/Minecraft.Client/Platform/PSVita/PSVita_App.h index 83253f738..ce204842c 100644 --- a/Minecraft.Client/Platform/PSVita/PSVita_App.h +++ b/Minecraft.Client/Platform/PSVita/PSVita_App.h @@ -159,7 +159,7 @@ public: bool DLCAlreadyPurchased(char *pchTitle); char *GetSkuIDFromProductList(); void GetDLCSkuIDFromProductList(char *,char *); - std::unordered_map* GetSonyDLCMap() { return &m_SONYDLCMap; } + std::unordered_map* GetSonyDLCMap() { return &m_SONYDLCMap; } static void CommerceInitCallback(LPVOID lpParam,int err); static void CommerceGetCategoriesCallback(LPVOID lpParam,int err); static void CommerceGetProductListCallback(LPVOID lpParam,int err); @@ -230,7 +230,7 @@ private: // SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed; PRODUCTCODES ProductCodes; - std::unordered_map m_SONYDLCMap; + std::unordered_map m_SONYDLCMap; bool m_bVoiceChatAndUGCRestricted; diff --git a/Minecraft.Client/Platform/PSVita/PSVita_PlayerUID.cpp b/Minecraft.Client/Platform/PSVita/PSVita_PlayerUID.cpp index db7f8ebfe..5ab8cfa04 100644 --- a/Minecraft.Client/Platform/PSVita/PSVita_PlayerUID.cpp +++ b/Minecraft.Client/Platform/PSVita/PSVita_PlayerUID.cpp @@ -35,7 +35,7 @@ PlayerUID::PlayerUID(int userID, SceNpOnlineId& onlineID, bool bSignedInPSN, int setOnlineID(onlineID, bSignedInPSN); } -PlayerUID::PlayerUID(wstring fromString) +PlayerUID::PlayerUID(std::wstring fromString) { // create for the format P_5e7ff8372ea9_00000004_Mark_4J @@ -47,16 +47,16 @@ PlayerUID::PlayerUID(wstring fromString) // parse the mac address next for(int i=0;i<6;i++) { - wstring macDigit = fromString.substr(2+(i*2),2); + std::wstring macDigit = fromString.substr(2+(i*2),2); m_macAddress[i] = _fromHEXString(macDigit); } // parse the userID - wstring userIDDigits = fromString.substr(15,8); + std::wstring userIDDigits = fromString.substr(15,8); m_userID = _fromString(userIDDigits); // finally, the onlineID, if there is one - wstring onlineID = fromString.substr(24); + std::wstring onlineID = fromString.substr(24); if(onlineID.size() > 0) { wcstombs(m_onlineID, onlineID.c_str(), 16); diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h index f1bd85bbe..4e6fc606c 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h @@ -76,7 +76,7 @@ public: int GetPrimaryPad(); void SetPrimaryPad(int iPad); char* GetGamertag(int iPad); - wstring GetDisplayName(int iPad); + std::wstring GetDisplayName(int iPad); bool IsFullVersion(); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h index 896f730a7..2b8df12de 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h @@ -319,7 +319,7 @@ public: C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); - // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); + // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename); // unsigned int CRC(unsigned char *buf, int len); // enum eXBLWS diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp index 9ce653fb9..2b10b4ac0 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp @@ -71,7 +71,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame app.ClearTerrainFeaturePosition(); - wstring wWorldName = L"TestWorld"; + std::wstring wWorldName = L"TestWorld"; StorageManager.ResetSaveData(); StorageManager.SetSaveTitle(wWorldName.c_str()); diff --git a/Minecraft.Client/Platform/Xbox/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Xbox/4JLibs/inc/4J_Storage.h index 2988dc2c1..9bdcf2c2e 100644 --- a/Minecraft.Client/Platform/Xbox/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Xbox/4JLibs/inc/4J_Storage.h @@ -287,7 +287,7 @@ public: C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); - bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); + bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename); unsigned int CRC(unsigned char *buf, int len); C4JStorage::ETMSStatus TMSPP_WriteFileWithProgress(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0, diff --git a/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.cpp b/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.cpp index 7431a23e5..c156fd141 100644 --- a/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.cpp @@ -438,7 +438,7 @@ void SoundEngine::XACTNotificationCallback( const XACT_NOTIFICATION* pNotificati } } -char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) +char *SoundEngine::ConvertSoundPathToName(const std::wstring& name, bool bConvertSpaces) { static char buf[256]; assert(name.length()<256); @@ -468,7 +468,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa { return; } - wstring name = wchSoundNames[iSound]; + std::wstring name = wchSoundNames[iSound]; //const unsigned char *name=ucSoundNames[iSound]; char *xboxName = ConvertSoundPathToName(name); @@ -576,7 +576,7 @@ void SoundEngine::playUI(int iSound, float, float) { return; } - wstring name = wchSoundNames[iSound]; + std::wstring name = wchSoundNames[iSound]; char *xboxName = (char *)ConvertSoundPathToName(name); @@ -635,7 +635,7 @@ void SoundEngine::playUI(int iSound, float, float) cueInstance->Play(); } -void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, float vol, float pitch, bool bMusicDelay) +void SoundEngine::playStreaming(const std::wstring& name, float x, float y, float z, float vol, float pitch, bool bMusicDelay) { IXACT3SoundBank *pSoundBank=NULL; @@ -1065,14 +1065,14 @@ void SoundEngine::tick(std::shared_ptr *players, float a) m_pXACT3Engine->DoWork(); } -void SoundEngine::add(const wstring& name, File *file) +void SoundEngine::add(const std::wstring& name, File *file) { } -void SoundEngine::addMusic(const wstring& name, File *file) +void SoundEngine::addMusic(const std::wstring& name, File *file) { } -void SoundEngine::addStreaming(const wstring& name, File *file) +void SoundEngine::addStreaming(const std::wstring& name, File *file) { } diff --git a/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.h b/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.h index e34ad4c9d..fd3a2fdbc 100644 --- a/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.h +++ b/Minecraft.Client/Platform/Xbox/Audio/SoundEngine.h @@ -79,7 +79,7 @@ public: SoundEngine(); virtual void destroy(); virtual void play(int iSound, float x, float y, float z, float volume, float pitch); - virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true); + virtual void playStreaming(const std::wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true); virtual void playUI(int iSound, float volume, float pitch); virtual void playMusicTick(); virtual void updateMusicVolume(float fVal); @@ -87,16 +87,16 @@ public: virtual void updateSoundEffectVolume(float fVal); virtual void init(Options *); virtual void tick(std::shared_ptr *players, float a); // 4J - updated to take array of local players rather than single one - virtual void add(const wstring& name, File *file); - virtual void addMusic(const wstring& name, File *file); - virtual void addStreaming(const wstring& name, File *file); + virtual void add(const std::wstring& name, File *file); + virtual void addMusic(const std::wstring& name, File *file); + virtual void addStreaming(const std::wstring& name, File *file); #ifndef __PS3__ static void setXACTEngine( IXACT3Engine *pXACT3Engine); void CreateStreamingWavebank(const char *pchName, IXACT3WaveBank **ppStreamedWaveBank); void CreateSoundbank(const char *pchName, IXACT3SoundBank **ppSoundBank); #endif // __PS3__ - virtual char *ConvertSoundPathToName(const wstring& name, bool bConvertSpaces=false); + virtual char *ConvertSoundPathToName(const std::wstring& name, bool bConvertSpaces=false); bool isStreamingWavebankReady(); // 4J Added #ifdef _XBOX bool isStreamingWavebankReady(IXACT3WaveBank *pWaveBank); diff --git a/Minecraft.Client/Platform/Xbox/Font/XUI_Font.h b/Minecraft.Client/Platform/Xbox/Font/XUI_Font.h index 1b6278e3c..b0b797f90 100644 --- a/Minecraft.Client/Platform/Xbox/Font/XUI_Font.h +++ b/Minecraft.Client/Platform/Xbox/Font/XUI_Font.h @@ -36,8 +36,8 @@ public: DWORD m_dwNestedBeginCount; - wstring m_fontName; - wstring m_fallbackFont; + std::wstring m_fontName; + std::wstring m_fallbackFont; DWORD refCount; public: float getScaleFactor() { return m_fScaleFactor; } @@ -53,7 +53,7 @@ public: // m_fXScaleFactor = m_fYScaleFactor = m_fScaleFactor; } - void SetFallbackFont(const wstring &fallbackFont) { m_fallbackFont = fallbackFont; } + void SetFallbackFont(const std::wstring &fallbackFont) { m_fallbackFont = fallbackFont; } void IncRefCount() { ++refCount; } void DecRefCount() { --refCount; } diff --git a/Minecraft.Client/Platform/Xbox/Font/XUI_FontRenderer.cpp b/Minecraft.Client/Platform/Xbox/Font/XUI_FontRenderer.cpp index 2745a2b5b..f2b172f8e 100644 --- a/Minecraft.Client/Platform/Xbox/Font/XUI_FontRenderer.cpp +++ b/Minecraft.Client/Platform/Xbox/Font/XUI_FontRenderer.cpp @@ -239,7 +239,7 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat #if 1 for( int i = 0; i < dwCount; i++ ) { - wstring string; + std::wstring string; string.push_back(pCharData[i].wch); lineYPos = pCharData[i].y; lineXPos = pCharData[i].x; @@ -257,7 +257,7 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat DWORD i = 0; while( i < dwCount ) { - wstring string; + std::wstring string; lineYPos = pCharData[i].y; lineXPos = pCharData[i].x; colour = pCharData[i].dwColor; diff --git a/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.cpp b/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.cpp index 3d9b0f561..4d9668cc3 100644 --- a/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.cpp +++ b/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.cpp @@ -1097,15 +1097,15 @@ bool CPlatformNetworkManagerXbox::SystemFlagGet(INetworkPlayer *pNetworkPlayer, return false; } -wstring CPlatformNetworkManagerXbox::GatherStats() +std::wstring CPlatformNetworkManagerXbox::GatherStats() { return L"Queue messages: " + _toString(((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetSendQueueSize( NULL, QNET_GETSENDQUEUESIZE_MESSAGES ) ) + L" Queue bytes: " + _toString( ((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetSendQueueSize( NULL, QNET_GETSENDQUEUESIZE_BYTES ) ); } -wstring CPlatformNetworkManagerXbox::GatherRTTStats() +std::wstring CPlatformNetworkManagerXbox::GatherRTTStats() { - wstring stats(L"Rtt: "); + std::wstring stats(L"Rtt: "); wchar_t stat[32]; @@ -1529,7 +1529,7 @@ vector *CPlatformNetworkManagerXbox::GetSessionList(int iPa { sessionInfo->data = *(GameSessionData *)pxnqi->pbData; - wstring gamerName = convStringToWstring(sessionInfo->data.hostName); + std::wstring gamerName = convStringToWstring(sessionInfo->data.hostName); #ifndef _CONTENT_PACKAGE if(app.DebugSettingsOn() && (app.GetGameSettingsDebugMask()&(1L<data = *(GameSessionData *)pxnqi->pbData; - wstring gamerName = convStringToWstring(sessionInfo->data.hostName); + std::wstring gamerName = convStringToWstring(sessionInfo->data.hostName); swprintf(sessionInfo->displayLabel,app.GetString(IDS_GAME_HOST_NAME),L"MWWWWWWWWWWWWWWM");// gamerName.c_str() ); } else diff --git a/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.h b/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.h index 5c9dd0c92..492299228 100644 --- a/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.h +++ b/Minecraft.Client/Platform/Xbox/Network/PlatformNetworkManagerXbox.h @@ -121,8 +121,8 @@ private: float m_lastPlayerEventTimeStart; public: - wstring GatherStats(); - wstring GatherRTTStats(); + std::wstring GatherStats(); + std::wstring GatherRTTStats(); private: vector friendsSessions[XUSER_MAX_COUNT]; diff --git a/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp b/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp index 60b593fc4..8217cf0ba 100644 --- a/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp +++ b/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp @@ -316,7 +316,7 @@ void CSocialManager::DestroyPreviewPostImage() void CSocialManager::SetSocialPostText(LPCWSTR pwchTitle, LPCWSTR pwchCaption, LPCWSTR pwchDesc) { - wstring wTemp; + std::wstring wTemp; ZeroMemory(m_wchTitleA,sizeof(WCHAR)*(MAX_SOCIALPOST_CAPTION+1)); ZeroMemory(m_wchCaptionA,sizeof(WCHAR)*(MAX_SOCIALPOST_CAPTION+1)); diff --git a/Minecraft.Client/Platform/Xbox/Xbox_UIController.cpp b/Minecraft.Client/Platform/Xbox/Xbox_UIController.cpp index 32d84617a..d00147e06 100644 --- a/Minecraft.Client/Platform/Xbox/Xbox_UIController.cpp +++ b/Minecraft.Client/Platform/Xbox/Xbox_UIController.cpp @@ -141,7 +141,7 @@ void ConsoleUIController::DisplayGamertag(unsigned int iPad, bool show) CXuiSceneBase::DisplayGamertag(iPad, show?TRUE:FALSE); } -void ConsoleUIController::SetSelectedItem(unsigned int iPad, const wstring &name) +void ConsoleUIController::SetSelectedItem(unsigned int iPad, const std::wstring &name) { CXuiSceneBase::SetSelectedItem(iPad, name); } diff --git a/Minecraft.Client/Platform/Xbox/Xbox_UIController.h b/Minecraft.Client/Platform/Xbox/Xbox_UIController.h index 5ec996554..f7fb90844 100644 --- a/Minecraft.Client/Platform/Xbox/Xbox_UIController.h +++ b/Minecraft.Client/Platform/Xbox/Xbox_UIController.h @@ -37,7 +37,7 @@ public: virtual void PlayUISFX(ESoundEffect eSound); virtual void DisplayGamertag(unsigned int iPad, bool show); - virtual void SetSelectedItem(unsigned int iPad, const wstring &name); + virtual void SetSelectedItem(unsigned int iPad, const std::wstring &name); virtual void UpdateSelectedItemPos(unsigned int iPad); virtual void HandleDLCMountingComplete(); diff --git a/Minecraft.Client/Player/LocalPlayer.cpp b/Minecraft.Client/Player/LocalPlayer.cpp index d4bee1869..aaa84ed61 100644 --- a/Minecraft.Client/Player/LocalPlayer.cpp +++ b/Minecraft.Client/Player/LocalPlayer.cpp @@ -674,7 +674,7 @@ void LocalPlayer::take(std::shared_ptr e, int orgCount) minecraft->particleEngine->add( std::shared_ptr( new TakeAnimationParticle((Level *)minecraft->level, e, shared_from_this(), -0.5f) ) ); } -void LocalPlayer::chat(const wstring& message) +void LocalPlayer::chat(const std::wstring& message) { } diff --git a/Minecraft.Client/Player/LocalPlayer.h b/Minecraft.Client/Player/LocalPlayer.h index 8abbb3657..a4054c974 100644 --- a/Minecraft.Client/Player/LocalPlayer.h +++ b/Minecraft.Client/Player/LocalPlayer.h @@ -111,7 +111,7 @@ public: virtual void crit(std::shared_ptr e); virtual void magicCrit(std::shared_ptr e); virtual void take(std::shared_ptr e, int orgCount); - virtual void chat(const wstring& message); + virtual void chat(const std::wstring& message); virtual bool isSneaking(); //virtual bool isIdle(); virtual void hurtTo(int newHealth, ETelemetryChallenges damageSource); diff --git a/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp index ed2c4beb8..50deaa970 100644 --- a/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp +++ b/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp @@ -162,7 +162,7 @@ void MultiplayerLocalPlayer::reallyDrop(std::shared_ptr itemEntity) { } -void MultiplayerLocalPlayer::chat(const wstring& message) +void MultiplayerLocalPlayer::chat(const std::wstring& message) { connection->send( std::shared_ptr( new ChatPacket(message) ) ); } diff --git a/Minecraft.Client/Player/MultiPlayerLocalPlayer.h b/Minecraft.Client/Player/MultiPlayerLocalPlayer.h index f8815ea43..54c6001da 100644 --- a/Minecraft.Client/Player/MultiPlayerLocalPlayer.h +++ b/Minecraft.Client/Player/MultiPlayerLocalPlayer.h @@ -37,7 +37,7 @@ public: protected: virtual void reallyDrop(std::shared_ptr itemEntity); public: - virtual void chat(const wstring& message); + virtual void chat(const std::wstring& message); virtual void swing(); virtual void respawn(); protected: diff --git a/Minecraft.Client/Player/RemotePlayer.cpp b/Minecraft.Client/Player/RemotePlayer.cpp index 4cd436340..0d9a6e977 100644 --- a/Minecraft.Client/Player/RemotePlayer.cpp +++ b/Minecraft.Client/Player/RemotePlayer.cpp @@ -3,7 +3,7 @@ #include "../../Minecraft.World/Headers/net.minecraft.world.item.h" #include "../../Minecraft.World/Util/Mth.h" -RemotePlayer::RemotePlayer(Level *level, const wstring& name) : Player(level) +RemotePlayer::RemotePlayer(Level *level, const std::wstring& name) : Player(level) { // 4J - added initialisers hasStartedUsingItem = false; diff --git a/Minecraft.Client/Player/RemotePlayer.h b/Minecraft.Client/Player/RemotePlayer.h index 641bf293a..7082a10c0 100644 --- a/Minecraft.Client/Player/RemotePlayer.h +++ b/Minecraft.Client/Player/RemotePlayer.h @@ -10,7 +10,7 @@ private: bool hasStartedUsingItem; public: Input *input; - RemotePlayer(Level *level, const wstring& name); + RemotePlayer(Level *level, const std::wstring& name); protected: virtual void setDefaultHeadHeight(); public: diff --git a/Minecraft.Client/Player/ServerPlayer.cpp b/Minecraft.Client/Player/ServerPlayer.cpp index 7e4bcaf6a..a27e9ba6d 100644 --- a/Minecraft.Client/Player/ServerPlayer.cpp +++ b/Minecraft.Client/Player/ServerPlayer.cpp @@ -27,7 +27,7 @@ #include "../../Minecraft.World/Level/LevelChunk.h" #include "../Rendering/LevelRenderer.h" -ServerPlayer::ServerPlayer(MinecraftServer *server, Level *level, const wstring& name, ServerPlayerGameMode *gameMode) : Player(level) +ServerPlayer::ServerPlayer(MinecraftServer *server, Level *level, const std::wstring& name, ServerPlayerGameMode *gameMode) : Player(level) { // 4J - added initialisers connection = nullptr; @@ -369,7 +369,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) okToSend = true; MinecraftServer::s_slowQueuePacketSent = true; -// static std::unordered_map mapLastTime; +// static std::unordered_map mapLastTime; // __int64 thisTime = System::currentTimeMillis(); // __int64 lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; // app.DebugPrintf(" - OK to send (%d ms since last)\n", thisTime - lastTime); @@ -1342,7 +1342,7 @@ void ServerPlayer::displayClientMessage(int messageId) } //Language *language = Language::getInstance(); - //wstring languageString = app.GetString(messageId);//language->getElement(messageId); + //std::wstring languageString = app.GetString(messageId);//language->getElement(messageId); //connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); } @@ -1423,7 +1423,7 @@ void ServerPlayer::setGameMode(GameType *mode) connection->send(std::shared_ptr(new GameEventPacket(GameEventPacket::CHANGE_GAME_MODE, mode->getId()))); } -void ServerPlayer::sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const wstring& additionalMessage /*= L""*/) +void ServerPlayer::sendMessage(const std::wstring& message, ChatPacket::EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const std::wstring& additionalMessage /*= L""*/) { connection->send(std::shared_ptr(new ChatPacket(message,type,customData,additionalMessage))); } diff --git a/Minecraft.Client/Player/ServerPlayer.h b/Minecraft.Client/Player/ServerPlayer.h index 136d08362..82eb27abc 100644 --- a/Minecraft.Client/Player/ServerPlayer.h +++ b/Minecraft.Client/Player/ServerPlayer.h @@ -39,7 +39,7 @@ private: int lastBrupSendTickCount; // 4J Added public: - ServerPlayer(MinecraftServer *server, Level *level, const wstring& name, ServerPlayerGameMode *gameMode); + ServerPlayer(MinecraftServer *server, Level *level, const std::wstring& name, ServerPlayerGameMode *gameMode); ~ServerPlayer(); void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added @@ -137,7 +137,7 @@ public: void onUpdateAbilities(); ServerLevel *getLevel(); void setGameMode(GameType *mode); - void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L""); + void sendMessage(const std::wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const std::wstring& additionalMessage = L""); bool hasPermission(EGameCommand command); // 4J - Don't use //void updateOptions(std::shared_ptr packet); diff --git a/Minecraft.Client/Player/User.cpp b/Minecraft.Client/Player/User.cpp index c0355293b..533985dcc 100644 --- a/Minecraft.Client/Player/User.cpp +++ b/Minecraft.Client/Player/User.cpp @@ -38,7 +38,7 @@ void User::staticCtor() allowedTiles.push_back(Tile::obsidian); } -User::User(const wstring& name, const wstring& sessionId) +User::User(const std::wstring& name, const std::wstring& sessionId) { this->name = name; this->sessionId = sessionId; diff --git a/Minecraft.Client/Player/User.h b/Minecraft.Client/Player/User.h index b888c7d4d..5d87832cb 100644 --- a/Minecraft.Client/Player/User.h +++ b/Minecraft.Client/Player/User.h @@ -6,9 +6,9 @@ class User public: static vector allowedTiles; static void staticCtor(); - wstring name; - wstring sessionId; - wstring mpPassword; + std::wstring name; + std::wstring sessionId; + std::wstring mpPassword; - User(const wstring& name, const wstring& sessionId); + User(const std::wstring& name, const std::wstring& sessionId); }; \ No newline at end of file diff --git a/Minecraft.Client/Rendering/Cube.cpp b/Minecraft.Client/Rendering/Cube.cpp index 45714e3a7..ee007f111 100644 --- a/Minecraft.Client/Rendering/Cube.cpp +++ b/Minecraft.Client/Rendering/Cube.cpp @@ -106,7 +106,7 @@ void Cube::render(Tesselator *t,float scale) } } -Cube *Cube::setId(const wstring &id) +Cube *Cube::setId(const std::wstring &id) { this->id = id; return this; diff --git a/Minecraft.Client/Rendering/Cube.h b/Minecraft.Client/Rendering/Cube.h index 388910015..eafa57ba5 100644 --- a/Minecraft.Client/Rendering/Cube.h +++ b/Minecraft.Client/Rendering/Cube.h @@ -15,7 +15,7 @@ private: public: const float x0, y0, z0, x1, y1, z1; - wstring id; + std::wstring id; public: Cube(ModelPart *modelPart, int xTexOffs, int yTexOffs, float x0, float y0, float z0, int w, int h, int d, float g, int faceMask = 63, bool bFlipPoly3UVs = false); // 4J - added faceMask @@ -25,5 +25,5 @@ private: public: void render(Tesselator *t,float scale); - Cube *setId(const wstring &id); + Cube *setId(const std::wstring &id); }; diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp index 5d0208fad..ed9678837 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.cpp @@ -31,12 +31,12 @@ void EntityRenderer::bindTexture(int resourceName) entityRenderDispatcher->textures->bindTexture(resourceName); } -void EntityRenderer::bindTexture(const wstring& resourceName) +void EntityRenderer::bindTexture(const std::wstring& resourceName) { entityRenderDispatcher->textures->bindTexture(resourceName); } -bool EntityRenderer::bindTexture(const wstring& urlTexture, int backupTexture) +bool EntityRenderer::bindTexture(const std::wstring& urlTexture, int backupTexture) { Textures *t = entityRenderDispatcher->textures; @@ -57,7 +57,7 @@ bool EntityRenderer::bindTexture(const wstring& urlTexture, int backupTexture) } } -bool EntityRenderer::bindTexture(const wstring& urlTexture, const wstring& backupTexture) +bool EntityRenderer::bindTexture(const std::wstring& urlTexture, const std::wstring& backupTexture) { Textures *t = entityRenderDispatcher->textures; diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h index 529d905ac..2095385b6 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/EntityRenderer.h @@ -39,10 +39,10 @@ public: virtual void render(std::shared_ptr entity, double x, double y, double z, float rot, float a) = 0; protected: virtual void bindTexture(int resourceName); // 4J - added - virtual void bindTexture(const wstring& resourceName); + virtual void bindTexture(const std::wstring& resourceName); - virtual bool bindTexture(const wstring& urlTexture, int backupTexture); // 4J added - virtual bool bindTexture(const wstring& urlTexture, const wstring& backupTexture); + virtual bool bindTexture(const std::wstring& urlTexture, int backupTexture); // 4J added + virtual bool bindTexture(const std::wstring& urlTexture, const std::wstring& backupTexture); private: virtual void renderFlame(std::shared_ptr e, double x, double y, double z, float a); virtual void renderShadow(std::shared_ptr e, double x, double y, double z, float pow, float a); diff --git a/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp index 0de9da0c5..7fc66de50 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/HumanoidMobRenderer.cpp @@ -70,7 +70,7 @@ void HumanoidMobRenderer::additionalRendering(std::shared_ptr mob, float a) float s = 17 / 16.0f; glScalef(s, -s, -s); - wstring extra = L""; + std::wstring extra = L""; if (headGear->hasTag() && headGear->getTag()->contains(L"SkullOwner")) { extra = headGear->getTag()->getString(L"SkullOwner"); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp index a64d2e792..82c2b3713 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp @@ -565,7 +565,7 @@ void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, std: renderGuiItemDecorations(font, textures, item, x, y, L"", fAlpha); } -void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, const wstring &countText, float fAlpha) +void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, const std::wstring &countText, float fAlpha) { if (item == NULL) { @@ -578,7 +578,7 @@ void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, std: if (item->count > 1 || !countText.empty() || item->GetForceNumberDisplay()) { MemSect(31); - wstring amount = countText; + std::wstring amount = countText; if(amount.empty()) { int count = item->count; diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h index 830e85100..f2f68a254 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h @@ -43,7 +43,7 @@ private: public: void renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, float fAlpha = 1.0f); - void renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, const wstring &countText, float fAlpha = 1.0f); + void renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, const std::wstring &countText, float fAlpha = 1.0f); private: void fillRect(Tesselator *t, int x, int y, int w, int h, int c); public: diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp index b2cb23ebf..dae750050 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.cpp @@ -330,7 +330,7 @@ void MobRenderer::renderName(std::shared_ptr mob, double x, double y, doubl } // 4J Added parameter for color here so that we can colour players names -void MobRenderer::renderNameTag(std::shared_ptr mob, const wstring& OriginalName, double x, double y, double z, int maxDist, int color /*= 0xffffffff*/) +void MobRenderer::renderNameTag(std::shared_ptr mob, const std::wstring& OriginalName, double x, double y, double z, int maxDist, int color /*= 0xffffffff*/) { if ( app.GetGameSettings(eGameSetting_DisplayHUD)==0 ) @@ -399,7 +399,7 @@ void MobRenderer::renderNameTag(std::shared_ptr mob, const wstring& Origina std::shared_ptr player = dynamic_pointer_cast(mob); if (player != NULL && app.isXuidDeadmau5( player->getXuid() ) ) offs = -10; - wstring playerName; + std::wstring playerName; WCHAR wchName[2]; #if defined(__PS3__) || defined(__ORBIS__) diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.h index 6a5df478e..1f5c01b7f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/MobRenderer.h @@ -38,7 +38,7 @@ protected: virtual int getOverlayColor(std::shared_ptr mob, float br, float a); virtual void scale(std::shared_ptr mob, float a); virtual void renderName(std::shared_ptr mob, double x, double y, double z); - virtual void renderNameTag(std::shared_ptr mob, const wstring& name, double x, double y, double z, int maxDist, int color = 0xff000000); + virtual void renderNameTag(std::shared_ptr mob, const std::wstring& name, double x, double y, double z, int maxDist, int color = 0xff000000); public: // 4J Added diff --git a/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.h index c367e9b03..1ca51db47 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/MobSpawnerRenderer.h @@ -5,7 +5,7 @@ using namespace std; class MobSpawnerRenderer : public TileEntityRenderer { private: - std::unordered_map > models; + std::unordered_map > models; public: virtual void render(std::shared_ptr _spawner, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param }; diff --git a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp index 3f938f302..2cff2584f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp @@ -27,7 +27,7 @@ const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] = #endif }; -const wstring PlayerRenderer::MATERIAL_NAMES[5] = { L"cloth", L"chain", L"iron", L"diamond", L"gold" }; +const std::wstring PlayerRenderer::MATERIAL_NAMES[5] = { L"cloth", L"chain", L"iron", L"diamond", L"gold" }; PlayerRenderer::PlayerRenderer() : MobRenderer( new HumanoidModel(0), 0.5f ) { @@ -245,7 +245,7 @@ void PlayerRenderer::renderName(std::shared_ptr _mob, double x, double y, d if (dist < maxDist * maxDist) { // Truncate display names longer than 16 char - wstring msg = mob->getDisplayName(); + std::wstring msg = mob->getDisplayName(); if (msg.length() > 16) { msg.resize(16); @@ -351,7 +351,7 @@ void PlayerRenderer::additionalRendering(std::shared_ptr _mob, float a) float s = 17 / 16.0f; glScalef(s, -s, -s); - wstring extra = L""; + std::wstring extra = L""; if (headGear->hasTag() && headGear->getTag()->contains(L"SkullOwner")) { extra = headGear->getTag()->getString(L"SkullOwner"); diff --git a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h index 6ed16f260..292a2f693 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.h @@ -20,7 +20,7 @@ public: static unsigned int getNametagColour(int index); private: - static const wstring MATERIAL_NAMES[5]; + static const std::wstring MATERIAL_NAMES[5]; protected: virtual int prepareArmor(std::shared_ptr _player, int layer, float a); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp index 03befa51e..054df57c2 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.cpp @@ -195,7 +195,7 @@ void ProgressRenderer::setType(eProgressStringType eType) LeaveCriticalSection( &ProgressRenderer::s_progress ); } -void ProgressRenderer::progressStage(wstring &wstrText) +void ProgressRenderer::progressStage(std::wstring &wstrText) { EnterCriticalSection( &ProgressRenderer::s_progress ); m_wstrText=wstrText; @@ -203,10 +203,10 @@ void ProgressRenderer::progressStage(wstring &wstrText) LeaveCriticalSection( &ProgressRenderer::s_progress ); } -wstring& ProgressRenderer::getProgressString(void) +std::wstring& ProgressRenderer::getProgressString(void) { EnterCriticalSection( &ProgressRenderer::s_progress ); - wstring &temp=m_wstrText; + std::wstring &temp=m_wstrText; LeaveCriticalSection( &ProgressRenderer::s_progress ); return temp; } diff --git a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h index 1244d3733..bb3446c4c 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h @@ -15,7 +15,7 @@ public: int getCurrentPercent(); int getCurrentTitle(); int getCurrentStatus(); - wstring& getProgressString(void); + std::wstring& getProgressString(void); ProgressRenderer::eProgressStringType getType(); private: @@ -27,7 +27,7 @@ private: int title; __int64 lastTime; bool noAbort; - wstring m_wstrText; + std::wstring m_wstrText; eProgressStringType m_eType; void setType(eProgressStringType eType); @@ -38,6 +38,6 @@ public: virtual void progressStartNoAbort(int string); void _progressStart(int title); virtual void progressStage(int status); - virtual void progressStage(wstring &wstrText); + virtual void progressStage(std::wstring &wstrText); virtual void progressStagePercentage(int i); }; \ No newline at end of file diff --git a/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp index 5c88b92ed..43e8a7e14 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/SignRenderer.cpp @@ -60,7 +60,7 @@ void SignRenderer::render(std::shared_ptr _sign, double x, double y, glDepthMask(false); int col = Minecraft::GetInstance()->getColourTable()->getColor(eMinecraftColour_Sign_Text); - wstring msg; + std::wstring msg; // need to send the new data // Get the current language setting from the console DWORD dwLanguage = XGetLanguage( ); diff --git a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp index 873c268fa..71f1f137f 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.cpp @@ -31,7 +31,7 @@ void SkullTileRenderer::init(TileEntityRenderDispatcher *tileEntityRenderDispatc instance = this; } -void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra) +void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float rot, int type, const std::wstring &extra) { Model *model = skeletonModel; @@ -47,7 +47,7 @@ void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float r case SkullTileEntity::TYPE_CHAR: //if (!extra.empty()) //{ - // wstring url = "http://skins.minecraft.net/MinecraftSkins/" + StringUtil.stripColor(extra) + ".png"; + // std::wstring url = "http://skins.minecraft.net/MinecraftSkins/" + StringUtil.stripColor(extra) + ".png"; // if (!instance->tileEntityRenderDispatcher->textures->hasHttpTexture(url)) // { diff --git a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.h index e9d2bf0f6..e2ef38605 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/SkullTileRenderer.h @@ -20,5 +20,5 @@ public: void render(std::shared_ptr skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled = true); void init(TileEntityRenderDispatcher *tileEntityRenderDispatcher); - void renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra); + void renderSkull(float x, float y, float z, int face, float rot, int type, const std::wstring &extra); }; diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp index 9a997b6e2..d31ddfd8e 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.cpp @@ -8,7 +8,7 @@ void TileEntityRenderer::bindTexture(int resourceName) if(t != NULL) t->bind(t->loadTexture(resourceName)); } -void TileEntityRenderer::bindTexture(const wstring& urlTexture, int backupTexture) +void TileEntityRenderer::bindTexture(const std::wstring& urlTexture, int backupTexture) { Textures *t = tileEntityRenderDispatcher->textures; if(t != NULL) t->bind(t->loadHttpTexture(urlTexture, backupTexture)); diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h b/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h index 7e01b4964..e9c4c1887 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h +++ b/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderer.h @@ -13,8 +13,8 @@ public: virtual void render(std::shared_ptr entity, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) = 0; // 4J added setColor param and alpha and useCompiled virtual void onNewLevel(Level *level) {} protected: - void bindTexture(int resourceName); // 4J - changed from wstring to int - void bindTexture(const wstring& urlTexture, int backupTexture); // 4J - changed from wstring to int + void bindTexture(int resourceName); // 4J - changed from std::wstring to int + void bindTexture(const std::wstring& urlTexture, int backupTexture); // 4J - changed from std::wstring to int private: Level *getLevel(); public: diff --git a/Minecraft.Client/Rendering/LevelRenderer.cpp b/Minecraft.Client/Rendering/LevelRenderer.cpp index 759d17d73..04854e5e2 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.cpp +++ b/Minecraft.Client/Rendering/LevelRenderer.cpp @@ -603,12 +603,12 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) mc->gameRenderer->turnOffLightLayer(a); // 4J - brought forward from 1.8.2 } -wstring LevelRenderer::gatherStats1() +std::wstring LevelRenderer::gatherStats1() { return L"C: " + _toString(renderedChunks) + L"/" + _toString(totalChunks) + L". F: " + _toString(offscreenChunks) + L", O: " + _toString(occludedChunks) + L", E: " + _toString(emptyChunks); } -wstring LevelRenderer::gatherStats2() +std::wstring LevelRenderer::gatherStats2() { return L"E: " + _toString(renderedEntities) + L"/" + _toString(totalEntities) + L". B: " + _toString(culledEntities) + L", I: " + _toString((totalEntities - culledEntities) - renderedEntities); } @@ -2560,7 +2560,7 @@ void LevelRenderer::cull(Culler *culler, float a) } } -void LevelRenderer::playStreamingMusic(const wstring& name, int x, int y, int z) +void LevelRenderer::playStreamingMusic(const std::wstring& name, int x, int y, int z) { if (name != L"") { @@ -2603,7 +2603,7 @@ void LevelRenderer::playSound(std::shared_ptr entity,int iSound, double // 4J-PB - original function. I've changed to an enum instead of string compares // 4J removed - /* -void LevelRenderer::addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) +void LevelRenderer::addParticle(const std::wstring& name, double x, double y, double z, double xa, double ya, double za) { if (mc == NULL || mc->cameraTargetPlayer == NULL || mc->particleEngine == NULL) return; diff --git a/Minecraft.Client/Rendering/LevelRenderer.h b/Minecraft.Client/Rendering/LevelRenderer.h index b456752e3..bdf371752 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.h +++ b/Minecraft.Client/Rendering/LevelRenderer.h @@ -68,8 +68,8 @@ public: void AddDLCSkinsToMemTextures(); public: void renderEntities(Vec3 *cam, Culler *culler, float a); - wstring gatherStats1(); - wstring gatherStats2(); + std::wstring gatherStats1(); + std::wstring gatherStats2(); private: void resortChunks(int xc, int yc, int zc); public: @@ -106,7 +106,7 @@ public: bool m_bSPUCullStarted[4]; #endif // __PS3__ void cull(Culler *culler, float a); - void playStreamingMusic(const wstring& name, int x, int y, int z); + void playStreamingMusic(const std::wstring& name, int x, int y, int z); void playSound(int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); void playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); void addParticle(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za); // 4J added diff --git a/Minecraft.Client/Rendering/Models/Model.cpp b/Minecraft.Client/Rendering/Models/Model.cpp index eebebf763..e3a1f2976 100644 --- a/Minecraft.Client/Rendering/Models/Model.cpp +++ b/Minecraft.Client/Rendering/Models/Model.cpp @@ -11,12 +11,12 @@ Model::Model() texHeight=32; } -void Model::setMapTex(wstring id, int x, int y) +void Model::setMapTex(std::wstring id, int x, int y) { mappedTexOffs[id]=new TexOffs(x, y); } -TexOffs *Model::getMapTex(wstring id) +TexOffs *Model::getMapTex(std::wstring id) { // 4J-PB - assuming there will always be this one return mappedTexOffs[id]; diff --git a/Minecraft.Client/Rendering/Models/Model.h b/Minecraft.Client/Rendering/Models/Model.h index bb474e98c..335afb9ca 100644 --- a/Minecraft.Client/Rendering/Models/Model.h +++ b/Minecraft.Client/Rendering/Models/Model.h @@ -14,7 +14,7 @@ public: bool riding; vector cubes; bool young; - std::unordered_map mappedTexOffs; + std::unordered_map mappedTexOffs; int texWidth; int texHeight; @@ -25,8 +25,8 @@ public: virtual ModelPart *getRandomCube(Random random) {return cubes.at(random.nextInt((int)cubes.size()));} virtual ModelPart * AddOrRetrievePart(SKIN_BOX *pBox) { return NULL;} - void setMapTex(wstring id, int x, int y); - TexOffs *getMapTex(wstring id); + void setMapTex(std::wstring id, int x, int y); + TexOffs *getMapTex(std::wstring id); protected: float yHeadOffs; diff --git a/Minecraft.Client/Rendering/Models/ModelPart.cpp b/Minecraft.Client/Rendering/Models/ModelPart.cpp index 182dc15cd..a93adfc69 100644 --- a/Minecraft.Client/Rendering/Models/ModelPart.cpp +++ b/Minecraft.Client/Rendering/Models/ModelPart.cpp @@ -23,7 +23,7 @@ ModelPart::ModelPart() _init(); } -ModelPart::ModelPart(Model *model, const wstring& id) +ModelPart::ModelPart(Model *model, const std::wstring& id) { construct(model, id); } @@ -39,7 +39,7 @@ ModelPart::ModelPart(Model *model, int xTexOffs, int yTexOffs) } -void ModelPart::construct(Model *model, const wstring& id) +void ModelPart::construct(Model *model, const std::wstring& id) { _init(); this->model = model; @@ -108,7 +108,7 @@ ModelPart *ModelPart::texOffs(int xTexOffs, int yTexOffs) return this; } -ModelPart *ModelPart::addBox(wstring id, float x0, float y0, float z0, int w, int h, int d) +ModelPart *ModelPart::addBox(std::wstring id, float x0, float y0, float z0, int w, int h, int d) { id = this->id + L"." + id; TexOffs *offs = model->getMapTex(id); diff --git a/Minecraft.Client/Rendering/Models/ModelPart.h b/Minecraft.Client/Rendering/Models/ModelPart.h index 5d22ad3a8..fbc90c7cd 100644 --- a/Minecraft.Client/Rendering/Models/ModelPart.h +++ b/Minecraft.Client/Rendering/Models/ModelPart.h @@ -22,7 +22,7 @@ public: static const float RAD; private: - wstring id; + std::wstring id; int xTexOffs, yTexOffs; boolean compiled; int list; @@ -31,12 +31,12 @@ private: public: void _init(); // 4J added ModelPart(); - ModelPart(Model *model, const wstring &id); + ModelPart(Model *model, const std::wstring &id); ModelPart(Model *model); ModelPart(Model *model, int xTexOffs, int yTexOffs); // MGH - had to add these for PS3, as calling constructors from others was only introduced in c++11 - https://en.wikipedia.org/wiki/C++11#Object_construction_improvement - void construct(Model *model, const wstring &id); + void construct(Model *model, const std::wstring &id); void construct(Model *model); void construct(Model *model, int xTexOffs, int yTexOffs); @@ -44,7 +44,7 @@ public: ModelPart * retrieveChild(SKIN_BOX *pBox); ModelPart *mirror(); ModelPart *texOffs(int xTexOffs, int yTexOffs); - ModelPart *addBox(wstring id, float x0, float y0, float z0, int w, int h, int d); + ModelPart *addBox(std::wstring id, float x0, float y0, float z0, int w, int h, int d); ModelPart *addBox(float x0, float y0, float z0, int w, int h, int d); ModelPart *addBoxWithMask(float x0, float y0, float z0, int w, int h, int d, int faceMask); // 4J added void addBox(float x0, float y0, float z0, int w, int h, int d, float g); diff --git a/Minecraft.Client/Rendering/Particles/Particle.cpp b/Minecraft.Client/Rendering/Particles/Particle.cpp index 0cc278286..3b5fd697c 100644 --- a/Minecraft.Client/Rendering/Particles/Particle.cpp +++ b/Minecraft.Client/Rendering/Particles/Particle.cpp @@ -240,7 +240,7 @@ bool Particle::isAttackable() } //@Override -wstring Particle::toString() +std::wstring Particle::toString() { return L"A particle"; //getClass()->getSimpleName() + ", Pos (" + x + "," + y + "," + z + "), RGBA (" + rCol + "," + gCol + "," + bCol + "," + alpha + "), Age " + age; } \ No newline at end of file diff --git a/Minecraft.Client/Rendering/Particles/Particle.h b/Minecraft.Client/Rendering/Particles/Particle.h index abf2aa0f7..572794401 100644 --- a/Minecraft.Client/Rendering/Particles/Particle.h +++ b/Minecraft.Client/Rendering/Particles/Particle.h @@ -49,5 +49,5 @@ public: virtual void setMiscTex(int slotIndex); virtual void setNextMiscAnimTex(); virtual bool isAttackable(); - virtual wstring toString(); + virtual std::wstring toString(); }; \ No newline at end of file diff --git a/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp b/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp index 073bf105e..d979256f1 100644 --- a/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp +++ b/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp @@ -205,7 +205,7 @@ void ParticleEngine::crack(int x, int y, int z, int face) } -wstring ParticleEngine::countParticles() +std::wstring ParticleEngine::countParticles() { int l = level->dimension->id == 0 ? 0 : (level->dimension->id == -1 ? 1 : 2 ); return _toString((int)(particles[l][0].size() + particles[l][1].size() + particles[l][2].size())); diff --git a/Minecraft.Client/Rendering/Particles/ParticleEngine.h b/Minecraft.Client/Rendering/Particles/ParticleEngine.h index 0fee7a165..8913d3140 100644 --- a/Minecraft.Client/Rendering/Particles/ParticleEngine.h +++ b/Minecraft.Client/Rendering/Particles/ParticleEngine.h @@ -40,5 +40,5 @@ public: void setLevel(Level *level); void destroy(int x, int y, int z, int tid, int data); void crack(int x, int y, int z, int face); - wstring countParticles(); + std::wstring countParticles(); }; \ No newline at end of file diff --git a/Minecraft.Client/Textures/BufferedImage.cpp b/Minecraft.Client/Textures/BufferedImage.cpp index 7c1e42dd1..70b9664eb 100644 --- a/Minecraft.Client/Textures/BufferedImage.cpp +++ b/Minecraft.Client/Textures/BufferedImage.cpp @@ -47,11 +47,11 @@ void BufferedImage::ByteFlip4(unsigned int &data) // Loads a bitmap into a buffered image - only currently supports the 2 types of 32-bit image that we've made so far // and determines which of these is which by the compression method. Compression method 3 is a 32-bit image with only // 24-bits used (ie no alpha channel) whereas method 0 is a full 32-bit image with a valid alpha channel. -BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/) +BufferedImage::BufferedImage(const std::wstring& File, bool filenameHasExtension /*=false*/, bool bTitleUpdateTexture /*=false*/, const std::wstring &drive /*=L""*/) { HRESULT hr; - wstring wDrive; - wstring filePath; + std::wstring wDrive; + std::wstring filePath; filePath = File; wDrive = drive; @@ -87,7 +87,7 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f pchUsrDir=getUsrDirPath(); } - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(bTitleUpdateTexture) { @@ -102,7 +102,7 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f /*char *pchUsrDir=getUsrDirPath(); - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(bTitleUpdateTexture) { @@ -145,8 +145,8 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f for( int l = 0; l < 10; l++ ) { - wstring name; - wstring mipMapPath = L""; + std::wstring name; + std::wstring mipMapPath = L""; if( l != 0 ) { mipMapPath = L"MipMapLevel" + _toString(l+1); @@ -189,10 +189,10 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f } } -BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension /*= false*/ ) +BufferedImage::BufferedImage(DLCPack *dlcPack, const std::wstring& File, bool filenameHasExtension /*= false*/ ) { HRESULT hr; - wstring filePath = File; + std::wstring filePath = File; BYTE *pbData = NULL; DWORD dwBytes = 0; @@ -203,8 +203,8 @@ BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenam for( int l = 0; l < 10; l++ ) { - wstring name; - wstring mipMapPath = L""; + std::wstring name; + std::wstring mipMapPath = L""; if( l != 0 ) { mipMapPath = L"MipMapLevel" + _toString(l+1); diff --git a/Minecraft.Client/Textures/BufferedImage.h b/Minecraft.Client/Textures/BufferedImage.h index a0227fe29..428ff29c8 100644 --- a/Minecraft.Client/Textures/BufferedImage.h +++ b/Minecraft.Client/Textures/BufferedImage.h @@ -15,8 +15,8 @@ public: static const int TYPE_INT_ARGB = 0; static const int TYPE_INT_RGB = 1; BufferedImage(int width,int height,int type); - BufferedImage(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); // 4J added - BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension = false ); // 4J Added + BufferedImage(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L""); // 4J added + BufferedImage(DLCPack *dlcPack, const std::wstring& File, bool filenameHasExtension = false ); // 4J Added BufferedImage(BYTE *pbData, DWORD dwBytes); // 4J added ~BufferedImage(); diff --git a/Minecraft.Client/Textures/HttpTexture.cpp b/Minecraft.Client/Textures/HttpTexture.cpp index 4ba5a9bbe..8f8aa8378 100644 --- a/Minecraft.Client/Textures/HttpTexture.cpp +++ b/Minecraft.Client/Textures/HttpTexture.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "HttpTexture.h" -HttpTexture::HttpTexture(const wstring& _url, HttpTextureProcessor *processor) +HttpTexture::HttpTexture(const std::wstring& _url, HttpTextureProcessor *processor) { // 4J - added count = 1; diff --git a/Minecraft.Client/Textures/HttpTexture.h b/Minecraft.Client/Textures/HttpTexture.h index 469ef6cb5..b123e1c57 100644 --- a/Minecraft.Client/Textures/HttpTexture.h +++ b/Minecraft.Client/Textures/HttpTexture.h @@ -10,5 +10,5 @@ public: int id; bool isLoaded; - HttpTexture(const wstring& _url, HttpTextureProcessor *processor); + HttpTexture(const std::wstring& _url, HttpTextureProcessor *processor); }; \ No newline at end of file diff --git a/Minecraft.Client/Textures/MemTexture.cpp b/Minecraft.Client/Textures/MemTexture.cpp index ebdd38c43..5dc6e5166 100644 --- a/Minecraft.Client/Textures/MemTexture.cpp +++ b/Minecraft.Client/Textures/MemTexture.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "MemTexture.h" -MemTexture::MemTexture(const wstring& _url, PBYTE pbData,DWORD dwBytes, MemTextureProcessor *processor) +MemTexture::MemTexture(const std::wstring& _url, PBYTE pbData,DWORD dwBytes, MemTextureProcessor *processor) { // 4J - added count = 1; diff --git a/Minecraft.Client/Textures/MemTexture.h b/Minecraft.Client/Textures/MemTexture.h index d11d68b12..e08c1bbb5 100644 --- a/Minecraft.Client/Textures/MemTexture.h +++ b/Minecraft.Client/Textures/MemTexture.h @@ -12,6 +12,6 @@ public: int ticksSinceLastUse; static const int UNUSED_TICKS_TO_FREE = 20; - MemTexture(const wstring& _name, PBYTE pbData, DWORD dwBytes, MemTextureProcessor *processor); + MemTexture(const std::wstring& _name, PBYTE pbData, DWORD dwBytes, MemTextureProcessor *processor); ~MemTexture(); }; \ No newline at end of file diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp b/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp index 6629fe9a2..4ff7b9c6f 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp @@ -4,7 +4,7 @@ #include "../../../Minecraft.World/IO/Streams/InputOutputStream.h" #include "../../../Minecraft.World/Util/StringHelpers.h" -AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name) +AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const std::wstring &name, TexturePack *fallback) : id(id), name(name) { // 4J init textureId = -1; @@ -25,7 +25,7 @@ AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &na //loadDescription(); } -wstring AbstractTexturePack::trim(wstring line) +std::wstring AbstractTexturePack::trim(std::wstring line) { if (!line.empty() && line.length() > 34) { @@ -101,7 +101,7 @@ void AbstractTexturePack::loadName() { } -InputStream *AbstractTexturePack::getResource(const wstring &name, bool allowFallback) //throws IOException +InputStream *AbstractTexturePack::getResource(const std::wstring &name, bool allowFallback) //throws IOException { app.DebugPrintf("texture - %ls\n",name.c_str()); InputStream *is = getResourceImplementation(name); @@ -114,7 +114,7 @@ InputStream *AbstractTexturePack::getResource(const wstring &name, bool allowFal } // 4J Currently removed due to override in TexturePack class -//InputStream *AbstractTexturePack::getResource(const wstring &name) //throws IOException +//InputStream *AbstractTexturePack::getResource(const std::wstring &name) //throws IOException //{ // return getResource(name, true); //} @@ -145,7 +145,7 @@ void AbstractTexturePack::load(Textures *textures) } } -bool AbstractTexturePack::hasFile(const wstring &name, bool allowFallback) +bool AbstractTexturePack::hasFile(const std::wstring &name, bool allowFallback) { bool hasFile = this->hasFile(name); @@ -157,34 +157,34 @@ DWORD AbstractTexturePack::getId() return id; } -wstring AbstractTexturePack::getName() +std::wstring AbstractTexturePack::getName() { return texname; } -wstring AbstractTexturePack::getWorldName() +std::wstring AbstractTexturePack::getWorldName() { return m_wsWorldName; } -wstring AbstractTexturePack::getDesc1() +std::wstring AbstractTexturePack::getDesc1() { return desc1; } -wstring AbstractTexturePack::getDesc2() +std::wstring AbstractTexturePack::getDesc2() { return desc2; } -wstring AbstractTexturePack::getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback) +std::wstring AbstractTexturePack::getAnimationString(const std::wstring &textureName, const std::wstring &path, bool allowFallback) { return getAnimationString(textureName, path); } -wstring AbstractTexturePack::getAnimationString(const wstring &textureName, const wstring &path) +std::wstring AbstractTexturePack::getAnimationString(const std::wstring &textureName, const std::wstring &path) { - wstring animationDefinitionFile = textureName + L".txt"; + std::wstring animationDefinitionFile = textureName + L".txt"; bool requiresFallback = !hasFile(L"\\" + textureName + L".png", false); @@ -197,9 +197,9 @@ wstring AbstractTexturePack::getAnimationString(const wstring &textureName, cons InputStreamReader isr(fileStream); BufferedReader br(&isr); - wstring result = L""; + std::wstring result = L""; - wstring line = br.readLine(); + std::wstring line = br.readLine(); while (!line.empty()) { line = trimString(line); @@ -215,7 +215,7 @@ wstring AbstractTexturePack::getAnimationString(const wstring &textureName, cons return result; } -BufferedImage *AbstractTexturePack::getImageResource(const wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/) +BufferedImage *AbstractTexturePack::getImageResource(const std::wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const std::wstring &drive /*=L""*/) { const char *pchTexture=wstringtofilename(File); app.DebugPrintf("AbstractTexturePack::getImageResource - %s, drive is %s\n",pchTexture, wstringtofilename(drive)); @@ -361,7 +361,7 @@ void AbstractTexturePack::unloadUI() // Do nothing } -wstring AbstractTexturePack::getXuiRootPath() +std::wstring AbstractTexturePack::getXuiRootPath() { const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h b/Minecraft.Client/Textures/Packs/AbstractTexturePack.h index e6410c193..9bccba975 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h +++ b/Minecraft.Client/Textures/Packs/AbstractTexturePack.h @@ -9,15 +9,15 @@ class AbstractTexturePack : public TexturePack { private: const DWORD id; - const wstring name; + const std::wstring name; protected: File *file; - wstring texname; - wstring m_wsWorldName; + std::wstring texname; + std::wstring m_wsWorldName; - wstring desc1; - wstring desc2; + std::wstring desc1; + std::wstring desc2; PBYTE m_iconData; DWORD m_iconSize; @@ -36,10 +36,10 @@ private: int textureId; protected: - AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback); + AbstractTexturePack(DWORD id, File *file, const std::wstring &name, TexturePack *fallback); private: - static wstring trim(wstring line); + static std::wstring trim(std::wstring line); protected: virtual void loadIcon(); @@ -48,29 +48,29 @@ protected: virtual void loadName(); public: - virtual InputStream *getResource(const wstring &name, bool allowFallback); //throws IOException + virtual InputStream *getResource(const std::wstring &name, bool allowFallback); //throws IOException // 4J Removed do to current override in TexturePack class - //virtual InputStream *getResource(const wstring &name); //throws IOException + //virtual InputStream *getResource(const std::wstring &name); //throws IOException virtual DLCPack * getDLCPack() =0; protected: - virtual InputStream *getResourceImplementation(const wstring &name) = 0; // throws IOException; + virtual InputStream *getResourceImplementation(const std::wstring &name) = 0; // throws IOException; public: virtual void unload(Textures *textures); virtual void load(Textures *textures); - virtual bool hasFile(const wstring &name, bool allowFallback); - virtual bool hasFile(const wstring &name) = 0; + virtual bool hasFile(const std::wstring &name, bool allowFallback); + virtual bool hasFile(const std::wstring &name) = 0; virtual DWORD getId(); - virtual wstring getName(); - virtual wstring getDesc1(); - virtual wstring getDesc2(); - virtual wstring getWorldName(); + virtual std::wstring getName(); + virtual std::wstring getDesc1(); + virtual std::wstring getDesc2(); + virtual std::wstring getWorldName(); - virtual wstring getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback); + virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path, bool allowFallback); protected: - virtual wstring getAnimationString(const wstring &textureName, const wstring &path); + virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path); void loadDefaultUI(); void loadDefaultColourTable(); void loadDefaultHTMLColourTable(); @@ -79,11 +79,11 @@ protected: #endif public: - virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); + virtual BufferedImage *getImageResource(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L""); virtual void loadColourTable(); virtual void loadUI(); virtual void unloadUI(); - virtual wstring getXuiRootPath(); + virtual std::wstring getXuiRootPath(); virtual PBYTE getPackIcon(DWORD &dwImageBytes); virtual PBYTE getPackComparison(DWORD &dwImageBytes); virtual unsigned int getDLCParentPackId(); diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp index 00fc395cc..0be09c786 100644 --- a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp @@ -101,7 +101,7 @@ void DLCTexturePack::loadDescription() } } -wstring DLCTexturePack::getResource(const wstring& name) +std::wstring DLCTexturePack::getResource(const std::wstring& name) { // 4J Stu - We should never call this function #ifndef __CONTENT_PACKAGE @@ -110,7 +110,7 @@ wstring DLCTexturePack::getResource(const wstring& name) return L""; } -InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //throws IOException +InputStream *DLCTexturePack::getResourceImplementation(const std::wstring &name) //throws IOException { // 4J Stu - We should never call this function #ifndef _CONTENT_PACKAGE @@ -120,7 +120,7 @@ InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //th return NULL; //resource; } -bool DLCTexturePack::hasFile(const wstring &name) +bool DLCTexturePack::hasFile(const std::wstring &name) { bool hasFile = false; if(m_dlcDataPack != NULL) hasFile = m_dlcDataPack->doesPackContainFile(DLCManager::e_DLCType_Texture, name); @@ -132,16 +132,16 @@ bool DLCTexturePack::isTerrainUpdateCompatible() return true; } -wstring DLCTexturePack::getPath(bool bTitleUpdateTexture /*= false*/) +std::wstring DLCTexturePack::getPath(bool bTitleUpdateTexture /*= false*/) { return L""; } -wstring DLCTexturePack::getAnimationString(const wstring &textureName, const wstring &path) +std::wstring DLCTexturePack::getAnimationString(const std::wstring &textureName, const std::wstring &path) { - wstring result = L""; + std::wstring result = L""; - wstring fullpath = L"res/" + path + textureName + L".png"; + std::wstring fullpath = L"res/" + path + textureName + L".png"; if(hasFile(fullpath)) { result = m_dlcDataPack->getFile(DLCManager::e_DLCType_Texture, fullpath)->getParameterAsString(DLCManager::e_DLCParamType_Anim); @@ -150,7 +150,7 @@ wstring DLCTexturePack::getAnimationString(const wstring &textureName, const wst return result; } -BufferedImage *DLCTexturePack::getImageResource(const wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/) +BufferedImage *DLCTexturePack::getImageResource(const std::wstring& File, bool filenameHasExtension /*= false*/, bool bTitleUpdateTexture /*=false*/, const std::wstring &drive /*=L""*/) { if(m_dlcDataPack) return new BufferedImage(m_dlcDataPack, L"/" + File, filenameHasExtension); else return fallback->getImageResource(File, filenameHasExtension, bTitleUpdateTexture, drive); @@ -267,7 +267,7 @@ void DLCTexturePack::loadData() -wstring DLCTexturePack::getFilePath(DWORD packId, wstring filename, bool bAddDataFolder) +std::wstring DLCTexturePack::getFilePath(DWORD packId, std::wstring filename, bool bAddDataFolder) { return app.getFilePath(packId,filename,bAddDataFolder); } @@ -288,7 +288,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen texturePack->setHasAudio(false); DWORD dwFilesProcessed = 0; // Load the DLC textures - wstring dataFilePath = texturePack->m_dlcInfoPack->getFullDataPath(); + std::wstring dataFilePath = texturePack->m_dlcInfoPack->getFullDataPath(); if(!dataFilePath.empty()) { if(!app.m_dlcManager.readDLCDataFile(dwFilesProcessed, getFilePath(texturePack->m_dlcInfoPack->GetPackID(), dataFilePath),texturePack->m_dlcDataPack)) @@ -301,7 +301,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if(texturePack->m_dlcDataPack != NULL) { #ifdef _XBOX - File xzpPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"TexturePack.xzp") ) ); + File xzpPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"TexturePack.xzp") ) ); if(xzpPath.exists()) { @@ -332,7 +332,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen } } #else - File archivePath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"media.arc") ) ); + File archivePath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"media.arc") ) ); if(archivePath.exists()) texturePack->m_archiveFile = new ArchiveFile(archivePath); #endif @@ -355,7 +355,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if (grf.exists()) { #if defined(_UNICODE) && !defined(__linux__) - wstring path = grf.getPath(); + std::wstring path = grf.getPath(); const WCHAR *pchFilename=path.c_str(); HANDLE fileHandle = CreateFile( pchFilename, // file name @@ -407,7 +407,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if (grf.exists()) { #if defined(_UNICODE) && !defined(__linux__) - wstring path = grf.getPath(); + std::wstring path = grf.getPath(); const WCHAR *pchFilename=path.c_str(); HANDLE fileHandle = CreateFile( pchFilename, // file name @@ -452,8 +452,8 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen // any audio data? #ifdef _XBOX - File audioXSBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"MashUp.xsb") ) ); - File audioXWBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), wstring(L"MashUp.xwb") ) ); + File audioXSBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"MashUp.xsb") ) ); + File audioXWBPath(getFilePath(texturePack->m_dlcInfoPack->GetPackID(), std::wstring(L"MashUp.xwb") ) ); if(audioXSBPath.exists() && audioXWBPath.exists()) { @@ -584,9 +584,9 @@ void DLCTexturePack::unloadUI() bUILoaded = false; } -wstring DLCTexturePack::getXuiRootPath() +std::wstring DLCTexturePack::getXuiRootPath() { - wstring path = L""; + std::wstring path = L""; if(m_dlcDataPack != NULL && m_dlcDataPack->doesPackContainFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp")) { DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp"); diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.h b/Minecraft.Client/Textures/Packs/DLCTexturePack.h index 14e6ea23e..375c8cafe 100644 --- a/Minecraft.Client/Textures/Packs/DLCTexturePack.h +++ b/Minecraft.Client/Textures/Packs/DLCTexturePack.h @@ -25,7 +25,7 @@ public: DLCTexturePack(DWORD id, DLCPack *pack, TexturePack *fallback); ~DLCTexturePack(); - virtual wstring getResource(const wstring& name); + virtual std::wstring getResource(const std::wstring& name); virtual DLCPack * getDLCPack(); // Added for sound banks with MashUp packs #ifdef _XBOX @@ -38,31 +38,31 @@ protected: void loadComparison(); void loadName(); void loadDescription(); - InputStream *getResourceImplementation(const wstring &name); //throws IOException + InputStream *getResourceImplementation(const std::wstring &name); //throws IOException public: //@Override - bool hasFile(const wstring &name); + bool hasFile(const std::wstring &name); bool isTerrainUpdateCompatible(); // 4J Added - virtual wstring getPath(bool bTitleUpdateTexture = false); - virtual wstring getAnimationString(const wstring &textureName, const wstring &path); - virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); + virtual std::wstring getPath(bool bTitleUpdateTexture = false); + virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path); + virtual BufferedImage *getImageResource(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L""); virtual void loadColourTable(); virtual bool hasData() { return m_bHasLoadedData; } virtual bool isLoadingData() { return m_bLoadingData; } private: - static wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder); - static wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder=true); + static std::wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder); + static std::wstring getFilePath(DWORD packId, std::wstring filename, bool bAddDataFolder=true); public: static int packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask); virtual void loadData(); virtual void loadUI(); virtual void unloadUI(); - virtual wstring getXuiRootPath(); + virtual std::wstring getXuiRootPath(); virtual ArchiveFile *getArchiveFile() { return m_archiveFile; } virtual unsigned int getDLCParentPackId(); diff --git a/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp b/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp index b92b2b649..5484ada30 100644 --- a/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp @@ -45,7 +45,7 @@ void DefaultTexturePack::loadName() texname = L"Minecraft"; } -bool DefaultTexturePack::hasFile(const wstring &name) +bool DefaultTexturePack::hasFile(const std::wstring &name) { // return DefaultTexturePack::class->getResourceAsStream(name) != null; return true; @@ -56,9 +56,9 @@ bool DefaultTexturePack::isTerrainUpdateCompatible() return true; } -InputStream *DefaultTexturePack::getResourceImplementation(const wstring &name)// throws FileNotFoundException +InputStream *DefaultTexturePack::getResourceImplementation(const std::wstring &name)// throws FileNotFoundException { - wstring wDrive = L""; + std::wstring wDrive = L""; // Make the content package point to to the UPDATE: drive is needed #ifdef _XBOX #ifdef _TU_BUILD @@ -84,14 +84,14 @@ InputStream *DefaultTexturePack::getResourceImplementation(const wstring &name)/ } - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); wDrive = wstr + L"\\Common\\res\\TitleUpdate\\res"; #elif __PSVITA__ /* char *pchUsrDir=getUsrDirPath(); - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); wDrive = wstr + L"Common\\res\\TitleUpdate\\res"; */ diff --git a/Minecraft.Client/Textures/Packs/DefaultTexturePack.h b/Minecraft.Client/Textures/Packs/DefaultTexturePack.h index 9aa87a07a..1b46f22f3 100644 --- a/Minecraft.Client/Textures/Packs/DefaultTexturePack.h +++ b/Minecraft.Client/Textures/Packs/DefaultTexturePack.h @@ -15,14 +15,14 @@ protected: public: //@Override - bool hasFile(const wstring &name); + bool hasFile(const std::wstring &name); bool isTerrainUpdateCompatible(); - wstring getDesc1() {return app.GetString(IDS_DEFAULT_TEXTUREPACK);} + std::wstring getDesc1() {return app.GetString(IDS_DEFAULT_TEXTUREPACK);} protected: //@Override - InputStream *getResourceImplementation(const wstring &name); // throws FileNotFoundException + InputStream *getResourceImplementation(const std::wstring &name); // throws FileNotFoundException public: virtual bool hasData() { return true; } diff --git a/Minecraft.Client/Textures/Packs/FileTexturePack.cpp b/Minecraft.Client/Textures/Packs/FileTexturePack.cpp index 6798d570a..93c9426a9 100644 --- a/Minecraft.Client/Textures/Packs/FileTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/FileTexturePack.cpp @@ -24,7 +24,7 @@ void FileTexturePack::unload(Textures *textures) #endif } -InputStream *FileTexturePack::getResourceImplementation(const wstring &name) //throws IOException +InputStream *FileTexturePack::getResourceImplementation(const std::wstring &name) //throws IOException { #if 0 loadZipFile(); @@ -39,7 +39,7 @@ InputStream *FileTexturePack::getResourceImplementation(const wstring &name) //t return NULL; } -bool FileTexturePack::hasFile(const wstring &name) +bool FileTexturePack::hasFile(const std::wstring &name) { #if 0 try { diff --git a/Minecraft.Client/Textures/Packs/FileTexturePack.h b/Minecraft.Client/Textures/Packs/FileTexturePack.h index 85221d114..082f4444b 100644 --- a/Minecraft.Client/Textures/Packs/FileTexturePack.h +++ b/Minecraft.Client/Textures/Packs/FileTexturePack.h @@ -18,11 +18,11 @@ public: void unload(Textures *textures); protected: - InputStream *getResourceImplementation(const wstring &name); //throws IOException + InputStream *getResourceImplementation(const std::wstring &name); //throws IOException public: //@Override - bool hasFile(const wstring &name); + bool hasFile(const std::wstring &name); private: void loadZipFile(); //throws IOException diff --git a/Minecraft.Client/Textures/Packs/FolderTexturePack.cpp b/Minecraft.Client/Textures/Packs/FolderTexturePack.cpp index f512f4eb9..a63498ecf 100644 --- a/Minecraft.Client/Textures/Packs/FolderTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/FolderTexturePack.cpp @@ -1,7 +1,7 @@ #include "../../Build/stdafx.h" #include "FolderTexturePack.h" -FolderTexturePack::FolderTexturePack(DWORD id, const wstring &name, File *folder, TexturePack *fallback) : AbstractTexturePack(id, folder, name, fallback) +FolderTexturePack::FolderTexturePack(DWORD id, const std::wstring &name, File *folder, TexturePack *fallback) : AbstractTexturePack(id, folder, name, fallback) { // 4J Stu - These calls need to be in the most derived version of the class loadIcon(); @@ -11,7 +11,7 @@ FolderTexturePack::FolderTexturePack(DWORD id, const wstring &name, File *folder bUILoaded = false; } -InputStream *FolderTexturePack::getResourceImplementation(const wstring &name) //throws IOException +InputStream *FolderTexturePack::getResourceImplementation(const std::wstring &name) //throws IOException { #if 0 final File file = new File(this.file, name.substring(1)); @@ -22,7 +22,7 @@ InputStream *FolderTexturePack::getResourceImplementation(const wstring &name) / return new BufferedInputStream(new FileInputStream(file)); #endif - wstring wDrive = L""; + std::wstring wDrive = L""; // Make the content package point to to the UPDATE: drive is needed #ifdef _XBOX wDrive=L"GAME:\\DummyTexturePack\\res"; @@ -40,7 +40,7 @@ InputStream *FolderTexturePack::getResourceImplementation(const wstring &name) / return resource; } -bool FolderTexturePack::hasFile(const wstring &name) +bool FolderTexturePack::hasFile(const std::wstring &name) { File file = File( getPath() + name); return file.exists() && file.isFile(); @@ -58,9 +58,9 @@ bool FolderTexturePack::isTerrainUpdateCompatible() return true; } -wstring FolderTexturePack::getPath(bool bTitleUpdateTexture /*= false*/) +std::wstring FolderTexturePack::getPath(bool bTitleUpdateTexture /*= false*/) { - wstring wDrive; + std::wstring wDrive; #ifdef _XBOX wDrive=L"GAME:\\" + file->getPath() + L"\\"; #else diff --git a/Minecraft.Client/Textures/Packs/FolderTexturePack.h b/Minecraft.Client/Textures/Packs/FolderTexturePack.h index fff4abf5d..c57d2576e 100644 --- a/Minecraft.Client/Textures/Packs/FolderTexturePack.h +++ b/Minecraft.Client/Textures/Packs/FolderTexturePack.h @@ -8,19 +8,19 @@ private: bool bUILoaded; public: - FolderTexturePack(DWORD id, const wstring &name, File *folder, TexturePack *fallback); + FolderTexturePack(DWORD id, const std::wstring &name, File *folder, TexturePack *fallback); protected: //@Override - InputStream *getResourceImplementation(const wstring &name); //throws IOException + InputStream *getResourceImplementation(const std::wstring &name); //throws IOException public: //@Override - bool hasFile(const wstring &name); + bool hasFile(const std::wstring &name); bool isTerrainUpdateCompatible(); // 4J Added - virtual wstring getPath(bool bTitleUpdateTexture = false); + virtual std::wstring getPath(bool bTitleUpdateTexture = false); virtual void loadUI(); virtual void unloadUI(); }; \ No newline at end of file diff --git a/Minecraft.Client/Textures/Packs/TexturePack.cpp b/Minecraft.Client/Textures/Packs/TexturePack.cpp index 4102b533a..77e1d8b87 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/TexturePack.cpp @@ -1,9 +1,9 @@ #include "../../Build/stdafx.h" #include "TexturePack.h" -wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/) +std::wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/) { - wstring wDrive; + std::wstring wDrive; #ifdef _XBOX if(bTitleUpdateTexture) { @@ -27,7 +27,7 @@ wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/) char *pchUsrDir=getUsrDirPath(); - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(bTitleUpdateTexture) { @@ -42,7 +42,7 @@ wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/) #elif __PSVITA__ char *pchUsrDir="";//getUsrDirPath(); - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(bTitleUpdateTexture) { diff --git a/Minecraft.Client/Textures/Packs/TexturePack.h b/Minecraft.Client/Textures/Packs/TexturePack.h index 16f877b8a..ee2a9af3b 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.h +++ b/Minecraft.Client/Textures/Packs/TexturePack.h @@ -19,16 +19,16 @@ public: virtual void loadData() {} virtual void unload(Textures *textures) = 0; virtual void load(Textures *textures) = 0; - virtual InputStream *getResource(const wstring &name, bool allowFallback) = 0;// throws IOException; - //virtual InputStream *getResource(const wstring &name) = 0;// throws IOException; + virtual InputStream *getResource(const std::wstring &name, bool allowFallback) = 0;// throws IOException; + //virtual InputStream *getResource(const std::wstring &name) = 0;// throws IOException; virtual DWORD getId() = 0; - virtual wstring getName() = 0; - virtual wstring getDesc1() = 0; - virtual wstring getDesc2() = 0; - virtual bool hasFile(const wstring &name, bool allowFallback) = 0; + virtual std::wstring getName() = 0; + virtual std::wstring getDesc1() = 0; + virtual std::wstring getDesc2() = 0; + virtual bool hasFile(const std::wstring &name, bool allowFallback) = 0; virtual bool isTerrainUpdateCompatible() = 0; - virtual wstring getResource(const wstring& name) // 4J - changed to just return a name rather than an input stream + virtual std::wstring getResource(const std::wstring& name) // 4J - changed to just return a name rather than an input stream { /* 4J - TODO return TexturePack.class.getResourceAsStream(name); @@ -39,13 +39,13 @@ public: // 4J Added - virtual wstring getPath(bool bTitleUpdateTexture = false); - virtual wstring getAnimationString(const wstring &textureName, const wstring &path, bool allowFallback) = 0; - virtual BufferedImage *getImageResource(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L"") = 0; + virtual std::wstring getPath(bool bTitleUpdateTexture = false); + virtual std::wstring getAnimationString(const std::wstring &textureName, const std::wstring &path, bool allowFallback) = 0; + virtual BufferedImage *getImageResource(const std::wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const std::wstring &drive =L"") = 0; virtual void loadColourTable() = 0; virtual void loadUI() = 0; virtual void unloadUI() = 0; - virtual wstring getXuiRootPath() = 0; + virtual std::wstring getXuiRootPath() = 0; virtual PBYTE getPackIcon(DWORD &dwImageBytes) = 0; virtual PBYTE getPackComparison(DWORD &dwImageBytes) = 0; virtual unsigned int getDLCParentPackId() = 0; diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp b/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp index 817fc7aac..3bae4d69a 100644 --- a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp +++ b/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp @@ -105,7 +105,7 @@ bool TexturePackRepository::selectSkin(TexturePack *skin) return true; } -void TexturePackRepository::selectWebSkin(const wstring &url) +void TexturePackRepository::selectWebSkin(const std::wstring &url) { app.DebugPrintf("TexturePackRepository::selectWebSkin is not implemented\n"); #if 0 @@ -117,7 +117,7 @@ void TexturePackRepository::selectWebSkin(const wstring &url) #endif } -void TexturePackRepository::downloadWebSkin(const wstring &url, File file) +void TexturePackRepository::downloadWebSkin(const std::wstring &url, File file) { app.DebugPrintf("TexturePackRepository::selectWebSkin is not implemented\n"); #if 0 @@ -219,7 +219,7 @@ void TexturePackRepository::updateList() #endif } -wstring TexturePackRepository::getIdOrNull(File file) +std::wstring TexturePackRepository::getIdOrNull(File file) { app.DebugPrintf("TexturePackRepository::getIdOrNull is not implemented\n"); #if 0 @@ -291,14 +291,14 @@ bool TexturePackRepository::canUseWebSkin() return false; } -vector< pair > *TexturePackRepository::getTexturePackIdNames() +vector< pair > *TexturePackRepository::getTexturePackIdNames() { - vector< pair > *packList = new vector< pair >(); + vector< pair > *packList = new vector< pair >(); for(AUTO_VAR(it,texturePacks->begin()); it != texturePacks->end(); ++it) { TexturePack *pack = *it; - packList->push_back( pair(pack->getId(),pack->getName()) ); + packList->push_back( pair(pack->getId(),pack->getName()) ); } return packList; } diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.h b/Minecraft.Client/Textures/Packs/TexturePackRepository.h index 922b440de..99e89852e 100644 --- a/Minecraft.Client/Textures/Packs/TexturePackRepository.h +++ b/Minecraft.Client/Textures/Packs/TexturePackRepository.h @@ -37,10 +37,10 @@ private: public: bool selectSkin(TexturePack *skin); - void selectWebSkin(const wstring &url); + void selectWebSkin(const std::wstring &url); private: - void downloadWebSkin(const wstring &url, File file); + void downloadWebSkin(const std::wstring &url, File file); public: bool isUsingWebSkin(); @@ -48,7 +48,7 @@ public: void updateList(); private: - wstring getIdOrNull(File file); + std::wstring getIdOrNull(File file); vector getWorkDirContents(); public: @@ -60,7 +60,7 @@ public: bool isUsingDefaultSkin() { return selected == DEFAULT_TEXTURE_PACK; } // 4J Added TexturePack *getDefault() { return DEFAULT_TEXTURE_PACK; } // 4J Added - vector< pair > *getTexturePackIdNames(); + vector< pair > *getTexturePackIdNames(); bool selectTexturePackById(DWORD id); // 4J Added TexturePack *getTexturePackById(DWORD id); // 4J Added diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp index cc024b19a..8bf37af90 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp @@ -19,9 +19,9 @@ #include "../CompassTexture.h" #include "../ClockTexture.h" -const wstring PreStitchedTextureMap::NAME_MISSING_TEXTURE = L"missingno"; +const std::wstring PreStitchedTextureMap::NAME_MISSING_TEXTURE = L"missingno"; -PreStitchedTextureMap::PreStitchedTextureMap(int type, const wstring &name, const wstring &path, BufferedImage *missingTexture, bool mipmap) : iconType(type), name(name), path(path), extension(L".png") +PreStitchedTextureMap::PreStitchedTextureMap(int type, const std::wstring &name, const std::wstring &path, BufferedImage *missingTexture, bool mipmap) : iconType(type), name(name), path(path), extension(L".png") { this->missingTexture = missingTexture; @@ -77,7 +77,7 @@ void PreStitchedTextureMap::stitch() animatedTextures.clear(); // Create the final image - wstring filename = name + extension; + std::wstring filename = name + extension; TexturePack *texturePack = Minecraft::GetInstance()->skins->getSelected(); //try { @@ -87,7 +87,7 @@ void PreStitchedTextureMap::stitch() int magFilter = Texture::TFLT_NEAREST; MemSect(32); - wstring drive = L""; + std::wstring drive = L""; if(texturePack->hasFile(L"res/" + filename,false)) { drive = texturePack->getPath(true); @@ -129,8 +129,8 @@ void PreStitchedTextureMap::stitch() MemSect(52); for(AUTO_VAR(it, texturesToAnimate.begin()); it != texturesToAnimate.end(); ++it) { - wstring textureName = it->first; - wstring textureFileName = it->second; + std::wstring textureName = it->first; + std::wstring textureFileName = it->second; StitchedTexture *preStitched = (StitchedTexture *)texturesByName[textureName]; @@ -140,7 +140,7 @@ void PreStitchedTextureMap::stitch() continue; } - wstring filename = path + textureFileName + extension; + std::wstring filename = path + textureFileName + extension; // TODO: [EB] Put the frames into a proper object, not this inside out hack vector *frames = TextureManager::getInstance()->createTextures(filename, m_mipMap); @@ -164,7 +164,7 @@ void PreStitchedTextureMap::stitch() { animatedTextures.push_back(preStitched); - wstring animString = texturePack->getAnimationString(textureFileName, path, true); + std::wstring animString = texturePack->getAnimationString(textureFileName, path, true); preStitched->loadAnimationFrames(animString); } @@ -216,7 +216,7 @@ void PreStitchedTextureMap::stitch() #endif } -StitchedTexture *PreStitchedTextureMap::getTexture(const wstring &name) +StitchedTexture *PreStitchedTextureMap::getTexture(const std::wstring &name) { #ifndef _CONTENT_PACKAGE app.DebugPrintf("Not implemented!\n"); @@ -246,7 +246,7 @@ Texture *PreStitchedTextureMap::getStitchedTexture() } // 4J Stu - register is a reserved keyword in C++ -Icon *PreStitchedTextureMap::registerIcon(const wstring &name) +Icon *PreStitchedTextureMap::registerIcon(const std::wstring &name) { Icon *result = NULL; if (name.empty()) @@ -363,11 +363,11 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"compassP1",new SimpleIcon(L"compassP1",slotSize*8,slotSize*14,slotSize*(8+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"compassP2",new SimpleIcon(L"compassP2",slotSize*9,slotSize*14,slotSize*(9+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"compassP3",new SimpleIcon(L"compassP3",slotSize*10,slotSize*14,slotSize*(10+1),slotSize*(14+1)))); - texturesToAnimate.push_back(pair(L"compass",L"compass")); - texturesToAnimate.push_back(pair(L"compassP0",L"compass")); - texturesToAnimate.push_back(pair(L"compassP1",L"compass")); - texturesToAnimate.push_back(pair(L"compassP2",L"compass")); - texturesToAnimate.push_back(pair(L"compassP3",L"compass")); + texturesToAnimate.push_back(pair(L"compass",L"compass")); + texturesToAnimate.push_back(pair(L"compassP0",L"compass")); + texturesToAnimate.push_back(pair(L"compassP1",L"compass")); + texturesToAnimate.push_back(pair(L"compassP2",L"compass")); + texturesToAnimate.push_back(pair(L"compassP3",L"compass")); texturesByName.insert(stringIconMap::value_type(L"diamond",new SimpleIcon(L"diamond",slotSize*7,slotSize*3,slotSize*(7+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"redstone",new SimpleIcon(L"redstone",slotSize*8,slotSize*3,slotSize*(8+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"clay",new SimpleIcon(L"clay",slotSize*9,slotSize*3,slotSize*(9+1),slotSize*(3+1)))); @@ -388,11 +388,11 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"clockP1",new SimpleIcon(L"clockP1",slotSize*12,slotSize*14,slotSize*(12+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"clockP2",new SimpleIcon(L"clockP2",slotSize*13,slotSize*14,slotSize*(13+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"clockP3",new SimpleIcon(L"clockP3",slotSize*14,slotSize*14,slotSize*(14+1),slotSize*(14+1)))); - texturesToAnimate.push_back(pair(L"clock",L"clock")); - texturesToAnimate.push_back(pair(L"clockP0",L"clock")); - texturesToAnimate.push_back(pair(L"clockP1",L"clock")); - texturesToAnimate.push_back(pair(L"clockP2",L"clock")); - texturesToAnimate.push_back(pair(L"clockP3",L"clock")); + texturesToAnimate.push_back(pair(L"clock",L"clock")); + texturesToAnimate.push_back(pair(L"clockP0",L"clock")); + texturesToAnimate.push_back(pair(L"clockP1",L"clock")); + texturesToAnimate.push_back(pair(L"clockP2",L"clock")); + texturesToAnimate.push_back(pair(L"clockP3",L"clock")); texturesByName.insert(stringIconMap::value_type(L"bowl",new SimpleIcon(L"bowl",slotSize*7,slotSize*4,slotSize*(7+1),slotSize*(4+1)))); texturesByName.insert(stringIconMap::value_type(L"mushroomStew",new SimpleIcon(L"mushroomStew",slotSize*8,slotSize*4,slotSize*(8+1),slotSize*(4+1)))); texturesByName.insert(stringIconMap::value_type(L"yellowDust",new SimpleIcon(L"yellowDust",slotSize*9,slotSize*4,slotSize*(9+1),slotSize*(4+1)))); @@ -607,7 +607,7 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"rose",new SimpleIcon(L"rose",slotSize*12,slotSize*0,slotSize*(12+1),slotSize*(0+1)))); texturesByName.insert(stringIconMap::value_type(L"flower",new SimpleIcon(L"flower",slotSize*13,slotSize*0,slotSize*(13+1),slotSize*(0+1)))); texturesByName.insert(stringIconMap::value_type(L"portal",new SimpleIcon(L"portal",slotSize*14,slotSize*0,slotSize*(14+1),slotSize*(0+1)))); - texturesToAnimate.push_back(pair(L"portal",L"portal")); + texturesToAnimate.push_back(pair(L"portal",L"portal")); texturesByName.insert(stringIconMap::value_type(L"sapling",new SimpleIcon(L"sapling",slotSize*15,slotSize*0,slotSize*(15+1),slotSize*(0+1)))); texturesByName.insert(stringIconMap::value_type(L"stonebrick",new SimpleIcon(L"stonebrick",slotSize*0,slotSize*1,slotSize*(0+1),slotSize*(1+1)))); texturesByName.insert(stringIconMap::value_type(L"bedrock",new SimpleIcon(L"bedrock",slotSize*1,slotSize*1,slotSize*(1+1),slotSize*(1+1)))); @@ -625,7 +625,7 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"mushroom_brown",new SimpleIcon(L"mushroom_brown",slotSize*13,slotSize*1,slotSize*(13+1),slotSize*(1+1)))); texturesByName.insert(stringIconMap::value_type(L"sapling_jungle",new SimpleIcon(L"sapling_jungle",slotSize*14,slotSize*1,slotSize*(14+1),slotSize*(1+1)))); texturesByName.insert(stringIconMap::value_type(L"fire_0",new SimpleIcon(L"fire_0",slotSize*15,slotSize*1,slotSize*(15+1),slotSize*(1+1)))); - texturesToAnimate.push_back(pair(L"fire_0",L"fire_0")); + texturesToAnimate.push_back(pair(L"fire_0",L"fire_0")); texturesByName.insert(stringIconMap::value_type(L"oreGold",new SimpleIcon(L"oreGold",slotSize*0,slotSize*2,slotSize*(0+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"oreIron",new SimpleIcon(L"oreIron",slotSize*1,slotSize*2,slotSize*(1+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"oreCoal",new SimpleIcon(L"oreCoal",slotSize*2,slotSize*2,slotSize*(2+1),slotSize*(2+1)))); @@ -642,7 +642,7 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"furnace_side",new SimpleIcon(L"furnace_side",slotSize*13,slotSize*2,slotSize*(13+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"dispenser_front",new SimpleIcon(L"dispenser_front",slotSize*14,slotSize*2,slotSize*(14+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"fire_1",new SimpleIcon(L"fire_1",slotSize*15,slotSize*1,slotSize*(15+1),slotSize*(1+1)))); - texturesToAnimate.push_back(pair(L"fire_1",L"fire_1")); + texturesToAnimate.push_back(pair(L"fire_1",L"fire_1")); texturesByName.insert(stringIconMap::value_type(L"sponge",new SimpleIcon(L"sponge",slotSize*0,slotSize*3,slotSize*(0+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"glass",new SimpleIcon(L"glass",slotSize*1,slotSize*3,slotSize*(1+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"oreDiamond",new SimpleIcon(L"oreDiamond",slotSize*2,slotSize*3,slotSize*(2+1),slotSize*(3+1)))); @@ -803,9 +803,9 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"potatoes_2",new SimpleIcon(L"potatoes_2",slotSize*10,slotSize*12,slotSize*(10+1),slotSize*(12+1)))); texturesByName.insert(stringIconMap::value_type(L"potatoes_3",new SimpleIcon(L"potatoes_3",slotSize*12,slotSize*12,slotSize*(12+1),slotSize*(12+1)))); texturesByName.insert(stringIconMap::value_type(L"water",new SimpleIcon(L"water",slotSize*13,slotSize*12,slotSize*(13+1),slotSize*(12+1)))); - texturesToAnimate.push_back(pair(L"water",L"water")); + texturesToAnimate.push_back(pair(L"water",L"water")); texturesByName.insert(stringIconMap::value_type(L"water_flow",new SimpleIcon(L"water_flow",slotSize*14,slotSize*12,slotSize*(14+2),slotSize*(12+2)))); - texturesToAnimate.push_back(pair(L"water_flow",L"water_flow")); + texturesToAnimate.push_back(pair(L"water_flow",L"water_flow")); texturesByName.insert(stringIconMap::value_type(L"sandstone_bottom",new SimpleIcon(L"sandstone_bottom",slotSize*0,slotSize*13,slotSize*(0+1),slotSize*(13+1)))); texturesByName.insert(stringIconMap::value_type(L"cloth_9",new SimpleIcon(L"cloth_9",slotSize*1,slotSize*13,slotSize*(1+1),slotSize*(13+1)))); texturesByName.insert(stringIconMap::value_type(L"cloth_1",new SimpleIcon(L"cloth_1",slotSize*2,slotSize*13,slotSize*(2+1),slotSize*(13+1)))); @@ -834,9 +834,9 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"quartzblock_side",new SimpleIcon(L"quartzblock_side",slotSize*11,slotSize*14,slotSize*(11+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"hopper_inside",new SimpleIcon(L"hopper_inside",slotSize*12,slotSize*14,slotSize*(12+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"lava",new SimpleIcon(L"lava",slotSize*13,slotSize*14,slotSize*(13+1),slotSize*(14+1)))); - texturesToAnimate.push_back(pair(L"lava",L"lava")); + texturesToAnimate.push_back(pair(L"lava",L"lava")); texturesByName.insert(stringIconMap::value_type(L"lava_flow",new SimpleIcon(L"lava_flow",slotSize*14,slotSize*14,slotSize*(14+2),slotSize*(14+2)))); - texturesToAnimate.push_back(pair(L"lava_flow",L"lava_flow")); + texturesToAnimate.push_back(pair(L"lava_flow",L"lava_flow")); texturesByName.insert(stringIconMap::value_type(L"destroy_0",new SimpleIcon(L"destroy_0",slotSize*0,slotSize*15,slotSize*(0+1),slotSize*(15+1)))); texturesByName.insert(stringIconMap::value_type(L"destroy_1",new SimpleIcon(L"destroy_1",slotSize*1,slotSize*15,slotSize*(1+1),slotSize*(15+1)))); texturesByName.insert(stringIconMap::value_type(L"destroy_2",new SimpleIcon(L"destroy_2",slotSize*2,slotSize*15,slotSize*(2+1),slotSize*(15+1)))); diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h index aab22ffab..763d2cab7 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h +++ b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h @@ -12,37 +12,37 @@ class BufferedImage; class PreStitchedTextureMap : public IconRegister { public: - static const wstring NAME_MISSING_TEXTURE; + static const std::wstring NAME_MISSING_TEXTURE; private: const int iconType; - const wstring name; - const wstring path; - const wstring extension; + const std::wstring name; + const std::wstring path; + const std::wstring extension; bool m_mipMap; - typedef std::unordered_map stringIconMap; + typedef std::unordered_map stringIconMap; stringIconMap texturesByName; // = new HashMap(); BufferedImage *missingTexture; // = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB); StitchedTexture *missingPosition; Texture *stitchResult; vector animatedTextures; // = new ArrayList(); - vector > texturesToAnimate; + vector > texturesToAnimate; void loadUVs(); public: - PreStitchedTextureMap(int type, const wstring &name, const wstring &path, BufferedImage *missingTexture, bool mipMap = false); + PreStitchedTextureMap(int type, const std::wstring &name, const std::wstring &path, BufferedImage *missingTexture, bool mipMap = false); void stitch(); - StitchedTexture *getTexture(const wstring &name); + StitchedTexture *getTexture(const std::wstring &name); void cycleAnimationFrames(); Texture *getStitchedTexture(); // 4J Stu - register is a reserved keyword in C++ - Icon *registerIcon(const wstring &name); + Icon *registerIcon(const std::wstring &name); int getIconType(); Icon *getMissingIcon(); diff --git a/Minecraft.Client/Textures/Stitching/StitchSlot.cpp b/Minecraft.Client/Textures/Stitching/StitchSlot.cpp index c044dcce2..15dcc2327 100644 --- a/Minecraft.Client/Textures/Stitching/StitchSlot.cpp +++ b/Minecraft.Client/Textures/Stitching/StitchSlot.cpp @@ -150,7 +150,7 @@ void StitchSlot::collectAssignments(vector *result) } //@Override -wstring StitchSlot::toString() +std::wstring StitchSlot::toString() { return L"Slot{originX=" + _toString(originX) + L", originY=" + _toString(originY) + L", width=" + _toString(width) + L", height=" + _toString(height) + L", texture=" + _toString(textureHolder) + L", subSlots=" + _toString(subSlots) + L'}'; } \ No newline at end of file diff --git a/Minecraft.Client/Textures/Stitching/StitchSlot.h b/Minecraft.Client/Textures/Stitching/StitchSlot.h index 0990a06ef..3cedce6b4 100644 --- a/Minecraft.Client/Textures/Stitching/StitchSlot.h +++ b/Minecraft.Client/Textures/Stitching/StitchSlot.h @@ -24,5 +24,5 @@ public: void collectAssignments(vector *result); //@Override - wstring toString(); + std::wstring toString(); }; \ No newline at end of file diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp b/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp index 4ed06b861..3fce9033a 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp +++ b/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp @@ -6,7 +6,7 @@ #include "StitchedTexture.h" #include "../TextureManager.h" -StitchedTexture *StitchedTexture::create(const wstring &name) +StitchedTexture *StitchedTexture::create(const std::wstring &name) { // TODO: Generalize? if (name.compare(L"clock") == 0) @@ -23,7 +23,7 @@ StitchedTexture *StitchedTexture::create(const wstring &name) } } -StitchedTexture::StitchedTexture(const wstring &name) : name(name) +StitchedTexture::StitchedTexture(const std::wstring &name) : name(name) { // 4J Initialisers source = NULL; @@ -170,7 +170,7 @@ float StitchedTexture::getV(double offset, bool adjust/*=false*/) const return getV0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION)); } -wstring StitchedTexture::getName() const +std::wstring StitchedTexture::getName() const { return name; } @@ -256,7 +256,7 @@ void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader) intPairVector *results = new intPairVector(); //try { - wstring line = bufferedReader->readLine(); + std::wstring line = bufferedReader->readLine(); while (!line.empty()) { line = trimString(line); @@ -266,7 +266,7 @@ void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader) //for (String token : tokens) for(AUTO_VAR(it, tokens.begin()); it != tokens.end(); ++it) { - wstring token = *it; + std::wstring token = *it; int multiPos = token.find_first_of('*'); if (multiPos > 0) { @@ -297,7 +297,7 @@ void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader) } } -void StitchedTexture::loadAnimationFrames(const wstring &string) +void StitchedTexture::loadAnimationFrames(const std::wstring &string) { if(frameOverride != NULL) { @@ -313,7 +313,7 @@ void StitchedTexture::loadAnimationFrames(const wstring &string) //for (String token : tokens) for(AUTO_VAR(it, tokens.begin()); it != tokens.end(); ++it) { - wstring token = trimString(*it); + std::wstring token = trimString(*it); int multiPos = token.find_first_of('*'); if (multiPos > 0) { diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.h b/Minecraft.Client/Textures/Stitching/StitchedTexture.h index 62ce19ccc..e1c72e401 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.h +++ b/Minecraft.Client/Textures/Stitching/StitchedTexture.h @@ -7,7 +7,7 @@ class Texture; class StitchedTexture : public Icon { private: - const wstring name; + const std::wstring name; protected: Texture *source; @@ -41,11 +41,11 @@ protected: int subFrame; public: - static StitchedTexture *create(const wstring &name); + static StitchedTexture *create(const std::wstring &name); ~StitchedTexture(); protected: - StitchedTexture(const wstring &name); + StitchedTexture(const std::wstring &name); public: void initUVs(float U0, float V0, float U1, float V1); @@ -61,7 +61,7 @@ public: float getV0(bool adjust = false) const; float getV1(bool adjust = false) const; float getV(double offset, bool adjust = false) const; - wstring getName() const; + std::wstring getName() const; virtual int getSourceWidth() const; virtual int getSourceHeight() const; virtual void cycleFrames(); @@ -80,7 +80,7 @@ public: * @param bufferedReader */ void loadAnimationFrames(BufferedReader *bufferedReader); - void loadAnimationFrames(const wstring &string); // 4J Added + void loadAnimationFrames(const std::wstring &string); // 4J Added int getFlags() const ; // 4J added void setFlags(int flags); // 4J added diff --git a/Minecraft.Client/Textures/Stitching/Stitcher.cpp b/Minecraft.Client/Textures/Stitching/Stitcher.cpp index 821a72af6..ede0953e8 100644 --- a/Minecraft.Client/Textures/Stitching/Stitcher.cpp +++ b/Minecraft.Client/Textures/Stitching/Stitcher.cpp @@ -6,7 +6,7 @@ #include "StitchedTexture.h" #include "Stitcher.h" -void Stitcher::_init(const wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale) +void Stitcher::_init(const std::wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale) { this->name = name; this->maxWidth = maxWidth; @@ -20,12 +20,12 @@ void Stitcher::_init(const wstring &name, int maxWidth, int maxHeight, bool forc stitchedTexture = NULL; } -Stitcher::Stitcher(const wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo) +Stitcher::Stitcher(const std::wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo) { _init(name, maxWidth, maxHeight, forcePowerOfTwo, 0); } -Stitcher::Stitcher(const wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale) +Stitcher::Stitcher(const std::wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale) { _init(name, maxWidth, maxHeight, forcePowerOfTwo, forcedScale); } diff --git a/Minecraft.Client/Textures/Stitching/Stitcher.h b/Minecraft.Client/Textures/Stitching/Stitcher.h index b7f37a3de..62803955a 100644 --- a/Minecraft.Client/Textures/Stitching/Stitcher.h +++ b/Minecraft.Client/Textures/Stitching/Stitcher.h @@ -28,13 +28,13 @@ private: Texture *stitchedTexture; - wstring name; + std::wstring name; - void _init(const wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale); + void _init(const std::wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale); public: - Stitcher(const wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo); - Stitcher(const wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale); + Stitcher(const std::wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo); + Stitcher(const std::wstring &name, int maxWidth, int maxHeight, bool forcePowerOfTwo, int forcedScale); int getWidth(); int getHeight(); diff --git a/Minecraft.Client/Textures/Stitching/TextureMap.cpp b/Minecraft.Client/Textures/Stitching/TextureMap.cpp index 8277da0ec..a36517f94 100644 --- a/Minecraft.Client/Textures/Stitching/TextureMap.cpp +++ b/Minecraft.Client/Textures/Stitching/TextureMap.cpp @@ -15,9 +15,9 @@ #include "../Packs/TexturePackRepository.h" #include "TextureMap.h" -const wstring TextureMap::NAME_MISSING_TEXTURE = L"missingno"; +const std::wstring TextureMap::NAME_MISSING_TEXTURE = L"missingno"; -TextureMap::TextureMap(int type, const wstring &name, const wstring &path, BufferedImage *missingTexture, bool mipmap) : iconType(type), name(name), path(path), extension(L".png") +TextureMap::TextureMap(int type, const std::wstring &name, const std::wstring &path, BufferedImage *missingTexture, bool mipmap) : iconType(type), name(name), path(path), extension(L".png") { this->missingTexture = missingTexture; @@ -82,9 +82,9 @@ void TextureMap::stitch() //for (final String name : texturesToRegister.keySet()) for(AUTO_VAR(it, texturesToRegister.begin()); it != texturesToRegister.end(); ++it) { - wstring name = it->first; + std::wstring name = it->first; - wstring filename = path + name + extension; + std::wstring filename = path + name + extension; // TODO: [EB] Put the frames into a proper object, not this inside out hack vector *frames = TextureManager::getInstance()->createTextures(filename, m_mipMap); @@ -121,7 +121,7 @@ void TextureMap::stitch() TextureHolder *textureHolder = slot->getHolder(); Texture *texture = textureHolder->getTexture(); - wstring textureName = texture->getName(); + std::wstring textureName = texture->getName(); vector *frames = textures.find(textureHolder)->second; @@ -155,7 +155,7 @@ void TextureMap::stitch() { animatedTextures.push_back(stored); - wstring animationDefinitionFile = textureName + L".txt"; + std::wstring animationDefinitionFile = textureName + L".txt"; TexturePack *texturePack = Minecraft::GetInstance()->skins->getSelected(); bool requiresFallback = !texturePack->hasFile(L"\\" + textureName + L".png", false); @@ -189,7 +189,7 @@ void TextureMap::stitch() stitchResult->updateOnGPU(); } -StitchedTexture *TextureMap::getTexture(const wstring &name) +StitchedTexture *TextureMap::getTexture(const std::wstring &name) { StitchedTexture *result = texturesByName.find(name)->second; if (result == NULL) result = missingPosition; @@ -212,7 +212,7 @@ Texture *TextureMap::getStitchedTexture() } // 4J Stu - register is a reserved keyword in C++ -Icon *TextureMap::registerIcon(const wstring &name) +Icon *TextureMap::registerIcon(const std::wstring &name) { if (name.empty()) { diff --git a/Minecraft.Client/Textures/Stitching/TextureMap.h b/Minecraft.Client/Textures/Stitching/TextureMap.h index 173dd15e1..73c35d1ff 100644 --- a/Minecraft.Client/Textures/Stitching/TextureMap.h +++ b/Minecraft.Client/Textures/Stitching/TextureMap.h @@ -10,18 +10,18 @@ class BufferedImage; class TextureMap : public IconRegister { public: - static const wstring NAME_MISSING_TEXTURE; + static const std::wstring NAME_MISSING_TEXTURE; private: const int iconType; - const wstring name; - const wstring path; - const wstring extension; + const std::wstring name; + const std::wstring path; + const std::wstring extension; bool m_mipMap; - typedef std::unordered_map stringStitchedTextureMap; + typedef std::unordered_map stringStitchedTextureMap; stringStitchedTextureMap texturesByName; // = new HashMap(); BufferedImage *missingTexture; // = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB); StitchedTexture *missingPosition; @@ -31,15 +31,15 @@ private: stringStitchedTextureMap texturesToRegister; // = new HashMap(); public: - TextureMap(int type, const wstring &name, const wstring &path, BufferedImage *missingTexture, bool mipMap = false); + TextureMap(int type, const std::wstring &name, const std::wstring &path, BufferedImage *missingTexture, bool mipMap = false); void stitch(); - StitchedTexture *getTexture(const wstring &name); + StitchedTexture *getTexture(const std::wstring &name); void cycleAnimationFrames(); Texture *getStitchedTexture(); // 4J Stu - register is a reserved keyword in C++ - Icon *registerIcon(const wstring &name); + Icon *registerIcon(const std::wstring &name); int getIconType(); Icon *getMissingIcon(); diff --git a/Minecraft.Client/Textures/Texture.cpp b/Minecraft.Client/Textures/Texture.cpp index 178d44d05..16084d176 100644 --- a/Minecraft.Client/Textures/Texture.cpp +++ b/Minecraft.Client/Textures/Texture.cpp @@ -15,12 +15,12 @@ C4JSpursJobQueue::Port* g_texBlitJobQueuePort; #define MAX_MIP_LEVELS 5 -Texture::Texture(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap) +Texture::Texture(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap) { _init(name, mode, width, height, depth, wrapMode, format, minFilter, magFilter, mipMap); } -void Texture::_init(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap) +void Texture::_init(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap) { #ifdef __PS3__ if(g_texBlitJobQueuePort == NULL) @@ -101,7 +101,7 @@ void Texture::_init(const wstring &name, int mode, int width, int height, int de managerId = TextureManager::getInstance()->createTextureID(); } -void Texture::_init(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap) +void Texture::_init(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap) { _init(name, mode, width, height, depth, wrapMode, format, minFilter, magFilter, mipMap); if (image == NULL) @@ -178,12 +178,12 @@ void Texture::_init(const wstring &name, int mode, int width, int height, int de } } -Texture::Texture(const wstring &name, int mode, int width, int height, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap) +Texture::Texture(const std::wstring &name, int mode, int width, int height, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap) { _init(name, mode, width, height, 1, wrapMode, format, minFilter, magFilter, image, mipMap); } -Texture::Texture(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap) +Texture::Texture(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap) { _init(name, mode, width, height, depth, wrapMode, format, minFilter, magFilter, image, mipMap); } @@ -242,7 +242,7 @@ void Texture::fill(const Rect2i *rect, int color) } } -void Texture::writeAsBMP(const wstring &name) +void Texture::writeAsBMP(const std::wstring &name) { // 4J Don't need #if 0 @@ -329,7 +329,7 @@ void Texture::writeAsBMP(const wstring &name) #endif } -void Texture::writeAsPNG(const wstring &filename) +void Texture::writeAsPNG(const std::wstring &filename) { // 4J Don't need #if 0 @@ -769,7 +769,7 @@ int Texture::getHeight() return height; } -wstring Texture::getName() +std::wstring Texture::getName() { return name; } diff --git a/Minecraft.Client/Textures/Texture.h b/Minecraft.Client/Textures/Texture.h index 09b7495e9..74afaea66 100644 --- a/Minecraft.Client/Textures/Texture.h +++ b/Minecraft.Client/Textures/Texture.h @@ -48,7 +48,7 @@ private: int magFilter; int wrapMode; bool mipmapped; - wstring name; + std::wstring name; Rect2i *rect; @@ -67,19 +67,19 @@ public: ~Texture(); private: - Texture(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap = true); + Texture(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap = true); - void _init(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap); - void _init(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap); + void _init(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, bool mipMap); + void _init(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap); public: - Texture(const wstring &name, int mode, int width, int height, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap = true); - Texture(const wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap = true); + Texture(const std::wstring &name, int mode, int width, int height, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap = true); + Texture(const std::wstring &name, int mode, int width, int height, int depth, int wrapMode, int format, int minFilter, int magFilter, BufferedImage *image, bool mipMap = true); const Rect2i *getRect(); void fill(const Rect2i *rect, int color); - void writeAsBMP(const wstring &name); - void writeAsPNG(const wstring &filename); + void writeAsBMP(const std::wstring &name); + void writeAsPNG(const std::wstring &filename); void blit(int x, int y, Texture *source); void blit(int x, int y, Texture *source, bool rotated); void transferFromBuffer(intArray buffer); @@ -88,7 +88,7 @@ public: int getGlId(); int getWidth(); int getHeight(); - wstring getName(); + std::wstring getName(); void setImmediateUpdate(bool immediateUpdate); void bind(int mipMapIndex); void updateOnGPU(); diff --git a/Minecraft.Client/Textures/TextureHolder.cpp b/Minecraft.Client/Textures/TextureHolder.cpp index 61cce49af..085e413c0 100644 --- a/Minecraft.Client/Textures/TextureHolder.cpp +++ b/Minecraft.Client/Textures/TextureHolder.cpp @@ -56,7 +56,7 @@ void TextureHolder::setForcedScale(int targetSize) } //@Override -wstring TextureHolder::toString() +std::wstring TextureHolder::toString() { return L"TextureHolder{width=" + _toString(width) + L", height=" + _toString(height) + L'}'; } diff --git a/Minecraft.Client/Textures/TextureHolder.h b/Minecraft.Client/Textures/TextureHolder.h index 57fd2ca2e..cab827dd1 100644 --- a/Minecraft.Client/Textures/TextureHolder.h +++ b/Minecraft.Client/Textures/TextureHolder.h @@ -26,7 +26,7 @@ private: public: void setForcedScale(int targetSize); //@Override - wstring toString(); + std::wstring toString(); int compareTo(const TextureHolder *other) const; }; diff --git a/Minecraft.Client/Textures/TextureManager.cpp b/Minecraft.Client/Textures/TextureManager.cpp index 377f6e98b..c8f2f3230 100644 --- a/Minecraft.Client/Textures/TextureManager.cpp +++ b/Minecraft.Client/Textures/TextureManager.cpp @@ -29,7 +29,7 @@ int TextureManager::createTextureID() return nextID++; } -Texture *TextureManager::getTexture(const wstring &name) +Texture *TextureManager::getTexture(const std::wstring &name) { if (stringToIDMap.find(name) != stringToIDMap.end()) { @@ -39,7 +39,7 @@ Texture *TextureManager::getTexture(const wstring &name) return NULL; } -void TextureManager::registerName(const wstring &name, Texture *texture) +void TextureManager::registerName(const std::wstring &name, Texture *texture) { stringToIDMap.insert( stringIntMap::value_type( name, texture->getManagerId() ) ); @@ -64,7 +64,7 @@ void TextureManager::registerTexture(Texture *texture) idToTextureMap.insert( intTextureMap::value_type( texture->getManagerId(), texture ) ); } -void TextureManager::unregisterTexture(const wstring &name, Texture *texture) +void TextureManager::unregisterTexture(const std::wstring &name, Texture *texture) { AUTO_VAR(it, idToTextureMap.find(texture->getManagerId())); if(it != idToTextureMap.end()) idToTextureMap.erase(it); @@ -73,14 +73,14 @@ void TextureManager::unregisterTexture(const wstring &name, Texture *texture) if(it2 != stringToIDMap.end()) stringToIDMap.erase(it2); } -Stitcher *TextureManager::createStitcher(const wstring &name) +Stitcher *TextureManager::createStitcher(const std::wstring &name) { int maxTextureSize = Minecraft::maxSupportedTextureSize(); return new Stitcher(name, maxTextureSize, maxTextureSize, true); } -vector *TextureManager::createTextures(const wstring &filename, bool mipmap) +vector *TextureManager::createTextures(const std::wstring &filename, bool mipmap) { vector *result = new vector(); TexturePack *texturePack = Minecraft::GetInstance()->skins->getSelected(); @@ -92,7 +92,7 @@ vector *TextureManager::createTextures(const wstring &filename, bool int magFilter = Texture::TFLT_NEAREST; MemSect(32); - wstring drive = L""; + std::wstring drive = L""; if(texturePack->hasFile(L"res/" + filename,false)) @@ -106,7 +106,7 @@ vector *TextureManager::createTextures(const wstring &filename, bool { const char *pchTextureName=wstringtofilename(filename); char *pchUsrDir = app.GetBDUsrDirPath(pchTextureName); - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); drive= wstr + L"\\Common\\res\\TitleUpdate\\"; } else @@ -123,7 +123,7 @@ vector *TextureManager::createTextures(const wstring &filename, bool int height = image->getHeight(); int width = image->getWidth(); - wstring texName = getTextureNameFromPath(filename); + std::wstring texName = getTextureNameFromPath(filename); if (isAnimation(filename, texturePack)) { @@ -168,27 +168,27 @@ vector *TextureManager::createTextures(const wstring &filename, bool return result; } -wstring TextureManager::getTextureNameFromPath(const wstring &filename) +std::wstring TextureManager::getTextureNameFromPath(const std::wstring &filename) { File file(filename); return file.getName().substr(0, file.getName().find_last_of(L'.')); } -bool TextureManager::isAnimation(const wstring &filename, TexturePack *texturePack) +bool TextureManager::isAnimation(const std::wstring &filename, TexturePack *texturePack) { - wstring dataFileName = L"/" + filename.substr(0, filename.find_last_of(L'.')) + L".txt"; + std::wstring dataFileName = L"/" + filename.substr(0, filename.find_last_of(L'.')) + L".txt"; bool hasOriginalImage = texturePack->hasFile(L"/" + filename, false); return Minecraft::GetInstance()->skins->getSelected()->hasFile(dataFileName, !hasOriginalImage); } -Texture *TextureManager::createTexture(const wstring &name, int mode, int width, int height, int wrap, int format, int minFilter, int magFilter, bool mipmap, BufferedImage *image) +Texture *TextureManager::createTexture(const std::wstring &name, int mode, int width, int height, int wrap, int format, int minFilter, int magFilter, bool mipmap, BufferedImage *image) { Texture *newTex = new Texture(name, mode, width, height, wrap, format, minFilter, magFilter, image, mipmap); registerTexture(newTex); return newTex; } -Texture *TextureManager::createTexture(const wstring &name, int mode, int width, int height, int format, bool mipmap) +Texture *TextureManager::createTexture(const std::wstring &name, int mode, int width, int height, int format, bool mipmap) { // 4J Stu - Don't clamp as it causes issues with how we signal non-mipmmapped textures to the pixel shader //return createTexture(name, mode, width, height, Texture::WM_CLAMP, format, Texture::TFLT_NEAREST, Texture::TFLT_NEAREST, mipmap, NULL); diff --git a/Minecraft.Client/Textures/TextureManager.h b/Minecraft.Client/Textures/TextureManager.h index f62209cb6..c67ea151b 100644 --- a/Minecraft.Client/Textures/TextureManager.h +++ b/Minecraft.Client/Textures/TextureManager.h @@ -10,7 +10,7 @@ private: static TextureManager *instance; int nextID; - typedef std::unordered_map stringIntMap; + typedef std::unordered_map stringIntMap; typedef std::unordered_map intTextureMap; intTextureMap idToTextureMap; stringIntMap stringToIDMap; @@ -24,18 +24,18 @@ private: public: int createTextureID(); - Texture *getTexture(const wstring &name); - void registerName(const wstring &name, Texture *texture); + Texture *getTexture(const std::wstring &name); + void registerName(const std::wstring &name, Texture *texture); void registerTexture(Texture *texture); - void unregisterTexture(const wstring &name, Texture *texture); - Stitcher *createStitcher(const wstring &name); - vector *createTextures(const wstring &filename, bool mipmap); // 4J added mipmap param + void unregisterTexture(const std::wstring &name, Texture *texture); + Stitcher *createStitcher(const std::wstring &name); + vector *createTextures(const std::wstring &filename, bool mipmap); // 4J added mipmap param private: - wstring getTextureNameFromPath(const wstring &filename); - bool isAnimation(const wstring &filename, TexturePack *texturePack); + std::wstring getTextureNameFromPath(const std::wstring &filename); + bool isAnimation(const std::wstring &filename, TexturePack *texturePack); public: - Texture *createTexture(const wstring &name, int mode, int width, int height, int wrap, int format, int minFilter, int magFilter, bool mipmap, BufferedImage *image); - Texture *createTexture(const wstring &name, int mode, int width, int height, int format, bool mipmap); // 4J Added mipmap param + Texture *createTexture(const std::wstring &name, int mode, int width, int height, int wrap, int format, int minFilter, int magFilter, bool mipmap, BufferedImage *image); + Texture *createTexture(const std::wstring &name, int mode, int width, int height, int format, bool mipmap); // 4J Added mipmap param }; \ No newline at end of file diff --git a/Minecraft.Client/Textures/Textures.cpp b/Minecraft.Client/Textures/Textures.cpp index 5d146a518..c7138f94e 100644 --- a/Minecraft.Client/Textures/Textures.cpp +++ b/Minecraft.Client/Textures/Textures.cpp @@ -252,11 +252,11 @@ void Textures::loadIndexedTextures() // 4J - added - preload a set of commonly used textures that can then be referenced directly be an enumerated type rather by string for( int i = 0; i < TN_COUNT - 2; i++ ) { - preLoadedIdx[i] = loadTexture((TEXTURE_NAME)i, wstring(preLoaded[i]) + L".png"); + preLoadedIdx[i] = loadTexture((TEXTURE_NAME)i, std::wstring(preLoaded[i]) + L".png"); } } -intArray Textures::loadTexturePixels(TEXTURE_NAME texId, const wstring& resourceName) +intArray Textures::loadTexturePixels(TEXTURE_NAME texId, const std::wstring& resourceName) { TexturePack *skin = skins->getSelected(); @@ -270,7 +270,7 @@ intArray Textures::loadTexturePixels(TEXTURE_NAME texId, const wstring& resource // 4J - removed try/catch // try { intArray res; - //wstring in = skin->getResource(resourceName); + //std::wstring in = skin->getResource(resourceName); if (false)// 4J - removed - was ( in == NULL) { res = loadTexturePixels(missingNo); @@ -335,7 +335,7 @@ int Textures::loadTexture(int idx) // 4J added - textures default to standard 32-bit RGBA format, but where we can, use an 8-bit format. There's 3 different varieties of these currently // in the renderer that map the single 8-bit channel to RGBA differently. -void Textures::setTextureFormat(const wstring& resourceName) +void Textures::setTextureFormat(const std::wstring& resourceName) { // 4J Stu - These texture formats are not currently in the render header #ifdef _XBOX @@ -366,7 +366,7 @@ void Textures::setTextureFormat(const wstring& resourceName) } } -void Textures::bindTexture(const wstring &resourceName) +void Textures::bindTexture(const std::wstring &resourceName) { bind(loadTexture(TN_COUNT,resourceName)); } @@ -392,7 +392,7 @@ void Textures::clearLastBoundId() lastBoundId = -1; } -int Textures::loadTexture(TEXTURE_NAME texId, const wstring& resourceName) +int Textures::loadTexture(TEXTURE_NAME texId, const std::wstring& resourceName) { // char buf[256]; // wcstombs(buf, resourceName.c_str(), 256); @@ -417,7 +417,7 @@ int Textures::loadTexture(TEXTURE_NAME texId, const wstring& resourceName) if (inMap) return id; } - wstring pathName = resourceName; + std::wstring pathName = resourceName; // 4J - added special cases to avoid mipmapping on clouds & shadows if( (resourceName == L"environment/clouds.png") || @@ -437,7 +437,7 @@ int Textures::loadTexture(TEXTURE_NAME texId, const wstring& resourceName) int id = MemoryTracker::genTextures(); - wstring prefix = L"%blur%"; + std::wstring prefix = L"%blur%"; bool blur = resourceName.substr(0, prefix.size()).compare(prefix) == 0; //resourceName.startsWith("%blur%"); if (blur) pathName = resourceName.substr(6); @@ -445,7 +445,7 @@ int Textures::loadTexture(TEXTURE_NAME texId, const wstring& resourceName) bool clamp = resourceName.substr(0, prefix.size()).compare(prefix) == 0; //resourceName.startsWith("%clamp%"); if (clamp) pathName = resourceName.substr(7); - //wstring in = skins->getSelected()->getResource(pathName); + //std::wstring in = skins->getSelected()->getResource(pathName); if (false ) // 4J - removed was ( in == NULL) { loadTexture(missingNo, id, blur, clamp); @@ -831,7 +831,7 @@ void Textures::releaseTexture(int id) glDeleteTextures(id); } -int Textures::loadHttpTexture(const wstring& url, const wstring& backup) +int Textures::loadHttpTexture(const std::wstring& url, const std::wstring& backup) { HttpTexture *texture = httpTextures[url]; if (texture != NULL) @@ -857,7 +857,7 @@ int Textures::loadHttpTexture(const wstring& url, const wstring& backup) return texture->id; } -int Textures::loadHttpTexture(const wstring& url, int backup) +int Textures::loadHttpTexture(const std::wstring& url, int backup) { HttpTexture *texture = httpTextures[url]; if (texture != NULL) @@ -882,12 +882,12 @@ int Textures::loadHttpTexture(const wstring& url, int backup) return texture->id; } -bool Textures::hasHttpTexture(const wstring &url) +bool Textures::hasHttpTexture(const std::wstring &url) { return httpTextures.find(url) != httpTextures.end(); } -HttpTexture *Textures::addHttpTexture(const wstring& url, HttpTextureProcessor *processor) +HttpTexture *Textures::addHttpTexture(const std::wstring& url, HttpTextureProcessor *processor) { HttpTexture *texture = httpTextures[url]; if (texture == NULL) @@ -901,7 +901,7 @@ HttpTexture *Textures::addHttpTexture(const wstring& url, HttpTextureProcessor * return texture; } -void Textures::removeHttpTexture(const wstring& url) +void Textures::removeHttpTexture(const std::wstring& url) { HttpTexture *texture = httpTextures[url]; if (texture != NULL) @@ -916,7 +916,7 @@ void Textures::removeHttpTexture(const wstring& url) } // 4J-PB - adding for texture in memory (from global title storage) -int Textures::loadMemTexture(const wstring& url, const wstring& backup) +int Textures::loadMemTexture(const std::wstring& url, const std::wstring& backup) { MemTexture *texture = NULL; AUTO_VAR(it, memTextures.find(url) ); @@ -960,7 +960,7 @@ int Textures::loadMemTexture(const wstring& url, const wstring& backup) return texture->id; } -int Textures::loadMemTexture(const wstring& url, int backup) +int Textures::loadMemTexture(const std::wstring& url, int backup) { MemTexture *texture = NULL; AUTO_VAR(it, memTextures.find(url) ); @@ -1003,7 +1003,7 @@ int Textures::loadMemTexture(const wstring& url, int backup) return texture->id; } -MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *processor) +MemTexture *Textures::addMemTexture(const std::wstring& name,MemTextureProcessor *processor) { MemTexture *texture = NULL; AUTO_VAR(it, memTextures.find(name) ); @@ -1039,7 +1039,7 @@ MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *pro return texture; } -// MemTexture *Textures::getMemTexture(const wstring& url, MemTextureProcessor *processor) +// MemTexture *Textures::getMemTexture(const std::wstring& url, MemTextureProcessor *processor) // { // MemTexture *texture = memTextures[url]; // if (texture != NULL) @@ -1049,7 +1049,7 @@ MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *pro // return texture; // } -void Textures::removeMemTexture(const wstring& url) +void Textures::removeMemTexture(const std::wstring& url) { MemTexture *texture = NULL; AUTO_VAR(it, memTextures.find(url) ); @@ -1146,27 +1146,27 @@ void Textures::reloadAll() } AUTO_VAR(itEndHT, httpTextures.end()); - for(std::unordered_map::iterator it = httpTextures.begin(); it != itEndHT; it++ ) + for(std::unordered_map::iterator it = httpTextures.begin(); it != itEndHT; it++ ) { it->second->isLoaded = false; } AUTO_VAR(itEndMT, memTextures.end()); - for(std::unordered_map::iterator it = memTextures.begin(); it != itEndMT; it++ ) + for(std::unordered_map::iterator it = memTextures.begin(); it != itEndMT; it++ ) { it->second->isLoaded = false; } AUTO_VAR(itEndIM, idMap.end()); - for( std::unordered_map::iterator it = idMap.begin(); it != itEndIM; it++ ) + for( std::unordered_map::iterator it = idMap.begin(); it != itEndIM; it++ ) { - wstring name = it->first; + std::wstring name = it->first; int id = idMap[name]; BufferedImage *image; - wstring prefix = L"%blur%"; + std::wstring prefix = L"%blur%"; bool blur = name.substr(0, prefix.size()).compare(prefix) == 0; //name.startsWith("%blur%"); if (blur) name = name.substr(6); @@ -1180,9 +1180,9 @@ void Textures::reloadAll() delete image; } AUTO_VAR(itEndPM, pixelsMap.end()); - for( std::unordered_map::iterator it = pixelsMap.begin(); it != itEndPM; it++ ) + for( std::unordered_map::iterator it = pixelsMap.begin(); it != itEndPM; it++ ) { - wstring name = it->first; + std::wstring name = it->first; BufferedImage *image = readImage(skin->getResource(name)); loadTexturePixels(image, pixelsMap[name]); @@ -1213,13 +1213,13 @@ Icon *Textures::getMissingIcon(int type) } } -BufferedImage *Textures::readImage(TEXTURE_NAME texId, const wstring& name) // 4J was InputStream *in +BufferedImage *Textures::readImage(TEXTURE_NAME texId, const std::wstring& name) // 4J was InputStream *in { BufferedImage *img=NULL; MemSect(32); // is this image one of the Title Update ones? bool isTu = IsTUImage(texId, name); - wstring drive = L""; + std::wstring drive = L""; if(!skins->isUsingDefaultSkin() && skins->getSelected()->hasFile(L"res/" + name,false)) { @@ -1233,7 +1233,7 @@ BufferedImage *Textures::readImage(TEXTURE_NAME texId, const wstring& name) // 4 if(app.GetBootedFromDiscPatch() && app.IsFileInPatchList(pchName)) { char *pchUsrDir = app.GetBDUsrDirPath(pchName); - wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); + std::wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(isTu) { @@ -1334,7 +1334,7 @@ const wchar_t *TUImagePaths[] = NULL }; -bool Textures::IsTUImage(TEXTURE_NAME texId, const wstring& name) +bool Textures::IsTUImage(TEXTURE_NAME texId, const std::wstring& name) { int i = 0; if(texId < TN_COUNT) @@ -1383,7 +1383,7 @@ wchar_t *OriginalImagesPaths[] = NULL }; -bool Textures::IsOriginalImage(TEXTURE_NAME texId, const wstring& name) +bool Textures::IsOriginalImage(TEXTURE_NAME texId, const std::wstring& name) { int i = 0; if(texId < TN_COUNT) diff --git a/Minecraft.Client/Textures/Textures.h b/Minecraft.Client/Textures/Textures.h index afd0564f4..9f4e83e63 100644 --- a/Minecraft.Client/Textures/Textures.h +++ b/Minecraft.Client/Textures/Textures.h @@ -208,14 +208,14 @@ private: static const wchar_t *preLoaded[TN_COUNT]; static int preLoadedIdx[TN_COUNT]; - std::unordered_map idMap; - std::unordered_map pixelsMap; + std::unordered_map idMap; + std::unordered_map pixelsMap; std::unordered_map loadedImages; //IntBuffer *pixels; // 4J - removed so we don't have a permanent buffer kicking round using up 1MB - std::unordered_map httpTextures; + std::unordered_map httpTextures; // 4J-PB - Added for GTS textures - std::unordered_map memTextures; + std::unordered_map memTextures; Options *options; private: @@ -232,14 +232,14 @@ private: void loadIndexedTextures(); // 4J Added public: - intArray loadTexturePixels(TEXTURE_NAME texId, const wstring& resourceName); + intArray loadTexturePixels(TEXTURE_NAME texId, const std::wstring& resourceName); private: intArray loadTexturePixels(BufferedImage *img); intArray loadTexturePixels(BufferedImage *img, intArray pixels); - void setTextureFormat(const wstring& resourceName); // 4J added + void setTextureFormat(const std::wstring& resourceName); // 4J added public: - void bindTexture(const wstring &resourceName); + void bindTexture(const std::wstring &resourceName); void bindTexture(int resourceId); // 4J Added // 4J Made public for use in XUI controls @@ -249,7 +249,7 @@ public: void clearLastBoundId(); private: - int loadTexture(TEXTURE_NAME texId, const wstring& resourceName); + int loadTexture(TEXTURE_NAME texId, const std::wstring& resourceName); public: int loadTexture(int idx); // 4J added int getTexture(BufferedImage *img, C4JRender::eTextureFormat format = C4JRender::TEXTURE_FORMAT_RxGyBzAw, bool mipmap = true); @@ -262,26 +262,26 @@ public: void replaceTextureDirect(intArray rawPixels, int w, int h, int id); // 4J added as optimisation void replaceTextureDirect(shortArray rawPixels, int w, int h, int id); // 4J added as optimisation void releaseTexture(int id); - int loadHttpTexture(const wstring& url, const wstring& backup); - int loadHttpTexture(const wstring& url, int backup); // 4J added - bool hasHttpTexture(const wstring &url); - HttpTexture *addHttpTexture(const wstring& url, HttpTextureProcessor *processor); - void removeHttpTexture(const wstring& url); + int loadHttpTexture(const std::wstring& url, const std::wstring& backup); + int loadHttpTexture(const std::wstring& url, int backup); // 4J added + bool hasHttpTexture(const std::wstring &url); + HttpTexture *addHttpTexture(const std::wstring& url, HttpTextureProcessor *processor); + void removeHttpTexture(const std::wstring& url); // 4J-PB - for the GTS textures - int loadMemTexture(const wstring& url, const wstring& backup); - int loadMemTexture(const wstring& url, int backup); - MemTexture * addMemTexture(const wstring& url, MemTextureProcessor *processor); - //MemTexture * getMemTexture(const wstring& url, MemTextureProcessor *processor); - void removeMemTexture(const wstring& url); + int loadMemTexture(const std::wstring& url, const std::wstring& backup); + int loadMemTexture(const std::wstring& url, int backup); + MemTexture * addMemTexture(const std::wstring& url, MemTextureProcessor *processor); + //MemTexture * getMemTexture(const std::wstring& url, MemTextureProcessor *processor); + void removeMemTexture(const std::wstring& url); void tick(bool updateTextures, bool tickDynamics = true); // 4J added updateTextures parameter & tickDynamics public: void reloadAll(); void stitch(); Icon *getMissingIcon(int type); - BufferedImage *readImage(TEXTURE_NAME texId, const wstring& name); // Moved this to public for Font.cpp access + BufferedImage *readImage(TEXTURE_NAME texId, const std::wstring& name); // Moved this to public for Font.cpp access // check list of title update textures to see if we need to use the UPDATE: drive - static bool IsTUImage(TEXTURE_NAME texId, const wstring& name); - static bool IsOriginalImage(TEXTURE_NAME texId, const wstring& name); + static bool IsTUImage(TEXTURE_NAME texId, const std::wstring& name); + static bool IsOriginalImage(TEXTURE_NAME texId, const std::wstring& name); }; diff --git a/Minecraft.Client/UI/Button.cpp b/Minecraft.Client/UI/Button.cpp index cd4f8d3b2..cb74f5fc2 100644 --- a/Minecraft.Client/UI/Button.cpp +++ b/Minecraft.Client/UI/Button.cpp @@ -2,18 +2,18 @@ #include "Button.h" #include "../Textures/Textures.h" -Button::Button(int id, int x, int y, const wstring& msg) +Button::Button(int id, int x, int y, const std::wstring& msg) { init(id, x, y, 200, 20, msg); } -Button::Button(int id, int x, int y, int w, int h, const wstring& msg) +Button::Button(int id, int x, int y, int w, int h, const std::wstring& msg) { init(id, x, y, w, h, msg); } // 4J - added -void Button::init(int id, int x, int y, int w, int h, const wstring& msg) +void Button::init(int id, int x, int y, int w, int h, const std::wstring& msg) { active = true; visible = true; diff --git a/Minecraft.Client/UI/Button.h b/Minecraft.Client/UI/Button.h index 0bef133c6..b7409e003 100644 --- a/Minecraft.Client/UI/Button.h +++ b/Minecraft.Client/UI/Button.h @@ -9,14 +9,14 @@ protected: int h; public: int x, y; - wstring msg; + std::wstring msg; int id; bool active; bool visible; - Button(int id, int x, int y, const wstring& msg); - Button(int id, int x, int y, int w, int h, const wstring& msg); - void init(int id, int x, int y, int w, int h, const wstring& msg); // 4J - added + Button(int id, int x, int y, const std::wstring& msg); + Button(int id, int x, int y, int w, int h, const std::wstring& msg); + void init(int id, int x, int y, int w, int h, const std::wstring& msg); // 4J - added protected: virtual int getYImage(bool hovered); public: diff --git a/Minecraft.Client/UI/EditBox.cpp b/Minecraft.Client/UI/EditBox.cpp index 27c1e85c2..5d29b7291 100644 --- a/Minecraft.Client/UI/EditBox.cpp +++ b/Minecraft.Client/UI/EditBox.cpp @@ -2,7 +2,7 @@ #include "EditBox.h" #include "../../Minecraft.World/Util/SharedConstants.h" -EditBox::EditBox(Screen *screen, Font *font, int x, int y, int width, int height, const wstring& value) +EditBox::EditBox(Screen *screen, Font *font, int x, int y, int width, int height, const std::wstring& value) { // 4J - added initialisers maxLength = 0; @@ -17,12 +17,12 @@ EditBox::EditBox(Screen *screen, Font *font, int x, int y, int width, int height this->setValue(value); } -void EditBox::setValue(const wstring& value) +void EditBox::setValue(const std::wstring& value) { this->value = value; } -wstring EditBox::getValue() +std::wstring EditBox::getValue() { return value; } @@ -60,7 +60,7 @@ void EditBox::keyPressed(wchar_t ch, int eventKey) { value = value.substr(0, value.length() - 1); } - if (SharedConstants::acceptableLetters.find(ch) != wstring::npos && (value.length() < maxLength || maxLength == 0)) + if (SharedConstants::acceptableLetters.find(ch) != std::wstring::npos && (value.length() < maxLength || maxLength == 0)) { value += ch; } diff --git a/Minecraft.Client/UI/EditBox.h b/Minecraft.Client/UI/EditBox.h index 9e24553f9..6c59a61f3 100644 --- a/Minecraft.Client/UI/EditBox.h +++ b/Minecraft.Client/UI/EditBox.h @@ -12,7 +12,7 @@ private: int y; int width; int height; - wstring value; + std::wstring value; unsigned int maxLength; int frame; @@ -23,9 +23,9 @@ private: Screen *screen; public: - EditBox(Screen *screen, Font *font, int x, int y, int width, int height, const wstring& value); - void setValue(const wstring& value); - wstring getValue(); + EditBox(Screen *screen, Font *font, int x, int y, int width, int height, const std::wstring& value); + void setValue(const std::wstring& value); + std::wstring getValue(); void tick(); void keyPressed(wchar_t ch, int eventKey); void mouseClicked(int mouseX, int mouseY, int buttonNum); diff --git a/Minecraft.Client/UI/Font.cpp b/Minecraft.Client/UI/Font.cpp index df0758e26..3b5e99d21 100644 --- a/Minecraft.Client/UI/Font.cpp +++ b/Minecraft.Client/UI/Font.cpp @@ -8,7 +8,7 @@ #include "../../Minecraft.World/Util/StringHelpers.h" #include "../../Minecraft.World/Util/Random.h" -Font::Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, TEXTURE_NAME textureName, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[]/* = nullptr */) : textures(textures) +Font::Font(Options *options, const std::wstring& name, Textures* textures, bool enforceUnicode, TEXTURE_NAME textureName, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[]/* = nullptr */) : textures(textures) { int charC = cols * rows; // Number of characters in the font @@ -169,36 +169,36 @@ void Font::renderCharacter(wchar_t c) xPos += (float) charWidths[c]; } -void Font::drawShadow(const wstring& str, int x, int y, int color) +void Font::drawShadow(const std::wstring& str, int x, int y, int color) { draw(str, x + 1, y + 1, color, true); draw(str, x, y, color, false); } -void Font::drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h) +void Font::drawShadowWordWrap(const std::wstring &str, int x, int y, int w, int color, int h) { drawWordWrapInternal(str, x + 1, y + 1, w, color, true, h); drawWordWrapInternal(str, x, y, w, color, h); } -void Font::draw(const wstring& str, int x, int y, int color) +void Font::draw(const std::wstring& str, int x, int y, int color) { draw(str, x, y, color, false); } -wstring Font::reorderBidi(const wstring &str) +std::wstring Font::reorderBidi(const std::wstring &str) { // 4J Not implemented return str; } -void Font::draw(const wstring &str, bool dropShadow) +void Font::draw(const std::wstring &str, bool dropShadow) { // Bind the texture textures->bindTexture(m_textureName); bool noise = false; - wstring cleanStr = sanitize(str); + std::wstring cleanStr = sanitize(str); for (int i = 0; i < (int)cleanStr.length(); ++i) { @@ -250,7 +250,7 @@ void Font::draw(const wstring &str, bool dropShadow) } } -void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow) +void Font::draw(const std::wstring& str, int x, int y, int color, bool dropShadow) { if (!str.empty()) { @@ -268,9 +268,9 @@ void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow) } } -int Font::width(const wstring& str) +int Font::width(const std::wstring& str) { - wstring cleanStr = sanitize(str); + std::wstring cleanStr = sanitize(str); if (cleanStr == L"") return 0; // 4J - was NULL comparison int len = 0; @@ -293,9 +293,9 @@ int Font::width(const wstring& str) return len; } -wstring Font::sanitize(const wstring& str) +std::wstring Font::sanitize(const std::wstring& str) { - wstring sb = str; + std::wstring sb = str; for (unsigned int i = 0; i < sb.length(); i++) { @@ -337,7 +337,7 @@ bool Font::CharacterExists(wchar_t c) } } -void Font::drawWordWrap(const wstring &string, int x, int y, int w, int col, int h) +void Font::drawWordWrap(const std::wstring &string, int x, int y, int w, int col, int h) { //if (bidirectional) //{ @@ -346,12 +346,12 @@ void Font::drawWordWrap(const wstring &string, int x, int y, int w, int col, int drawWordWrapInternal(string, x, y, w, col, h); } -void Font::drawWordWrapInternal(const wstring &string, int x, int y, int w, int col, int h) +void Font::drawWordWrapInternal(const std::wstring &string, int x, int y, int w, int col, int h) { drawWordWrapInternal(string, x, y, w, col, false, h); } -void Font::drawWordWrap(const wstring &string, int x, int y, int w, int col, bool darken, int h) +void Font::drawWordWrap(const std::wstring &string, int x, int y, int w, int col, bool darken, int h) { //if (bidirectional) //{ @@ -360,9 +360,9 @@ void Font::drawWordWrap(const wstring &string, int x, int y, int w, int col, boo drawWordWrapInternal(string, x, y, w, col, darken, h); } -void Font::drawWordWrapInternal(const wstring& string, int x, int y, int w, int col, bool darken, int h) +void Font::drawWordWrapInternal(const std::wstring& string, int x, int y, int w, int col, bool darken, int h) { - vectorlines = stringSplit(string,L'\n'); + vectorlines = stringSplit(string,L'\n'); if (lines.size() > 1) { AUTO_VAR(itEnd, lines.end()); @@ -375,11 +375,11 @@ void Font::drawWordWrapInternal(const wstring& string, int x, int y, int w, int } return; } - vector words = stringSplit(string,L' '); + vector words = stringSplit(string,L' '); unsigned int pos = 0; while (pos < words.size()) { - wstring line = words[pos++] + L" "; + std::wstring line = words[pos++] + L" "; while (pos < words.size() && width(line + words[pos]) < w) { line += words[pos++] + L" "; @@ -411,9 +411,9 @@ void Font::drawWordWrapInternal(const wstring& string, int x, int y, int w, int } -int Font::wordWrapHeight(const wstring& string, int w) +int Font::wordWrapHeight(const std::wstring& string, int w) { - vector lines = stringSplit(string,L'\n'); + vector lines = stringSplit(string,L'\n'); if (lines.size() > 1) { int h = 0; @@ -424,12 +424,12 @@ int Font::wordWrapHeight(const wstring& string, int w) } return h; } - vector words = stringSplit(string,L' '); + vector words = stringSplit(string,L' '); unsigned int pos = 0; int y = 0; while (pos < words.size()) { - wstring line = words[pos++] + L" "; + std::wstring line = words[pos++] + L" "; while (pos < words.size() && width(line + words[pos]) < w) { line += words[pos++] + L" "; @@ -466,7 +466,7 @@ void Font::setBidirectional(bool bidirectional) this->bidirectional = bidirectional; } -bool Font::AllCharactersValid(const wstring &str) +bool Font::AllCharactersValid(const std::wstring &str) { for (int i = 0; i < (int)str.length(); ++i) { diff --git a/Minecraft.Client/UI/Font.h b/Minecraft.Client/UI/Font.h index b6ad555db..e7769698c 100644 --- a/Minecraft.Client/UI/Font.h +++ b/Minecraft.Client/UI/Font.h @@ -30,7 +30,7 @@ private: std::map m_charMap; public: - Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, TEXTURE_NAME textureName, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[] = NULL); + Font(Options *options, const std::wstring& name, Textures* textures, bool enforceUnicode, TEXTURE_NAME textureName, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[] = NULL); #ifndef _XBOX // 4J Stu - This dtor clashes with one in xui! We never delete these anyway so take it out for now. Can go back when we have got rid of XUI ~Font(); @@ -41,9 +41,9 @@ private: void renderCharacter(wchar_t c); // 4J added public: - void drawShadow(const wstring& str, int x, int y, int color); - void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param - void draw(const wstring &str, int x, int y, int color); + void drawShadow(const std::wstring& str, int x, int y, int color); + void drawShadowWordWrap(const std::wstring &str, int x, int y, int w, int color, int h); // 4J Added h param + void draw(const std::wstring &str, int x, int y, int color); /** * Reorders the string according to bidirectional levels. A bit expensive at * the moment. @@ -52,32 +52,32 @@ public: * @return */ private: - wstring reorderBidi(const wstring &str); + std::wstring reorderBidi(const std::wstring &str); - void draw(const wstring &str, bool dropShadow); - void draw(const wstring& str, int x, int y, int color, bool dropShadow); + void draw(const std::wstring &str, bool dropShadow); + void draw(const std::wstring& str, int x, int y, int color, bool dropShadow); int MapCharacter(wchar_t c); // 4J added bool CharacterExists(wchar_t c); // 4J added public: - int width(const wstring& str); - wstring sanitize(const wstring& str); - void drawWordWrap(const wstring &string, int x, int y, int w, int col, int h); // 4J Added h param + int width(const std::wstring& str); + std::wstring sanitize(const std::wstring& str); + void drawWordWrap(const std::wstring &string, int x, int y, int w, int col, int h); // 4J Added h param private: - void drawWordWrapInternal(const wstring &string, int x, int y, int w, int col, int h); // 4J Added h param + void drawWordWrapInternal(const std::wstring &string, int x, int y, int w, int col, int h); // 4J Added h param public: - void drawWordWrap(const wstring &string, int x, int y, int w, int col, bool darken, int h); // 4J Added h param + void drawWordWrap(const std::wstring &string, int x, int y, int w, int col, bool darken, int h); // 4J Added h param private: - void drawWordWrapInternal(const wstring& string, int x, int y, int w, int col, bool darken, int h); // 4J Added h param + void drawWordWrapInternal(const std::wstring& string, int x, int y, int w, int col, bool darken, int h); // 4J Added h param public: - int wordWrapHeight(const wstring& string, int w); + int wordWrapHeight(const std::wstring& string, int w); void setEnforceUnicodeSheet(bool enforceUnicodeSheet); void setBidirectional(bool bidirectional); // 4J-PB - check for invalid player name - Japanese local name - bool AllCharactersValid(const wstring &str); + bool AllCharactersValid(const std::wstring &str); }; diff --git a/Minecraft.Client/UI/Gui.cpp b/Minecraft.Client/UI/Gui.cpp index a2b096283..fb30994c7 100644 --- a/Minecraft.Client/UI/Gui.cpp +++ b/Minecraft.Client/UI/Gui.cpp @@ -700,7 +700,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) wchar_t formatted[10]; swprintf(formatted, 10, L"%d",minecraft->player->experienceLevel); - wstring str = formatted; + std::wstring str = formatted; int x = iWidthOffset + (screenWidth - font->width(str)) / 2; int y = screenHeight - iSafezoneYHalf - iTooltipsYOffset; // If we're in creative mode, we don't need to offset the XP display so much @@ -795,7 +795,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if(minecraft->level->dimension->id==0) { - wstring wfeature[eTerrainFeature_Count]; + std::wstring wfeature[eTerrainFeature_Count]; wfeature[eTerrainFeature_Stronghold] = L"Stronghold: "; wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: "; @@ -806,7 +806,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { FEATURE_DATA *pFeatureData=app.m_vTerrainFeatures[i]; - wstring itemInfo = L"[" + _toString( pFeatureData->x*16 ) + L", " + _toString( pFeatureData->z*16 ) + L"] "; + std::wstring itemInfo = L"[" + _toString( pFeatureData->x*16 ) + L", " + _toString( pFeatureData->z*16 ) + L"] "; wfeature[pFeatureData->eTerrainFeature] += itemInfo; } @@ -940,7 +940,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) y+= iHeightOffset; } - wstring msg = guiMessages[iPad][i].string; + std::wstring msg = guiMessages[iPad][i].string; // 4J-PB - fill the black bar across the whole screen, otherwise it looks odd due to the safe area this->fill(0, y - 1, screenWidth/fScaleFactorWidth, y + 8, (alpha / 2) << 24); glEnable(GL_BLEND); @@ -1050,7 +1050,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // blit(xLeft, yo, 0, 79, progress, 5); // } // -// wstring msg = L"Boss health - NON LOCALISED"; +// std::wstring msg = L"Boss health - NON LOCALISED"; // font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff); // glColor4f(1, 1, 1, 1); // glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png")); @@ -1211,9 +1211,9 @@ void Gui::clearMessages(int iPad) } -void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage) +void Gui::addMessage(const std::wstring& _string,int iPad,bool bIsDeathMessage) { - wstring string = _string; // 4J - Take copy of input as it is const + std::wstring string = _string; // 4J - Take copy of input as it is const //int iScale=1; //if((minecraft->player->m_iScreenSection==C4JRender::VIEWPORT_TYPE_SPLIT_TOP) || @@ -1374,7 +1374,7 @@ float Gui::getJukeboxOpacity(int iPad) return alpha; } -void Gui::setNowPlaying(const wstring& string) +void Gui::setNowPlaying(const std::wstring& string) { // overlayMessageString = L"Now playing: " + string; overlayMessageString = app.GetString(IDS_NOWPLAYING) + string; @@ -1385,7 +1385,7 @@ void Gui::setNowPlaying(const wstring& string) void Gui::displayClientMessage(int messageId, int iPad) { //Language *language = Language::getInstance(); - wstring languageString = app.GetString(messageId);//language->getElement(messageId); + std::wstring languageString = app.GetString(messageId);//language->getElement(messageId); addMessage(languageString, iPad); } diff --git a/Minecraft.Client/UI/Gui.h b/Minecraft.Client/UI/Gui.h index 417620163..3db5c4191 100644 --- a/Minecraft.Client/UI/Gui.h +++ b/Minecraft.Client/UI/Gui.h @@ -17,10 +17,10 @@ private: Minecraft *minecraft; public: - wstring selectedName; + std::wstring selectedName; private: int tickCount; - wstring overlayMessageString; + std::wstring overlayMessageString; int overlayMessageTime; bool animateOverlayMessageColor; @@ -50,16 +50,16 @@ private: public: void tick(); void clearMessages(int iPad=-1); - void addMessage(const wstring& string, int iPad,bool bIsDeathMessage=false); - void setNowPlaying(const wstring& string); + void addMessage(const std::wstring& string, int iPad,bool bIsDeathMessage=false); + void setNowPlaying(const std::wstring& string); void displayClientMessage(int messageId, int iPad); // 4J Added DWORD getMessagesCount(int iPad) { return (int)guiMessages[iPad].size(); } - wstring getMessage(int iPad, DWORD index) { return guiMessages[iPad].at(index).string; } + std::wstring getMessage(int iPad, DWORD index) { return guiMessages[iPad].at(index).string; } float getOpacity(int iPad, DWORD index); - wstring getJukeboxMessage(int iPad) { return overlayMessageString; } + std::wstring getJukeboxMessage(int iPad) { return overlayMessageString; } float getJukeboxOpacity(int iPad); // 4J Added diff --git a/Minecraft.Client/UI/GuiComponent.cpp b/Minecraft.Client/UI/GuiComponent.cpp index 3e3976703..8ffc8b4d4 100644 --- a/Minecraft.Client/UI/GuiComponent.cpp +++ b/Minecraft.Client/UI/GuiComponent.cpp @@ -95,12 +95,12 @@ GuiComponent::GuiComponent() blitOffset = 0; } -void GuiComponent::drawCenteredString(Font *font, const wstring& str, int x, int y, int color) +void GuiComponent::drawCenteredString(Font *font, const std::wstring& str, int x, int y, int color) { font->drawShadow(str, x - (font->width(str)) / 2, y, color); } -void GuiComponent::drawString(Font *font, const wstring& str, int x, int y, int color) +void GuiComponent::drawString(Font *font, const std::wstring& str, int x, int y, int color) { font->drawShadow(str, x, y, color); } diff --git a/Minecraft.Client/UI/GuiComponent.h b/Minecraft.Client/UI/GuiComponent.h index 7073db404..5819b5eaf 100644 --- a/Minecraft.Client/UI/GuiComponent.h +++ b/Minecraft.Client/UI/GuiComponent.h @@ -13,7 +13,7 @@ protected: void fillGradient(int x0, int y0, int x1, int y1, int col1, int col2); public: GuiComponent(); // 4J added - void drawCenteredString(Font *font, const wstring& str, int x, int y, int color); - void drawString(Font *font, const wstring& str, int x, int y, int color); + void drawCenteredString(Font *font, const std::wstring& str, int x, int y, int color); + void drawString(Font *font, const std::wstring& str, int x, int y, int color); void blit(int x, int y, int sx, int sy, int w, int h); }; diff --git a/Minecraft.Client/UI/GuiMessage.cpp b/Minecraft.Client/UI/GuiMessage.cpp index a7c33a0b3..b0c034f8f 100644 --- a/Minecraft.Client/UI/GuiMessage.cpp +++ b/Minecraft.Client/UI/GuiMessage.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "GuiMessage.h" -GuiMessage::GuiMessage(const wstring& string) +GuiMessage::GuiMessage(const std::wstring& string) { this->string = string; ticks = 0; diff --git a/Minecraft.Client/UI/GuiMessage.h b/Minecraft.Client/UI/GuiMessage.h index dac9a9e39..6fee65f39 100644 --- a/Minecraft.Client/UI/GuiMessage.h +++ b/Minecraft.Client/UI/GuiMessage.h @@ -4,7 +4,7 @@ using namespace std; class GuiMessage { public: - wstring string; + std::wstring string; int ticks; - GuiMessage(const wstring& string); + GuiMessage(const std::wstring& string); }; \ No newline at end of file diff --git a/Minecraft.Client/UI/Screen.cpp b/Minecraft.Client/UI/Screen.cpp index 6aa70d4e0..56133bc12 100644 --- a/Minecraft.Client/UI/Screen.cpp +++ b/Minecraft.Client/UI/Screen.cpp @@ -38,13 +38,13 @@ void Screen::keyPressed(wchar_t eventCharacter, int eventKey) } } -wstring Screen::getClipboard() +std::wstring Screen::getClipboard() { // 4J - removed return NULL; } -void Screen::setClipboard(const wstring& str) +void Screen::setClipboard(const std::wstring& str) { // 4J - removed } diff --git a/Minecraft.Client/UI/Screen.h b/Minecraft.Client/UI/Screen.h index 50deb1d08..324f4ca5c 100644 --- a/Minecraft.Client/UI/Screen.h +++ b/Minecraft.Client/UI/Screen.h @@ -26,8 +26,8 @@ public: protected: virtual void keyPressed(wchar_t eventCharacter, int eventKey); public: - static wstring getClipboard(); - static void setClipboard(const wstring& str); + static std::wstring getClipboard(); + static void setClipboard(const std::wstring& str); private: Button *clickedButton; diff --git a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp b/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp index 06cda6045..df09bfb3f 100644 --- a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp +++ b/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp @@ -96,7 +96,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a) if (inventory->getCarried() == NULL && hoveredSlot != NULL && hoveredSlot->hasItem()) { - wstring elementName = trimString(Language::getInstance()->getElementName(hoveredSlot->getItem()->getDescriptionId())); + std::wstring elementName = trimString(Language::getInstance()->getElementName(hoveredSlot->getItem()->getDescriptionId())); if (elementName.length() > 0) { diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.cpp b/Minecraft.Client/UI/Screens/AchievementPopup.cpp index 065349317..7a60c7ea9 100644 --- a/Minecraft.Client/UI/Screens/AchievementPopup.cpp +++ b/Minecraft.Client/UI/Screens/AchievementPopup.cpp @@ -77,9 +77,9 @@ void AchievementPopup::render() Lighting::turnOff(); prepareWindow(); - wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + L" Unlicensed Copy :("; - wstring msg1 = L"(Or logged in from another location)"; - wstring msg2 = L"Purchase at minecraft.net"; + std::wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + L" Unlicensed Copy :("; + std::wstring msg1 = L"(Or logged in from another location)"; + std::wstring msg2 = L"Purchase at minecraft.net"; mc->font->drawShadow(title, 2, 2 + 9 * 0, 0xffffff); mc->font->drawShadow(msg1, 2, 2 + 9 * 1, 0xffffff); diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.h b/Minecraft.Client/UI/Screens/AchievementPopup.h index 75e33be77..5d7b04663 100644 --- a/Minecraft.Client/UI/Screens/AchievementPopup.h +++ b/Minecraft.Client/UI/Screens/AchievementPopup.h @@ -10,8 +10,8 @@ private: Minecraft *mc; int width, height; - wstring title; - wstring desc; + std::wstring title; + std::wstring desc; Achievement *ach; __int64 startTime; ItemRenderer *ir; diff --git a/Minecraft.Client/UI/Screens/AchievementScreen.cpp b/Minecraft.Client/UI/Screens/AchievementScreen.cpp index df642bd90..53166d631 100644 --- a/Minecraft.Client/UI/Screens/AchievementScreen.cpp +++ b/Minecraft.Client/UI/Screens/AchievementScreen.cpp @@ -380,8 +380,8 @@ void AchievementScreen::renderBg(int xm, int ym, float a) if (hoveredAchievement != NULL) { Achievement *ach = hoveredAchievement; - wstring name = ach->name; - wstring descr = ach->getDescription(); + std::wstring name = ach->name; + std::wstring descr = ach->getDescription(); int x = xm + 12; int y = ym - 4; @@ -405,7 +405,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a) else { int width = Math::_max(font->width(name), 120); - wstring msg = I18n::get(L"achievement.requires", ach->requires->name); + std::wstring msg = I18n::get(L"achievement.requires", ach->requires->name); int height = font->wordWrapHeight(msg, width); fillGradient(x - 3, y - 3, x + width + 3, y + height + 12 + 3, 0xc0000000, 0xc0000000); font->drawWordWrap(msg, x, y + 12, width, 0xff705050); diff --git a/Minecraft.Client/UI/Screens/ChatScreen.cpp b/Minecraft.Client/UI/Screens/ChatScreen.cpp index d7c944fbe..4d14e9e01 100644 --- a/Minecraft.Client/UI/Screens/ChatScreen.cpp +++ b/Minecraft.Client/UI/Screens/ChatScreen.cpp @@ -4,7 +4,7 @@ #include "../../../Minecraft.World/Util/SharedConstants.h" #include "../../../Minecraft.World/Util/StringHelpers.h" -const wstring ChatScreen::allowedChars = SharedConstants::readAcceptableChars(); +const std::wstring ChatScreen::allowedChars = SharedConstants::readAcceptableChars(); ChatScreen::ChatScreen() { @@ -35,10 +35,10 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey) } if (eventKey == Keyboard::KEY_RETURN) { - wstring msg = trimString(message); + std::wstring msg = trimString(message); if (msg.length() > 0) { - wstring trim = trimString(message); + std::wstring trim = trimString(message); if (!minecraft->handleClientSideCommand(trim)) { minecraft->player->chat(trim); diff --git a/Minecraft.Client/UI/Screens/ChatScreen.h b/Minecraft.Client/UI/Screens/ChatScreen.h index fe5fa29c0..b0e471cf7 100644 --- a/Minecraft.Client/UI/Screens/ChatScreen.h +++ b/Minecraft.Client/UI/Screens/ChatScreen.h @@ -5,7 +5,7 @@ using namespace std; class ChatScreen : public Screen { protected: - wstring message; + std::wstring message; private: int frame; @@ -15,7 +15,7 @@ public: virtual void removed(); virtual void tick(); private: - static const wstring allowedChars; + static const std::wstring allowedChars; protected: void keyPressed(wchar_t ch, int eventKey); public: diff --git a/Minecraft.Client/UI/Screens/ConfirmScreen.cpp b/Minecraft.Client/UI/Screens/ConfirmScreen.cpp index 44b5b7cf6..edd398443 100644 --- a/Minecraft.Client/UI/Screens/ConfirmScreen.cpp +++ b/Minecraft.Client/UI/Screens/ConfirmScreen.cpp @@ -3,7 +3,7 @@ #include "../SmallButton.h" #include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -ConfirmScreen::ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, int id) +ConfirmScreen::ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, int id) { this->parent = parent; this->title1 = title1; @@ -15,7 +15,7 @@ ConfirmScreen::ConfirmScreen(Screen *parent, const wstring& title1, const wstrin noButton = language->getElement(L"gui.no"); } -ConfirmScreen::ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, const wstring& yesButton, const wstring& noButton, int id) +ConfirmScreen::ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, const std::wstring& yesButton, const std::wstring& noButton, int id) { this->parent = parent; this->title1 = title1; diff --git a/Minecraft.Client/UI/Screens/ConfirmScreen.h b/Minecraft.Client/UI/Screens/ConfirmScreen.h index 7436a2b80..d4dcdaec0 100644 --- a/Minecraft.Client/UI/Screens/ConfirmScreen.h +++ b/Minecraft.Client/UI/Screens/ConfirmScreen.h @@ -6,15 +6,15 @@ class ConfirmScreen : public Screen { private: Screen *parent; - wstring title1; - wstring title2; - wstring yesButton; - wstring noButton; + std::wstring title1; + std::wstring title2; + std::wstring yesButton; + std::wstring noButton; int id; public: - ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, int id); - ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, const wstring& yesButton, const wstring& noButton, int id); + ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, int id); + ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, const std::wstring& yesButton, const std::wstring& noButton, int id); virtual void init(); protected: virtual void buttonClicked(Button *button); diff --git a/Minecraft.Client/UI/Screens/ConnectScreen.cpp b/Minecraft.Client/UI/Screens/ConnectScreen.cpp index 9a5af6412..8631cbbd1 100644 --- a/Minecraft.Client/UI/Screens/ConnectScreen.cpp +++ b/Minecraft.Client/UI/Screens/ConnectScreen.cpp @@ -8,7 +8,7 @@ #include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -ConnectScreen::ConnectScreen(Minecraft *minecraft, const wstring& ip, int port) +ConnectScreen::ConnectScreen(Minecraft *minecraft, const std::wstring& ip, int port) { aborted = false; // System.out.println("Connecting to " + ip + ", " + port); diff --git a/Minecraft.Client/UI/Screens/ConnectScreen.h b/Minecraft.Client/UI/Screens/ConnectScreen.h index 57b13dfae..1de5b2f06 100644 --- a/Minecraft.Client/UI/Screens/ConnectScreen.h +++ b/Minecraft.Client/UI/Screens/ConnectScreen.h @@ -11,7 +11,7 @@ private: ClientConnection *connection; bool aborted; public: - ConnectScreen(Minecraft *minecraft, const wstring& ip, int port); + ConnectScreen(Minecraft *minecraft, const std::wstring& ip, int port); virtual void tick(); protected: virtual void keyPressed(char eventCharacter, int eventKey); diff --git a/Minecraft.Client/UI/Screens/ControlsScreen.h b/Minecraft.Client/UI/Screens/ControlsScreen.h index 92c4b75da..07778abdc 100644 --- a/Minecraft.Client/UI/Screens/ControlsScreen.h +++ b/Minecraft.Client/UI/Screens/ControlsScreen.h @@ -8,7 +8,7 @@ class ControlsScreen : public Screen private: Screen *lastScreen; protected: - wstring title; + std::wstring title; private: Options *options; diff --git a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp b/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp index 82708b54c..27e3d33e7 100644 --- a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp @@ -51,7 +51,7 @@ void CreateWorldScreen::updateResultFolder() for( int i = 0; i < SharedConstants::ILLEGAL_FILE_CHARACTERS_LENGTH; i++ ) { size_t pos; - while( (pos = resultFolder.find(SharedConstants::ILLEGAL_FILE_CHARACTERS[i])) != wstring::npos) + while( (pos = resultFolder.find(SharedConstants::ILLEGAL_FILE_CHARACTERS[i])) != std::wstring::npos) { resultFolder[pos] = L'_'; } @@ -65,9 +65,9 @@ void CreateWorldScreen::updateResultFolder() } -wstring CreateWorldScreen::findAvailableFolderName(LevelStorageSource *levelSource, const wstring& folder) +std::wstring CreateWorldScreen::findAvailableFolderName(LevelStorageSource *levelSource, const std::wstring& folder) { - wstring folder2 = folder; // 4J - copy input as it is const + std::wstring folder2 = folder; // 4J - copy input as it is const #if 0 while (levelSource->getDataTagFor(folder2) != NULL) @@ -98,7 +98,7 @@ void CreateWorldScreen::buttonClicked(Button *button) done = true; __int64 seedValue = (new Random())->nextLong(); - wstring seedString = seedEdit->getValue(); + std::wstring seedString = seedEdit->getValue(); if (seedString.length() != 0) { diff --git a/Minecraft.Client/UI/Screens/CreateWorldScreen.h b/Minecraft.Client/UI/Screens/CreateWorldScreen.h index 09bf97a9a..3b3ded4f2 100644 --- a/Minecraft.Client/UI/Screens/CreateWorldScreen.h +++ b/Minecraft.Client/UI/Screens/CreateWorldScreen.h @@ -10,7 +10,7 @@ private: Screen *lastScreen; EditBox *nameEdit; EditBox *seedEdit; - wstring resultFolder; + std::wstring resultFolder; bool done; public: @@ -20,7 +20,7 @@ public: private: void updateResultFolder(); public: - static wstring findAvailableFolderName(LevelStorageSource *levelSource, const wstring& folder); + static std::wstring findAvailableFolderName(LevelStorageSource *levelSource, const std::wstring& folder); virtual void removed(); protected: virtual void buttonClicked(Button *button); diff --git a/Minecraft.Client/UI/Screens/DisconnectedScreen.cpp b/Minecraft.Client/UI/Screens/DisconnectedScreen.cpp index d41b6bc15..3e8db2ff4 100644 --- a/Minecraft.Client/UI/Screens/DisconnectedScreen.cpp +++ b/Minecraft.Client/UI/Screens/DisconnectedScreen.cpp @@ -4,7 +4,7 @@ #include "../Button.h" #include "../../../Minecraft.World/Headers/net.minecraft.locale.h" -DisconnectedScreen::DisconnectedScreen(const wstring& title, const wstring reason, void *reasonObjects, ...) +DisconnectedScreen::DisconnectedScreen(const std::wstring& title, const std::wstring reason, void *reasonObjects, ...) { Language *language = Language::getInstance(); diff --git a/Minecraft.Client/UI/Screens/DisconnectedScreen.h b/Minecraft.Client/UI/Screens/DisconnectedScreen.h index 6d7b89065..d949656b9 100644 --- a/Minecraft.Client/UI/Screens/DisconnectedScreen.h +++ b/Minecraft.Client/UI/Screens/DisconnectedScreen.h @@ -5,10 +5,10 @@ using namespace std; class DisconnectedScreen : public Screen { private: - wstring title, reason; + std::wstring title, reason; public: - DisconnectedScreen(const wstring& title, const wstring reason, void *reasonObjects, ...); + DisconnectedScreen(const std::wstring& title, const std::wstring reason, void *reasonObjects, ...); virtual void tick(); protected: using Screen::keyPressed; diff --git a/Minecraft.Client/UI/Screens/ErrorScreen.cpp b/Minecraft.Client/UI/Screens/ErrorScreen.cpp index fbfec3b26..ba151cb0c 100644 --- a/Minecraft.Client/UI/Screens/ErrorScreen.cpp +++ b/Minecraft.Client/UI/Screens/ErrorScreen.cpp @@ -1,7 +1,7 @@ #include "../../Build/stdafx.h" #include "ErrorScreen.h" -ErrorScreen::ErrorScreen(const wstring& title, const wstring& message) +ErrorScreen::ErrorScreen(const std::wstring& title, const std::wstring& message) { this->title = title; this->message = message; diff --git a/Minecraft.Client/UI/Screens/ErrorScreen.h b/Minecraft.Client/UI/Screens/ErrorScreen.h index 5bdf97444..4b8d675b8 100644 --- a/Minecraft.Client/UI/Screens/ErrorScreen.h +++ b/Minecraft.Client/UI/Screens/ErrorScreen.h @@ -4,9 +4,9 @@ class ErrorScreen : public Screen { private: - wstring title, message; + std::wstring title, message; public: - ErrorScreen(const wstring& title, const wstring& message); + ErrorScreen(const std::wstring& title, const std::wstring& message); virtual void init(); virtual void render(int xm, int ym, float a); protected: diff --git a/Minecraft.Client/UI/Screens/InBedChatScreen.cpp b/Minecraft.Client/UI/Screens/InBedChatScreen.cpp index 9113f4bca..c3d7cb85d 100644 --- a/Minecraft.Client/UI/Screens/InBedChatScreen.cpp +++ b/Minecraft.Client/UI/Screens/InBedChatScreen.cpp @@ -28,7 +28,7 @@ void InBedChatScreen::keyPressed(wchar_t ch, int eventKey) } else if (eventKey == Keyboard::KEY_RETURN) { - wstring msg = trimString(message); + std::wstring msg = trimString(message); if (msg.length() > 0) { minecraft->player->chat(trimString(message)); diff --git a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp b/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp index 0dff15369..5b0c755c6 100644 --- a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp +++ b/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.cpp @@ -24,7 +24,7 @@ void JoinMultiplayerScreen::init() buttons.clear(); buttons.push_back(new Button(0, width / 2 - 100, height / 4 + 24 * 4 + 12, language->getElement(L"multiplayer.connect"))); buttons.push_back(new Button(1, width / 2 - 100, height / 4 + 24 * 5 + 12, language->getElement(L"gui.cancel"))); - wstring ip = replaceAll(minecraft->options->lastMpIp,L"_", L":"); + std::wstring ip = replaceAll(minecraft->options->lastMpIp,L"_", L":"); buttons[0]->active = ip.length() > 0; ipEdit = new EditBox(this, font, width / 2 - 100, height / 4 - 10 + 50 + 18, 200, 20, ip); @@ -47,19 +47,19 @@ void JoinMultiplayerScreen::buttonClicked(Button *button) } else if (button->id == 0) { - wstring ip = trimString(ipEdit->getValue()); + std::wstring ip = trimString(ipEdit->getValue()); minecraft->options->lastMpIp = replaceAll(ip,L":", L"_"); minecraft->options->save(); - vector parts = stringSplit(ip,L'L'); + vector parts = stringSplit(ip,L'L'); if (ip[0]==L'[') { int pos = (int)ip.find(L"]"); - if (pos != wstring::npos) + if (pos != std::wstring::npos) { - wstring path = ip.substr(1, pos); - wstring port = trimString(ip.substr(pos + 1)); + std::wstring path = ip.substr(1, pos); + std::wstring port = trimString(ip.substr(pos + 1)); if (port[0]==L':' && port.length() > 0) { port = port.substr(1); @@ -86,7 +86,7 @@ void JoinMultiplayerScreen::buttonClicked(Button *button) } } -int JoinMultiplayerScreen::parseInt(const wstring& str, int def) +int JoinMultiplayerScreen::parseInt(const std::wstring& str, int def) { return _fromString(str); } diff --git a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h b/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h index aed68c5d7..631ab3763 100644 --- a/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h +++ b/Minecraft.Client/UI/Screens/JoinMultiplayerScreen.h @@ -17,7 +17,7 @@ public: protected: virtual void buttonClicked(Button *button); private: - virtual int parseInt(const wstring& str, int def); + virtual int parseInt(const std::wstring& str, int def); protected: virtual void keyPressed(wchar_t ch, int eventKey); virtual void mouseClicked(int x, int y, int buttonNum); diff --git a/Minecraft.Client/UI/Screens/NameEntryScreen.cpp b/Minecraft.Client/UI/Screens/NameEntryScreen.cpp index e567777ef..0f4f968ad 100644 --- a/Minecraft.Client/UI/Screens/NameEntryScreen.cpp +++ b/Minecraft.Client/UI/Screens/NameEntryScreen.cpp @@ -3,9 +3,9 @@ #include "../Button.h" #include "../../../Minecraft.World/Util/StringHelpers.h" -const wstring NameEntryScreen::allowedChars = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_'*!\"#%/()=+?[]{}<>"; +const std::wstring NameEntryScreen::allowedChars = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_'*!\"#%/()=+?[]{}<>"; -NameEntryScreen::NameEntryScreen(Screen *lastScreen, const wstring& oldName, int slot) +NameEntryScreen::NameEntryScreen(Screen *lastScreen, const std::wstring& oldName, int slot) { frame = 0; // 4J added @@ -53,7 +53,7 @@ void NameEntryScreen::buttonClicked(Button button) void NameEntryScreen::keyPressed(wchar_t ch, int eventKey) { if (eventKey == Keyboard::KEY_BACK && name.length() > 0) name = name.substr(0, name.length() - 1); - if (allowedChars.find(ch) != wstring::npos && name.length()<64) + if (allowedChars.find(ch) != std::wstring::npos && name.length()<64) { name += ch; } diff --git a/Minecraft.Client/UI/Screens/NameEntryScreen.h b/Minecraft.Client/UI/Screens/NameEntryScreen.h index 8793d58d7..096fe6805 100644 --- a/Minecraft.Client/UI/Screens/NameEntryScreen.h +++ b/Minecraft.Client/UI/Screens/NameEntryScreen.h @@ -6,20 +6,20 @@ class NameEntryScreen : public Screen private: Screen *lastScreen; protected: - wstring title; + std::wstring title; private: int slot; - wstring name; + std::wstring name; int frame; public: - NameEntryScreen(Screen *lastScreen, const wstring& oldName, int slot); + NameEntryScreen(Screen *lastScreen, const std::wstring& oldName, int slot); virtual void init(); virtual void removed(); virtual void tick(); protected: virtual void buttonClicked(Button button); private: - static const wstring allowedChars; + static const std::wstring allowedChars; protected: virtual void keyPressed(wchar_t ch, int eventKey); public: diff --git a/Minecraft.Client/UI/Screens/OptionsScreen.h b/Minecraft.Client/UI/Screens/OptionsScreen.h index 301161c0f..ed412bd8d 100644 --- a/Minecraft.Client/UI/Screens/OptionsScreen.h +++ b/Minecraft.Client/UI/Screens/OptionsScreen.h @@ -10,7 +10,7 @@ private: static const int VIDEO_BUTTON_ID = 101; Screen *lastScreen; protected: - wstring title; + std::wstring title; private: Options *options; public: diff --git a/Minecraft.Client/UI/Screens/RenameWorldScreen.cpp b/Minecraft.Client/UI/Screens/RenameWorldScreen.cpp index 62cf95c75..6c62d5d6d 100644 --- a/Minecraft.Client/UI/Screens/RenameWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/RenameWorldScreen.cpp @@ -6,7 +6,7 @@ #include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" #include "../../../Minecraft.World/Headers/net.minecraft.world.level.storage.h" -RenameWorldScreen::RenameWorldScreen(Screen *lastScreen, const wstring& levelId) +RenameWorldScreen::RenameWorldScreen(Screen *lastScreen, const std::wstring& levelId) { nameEdit = NULL; this->lastScreen = lastScreen; @@ -31,7 +31,7 @@ void RenameWorldScreen::init() LevelStorageSource *levelSource = minecraft->getLevelSource(); LevelData *levelData = levelSource->getDataTagFor(levelId); - wstring currentName = levelData->getLevelName(); + std::wstring currentName = levelData->getLevelName(); nameEdit = new EditBox(this, font, width / 2 - 100, 60, 200, 20, currentName); nameEdit->inFocus = true; diff --git a/Minecraft.Client/UI/Screens/RenameWorldScreen.h b/Minecraft.Client/UI/Screens/RenameWorldScreen.h index e1c398b1d..8aef6b83e 100644 --- a/Minecraft.Client/UI/Screens/RenameWorldScreen.h +++ b/Minecraft.Client/UI/Screens/RenameWorldScreen.h @@ -9,10 +9,10 @@ class RenameWorldScreen : public Screen private: Screen *lastScreen; EditBox *nameEdit; - wstring levelId; + std::wstring levelId; public: - RenameWorldScreen(Screen *lastScreen, const wstring& levelId); + RenameWorldScreen(Screen *lastScreen, const std::wstring& levelId); virtual void tick(); virtual void init() ; virtual void removed(); diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp index f23d225d9..42afd57ff 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp @@ -48,14 +48,14 @@ void SelectWorldScreen::loadLevelList() selectedWorld = -1; } -wstring SelectWorldScreen::getWorldId(int id) +std::wstring SelectWorldScreen::getWorldId(int id) { return levelList->at(id)->getLevelId(); } -wstring SelectWorldScreen::getWorldName(int id) +std::wstring SelectWorldScreen::getWorldName(int id) { - wstring levelName = levelList->at(id)->getLevelName(); + std::wstring levelName = levelList->at(id)->getLevelName(); if ( levelName.length() == 0 ) { @@ -87,16 +87,16 @@ void SelectWorldScreen::buttonClicked(Button *button) if (!button->active) return; if (button->id == BUTTON_DELETE_ID) { - wstring worldName = getWorldName(selectedWorld); + std::wstring worldName = getWorldName(selectedWorld); if (worldName != L"") { isDeleting = true; Language *language = Language::getInstance(); - wstring title = language->getElement(L"selectWorld.deleteQuestion"); - wstring warning = L"'" + worldName + L"' " + language->getElement(L"selectWorld.deleteWarning"); - wstring yes = language->getElement(L"selectWorld.deleteButton"); - wstring no = language->getElement(L"gui.cancel"); + std::wstring title = language->getElement(L"selectWorld.deleteQuestion"); + std::wstring warning = L"'" + worldName + L"' " + language->getElement(L"selectWorld.deleteWarning"); + std::wstring yes = language->getElement(L"selectWorld.deleteButton"); + std::wstring no = language->getElement(L"gui.cancel"); ConfirmScreen *confirmScreen = new ConfirmScreen(this, title, warning, yes, no, selectedWorld); minecraft->setScreen(confirmScreen); @@ -147,7 +147,7 @@ void SelectWorldScreen::worldSelected(int id) done = true; minecraft->gameMode = NULL; //new SurvivalMode(minecraft); - wstring worldFolderName = getWorldId(id); + std::wstring worldFolderName = getWorldId(id); if (worldFolderName == L"") // 4J - was NULL comparison { worldFolderName = L"World" + _toString(id); @@ -271,13 +271,13 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int { LevelSummary *levelSummary = parent->levelList->at(i); - wstring name = levelSummary->getLevelName(); + std::wstring name = levelSummary->getLevelName(); if (name.length()==0) { name = parent->worldLang + L" " + _toString(i + 1); } - wstring id = levelSummary->getLevelId(); + std::wstring id = levelSummary->getLevelId(); ULARGE_INTEGER rawtime; rawtime.QuadPart = levelSummary->getLastPlayed() * 10000; // Convert it from milliseconds back to FileTime @@ -296,7 +296,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int __int64 size = levelSummary->getSizeOnDisk(); id = id + L", " + _toString(size / 1024 * 100 / 1024 / 100.0f) + L" MB)"; - wstring info; + std::wstring info; if (levelSummary->isRequiresConversion()) { diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.h b/Minecraft.Client/UI/Screens/SelectWorldScreen.h index b85869f31..11a3b82d9 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.h +++ b/Minecraft.Client/UI/Screens/SelectWorldScreen.h @@ -25,14 +25,14 @@ private: protected: Screen *lastScreen; - wstring title; + std::wstring title; private: bool done; int selectedWorld; vector *levelList; WorldSelectionList *worldSelectionList; - wstring worldLang; - wstring conversionLang; + std::wstring worldLang; + std::wstring conversionLang; bool isDeleting; Button *deleteButton; @@ -45,8 +45,8 @@ public: private: void loadLevelList(); protected: - wstring getWorldId(int id); - wstring getWorldName(int id); + std::wstring getWorldId(int id); + std::wstring getWorldName(int id); public: virtual void postInit(); diff --git a/Minecraft.Client/UI/Screens/StatsScreen.cpp b/Minecraft.Client/UI/Screens/StatsScreen.cpp index 0c9983069..71e34ca49 100644 --- a/Minecraft.Client/UI/Screens/StatsScreen.cpp +++ b/Minecraft.Client/UI/Screens/StatsScreen.cpp @@ -133,7 +133,7 @@ void StatsScreen::GeneralStatisticsList::renderItem(int i, int x, int y, int h, { Stat *stat = Stats::generalStats->at(i); parent->drawString(parent->font, stat->name, x + 2, y + 1, i % 2 == 0 ? 0xffffff : 0x909090); - wstring msg = stat->format(parent->stats->getTotalValue(stat)); + std::wstring msg = stat->format(parent->stats->getTotalValue(stat)); parent->drawString(parent->font, msg, x + 2 + 213 - parent->font->width(msg), y + 1, i % 2 == 0 ? 0xffffff : 0x909090); } @@ -305,12 +305,12 @@ void StatsScreen::StatisticsList::renderStat(ItemStat *stat, int x, int y, bool { if (stat != NULL) { - wstring msg = stat->format(parent->stats->getTotalValue(stat)); + std::wstring msg = stat->format(parent->stats->getTotalValue(stat)); parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090); } else { - wstring msg = L"-"; + std::wstring msg = L"-"; parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090); } } @@ -336,7 +336,7 @@ void StatsScreen::StatisticsList::renderDecorations(int mouseX, int mouseY) } else { - wstring elementName; + std::wstring elementName; if (mouseX >= (rowX + ROW_COL_1 - SLOT_BG_SIZE) && mouseX <= (rowX + ROW_COL_1)) { elementName = getHeaderDescriptionId(0); @@ -380,7 +380,7 @@ void StatsScreen::StatisticsList::renderMousehoverTooltip(ItemStat *stat, int x, Item *item = Item::items[stat->getItemId()]; - wstring elementName = trimString(L"" + Language::getInstance()->getElementName(item->getDescriptionId())); + std::wstring elementName = trimString(L"" + Language::getInstance()->getElementName(item->getDescriptionId())); if (elementName.length() > 0) { @@ -526,7 +526,7 @@ void StatsScreen::ItemStatisticsList::renderItem(int i, int x, int y, int h, Tes renderStat((ItemStat *) stat, x + ROW_COL_3, y, i % 2 == 0);*/ } -wstring StatsScreen::ItemStatisticsList::getHeaderDescriptionId(int column) +std::wstring StatsScreen::ItemStatisticsList::getHeaderDescriptionId(int column) { if (column == COLUMN_CRAFTED) { @@ -653,7 +653,7 @@ void StatsScreen::BlockStatisticsList::renderItem(int i, int x, int y, int h, Te renderStat((ItemStat *) mineCount, x + ROW_COL_3, y, i % 2 == 0);*/ } -wstring StatsScreen::BlockStatisticsList::getHeaderDescriptionId(int column) +std::wstring StatsScreen::BlockStatisticsList::getHeaderDescriptionId(int column) { if (column == COLUMN_CRAFTED) { diff --git a/Minecraft.Client/UI/Screens/StatsScreen.h b/Minecraft.Client/UI/Screens/StatsScreen.h index 39660d0cf..26d9a2103 100644 --- a/Minecraft.Client/UI/Screens/StatsScreen.h +++ b/Minecraft.Client/UI/Screens/StatsScreen.h @@ -15,7 +15,7 @@ protected: static const int BUTTON_ITEMSTATS_ID = 3; Screen *lastScreen; - wstring title; + std::wstring title; public: class GeneralStatisticsList; class ItemStatisticsList; @@ -92,7 +92,7 @@ private: virtual void clickedHeader(int headerMouseX, int headerMouseY); virtual int getNumberOfItems(); ItemStat *getSlotStat(int slot); - virtual wstring getHeaderDescriptionId(int column) = 0; + virtual std::wstring getHeaderDescriptionId(int column) = 0; virtual void renderStat(ItemStat *stat, int x, int y, bool shaded); virtual void renderDecorations(int mouseX, int mouseY); virtual void renderMousehoverTooltip(ItemStat *stat, int x, int y); @@ -112,7 +112,7 @@ public: ItemStatisticsList(StatsScreen *ss); // 4J - added parameter so we can access parent virtual void renderHeader(int x, int y, Tesselator *t); virtual void renderItem(int i, int x, int y, int h, Tesselator *t); - virtual wstring getHeaderDescriptionId(int column); + virtual std::wstring getHeaderDescriptionId(int column); }; class BlockStatisticsList : public StatisticsList @@ -127,7 +127,7 @@ public: BlockStatisticsList(StatsScreen *ss); // 4J - added parameter so we can access parent virtual void renderHeader(int x, int y, Tesselator *t); virtual void renderItem(int i, int x, int y, int h, Tesselator *t); - virtual wstring getHeaderDescriptionId(int column); + virtual std::wstring getHeaderDescriptionId(int column); }; }; \ No newline at end of file diff --git a/Minecraft.Client/UI/Screens/TextEditScreen.cpp b/Minecraft.Client/UI/Screens/TextEditScreen.cpp index 667d1eb09..82acbf81a 100644 --- a/Minecraft.Client/UI/Screens/TextEditScreen.cpp +++ b/Minecraft.Client/UI/Screens/TextEditScreen.cpp @@ -11,7 +11,7 @@ #include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" -const wstring TextEditScreen::allowedChars = SharedConstants::readAcceptableChars(); +const std::wstring TextEditScreen::allowedChars = SharedConstants::readAcceptableChars(); TextEditScreen::TextEditScreen(std::shared_ptr sign) { @@ -61,12 +61,12 @@ void TextEditScreen::keyPressed(wchar_t ch, int eventKey) if (eventKey == Keyboard::KEY_UP) line = (line - 1) & 3; if (eventKey == Keyboard::KEY_DOWN || eventKey == Keyboard::KEY_RETURN) line = (line + 1) & 3; - wstring temp=sign->GetMessage(line); + std::wstring temp=sign->GetMessage(line); if (eventKey == Keyboard::KEY_BACK && temp.length() > 0) { temp = temp.substr(0, temp.length() - 1); } - if (allowedChars.find(ch) != wstring::npos && temp.length() < 15) + if (allowedChars.find(ch) != std::wstring::npos && temp.length() < 15) { temp += ch; } diff --git a/Minecraft.Client/UI/Screens/TextEditScreen.h b/Minecraft.Client/UI/Screens/TextEditScreen.h index 706817f66..da1636f90 100644 --- a/Minecraft.Client/UI/Screens/TextEditScreen.h +++ b/Minecraft.Client/UI/Screens/TextEditScreen.h @@ -6,7 +6,7 @@ using namespace std; class TextEditScreen : public Screen { protected: - wstring title; + std::wstring title; private: std::shared_ptr sign; int frame; @@ -20,7 +20,7 @@ public: protected: virtual void buttonClicked(Button *button); private: - static const wstring allowedChars; + static const std::wstring allowedChars; protected: virtual void keyPressed(wchar_t ch, int eventKey); public: diff --git a/Minecraft.Client/UI/Screens/TitleScreen.cpp b/Minecraft.Client/UI/Screens/TitleScreen.cpp index a98807442..165774991 100644 --- a/Minecraft.Client/UI/Screens/TitleScreen.cpp +++ b/Minecraft.Client/UI/Screens/TitleScreen.cpp @@ -22,12 +22,12 @@ TitleScreen::TitleScreen() splash = L"missingno"; // try { // 4J - removed try/catch - vector splashes; + vector splashes; /* BufferedReader *br = new BufferedReader(new InputStreamReader(InputStream::getResourceAsStream(L"res\\title\\splashes.txt"))); //, Charset.forName("UTF-8") - wstring line = L""; + std::wstring line = L""; while ( !(line = br->readLine()).empty() ) { line = trimString( line ); diff --git a/Minecraft.Client/UI/Screens/TitleScreen.h b/Minecraft.Client/UI/Screens/TitleScreen.h index 0f2a8ebc0..9829ae504 100644 --- a/Minecraft.Client/UI/Screens/TitleScreen.h +++ b/Minecraft.Client/UI/Screens/TitleScreen.h @@ -11,7 +11,7 @@ private: float vo; - wstring splash; + std::wstring splash; Button *multiplayerButton; public: diff --git a/Minecraft.Client/UI/Screens/VideoSettingsScreen.h b/Minecraft.Client/UI/Screens/VideoSettingsScreen.h index f4520c768..7570c0014 100644 --- a/Minecraft.Client/UI/Screens/VideoSettingsScreen.h +++ b/Minecraft.Client/UI/Screens/VideoSettingsScreen.h @@ -8,7 +8,7 @@ class VideoSettingsScreen : public Screen private: Screen *lastScreen; protected: - wstring title; + std::wstring title; private: Options *options; diff --git a/Minecraft.Client/UI/SimpleIcon.cpp b/Minecraft.Client/UI/SimpleIcon.cpp index ae6a73857..c69a9938b 100644 --- a/Minecraft.Client/UI/SimpleIcon.cpp +++ b/Minecraft.Client/UI/SimpleIcon.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "SimpleIcon.h" -SimpleIcon::SimpleIcon(const wstring &name, float U0, float V0, float U1, float V1) : StitchedTexture(name) +SimpleIcon::SimpleIcon(const std::wstring &name, float U0, float V0, float U1, float V1) : StitchedTexture(name) { u0 = U0; u1 = U1; diff --git a/Minecraft.Client/UI/SimpleIcon.h b/Minecraft.Client/UI/SimpleIcon.h index 5bece8346..f75a6081a 100644 --- a/Minecraft.Client/UI/SimpleIcon.h +++ b/Minecraft.Client/UI/SimpleIcon.h @@ -7,5 +7,5 @@ using namespace std; class SimpleIcon : public StitchedTexture { public: - SimpleIcon(const wstring &name, float u0, float v0, float u1, float v1); + SimpleIcon(const std::wstring &name, float u0, float v0, float u1, float v1); }; \ No newline at end of file diff --git a/Minecraft.Client/UI/SlideButton.cpp b/Minecraft.Client/UI/SlideButton.cpp index cb86776c1..a9d4c250e 100644 --- a/Minecraft.Client/UI/SlideButton.cpp +++ b/Minecraft.Client/UI/SlideButton.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "SlideButton.h" -SlideButton::SlideButton(int id, int x, int y, const Options::Option *option, const wstring& msg, float value) : Button(id, x, y, 150, 20, msg) +SlideButton::SlideButton(int id, int x, int y, const Options::Option *option, const std::wstring& msg, float value) : Button(id, x, y, 150, 20, msg) { this->sliding = false; //4J added this->option = option; diff --git a/Minecraft.Client/UI/SlideButton.h b/Minecraft.Client/UI/SlideButton.h index 21ed3548a..2947e7015 100644 --- a/Minecraft.Client/UI/SlideButton.h +++ b/Minecraft.Client/UI/SlideButton.h @@ -12,7 +12,7 @@ private: const Options::Option *option; public: - SlideButton(int id, int x, int y, const Options::Option *option, const wstring& msg, float value); + SlideButton(int id, int x, int y, const Options::Option *option, const std::wstring& msg, float value); protected: virtual int getYImage(bool hovered); virtual void renderBg(Minecraft *minecraft, int xm, int ym); diff --git a/Minecraft.Client/UI/SmallButton.cpp b/Minecraft.Client/UI/SmallButton.cpp index 0ce93d0eb..ff736996f 100644 --- a/Minecraft.Client/UI/SmallButton.cpp +++ b/Minecraft.Client/UI/SmallButton.cpp @@ -1,17 +1,17 @@ #include "../Build/stdafx.h" #include "SmallButton.h" -SmallButton::SmallButton(int id, int x, int y, const wstring& msg) : Button(id, x, y, 150, 20, msg) +SmallButton::SmallButton(int id, int x, int y, const std::wstring& msg) : Button(id, x, y, 150, 20, msg) { this->option = NULL; } -SmallButton::SmallButton(int id, int x, int y, int width, int height, const wstring& msg) : Button(id, x, y, width, height, msg) +SmallButton::SmallButton(int id, int x, int y, int width, int height, const std::wstring& msg) : Button(id, x, y, width, height, msg) { this->option = NULL; } -SmallButton::SmallButton(int id, int x, int y, const Options::Option *item, const wstring& msg) : Button(id, x, y, 150, 20, msg) +SmallButton::SmallButton(int id, int x, int y, const Options::Option *item, const std::wstring& msg) : Button(id, x, y, 150, 20, msg) { this->option = item; } diff --git a/Minecraft.Client/UI/SmallButton.h b/Minecraft.Client/UI/SmallButton.h index ede350be6..7ddf9f56f 100644 --- a/Minecraft.Client/UI/SmallButton.h +++ b/Minecraft.Client/UI/SmallButton.h @@ -8,8 +8,8 @@ private: const Options::Option *option; public: - SmallButton(int id, int x, int y, const wstring& msg); - SmallButton(int id, int x, int y, int width, int height, const wstring& msg); - SmallButton(int id, int x, int y, const Options::Option *item, const wstring& msg); + SmallButton(int id, int x, int y, const std::wstring& msg); + SmallButton(int id, int x, int y, int width, int height, const std::wstring& msg); + SmallButton(int id, int x, int y, const Options::Option *item, const std::wstring& msg); const Options::Option *getOption(); }; \ No newline at end of file diff --git a/Minecraft.Client/Utils/ArchiveFile.cpp b/Minecraft.Client/Utils/ArchiveFile.cpp index 29c8a651b..2678d33fb 100644 --- a/Minecraft.Client/Utils/ArchiveFile.cpp +++ b/Minecraft.Client/Utils/ArchiveFile.cpp @@ -24,7 +24,7 @@ void ArchiveFile::_readHeader(DataInputStream *dis) } else meta->isCompressed = false; - m_index.insert( pair(meta->filename,meta) ); + m_index.insert( pair(meta->filename,meta) ); } } @@ -74,9 +74,9 @@ ArchiveFile::~ArchiveFile() delete m_cachedData; } -vector *ArchiveFile::getFileList() +vector *ArchiveFile::getFileList() { - vector *out = new vector(); + vector *out = new vector(); for ( AUTO_VAR(it, m_index.begin()); it != m_index.end(); @@ -87,17 +87,17 @@ vector *ArchiveFile::getFileList() return out; } -bool ArchiveFile::hasFile(const wstring &filename) +bool ArchiveFile::hasFile(const std::wstring &filename) { return m_index.find(filename) != m_index.end(); } -int ArchiveFile::getFileSize(const wstring &filename) +int ArchiveFile::getFileSize(const std::wstring &filename) { return hasFile(filename) ? m_index.at(filename)->filesize : -1; } -byteArray ArchiveFile::getFile(const wstring &filename) +byteArray ArchiveFile::getFile(const std::wstring &filename) { byteArray out; AUTO_VAR(it,m_index.find(filename)); diff --git a/Minecraft.Client/Utils/ArchiveFile.h b/Minecraft.Client/Utils/ArchiveFile.h index f67c25b99..9f3ee9775 100644 --- a/Minecraft.Client/Utils/ArchiveFile.h +++ b/Minecraft.Client/Utils/ArchiveFile.h @@ -16,14 +16,14 @@ protected: typedef struct _MetaData { - wstring filename; + std::wstring filename; int ptr; int filesize; bool isCompressed; } MetaData, *PMetaData; - std::unordered_map m_index; + std::unordered_map m_index; public: void _readHeader(DataInputStream *dis); @@ -31,8 +31,8 @@ public: ArchiveFile(File file); ~ArchiveFile(); - vector *getFileList(); - bool hasFile(const wstring &filename); - int getFileSize(const wstring &filename); - byteArray getFile(const wstring &filename); + vector *getFileList(); + bool hasFile(const std::wstring &filename); + int getFileSize(const std::wstring &filename); + byteArray getFile(const std::wstring &filename); }; diff --git a/Minecraft.Client/Utils/StringTable.cpp b/Minecraft.Client/Utils/StringTable.cpp index 68764957a..6cf2de964 100644 --- a/Minecraft.Client/Utils/StringTable.cpp +++ b/Minecraft.Client/Utils/StringTable.cpp @@ -17,16 +17,16 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) int versionNumber = dis.readInt(); int languagesCount = dis.readInt(); - vector< pair > langSizeMap; + vector< pair > langSizeMap; for(int i = 0; i < languagesCount; ++i) { - wstring langId = dis.readUTF(); + std::wstring langId = dis.readUTF(); int langSize = dis.readInt(); - langSizeMap.push_back( vector< pair >::value_type(langId, langSize)); + langSizeMap.push_back( vector< pair >::value_type(langId, langSize)); } - vector locales; + vector locales; app.getLocale(locales); bool foundLang = false; @@ -74,20 +74,20 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) int langVersion = dis2.readInt(); isStatic = false; // 4J-JEV: Versions 1 and up could use - if (langVersion > 0) // integers rather than wstrings as keys. + if (langVersion > 0) // integers rather than std::wstrings as keys. isStatic = dis2.readBoolean(); - wstring langId = dis2.readUTF(); + std::wstring langId = dis2.readUTF(); int totalStrings = dis2.readInt(); if (!isStatic) { for(int i = 0; i < totalStrings; ++i) { - wstring stringId = dis2.readUTF(); - wstring stringValue = dis2.readUTF(); + std::wstring stringId = dis2.readUTF(); + std::wstring stringValue = dis2.readUTF(); - m_stringsMap.insert( std::unordered_map::value_type(stringId, stringValue) ); + m_stringsMap.insert( std::unordered_map::value_type(stringId, stringValue) ); } } else @@ -125,7 +125,7 @@ void StringTable::getData(PBYTE *ppData, UINT *pSize) *pSize = src.length; } -LPCWSTR StringTable::getString(const wstring &id) +LPCWSTR StringTable::getString(const std::wstring &id) { #ifndef _CONTENT_PACKAGE if (isStatic) diff --git a/Minecraft.Client/Utils/StringTable.h b/Minecraft.Client/Utils/StringTable.h index 5cb379b99..27374046e 100644 --- a/Minecraft.Client/Utils/StringTable.h +++ b/Minecraft.Client/Utils/StringTable.h @@ -15,8 +15,8 @@ class StringTable private: bool isStatic; - std::unordered_map m_stringsMap; - vector m_stringsVec; + std::unordered_map m_stringsMap; + vector m_stringsVec; byteArray src; @@ -64,7 +64,7 @@ public: void getData(PBYTE *ppbData, UINT *pdwSize); - LPCWSTR getString(const wstring &id); + LPCWSTR getString(const std::wstring &id); LPCWSTR getString(int id); //static LPCWSTR m_wchLocaleCode[LOCALE_COUNT]; @@ -72,7 +72,7 @@ public: private: - //wstring getLangId(DWORD dwLanguage=0); + //std::wstring getLangId(DWORD dwLanguage=0); }; diff --git a/Minecraft.Client/Utils/WstringLookup.cpp b/Minecraft.Client/Utils/WstringLookup.cpp index 376b9dfad..fa99e5008 100644 --- a/Minecraft.Client/Utils/WstringLookup.cpp +++ b/Minecraft.Client/Utils/WstringLookup.cpp @@ -8,7 +8,7 @@ WstringLookup::WstringLookup() numIDs = 0; } -wstring WstringLookup::lookup(UINT id) +std::wstring WstringLookup::lookup(UINT id) { // TODO //if (id > currentMaxID) @@ -17,12 +17,12 @@ wstring WstringLookup::lookup(UINT id) return int2str.at(id); } -UINT WstringLookup::lookup(wstring str) +UINT WstringLookup::lookup(std::wstring str) { if (str2int.find(str) == str2int.end()) { - pair p = - pair(str, numIDs); + pair p = + pair(str, numIDs); str2int.insert( p ); int2str.push_back( str ); @@ -35,13 +35,13 @@ UINT WstringLookup::lookup(wstring str) } } -VOID WstringLookup::getTable(wstring **lookup, UINT *len) +VOID WstringLookup::getTable(std::wstring **lookup, UINT *len) { // Outputs - wstring *out_lookup; UINT out_len; + std::wstring *out_lookup; UINT out_len; // Fill lookup. - out_lookup = new wstring[int2str.size()]; + out_lookup = new std::wstring[int2str.size()]; for (UINT i = 0; i < numIDs; i++) out_lookup[i] = int2str.at(i); diff --git a/Minecraft.Client/Utils/WstringLookup.h b/Minecraft.Client/Utils/WstringLookup.h index 45f92dc52..086b9da5e 100644 --- a/Minecraft.Client/Utils/WstringLookup.h +++ b/Minecraft.Client/Utils/WstringLookup.h @@ -6,15 +6,15 @@ class WstringLookup { private: UINT numIDs; - std::unordered_map str2int; - vector int2str; + std::unordered_map str2int; + vector int2str; public: WstringLookup(); - wstring lookup(UINT id); + std::wstring lookup(UINT id); - UINT lookup(wstring); + UINT lookup(std::wstring); - VOID getTable(wstring **lookup, UINT *len); + VOID getTable(std::wstring **lookup, UINT *len); }; \ No newline at end of file diff --git a/Minecraft.World/AI/Navigation/Node.cpp b/Minecraft.World/AI/Navigation/Node.cpp index 92fd4c24b..ad1104e3b 100644 --- a/Minecraft.World/AI/Navigation/Node.cpp +++ b/Minecraft.World/AI/Navigation/Node.cpp @@ -69,7 +69,7 @@ bool Node::inOpenSet() return heapIdx >= 0; } -wstring Node::toString() +std::wstring Node::toString() { return _toString(x) + L", " + _toString(y) + L", " + _toString(z); } \ No newline at end of file diff --git a/Minecraft.World/AI/Navigation/Node.h b/Minecraft.World/AI/Navigation/Node.h index 6d2bdda86..f85be5331 100644 --- a/Minecraft.World/AI/Navigation/Node.h +++ b/Minecraft.World/AI/Navigation/Node.h @@ -34,5 +34,5 @@ public: bool equals(Node *o); int hashCode(); bool inOpenSet(); - wstring toString(); + std::wstring toString(); }; diff --git a/Minecraft.World/Blocks/AnvilTile.cpp b/Minecraft.World/Blocks/AnvilTile.cpp index 761b1a03b..0e1c9dbad 100644 --- a/Minecraft.World/Blocks/AnvilTile.cpp +++ b/Minecraft.World/Blocks/AnvilTile.cpp @@ -13,7 +13,7 @@ const unsigned int AnvilTile::ANVIL_NAMES[ANVIL_NAMES_LENGTH] = { IDS_TILE_ANVIL }; -wstring AnvilTile::TEXTURE_DAMAGE_NAMES[ANVIL_NAMES_LENGTH] = { +std::wstring AnvilTile::TEXTURE_DAMAGE_NAMES[ANVIL_NAMES_LENGTH] = { L"anvil_top", L"anvil_top_damaged_1", L"anvil_top_damaged_2" }; diff --git a/Minecraft.World/Blocks/AnvilTile.h b/Minecraft.World/Blocks/AnvilTile.h index e625777d9..745d03997 100644 --- a/Minecraft.World/Blocks/AnvilTile.h +++ b/Minecraft.World/Blocks/AnvilTile.h @@ -19,7 +19,7 @@ public: static const unsigned int ANVIL_NAMES[ANVIL_NAMES_LENGTH]; private: - static wstring TEXTURE_DAMAGE_NAMES[ANVIL_NAMES_LENGTH]; + static std::wstring TEXTURE_DAMAGE_NAMES[ANVIL_NAMES_LENGTH]; public: int part; diff --git a/Minecraft.World/Blocks/BrewingStandTile.cpp b/Minecraft.World/Blocks/BrewingStandTile.cpp index fcdff6e91..0ecdc6d0a 100644 --- a/Minecraft.World/Blocks/BrewingStandTile.cpp +++ b/Minecraft.World/Blocks/BrewingStandTile.cpp @@ -6,7 +6,7 @@ #include "../Headers/net.minecraft.world.entity.item.h" #include "../Headers/net.minecraft.world.h" -const wstring BrewingStandTile::TEXTURE_BASE = L"brewingStand_base"; +const std::wstring BrewingStandTile::TEXTURE_BASE = L"brewingStand_base"; BrewingStandTile::BrewingStandTile(int id) : EntityTile(id, Material::metal, isSolidRender()) { diff --git a/Minecraft.World/Blocks/BrewingStandTile.h b/Minecraft.World/Blocks/BrewingStandTile.h index 29824c375..03b99361c 100644 --- a/Minecraft.World/Blocks/BrewingStandTile.h +++ b/Minecraft.World/Blocks/BrewingStandTile.h @@ -8,7 +8,7 @@ class BrewingStandTile : public EntityTile { friend ChunkRebuildData; public: - static const wstring TEXTURE_BASE; + static const std::wstring TEXTURE_BASE; private: Random *random; Icon *iconBase; diff --git a/Minecraft.World/Blocks/CauldronTile.cpp b/Minecraft.World/Blocks/CauldronTile.cpp index 8111aa9ab..1e2fdc637 100644 --- a/Minecraft.World/Blocks/CauldronTile.cpp +++ b/Minecraft.World/Blocks/CauldronTile.cpp @@ -8,8 +8,8 @@ #include "../Headers/net.minecraft.world.h" #include "../../Minecraft.Client/Player/ServerPlayer.h" -const wstring CauldronTile::TEXTURE_INSIDE = L"cauldron_inner"; -const wstring CauldronTile::TEXTURE_BOTTOM = L"cauldron_bottom"; +const std::wstring CauldronTile::TEXTURE_INSIDE = L"cauldron_inner"; +const std::wstring CauldronTile::TEXTURE_BOTTOM = L"cauldron_bottom"; CauldronTile::CauldronTile(int id) : Tile(id, Material::metal, isSolidRender()) { @@ -39,7 +39,7 @@ void CauldronTile::registerIcons(IconRegister *iconRegister) icon = iconRegister->registerIcon(L"cauldron_side"); } -Icon *CauldronTile::getTexture(const wstring &name) +Icon *CauldronTile::getTexture(const std::wstring &name) { if (name.compare(TEXTURE_INSIDE) == 0) return Tile::cauldron->iconInner; if (name.compare(TEXTURE_BOTTOM) == 0) return Tile::cauldron->iconBottom; diff --git a/Minecraft.World/Blocks/CauldronTile.h b/Minecraft.World/Blocks/CauldronTile.h index 61c98de35..804a33450 100644 --- a/Minecraft.World/Blocks/CauldronTile.h +++ b/Minecraft.World/Blocks/CauldronTile.h @@ -6,8 +6,8 @@ class IconRegister; class CauldronTile : public Tile { public: - static const wstring TEXTURE_INSIDE; - static const wstring TEXTURE_BOTTOM; + static const std::wstring TEXTURE_INSIDE; + static const std::wstring TEXTURE_BOTTOM; private: Icon *iconInner; @@ -20,7 +20,7 @@ public: virtual Icon *getTexture(int face, int data); //@Override void registerIcons(IconRegister *iconRegister); - static Icon *getTexture(const wstring &name); + static Icon *getTexture(const std::wstring &name); virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual void updateDefaultShape(); virtual bool isSolidRender(bool isServerLevel = false); diff --git a/Minecraft.World/Blocks/CocoaTile.cpp b/Minecraft.World/Blocks/CocoaTile.cpp index 7c24edde4..a30a9da63 100644 --- a/Minecraft.World/Blocks/CocoaTile.cpp +++ b/Minecraft.World/Blocks/CocoaTile.cpp @@ -6,7 +6,7 @@ #include "../Headers/net.minecraft.h" #include "CocoaTile.h" -const wstring CocoaTile::TEXTURE_AGES[] = { L"cocoa_0", L"cocoa_1", L"cocoa_2"}; +const std::wstring CocoaTile::TEXTURE_AGES[] = { L"cocoa_0", L"cocoa_1", L"cocoa_2"}; CocoaTile::CocoaTile(int id) : DirectionalTile(id, Material::plant, isSolidRender() ) { diff --git a/Minecraft.World/Blocks/CocoaTile.h b/Minecraft.World/Blocks/CocoaTile.h index 81de72ead..67345b338 100644 --- a/Minecraft.World/Blocks/CocoaTile.h +++ b/Minecraft.World/Blocks/CocoaTile.h @@ -6,7 +6,7 @@ class CocoaTile : public DirectionalTile { public: static const int COCOA_TEXTURES_LENGTH = 3; - static const wstring TEXTURE_AGES[]; + static const std::wstring TEXTURE_AGES[]; private: Icon **icons; diff --git a/Minecraft.World/Blocks/DoorTile.cpp b/Minecraft.World/Blocks/DoorTile.cpp index e973bc842..5940a39ea 100644 --- a/Minecraft.World/Blocks/DoorTile.cpp +++ b/Minecraft.World/Blocks/DoorTile.cpp @@ -8,7 +8,7 @@ #include "../Headers/net.minecraft.world.h" #include "../Headers/net.minecraft.h" -const wstring DoorTile::TEXTURES[] = { L"doorWood_lower", L"doorWood_upper", L"doorIron_lower", L"doorIron_upper" }; +const std::wstring DoorTile::TEXTURES[] = { L"doorWood_lower", L"doorWood_upper", L"doorIron_lower", L"doorIron_upper" }; DoorTile::DoorTile(int id, Material *material) : Tile(id, material,isSolidRender()) { diff --git a/Minecraft.World/Blocks/DoorTile.h b/Minecraft.World/Blocks/DoorTile.h index d9f84a60a..14c68b7ed 100644 --- a/Minecraft.World/Blocks/DoorTile.h +++ b/Minecraft.World/Blocks/DoorTile.h @@ -20,7 +20,7 @@ public: private: static const int DOOR_TILE_TEXTURE_COUNT = 4; - static const wstring TEXTURES[]; + static const std::wstring TEXTURES[]; int texBase; Icon **icons; diff --git a/Minecraft.World/Blocks/EnchantmentTableTile.cpp b/Minecraft.World/Blocks/EnchantmentTableTile.cpp index 5c111ebe6..3aa90c632 100644 --- a/Minecraft.World/Blocks/EnchantmentTableTile.cpp +++ b/Minecraft.World/Blocks/EnchantmentTableTile.cpp @@ -5,9 +5,9 @@ #include "../Headers/net.minecraft.h" #include "../Headers/net.minecraft.world.h" -const wstring EnchantmentTableTile::TEXTURE_SIDE = L"enchantment_side"; -const wstring EnchantmentTableTile::TEXTURE_TOP = L"enchantment_top"; -const wstring EnchantmentTableTile::TEXTURE_BOTTOM = L"enchantment_bottom"; +const std::wstring EnchantmentTableTile::TEXTURE_SIDE = L"enchantment_side"; +const std::wstring EnchantmentTableTile::TEXTURE_TOP = L"enchantment_top"; +const std::wstring EnchantmentTableTile::TEXTURE_BOTTOM = L"enchantment_bottom"; EnchantmentTableTile::EnchantmentTableTile(int id) : EntityTile(id, Material::stone, isSolidRender()) { diff --git a/Minecraft.World/Blocks/EnchantmentTableTile.h b/Minecraft.World/Blocks/EnchantmentTableTile.h index a789c5a01..13860d106 100644 --- a/Minecraft.World/Blocks/EnchantmentTableTile.h +++ b/Minecraft.World/Blocks/EnchantmentTableTile.h @@ -6,9 +6,9 @@ class EnchantmentTableTile : public EntityTile { friend class ChunkRebuildData; public: - static const wstring TEXTURE_SIDE; - static const wstring TEXTURE_TOP; - static const wstring TEXTURE_BOTTOM; + static const std::wstring TEXTURE_SIDE; + static const std::wstring TEXTURE_TOP; + static const std::wstring TEXTURE_BOTTOM; private: Icon *iconTop; diff --git a/Minecraft.World/Blocks/FenceTile.cpp b/Minecraft.World/Blocks/FenceTile.cpp index ee95c95e9..e5104eb5a 100644 --- a/Minecraft.World/Blocks/FenceTile.cpp +++ b/Minecraft.World/Blocks/FenceTile.cpp @@ -4,7 +4,7 @@ #include "../Headers/net.minecraft.world.h" #include "FenceTile.h" -FenceTile::FenceTile(int id, const wstring &texture, Material *material) : Tile( id, material, isSolidRender()) +FenceTile::FenceTile(int id, const std::wstring &texture, Material *material) : Tile( id, material, isSolidRender()) { this->texture = texture; } diff --git a/Minecraft.World/Blocks/FenceTile.h b/Minecraft.World/Blocks/FenceTile.h index d42465205..001fe19f8 100644 --- a/Minecraft.World/Blocks/FenceTile.h +++ b/Minecraft.World/Blocks/FenceTile.h @@ -5,10 +5,10 @@ class FenceTile : public Tile { private: - wstring texture; + std::wstring texture; public: - FenceTile(int id, const wstring &texture, Material *material); + FenceTile(int id, const std::wstring &texture, Material *material); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual bool blocksLight(); diff --git a/Minecraft.World/Blocks/FireTile.cpp b/Minecraft.World/Blocks/FireTile.cpp index 7d0ce152e..c5af0901e 100644 --- a/Minecraft.World/Blocks/FireTile.cpp +++ b/Minecraft.World/Blocks/FireTile.cpp @@ -13,8 +13,8 @@ #include "../../Minecraft.Client/Rendering/Tesselator.h" -const wstring FireTile::TEXTURE_FIRST = L"fire_0"; -const wstring FireTile::TEXTURE_SECOND = L"fire_1"; +const std::wstring FireTile::TEXTURE_FIRST = L"fire_0"; +const std::wstring FireTile::TEXTURE_SECOND = L"fire_1"; FireTile::FireTile(int id) : Tile(id, Material::fire,isSolidRender()) { diff --git a/Minecraft.World/Blocks/FireTile.h b/Minecraft.World/Blocks/FireTile.h index 05c9e2b88..35a391b3d 100644 --- a/Minecraft.World/Blocks/FireTile.h +++ b/Minecraft.World/Blocks/FireTile.h @@ -9,8 +9,8 @@ class FireTile : public Tile friend class Tile; friend class ChunkRebuildData; public: - static const wstring TEXTURE_FIRST; - static const wstring TEXTURE_SECOND; + static const std::wstring TEXTURE_FIRST; + static const std::wstring TEXTURE_SECOND; static const int FLAME_INSTANT = 60; static const int FLAME_EASY = 30; diff --git a/Minecraft.World/Blocks/HalfTransparentTile.cpp b/Minecraft.World/Blocks/HalfTransparentTile.cpp index d031af57b..00d3e84d4 100644 --- a/Minecraft.World/Blocks/HalfTransparentTile.cpp +++ b/Minecraft.World/Blocks/HalfTransparentTile.cpp @@ -3,7 +3,7 @@ #include "../Headers/net.minecraft.world.h" #include "HalfTransparentTile.h" -HalfTransparentTile::HalfTransparentTile(int id, const wstring &tex, Material *material, bool allowSame) : Tile(id,material,isSolidRender()) +HalfTransparentTile::HalfTransparentTile(int id, const std::wstring &tex, Material *material, bool allowSame) : Tile(id,material,isSolidRender()) { this->allowSame = allowSame; this->texture = tex; diff --git a/Minecraft.World/Blocks/HalfTransparentTile.h b/Minecraft.World/Blocks/HalfTransparentTile.h index e3d34c3fd..b74cbeca0 100644 --- a/Minecraft.World/Blocks/HalfTransparentTile.h +++ b/Minecraft.World/Blocks/HalfTransparentTile.h @@ -8,9 +8,9 @@ class HalfTransparentTile : public Tile friend class ChunkRebuildData; private: bool allowSame; - wstring texture; + std::wstring texture; protected: - HalfTransparentTile(int id, const wstring &tex, Material *material, bool allowSame); + HalfTransparentTile(int id, const std::wstring &tex, Material *material, bool allowSame); public: virtual bool isSolidRender(bool isServerLevel = false); virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); diff --git a/Minecraft.World/Blocks/HugeMushroomTile.cpp b/Minecraft.World/Blocks/HugeMushroomTile.cpp index 614949a54..9da041510 100644 --- a/Minecraft.World/Blocks/HugeMushroomTile.cpp +++ b/Minecraft.World/Blocks/HugeMushroomTile.cpp @@ -2,9 +2,9 @@ #include "../Headers/net.minecraft.world.h" #include "HugeMushroomTile.h" -const wstring HugeMushroomTile::TEXTURE_STEM = L"mushroom_skin_stem"; -const wstring HugeMushroomTile::TEXTURE_INSIDE = L"mushroom_inside"; -const wstring HugeMushroomTile::TEXTURE_TYPE[] = {L"mushroom_skin_brown", L"mushroom_skin_red"}; +const std::wstring HugeMushroomTile::TEXTURE_STEM = L"mushroom_skin_stem"; +const std::wstring HugeMushroomTile::TEXTURE_INSIDE = L"mushroom_inside"; +const std::wstring HugeMushroomTile::TEXTURE_TYPE[] = {L"mushroom_skin_brown", L"mushroom_skin_red"}; HugeMushroomTile::HugeMushroomTile(int id, Material *material, int type) : Tile(id, material) { diff --git a/Minecraft.World/Blocks/HugeMushroomTile.h b/Minecraft.World/Blocks/HugeMushroomTile.h index 2aa22fbb5..2dc4a0ddc 100644 --- a/Minecraft.World/Blocks/HugeMushroomTile.h +++ b/Minecraft.World/Blocks/HugeMushroomTile.h @@ -6,12 +6,12 @@ class HugeMushroomTile : public Tile { friend class ChunkRebuildData; public: - static const wstring TEXTURE_STEM; - static const wstring TEXTURE_INSIDE; + static const std::wstring TEXTURE_STEM; + static const std::wstring TEXTURE_INSIDE; private: static const int HUGE_MUSHROOM_TEXTURE_COUNT = 2; - static const wstring TEXTURE_TYPE[]; + static const std::wstring TEXTURE_TYPE[]; int type; Icon **icons; Icon *iconStem; diff --git a/Minecraft.World/Blocks/LeafTile.cpp b/Minecraft.World/Blocks/LeafTile.cpp index cd928fed4..7f14e90c0 100644 --- a/Minecraft.World/Blocks/LeafTile.cpp +++ b/Minecraft.World/Blocks/LeafTile.cpp @@ -13,7 +13,7 @@ const unsigned int LeafTile::LEAF_NAMES[LEAF_NAMES_LENGTH] = { IDS_TILE_LEAVES_O IDS_TILE_LEAVES_JUNGLE, }; -const wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},}; +const std::wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},}; LeafTile::LeafTile(int id) : TransparentTile(id, Material::leaves, false, isSolidRender()) { diff --git a/Minecraft.World/Blocks/LeafTile.h b/Minecraft.World/Blocks/LeafTile.h index 428a293f1..20b5d73c7 100644 --- a/Minecraft.World/Blocks/LeafTile.h +++ b/Minecraft.World/Blocks/LeafTile.h @@ -9,7 +9,7 @@ class LeafTile : public TransparentTile friend class Tile; friend class ChunkRebuildData; public: - static const wstring TEXTURES[2][4]; + static const std::wstring TEXTURES[2][4]; static const int REQUIRED_WOOD_RANGE = 4; static const int UPDATE_LEAF_BIT = 8; diff --git a/Minecraft.World/Blocks/LiquidTile.cpp b/Minecraft.World/Blocks/LiquidTile.cpp index a168a8b4b..7283c0850 100644 --- a/Minecraft.World/Blocks/LiquidTile.cpp +++ b/Minecraft.World/Blocks/LiquidTile.cpp @@ -7,10 +7,10 @@ #include "../Util/Facing.h" #include "../Util/SoundTypes.h" -const wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava"; -const wstring LiquidTile::TEXTURE_WATER_STILL = L"water"; -const wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow"; -const wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow"; +const std::wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava"; +const std::wstring LiquidTile::TEXTURE_WATER_STILL = L"water"; +const std::wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow"; +const std::wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow"; LiquidTile::LiquidTile(int id, Material *material) : Tile(id, material,isSolidRender()) { @@ -408,7 +408,7 @@ void LiquidTile::registerIcons(IconRegister *iconRegister) } } -Icon *LiquidTile::getTexture(const wstring &name) +Icon *LiquidTile::getTexture(const std::wstring &name) { if (name.compare(TEXTURE_WATER_STILL)==0) return Tile::water->icons[0]; if (name.compare(TEXTURE_WATER_FLOW)==0) return Tile::water->icons[1]; diff --git a/Minecraft.World/Blocks/LiquidTile.h b/Minecraft.World/Blocks/LiquidTile.h index 53649acbc..4a0e8e6d5 100644 --- a/Minecraft.World/Blocks/LiquidTile.h +++ b/Minecraft.World/Blocks/LiquidTile.h @@ -9,10 +9,10 @@ class LiquidTile : public Tile { friend class ChunkRebuildData; public: - static const wstring TEXTURE_LAVA_STILL; - static const wstring TEXTURE_WATER_STILL; - static const wstring TEXTURE_WATER_FLOW; - static const wstring TEXTURE_LAVA_FLOW; + static const std::wstring TEXTURE_LAVA_STILL; + static const std::wstring TEXTURE_WATER_STILL; + static const std::wstring TEXTURE_WATER_FLOW; + static const std::wstring TEXTURE_LAVA_FLOW; private: Icon *icons[2]; @@ -58,5 +58,5 @@ protected: public: void registerIcons(IconRegister *iconRegister); - static Icon *getTexture(const wstring &name); + static Icon *getTexture(const std::wstring &name); }; \ No newline at end of file diff --git a/Minecraft.World/Blocks/MelonTile.cpp b/Minecraft.World/Blocks/MelonTile.cpp index 320e03b30..3d441ba10 100644 --- a/Minecraft.World/Blocks/MelonTile.cpp +++ b/Minecraft.World/Blocks/MelonTile.cpp @@ -4,8 +4,8 @@ #include "../Headers/net.minecraft.world.h" #include "../Util/Facing.h" -const wstring MelonTile::TEX = L"melon_side"; -const wstring MelonTile::TEX_TOP = L"melon_top"; +const std::wstring MelonTile::TEX = L"melon_side"; +const std::wstring MelonTile::TEX_TOP = L"melon_top"; MelonTile::MelonTile(int id) : Tile(id, Material::vegetable) { diff --git a/Minecraft.World/Blocks/MelonTile.h b/Minecraft.World/Blocks/MelonTile.h index 029cb1cb1..43b456e64 100644 --- a/Minecraft.World/Blocks/MelonTile.h +++ b/Minecraft.World/Blocks/MelonTile.h @@ -6,8 +6,8 @@ class MelonTile : public Tile { friend class ChunkRebuildData; private: - static const wstring TEX; - static const wstring TEX_TOP; + static const std::wstring TEX; + static const std::wstring TEX_TOP; Icon *iconTop; diff --git a/Minecraft.World/Blocks/MushroomPlantTile.cpp b/Minecraft.World/Blocks/MushroomPlantTile.cpp index caa026b72..6099a9e2a 100644 --- a/Minecraft.World/Blocks/MushroomPlantTile.cpp +++ b/Minecraft.World/Blocks/MushroomPlantTile.cpp @@ -4,7 +4,7 @@ #include "../Headers/net.minecraft.world.h" #include "MushroomPlantTile.h" -Mushroom::Mushroom(int id, const wstring &texture) : Bush(id) +Mushroom::Mushroom(int id, const std::wstring &texture) : Bush(id) { this->updateDefaultShape(); this->setTicking(true); diff --git a/Minecraft.World/Blocks/MushroomPlantTile.h b/Minecraft.World/Blocks/MushroomPlantTile.h index c5cfbd88d..04f82d81c 100644 --- a/Minecraft.World/Blocks/MushroomPlantTile.h +++ b/Minecraft.World/Blocks/MushroomPlantTile.h @@ -7,9 +7,9 @@ class Mushroom : public Bush { friend class Tile; private: - wstring texture; + std::wstring texture; protected: - Mushroom(int id, const wstring &texture); + Mushroom(int id, const std::wstring &texture); public: virtual void updateDefaultShape(); // 4J Added override virtual void tick(Level *level, int x, int y, int z, Random *random); diff --git a/Minecraft.World/Blocks/NetherStalkTile.cpp b/Minecraft.World/Blocks/NetherStalkTile.cpp index 689967831..9c4f9bfaf 100644 --- a/Minecraft.World/Blocks/NetherStalkTile.cpp +++ b/Minecraft.World/Blocks/NetherStalkTile.cpp @@ -5,7 +5,7 @@ #include "../Headers/net.minecraft.world.item.h" #include "../Headers/net.minecraft.world.h" -const wstring NetherStalkTile::TEXTURE_NAMES[] = { L"netherStalk_0", L"netherStalk_1", L"netherStalk_2" }; +const std::wstring NetherStalkTile::TEXTURE_NAMES[] = { L"netherStalk_0", L"netherStalk_1", L"netherStalk_2" }; NetherStalkTile::NetherStalkTile(int id) : Bush(id) { diff --git a/Minecraft.World/Blocks/NetherStalkTile.h b/Minecraft.World/Blocks/NetherStalkTile.h index 55e70d930..f6dd55e35 100644 --- a/Minecraft.World/Blocks/NetherStalkTile.h +++ b/Minecraft.World/Blocks/NetherStalkTile.h @@ -9,7 +9,7 @@ private: static const int MAX_AGE = 3; static const int NETHER_STALK_TEXTURE_COUNT = 3; - static const wstring TEXTURE_NAMES[]; + static const std::wstring TEXTURE_NAMES[]; Icon **icons; diff --git a/Minecraft.World/Blocks/PistonBaseTile.cpp b/Minecraft.World/Blocks/PistonBaseTile.cpp index d61a6d58b..043db0f16 100644 --- a/Minecraft.World/Blocks/PistonBaseTile.cpp +++ b/Minecraft.World/Blocks/PistonBaseTile.cpp @@ -11,11 +11,11 @@ #include "../Level/LevelChunk.h" #include "../Level/Dimensions/Dimension.h" -const wstring PistonBaseTile::EDGE_TEX = L"piston_side"; -const wstring PistonBaseTile::PLATFORM_TEX = L"piston_top"; -const wstring PistonBaseTile::PLATFORM_STICKY_TEX = L"piston_top_sticky"; -const wstring PistonBaseTile::BACK_TEX = L"piston_bottom"; -const wstring PistonBaseTile::INSIDE_TEX = L"piston_inner_top"; +const std::wstring PistonBaseTile::EDGE_TEX = L"piston_side"; +const std::wstring PistonBaseTile::PLATFORM_TEX = L"piston_top"; +const std::wstring PistonBaseTile::PLATFORM_STICKY_TEX = L"piston_top_sticky"; +const std::wstring PistonBaseTile::BACK_TEX = L"piston_bottom"; +const std::wstring PistonBaseTile::INSIDE_TEX = L"piston_inner_top"; const float PistonBaseTile::PLATFORM_THICKNESS = 4.0f; @@ -90,7 +90,7 @@ Icon *PistonBaseTile::getTexture(int face, int data) return icon; } -Icon *PistonBaseTile::getTexture(const wstring &name) +Icon *PistonBaseTile::getTexture(const std::wstring &name) { if (name.compare(EDGE_TEX) == 0) return Tile::pistonBase->icon; if (name.compare(PLATFORM_TEX) == 0) return Tile::pistonBase->iconPlatform; diff --git a/Minecraft.World/Blocks/PistonBaseTile.h b/Minecraft.World/Blocks/PistonBaseTile.h index c5127e8c2..9e5ca11e1 100644 --- a/Minecraft.World/Blocks/PistonBaseTile.h +++ b/Minecraft.World/Blocks/PistonBaseTile.h @@ -12,11 +12,11 @@ public: static const int TRIGGER_EXTEND = 0; static const int TRIGGER_CONTRACT = 1; - static const wstring EDGE_TEX; - static const wstring PLATFORM_TEX; - static const wstring PLATFORM_STICKY_TEX; - static const wstring BACK_TEX; - static const wstring INSIDE_TEX; + static const std::wstring EDGE_TEX; + static const std::wstring PLATFORM_TEX; + static const std::wstring PLATFORM_STICKY_TEX; + static const std::wstring BACK_TEX; + static const std::wstring INSIDE_TEX; private: bool isSticky; @@ -37,7 +37,7 @@ public: virtual void updateShape(float x0, float y0, float z0, float x1, float y1, float z1); virtual Icon *getTexture(int face, int data); - static Icon *getTexture(const wstring &name); + static Icon *getTexture(const std::wstring &name); void registerIcons(IconRegister *iconRegister); virtual int getRenderShape(); diff --git a/Minecraft.World/Blocks/PressurePlateTile.cpp b/Minecraft.World/Blocks/PressurePlateTile.cpp index 5262d17a9..5c21957a8 100644 --- a/Minecraft.World/Blocks/PressurePlateTile.cpp +++ b/Minecraft.World/Blocks/PressurePlateTile.cpp @@ -7,7 +7,7 @@ #include "PressurePlateTile.h" #include "../Util/SoundTypes.h" -PressurePlateTile::PressurePlateTile(int id, const wstring &tex, Material *material, Sensitivity sensitivity) : Tile(id, material, isSolidRender()) +PressurePlateTile::PressurePlateTile(int id, const std::wstring &tex, Material *material, Sensitivity sensitivity) : Tile(id, material, isSolidRender()) { this->sensitivity = sensitivity; this->setTicking(true); diff --git a/Minecraft.World/Blocks/PressurePlateTile.h b/Minecraft.World/Blocks/PressurePlateTile.h index 49780acbe..a6219feb2 100644 --- a/Minecraft.World/Blocks/PressurePlateTile.h +++ b/Minecraft.World/Blocks/PressurePlateTile.h @@ -8,7 +8,7 @@ class PressurePlateTile : public Tile { friend class Tile; private: - wstring texture; + std::wstring texture; public: enum Sensitivity { @@ -20,7 +20,7 @@ public: private: Sensitivity sensitivity; protected: - PressurePlateTile(int id, const wstring &tex, Material *material, Sensitivity sensitivity); + PressurePlateTile(int id, const std::wstring &tex, Material *material, Sensitivity sensitivity); public: virtual int getTickDelay(); virtual AABB *getAABB(Level *level, int x, int y, int z); diff --git a/Minecraft.World/Blocks/PumpkinTile.cpp b/Minecraft.World/Blocks/PumpkinTile.cpp index 41c5c3485..d41567b9b 100644 --- a/Minecraft.World/Blocks/PumpkinTile.cpp +++ b/Minecraft.World/Blocks/PumpkinTile.cpp @@ -8,8 +8,8 @@ #include "../Entities/Mobs/SnowMan.h" #include "../Entities/MobCategory.h" -const wstring PumpkinTile::TEXTURE_FACE = L"pumpkin_face"; -const wstring PumpkinTile::TEXTURE_LANTERN = L"pumpkin_jack"; +const std::wstring PumpkinTile::TEXTURE_FACE = L"pumpkin_face"; +const std::wstring PumpkinTile::TEXTURE_LANTERN = L"pumpkin_jack"; PumpkinTile::PumpkinTile(int id, bool lit) : DirectionalTile(id, Material::vegetable) { diff --git a/Minecraft.World/Blocks/PumpkinTile.h b/Minecraft.World/Blocks/PumpkinTile.h index 03e555695..5117c9c30 100644 --- a/Minecraft.World/Blocks/PumpkinTile.h +++ b/Minecraft.World/Blocks/PumpkinTile.h @@ -15,8 +15,8 @@ public: static const int DIR_EAST = 3; private: - static const wstring TEXTURE_FACE; - static const wstring TEXTURE_LANTERN; + static const std::wstring TEXTURE_FACE; + static const std::wstring TEXTURE_LANTERN; bool lit; Icon *iconTop; Icon *iconFace; diff --git a/Minecraft.World/Blocks/QuartzBlockTile.cpp b/Minecraft.World/Blocks/QuartzBlockTile.cpp index 553d97943..46628dbc6 100644 --- a/Minecraft.World/Blocks/QuartzBlockTile.cpp +++ b/Minecraft.World/Blocks/QuartzBlockTile.cpp @@ -12,11 +12,11 @@ int QuartzBlockTile::BLOCK_NAMES[QUARTZ_BLOCK_NAMES] = { IDS_TILE_QUARTZ_BLOCK, IDS_TILE_QUARTZ_BLOCK_CHISELED, IDS_TILE_QUARTZ_BLOCK_LINES, IDS_TILE_QUARTZ_BLOCK_LINES, IDS_TILE_QUARTZ_BLOCK_LINES }; -const wstring QuartzBlockTile::TEXTURE_TOP = L"quartzblock_top"; -const wstring QuartzBlockTile::TEXTURE_CHISELED_TOP = L"quartzblock_chiseled_top"; -const wstring QuartzBlockTile::TEXTURE_LINES_TOP = L"quartzblock_lines_top"; -const wstring QuartzBlockTile::TEXTURE_BOTTOM = L"quartzblock_bottom"; -const wstring QuartzBlockTile::TEXTURE_NAMES[QUARTZ_BLOCK_TEXTURES] = { L"quartzblock_side", L"quartzblock_chiseled", L"quartzblock_lines", L"", L""}; +const std::wstring QuartzBlockTile::TEXTURE_TOP = L"quartzblock_top"; +const std::wstring QuartzBlockTile::TEXTURE_CHISELED_TOP = L"quartzblock_chiseled_top"; +const std::wstring QuartzBlockTile::TEXTURE_LINES_TOP = L"quartzblock_lines_top"; +const std::wstring QuartzBlockTile::TEXTURE_BOTTOM = L"quartzblock_bottom"; +const std::wstring QuartzBlockTile::TEXTURE_NAMES[QUARTZ_BLOCK_TEXTURES] = { L"quartzblock_side", L"quartzblock_chiseled", L"quartzblock_lines", L"", L""}; QuartzBlockTile::QuartzBlockTile(int id) : Tile(id, Material::stone) { diff --git a/Minecraft.World/Blocks/QuartzBlockTile.h b/Minecraft.World/Blocks/QuartzBlockTile.h index d812e8a18..7a4e0719b 100644 --- a/Minecraft.World/Blocks/QuartzBlockTile.h +++ b/Minecraft.World/Blocks/QuartzBlockTile.h @@ -19,11 +19,11 @@ public: private: static const int QUARTZ_BLOCK_TEXTURES = 5; - static const wstring TEXTURE_TOP; - static const wstring TEXTURE_CHISELED_TOP; - static const wstring TEXTURE_LINES_TOP; - static const wstring TEXTURE_BOTTOM; - static const wstring TEXTURE_NAMES[QUARTZ_BLOCK_TEXTURES]; + static const std::wstring TEXTURE_TOP; + static const std::wstring TEXTURE_CHISELED_TOP; + static const std::wstring TEXTURE_LINES_TOP; + static const std::wstring TEXTURE_BOTTOM; + static const std::wstring TEXTURE_NAMES[QUARTZ_BLOCK_TEXTURES]; Icon *icons[QUARTZ_BLOCK_TEXTURES]; Icon *iconChiseledTop; diff --git a/Minecraft.World/Blocks/RedStoneDustTile.cpp b/Minecraft.World/Blocks/RedStoneDustTile.cpp index 2ae1efc05..630267dd4 100644 --- a/Minecraft.World/Blocks/RedStoneDustTile.cpp +++ b/Minecraft.World/Blocks/RedStoneDustTile.cpp @@ -11,10 +11,10 @@ #include "../IO/Streams/IntBuffer.h" #include "../../Minecraft.Client/Rendering/Tesselator.h" -const wstring RedStoneDustTile::TEXTURE_CROSS = L"redstoneDust_cross"; -const wstring RedStoneDustTile::TEXTURE_LINE = L"redstoneDust_line"; -const wstring RedStoneDustTile::TEXTURE_CROSS_OVERLAY = L"redstoneDust_cross_overlay"; -const wstring RedStoneDustTile::TEXTURE_LINE_OVERLAY = L"redstoneDust_line_overlay"; +const std::wstring RedStoneDustTile::TEXTURE_CROSS = L"redstoneDust_cross"; +const std::wstring RedStoneDustTile::TEXTURE_LINE = L"redstoneDust_line"; +const std::wstring RedStoneDustTile::TEXTURE_CROSS_OVERLAY = L"redstoneDust_cross_overlay"; +const std::wstring RedStoneDustTile::TEXTURE_LINE_OVERLAY = L"redstoneDust_line_overlay"; RedStoneDustTile::RedStoneDustTile(int id) : Tile(id, Material::decoration,isSolidRender()) { @@ -415,7 +415,7 @@ void RedStoneDustTile::registerIcons(IconRegister *iconRegister) icon = iconCross; } -Icon *RedStoneDustTile::getTexture(const wstring &name) +Icon *RedStoneDustTile::getTexture(const std::wstring &name) { #ifdef __PSVITA__ // AP - alpha cut out is expensive on vita. Set the Alpha Cut out flag diff --git a/Minecraft.World/Blocks/RedStoneDustTile.h b/Minecraft.World/Blocks/RedStoneDustTile.h index 5c262f988..12a1bca64 100644 --- a/Minecraft.World/Blocks/RedStoneDustTile.h +++ b/Minecraft.World/Blocks/RedStoneDustTile.h @@ -11,10 +11,10 @@ class RedStoneDustTile : public Tile { friend ChunkRebuildData; public: - static const wstring TEXTURE_CROSS; - static const wstring TEXTURE_LINE; - static const wstring TEXTURE_CROSS_OVERLAY; - static const wstring TEXTURE_LINE_OVERLAY; + static const std::wstring TEXTURE_CROSS; + static const std::wstring TEXTURE_LINE; + static const std::wstring TEXTURE_CROSS_OVERLAY; + static const std::wstring TEXTURE_LINE_OVERLAY; private: bool shouldSignal; unordered_set toUpdate; @@ -57,5 +57,5 @@ public: virtual int cloneTileId(Level *level, int x, int y, int z); void registerIcons(IconRegister *iconRegister); - static Icon *getTexture(const wstring &name); + static Icon *getTexture(const std::wstring &name); }; diff --git a/Minecraft.World/Blocks/SandStoneTile.cpp b/Minecraft.World/Blocks/SandStoneTile.cpp index 5ff288fa1..c4436d32d 100644 --- a/Minecraft.World/Blocks/SandStoneTile.cpp +++ b/Minecraft.World/Blocks/SandStoneTile.cpp @@ -4,9 +4,9 @@ #include "../Headers/net.minecraft.world.h" #include "SandStoneTile.h" -const wstring SandStoneTile::TEXTURE_TOP = L"sandstone_top"; -const wstring SandStoneTile::TEXTURE_BOTTOM = L"sandstone_bottom"; -const wstring SandStoneTile::TEXTURE_NAMES[] = {L"sandstone_side", L"sandstone_carved", L"sandstone_smooth"}; +const std::wstring SandStoneTile::TEXTURE_TOP = L"sandstone_top"; +const std::wstring SandStoneTile::TEXTURE_BOTTOM = L"sandstone_bottom"; +const std::wstring SandStoneTile::TEXTURE_NAMES[] = {L"sandstone_side", L"sandstone_carved", L"sandstone_smooth"}; int SandStoneTile::SANDSTONE_NAMES[SANDSTONE_BLOCK_NAMES] = { IDS_TILE_SANDSTONE, IDS_TILE_SANDSTONE_CHISELED, IDS_TILE_SANDSTONE_SMOOTH diff --git a/Minecraft.World/Blocks/SandStoneTile.h b/Minecraft.World/Blocks/SandStoneTile.h index ac6f9ff78..247d15339 100644 --- a/Minecraft.World/Blocks/SandStoneTile.h +++ b/Minecraft.World/Blocks/SandStoneTile.h @@ -20,9 +20,9 @@ public: static int SANDSTONE_NAMES[SANDSTONE_BLOCK_NAMES]; private: - static const wstring TEXTURE_TOP; - static const wstring TEXTURE_BOTTOM; - static const wstring TEXTURE_NAMES[]; + static const std::wstring TEXTURE_TOP; + static const std::wstring TEXTURE_BOTTOM; + static const std::wstring TEXTURE_NAMES[]; static const int SANDSTONE_TILE_TEXTURE_COUNT = 3; Icon **icons; diff --git a/Minecraft.World/Blocks/SaplingPlantTile.cpp b/Minecraft.World/Blocks/SaplingPlantTile.cpp index 13e348201..16ed8c322 100644 --- a/Minecraft.World/Blocks/SaplingPlantTile.cpp +++ b/Minecraft.World/Blocks/SaplingPlantTile.cpp @@ -12,7 +12,7 @@ const unsigned int Sapling::SAPLING_NAMES[SAPLING_NAMES_SIZE] = { IDS_TILE_SAPLI IDS_TILE_SAPLING_JUNGLE }; -const wstring Sapling::TEXTURE_NAMES[] = {L"sapling", L"sapling_spruce", L"sapling_birch", L"sapling_jungle"}; +const std::wstring Sapling::TEXTURE_NAMES[] = {L"sapling", L"sapling_spruce", L"sapling_birch", L"sapling_jungle"}; Sapling::Sapling(int id) : Bush( id ) { diff --git a/Minecraft.World/Blocks/SaplingPlantTile.h b/Minecraft.World/Blocks/SaplingPlantTile.h index 1d3e267b3..3996b6be9 100644 --- a/Minecraft.World/Blocks/SaplingPlantTile.h +++ b/Minecraft.World/Blocks/SaplingPlantTile.h @@ -21,7 +21,7 @@ public: static const unsigned int SAPLING_NAMES[SAPLING_NAMES_SIZE]; private: - static const wstring TEXTURE_NAMES[]; + static const std::wstring TEXTURE_NAMES[]; Icon **icons; diff --git a/Minecraft.World/Blocks/SkullTile.cpp b/Minecraft.World/Blocks/SkullTile.cpp index 59c6f9c0f..0f0a7e03a 100644 --- a/Minecraft.World/Blocks/SkullTile.cpp +++ b/Minecraft.World/Blocks/SkullTile.cpp @@ -263,7 +263,7 @@ Icon *SkullTile::getTexture(int face, int data) return Tile::hellSand->getTexture(face); } -wstring SkullTile::getTileItemIconName() +std::wstring SkullTile::getTileItemIconName() { return L""; //return SkullItem::ICON_NAMES[0]; diff --git a/Minecraft.World/Blocks/SkullTile.h b/Minecraft.World/Blocks/SkullTile.h index eef309a0c..3a2ece7b6 100644 --- a/Minecraft.World/Blocks/SkullTile.h +++ b/Minecraft.World/Blocks/SkullTile.h @@ -40,5 +40,5 @@ private: public: void registerIcons(IconRegister *iconRegister); Icon *getTexture(int face, int data); - wstring getTileItemIconName(); + std::wstring getTileItemIconName(); }; diff --git a/Minecraft.World/Blocks/SmoothStoneBrickTile.cpp b/Minecraft.World/Blocks/SmoothStoneBrickTile.cpp index ae12b20fb..068e7b99f 100644 --- a/Minecraft.World/Blocks/SmoothStoneBrickTile.cpp +++ b/Minecraft.World/Blocks/SmoothStoneBrickTile.cpp @@ -2,7 +2,7 @@ #include "SmoothStoneBrickTile.h" #include "../Headers/net.minecraft.world.h" -const wstring SmoothStoneBrickTile::TEXTURE_NAMES[] = {L"stonebricksmooth", L"stonebricksmooth_mossy", L"stonebricksmooth_cracked", L"stonebricksmooth_carved"}; +const std::wstring SmoothStoneBrickTile::TEXTURE_NAMES[] = {L"stonebricksmooth", L"stonebricksmooth_mossy", L"stonebricksmooth_cracked", L"stonebricksmooth_carved"}; const unsigned int SmoothStoneBrickTile::SMOOTH_STONE_BRICK_NAMES[SMOOTH_STONE_BRICK_NAMES_LENGTH] = { IDS_TILE_STONE_BRICK_SMOOTH, IDS_TILE_STONE_BRICK_SMOOTH_MOSSY, diff --git a/Minecraft.World/Blocks/SmoothStoneBrickTile.h b/Minecraft.World/Blocks/SmoothStoneBrickTile.h index 1464c6daf..915e74b35 100644 --- a/Minecraft.World/Blocks/SmoothStoneBrickTile.h +++ b/Minecraft.World/Blocks/SmoothStoneBrickTile.h @@ -11,7 +11,7 @@ public: static const int TYPE_CRACKED = 2; static const int TYPE_DETAIL = 3; - static const wstring TEXTURE_NAMES[]; + static const std::wstring TEXTURE_NAMES[]; static const int SMOOTH_STONE_BRICK_NAMES_LENGTH = 4; diff --git a/Minecraft.World/Blocks/StemTile.cpp b/Minecraft.World/Blocks/StemTile.cpp index 9d3544e82..5f83ab3d7 100644 --- a/Minecraft.World/Blocks/StemTile.cpp +++ b/Minecraft.World/Blocks/StemTile.cpp @@ -7,7 +7,7 @@ #include "../../Minecraft.Client/Build/Common/Colours/ColourTable.h" #include "StemTile.h" -const wstring StemTile::TEXTURE_ANGLED = L"stem_bent"; +const std::wstring StemTile::TEXTURE_ANGLED = L"stem_bent"; StemTile::StemTile(int id, Tile *fruit) : Bush(id) { diff --git a/Minecraft.World/Blocks/StemTile.h b/Minecraft.World/Blocks/StemTile.h index c4b4f87a4..bc2b34894 100644 --- a/Minecraft.World/Blocks/StemTile.h +++ b/Minecraft.World/Blocks/StemTile.h @@ -7,7 +7,7 @@ class StemTile : public Bush { friend class ChunkRebuildData; public: - static const wstring TEXTURE_ANGLED; + static const std::wstring TEXTURE_ANGLED; private: Tile *fruit; diff --git a/Minecraft.World/Blocks/TallGrassPlantTile.cpp b/Minecraft.World/Blocks/TallGrassPlantTile.cpp index daf5efac6..01f2a8033 100644 --- a/Minecraft.World/Blocks/TallGrassPlantTile.cpp +++ b/Minecraft.World/Blocks/TallGrassPlantTile.cpp @@ -12,7 +12,7 @@ const unsigned int TallGrass::TALL_GRASS_TILE_NAMES[TALL_GRASS_TILE_NAMES_LENGTH IDS_TILE_FERN, }; -const wstring TallGrass::TEXTURE_NAMES[] = {L"deadbush", L"tallgrass", L"fern"}; +const std::wstring TallGrass::TEXTURE_NAMES[] = {L"deadbush", L"tallgrass", L"fern"}; TallGrass::TallGrass(int id) : Bush(id, Material::replaceable_plant) { diff --git a/Minecraft.World/Blocks/TallGrassPlantTile.h b/Minecraft.World/Blocks/TallGrassPlantTile.h index 3af76cabc..786132a45 100644 --- a/Minecraft.World/Blocks/TallGrassPlantTile.h +++ b/Minecraft.World/Blocks/TallGrassPlantTile.h @@ -17,7 +17,7 @@ public: static const unsigned int TALL_GRASS_TILE_NAMES[TALL_GRASS_TILE_NAMES_LENGTH]; private: - static const wstring TEXTURE_NAMES[]; + static const std::wstring TEXTURE_NAMES[]; Icon **icons; protected: diff --git a/Minecraft.World/Blocks/TheEndPortalFrameTile.cpp b/Minecraft.World/Blocks/TheEndPortalFrameTile.cpp index 5a266f11f..86ccd7130 100644 --- a/Minecraft.World/Blocks/TheEndPortalFrameTile.cpp +++ b/Minecraft.World/Blocks/TheEndPortalFrameTile.cpp @@ -4,7 +4,7 @@ #include "../Headers/net.minecraft.world.h" #include "../Util/Facing.h" -const wstring TheEndPortalFrameTile::TEXTURE_EYE = L"endframe_eye"; +const std::wstring TheEndPortalFrameTile::TEXTURE_EYE = L"endframe_eye"; TheEndPortalFrameTile::TheEndPortalFrameTile(int id) : Tile(id, Material::glass, isSolidRender() ) { diff --git a/Minecraft.World/Blocks/TheEndPortalFrameTile.h b/Minecraft.World/Blocks/TheEndPortalFrameTile.h index bedad14d5..ab3180ef3 100644 --- a/Minecraft.World/Blocks/TheEndPortalFrameTile.h +++ b/Minecraft.World/Blocks/TheEndPortalFrameTile.h @@ -5,7 +5,7 @@ class TheEndPortalFrameTile : public Tile { public: static const int EYE_BIT = 4; - static const wstring TEXTURE_EYE; + static const std::wstring TEXTURE_EYE; private: Icon *iconTop; diff --git a/Minecraft.World/Blocks/ThinFenceTile.cpp b/Minecraft.World/Blocks/ThinFenceTile.cpp index 697338e2d..deb687c01 100644 --- a/Minecraft.World/Blocks/ThinFenceTile.cpp +++ b/Minecraft.World/Blocks/ThinFenceTile.cpp @@ -3,7 +3,7 @@ #include "../Headers/net.minecraft.world.level.h" #include "../Headers/net.minecraft.world.h" -ThinFenceTile::ThinFenceTile(int id, const wstring &tex, const wstring &edgeTex, Material *material, bool dropsResources) : Tile(id, material,isSolidRender()) +ThinFenceTile::ThinFenceTile(int id, const std::wstring &tex, const std::wstring &edgeTex, Material *material, bool dropsResources) : Tile(id, material,isSolidRender()) { iconSide = NULL; edgeTexture = edgeTex; diff --git a/Minecraft.World/Blocks/ThinFenceTile.h b/Minecraft.World/Blocks/ThinFenceTile.h index 0f1c3bfa1..7c39cabff 100644 --- a/Minecraft.World/Blocks/ThinFenceTile.h +++ b/Minecraft.World/Blocks/ThinFenceTile.h @@ -5,13 +5,13 @@ class ThinFenceTile : public Tile { private: - wstring edgeTexture; + std::wstring edgeTexture; bool dropsResources; - wstring texture; + std::wstring texture; Icon *iconSide; public: - ThinFenceTile(int id, const wstring &tex, const wstring &edgeTex, Material *material, bool dropsResources); + ThinFenceTile(int id, const std::wstring &tex, const std::wstring &edgeTex, Material *material, bool dropsResources); virtual int getResource(int data, Random *random, int playerBonusLevel); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); diff --git a/Minecraft.World/Blocks/Tile.cpp b/Minecraft.World/Blocks/Tile.cpp index e80d0637c..60d6fb77f 100644 --- a/Minecraft.World/Blocks/Tile.cpp +++ b/Minecraft.World/Blocks/Tile.cpp @@ -16,7 +16,7 @@ #include "../Headers/net.minecraft.h" #include "Tile.h" -wstring Tile::TILE_DESCRIPTION_PREFIX = L"Tile."; +std::wstring Tile::TILE_DESCRIPTION_PREFIX = L"Tile."; const float Tile::INDESTRUCTIBLE_DESTROY_TIME = -1.0f; @@ -1260,7 +1260,7 @@ Tile *Tile::setDescriptionId(unsigned int id) return this; } -wstring Tile::getName() +std::wstring Tile::getName() { return L"";//I18n::get(getDescriptionId() + L".name"); } @@ -1342,12 +1342,12 @@ void Tile::registerIcons(IconRegister *iconRegister) icon = iconRegister->registerIcon(m_textureName); } -wstring Tile::getTileItemIconName() +std::wstring Tile::getTileItemIconName() { return L""; } -Tile *Tile::setTextureName(const wstring &name) +Tile *Tile::setTextureName(const std::wstring &name) { m_textureName = name; return this; @@ -1461,8 +1461,8 @@ float Tile::SoundType::getPitch() const { return pitch; } -//wstring getBreakSound() const { return breakSound; } -//wstring getStepSound() const { return stepSound; } +//std::wstring getBreakSound() const { return breakSound; } +//std::wstring getStepSound() const { return stepSound; } int Tile::SoundType::getBreakSound() const { return iBreakSound; diff --git a/Minecraft.World/Blocks/Tile.h b/Minecraft.World/Blocks/Tile.h index 7d93d6bbb..08a1f6b61 100644 --- a/Minecraft.World/Blocks/Tile.h +++ b/Minecraft.World/Blocks/Tile.h @@ -69,7 +69,7 @@ public: private: // 4J Stu - Was const but had to change it so that we can initialise it in TileStaticInit - static wstring TILE_DESCRIPTION_PREFIX; + static std::wstring TILE_DESCRIPTION_PREFIX; protected: static const float INDESTRUCTIBLE_DESTROY_TIME; @@ -78,9 +78,9 @@ public: class SoundType { public: -// wstring name; -// wstring breakSound; -// wstring stepSound; +// std::wstring name; +// std::wstring breakSound; +// std::wstring stepSound; eMATERIALSOUND_TYPE eMaterialSound; int iBreakSound,iStepSound,iPlaceSound; float volume; @@ -90,8 +90,8 @@ public: float getVolume() const; float getPitch() const; - //wstring getBreakSound() const { return breakSound; } - //wstring getStepSound() const { return stepSound; } + //std::wstring getBreakSound() const { return breakSound; } + //std::wstring getStepSound() const { return stepSound; } int getBreakSound() const; int getStepSound() const; int getPlaceSound() const; @@ -498,7 +498,7 @@ private: unsigned int descriptionId; unsigned int useDescriptionId; // 4J Added - wstring m_textureName; + std::wstring m_textureName; protected: Icon *icon; @@ -615,7 +615,7 @@ public: virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual void finalizePlacement(Level *level, int x, int y, int z, int data); virtual Tile *setDescriptionId(unsigned int id); - virtual wstring getName(); + virtual std::wstring getName(); virtual unsigned int getDescriptionId(int iData = -1); virtual Tile *setUseDescriptionId(unsigned int id); // 4J Added virtual unsigned int getUseDescriptionId(); // 4J Added @@ -638,9 +638,9 @@ public: virtual void handleRain(Level *level, int x, int y, int z); virtual void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); virtual void registerIcons(IconRegister *iconRegister); - virtual wstring getTileItemIconName(); + virtual std::wstring getTileItemIconName(); // 4J Using per-item textures now - Tile *setTextureName(const wstring &name); + Tile *setTextureName(const std::wstring &name); // AP - added this function so we can generate the faceFlags for a block in a single fast function int getFaceFlags(LevelSource *level, int x, int y, int z); }; diff --git a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp index 9142bebf8..33c173dc5 100644 --- a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp @@ -35,12 +35,12 @@ MobSpawnerTileEntity::MobSpawnerTileEntity() : TileEntity() displayEntity = nullptr; } -wstring MobSpawnerTileEntity::getEntityId() +std::wstring MobSpawnerTileEntity::getEntityId() { return entityId; } -void MobSpawnerTileEntity::setEntityId(const wstring& entityId) +void MobSpawnerTileEntity::setEntityId(const std::wstring& entityId) { this->entityId = entityId; } diff --git a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h b/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h index 61c69d3ef..88aae9314 100644 --- a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h +++ b/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.h @@ -21,7 +21,7 @@ public: int spawnDelay; private: - wstring entityId; + std::wstring entityId; CompoundTag *spawnData; bool m_bEntityIdUpdated; // 4J Added @@ -38,8 +38,8 @@ private: public: MobSpawnerTileEntity(); - wstring getEntityId(); - void setEntityId(const wstring& entityId); + std::wstring getEntityId(); + void setEntityId(const std::wstring& entityId); bool isNearPlayer(); virtual void tick(); void fillExtraData(std::shared_ptr entity); diff --git a/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp b/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp index b72ee7fb1..6103a6ada 100644 --- a/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp +++ b/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp @@ -65,34 +65,34 @@ const int PotionBrewing::DEFAULT_APPEARANCES[] = * Therefore if bit 13 is on, don't use netherwart! * Added "&!13" which requires that bit 13 be turned off. */ -const wstring PotionBrewing::MOD_NETHERWART = L"+4&!13"; // L"+4" +const std::wstring PotionBrewing::MOD_NETHERWART = L"+4&!13"; // L"+4" #if _SIMPLIFIED_BREWING -const wstring PotionBrewing::MOD_WATER = L""; -const wstring PotionBrewing::MOD_SUGAR = L"-0+1-2-3&4-4+13"; -const wstring PotionBrewing::MOD_GHASTTEARS = L"+0-1-2-3&4-4+13"; -const wstring PotionBrewing::MOD_SPIDEREYE = L"-0-1+2-3&4-4+13"; -const wstring PotionBrewing::MOD_FERMENTEDEYE = L"-0+3-4+13"; -const wstring PotionBrewing::MOD_SPECKLEDMELON = L"+0-1+2-3&4-4+13"; -const wstring PotionBrewing::MOD_BLAZEPOWDER = L"+0-1-2+3&4-4+13"; -const wstring PotionBrewing::MOD_GOLDENCARROT = L"-0+1+2-3+13&4-4"; -const wstring PotionBrewing::MOD_MAGMACREAM = L"+0+1-2-3&4-4+13"; -const wstring PotionBrewing::MOD_REDSTONE = L"-5+6-7"; // redstone increases duration -const wstring PotionBrewing::MOD_GLOWSTONE = L"+5-6-7"; // glowstone increases amplification +const std::wstring PotionBrewing::MOD_WATER = L""; +const std::wstring PotionBrewing::MOD_SUGAR = L"-0+1-2-3&4-4+13"; +const std::wstring PotionBrewing::MOD_GHASTTEARS = L"+0-1-2-3&4-4+13"; +const std::wstring PotionBrewing::MOD_SPIDEREYE = L"-0-1+2-3&4-4+13"; +const std::wstring PotionBrewing::MOD_FERMENTEDEYE = L"-0+3-4+13"; +const std::wstring PotionBrewing::MOD_SPECKLEDMELON = L"+0-1+2-3&4-4+13"; +const std::wstring PotionBrewing::MOD_BLAZEPOWDER = L"+0-1-2+3&4-4+13"; +const std::wstring PotionBrewing::MOD_GOLDENCARROT = L"-0+1+2-3+13&4-4"; +const std::wstring PotionBrewing::MOD_MAGMACREAM = L"+0+1-2-3&4-4+13"; +const std::wstring PotionBrewing::MOD_REDSTONE = L"-5+6-7"; // redstone increases duration +const std::wstring PotionBrewing::MOD_GLOWSTONE = L"+5-6-7"; // glowstone increases amplification // 4J Stu - Don't require bit 13 to be set. We don't use it in the creative menu. Side effect is you can make a (virtually useless) Splash Mundane potion with water bottle and gunpowder -const wstring PotionBrewing::MOD_GUNPOWDER = L"+14";//&13-13"; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 +const std::wstring PotionBrewing::MOD_GUNPOWDER = L"+14";//&13-13"; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 #else -const wstring PotionBrewing::MOD_WATER = L"-1-3-5-7-9-11-13"; -const wstring PotionBrewing::MOD_SUGAR = L"+0"; -const wstring PotionBrewing::MOD_GHASTTEARS = L"+11"; -const wstring PotionBrewing::MOD_SPIDEREYE = L"+10+7+5"; -const wstring PotionBrewing::MOD_FERMENTEDEYE = L"+14+9"; -const wstring PotionBrewing::MOD_SPECKLEDMELON = L""; -const wstring PotionBrewing::MOD_BLAZEPOWDER = L"+14"; -const wstring PotionBrewing::MOD_MAGMACREAM = L"+14+6+1"; -const wstring PotionBrewing::MOD_REDSTONE = L""; // redstone increases duration -const wstring PotionBrewing::MOD_GLOWSTONE = L""; // glowstone increases amplification -const wstring PotionBrewing::MOD_GUNPOWDER = L""; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 +const std::wstring PotionBrewing::MOD_WATER = L"-1-3-5-7-9-11-13"; +const std::wstring PotionBrewing::MOD_SUGAR = L"+0"; +const std::wstring PotionBrewing::MOD_GHASTTEARS = L"+11"; +const std::wstring PotionBrewing::MOD_SPIDEREYE = L"+10+7+5"; +const std::wstring PotionBrewing::MOD_FERMENTEDEYE = L"+14+9"; +const std::wstring PotionBrewing::MOD_SPECKLEDMELON = L""; +const std::wstring PotionBrewing::MOD_BLAZEPOWDER = L"+14"; +const std::wstring PotionBrewing::MOD_MAGMACREAM = L"+14+6+1"; +const std::wstring PotionBrewing::MOD_REDSTONE = L""; // redstone increases duration +const std::wstring PotionBrewing::MOD_GLOWSTONE = L""; // glowstone increases amplification +const std::wstring PotionBrewing::MOD_GUNPOWDER = L""; // gunpowder makes them throwable! // gunpowder requires 13 and sets 14 #endif PotionBrewing::intStringMap PotionBrewing::potionEffectDuration; @@ -309,7 +309,7 @@ int PotionBrewing::countOnes(int brew) #if _SIMPLIFIED_BREWING // 4J Stu - Trimmed this function to remove all the unused features for simplified brewing -int PotionBrewing::parseEffectFormulaValue(const wstring &definition, int start, int end, int brew) +int PotionBrewing::parseEffectFormulaValue(const std::wstring &definition, int start, int end, int brew) { if (start >= definition.length() || end < 0 || start >= end) { @@ -397,7 +397,7 @@ int PotionBrewing::parseEffectFormulaValue(const wstring &definition, int start, return result; } #else -int PotionBrewing::parseEffectFormulaValue(const wstring &definition, int start, int end, int brew) +int PotionBrewing::parseEffectFormulaValue(const std::wstring &definition, int start, int end, int brew) { if (start >= definition.length() || end < 0 || start >= end) { @@ -554,13 +554,13 @@ vector *PotionBrewing::getEffects(int brew, bool includeDis { continue; } - //wstring durationString = potionEffectDuration.get(effect->getId()); + //std::wstring durationString = potionEffectDuration.get(effect->getId()); AUTO_VAR(effIt, potionEffectDuration.find(effect->getId())); if ( effIt == potionEffectDuration.end() ) { continue; } - wstring durationString = effIt->second; + std::wstring durationString = effIt->second; int duration = parseEffectFormulaValue(durationString, 0, (int)durationString.length(), brew); if (duration > 0) @@ -569,7 +569,7 @@ vector *PotionBrewing::getEffects(int brew, bool includeDis AUTO_VAR(ampIt, potionEffectAmplifier.find(effect->getId())); if (ampIt != potionEffectAmplifier.end()) { - wstring amplifierString = ampIt->second; + std::wstring amplifierString = ampIt->second; amplifier = parseEffectFormulaValue(amplifierString, 0, (int)amplifierString.length(), brew); if (amplifier < 0) { @@ -742,7 +742,7 @@ int PotionBrewing::applyBrewBit(int currentBrew, int bit, bool isNeg, bool isNot return currentBrew; } -int PotionBrewing::applyBrew(int currentBrew, const wstring &formula) +int PotionBrewing::applyBrew(int currentBrew, const std::wstring &formula) { int start = 0; @@ -831,9 +831,9 @@ int PotionBrewing::valueOf(int brew, int p1, int p2, int p3, int p4, int p5) return (isLit(brew, p1) ? 0x10 : 0) | (isLit(brew, p2) ? 0x08 : 0) | (isLit(brew, p3) ? 0x04 : 0) | (isLit(brew, p4) ? 0x02 : 0) | (isLit(brew, p5) ? 0x01 : 0); } -wstring PotionBrewing::toString(int brew) +std::wstring PotionBrewing::toString(int brew) { - wstring string; + std::wstring string; int bit = NUM_BITS - 1; while (bit >= 0) diff --git a/Minecraft.World/Blocks/TileEntities/PotionBrewing.h b/Minecraft.World/Blocks/TileEntities/PotionBrewing.h index 6f0197e6b..e06742ff1 100644 --- a/Minecraft.World/Blocks/TileEntities/PotionBrewing.h +++ b/Minecraft.World/Blocks/TileEntities/PotionBrewing.h @@ -14,22 +14,22 @@ public: static const int THROWABLE_BIT = 14; static const int THROWABLE_MASK = (1 << THROWABLE_BIT); - static const wstring MOD_WATER; - static const wstring MOD_SUGAR; - static const wstring MOD_GHASTTEARS; - static const wstring MOD_SPIDEREYE; - static const wstring MOD_FERMENTEDEYE; - static const wstring MOD_SPECKLEDMELON; - static const wstring MOD_BLAZEPOWDER; - static const wstring MOD_MAGMACREAM; - static const wstring MOD_REDSTONE; - static const wstring MOD_GLOWSTONE; - static const wstring MOD_NETHERWART; - static const wstring MOD_GUNPOWDER; - static const wstring MOD_GOLDENCARROT; + static const std::wstring MOD_WATER; + static const std::wstring MOD_SUGAR; + static const std::wstring MOD_GHASTTEARS; + static const std::wstring MOD_SPIDEREYE; + static const std::wstring MOD_FERMENTEDEYE; + static const std::wstring MOD_SPECKLEDMELON; + static const std::wstring MOD_BLAZEPOWDER; + static const std::wstring MOD_MAGMACREAM; + static const std::wstring MOD_REDSTONE; + static const std::wstring MOD_GLOWSTONE; + static const std::wstring MOD_NETHERWART; + static const std::wstring MOD_GUNPOWDER; + static const std::wstring MOD_GOLDENCARROT; private: - typedef std::unordered_map intStringMap; + typedef std::unordered_map intStringMap; static intStringMap potionEffectDuration; static intStringMap potionEffectAmplifier; @@ -77,7 +77,7 @@ private: static int constructParsedValue(bool isNot, bool hasMultiplier, bool isNeg, int countCompare, int valuePart, int multiplierPart, int brew); static int countOnes(int brew); - static int parseEffectFormulaValue(const wstring &definition, int start, int end, int brew); + static int parseEffectFormulaValue(const std::wstring &definition, int start, int end, int brew); public: static vector *getEffects(int brew, bool includeDisabledEffects); @@ -92,10 +92,10 @@ private: static int applyBrewBit(int currentBrew, int bit, bool isNeg, bool isNot, bool isRequired); public: - static int applyBrew(int currentBrew, const wstring &formula); + static int applyBrew(int currentBrew, const std::wstring &formula); static int setBit(int brew, int position, bool onOff); static int valueOf(int brew, int p1, int p2, int p3, int p4); static int valueOf(int brew, int p1, int p2, int p3, int p4, int p5); - static wstring toString(int brew); + static std::wstring toString(int brew); //static void main(String[] args); }; \ No newline at end of file diff --git a/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp index f8ae04c9a..a62b298ca 100644 --- a/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp @@ -86,7 +86,7 @@ void SignTileEntity::load(CompoundTag *tag) std::shared_ptr SignTileEntity::getUpdatePacket() { - wstring copy[MAX_SIGN_LINES]; + std::wstring copy[MAX_SIGN_LINES]; for (int i = 0; i < MAX_SIGN_LINES; i++) { copy[i] = m_wsmessages[i]; @@ -149,7 +149,7 @@ void SignTileEntity::setChanged() } -void SignTileEntity::SetMessage(int iIndex,wstring &wsText) +void SignTileEntity::SetMessage(int iIndex,std::wstring &wsText) { m_wsmessages[iIndex]=wsText; diff --git a/Minecraft.World/Blocks/TileEntities/SignTileEntity.h b/Minecraft.World/Blocks/TileEntities/SignTileEntity.h index 8713c6272..6329c6eca 100644 --- a/Minecraft.World/Blocks/TileEntities/SignTileEntity.h +++ b/Minecraft.World/Blocks/TileEntities/SignTileEntity.h @@ -16,9 +16,9 @@ public: public: SignTileEntity(); virtual ~SignTileEntity(); - wstring GetMessage(int i) { return m_wsmessages[i];} - wstring *GetMessages() { return m_wsmessages;} - void SetMessage(int iIndex,wstring &wsText); + std::wstring GetMessage(int i) { return m_wsmessages[i];} + std::wstring *GetMessages() { return m_wsmessages;} + void SetMessage(int iIndex,std::wstring &wsText); int GetSelectedLine() {return m_iSelectedLine;} void SetSelectedLine(int iLine) {m_iSelectedLine=iLine;} bool IsVerified() {return m_bVerified;} @@ -33,7 +33,7 @@ private: bool m_bCensored; int m_iSelectedLine; - wstring m_wsmessages[MAX_SIGN_LINES]; + std::wstring m_wsmessages[MAX_SIGN_LINES]; public: virtual void save(CompoundTag *tag); diff --git a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp index 7c7550a84..abe43de6c 100644 --- a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/SkullTileEntity.cpp @@ -33,7 +33,7 @@ std::shared_ptr SkullTileEntity::getUpdatePacket() return std::shared_ptr(new TileEntityDataPacket(x, y, z, TileEntityDataPacket::TYPE_SKULL, tag)); } -void SkullTileEntity::setSkullType(int skullType, const wstring &extra) +void SkullTileEntity::setSkullType(int skullType, const std::wstring &extra) { this->skullType = skullType; this->extraType = extra; @@ -54,7 +54,7 @@ void SkullTileEntity::setRotation(int rot) rotation = rot; } -wstring SkullTileEntity::getExtraType() +std::wstring SkullTileEntity::getExtraType() { return extraType; } diff --git a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.h b/Minecraft.World/Blocks/TileEntities/SkullTileEntity.h index db1580fa0..51b9d5e77 100644 --- a/Minecraft.World/Blocks/TileEntities/SkullTileEntity.h +++ b/Minecraft.World/Blocks/TileEntities/SkullTileEntity.h @@ -17,7 +17,7 @@ public: private: int skullType; int rotation; - wstring extraType; + std::wstring extraType; public: SkullTileEntity(); @@ -25,11 +25,11 @@ public: void save(CompoundTag *tag); void load(CompoundTag *tag); std::shared_ptr getUpdatePacket(); - void setSkullType(int skullType, const wstring &extra); + void setSkullType(int skullType, const std::wstring &extra); int getSkullType(); int getRotation(); void setRotation(int rot); - wstring getExtraType(); + std::wstring getExtraType(); // 4J Added virtual std::shared_ptr clone(); diff --git a/Minecraft.World/Blocks/TileEntities/TileEntity.cpp b/Minecraft.World/Blocks/TileEntities/TileEntity.cpp index 7e01678c4..a47215476 100644 --- a/Minecraft.World/Blocks/TileEntities/TileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/TileEntity.cpp @@ -8,8 +8,8 @@ -TileEntity::idToCreateMapType TileEntity::idCreateMap = std::unordered_map(); -TileEntity::classToIdMapType TileEntity::classIdMap = std::unordered_map(); +TileEntity::idToCreateMapType TileEntity::idCreateMap = std::unordered_map(); +TileEntity::classToIdMapType TileEntity::classIdMap = std::unordered_map(); void TileEntity::staticCtor() { @@ -28,7 +28,7 @@ void TileEntity::staticCtor() TileEntity::setId(SkullTileEntity::create,eTYPE_SKULLTILEENTITY, L"Skull"); } -void TileEntity::setId(tileEntityCreateFn createFn, eINSTANCEOF clas, wstring id) +void TileEntity::setId(tileEntityCreateFn createFn, eINSTANCEOF clas, std::wstring id) { // 4J Stu - Java has classIdMap.containsKey(id) which would never work as id is not of the type of the key in classIdMap // I have changed to use idClassMap instead so that we can still search from the string key diff --git a/Minecraft.World/Blocks/TileEntities/TileEntity.h b/Minecraft.World/Blocks/TileEntities/TileEntity.h index 4833f2910..65544407e 100644 --- a/Minecraft.World/Blocks/TileEntities/TileEntity.h +++ b/Minecraft.World/Blocks/TileEntities/TileEntity.h @@ -16,11 +16,11 @@ public: static void staticCtor(); virtual eINSTANCEOF GetType() { return eTYPE_TILEENTITY; } private: - typedef std::unordered_map idToCreateMapType; - typedef std::unordered_map classToIdMapType; + typedef std::unordered_map idToCreateMapType; + typedef std::unordered_map classToIdMapType; static idToCreateMapType idCreateMap; static classToIdMapType classIdMap; - static void setId(tileEntityCreateFn createFn, eINSTANCEOF clas, wstring id); + static void setId(tileEntityCreateFn createFn, eINSTANCEOF clas, std::wstring id); bool remove; unsigned char renderRemoveStage; // 4J added diff --git a/Minecraft.World/Blocks/TreeTile.cpp b/Minecraft.World/Blocks/TreeTile.cpp index 935520686..682fcd974 100644 --- a/Minecraft.World/Blocks/TreeTile.cpp +++ b/Minecraft.World/Blocks/TreeTile.cpp @@ -13,7 +13,7 @@ const unsigned int TreeTile::TREE_NAMES[TREE_NAMES_LENGTH] = { IDS_TILE_LOG_OAK, IDS_TILE_LOG_JUNGLE }; -const wstring TreeTile::TREE_TEXTURES[] = {L"tree_side", L"tree_spruce", L"tree_birch", L"tree_jungle"}; +const std::wstring TreeTile::TREE_TEXTURES[] = {L"tree_side", L"tree_spruce", L"tree_birch", L"tree_jungle"}; TreeTile::TreeTile(int id) : Tile(id, Material::wood) { diff --git a/Minecraft.World/Blocks/TreeTile.h b/Minecraft.World/Blocks/TreeTile.h index a245064f1..295f3f82c 100644 --- a/Minecraft.World/Blocks/TreeTile.h +++ b/Minecraft.World/Blocks/TreeTile.h @@ -25,7 +25,7 @@ public: static const unsigned int TREE_NAMES[TREE_NAMES_LENGTH]; - static const wstring TREE_TEXTURES[]; + static const std::wstring TREE_TEXTURES[]; private: Icon **icons; diff --git a/Minecraft.World/Blocks/WoodTile.cpp b/Minecraft.World/Blocks/WoodTile.cpp index c333c258f..b875741ba 100644 --- a/Minecraft.World/Blocks/WoodTile.cpp +++ b/Minecraft.World/Blocks/WoodTile.cpp @@ -13,7 +13,7 @@ const unsigned int WoodTile::WOOD_NAMES[WOOD_NAMES_LENGTH] = { IDS_TILE_OAKWOOD_ IDS_TILE_JUNGLE_PLANKS, }; -const wstring WoodTile::TEXTURE_NAMES[] = {L"wood", L"wood_spruce", L"wood_birch", L"wood_jungle"}; +const std::wstring WoodTile::TEXTURE_NAMES[] = {L"wood", L"wood_spruce", L"wood_birch", L"wood_jungle"}; // public static final String[] WOOD_NAMES = { // "oak", "spruce", "birch", "jungle" diff --git a/Minecraft.World/Blocks/WoodTile.h b/Minecraft.World/Blocks/WoodTile.h index 23bbdfb17..a380d934d 100644 --- a/Minecraft.World/Blocks/WoodTile.h +++ b/Minecraft.World/Blocks/WoodTile.h @@ -11,7 +11,7 @@ public: static const unsigned int WOOD_NAMES[WOOD_NAMES_LENGTH]; - static const wstring TEXTURE_NAMES[]; + static const std::wstring TEXTURE_NAMES[]; private: Icon **icons; diff --git a/Minecraft.World/Commands/AdminLogCommand.h b/Minecraft.World/Commands/AdminLogCommand.h index 0c80e1b0f..f3d4a483b 100644 --- a/Minecraft.World/Commands/AdminLogCommand.h +++ b/Minecraft.World/Commands/AdminLogCommand.h @@ -9,5 +9,5 @@ class AdminLogCommand public: static const int LOGTYPE_DONT_SHOW_TO_SELF = 1; - virtual void logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L"") = 0; + virtual void logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message = L"", int customData = -1, const std::wstring& additionalMessage = L"") = 0; }; \ No newline at end of file diff --git a/Minecraft.World/Commands/Command.cpp b/Minecraft.World/Commands/Command.cpp index e96b07cc3..d4f5bd4f0 100644 --- a/Minecraft.World/Commands/Command.cpp +++ b/Minecraft.World/Commands/Command.cpp @@ -12,12 +12,12 @@ bool Command::canExecute(std::shared_ptr source) return source->hasPermission(getId()); } -void Command::logAdminAction(std::shared_ptr source, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) +void Command::logAdminAction(std::shared_ptr source, ChatPacket::EChatPacketMessage messageType, const std::wstring& message, int customData, const std::wstring& additionalMessage) { logAdminAction(source, 0, messageType, message, customData, additionalMessage); } -void Command::logAdminAction(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) +void Command::logAdminAction(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message, int customData, const std::wstring& additionalMessage) { if (logger != NULL) { diff --git a/Minecraft.World/Commands/Command.h b/Minecraft.World/Commands/Command.h index 580a98412..a0db21851 100644 --- a/Minecraft.World/Commands/Command.h +++ b/Minecraft.World/Commands/Command.h @@ -19,8 +19,8 @@ public: virtual void execute(std::shared_ptr source, byteArray commandData) = 0; virtual bool canExecute(std::shared_ptr source); - static void logAdminAction(std::shared_ptr source, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); - static void logAdminAction(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); + static void logAdminAction(std::shared_ptr source, ChatPacket::EChatPacketMessage messageType, const std::wstring& message = L"", int customData = -1, const std::wstring& additionalMessage = L""); + static void logAdminAction(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message = L"", int customData = -1, const std::wstring& additionalMessage = L""); static void setLogger(AdminLogCommand *logger); protected: diff --git a/Minecraft.World/Commands/CommandSender.h b/Minecraft.World/Commands/CommandSender.h index 6886aa365..1484fec21 100644 --- a/Minecraft.World/Commands/CommandSender.h +++ b/Minecraft.World/Commands/CommandSender.h @@ -7,6 +7,6 @@ class CommandSender { public: //virtual int getUID() = 0; - virtual void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L"") = 0; + virtual void sendMessage(const std::wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const std::wstring& additionalMessage = L"") = 0; virtual bool hasPermission(EGameCommand command) = 0; }; \ No newline at end of file diff --git a/Minecraft.World/Commands/GameModeCommand.cpp b/Minecraft.World/Commands/GameModeCommand.cpp index 6c50a0fda..439cc2b62 100644 --- a/Minecraft.World/Commands/GameModeCommand.cpp +++ b/Minecraft.World/Commands/GameModeCommand.cpp @@ -26,7 +26,7 @@ void GameModeCommand::execute(std::shared_ptr source, byteArray c //} } -GameType *GameModeCommand::getModeForString(std::shared_ptr source, const wstring &name) +GameType *GameModeCommand::getModeForString(std::shared_ptr source, const std::wstring &name) { return NULL; //if (name.equalsIgnoreCase(GameType.SURVIVAL.getName()) || name.equalsIgnoreCase("s")) { diff --git a/Minecraft.World/Commands/GameModeCommand.h b/Minecraft.World/Commands/GameModeCommand.h index 7c08caabe..14a8490c8 100644 --- a/Minecraft.World/Commands/GameModeCommand.h +++ b/Minecraft.World/Commands/GameModeCommand.h @@ -11,6 +11,6 @@ public: virtual void execute(std::shared_ptr source, byteArray commandData); protected: - GameType *getModeForString(std::shared_ptr source, const wstring &name); + GameType *getModeForString(std::shared_ptr source, const std::wstring &name); std::shared_ptr getPlayer(PlayerUID playerId); }; \ No newline at end of file diff --git a/Minecraft.World/Commands/GiveItemCommand.cpp b/Minecraft.World/Commands/GiveItemCommand.cpp index 0463e7103..80b75df38 100644 --- a/Minecraft.World/Commands/GiveItemCommand.cpp +++ b/Minecraft.World/Commands/GiveItemCommand.cpp @@ -19,7 +19,7 @@ void GiveItemCommand::execute(std::shared_ptr source, byteArray c int item = dis.readInt(); int amount = dis.readInt(); int aux = dis.readInt(); - wstring tag = dis.readUTF(); + std::wstring tag = dis.readUTF(); bais.reset(); @@ -33,7 +33,7 @@ void GiveItemCommand::execute(std::shared_ptr source, byteArray c } } -std::shared_ptr GiveItemCommand::preparePacket(std::shared_ptr player, int item, int amount, int aux, const wstring &tag) +std::shared_ptr GiveItemCommand::preparePacket(std::shared_ptr player, int item, int amount, int aux, const std::wstring &tag) { if(player == NULL) return nullptr; diff --git a/Minecraft.World/Commands/GiveItemCommand.h b/Minecraft.World/Commands/GiveItemCommand.h index 0881d9f64..9297711f7 100644 --- a/Minecraft.World/Commands/GiveItemCommand.h +++ b/Minecraft.World/Commands/GiveItemCommand.h @@ -11,5 +11,5 @@ public: virtual void execute(std::shared_ptr source, byteArray commandData); public: - static std::shared_ptr preparePacket(std::shared_ptr player, int item, int amount = 1, int aux = 0, const wstring &tag = L""); + static std::shared_ptr preparePacket(std::shared_ptr player, int item, int amount = 1, int aux = 0, const std::wstring &tag = L""); }; \ No newline at end of file diff --git a/Minecraft.World/Containers/Inventory.cpp b/Minecraft.World/Containers/Inventory.cpp index ef8243963..93afbb2c5 100644 --- a/Minecraft.World/Containers/Inventory.cpp +++ b/Minecraft.World/Containers/Inventory.cpp @@ -428,7 +428,7 @@ void Inventory::setItem(unsigned int slot, std::shared_ptr item) #ifdef _DEBUG if(item!=NULL) { - wstring itemstring=item->toString(); + std::wstring itemstring=item->toString(); app.DebugPrintf("Inventory::setItem - slot = %d,\t item = %d ",slot,item->id); //OutputDebugStringW(itemstring.c_str()); app.DebugPrintf("\n"); diff --git a/Minecraft.World/Containers/RepairMenu.cpp b/Minecraft.World/Containers/RepairMenu.cpp index 7f9120a99..65c6432bf 100644 --- a/Minecraft.World/Containers/RepairMenu.cpp +++ b/Minecraft.World/Containers/RepairMenu.cpp @@ -392,7 +392,7 @@ std::shared_ptr RepairMenu::quickMoveStack(std::shared_ptr return clicked; } -void RepairMenu::setItemName(const wstring &name) +void RepairMenu::setItemName(const std::wstring &name) { this->itemName = name; if (getSlot(RESULT_SLOT)->hasItem()) diff --git a/Minecraft.World/Containers/RepairMenu.h b/Minecraft.World/Containers/RepairMenu.h index acd7dc37c..f47f01a5f 100644 --- a/Minecraft.World/Containers/RepairMenu.h +++ b/Minecraft.World/Containers/RepairMenu.h @@ -35,7 +35,7 @@ public: private: int repairItemCountCost; - wstring itemName; + std::wstring itemName; std::shared_ptr player; public: @@ -51,5 +51,5 @@ public: void removed(std::shared_ptr player); bool stillValid(std::shared_ptr player); std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); - void setItemName(const wstring &name); + void setItemName(const std::wstring &name); }; diff --git a/Minecraft.World/Enchantments/Enchantment.cpp b/Minecraft.World/Enchantments/Enchantment.cpp index 4c8c0383d..bf12d7f2b 100644 --- a/Minecraft.World/Enchantments/Enchantment.cpp +++ b/Minecraft.World/Enchantments/Enchantment.cpp @@ -150,7 +150,7 @@ int Enchantment::getDescriptionId() return descriptionId; } -wstring Enchantment::getFullname(int level,wstring &unformatted) +std::wstring Enchantment::getFullname(int level,std::wstring &unformatted) { wchar_t formatted[256]; swprintf(formatted,256,L"%ls %ls",app.GetString( getDescriptionId() ), getLevelString(level).c_str()); @@ -165,7 +165,7 @@ bool Enchantment::canEnchant(std::shared_ptr item) } // 4J Added -wstring Enchantment::getLevelString(int level) +std::wstring Enchantment::getLevelString(int level) { int stringId = IDS_ENCHANTMENT_LEVEL_1; switch(level) diff --git a/Minecraft.World/Enchantments/Enchantment.h b/Minecraft.World/Enchantments/Enchantment.h index 08c1ab0a2..1fe1a2f18 100644 --- a/Minecraft.World/Enchantments/Enchantment.h +++ b/Minecraft.World/Enchantments/Enchantment.h @@ -78,10 +78,10 @@ public: virtual bool isCompatibleWith(Enchantment *other) const; virtual Enchantment *setDescriptionId(int id); virtual int getDescriptionId(); - virtual wstring getFullname(int level,wstring &unformatted); // 4J Stu added unformatted + virtual std::wstring getFullname(int level,std::wstring &unformatted); // 4J Stu added unformatted virtual bool canEnchant(std::shared_ptr item); private: // 4J Added - wstring getLevelString(int level); + std::wstring getLevelString(int level); }; \ No newline at end of file diff --git a/Minecraft.World/Entities/BossMobPart.cpp b/Minecraft.World/Entities/BossMobPart.cpp index 3c3100a87..a6750f601 100644 --- a/Minecraft.World/Entities/BossMobPart.cpp +++ b/Minecraft.World/Entities/BossMobPart.cpp @@ -4,7 +4,7 @@ -BossMobPart::BossMobPart(BossMob *bossMob, const wstring &id, float w, float h) : Entity(bossMob->level), bossMob( bossMob ), id( id ) +BossMobPart::BossMobPart(BossMob *bossMob, const std::wstring &id, float w, float h) : Entity(bossMob->level), bossMob( bossMob ), id( id ) { // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called diff --git a/Minecraft.World/Entities/BossMobPart.h b/Minecraft.World/Entities/BossMobPart.h index 7b53126f2..cf003507f 100644 --- a/Minecraft.World/Entities/BossMobPart.h +++ b/Minecraft.World/Entities/BossMobPart.h @@ -11,9 +11,9 @@ public: eINSTANCEOF GetType() { return eTYPE_BOSS_MOB_PART; }; public: BossMob *bossMob; - const wstring id; + const std::wstring id; - BossMobPart(BossMob *bossMob, const wstring &id, float w, float h); + BossMobPart(BossMob *bossMob, const std::wstring &id, float w, float h); protected: virtual void defineSynchedData(); diff --git a/Minecraft.World/Entities/Entity.cpp b/Minecraft.World/Entities/Entity.cpp index f6710d8bf..a2dd67df1 100644 --- a/Minecraft.World/Entities/Entity.cpp +++ b/Minecraft.World/Entities/Entity.cpp @@ -1302,7 +1302,7 @@ bool Entity::shouldRenderAtSqrDistance(double distance) return distance < size * size; } -// 4J - used to be wstring return type, returning L"" +// 4J - used to be std::wstring return type, returning L"" int Entity::getTexture() { return -1; @@ -1315,7 +1315,7 @@ bool Entity::isCreativeModeAllowed() bool Entity::save(CompoundTag *entityTag) { - wstring id = getEncodeId(); + std::wstring id = getEncodeId(); if (removed || id.empty() ) { return false; @@ -1382,7 +1382,7 @@ void Entity::load(CompoundTag *tag) } -const wstring Entity::getEncodeId() +const std::wstring Entity::getEncodeId() { return EntityIO::getEncodeId( shared_from_this() ); } @@ -1889,9 +1889,9 @@ void Entity::makeStuckInWeb() fallDistance = 0; } -wstring Entity::getAName() +std::wstring Entity::getAName() { - wstring id = EntityIO::getEncodeId(shared_from_this()); + std::wstring id = EntityIO::getEncodeId(shared_from_this()); if (id.empty()) id = L"generic"; return L"entity." + id + _toString(entityId); //return I18n.get("entity." + id + ".name"); diff --git a/Minecraft.World/Entities/Entity.h b/Minecraft.World/Entities/Entity.h index 6e96bd8a6..4a86edfd9 100644 --- a/Minecraft.World/Entities/Entity.h +++ b/Minecraft.World/Entities/Entity.h @@ -112,8 +112,8 @@ private: bool firstTick; public: - wstring customTextureUrl; - wstring customTextureUrl2; + std::wstring customTextureUrl; + std::wstring customTextureUrl2; protected: bool fireImmune; @@ -265,14 +265,14 @@ public: virtual void awardKillScore(std::shared_ptr victim, int score); virtual bool shouldRender(Vec3 *c); virtual bool shouldRenderAtSqrDistance(double distance); - virtual int getTexture(); // 4J - changed from wstring to int + virtual int getTexture(); // 4J - changed from std::wstring to int virtual bool isCreativeModeAllowed(); bool save(CompoundTag *entityTag); void saveWithoutId(CompoundTag *entityTag); virtual void load(CompoundTag *tag); protected: - const wstring getEncodeId(); + const std::wstring getEncodeId(); public: virtual void readAdditionalSaveData(CompoundTag *tag) = 0; @@ -345,7 +345,7 @@ protected: public: virtual void makeStuckInWeb(); - virtual wstring getAName(); + virtual std::wstring getAName(); // TU9 bool skipAttackInteraction(std::shared_ptr source) {return false;} diff --git a/Minecraft.World/Entities/EntityDamageSource.cpp b/Minecraft.World/Entities/EntityDamageSource.cpp index cea252f07..918c8a371 100644 --- a/Minecraft.World/Entities/EntityDamageSource.cpp +++ b/Minecraft.World/Entities/EntityDamageSource.cpp @@ -4,7 +4,7 @@ #include "../Headers/net.minecraft.world.damagesource.h" #include "../Headers/net.minecraft.network.packet.h" -//EntityDamageSource::EntityDamageSource(const wstring &msgId, std::shared_ptr entity) : DamageSource(msgId) +//EntityDamageSource::EntityDamageSource(const std::wstring &msgId, std::shared_ptr entity) : DamageSource(msgId) EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity) : DamageSource(msgId) { this->entity = entity; @@ -15,7 +15,7 @@ std::shared_ptr EntityDamageSource::getEntity() return entity; } -//wstring EntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) +//std::wstring EntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name + entity->getAName(); // //return I18n.get("death." + msgId, player.name, entity.getAName()); @@ -23,7 +23,7 @@ std::shared_ptr EntityDamageSource::getEntity() std::shared_ptr EntityDamageSource::getDeathMessagePacket(std::shared_ptr player) { - wstring additional = L""; + std::wstring additional = L""; if(entity->GetType() == eTYPE_SERVERPLAYER) { std::shared_ptr sourcePlayer = dynamic_pointer_cast(entity); diff --git a/Minecraft.World/Entities/EntityDamageSource.h b/Minecraft.World/Entities/EntityDamageSource.h index 5c9fab190..e1d11598d 100644 --- a/Minecraft.World/Entities/EntityDamageSource.h +++ b/Minecraft.World/Entities/EntityDamageSource.h @@ -12,14 +12,14 @@ protected: std::shared_ptr entity; public: - //EntityDamageSource(const wstring &msgId, std::shared_ptr entity); + //EntityDamageSource(const std::wstring &msgId, std::shared_ptr entity); EntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity); virtual ~EntityDamageSource() { } std::shared_ptr getEntity(); // 4J Stu - Made return a packet - //virtual wstring getLocalizedDeathMessage(std::shared_ptr player); + //virtual std::wstring getLocalizedDeathMessage(std::shared_ptr player); virtual std::shared_ptr getDeathMessagePacket(std::shared_ptr player); virtual bool scalesWithDifficulty(); diff --git a/Minecraft.World/Entities/IndirectEntityDamageSource.cpp b/Minecraft.World/Entities/IndirectEntityDamageSource.cpp index e5670c969..7f43e0331 100644 --- a/Minecraft.World/Entities/IndirectEntityDamageSource.cpp +++ b/Minecraft.World/Entities/IndirectEntityDamageSource.cpp @@ -4,7 +4,7 @@ #include "../Headers/net.minecraft.world.damagesource.h" #include "../Headers/net.minecraft.network.packet.h" -//IndirectEntityDamageSource::IndirectEntityDamageSource(const wstring &msgId, std::shared_ptr entity, std::shared_ptr owner) : EntityDamageSource(msgId, entity) +//IndirectEntityDamageSource::IndirectEntityDamageSource(const std::wstring &msgId, std::shared_ptr entity, std::shared_ptr owner) : EntityDamageSource(msgId, entity) IndirectEntityDamageSource::IndirectEntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity, std::shared_ptr owner) : EntityDamageSource(msgId, entity) { this->owner = owner; @@ -21,7 +21,7 @@ std::shared_ptr IndirectEntityDamageSource::getEntity() return owner; } -//wstring IndirectEntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) +//std::wstring IndirectEntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name + owner->getAName(); // //return I18n.get("death." + msgId, player.name, owner.getAName()); @@ -29,7 +29,7 @@ std::shared_ptr IndirectEntityDamageSource::getEntity() std::shared_ptr IndirectEntityDamageSource::getDeathMessagePacket(std::shared_ptr player) { - wstring additional = L""; + std::wstring additional = L""; int type; if(owner != NULL) { diff --git a/Minecraft.World/Entities/IndirectEntityDamageSource.h b/Minecraft.World/Entities/IndirectEntityDamageSource.h index 52848de1f..2c3094799 100644 --- a/Minecraft.World/Entities/IndirectEntityDamageSource.h +++ b/Minecraft.World/Entities/IndirectEntityDamageSource.h @@ -12,7 +12,7 @@ private: std::shared_ptr owner; public: - //IndirectEntityDamageSource(const wstring &msgId, std::shared_ptr entity, std::shared_ptr owner); + //IndirectEntityDamageSource(const std::wstring &msgId, std::shared_ptr entity, std::shared_ptr owner); IndirectEntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity, std::shared_ptr owner); virtual ~IndirectEntityDamageSource() { } @@ -20,6 +20,6 @@ public: virtual std::shared_ptr getEntity(); // 4J Stu - Made return a packet - //virtual wstring getLocalizedDeathMessage(std::shared_ptr player); + //virtual std::wstring getLocalizedDeathMessage(std::shared_ptr player); virtual std::shared_ptr getDeathMessagePacket(std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/Entities/ItemEntity.cpp b/Minecraft.World/Entities/ItemEntity.cpp index c3210f930..ca558ff98 100644 --- a/Minecraft.World/Entities/ItemEntity.cpp +++ b/Minecraft.World/Entities/ItemEntity.cpp @@ -261,7 +261,7 @@ void ItemEntity::playerTouch(std::shared_ptr player) } } -wstring ItemEntity::getAName() +std::wstring ItemEntity::getAName() { return L"";//L"item." + getItem()->getDescriptionId(); //return I18n.get("item." + item.getDescriptionId()); @@ -295,12 +295,12 @@ bool ItemEntity::isAttackable() return false; } -void ItemEntity::setThrower(const wstring &thrower) +void ItemEntity::setThrower(const std::wstring &thrower) { this->thrower = thrower; } -wstring ItemEntity::getThrower() +std::wstring ItemEntity::getThrower() { return this->thrower; } diff --git a/Minecraft.World/Entities/ItemEntity.h b/Minecraft.World/Entities/ItemEntity.h index 6973497de..65c6fbe05 100644 --- a/Minecraft.World/Entities/ItemEntity.h +++ b/Minecraft.World/Entities/ItemEntity.h @@ -15,7 +15,7 @@ private: static const int LIFETIME = 5 * 60 * SharedConstants::TICKS_PER_SECOND; // Five miniutes. - wstring thrower; + std::wstring thrower; // 4J Added void _init(); @@ -63,12 +63,12 @@ public: virtual void readAdditionalSaveData(CompoundTag *tag); virtual void playerTouch(std::shared_ptr player); - virtual wstring getAName(); + virtual std::wstring getAName(); std::shared_ptr getItem(); void setItem(std::shared_ptr item); virtual bool isAttackable(); - void setThrower(const wstring &thrower); - wstring getThrower(); + void setThrower(const std::wstring &thrower); + std::wstring getThrower(); }; diff --git a/Minecraft.World/Entities/Mob.h b/Minecraft.World/Entities/Mob.h index d98438165..8936c67ab 100644 --- a/Minecraft.World/Entities/Mob.h +++ b/Minecraft.World/Entities/Mob.h @@ -55,11 +55,11 @@ protected: float oRun, run; float animStep, animStepO; bool hasHair; - // wstring textureName; - int textureIdx; // 4J changed from wstring textureName + // std::wstring textureName; + int textureIdx; // 4J changed from std::wstring textureName bool allowAlpha; float rotOffs; - wstring modelName; + std::wstring modelName; float bobStrength; int deathScore; float renderOffset; @@ -172,7 +172,7 @@ protected: public: bool canSee(std::shared_ptr target); - virtual int getTexture(); // 4J - changed from wstring to int + virtual int getTexture(); // 4J - changed from std::wstring to int virtual bool isPickable() ; virtual bool isPushable(); virtual float getHeadHeight(); diff --git a/Minecraft.World/Entities/MobEffect.cpp b/Minecraft.World/Entities/MobEffect.cpp index efb21889d..270e4f799 100644 --- a/Minecraft.World/Entities/MobEffect.cpp +++ b/Minecraft.World/Entities/MobEffect.cpp @@ -217,7 +217,7 @@ bool MobEffect::isHarmful() return _isHarmful; } -wstring MobEffect::formatDuration(MobEffectInstance *instance) +std::wstring MobEffect::formatDuration(MobEffectInstance *instance) { int duration = instance->getDuration(); diff --git a/Minecraft.World/Entities/MobEffect.h b/Minecraft.World/Entities/MobEffect.h index 94b9da8f1..7f42234eb 100644 --- a/Minecraft.World/Entities/MobEffect.h +++ b/Minecraft.World/Entities/MobEffect.h @@ -101,7 +101,7 @@ public: bool hasIcon(); EMobEffectIcon getIcon(); // 4J changed return type bool isHarmful(); - static wstring formatDuration(MobEffectInstance *instance); + static std::wstring formatDuration(MobEffectInstance *instance); protected: MobEffect *setDurationModifier(double durationModifier); diff --git a/Minecraft.World/Entities/MobEffectInstance.cpp b/Minecraft.World/Entities/MobEffectInstance.cpp index 6a438eef2..d0a0ecb07 100644 --- a/Minecraft.World/Entities/MobEffectInstance.cpp +++ b/Minecraft.World/Entities/MobEffectInstance.cpp @@ -113,10 +113,10 @@ int MobEffectInstance::hashCode() return (id & 0xff) | ( (amplifier & 0xff) << 8) | ( (duration & 0xffff) << 16); } -wstring MobEffectInstance::toString() +std::wstring MobEffectInstance::toString() { - wstring result = L"MobEffectInstance::toString - NON IMPLEMENTED OR LOCALISED FUNCTION"; - //wstring result = ""; + std::wstring result = L"MobEffectInstance::toString - NON IMPLEMENTED OR LOCALISED FUNCTION"; + //std::wstring result = ""; //if (getAmplifier() > 0) //{ // result = getDescriptionId() + " x " + (getAmplifier() + 1) + ", Duration: " + getDuration(); diff --git a/Minecraft.World/Entities/MobEffectInstance.h b/Minecraft.World/Entities/MobEffectInstance.h index bfecc6125..4f6b6ef00 100644 --- a/Minecraft.World/Entities/MobEffectInstance.h +++ b/Minecraft.World/Entities/MobEffectInstance.h @@ -35,7 +35,7 @@ public: int getPostfixDescriptionId(); // 4J Added int hashCode(); - wstring toString(); + std::wstring toString(); // Was bool equals(Object obj) bool equals(MobEffectInstance *obj); diff --git a/Minecraft.World/Entities/Mobs/Boat.cpp b/Minecraft.World/Entities/Mobs/Boat.cpp index b3480186b..397dd53dc 100644 --- a/Minecraft.World/Entities/Mobs/Boat.cpp +++ b/Minecraft.World/Entities/Mobs/Boat.cpp @@ -462,7 +462,7 @@ float Boat::getShadowHeightOffs() return 0; } -wstring Boat::getName() +std::wstring Boat::getName() { return L"Boat"; } diff --git a/Minecraft.World/Entities/Mobs/Boat.h b/Minecraft.World/Entities/Mobs/Boat.h index eb5f5fc1f..b4d147d37 100644 --- a/Minecraft.World/Entities/Mobs/Boat.h +++ b/Minecraft.World/Entities/Mobs/Boat.h @@ -68,7 +68,7 @@ protected: public: virtual float getShadowHeightOffs(); - wstring getName(); + std::wstring getName(); virtual bool interact(std::shared_ptr player); virtual void setDamage(int damage); diff --git a/Minecraft.World/Entities/Mobs/Ocelot.cpp b/Minecraft.World/Entities/Mobs/Ocelot.cpp index f6355f5dc..2243299e9 100644 --- a/Minecraft.World/Entities/Mobs/Ocelot.cpp +++ b/Minecraft.World/Entities/Mobs/Ocelot.cpp @@ -323,7 +323,7 @@ bool Ozelot::canSpawn() return false; } -wstring Ozelot::getAName() +std::wstring Ozelot::getAName() { if (isTame()) { diff --git a/Minecraft.World/Entities/Mobs/Ocelot.h b/Minecraft.World/Entities/Mobs/Ocelot.h index 8ca188331..bc557e317 100644 --- a/Minecraft.World/Entities/Mobs/Ocelot.h +++ b/Minecraft.World/Entities/Mobs/Ocelot.h @@ -72,5 +72,5 @@ public: virtual int getCatType(); virtual void setCatType(int type); virtual bool canSpawn(); - virtual wstring getAName(); + virtual std::wstring getAName(); }; \ No newline at end of file diff --git a/Minecraft.World/Entities/Mobs/Painting.cpp b/Minecraft.World/Entities/Mobs/Painting.cpp index ba31f5140..b04132bb0 100644 --- a/Minecraft.World/Entities/Mobs/Painting.cpp +++ b/Minecraft.World/Entities/Mobs/Painting.cpp @@ -93,7 +93,7 @@ void Painting::PaintingPostConstructor(int dir) setDir(dir); } -Painting::Painting(Level *level, int x, int y, int z, int dir, wstring motiveName) : HangingEntity( level , x, y, z, dir ) +Painting::Painting(Level *level, int x, int y, int z, int dir, std::wstring motiveName) : HangingEntity( level , x, y, z, dir ) { _init(level); @@ -118,7 +118,7 @@ void Painting::addAdditonalSaveData(CompoundTag *tag) void Painting::readAdditionalSaveData(CompoundTag *tag) { - wstring motiveName = tag->getString(L"Motive"); + std::wstring motiveName = tag->getString(L"Motive"); vector::iterator it; for (int i = 0 ; i < LAST_VALUE; i++) { diff --git a/Minecraft.World/Entities/Mobs/Painting.h b/Minecraft.World/Entities/Mobs/Painting.h index 7c986a01e..7ce1e60ef 100644 --- a/Minecraft.World/Entities/Mobs/Painting.h +++ b/Minecraft.World/Entities/Mobs/Painting.h @@ -63,12 +63,12 @@ public: static const int MAX_MOTIVE_NAME_LENGTH; - const wstring name; + const std::wstring name; const int w, h; const int uo, vo; //private: - Motive(wstring name, int w, int h, int uo, int vo) : name( name ), w( w ), h( h ), uo( uo ), vo( vo ) {}; + Motive(std::wstring name, int w, int h, int uo, int vo) : name( name ), w( w ), h( h ), uo( uo ), vo( vo ) {}; }; public: @@ -85,7 +85,7 @@ private: public: Painting(Level *level); Painting(Level *level, int xTile, int yTile, int zTile, int dir); - Painting(Level *level, int x, int y, int z, int dir, wstring motiveName); + Painting(Level *level, int x, int y, int z, int dir, std::wstring motiveName); // 4J Stu - Added this so that we can use some std::shared_ptr functions that were needed in the ctor void PaintingPostConstructor(int dir); diff --git a/Minecraft.World/Entities/Mobs/Villager.h b/Minecraft.World/Entities/Mobs/Villager.h index ae18ecfbb..bc0717375 100644 --- a/Minecraft.World/Entities/Mobs/Villager.h +++ b/Minecraft.World/Entities/Mobs/Villager.h @@ -39,7 +39,7 @@ private: int updateMerchantTimer; bool addRecipeOnUpdate; int riches; - wstring lastPlayerTradeName; + std::wstring lastPlayerTradeName; bool rewardPlayersOnFirstVillage; diff --git a/Minecraft.World/Entities/Mobs/Wolf.cpp b/Minecraft.World/Entities/Mobs/Wolf.cpp index b5c233a8b..f463aa784 100644 --- a/Minecraft.World/Entities/Mobs/Wolf.cpp +++ b/Minecraft.World/Entities/Mobs/Wolf.cpp @@ -308,7 +308,7 @@ bool Wolf::doHurtTarget(std::shared_ptr target) return target->hurt(DamageSource::mobAttack(dynamic_pointer_cast(shared_from_this())), damage); } -void Wolf::tame(const wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting) +void Wolf::tame(const std::wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting) { setTame(true); setPath(NULL); diff --git a/Minecraft.World/Entities/Mobs/Wolf.h b/Minecraft.World/Entities/Mobs/Wolf.h index 8b3e69c4a..c8fbf6c97 100644 --- a/Minecraft.World/Entities/Mobs/Wolf.h +++ b/Minecraft.World/Entities/Mobs/Wolf.h @@ -39,7 +39,7 @@ protected: virtual bool makeStepSound(); public: - virtual int getTexture(); // 4J - changed from wstring to ing + virtual int getTexture(); // 4J - changed from std::wstring to ing virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); @@ -71,7 +71,7 @@ public: void setAngry(bool value); int getCollarColor(); void setCollarColor(int color); - void tame(const wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting); + void tame(const std::wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting); // For tooltips int GetSynchedHealth(); diff --git a/Minecraft.World/Entities/SyncedEntityData.cpp b/Minecraft.World/Entities/SyncedEntityData.cpp index 47012bd69..5bb72f3b9 100644 --- a/Minecraft.World/Entities/SyncedEntityData.cpp +++ b/Minecraft.World/Entities/SyncedEntityData.cpp @@ -46,7 +46,7 @@ void SynchedEntityData::define(int id, short value) m_isEmpty = false; } -void SynchedEntityData::define(int id, const wstring& value) +void SynchedEntityData::define(int id, const std::wstring& value) { MemSect(17); checkId(id); @@ -103,7 +103,7 @@ float SynchedEntityData::getFloat(int id) return 0; } -wstring SynchedEntityData::getString(int id) +std::wstring SynchedEntityData::getString(int id) { return itemsById[id]->getValue_wstring(); } @@ -159,7 +159,7 @@ void SynchedEntityData::set(int id, short value) } } -void SynchedEntityData::set(int id, const wstring& value) +void SynchedEntityData::set(int id, const std::wstring& value) { std::shared_ptr dataItem = itemsById[id]; @@ -474,7 +474,7 @@ SynchedEntityData::DataItem::DataItem(int type, int id, short value) : type( typ this->dirty = true; } -SynchedEntityData::DataItem::DataItem(int type, int id, const wstring& value) : type( type ), id( id ) +SynchedEntityData::DataItem::DataItem(int type, int id, const std::wstring& value) : type( type ), id( id ) { this->value_wstring = value; this->dirty = true; @@ -506,7 +506,7 @@ void SynchedEntityData::DataItem::setValue(short value) this->value_short = value; } -void SynchedEntityData::DataItem::setValue(const wstring& value) +void SynchedEntityData::DataItem::setValue(const std::wstring& value) { this->value_wstring = value; } @@ -531,7 +531,7 @@ uint8_t SynchedEntityData::DataItem::getValue_byte() return value_byte; } -wstring SynchedEntityData::DataItem::getValue_wstring() +std::wstring SynchedEntityData::DataItem::getValue_wstring() { return value_wstring; } diff --git a/Minecraft.World/Entities/SyncedEntityData.h b/Minecraft.World/Entities/SyncedEntityData.h index 404441b80..87008b4dd 100644 --- a/Minecraft.World/Entities/SyncedEntityData.h +++ b/Minecraft.World/Entities/SyncedEntityData.h @@ -18,7 +18,7 @@ public: uint8_t value_byte; int value_int; short value_short; - wstring value_wstring; + std::wstring value_wstring; std::shared_ptr value_itemInstance; bool dirty; @@ -26,7 +26,7 @@ public: // There was one type here that took a generic Object type, using overloading here instead DataItem(int type, int id, uint8_t value); DataItem(int type, int id, int value); - DataItem(int type, int id, const wstring& value); + DataItem(int type, int id, const std::wstring& value); DataItem(int type, int id, std::shared_ptr itemInstance); DataItem(int type, int id, short value); @@ -34,12 +34,12 @@ public: void setValue(uint8_t value); void setValue(int value); void setValue(short value); - void setValue(const wstring& value); + void setValue(const std::wstring& value); void setValue(std::shared_ptr value); uint8_t getValue_byte(); int getValue_int(); short getValue_short(); - wstring getValue_wstring(); + std::wstring getValue_wstring(); std::shared_ptr getValue_itemInstance(); int getType(); bool isDirty(); @@ -80,7 +80,7 @@ public: // 4J - this function used to be a template, but there's only 3 varieties of use I've found so just hard-coding now, as // the original had some automatic Class to type sort of conversion that's a real pain for us to actually do void define(int id, uint8_t value); - void define(int id, const wstring& value); + void define(int id, const std::wstring& value); void define(int id, int value); void define(int id, short value); void defineNULL(int id, void *pVal); @@ -90,14 +90,14 @@ public: short getShort(int id); int getInteger(int id); float getFloat(int id); - wstring getString(int id); + std::wstring getString(int id); std::shared_ptr getItemInstance(int id); Pos *getPos(int id); // 4J - using overloads rather than template here void set(int id, uint8_t value); void set(int id, int value); void set(int id, short value); - void set(int id, const wstring& value); + void set(int id, const std::wstring& value); void set(int id, std::shared_ptr); void markDirty(int id); bool isDirty(); diff --git a/Minecraft.World/Entities/TamableAnimal.cpp b/Minecraft.World/Entities/TamableAnimal.cpp index 0ab7bae27..d4d265691 100644 --- a/Minecraft.World/Entities/TamableAnimal.cpp +++ b/Minecraft.World/Entities/TamableAnimal.cpp @@ -54,13 +54,13 @@ void TamableAnimal::readAdditionalSaveData(CompoundTag *tag) Animal::readAdditionalSaveData(tag); #ifdef _XBOX_ONE // 4J Stu Added from later Java version to remove owners from save transfer saves. We will probably want this on other platforms in the future - wstring owner = L""; + std::wstring owner = L""; if(tag->contains(L"OwnerUUID") ) { owner = tag->getString(L"OwnerUUID"); } #else - wstring owner = tag->getString(L"Owner"); + std::wstring owner = tag->getString(L"Owner"); #endif if (owner.length() > 0) { @@ -138,12 +138,12 @@ void TamableAnimal::setSitting(bool value) } } -wstring TamableAnimal::getOwnerUUID() +std::wstring TamableAnimal::getOwnerUUID() { return entityData->getString(DATA_OWNERUUID_ID); } -void TamableAnimal::setOwnerUUID(const wstring &name) +void TamableAnimal::setOwnerUUID(const std::wstring &name) { entityData->set(DATA_OWNERUUID_ID, name); } diff --git a/Minecraft.World/Entities/TamableAnimal.h b/Minecraft.World/Entities/TamableAnimal.h index 644665da1..4955f0ff2 100644 --- a/Minecraft.World/Entities/TamableAnimal.h +++ b/Minecraft.World/Entities/TamableAnimal.h @@ -31,8 +31,8 @@ public: virtual void setTame(bool value); virtual bool isSitting(); virtual void setSitting(bool value); - virtual wstring getOwnerUUID(); - virtual void setOwnerUUID(const wstring &name); + virtual std::wstring getOwnerUUID(); + virtual void setOwnerUUID(const std::wstring &name); virtual std::shared_ptr getOwner(); virtual SitGoal *getSitGoal(); }; \ No newline at end of file diff --git a/Minecraft.World/IO/Files/ConsoleSaveFile.h b/Minecraft.World/IO/Files/ConsoleSaveFile.h index 39c1ec89c..508f9e603 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFile.h +++ b/Minecraft.World/IO/Files/ConsoleSaveFile.h @@ -26,13 +26,13 @@ public: virtual void DebugFlushToFile(void *compressedData = NULL, unsigned int compressedDataSize = 0) = 0; #endif virtual unsigned int getSizeOnDisk() = 0; - virtual wstring getFilename() = 0; - virtual vector *getFilesWithPrefix(const wstring &prefix) = 0; + virtual std::wstring getFilename() = 0; + virtual vector *getFilesWithPrefix(const std::wstring &prefix) = 0; virtual vector *getRegionFilesByDimension(unsigned int dimensionIndex) = 0; #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - virtual wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID) = 0; - virtual wstring getPlayerDataFilenameForSave(const PlayerUID& pUID) = 0; + virtual std::wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID) = 0; + virtual std::wstring getPlayerDataFilenameForSave(const PlayerUID& pUID) = 0; virtual vector *getValidPlayerDatFiles() = 0; #endif //__PS3__ diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp index a4096ff4b..392998f99 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp @@ -59,7 +59,7 @@ void ConsoleSaveFileConverter::ProcessStandardRegionFile(ConsoleSaveFile *source void ConsoleSaveFileConverter::ConvertSave(ConsoleSaveFile *sourceSave, ConsoleSaveFile *targetSave, ProgressListener *progress) { // Process level.dat - ConsoleSavePath ldatPath( wstring(L"level.dat") ); + ConsoleSavePath ldatPath( std::wstring(L"level.dat") ); FileEntry *sourceLdatFe = sourceSave->createFile( ldatPath ); FileEntry *targetLdatFe = targetSave->createFile( ldatPath ); printf("Processing level.dat\n"); @@ -267,14 +267,14 @@ void ConsoleSaveFileConverter::ConvertSave(ConsoleSaveFile *sourceSave, ConsoleS #else // 4J Stu - Old version that just changes the compression of chunks, not usable for XboxOne style split saves or compressed tile formats // Process region files - vector *allFilesInSave = sourceSave->getFilesWithPrefix(wstring(L"")); + vector *allFilesInSave = sourceSave->getFilesWithPrefix(std::wstring(L"")); for(AUTO_VAR(it, allFilesInSave->begin()); it < allFilesInSave->end(); ++it) { FileEntry *fe = *it; if( fe != sourceLdatFe ) { - wstring fName( fe->data.filename ); - wstring suffix(L".mcr"); + std::wstring fName( fe->data.filename ); + std::wstring suffix(L".mcr"); if( fName.compare(fName.length() - suffix.length(), suffix.length(), suffix) == 0 ) { #ifndef _CONTENT_PACKAGE diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp index 41f6777af..0023c146e 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp @@ -23,7 +23,7 @@ unsigned int ConsoleSaveFileOriginal::pagesCommitted = 0; void *ConsoleSaveFileOriginal::pvHeap = NULL; -ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID pvSaveData /*= NULL*/, DWORD dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) +ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const std::wstring &fileName, LPVOID pvSaveData /*= NULL*/, DWORD dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) { InitializeCriticalSectionAndSpinCount(&m_lock,5120); @@ -852,7 +852,7 @@ void ConsoleSaveFileOriginal::DebugFlushToFile(void *compressedData /*= NULL*/, //14 chars for the digits //11 chars for the separators + suffix //25 chars total - wstring cutFileName = m_fileName; + std::wstring cutFileName = m_fileName; if(m_fileName.length() > XCONTENT_MAX_FILENAME_LENGTH - 25) { cutFileName = m_fileName.substr(0, XCONTENT_MAX_FILENAME_LENGTH - 25); @@ -860,10 +860,10 @@ void ConsoleSaveFileOriginal::DebugFlushToFile(void *compressedData /*= NULL*/, swprintf(fileName, XCONTENT_MAX_FILENAME_LENGTH+1, L"\\v%04d-%ls%02d.%02d.%02d.%02d.%02d.mcs",VER_PRODUCTBUILD,cutFileName.c_str(), t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond); #ifdef _UNICODE - wstring wtemp = targetFileDir.getPath() + wstring(fileName); + std::wstring wtemp = targetFileDir.getPath() + std::wstring(fileName); LPCWSTR lpFileName = wtemp.c_str(); #else - LPCSTR lpFileName = wstringtofilename( targetFileDir.getPath() + wstring(fileName) ); + LPCSTR lpFileName = wstringtofilename( targetFileDir.getPath() + std::wstring(fileName) ); #endif #ifndef __PSVITA__ HANDLE hSaveFile = CreateFile( lpFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); @@ -904,12 +904,12 @@ unsigned int ConsoleSaveFileOriginal::getSizeOnDisk() return header.GetFileSize(); } -wstring ConsoleSaveFileOriginal::getFilename() +std::wstring ConsoleSaveFileOriginal::getFilename() { return m_fileName; } -vector *ConsoleSaveFileOriginal::getFilesWithPrefix(const wstring &prefix) +vector *ConsoleSaveFileOriginal::getFilesWithPrefix(const std::wstring &prefix) { return header.getFilesWithPrefix( prefix ); } @@ -920,11 +920,11 @@ vector *ConsoleSaveFileOriginal::getRegionFilesByDimension(unsigned } #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) -wstring ConsoleSaveFileOriginal::getPlayerDataFilenameForLoad(const PlayerUID& pUID) +std::wstring ConsoleSaveFileOriginal::getPlayerDataFilenameForLoad(const PlayerUID& pUID) { return header.getPlayerDataFilenameForLoad( pUID ); } -wstring ConsoleSaveFileOriginal::getPlayerDataFilenameForSave(const PlayerUID& pUID) +std::wstring ConsoleSaveFileOriginal::getPlayerDataFilenameForSave(const PlayerUID& pUID) { return header.getPlayerDataFilenameForSave( pUID ); } @@ -1041,12 +1041,12 @@ void ConsoleSaveFileOriginal::ConvertToLocalPlatform() return; } // convert each of the region files to the local platform - vector *allFilesInSave = getFilesWithPrefix(wstring(L"")); + vector *allFilesInSave = getFilesWithPrefix(std::wstring(L"")); for(AUTO_VAR(it, allFilesInSave->begin()); it < allFilesInSave->end(); ++it) { FileEntry *fe = *it; - wstring fName( fe->data.filename ); - wstring suffix(L".mcr"); + std::wstring fName( fe->data.filename ); + std::wstring suffix(L".mcr"); if( fName.compare(fName.length() - suffix.length(), suffix.length(), suffix) == 0 ) { app.DebugPrintf("Processing a region file: %ls\n",fName.c_str()); diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h index fd35aa1da..f8c7a106c 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.h @@ -9,7 +9,7 @@ class ConsoleSaveFileOriginal : public ConsoleSaveFile private: FileHeader header; - wstring m_fileName; + std::wstring m_fileName; // HANDLE hHeap; static void *pvHeap; @@ -35,7 +35,7 @@ public: #if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ || defined _DURANGO || defined _WINDOWS64) static int SaveSaveDataCallback(LPVOID lpParam,bool bRes); #endif - ConsoleSaveFileOriginal(const wstring &fileName, LPVOID pvSaveData = NULL, DWORD fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); + ConsoleSaveFileOriginal(const std::wstring &fileName, LPVOID pvSaveData = NULL, DWORD fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); virtual ~ConsoleSaveFileOriginal(); // 4J Stu - Initial implementation is intended to have a similar interface to the standard Xbox file access functions @@ -60,14 +60,14 @@ public: #endif virtual unsigned int getSizeOnDisk(); - virtual wstring getFilename(); + virtual std::wstring getFilename(); - virtual vector *getFilesWithPrefix(const wstring &prefix); + virtual vector *getFilesWithPrefix(const std::wstring &prefix); virtual vector *getRegionFilesByDimension(unsigned int dimensionIndex); #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - virtual wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID); - virtual wstring getPlayerDataFilenameForSave(const PlayerUID& pUID); + virtual std::wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID); + virtual std::wstring getPlayerDataFilenameForSave(const PlayerUID& pUID); virtual vector *getValidPlayerDatFiles(); #endif //__PS3__ diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp index 111b741e7..ef5b671e8 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp @@ -379,7 +379,7 @@ FileEntry *ConsoleSaveFileSplit::GetRegionFileEntry(unsigned int regionIndex) return newRef->fileEntry; } -ConsoleSaveFileSplit::ConsoleSaveFileSplit(const wstring &fileName, LPVOID pvSaveData /*= NULL*/, DWORD dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) +ConsoleSaveFileSplit::ConsoleSaveFileSplit(const std::wstring &fileName, LPVOID pvSaveData /*= NULL*/, DWORD dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) { DWORD fileSize = dFileSize; @@ -437,7 +437,7 @@ ConsoleSaveFileSplit::ConsoleSaveFileSplit(ConsoleSaveFile *sourceSave, bool alr } } -void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWORD fileSize, ESavePlatform plat) +void ConsoleSaveFileSplit::_init(const std::wstring &fileName, LPVOID pvSaveData, DWORD fileSize, ESavePlatform plat) { InitializeCriticalSectionAndSpinCount(&m_lock,5120); @@ -1187,12 +1187,12 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesT // DIM-1r.x.z.mcr 00 01 xx zz // DIM1/r.x.z.mcr 00 02 xx zz -bool ConsoleSaveFileSplit::GetNumericIdentifierFromName(const wstring &fileName, unsigned int *idOut) +bool ConsoleSaveFileSplit::GetNumericIdentifierFromName(const std::wstring &fileName, unsigned int *idOut) { // Determine whether it is one of our region file names if the file extension is ".mbr" if( fileName.length() < 4 ) return false; - wstring extension = fileName.substr(fileName.length()-4,4); - if( extension != wstring(L".mcr") ) return false; + std::wstring extension = fileName.substr(fileName.length()-4,4); + if( extension != std::wstring(L".mcr") ) return false; unsigned int id = 0; int x, z; @@ -1231,9 +1231,9 @@ bool ConsoleSaveFileSplit::GetNumericIdentifierFromName(const wstring &fileName, // Convert a numeric file identifier (for region files) back into a normal filename. See comment above. -wstring ConsoleSaveFileSplit::GetNameFromNumericIdentifier(unsigned int idIn) +std::wstring ConsoleSaveFileSplit::GetNameFromNumericIdentifier(unsigned int idIn) { - wstring prefix; + std::wstring prefix; switch(idIn & 0x00ff0000 ) { @@ -1249,7 +1249,7 @@ wstring ConsoleSaveFileSplit::GetNameFromNumericIdentifier(unsigned int idIn) } signed char regionX = ( idIn >> 8 ) & 255; signed char regionZ = idIn & 255; - wstring region = ( prefix + wstring(L"r.") + _toString(regionX) + L"." + _toString(regionZ) + L".mcr" ); + std::wstring region = ( prefix + std::wstring(L"r.") + _toString(regionX) + L"." + _toString(regionZ) + L".mcr" ); return region; } @@ -1503,7 +1503,7 @@ void ConsoleSaveFileSplit::DebugFlushToFile(void *compressedData /*= NULL*/, uns //14 chars for the digits //11 chars for the separators + suffix //25 chars total - wstring cutFileName = m_fileName; + std::wstring cutFileName = m_fileName; if(m_fileName.length() > XCONTENT_MAX_FILENAME_LENGTH - 25) { cutFileName = m_fileName.substr(0, XCONTENT_MAX_FILENAME_LENGTH - 25); @@ -1511,10 +1511,10 @@ void ConsoleSaveFileSplit::DebugFlushToFile(void *compressedData /*= NULL*/, uns swprintf(fileName, XCONTENT_MAX_FILENAME_LENGTH+1, L"\\v%04d-%ls%02d.%02d.%02d.%02d.%02d.mcs",VER_PRODUCTBUILD,cutFileName.c_str(), t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond); #ifdef _UNICODE - wstring wtemp = targetFileDir.getPath() + wstring(fileName); + std::wstring wtemp = targetFileDir.getPath() + std::wstring(fileName); LPCWSTR lpFileName = wtemp.c_str(); #else - LPCSTR lpFileName = wstringtofilename( targetFileDir.getPath() + wstring(fileName) ); + LPCSTR lpFileName = wstringtofilename( targetFileDir.getPath() + std::wstring(fileName) ); #endif HANDLE hSaveFile = CreateFile( lpFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); @@ -1542,12 +1542,12 @@ unsigned int ConsoleSaveFileSplit::getSizeOnDisk() return header.GetFileSize(); } -wstring ConsoleSaveFileSplit::getFilename() +std::wstring ConsoleSaveFileSplit::getFilename() { return m_fileName; } -vector *ConsoleSaveFileSplit::getFilesWithPrefix(const wstring &prefix) +vector *ConsoleSaveFileSplit::getFilesWithPrefix(const std::wstring &prefix) { return header.getFilesWithPrefix( prefix ); } @@ -1575,11 +1575,11 @@ vector *ConsoleSaveFileSplit::getRegionFilesByDimension(unsigned in } #if defined(__PS3__) || defined(__ORBIS__) -wstring ConsoleSaveFileSplit::getPlayerDataFilenameForLoad(const PlayerUID& pUID) +std::wstring ConsoleSaveFileSplit::getPlayerDataFilenameForLoad(const PlayerUID& pUID) { return header.getPlayerDataFilenameForLoad( pUID ); } -wstring ConsoleSaveFileSplit::getPlayerDataFilenameForSave(const PlayerUID& pUID) +std::wstring ConsoleSaveFileSplit::getPlayerDataFilenameForSave(const PlayerUID& pUID) { return header.getPlayerDataFilenameForSave( pUID ); } @@ -1690,12 +1690,12 @@ void ConsoleSaveFileSplit::ConvertToLocalPlatform() return; } // convert each of the region files to the local platform - vector *allFilesInSave = getFilesWithPrefix(wstring(L"")); + vector *allFilesInSave = getFilesWithPrefix(std::wstring(L"")); for(AUTO_VAR(it, allFilesInSave->begin()); it < allFilesInSave->end(); ++it) { FileEntry *fe = *it; - wstring fName( fe->data.filename ); - wstring suffix(L".mcr"); + std::wstring fName( fe->data.filename ); + std::wstring suffix(L".mcr"); if( fName.compare(fName.length() - suffix.length(), suffix.length(), suffix) == 0 ) { app.DebugPrintf("Processing a region file: %ls\n",fName.c_str()); diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.h b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.h index a35a5838b..41c0523fd 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.h +++ b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.h @@ -54,7 +54,7 @@ private: FileEntry *GetRegionFileEntry(unsigned int regionIndex); - wstring m_fileName; + std::wstring m_fileName; bool m_autosave; // HANDLE hHeap; @@ -74,8 +74,8 @@ private: void PrepareForWrite( FileEntry *file, DWORD nNumberOfBytesToWrite ); void MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesToWrite); - bool GetNumericIdentifierFromName(const wstring &fileName, unsigned int *idOut); - wstring GetNameFromNumericIdentifier(unsigned int idIn); + bool GetNumericIdentifierFromName(const std::wstring &fileName, unsigned int *idOut); + std::wstring GetNameFromNumericIdentifier(unsigned int idIn); void processSubfilesForWrite(); void processSubfilesAfterWrite(); public: @@ -83,10 +83,10 @@ public: static int SaveRegionFilesCallback(LPVOID lpParam,bool bRes); private: - void _init(const wstring &fileName, LPVOID pvSaveData, DWORD fileSize, ESavePlatform plat); + void _init(const std::wstring &fileName, LPVOID pvSaveData, DWORD fileSize, ESavePlatform plat); public: - ConsoleSaveFileSplit(const wstring &fileName, LPVOID pvSaveData = NULL, DWORD fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); + ConsoleSaveFileSplit(const std::wstring &fileName, LPVOID pvSaveData = NULL, DWORD fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); ConsoleSaveFileSplit(ConsoleSaveFile *sourceSave, bool alreadySmallRegions = true, ProgressListener *progress = NULL); virtual ~ConsoleSaveFileSplit(); @@ -113,14 +113,14 @@ public: #endif virtual unsigned int getSizeOnDisk(); - virtual wstring getFilename(); + virtual std::wstring getFilename(); - virtual vector *getFilesWithPrefix(const wstring &prefix); + virtual vector *getFilesWithPrefix(const std::wstring &prefix); virtual vector *getRegionFilesByDimension(unsigned int dimensionIndex); #if defined(__PS3__) || defined(__ORBIS__) - virtual wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID); - virtual wstring getPlayerDataFilenameForSave(const PlayerUID& pUID); + virtual std::wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID); + virtual std::wstring getPlayerDataFilenameForSave(const PlayerUID& pUID); virtual vector *getValidPlayerDatFiles(); #endif //__PS3__ diff --git a/Minecraft.World/IO/Files/ConsoleSavePath.h b/Minecraft.World/IO/Files/ConsoleSavePath.h index 321b89033..1c91ca14d 100644 --- a/Minecraft.World/IO/Files/ConsoleSavePath.h +++ b/Minecraft.World/IO/Files/ConsoleSavePath.h @@ -4,12 +4,12 @@ using namespace std; class ConsoleSavePath { private: - wstring path; + std::wstring path; public: - ConsoleSavePath( const wstring &newPath ) { path = newPath; } + ConsoleSavePath( const std::wstring &newPath ) { path = newPath; } - wstring getName() const { return path; } + std::wstring getName() const { return path; } - wstring operator+( wstring &b ) { return path + b; } + std::wstring operator+( std::wstring &b ) { return path + b; } }; \ No newline at end of file diff --git a/Minecraft.World/IO/Files/File.cpp b/Minecraft.World/IO/Files/File.cpp index 67adfe805..0f457dd21 100644 --- a/Minecraft.World/IO/Files/File.cpp +++ b/Minecraft.World/IO/Files/File.cpp @@ -12,19 +12,19 @@ const wchar_t File::pathSeparator = L'\\'; #ifdef _XBOX -const wstring File::pathRoot = L"GAME:"; // Path root after pathSeparator has been removed +const std::wstring File::pathRoot = L"GAME:"; // Path root after pathSeparator has been removed #else -const wstring File::pathRoot = L""; // Path root after pathSeparator has been removed +const std::wstring File::pathRoot = L""; // Path root after pathSeparator has been removed #endif //Creates a new File instance from a parent abstract pathname and a child pathname string. -File::File( const File &parent, const wstring& child ) +File::File( const File &parent, const std::wstring& child ) { m_abstractPathName = parent.getPath() + pathSeparator + child; } //Creates a new File instance by converting the given pathname string into an abstract pathname. -File::File( const wstring& pathname ) //: parent( NULL ) +File::File( const std::wstring& pathname ) //: parent( NULL ) { // #ifndef _CONTENT_PACKAGE // char buf[256]; @@ -32,7 +32,7 @@ File::File( const wstring& pathname ) //: parent( NULL ) // printf("File::File - %s\n",buf); // #endif if( pathname.empty() ) - m_abstractPathName = wstring( L"" ); + m_abstractPathName = std::wstring( L"" ); else m_abstractPathName = pathname; @@ -42,12 +42,12 @@ File::File( const wstring& pathname ) //: parent( NULL ) if(finalPath.size() == 0) finalPath = path; m_abstractPathName = convStringToWstring(finalPath); #elif defined(_DURANGO) - wstring finalPath = StorageManager.GetMountedPath(m_abstractPathName.c_str()); + std::wstring finalPath = StorageManager.GetMountedPath(m_abstractPathName.c_str()); if(finalPath.size() == 0) finalPath = m_abstractPathName; m_abstractPathName = finalPath; #endif /* - vector path = stringSplit( pathname, pathSeparator ); + vector path = stringSplit( pathname, pathSeparator ); if( path.back().compare( pathRoot ) != 0 ) m_abstractPathName = path.back(); @@ -67,7 +67,7 @@ File::File( const wstring& pathname ) //: parent( NULL ) */ } -File::File( const wstring& parent, const wstring& child ) //: m_abstractPathName( child ) +File::File( const std::wstring& parent, const std::wstring& child ) //: m_abstractPathName( child ) { m_abstractPathName = pathRoot + pathSeparator + parent + pathSeparator + child; //this->parent = new File( parent ); @@ -75,7 +75,7 @@ File::File( const wstring& parent, const wstring& child ) //: m_abstractPathNam //Creates a new File instance by converting the given path vector into an abstract pathname. /* -File::File( vector *path ) : parent( NULL ) +File::File( vector *path ) : parent( NULL ) { m_abstractPathName = path->back(); path->pop_back(); @@ -157,9 +157,9 @@ bool File::mkdir() const // bool File::mkdirs() const { - vector path = stringSplit( m_abstractPathName, pathSeparator ); + vector path = stringSplit( m_abstractPathName, pathSeparator ); - wstring pathToHere = L""; + std::wstring pathToHere = L""; AUTO_VAR(itEnd, path.end()); for( AUTO_VAR(it, path.begin()); it != itEnd; it++ ) { @@ -729,14 +729,14 @@ __int64 File::lastModified() #endif } -const wstring File::getPath() const +const std::wstring File::getPath() const { /* - wstring path; + std::wstring path; if ( parent != NULL) path = parent->getPath(); else - path = wstring(pathRoot); + path = std::wstring(pathRoot); path.push_back( pathSeparator ); path.append(m_abstractPathName); @@ -744,7 +744,7 @@ const wstring File::getPath() const return m_abstractPathName; } -wstring File::getName() const +std::wstring File::getName() const { unsigned int sep = (unsigned int )(m_abstractPathName.find_last_of( this->pathSeparator )); return m_abstractPathName.substr( sep + 1, m_abstractPathName.length() ); diff --git a/Minecraft.World/IO/Files/File.h b/Minecraft.World/IO/Files/File.h index adca156f2..c91b0c071 100644 --- a/Minecraft.World/IO/Files/File.h +++ b/Minecraft.World/IO/Files/File.h @@ -11,13 +11,13 @@ public: static const wchar_t pathSeparator; // 4J Jev, the start of the file root - static const wstring pathRoot; + static const std::wstring pathRoot; File() { m_abstractPathName = L""; } - File( const File &parent, const wstring& child ); - File( const wstring& pathname ); - File( const wstring& parent, const wstring& child ); + File( const File &parent, const std::wstring& child ); + File( const std::wstring& pathname ); + File( const std::wstring& parent, const std::wstring& child ); bool _delete(); bool mkdir() const; bool mkdirs() const; @@ -29,18 +29,18 @@ public: bool isDirectory() const; __int64 length(); __int64 lastModified(); - const wstring getPath() const; // 4J Jev: TODO - wstring getName() const; + const std::wstring getPath() const; // 4J Jev: TODO + std::wstring getName() const; static int hash_fnct(const File &k); static bool eq_test(const File &x, const File &y); private: void _init(); - wstring m_abstractPathName; + std::wstring m_abstractPathName; // 4J Jev, just helper functions, change between paths and vector - //File(vector *path); + //File(vector *path); }; struct FileKeyHash diff --git a/Minecraft.World/IO/Files/FileHeader.cpp b/Minecraft.World/IO/Files/FileHeader.cpp index 9ca4dd12b..aa4fb965a 100644 --- a/Minecraft.World/IO/Files/FileHeader.cpp +++ b/Minecraft.World/IO/Files/FileHeader.cpp @@ -24,7 +24,7 @@ FileHeader::~FileHeader() } } -FileEntry *FileHeader::AddFile( const wstring &name, unsigned int length /* = 0 */ ) +FileEntry *FileHeader::AddFile( const std::wstring &name, unsigned int length /* = 0 */ ) { assert( name.length() < 64 ); @@ -350,7 +350,7 @@ void FileHeader::AdjustStartOffsets(FileEntry *file, DWORD nNumberOfBytesToWrite } } -bool FileHeader::fileExists( const wstring &name ) +bool FileHeader::fileExists( const std::wstring &name ) { for( unsigned int i = 0; i < fileTable.size(); ++i ) { @@ -363,7 +363,7 @@ bool FileHeader::fileExists( const wstring &name ) return false; } -vector *FileHeader::getFilesWithPrefix(const wstring &prefix) +vector *FileHeader::getFilesWithPrefix(const std::wstring &prefix) { vector *files = NULL; @@ -428,9 +428,9 @@ static wchar_t* findFilenameStart(wchar_t* str) return filenameStart; } -wstring FileHeader::getPlayerDataFilenameForLoad(const PlayerUID& pUID) +std::wstring FileHeader::getPlayerDataFilenameForLoad(const PlayerUID& pUID) { - wstring retVal = L""; + std::wstring retVal = L""; vector* pFiles = getDatFilesWithOnlineID(pUID); if(!pFiles) { @@ -455,7 +455,7 @@ wstring FileHeader::getPlayerDataFilenameForLoad(const PlayerUID& pUID) return retVal; } -wstring FileHeader::getPlayerDataFilenameForSave(const PlayerUID& pUID) +std::wstring FileHeader::getPlayerDataFilenameForSave(const PlayerUID& pUID) { // check if we're online first if(pUID.isSignedIntoPSN() == false) @@ -466,14 +466,14 @@ wstring FileHeader::getPlayerDataFilenameForSave(const PlayerUID& pUID) { // we've found a previous save, use the filename from it, as it might have the online part too // assert(pFiles->size() == 1); - wstring retVal = pFiles->at(0)->data.filename; + std::wstring retVal = pFiles->at(0)->data.filename; delete pFiles; return retVal; } } // we're either online, or we can't find a previous save, so use the standard filename - wstring retVal = pUID.toString() + L".dat"; + std::wstring retVal = pUID.toString() + L".dat"; return retVal; } diff --git a/Minecraft.World/IO/Files/FileHeader.h b/Minecraft.World/IO/Files/FileHeader.h index 6a724e0a5..1a12d42ae 100644 --- a/Minecraft.World/IO/Files/FileHeader.h +++ b/Minecraft.World/IO/Files/FileHeader.h @@ -164,7 +164,7 @@ public: ~FileHeader(); protected: - FileEntry *AddFile( const wstring &name, unsigned int length = 0 ); + FileEntry *AddFile( const std::wstring &name, unsigned int length = 0 ); void RemoveFile( FileEntry * ); void WriteHeader( LPVOID saveMem ); void ReadHeader( LPVOID saveMem, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL ); @@ -175,15 +175,15 @@ protected: void AdjustStartOffsets(FileEntry *file, DWORD nNumberOfBytesToWrite, bool subtract = false); - bool fileExists( const wstring &name ); + bool fileExists( const std::wstring &name ); - vector *getFilesWithPrefix(const wstring &prefix); + vector *getFilesWithPrefix(const std::wstring &prefix); vector *getValidPlayerDatFiles(); #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID); - wstring getPlayerDataFilenameForSave(const PlayerUID& pUID); + std::wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID); + std::wstring getPlayerDataFilenameForSave(const PlayerUID& pUID); vector *getDatFilesWithOnlineID(const PlayerUID& pUID); vector *getDatFilesWithMacAndUserID(const PlayerUID& pUID); vector *getDatFilesWithPrimaryUser(); diff --git a/Minecraft.World/IO/Files/FilenameFilter.h b/Minecraft.World/IO/Files/FilenameFilter.h index f81534bd6..1f0339b5d 100644 --- a/Minecraft.World/IO/Files/FilenameFilter.h +++ b/Minecraft.World/IO/Files/FilenameFilter.h @@ -9,5 +9,5 @@ class File; class FilenameFilter { public: - virtual bool accept(File *dir, const wstring& name) = 0; + virtual bool accept(File *dir, const std::wstring& name) = 0; }; \ No newline at end of file diff --git a/Minecraft.World/IO/NBT/ByteArrayTag.h b/Minecraft.World/IO/NBT/ByteArrayTag.h index ef962d142..96827cd87 100644 --- a/Minecraft.World/IO/NBT/ByteArrayTag.h +++ b/Minecraft.World/IO/NBT/ByteArrayTag.h @@ -7,8 +7,8 @@ class ByteArrayTag : public Tag public: byteArray data; - ByteArrayTag(const wstring &name) : Tag(name) { } - ByteArrayTag(const wstring &name, byteArray data) : Tag(name) {this->data = data; } // 4J - added ownData param + ByteArrayTag(const std::wstring &name) : Tag(name) { } + ByteArrayTag(const std::wstring &name, byteArray data) : Tag(name) {this->data = data; } // 4J - added ownData param void write(DataOutput *dos) { @@ -27,11 +27,11 @@ public: uint8_t getId() { return TAG_Byte_Array; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf, 32, L"[%d bytes]",data.length); - return wstring( buf ); + return std::wstring( buf ); } bool equals(Tag *obj) diff --git a/Minecraft.World/IO/NBT/ByteTag.h b/Minecraft.World/IO/NBT/ByteTag.h index a2274a6be..2e54755c9 100644 --- a/Minecraft.World/IO/NBT/ByteTag.h +++ b/Minecraft.World/IO/NBT/ByteTag.h @@ -5,18 +5,18 @@ class ByteTag : public Tag { public: uint8_t data; - ByteTag(const wstring &name) : Tag(name) {} - ByteTag(const wstring &name, uint8_t data) : Tag(name) {this->data = data; } + ByteTag(const std::wstring &name) : Tag(name) {} + ByteTag(const std::wstring &name, uint8_t data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeByte(data); } void load(DataInput *dis) { data = dis->readByte(); } uint8_t getId() { return TAG_Byte; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf,32,L"%d",data); - return wstring( buf ); + return std::wstring( buf ); } bool equals(Tag *obj) diff --git a/Minecraft.World/IO/NBT/CompoundTag.h b/Minecraft.World/IO/NBT/CompoundTag.h index 244de5179..d6399fdec 100644 --- a/Minecraft.World/IO/NBT/CompoundTag.h +++ b/Minecraft.World/IO/NBT/CompoundTag.h @@ -14,16 +14,16 @@ class CompoundTag : public Tag { private: - std::unordered_map tags; + std::unordered_map tags; public: CompoundTag() : Tag(L"") {} - CompoundTag(const wstring &name) : Tag(name) {} + CompoundTag(const std::wstring &name) : Tag(name) {} void write(DataOutput *dos) { AUTO_VAR(itEnd, tags.end()); - for( std::unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) + for( std::unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) { Tag::writeNamedTag(it->second, dos); } @@ -48,7 +48,7 @@ public: vector *ret = new vector; AUTO_VAR(itEnd, tags.end()); - for( std::unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) + for( std::unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) { ret->push_back(it->second); } @@ -62,7 +62,7 @@ public: void put(const wchar_t *name, Tag *tag) { - tags[name] = tag->setName(wstring( name )); + tags[name] = tag->setName(std::wstring( name )); } void putByte(const wchar_t * name, uint8_t value) @@ -95,7 +95,7 @@ public: tags[name] = (new DoubleTag(name,value)); } - void putString(const wchar_t *name, const wstring& value) + void putString(const wchar_t *name, const std::wstring& value) { tags[name] = (new StringTag(name,value)); } @@ -112,7 +112,7 @@ public: void putCompound(const wchar_t * name, CompoundTag *value) { - tags[name] = value->setName( wstring( name ) ); + tags[name] = value->setName( std::wstring( name ) ); } void putBoolean(const wchar_t * string, bool val) @@ -168,9 +168,9 @@ public: return ((DoubleTag *) tags[name])->data; } - wstring getString(const wchar_t * name) + std::wstring getString(const wchar_t * name) { - if (tags.find(name) == tags.end()) return wstring( L"" ); + if (tags.find(name) == tags.end()) return std::wstring( L"" ); return ((StringTag *) tags[name])->data; } @@ -203,19 +203,19 @@ public: return getByte(string) != static_cast(0); } - void remove(const wstring &name) + void remove(const std::wstring &name) { AUTO_VAR(it, tags.find(name)); if(it != tags.end()) tags.erase(it); //tags.remove(name); } - wstring toString() + std::wstring toString() { static const int bufSize = 32; static wchar_t buf[bufSize]; swprintf(buf,bufSize,L"%d entries",tags.size()); - return wstring( buf ); + return std::wstring( buf ); } void print(char *prefix, ostream out) diff --git a/Minecraft.World/IO/NBT/DoubleTag.h b/Minecraft.World/IO/NBT/DoubleTag.h index 6a2104798..35e2713ac 100644 --- a/Minecraft.World/IO/NBT/DoubleTag.h +++ b/Minecraft.World/IO/NBT/DoubleTag.h @@ -6,18 +6,18 @@ class DoubleTag : public Tag { public: double data; - DoubleTag(const wstring &name) : Tag(name) {} - DoubleTag(const wstring &name, double data) : Tag(name) {this->data = data; } + DoubleTag(const std::wstring &name) : Tag(name) {} + DoubleTag(const std::wstring &name, double data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeDouble(data); } void load(DataInput *dis) { data = dis->readDouble(); } uint8_t getId() { return TAG_Double; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf,32,L"%f",data); - return wstring( buf ); + return std::wstring( buf ); } Tag *copy() diff --git a/Minecraft.World/IO/NBT/EndTag.h b/Minecraft.World/IO/NBT/EndTag.h index 6ff27d535..105c8c8fa 100644 --- a/Minecraft.World/IO/NBT/EndTag.h +++ b/Minecraft.World/IO/NBT/EndTag.h @@ -5,13 +5,13 @@ class EndTag : public Tag { public: EndTag() : Tag(L"") {} - EndTag(const wstring &name) : Tag(name) {} + EndTag(const std::wstring &name) : Tag(name) {} void load(DataInput *dis) {}; void write(DataOutput *dos) {}; uint8_t getId() { return TAG_End; } - wstring toString() { return wstring( L"END" ); } + std::wstring toString() { return std::wstring( L"END" ); } Tag *copy() { diff --git a/Minecraft.World/IO/NBT/FloatTag.h b/Minecraft.World/IO/NBT/FloatTag.h index 60698bcaa..738f7e2ff 100644 --- a/Minecraft.World/IO/NBT/FloatTag.h +++ b/Minecraft.World/IO/NBT/FloatTag.h @@ -6,18 +6,18 @@ class FloatTag : public Tag { public: float data; - FloatTag(const wstring &name) : Tag(name) {} - FloatTag(const wstring &name, float data) : Tag(name) {this->data = data; } + FloatTag(const std::wstring &name) : Tag(name) {} + FloatTag(const std::wstring &name, float data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeFloat(data); } void load(DataInput *dis) { data = dis->readFloat(); } uint8_t getId() { return TAG_Float; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf, 32, L"%f",data); - return wstring( buf ); + return std::wstring( buf ); } Tag *copy() diff --git a/Minecraft.World/IO/NBT/IntArrayTag.h b/Minecraft.World/IO/NBT/IntArrayTag.h index 1e7f60502..7520186fc 100644 --- a/Minecraft.World/IO/NBT/IntArrayTag.h +++ b/Minecraft.World/IO/NBT/IntArrayTag.h @@ -8,11 +8,11 @@ class IntArrayTag : public Tag public: intArray data; - IntArrayTag(const wstring &name) : Tag(name) + IntArrayTag(const std::wstring &name) : Tag(name) { } - IntArrayTag(const wstring &name, intArray data) : Tag(name) + IntArrayTag(const std::wstring &name, intArray data) : Tag(name) { this->data = data; } @@ -40,11 +40,11 @@ public: uint8_t getId() { return TAG_Int_Array; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf, 32, L"[%d bytes]",data.length); - return wstring( buf ); + return std::wstring( buf ); } bool equals(Tag *obj) diff --git a/Minecraft.World/IO/NBT/IntTag.h b/Minecraft.World/IO/NBT/IntTag.h index 6694f2e0a..9dc9aaf25 100644 --- a/Minecraft.World/IO/NBT/IntTag.h +++ b/Minecraft.World/IO/NBT/IntTag.h @@ -5,18 +5,18 @@ class IntTag : public Tag { public: int data; - IntTag(const wstring &name) : Tag(name) {} - IntTag(const wstring &name, int data) : Tag(name) {this->data = data; } + IntTag(const std::wstring &name) : Tag(name) {} + IntTag(const std::wstring &name, int data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeInt(data); } void load(DataInput *dis) { data = dis->readInt(); } uint8_t getId() { return TAG_Int; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf, 32, L"%d", data); - return wstring( buf ); + return std::wstring( buf ); } Tag *copy() diff --git a/Minecraft.World/IO/NBT/ListTag.h b/Minecraft.World/IO/NBT/ListTag.h index fd077328d..4ab8938fd 100644 --- a/Minecraft.World/IO/NBT/ListTag.h +++ b/Minecraft.World/IO/NBT/ListTag.h @@ -10,7 +10,7 @@ private: public: ListTag() : Tag(L"") {} - ListTag(const wstring &name) : Tag(name) {} + ListTag(const std::wstring &name) : Tag(name) {} void write(DataOutput *dos) { @@ -40,11 +40,11 @@ public: uint8_t getId() { return TAG_List; } - wstring toString() + std::wstring toString() { static wchar_t buf[64]; swprintf(buf,64,L"%d entries of type %ls",list.size(),Tag::getTagName(type)); - return wstring( buf ); + return std::wstring( buf ); } void print(char *prefix, ostream out) diff --git a/Minecraft.World/IO/NBT/LongTag.h b/Minecraft.World/IO/NBT/LongTag.h index a5bc079fc..126a102f2 100644 --- a/Minecraft.World/IO/NBT/LongTag.h +++ b/Minecraft.World/IO/NBT/LongTag.h @@ -5,18 +5,18 @@ class LongTag : public Tag { public: __int64 data; - LongTag(const wstring &name) : Tag(name) {} - LongTag(const wstring &name, __int64 data) : Tag(name) {this->data = data; } + LongTag(const std::wstring &name) : Tag(name) {} + LongTag(const std::wstring &name, __int64 data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis) { data = dis->readLong(); } uint8_t getId() { return TAG_Long; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf,32,L"%I64d",data); - return wstring(buf); + return std::wstring(buf); } Tag *copy() diff --git a/Minecraft.World/IO/NBT/ShortTag.h b/Minecraft.World/IO/NBT/ShortTag.h index 285a287b4..2f04501d6 100644 --- a/Minecraft.World/IO/NBT/ShortTag.h +++ b/Minecraft.World/IO/NBT/ShortTag.h @@ -5,18 +5,18 @@ class ShortTag : public Tag { public: short data; - ShortTag(const wstring &name) : Tag(name) {} - ShortTag(const wstring &name, int data) : Tag(name) {this->data = data; } + ShortTag(const std::wstring &name) : Tag(name) {} + ShortTag(const std::wstring &name, int data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeShort(data); } void load(DataInput *dis) { data = dis->readShort(); } uint8_t getId() { return TAG_Short; } - wstring toString() + std::wstring toString() { static wchar_t buf[32]; swprintf(buf,32,L"%d",data); - return wstring( buf ); + return std::wstring( buf ); } Tag *copy() diff --git a/Minecraft.World/IO/NBT/StringTag.h b/Minecraft.World/IO/NBT/StringTag.h index a1dad58f5..17a4a286b 100644 --- a/Minecraft.World/IO/NBT/StringTag.h +++ b/Minecraft.World/IO/NBT/StringTag.h @@ -4,9 +4,9 @@ class StringTag : public Tag { public: - wstring data; - StringTag(const wstring &name) : Tag(name) {} - StringTag(const wstring &name, const wstring& data) : Tag(name) {this->data = data; } + std::wstring data; + StringTag(const std::wstring &name) : Tag(name) {} + StringTag(const std::wstring &name, const std::wstring& data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { @@ -20,7 +20,7 @@ public: uint8_t getId() { return TAG_String; } - wstring toString() + std::wstring toString() { return data; } diff --git a/Minecraft.World/IO/NBT/Tag.cpp b/Minecraft.World/IO/NBT/Tag.cpp index a09a9958f..28cfcdf11 100644 --- a/Minecraft.World/IO/NBT/Tag.cpp +++ b/Minecraft.World/IO/NBT/Tag.cpp @@ -12,7 +12,7 @@ #include "ListTag.h" #include "CompoundTag.h" -Tag::Tag(const wstring &name) +Tag::Tag(const std::wstring &name) { if (name.empty()) { @@ -54,7 +54,7 @@ void Tag::print(ostream out) void Tag::print(char *prefix, wostream out) { - wstring name = getName(); + std::wstring name = getName(); out << prefix; out << getTagName(getId()); @@ -66,12 +66,12 @@ void Tag::print(char *prefix, wostream out) out << toString() << endl; } -wstring Tag::getName() +std::wstring Tag::getName() { return name; } -Tag *Tag::setName(const wstring& name) +Tag *Tag::setName(const std::wstring& name) { this->name = name; return this; @@ -92,7 +92,7 @@ Tag *Tag::readNamedTag(DataInput *dis) return new EndTag(); } - wstring name = dis->readUTF();//new String(bytes, "UTF-8"); + std::wstring name = dis->readUTF();//new String(bytes, "UTF-8"); Tag *tag = newTag(type, name); // short length = dis.readShort(); @@ -116,7 +116,7 @@ void Tag::writeNamedTag(Tag *tag, DataOutput *dos) tag->write(dos); } -Tag *Tag::newTag(uint8_t type, const wstring &name) +Tag *Tag::newTag(uint8_t type, const std::wstring &name) { switch (type) { diff --git a/Minecraft.World/IO/NBT/Tag.h b/Minecraft.World/IO/NBT/Tag.h index a2e0b2af6..2c00d4e88 100644 --- a/Minecraft.World/IO/NBT/Tag.h +++ b/Minecraft.World/IO/NBT/Tag.h @@ -21,23 +21,23 @@ public: static const uint8_t TAG_Int_Array = static_cast(11); private: - wstring name; + std::wstring name; protected: - Tag(const wstring &name); + Tag(const std::wstring &name); public: virtual void write(DataOutput *dos) = 0; virtual void load(DataInput *dis) = 0; - virtual wstring toString() = 0; + virtual std::wstring toString() = 0; virtual uint8_t getId() = 0; void print(ostream out); void print(char *prefix, wostream out); - wstring getName(); - Tag *setName(const wstring& name); + std::wstring getName(); + Tag *setName(const std::wstring& name); static Tag *readNamedTag(DataInput *dis); static void writeNamedTag(Tag *tag, DataOutput *dos); - static Tag *newTag(uint8_t type, const wstring &name); + static Tag *newTag(uint8_t type, const std::wstring &name); static const wchar_t *getTagName(uint8_t type); virtual ~Tag() {} virtual bool equals(Tag *obj); // 4J Brought forward from 1.2 diff --git a/Minecraft.World/IO/Streams/BufferedReader.cpp b/Minecraft.World/IO/Streams/BufferedReader.cpp index 25f98cd45..5e2871057 100644 --- a/Minecraft.World/IO/Streams/BufferedReader.cpp +++ b/Minecraft.World/IO/Streams/BufferedReader.cpp @@ -136,9 +136,9 @@ int BufferedReader::read(wchar_t cbuf[], unsigned int off, unsigned int len) //or a carriage return followed immediately by a linefeed. //Returns: //A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached -wstring BufferedReader::readLine() +std::wstring BufferedReader::readLine() { - wstring output = L""; + std::wstring output = L""; bool newLineCharFound = false; while( readMark < bufferedMark ) diff --git a/Minecraft.World/IO/Streams/BufferedReader.h b/Minecraft.World/IO/Streams/BufferedReader.h index b2f7fc676..780a76b09 100644 --- a/Minecraft.World/IO/Streams/BufferedReader.h +++ b/Minecraft.World/IO/Streams/BufferedReader.h @@ -23,5 +23,5 @@ public: virtual void close(); virtual int read(); virtual int read(wchar_t cbuf[], unsigned int off, unsigned int len); - wstring readLine(); + std::wstring readLine(); }; \ No newline at end of file diff --git a/Minecraft.World/IO/Streams/DataInput.h b/Minecraft.World/IO/Streams/DataInput.h index 2b2e341c0..76a8075bc 100644 --- a/Minecraft.World/IO/Streams/DataInput.h +++ b/Minecraft.World/IO/Streams/DataInput.h @@ -16,7 +16,7 @@ public: virtual __int64 readLong() = 0; virtual short readShort() = 0; virtual wchar_t readChar() = 0; - virtual wstring readUTF() = 0; + virtual std::wstring readUTF() = 0; virtual PlayerUID readPlayerUID() = 0; // 4J Added virtual int skipBytes(int n) = 0; }; diff --git a/Minecraft.World/IO/Streams/DataInputStream.cpp b/Minecraft.World/IO/Streams/DataInputStream.cpp index 9aa78a335..00c948fcd 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.cpp +++ b/Minecraft.World/IO/Streams/DataInputStream.cpp @@ -354,9 +354,9 @@ short DataInputStream::readShort() // //Returns: //a Unicode string. -wstring DataInputStream::readUTF() +std::wstring DataInputStream::readUTF() { - wstring outputString; + std::wstring outputString; if (stream == NULL) { app.DebugPrintf("DataInputStream::readUTF() but underlying stream is NULL\n"); diff --git a/Minecraft.World/IO/Streams/DataInputStream.h b/Minecraft.World/IO/Streams/DataInputStream.h index a70b16907..fd039177e 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.h +++ b/Minecraft.World/IO/Streams/DataInputStream.h @@ -26,7 +26,7 @@ public: virtual int readInt(); virtual __int64 readLong(); virtual short readShort(); - virtual wstring readUTF(); + virtual std::wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added diff --git a/Minecraft.World/IO/Streams/DataOutput.h b/Minecraft.World/IO/Streams/DataOutput.h index 9df3dd957..183aa62ad 100644 --- a/Minecraft.World/IO/Streams/DataOutput.h +++ b/Minecraft.World/IO/Streams/DataOutput.h @@ -14,7 +14,7 @@ public: virtual void writeShort(short a) = 0; virtual void writeBoolean(bool v) = 0; virtual void writeChar(wchar_t v) = 0; - virtual void writeChars(const wstring& s) = 0; - virtual void writeUTF(const wstring& a) = 0; + virtual void writeChars(const std::wstring& s) = 0; + virtual void writeUTF(const std::wstring& a) = 0; virtual void writePlayerUID(PlayerUID player) = 0; // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/IO/Streams/DataOutputStream.cpp b/Minecraft.World/IO/Streams/DataOutputStream.cpp index 41feda0be..f7e9585b2 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.cpp +++ b/Minecraft.World/IO/Streams/DataOutputStream.cpp @@ -159,7 +159,7 @@ void DataOutputStream::writeChar( wchar_t v ) //If no exception is thrown, the counter written is incremented by twice the length of s. //Parameters: //s - a String value to be written. -void DataOutputStream::writeChars(const wstring& str) +void DataOutputStream::writeChars(const std::wstring& str) { for( unsigned int i = 0; i < str.length(); i++) { @@ -189,7 +189,7 @@ void DataOutputStream::writeBoolean(bool b) //This will be at least two plus the length of str, and at most two plus thrice the length of str. //Parameters: //str - a string to be written. -void DataOutputStream::writeUTF(const wstring& str) +void DataOutputStream::writeUTF(const std::wstring& str) { int strlen = (int)str.length(); int utflen = 0; diff --git a/Minecraft.World/IO/Streams/DataOutputStream.h b/Minecraft.World/IO/Streams/DataOutputStream.h index dcb81cd6d..60163701c 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.h +++ b/Minecraft.World/IO/Streams/DataOutputStream.h @@ -29,9 +29,9 @@ public: virtual void writeLong(__int64 a); virtual void writeShort(short a); virtual void writeChar(wchar_t a); - virtual void writeChars(const wstring& a); + virtual void writeChars(const std::wstring& a); virtual void writeBoolean(bool b); - virtual void writeUTF(const wstring& a); + virtual void writeUTF(const std::wstring& a); virtual void writePlayerUID(PlayerUID player); virtual void flush(); }; \ No newline at end of file diff --git a/Minecraft.World/IO/Streams/InputStream.cpp b/Minecraft.World/IO/Streams/InputStream.cpp index 2605cd365..15d621007 100644 --- a/Minecraft.World/IO/Streams/InputStream.cpp +++ b/Minecraft.World/IO/Streams/InputStream.cpp @@ -3,7 +3,7 @@ #include "InputOutputStream.h" #include "InputStream.h" -InputStream *InputStream::getResourceAsStream(const wstring &fileName) +InputStream *InputStream::getResourceAsStream(const std::wstring &fileName) { return new FileInputStream( File( fileName ) ); } \ No newline at end of file diff --git a/Minecraft.World/IO/Streams/InputStream.h b/Minecraft.World/IO/Streams/InputStream.h index af0ff5934..477d52df8 100644 --- a/Minecraft.World/IO/Streams/InputStream.h +++ b/Minecraft.World/IO/Streams/InputStream.h @@ -13,5 +13,5 @@ public: virtual void close() = 0; virtual __int64 skip(__int64 n) = 0; - static InputStream *getResourceAsStream(const wstring &fileName); + static InputStream *getResourceAsStream(const std::wstring &fileName); }; \ No newline at end of file diff --git a/Minecraft.World/Items/ArmorItem.cpp b/Minecraft.World/Items/ArmorItem.cpp index 71ac4b01d..ba634db13 100644 --- a/Minecraft.World/Items/ArmorItem.cpp +++ b/Minecraft.World/Items/ArmorItem.cpp @@ -9,11 +9,11 @@ const int ArmorItem::healthPerSlot[] = { 11, 16, 15, 13 }; -const wstring ArmorItem::LEATHER_OVERLAYS[] = { +const std::wstring ArmorItem::LEATHER_OVERLAYS[] = { L"helmetCloth_overlay", L"chestplateCloth_overlay", L"leggingsCloth_overlay", L"bootsCloth_overlay" }; -const wstring ArmorItem::TEXTURE_EMPTY_SLOTS[] = { +const std::wstring ArmorItem::TEXTURE_EMPTY_SLOTS[] = { L"slot_empty_helmet", L"slot_empty_chestplate", L"slot_empty_leggings", L"slot_empty_boots" }; diff --git a/Minecraft.World/Items/ArmorItem.h b/Minecraft.World/Items/ArmorItem.h index 04b483e25..ed5746c7c 100644 --- a/Minecraft.World/Items/ArmorItem.h +++ b/Minecraft.World/Items/ArmorItem.h @@ -13,10 +13,10 @@ public: private: static const int healthPerSlot[]; - static const wstring LEATHER_OVERLAYS[] ; + static const std::wstring LEATHER_OVERLAYS[] ; public: - static const wstring TEXTURE_EMPTY_SLOTS[]; + static const std::wstring TEXTURE_EMPTY_SLOTS[]; public: class ArmorMaterial diff --git a/Minecraft.World/Items/BowItem.cpp b/Minecraft.World/Items/BowItem.cpp index d052b2f87..06c52c670 100644 --- a/Minecraft.World/Items/BowItem.cpp +++ b/Minecraft.World/Items/BowItem.cpp @@ -8,7 +8,7 @@ #include "BowItem.h" #include "../Util/SoundTypes.h" -const wstring BowItem::TEXTURE_PULL[] = {L"bow_pull_0", L"bow_pull_1", L"bow_pull_2"}; +const std::wstring BowItem::TEXTURE_PULL[] = {L"bow_pull_0", L"bow_pull_1", L"bow_pull_2"}; BowItem::BowItem(int id) : Item( id ) { diff --git a/Minecraft.World/Items/BowItem.h b/Minecraft.World/Items/BowItem.h index 76b795f98..1c28494ca 100644 --- a/Minecraft.World/Items/BowItem.h +++ b/Minecraft.World/Items/BowItem.h @@ -8,7 +8,7 @@ class Level; class BowItem : public Item { public: - static const wstring TEXTURE_PULL[]; + static const std::wstring TEXTURE_PULL[]; static const int MAX_DRAW_DURATION = 20 * 1; private: diff --git a/Minecraft.World/Items/ClockItem.cpp b/Minecraft.World/Items/ClockItem.cpp index 33c249906..9e8a6d551 100644 --- a/Minecraft.World/Items/ClockItem.cpp +++ b/Minecraft.World/Items/ClockItem.cpp @@ -5,9 +5,9 @@ #include "../Headers/net.minecraft.world.h" #ifdef __PSVITA__ -const wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"clockP0"}; +const std::wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"clockP0"}; #else -const wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"clockP0",L"clockP1",L"clockP2",L"clockP3"}; +const std::wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"clockP0",L"clockP1",L"clockP2",L"clockP3"}; #endif ClockItem::ClockItem(int id) : Item(id) diff --git a/Minecraft.World/Items/ClockItem.h b/Minecraft.World/Items/ClockItem.h index 3ee4b5a46..3b268422b 100644 --- a/Minecraft.World/Items/ClockItem.h +++ b/Minecraft.World/Items/ClockItem.h @@ -7,7 +7,7 @@ class ClockItem : public Item { private: Icon **icons; - static const wstring TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT]; + static const std::wstring TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT]; public: ClockItem(int id); diff --git a/Minecraft.World/Items/CompassItem.cpp b/Minecraft.World/Items/CompassItem.cpp index d81646d25..20b1d9d3d 100644 --- a/Minecraft.World/Items/CompassItem.cpp +++ b/Minecraft.World/Items/CompassItem.cpp @@ -5,9 +5,9 @@ #include "../Headers/net.minecraft.world.h" #ifdef __PSVITA__ -const wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0"}; +const std::wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0"}; #else -const wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0",L"compassP1",L"compassP2",L"compassP3"}; +const std::wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0",L"compassP1",L"compassP2",L"compassP3"}; #endif CompassItem::CompassItem(int id) : Item(id) diff --git a/Minecraft.World/Items/CompassItem.h b/Minecraft.World/Items/CompassItem.h index b975144ac..83399f609 100644 --- a/Minecraft.World/Items/CompassItem.h +++ b/Minecraft.World/Items/CompassItem.h @@ -7,7 +7,7 @@ class CompassItem : public Item { private: Icon **icons; - static const wstring TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT]; + static const std::wstring TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT]; public: CompassItem(int id); diff --git a/Minecraft.World/Items/DyePowderItem.cpp b/Minecraft.World/Items/DyePowderItem.cpp index f9a038033..0251593fb 100644 --- a/Minecraft.World/Items/DyePowderItem.cpp +++ b/Minecraft.World/Items/DyePowderItem.cpp @@ -61,7 +61,7 @@ const unsigned int DyePowderItem::COLOR_USE_DESCS[] = IDS_DESC_DYE_WHITE }; -const wstring DyePowderItem::COLOR_TEXTURES[] = +const std::wstring DyePowderItem::COLOR_TEXTURES[] = { L"dyePowder_black", L"dyePowder_red", L"dyePowder_green", L"dyePowder_brown", L"dyePowder_blue", L"dyePowder_purple", L"dyePowder_cyan", L"dyePowder_silver", L"dyePowder_gray", L"dyePowder_pink", L"dyePowder_lime", L"dyePowder_yellow", L"dyePowder_lightBlue", L"dyePowder_magenta", L"dyePowder_orange", L"dyePowder_white"}; diff --git a/Minecraft.World/Items/DyePowderItem.h b/Minecraft.World/Items/DyePowderItem.h index df6147b90..694960663 100644 --- a/Minecraft.World/Items/DyePowderItem.h +++ b/Minecraft.World/Items/DyePowderItem.h @@ -12,7 +12,7 @@ class DyePowderItem : public Item public: static const unsigned int COLOR_DESCS[]; static const unsigned int COLOR_USE_DESCS[]; - static const wstring COLOR_TEXTURES[]; + static const std::wstring COLOR_TEXTURES[]; static const int COLOR_RGB[]; static const int BLACK; diff --git a/Minecraft.World/Items/EnchantedBookItem.cpp b/Minecraft.World/Items/EnchantedBookItem.cpp index 963646a89..3ca10d75e 100644 --- a/Minecraft.World/Items/EnchantedBookItem.cpp +++ b/Minecraft.World/Items/EnchantedBookItem.cpp @@ -4,7 +4,7 @@ #include "../Util/WeighedTreasure.h" #include "EnchantedBookItem.h" -const wstring EnchantedBookItem::TAG_STORED_ENCHANTMENTS = L"StoredEnchantments"; +const std::wstring EnchantedBookItem::TAG_STORED_ENCHANTMENTS = L"StoredEnchantments"; EnchantedBookItem::EnchantedBookItem(int id) : Item(id) { @@ -43,7 +43,7 @@ ListTag *EnchantedBookItem::getEnchantments(std::shared_ptr *) item->tag->get((wchar_t *)TAG_STORED_ENCHANTMENTS.c_str()); } -void EnchantedBookItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void EnchantedBookItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { Item::appendHoverText(itemInstance, player, lines, advanced, unformattedStrings); @@ -51,7 +51,7 @@ void EnchantedBookItem::appendHoverText(std::shared_ptr itemInstan if (list != NULL) { - wstring unformatted = L""; + std::wstring unformatted = L""; for (int i = 0; i < list->size(); i++) { int type = list->get(i)->getShort((wchar_t *)ItemInstance::TAG_ENCH_ID); diff --git a/Minecraft.World/Items/EnchantedBookItem.h b/Minecraft.World/Items/EnchantedBookItem.h index 5b642b72c..e16adc9ba 100644 --- a/Minecraft.World/Items/EnchantedBookItem.h +++ b/Minecraft.World/Items/EnchantedBookItem.h @@ -7,7 +7,7 @@ class EnchantmentInstance; class EnchantedBookItem : public Item { public: - static const wstring TAG_STORED_ENCHANTMENTS; + static const std::wstring TAG_STORED_ENCHANTMENTS; EnchantedBookItem(int id); @@ -15,7 +15,7 @@ public: bool isEnchantable(std::shared_ptr itemInstance); const Rarity *getRarity(std::shared_ptr itemInstance); ListTag *getEnchantments(std::shared_ptr item); - void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); + void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); void addEnchantment(std::shared_ptr item, EnchantmentInstance *enchantment); std::shared_ptr createForEnchantment(EnchantmentInstance *enchant); void createForEnchantment(Enchantment *enchant, vector > *items); diff --git a/Minecraft.World/Items/FishingRodItem.cpp b/Minecraft.World/Items/FishingRodItem.cpp index b9d4f49ea..a709bf81f 100644 --- a/Minecraft.World/Items/FishingRodItem.cpp +++ b/Minecraft.World/Items/FishingRodItem.cpp @@ -13,7 +13,7 @@ #include "FishingRodItem.h" #include "../Util/SoundTypes.h" -const wstring FishingRodItem::TEXTURE_EMPTY = L"fishingRod_empty"; +const std::wstring FishingRodItem::TEXTURE_EMPTY = L"fishingRod_empty"; FishingRodItem::FishingRodItem(int id) : Item(id) { diff --git a/Minecraft.World/Items/FishingRodItem.h b/Minecraft.World/Items/FishingRodItem.h index 42c02eb55..2d16d6b1e 100644 --- a/Minecraft.World/Items/FishingRodItem.h +++ b/Minecraft.World/Items/FishingRodItem.h @@ -9,7 +9,7 @@ class Level; class FishingRodItem : public Item { public: - static const wstring TEXTURE_EMPTY; + static const std::wstring TEXTURE_EMPTY; private: Icon *emptyIcon; diff --git a/Minecraft.World/Items/Item.cpp b/Minecraft.World/Items/Item.cpp index 84c42ebc8..14b841f6e 100644 --- a/Minecraft.World/Items/Item.cpp +++ b/Minecraft.World/Items/Item.cpp @@ -17,7 +17,7 @@ typedef Item::Tier _Tier; -wstring Item::ICON_DESCRIPTION_PREFIX = L"item."; +std::wstring Item::ICON_DESCRIPTION_PREFIX = L"item."; const _Tier *_Tier::WOOD = new _Tier(0, 59, 2, 0, 15); // const _Tier *_Tier::STONE = new _Tier(1, 131, 4, 1, 5); // @@ -582,7 +582,7 @@ int Item::getMaterial() return this->m_iMaterial; } -Item *Item::setTextureName(const wstring &name) +Item *Item::setTextureName(const std::wstring &name) { m_textureName = name; @@ -812,7 +812,7 @@ bool Item::hasCraftingRemainingItem() return craftingRemainingItem != NULL; } -wstring Item::getName() +std::wstring Item::getName() { return L"";//I18n::get(getDescriptionId() + L".name"); } @@ -848,13 +848,13 @@ void Item::releaseUsing(std::shared_ptr itemInstance, Level *level { } -Item *Item::setPotionBrewingFormula(const wstring &potionBrewingFormula) +Item *Item::setPotionBrewingFormula(const std::wstring &potionBrewingFormula) { this->potionBrewingFormula = potionBrewingFormula; return this; } -wstring Item::getPotionBrewingFormula() +std::wstring Item::getPotionBrewingFormula() { return potionBrewingFormula; } @@ -864,11 +864,11 @@ bool Item::hasPotionBrewingFormula() return !potionBrewingFormula.empty(); } -void Item::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void Item::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { } -wstring Item::getHoverName(std::shared_ptr itemInstance) +std::wstring Item::getHoverName(std::shared_ptr itemInstance) { //String elementName = ("" + Language.getInstance().getElementName(getDescription(itemInstance))).trim(); //return elementName; diff --git a/Minecraft.World/Items/Item.h b/Minecraft.World/Items/Item.h index 8cd7ac846..80a5a9fd0 100644 --- a/Minecraft.World/Items/Item.h +++ b/Minecraft.World/Items/Item.h @@ -129,7 +129,7 @@ public: protected: static const int ICON_COLUMNS = ITEM_ICON_COLUMNS; - static wstring ICON_DESCRIPTION_PREFIX; // 4J Stu - Was const but we have to static initialise it outside of this class + static std::wstring ICON_DESCRIPTION_PREFIX; // 4J Stu - Was const but we have to static initialise it outside of this class public: @@ -595,7 +595,7 @@ protected: private: Item *craftingRemainingItem; - wstring potionBrewingFormula; + std::wstring potionBrewingFormula; // 4J Stu - A value from strings.h, that is the name of the item unsigned int descriptionId; @@ -603,14 +603,14 @@ private: // 4J Stu - A value from strings.h that says what this does unsigned int useDescriptionId; - wstring m_textureName; + std::wstring m_textureName; protected: Item(int id); public: // 4J Using per-item textures now - Item *setTextureName(const wstring &name); + Item *setTextureName(const std::wstring &name); Item *setMaxStackSize(int max); Item *setBaseItemTypeAndMaterial(int iType,int iMaterial); int getBaseItemType(); @@ -695,13 +695,13 @@ public: virtual void releaseUsing(std::shared_ptr itemInstance, Level *level, std::shared_ptr player, int durationLeft); protected: - virtual Item *setPotionBrewingFormula(const wstring &potionBrewingFormula); + virtual Item *setPotionBrewingFormula(const std::wstring &potionBrewingFormula); public: - virtual wstring getPotionBrewingFormula(); + virtual std::wstring getPotionBrewingFormula(); virtual bool hasPotionBrewingFormula(); - virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); // 4J Added unformattedStrings - virtual wstring getHoverName(std::shared_ptr itemInstance); + virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); // 4J Added unformattedStrings + virtual std::wstring getHoverName(std::shared_ptr itemInstance); virtual bool isFoil(std::shared_ptr itemInstance); virtual const Rarity *getRarity(std::shared_ptr itemInstance); virtual bool isEnchantable(std::shared_ptr itemInstance); diff --git a/Minecraft.World/Items/ItemInstance.cpp b/Minecraft.World/Items/ItemInstance.cpp index 8b091b5de..fbafb34b8 100644 --- a/Minecraft.World/Items/ItemInstance.cpp +++ b/Minecraft.World/Items/ItemInstance.cpp @@ -389,7 +389,7 @@ std::shared_ptr ItemInstance::clone(std::shared_ptr return item == NULL ? nullptr : item->copy(); } -wstring ItemInstance::toString() +std::wstring ItemInstance::toString() { //return count + "x" + Item::items[id]->getDescriptionId() + "@" + auxValue; @@ -470,9 +470,9 @@ void ItemInstance::setTag(CompoundTag *tag) this->tag = tag; } -wstring ItemInstance::getHoverName() +std::wstring ItemInstance::getHoverName() { - wstring title = getItem()->getHoverName(shared_from_this()); + std::wstring title = getItem()->getHoverName(shared_from_this()); if (tag != NULL && tag->contains(L"display")) { @@ -487,7 +487,7 @@ wstring ItemInstance::getHoverName() return title; } -void ItemInstance::setHoverName(const wstring &name) +void ItemInstance::setHoverName(const std::wstring &name) { if (tag == NULL) tag = new CompoundTag(); if (!tag->contains(L"display")) tag->putCompound(L"display", new CompoundTag()); @@ -501,11 +501,11 @@ bool ItemInstance::hasCustomHoverName() return tag->getCompound(L"display")->contains(L"Name"); } -vector *ItemInstance::getHoverText(std::shared_ptr player, bool advanced, vector &unformattedStrings) +vector *ItemInstance::getHoverText(std::shared_ptr player, bool advanced, vector &unformattedStrings) { - vector *lines = new vector(); + vector *lines = new vector(); Item *item = Item::items[id]; - wstring title = getHoverName(); + std::wstring title = getHoverName(); // 4J Stu - We don't do italics, but do change colour. But handle this later in the process due to text length measuring on the Xbox360 //if (hasCustomHoverName()) @@ -557,7 +557,7 @@ vector *ItemInstance::getHoverText(std::shared_ptr player, bool if (Enchantment::enchantments[type] != NULL) { - wstring unformatted = L""; + std::wstring unformatted = L""; lines->push_back(Enchantment::enchantments[type]->getFullname(level, unformatted)); unformattedStrings.push_back(unformatted); } @@ -568,9 +568,9 @@ vector *ItemInstance::getHoverText(std::shared_ptr player, bool } // 4J Added -vector *ItemInstance::getHoverTextOnly(std::shared_ptr player, bool advanced, vector &unformattedStrings) +vector *ItemInstance::getHoverTextOnly(std::shared_ptr player, bool advanced, vector &unformattedStrings) { - vector *lines = new vector(); + vector *lines = new vector(); Item *item = Item::items[id]; item->appendHoverText(shared_from_this(), player, lines, advanced, unformattedStrings); @@ -587,7 +587,7 @@ vector *ItemInstance::getHoverTextOnly(std::shared_ptr player, if (Enchantment::enchantments[type] != NULL) { - wstring unformatted = L""; + std::wstring unformatted = L""; lines->push_back(Enchantment::enchantments[type]->getFullname(level,unformatted)); unformattedStrings.push_back(unformatted); } @@ -632,7 +632,7 @@ bool ItemInstance::isEnchanted() return false; } -void ItemInstance::addTagElement(wstring name, Tag *tag) +void ItemInstance::addTagElement(std::wstring name, Tag *tag) { if (this->tag == NULL) { diff --git a/Minecraft.World/Items/ItemInstance.h b/Minecraft.World/Items/ItemInstance.h index 82f6e4a53..e04901312 100644 --- a/Minecraft.World/Items/ItemInstance.h +++ b/Minecraft.World/Items/ItemInstance.h @@ -112,7 +112,7 @@ public: virtual unsigned int getDescriptionId(int iData = -1); virtual ItemInstance *setDescriptionId(unsigned int id); static std::shared_ptr clone(std::shared_ptr item); - wstring toString(); + std::wstring toString(); void inventoryTick(Level *level, std::shared_ptr owner, int slot, bool selected); void onCraftedBy(Level *level, std::shared_ptr player, int craftCount); bool equals(std::shared_ptr ii); @@ -126,17 +126,17 @@ public: CompoundTag *getTag(); ListTag *getEnchantmentTags(); void setTag(CompoundTag *tag); - wstring getHoverName(); - void setHoverName(const wstring &name); + std::wstring getHoverName(); + void setHoverName(const std::wstring &name); bool hasCustomHoverName(); - vector *getHoverText(std::shared_ptr player, bool advanced, vector &unformattedStrings); - vector *getHoverTextOnly(std::shared_ptr player, bool advanced, vector &unformattedStrings); // 4J Added + vector *getHoverText(std::shared_ptr player, bool advanced, vector &unformattedStrings); + vector *getHoverTextOnly(std::shared_ptr player, bool advanced, vector &unformattedStrings); // 4J Added bool isFoil(); const Rarity *getRarity(); bool isEnchantable(); void enchant(const Enchantment *enchantment, int level); bool isEnchanted(); - void addTagElement(wstring name, Tag *tag); + void addTagElement(std::wstring name, Tag *tag); // 4J Added void set4JData(int data); diff --git a/Minecraft.World/Items/MapItem.cpp b/Minecraft.World/Items/MapItem.cpp index e15558f8e..805a99259 100644 --- a/Minecraft.World/Items/MapItem.cpp +++ b/Minecraft.World/Items/MapItem.cpp @@ -21,7 +21,7 @@ MapItem::MapItem(int id) : ComplexItem(id) std::shared_ptr MapItem::getSavedData(short idNum, Level *level) { - std::wstring id = wstring( L"map_" ) + _toString(idNum); + std::wstring id = std::wstring( L"map_" ) + _toString(idNum); std::shared_ptr mapItemSavedData = dynamic_pointer_cast(level->getSavedData(typeid(MapItemSavedData), id)); if (mapItemSavedData == NULL) @@ -31,7 +31,7 @@ std::shared_ptr MapItem::getSavedData(short idNum, Level *leve //int aux = level->getFreeAuxValueFor(L"map"); int aux = idNum; - id = wstring( L"map_" ) + _toString(aux); + id = std::wstring( L"map_" ) + _toString(aux); mapItemSavedData = std::shared_ptr( new MapItemSavedData(id) ); level->setSavedData(id, (std::shared_ptr ) mapItemSavedData); @@ -43,7 +43,7 @@ std::shared_ptr MapItem::getSavedData(short idNum, Level *leve std::shared_ptr MapItem::getSavedData(std::shared_ptr itemInstance, Level *level) { MemSect(31); - std::wstring id = wstring( L"map_" ) + _toString(itemInstance->getAuxValue() ); + std::wstring id = std::wstring( L"map_" ) + _toString(itemInstance->getAuxValue() ); MemSect(0); std::shared_ptr mapItemSavedData = dynamic_pointer_cast( level->getSavedData(typeid(MapItemSavedData), id ) ); @@ -54,7 +54,7 @@ std::shared_ptr MapItem::getSavedData(std::shared_ptrsetAuxValue(level->getFreeAuxValueFor(L"map")); - id = wstring( L"map_" ) + _toString(itemInstance->getAuxValue() ); + id = std::wstring( L"map_" ) + _toString(itemInstance->getAuxValue() ); mapItemSavedData = std::shared_ptr( new MapItemSavedData(id) ); newData = true; @@ -316,7 +316,7 @@ void MapItem::onCraftedBy(std::shared_ptr itemInstance, Level *lev itemInstance->setAuxValue(level->getAuxValueForMap(player->getXuid(), player->dimension, centreXC, centreZC, mapScale)); swprintf(buf,64,L"map_%d", itemInstance->getAuxValue()); - std::wstring id = wstring(buf); + std::wstring id = std::wstring(buf); std::shared_ptr data = getSavedData(itemInstance->getAuxValue(), level); // 4J Stu - We only have one map per player per dimension, so don't reset the one that they have diff --git a/Minecraft.World/Items/MonsterPlacerItem.cpp b/Minecraft.World/Items/MonsterPlacerItem.cpp index bdfea35c1..ed4c4435b 100644 --- a/Minecraft.World/Items/MonsterPlacerItem.cpp +++ b/Minecraft.World/Items/MonsterPlacerItem.cpp @@ -18,9 +18,9 @@ MonsterPlacerItem::MonsterPlacerItem(int id) : Item(id) overlay = NULL; } -wstring MonsterPlacerItem::getHoverName(std::shared_ptr itemInstance) +std::wstring MonsterPlacerItem::getHoverName(std::shared_ptr itemInstance) { - wstring elementName = getDescription(); + std::wstring elementName = getDescription(); int nameId = EntityIO::getNameId(itemInstance->getAuxValue()); if (nameId >= 0) diff --git a/Minecraft.World/Items/MonsterPlacerItem.h b/Minecraft.World/Items/MonsterPlacerItem.h index bccca9150..9f4c5a7e4 100644 --- a/Minecraft.World/Items/MonsterPlacerItem.h +++ b/Minecraft.World/Items/MonsterPlacerItem.h @@ -27,7 +27,7 @@ public: MonsterPlacerItem(int id); - virtual wstring getHoverName(std::shared_ptr itemInstance); + virtual std::wstring getHoverName(std::shared_ptr itemInstance); virtual int getColor(std::shared_ptr item, int spriteLayer); virtual bool hasMultipleSpriteLayers(); virtual Icon *getLayerIcon(int auxValue, int spriteLayer); diff --git a/Minecraft.World/Items/PotionItem.cpp b/Minecraft.World/Items/PotionItem.cpp index af185e0a7..83cf92552 100644 --- a/Minecraft.World/Items/PotionItem.cpp +++ b/Minecraft.World/Items/PotionItem.cpp @@ -12,9 +12,9 @@ #include "PotionItem.h" #include "../Util/SoundTypes.h" -const wstring PotionItem::DEFAULT_ICON = L"potion"; -const wstring PotionItem::THROWABLE_ICON = L"potion_splash"; -const wstring PotionItem::CONTENTS_ICON = L"potion_contents"; +const std::wstring PotionItem::DEFAULT_ICON = L"potion"; +const std::wstring PotionItem::THROWABLE_ICON = L"potion_splash"; +const std::wstring PotionItem::CONTENTS_ICON = L"potion_contents"; // 4J Added vector > PotionItem::s_uniquePotionValues; @@ -173,14 +173,14 @@ bool PotionItem::hasInstantenousEffects(int itemAuxValue) return false; } -wstring PotionItem::getHoverName(std::shared_ptr itemInstance) +std::wstring PotionItem::getHoverName(std::shared_ptr itemInstance) { if (itemInstance->getAuxValue() == 0) { return app.GetString(IDS_ITEM_WATER_BOTTLE); // I18n.get("item.emptyPotion.name").trim(); } - wstring elementName = Item::getHoverName(itemInstance); + std::wstring elementName = Item::getHoverName(itemInstance); if (isThrowable(itemInstance->getAuxValue())) { //elementName = I18n.get("potion.prefix.grenade").trim() + " " + elementName; @@ -212,7 +212,7 @@ wstring PotionItem::getHoverName(std::shared_ptr itemInstance) return elementName; } -void PotionItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void PotionItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { if (itemInstance->getAuxValue() == 0) { @@ -225,10 +225,10 @@ void PotionItem::appendHoverText(std::shared_ptr itemInstance, std for(AUTO_VAR(it, effects->begin()); it != effects->end(); ++it) { MobEffectInstance *effect = *it; - wstring effectString = app.GetString( effect->getDescriptionId() );//I18n.get(effect.getDescriptionId()).trim(); + std::wstring effectString = app.GetString( effect->getDescriptionId() );//I18n.get(effect.getDescriptionId()).trim(); if (effect->getAmplifier() > 0) { - wstring potencyString = L""; + std::wstring potencyString = L""; switch(effect->getAmplifier()) { case 1: @@ -273,7 +273,7 @@ void PotionItem::appendHoverText(std::shared_ptr itemInstance, std } else { - wstring effectString = app.GetString(IDS_POTION_EMPTY); //I18n.get("potion.empty").trim(); + std::wstring effectString = app.GetString(IDS_POTION_EMPTY); //I18n.get("potion.empty").trim(); //eHTMLColor_7 wchar_t formatted[256]; swprintf(formatted,256,L"%ls",app.GetHTMLColour(eHTMLColor_7),effectString.c_str()); @@ -317,7 +317,7 @@ void PotionItem::registerIcons(IconRegister *iconRegister) iconOverlay = iconRegister->registerIcon(CONTENTS_ICON); } -Icon *PotionItem::getTexture(const wstring &name) +Icon *PotionItem::getTexture(const std::wstring &name) { if (name.compare(DEFAULT_ICON) == 0) return Item::potion->iconDrinkable; if (name.compare(THROWABLE_ICON) == 0) return Item::potion->iconThrowable; diff --git a/Minecraft.World/Items/PotionItem.h b/Minecraft.World/Items/PotionItem.h index 02f39e974..89dce512c 100644 --- a/Minecraft.World/Items/PotionItem.h +++ b/Minecraft.World/Items/PotionItem.h @@ -10,9 +10,9 @@ private: static const int DRINK_DURATION = (int) (20 * 1.6); public: - static const wstring DEFAULT_ICON; - static const wstring THROWABLE_ICON; - static const wstring CONTENTS_ICON; + static const std::wstring DEFAULT_ICON; + static const std::wstring THROWABLE_ICON; + static const std::wstring CONTENTS_ICON; private: std::unordered_map *> cachedMobEffects; @@ -39,15 +39,15 @@ public: virtual int getColor(std::shared_ptr item, int spriteLayer); virtual bool hasMultipleSpriteLayers(); virtual bool hasInstantenousEffects(int itemAuxValue); - virtual wstring getHoverName(std::shared_ptr itemInstance); - virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); + virtual std::wstring getHoverName(std::shared_ptr itemInstance); + virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); virtual bool isFoil(std::shared_ptr itemInstance); virtual unsigned int getUseDescriptionId(std::shared_ptr instance); //@Override void registerIcons(IconRegister *iconRegister); - static Icon *getTexture(const wstring &name); + static Icon *getTexture(const std::wstring &name); // 4J Stu - Based loosely on a function that gets added in java much later on (1.3) static vector > *getUniquePotionValues(); diff --git a/Minecraft.World/Items/RecordingItem.cpp b/Minecraft.World/Items/RecordingItem.cpp index b2f3a50b3..b40f5fddc 100644 --- a/Minecraft.World/Items/RecordingItem.cpp +++ b/Minecraft.World/Items/RecordingItem.cpp @@ -7,7 +7,7 @@ #include "RecordingItem.h" #include "../Stats/GenericStats.h" -RecordingItem::RecordingItem(int id, const wstring& recording) : Item(id), recording( recording ) +RecordingItem::RecordingItem(int id, const std::wstring& recording) : Item(id), recording( recording ) { this->maxStackSize = 1; } @@ -40,7 +40,7 @@ bool RecordingItem::useOn(std::shared_ptr itemInstance, std::share return false; } -void RecordingItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void RecordingItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { eMinecraftColour rarityColour = getRarity(std::shared_ptr())->color; int colour = app.GetHTMLColour(rarityColour); diff --git a/Minecraft.World/Items/RecordingItem.h b/Minecraft.World/Items/RecordingItem.h index 5aba0b51d..41f672a55 100644 --- a/Minecraft.World/Items/RecordingItem.h +++ b/Minecraft.World/Items/RecordingItem.h @@ -9,13 +9,13 @@ public: const std::wstring recording; public: // 4J Stu - Was protected in Java, but the can't access it where we need - RecordingItem(int id, const wstring& recording); + RecordingItem(int id, const std::wstring& recording); //@Override Icon *getIcon(int auxValue); virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); + virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); virtual const Rarity *getRarity(std::shared_ptr itemInstance); //@Override diff --git a/Minecraft.World/Items/TileItems/SkullItem.cpp b/Minecraft.World/Items/TileItems/SkullItem.cpp index 18972c409..668a3f92b 100644 --- a/Minecraft.World/Items/TileItems/SkullItem.cpp +++ b/Minecraft.World/Items/TileItems/SkullItem.cpp @@ -9,7 +9,7 @@ const unsigned int SkullItem::NAMES[SKULL_COUNT] = {IDS_ITEM_SKULL_SKELETON, IDS_ITEM_SKULL_WITHER, IDS_ITEM_SKULL_ZOMBIE, IDS_ITEM_SKULL_CHARACTER, IDS_ITEM_SKULL_CREEPER}; -wstring SkullItem::ICON_NAMES[SKULL_COUNT] = {L"skull_skeleton", L"skull_wither", L"skull_zombie", L"skull_char", L"skull_creeper"}; +std::wstring SkullItem::ICON_NAMES[SKULL_COUNT] = {L"skull_skeleton", L"skull_wither", L"skull_zombie", L"skull_char", L"skull_creeper"}; SkullItem::SkullItem(int id) : Item(id) { @@ -50,7 +50,7 @@ bool SkullItem::useOn(std::shared_ptr instance, std::shared_ptrhasTag() && instance->getTag()->contains(L"SkullOwner")) { extra = instance->getTag()->getString(L"SkullOwner"); @@ -118,7 +118,7 @@ unsigned int SkullItem::getDescriptionId(std::shared_ptr instance) return NAMES[auxValue]; } -wstring SkullItem::getHoverName(std::shared_ptr itemInstance) +std::wstring SkullItem::getHoverName(std::shared_ptr itemInstance) { #if 0 if (itemInstance->getAuxValue() == SkullTileEntity::TYPE_CHAR && itemInstance->hasTag() && itemInstance->getTag()->contains(L"SkullOwner")) diff --git a/Minecraft.World/Items/TileItems/SkullItem.h b/Minecraft.World/Items/TileItems/SkullItem.h index d95ce1692..24d65472e 100644 --- a/Minecraft.World/Items/TileItems/SkullItem.h +++ b/Minecraft.World/Items/TileItems/SkullItem.h @@ -10,7 +10,7 @@ private: static const unsigned int NAMES[SKULL_COUNT]; public: - static wstring ICON_NAMES[SKULL_COUNT]; + static std::wstring ICON_NAMES[SKULL_COUNT]; private: Icon *icons[SKULL_COUNT]; @@ -24,6 +24,6 @@ public: int getLevelDataForAuxValue(int auxValue); virtual unsigned int getDescriptionId(int iData = -1); unsigned int getDescriptionId(std::shared_ptr instance); - wstring getHoverName(std::shared_ptr itemInstance); + std::wstring getHoverName(std::shared_ptr itemInstance); void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/Minecraft.World/Items/TileItems/TileItem.cpp b/Minecraft.World/Items/TileItems/TileItem.cpp index e01188e2b..5ada62c31 100644 --- a/Minecraft.World/Items/TileItems/TileItem.cpp +++ b/Minecraft.World/Items/TileItems/TileItem.cpp @@ -213,7 +213,7 @@ unsigned int TileItem::getUseDescriptionId() void TileItem::registerIcons(IconRegister *iconRegister) { - wstring iconName = Tile::tiles[tileId]->getTileItemIconName(); + std::wstring iconName = Tile::tiles[tileId]->getTileItemIconName(); if (!iconName.empty()) { itemIcon = iconRegister->registerIcon(iconName); diff --git a/Minecraft.World/Level/ChunkPos.cpp b/Minecraft.World/Level/ChunkPos.cpp index fcc58cbc1..5f6026443 100644 --- a/Minecraft.World/Level/ChunkPos.cpp +++ b/Minecraft.World/Level/ChunkPos.cpp @@ -58,7 +58,7 @@ TilePos ChunkPos::getMiddleBlockPosition(int y) return TilePos(getMiddleBlockX(), y, getMiddleBlockZ()); } -wstring ChunkPos::toString() +std::wstring ChunkPos::toString() { return L"[" + _toString(x) + L", " + _toString(z) + L"]"; } diff --git a/Minecraft.World/Level/ChunkPos.h b/Minecraft.World/Level/ChunkPos.h index 8a9cb4f61..d5adaa20b 100644 --- a/Minecraft.World/Level/ChunkPos.h +++ b/Minecraft.World/Level/ChunkPos.h @@ -20,7 +20,7 @@ public: int getMiddleBlockZ(); TilePos getMiddleBlockPosition(int y); - wstring toString(); + std::wstring toString(); static __int64 hash_fnct(const ChunkPos &k); static bool eq_test(const ChunkPos &x, const ChunkPos &y); diff --git a/Minecraft.World/Level/ChunkSource.h b/Minecraft.World/Level/ChunkSource.h index 1c09feb22..766ba1efb 100644 --- a/Minecraft.World/Level/ChunkSource.h +++ b/Minecraft.World/Level/ChunkSource.h @@ -60,8 +60,8 @@ public: /** * Returns some stats that are rendered when the user holds F3. */ - virtual wstring gatherStats() = 0; + virtual std::wstring gatherStats() = 0; virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z) = 0; - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) = 0; + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) = 0; }; diff --git a/Minecraft.World/Level/CustomLevelSource.cpp b/Minecraft.World/Level/CustomLevelSource.cpp index 01aebc2f1..39f25aa25 100644 --- a/Minecraft.World/Level/CustomLevelSource.cpp +++ b/Minecraft.World/Level/CustomLevelSource.cpp @@ -20,7 +20,7 @@ CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateSt m_heightmapOverride = byteArray( (m_XZSize*16) * (m_XZSize*16) ); #ifdef _UNICODE - wstring path = L"GAME:\\GameRules\\heightmap.bin"; + std::wstring path = L"GAME:\\GameRules\\heightmap.bin"; #else #ifdef _WINDOWS64 @@ -62,7 +62,7 @@ CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateSt m_waterheightOverride = byteArray( (m_XZSize*16) * (m_XZSize*16) ); #ifdef _UNICODE - wstring waterHeightPath = L"GAME:\\GameRules\\waterheight.bin"; + std::wstring waterHeightPath = L"GAME:\\GameRules\\waterheight.bin"; #else #ifdef _WINDOWS64 @@ -609,7 +609,7 @@ bool CustomLevelSource::shouldSave() return true; } -wstring CustomLevelSource::gatherStats() +std::wstring CustomLevelSource::gatherStats() { return L"CustomLevelSource"; } @@ -628,7 +628,7 @@ vector *CustomLevelSource::getMobsAt(MobCategory *mobCa #endif } -TilePos *CustomLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *CustomLevelSource::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { #ifdef _OVERRIDE_HEIGHTMAP if (LargeFeature::STRONGHOLD == featureName && strongholdFeature != NULL) diff --git a/Minecraft.World/Level/CustomLevelSource.h b/Minecraft.World/Level/CustomLevelSource.h index af01a478a..390e038da 100644 --- a/Minecraft.World/Level/CustomLevelSource.h +++ b/Minecraft.World/Level/CustomLevelSource.h @@ -71,9 +71,9 @@ public: virtual bool save(bool force, ProgressListener *progressListener); virtual bool tick(); virtual bool shouldSave(); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/Level/DerivedLevelData.cpp b/Minecraft.World/Level/DerivedLevelData.cpp index e167e4407..23e01bd93 100644 --- a/Minecraft.World/Level/DerivedLevelData.cpp +++ b/Minecraft.World/Level/DerivedLevelData.cpp @@ -58,7 +58,7 @@ CompoundTag *DerivedLevelData::getLoadedPlayerTag() return wrapped->getLoadedPlayerTag(); } -wstring DerivedLevelData::getLevelName() +std::wstring DerivedLevelData::getLevelName() { return wrapped->getLevelName(); } @@ -134,7 +134,7 @@ void DerivedLevelData::setSpawn(int xSpawn, int ySpawn, int zSpawn) { } -void DerivedLevelData::setLevelName(const wstring &levelName) +void DerivedLevelData::setLevelName(const std::wstring &levelName) { } diff --git a/Minecraft.World/Level/DerivedLevelData.h b/Minecraft.World/Level/DerivedLevelData.h index c3ab42630..a5664398c 100644 --- a/Minecraft.World/Level/DerivedLevelData.h +++ b/Minecraft.World/Level/DerivedLevelData.h @@ -23,7 +23,7 @@ public: __int64 getTime(); __int64 getSizeOnDisk(); CompoundTag *getLoadedPlayerTag(); - wstring getLevelName(); + std::wstring getLevelName(); int getVersion(); __int64 getLastPlayed(); bool isThundering(); @@ -40,7 +40,7 @@ public: void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); void setDimension(int dimension); void setSpawn(int xSpawn, int ySpawn, int zSpawn); - void setLevelName(const wstring &levelName); + void setLevelName(const std::wstring &levelName); void setVersion(int version); void setThundering(bool thundering); void setThunderTime(int thunderTime); diff --git a/Minecraft.World/Level/Events/LevelListener.h b/Minecraft.World/Level/Events/LevelListener.h index 671df0d17..1776fb21a 100644 --- a/Minecraft.World/Level/Events/LevelListener.h +++ b/Minecraft.World/Level/Events/LevelListener.h @@ -16,11 +16,11 @@ public: virtual void allChanged() = 0; - //virtual void playSound(const wstring& name, double x, double y, double z, float volume, float pitch) = 0; + //virtual void playSound(const std::wstring& name, double x, double y, double z, float volume, float pitch) = 0; virtual void playSound(int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f) = 0; virtual void playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f) = 0; - // 4J removed - virtual void addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) = 0; + // 4J removed - virtual void addParticle(const std::wstring& name, double x, double y, double z, double xa, double ya, double za) = 0; virtual void addParticle(ePARTICLE_TYPE name, double x, double y, double z, double xa, double ya, double za) = 0; // 4J added @@ -32,7 +32,7 @@ public: virtual void skyColorChanged() = 0; - virtual void playStreamingMusic(const wstring& name, int x, int y, int z) = 0; + virtual void playStreamingMusic(const std::wstring& name, int x, int y, int z) = 0; virtual void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data) = 0; diff --git a/Minecraft.World/Level/Level.cpp b/Minecraft.World/Level/Level.cpp index ea71b36de..039f68d84 100644 --- a/Minecraft.World/Level/Level.cpp +++ b/Minecraft.World/Level/Level.cpp @@ -558,7 +558,7 @@ BiomeSource *Level::getBiomeSource() return dimension->biomeSource; } -Level::Level(std::shared_ptr levelStorage, const wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource) +Level::Level(std::shared_ptr levelStorage, const std::wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource) : seaLevel(constSeaLevel) { _init(); @@ -617,20 +617,20 @@ Level::Level(Level *level, Dimension *dimension) } -Level::Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings) +Level::Level(std::shared_ptrlevelStorage, const std::wstring& levelName, LevelSettings *levelSettings) : seaLevel( constSeaLevel ) { _init(levelStorage, levelName, levelSettings, NULL, true); } -Level::Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) +Level::Level(std::shared_ptrlevelStorage, const std::wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) : seaLevel( constSeaLevel ) { _init( levelStorage, levelName, levelSettings, fixedDimension, doCreateChunkSource ); } -void Level::_init(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) +void Level::_init(std::shared_ptrlevelStorage, const std::wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) { _init(); this->levelStorage = levelStorage;//std::shared_ptr(levelStorage); @@ -1602,7 +1602,7 @@ void Level::playSound(std::shared_ptr entity, int iSound, float volume, } -//void Level::playSound(double x, double y, double z, const wstring& name, float volume, float pitch) +//void Level::playSound(double x, double y, double z, const std::wstring& name, float volume, float pitch) void Level::playSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist) { AUTO_VAR(itEnd, listeners.end()); @@ -1616,7 +1616,7 @@ void Level::playLocalSound(double x, double y, double z, int iSound, float volum { } -void Level::playStreamingMusic(const wstring& name, int x, int y, int z) +void Level::playStreamingMusic(const std::wstring& name, int x, int y, int z) { AUTO_VAR(itEnd, listeners.end()); for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) @@ -1626,13 +1626,13 @@ void Level::playStreamingMusic(const wstring& name, int x, int y, int z) } -void Level::playMusic(double x, double y, double z, const wstring& string, float volume) +void Level::playMusic(double x, double y, double z, const std::wstring& string, float volume) { } // 4J removed - /* -void Level::addParticle(const wstring& id, double x, double y, double z, double xd, double yd, double zd) +void Level::addParticle(const std::wstring& id, double x, double y, double z, double xd, double yd, double zd) { AUTO_VAR(itEnd, listeners.end()); for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) @@ -2825,17 +2825,17 @@ std::shared_ptr Level::findSubclassOf(Entity::Class *entityClass) */ -wstring Level::gatherStats() +std::wstring Level::gatherStats() { wchar_t buf[64]; EnterCriticalSection(&m_entitiesCS); swprintf(buf,64,L"All:%d",this->entities.size()); LeaveCriticalSection(&m_entitiesCS); - return wstring(buf); + return std::wstring(buf); } -wstring Level::gatherChunkSourceStats() +std::wstring Level::gatherChunkSourceStats() { return chunkSource->gatherStats(); } @@ -4190,7 +4190,7 @@ std::shared_ptr Level::getNearestAttackablePlayer(double x, double y, do return result; } -std::shared_ptr Level::getPlayerByName(const wstring& name) +std::shared_ptr Level::getPlayerByName(const std::wstring& name) { AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) @@ -4203,7 +4203,7 @@ std::shared_ptr Level::getPlayerByName(const wstring& name) return std::shared_ptr(); } -std::shared_ptr Level::getPlayerByUUID(const wstring& name) +std::shared_ptr Level::getPlayerByUUID(const std::wstring& name) { AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) @@ -4506,19 +4506,19 @@ bool Level::isHumidAt(int x, int y, int z) } -void Level::setSavedData(const wstring& id, std::shared_ptr data) +void Level::setSavedData(const std::wstring& id, std::shared_ptr data) { savedDataStorage->set(id, data); } -std::shared_ptr Level::getSavedData(const type_info& clazz, const wstring& id) +std::shared_ptr Level::getSavedData(const type_info& clazz, const std::wstring& id) { return savedDataStorage->get(clazz, id); } -int Level::getFreeAuxValueFor(const wstring& id) +int Level::getFreeAuxValueFor(const std::wstring& id) { return savedDataStorage->getFreeAuxValueFor(id); } @@ -4575,7 +4575,7 @@ bool Level::updateLights() return false; } -TilePos *Level::findNearestMapFeature(const wstring& featureName, int x, int y, int z) +TilePos *Level::findNearestMapFeature(const std::wstring& featureName, int x, int y, int z) { return getChunkSource()->findNearestMapFeature(this, featureName, x, y, z); } diff --git a/Minecraft.World/Level/Level.h b/Minecraft.World/Level/Level.h index 47a974770..afeee6cca 100644 --- a/Minecraft.World/Level/Level.h +++ b/Minecraft.World/Level/Level.h @@ -160,13 +160,13 @@ private: // 4J Stu - Added these ctors to handle init of member variables void _init(); - void _init(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); + void _init(std::shared_ptrlevelStorage, const std::wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); public: - Level(std::shared_ptrlevelStorage, const wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource = true); + Level(std::shared_ptrlevelStorage, const std::wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource = true); Level(Level *level, Dimension *dimension); - Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings); - Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); + Level(std::shared_ptrlevelStorage, const std::wstring& levelName, LevelSettings *levelSettings); + Level(std::shared_ptrlevelStorage, const std::wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); virtual ~Level(); @@ -283,9 +283,9 @@ public: virtual void playLocalSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist=16.0f); - void playStreamingMusic(const wstring& name, int x, int y, int z); - void playMusic(double x, double y, double z, const wstring& string, float volume); - // 4J removed - void addParticle(const wstring& id, double x, double y, double z, double xd, double yd, double zd); + void playStreamingMusic(const std::wstring& name, int x, int y, int z); + void playMusic(double x, double y, double z, const std::wstring& string, float volume); + // 4J removed - void addParticle(const std::wstring& id, double x, double y, double z, double xd, double yd, double zd); void addParticle(ePARTICLE_TYPE id, double x, double y, double z, double xd, double yd, double zd); // 4J added virtual bool addGlobalEntity(std::shared_ptr e); virtual bool addEntity(std::shared_ptr e); @@ -341,8 +341,8 @@ public: virtual std::shared_ptr explode(std::shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); float getSeenPercent(Vec3 *center, AABB *bb); bool extinguishFire(std::shared_ptr player, int x, int y, int z, int face); - wstring gatherStats(); - wstring gatherChunkSourceStats(); + std::wstring gatherStats(); + std::wstring gatherChunkSourceStats(); virtual std::shared_ptr getTileEntity(int x, int y, int z); void setTileEntity(int x, int y, int z, std::shared_ptr tileEntity); void removeTileEntity(int x, int y, int z); @@ -443,8 +443,8 @@ public: std::shared_ptr getNearestAttackablePlayer(std::shared_ptr source, double maxDist); std::shared_ptr getNearestAttackablePlayer(double x, double y, double z, double maxDist); - std::shared_ptr getPlayerByName(const wstring& name); - std::shared_ptr getPlayerByUUID(const wstring& name); // 4J Added + std::shared_ptr getPlayerByName(const std::wstring& name); + std::shared_ptr getPlayerByUUID(const std::wstring& name); // 4J Added byteArray getBlocksAndData(int x, int y, int z, int xs, int ys, int zs, bool includeLighting = true); void setBlocksAndData(int x, int y, int z, int xs, int ys, int zs, byteArray data, bool includeLighting = true); virtual void disconnect(bool sendDisconnect = true); @@ -476,9 +476,9 @@ public: bool isRaining(); bool isRainingAt(int x, int y, int z); bool isHumidAt(int x, int y, int z); - void setSavedData(const wstring& id, std::shared_ptr data); - std::shared_ptr getSavedData(const type_info& clazz, const wstring& id); - int getFreeAuxValueFor(const wstring& id); + void setSavedData(const std::wstring& id, std::shared_ptr data); + std::shared_ptr getSavedData(const type_info& clazz, const std::wstring& id); + int getFreeAuxValueFor(const std::wstring& id); void levelEvent(int type, int x, int y, int z, int data); void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data); int getMaxBuildHeight(); @@ -488,7 +488,7 @@ public: virtual bool isAllEmpty(); double getHorizonHeight() ; void destroyTileProgress(int id, int x, int y, int z, int progress); - TilePos *findNearestMapFeature(const wstring& featureName, int x, int y, int z); + TilePos *findNearestMapFeature(const std::wstring& featureName, int x, int y, int z); // 4J Added int getAuxValueForMap(PlayerUID xuid, int dimension, int centreXC, int centreZC, int scale); diff --git a/Minecraft.World/Level/LevelConflictException.cpp b/Minecraft.World/Level/LevelConflictException.cpp index 35a04e9e4..76cd1cbdc 100644 --- a/Minecraft.World/Level/LevelConflictException.cpp +++ b/Minecraft.World/Level/LevelConflictException.cpp @@ -1,6 +1,6 @@ #include "../Build/stdafx.h" #include "LevelConflictException.h" -LevelConflictException::LevelConflictException(const wstring& msg) : RuntimeException(msg) +LevelConflictException::LevelConflictException(const std::wstring& msg) : RuntimeException(msg) { } \ No newline at end of file diff --git a/Minecraft.World/Level/LevelConflictException.h b/Minecraft.World/Level/LevelConflictException.h index cde4fc56d..dfa668ae1 100644 --- a/Minecraft.World/Level/LevelConflictException.h +++ b/Minecraft.World/Level/LevelConflictException.h @@ -9,5 +9,5 @@ private: static const __int32 serialVersionUID = 1L; public: - LevelConflictException(const wstring& msg); + LevelConflictException(const std::wstring& msg); }; \ No newline at end of file diff --git a/Minecraft.World/Level/LevelData.cpp b/Minecraft.World/Level/LevelData.cpp index c4a435a62..ee86ea516 100644 --- a/Minecraft.World/Level/LevelData.cpp +++ b/Minecraft.World/Level/LevelData.cpp @@ -16,7 +16,7 @@ LevelData::LevelData(CompoundTag *tag) m_pGenerator = LevelType::lvl_normal; if (tag->contains(L"generatorName")) { - wstring generatorName = tag->getString(L"generatorName"); + std::wstring generatorName = tag->getString(L"generatorName"); m_pGenerator = LevelType::getLevelType(generatorName); if (m_pGenerator == NULL) { @@ -139,7 +139,7 @@ LevelData::LevelData(CompoundTag *tag) dimension = 0; } -LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) +LevelData::LevelData(LevelSettings *levelSettings, const std::wstring& levelName) { this->seed = levelSettings->getSeed(); this->gameType = levelSettings->getGameType(); @@ -440,12 +440,12 @@ void LevelData::setSpawn(int xSpawn, int ySpawn, int zSpawn) this->zSpawn = zSpawn; } -wstring LevelData::getLevelName() +std::wstring LevelData::getLevelName() { return levelName; } -void LevelData::setLevelName(const wstring& levelName) +void LevelData::setLevelName(const std::wstring& levelName) { this->levelName = levelName; } diff --git a/Minecraft.World/Level/LevelData.h b/Minecraft.World/Level/LevelData.h index 9b837f074..f7bc87d8e 100644 --- a/Minecraft.World/Level/LevelData.h +++ b/Minecraft.World/Level/LevelData.h @@ -21,7 +21,7 @@ private: __int64 sizeOnDisk; // CompoundTag *loadedPlayerTag; // 4J removed int dimension; - wstring levelName; + std::wstring levelName; int version; bool raining; @@ -55,7 +55,7 @@ protected: public: LevelData(CompoundTag *tag); - LevelData(LevelSettings *levelSettings, const wstring& levelName); + LevelData(LevelSettings *levelSettings, const std::wstring& levelName); LevelData(LevelData *copy); CompoundTag *createTag(); CompoundTag *createTag(vector > *players); @@ -101,8 +101,8 @@ public: virtual void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); //void setDimension(int dimension); // 4J Removed TU 9 as it's never used virtual void setSpawn(int xSpawn, int ySpawn, int zSpawn); - virtual wstring getLevelName(); - virtual void setLevelName(const wstring& levelName); + virtual std::wstring getLevelName(); + virtual void setLevelName(const std::wstring& levelName); virtual int getVersion(); virtual void setVersion(int version); virtual __int64 getLastPlayed(); diff --git a/Minecraft.World/Level/RandomLevelSource.cpp b/Minecraft.World/Level/RandomLevelSource.cpp index 75d8c4377..ffa1a547b 100644 --- a/Minecraft.World/Level/RandomLevelSource.cpp +++ b/Minecraft.World/Level/RandomLevelSource.cpp @@ -755,7 +755,7 @@ bool RandomLevelSource::shouldSave() return true; } -wstring RandomLevelSource::gatherStats() +std::wstring RandomLevelSource::gatherStats() { return L"RandomLevelSource"; } @@ -770,7 +770,7 @@ vector *RandomLevelSource::getMobsAt(MobCategory *mobCa return biome->getMobs(mobCategory); } -TilePos *RandomLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *RandomLevelSource::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { if (LargeFeature::STRONGHOLD == featureName && strongholdFeature != NULL) { diff --git a/Minecraft.World/Level/RandomLevelSource.h b/Minecraft.World/Level/RandomLevelSource.h index d71028b1f..b9b08e568 100644 --- a/Minecraft.World/Level/RandomLevelSource.h +++ b/Minecraft.World/Level/RandomLevelSource.h @@ -84,9 +84,9 @@ public: virtual bool save(bool force, ProgressListener *progressListener); virtual bool tick(); virtual bool shouldSave(); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp index e08d675c0..390371658 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp @@ -12,7 +12,7 @@ #include "DirectoryLevelStorage.h" #include "../../IO/Files/ConsoleSaveFileIO.h" -const wstring DirectoryLevelStorage::sc_szPlayerDir(L"players/"); +const std::wstring DirectoryLevelStorage::sc_szPlayerDir(L"players/"); _MapDataMappings::_MapDataMappings() { @@ -159,8 +159,8 @@ void DirectoryLevelStorage::PlayerMappings::readMappings(DataInputStream *dis) } #endif -DirectoryLevelStorage::DirectoryLevelStorage(ConsoleSaveFile *saveFile, const File dir, const wstring& levelId, bool createPlayerDir) : sessionId( System::currentTimeMillis() ), - dir( L"" ), playerDir( sc_szPlayerDir ), dataDir( wstring(L"data/") ), levelId(levelId) +DirectoryLevelStorage::DirectoryLevelStorage(ConsoleSaveFile *saveFile, const File dir, const std::wstring& levelId, bool createPlayerDir) : sessionId( System::currentTimeMillis() ), + dir( L"" ), playerDir( sc_szPlayerDir ), dataDir( std::wstring(L"data/") ), levelId(levelId) { m_saveFile = saveFile; m_bHasLoadedMapDataMappings = false; @@ -188,7 +188,7 @@ void DirectoryLevelStorage::initiateSession() { // 4J Jev, removed try/catch. - File dataFile = File( dir, wstring(L"session.lock") ); + File dataFile = File( dir, std::wstring(L"session.lock") ); FileOutputStream fos = FileOutputStream(dataFile); DataOutputStream dos = DataOutputStream(&fos); dos.writeLong(sessionId); @@ -206,7 +206,7 @@ void DirectoryLevelStorage::checkSession() // 4J-PB - Not in the Xbox game /* - File dataFile = File( dir, wstring(L"session.lock")); + File dataFile = File( dir, std::wstring(L"session.lock")); FileInputStream fis = FileInputStream(dataFile); DataInputStream dis = DataInputStream(&fis); dis.close(); @@ -336,7 +336,7 @@ LevelData *DirectoryLevelStorage::prepareLevel() // 4J Jev, removed try/catch - ConsoleSavePath dataFile = ConsoleSavePath( wstring( L"level.dat" ) ); + ConsoleSavePath dataFile = ConsoleSavePath( std::wstring( L"level.dat" ) ); if ( m_saveFile->doesFileExist( dataFile ) ) { @@ -360,7 +360,7 @@ void DirectoryLevelStorage::saveLevelData(LevelData *levelData, vectorput(L"Data", dataTag); - ConsoleSavePath currentFile = ConsoleSavePath( wstring( L"level.dat" ) ); + ConsoleSavePath currentFile = ConsoleSavePath( std::wstring( L"level.dat" ) ); ConsoleSaveFileOutputStream fos = ConsoleSaveFileOutputStream( m_saveFile, currentFile ); NbtIo::writeCompressed(root, &fos); @@ -377,7 +377,7 @@ void DirectoryLevelStorage::saveLevelData(LevelData *levelData) CompoundTag *root = new CompoundTag(); root->put(L"Data", dataTag); - ConsoleSavePath currentFile = ConsoleSavePath( wstring( L"level.dat" ) ); + ConsoleSavePath currentFile = ConsoleSavePath( std::wstring( L"level.dat" ) ); ConsoleSaveFileOutputStream fos = ConsoleSaveFileOutputStream( m_saveFile, currentFile ); NbtIo::writeCompressed(root, &fos); @@ -493,7 +493,7 @@ void DirectoryLevelStorage::clearOldPlayerFiles() for(unsigned int i = 0; i < playerFiles->size(); ++i ) { FileEntry *file = playerFiles->at(i); - wstring xuidStr = replaceAll( replaceAll(file->data.filename,playerDir.getName(),L""),L".dat",L""); + std::wstring xuidStr = replaceAll( replaceAll(file->data.filename,playerDir.getName(),L""),L".dat",L""); #if defined(__PS3__) || defined(__ORBIS__) || defined(_DURANGO) PlayerUID xuid(xuidStr); #else @@ -512,7 +512,7 @@ void DirectoryLevelStorage::clearOldPlayerFiles() for(unsigned int i = MAX_PLAYER_DATA_SAVES; i < playerFiles->size(); ++i ) { FileEntry *file = playerFiles->at(i); - wstring xuidStr = replaceAll( replaceAll(file->data.filename,playerDir.getName(),L""),L".dat",L""); + std::wstring xuidStr = replaceAll( replaceAll(file->data.filename,playerDir.getName(),L""),L".dat",L""); #if defined(__PS3__) || defined(__ORBIS__) || defined(_DURANGO) PlayerUID xuid(xuidStr); #else @@ -536,12 +536,12 @@ void DirectoryLevelStorage::closeAll() { } -ConsoleSavePath DirectoryLevelStorage::getDataFile(const wstring& id) +ConsoleSavePath DirectoryLevelStorage::getDataFile(const std::wstring& id) { return ConsoleSavePath( dataDir.getName() + id + L".dat" ); } -wstring DirectoryLevelStorage::getLevelId() +std::wstring DirectoryLevelStorage::getLevelId() { return levelId; } @@ -654,7 +654,7 @@ int DirectoryLevelStorage::getAuxValueForMap(PlayerUID xuid, int dimension, int m_saveableMapDataMappings.setMapping(mapId, xuid, dimension); // If we had an old map file for a mapping that is no longer valid, delete it - std::wstring id = wstring( L"map_" ) + _toString(mapId); + std::wstring id = std::wstring( L"map_" ) + _toString(mapId); ConsoleSavePath file = getDataFile(id); if(m_saveFile->doesFileExist(file) ) @@ -760,7 +760,7 @@ void DirectoryLevelStorage::deleteMapFilesForPlayer(PlayerUID xuid) { for(AUTO_VAR(itMap, it->second.m_mappings.begin()); itMap != it->second.m_mappings.end(); ++itMap) { - std::wstring id = wstring( L"map_" ) + _toString(itMap->second); + std::wstring id = std::wstring( L"map_" ) + _toString(itMap->second); ConsoleSavePath file = getDataFile(id); if(m_saveFile->doesFileExist(file) ) @@ -784,7 +784,7 @@ void DirectoryLevelStorage::deleteMapFilesForPlayer(PlayerUID xuid) { changed = true; - std::wstring id = wstring( L"map_" ) + _toString(i); + std::wstring id = std::wstring( L"map_" ) + _toString(i); ConsoleSavePath file = getDataFile(id); if(m_saveFile->doesFileExist(file) ) @@ -821,7 +821,7 @@ void DirectoryLevelStorage::saveAllCachedData() for(AUTO_VAR(it, m_mapFilesToDelete.begin()); it != m_mapFilesToDelete.end(); ++it) { - std::wstring id = wstring( L"map_" ) + _toString(*it); + std::wstring id = std::wstring( L"map_" ) + _toString(*it); ConsoleSavePath file = getDataFile(id); if(m_saveFile->doesFileExist(file) ) { diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorage.h b/Minecraft.World/Level/Storage/DirectoryLevelStorage.h index 74d7f829d..bd1c312f9 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.h +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorage.h @@ -66,9 +66,9 @@ private: //const File dataDir; const ConsoleSavePath dataDir; const __int64 sessionId; - const wstring levelId; + const std::wstring levelId; - static const wstring sc_szPlayerDir; + static const std::wstring sc_szPlayerDir; // 4J Added #ifdef _LARGE_WORLDS class PlayerMappings @@ -95,7 +95,7 @@ private: #endif bool m_bHasLoadedMapDataMappings; - std::unordered_map m_cachedSaveData; + std::unordered_map m_cachedSaveData; vector m_mapFilesToDelete; // Temp list of files that couldn't be deleted immediately due to saving being disabled protected: @@ -106,7 +106,7 @@ public: virtual void flushSaveFile(bool autosave); public: - DirectoryLevelStorage(ConsoleSaveFile *saveFile, const File dir, const wstring& levelId, bool createPlayerDir); + DirectoryLevelStorage(ConsoleSaveFile *saveFile, const File dir, const std::wstring& levelId, bool createPlayerDir); ~DirectoryLevelStorage(); private: @@ -127,8 +127,8 @@ public: virtual void clearOldPlayerFiles(); // 4J Added PlayerIO *getPlayerIO(); virtual void closeAll(); - ConsoleSavePath getDataFile(const wstring& id); - wstring getLevelId(); + ConsoleSavePath getDataFile(const std::wstring& id); + std::wstring getLevelId(); // 4J Added virtual int getAuxValueForMap(PlayerUID xuid, int dimension, int centreXC, int centreZC, int scale); @@ -136,7 +136,7 @@ public: virtual void deleteMapFilesForPlayer(std::shared_ptr player); virtual void saveAllCachedData(); void resetNetherPlayerPositions(); // 4J Added - static wstring getPlayerDir() { return sc_szPlayerDir; } + static std::wstring getPlayerDir() { return sc_szPlayerDir; } private: void dontSaveMapMappingForPlayer(PlayerUID xuid); diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp b/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp index 6a1c31a37..4396ec437 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp @@ -17,7 +17,7 @@ DirectoryLevelStorageSource::DirectoryLevelStorageSource(const File dir) : baseD //this->baseDir = dir; } -wstring DirectoryLevelStorageSource::getName() +std::wstring DirectoryLevelStorageSource::getName() { return L"Old Format"; } @@ -29,7 +29,7 @@ vector *DirectoryLevelStorageSource::getLevelList() #if 0 for (int i = 0; i < 5; i++) { - wstring levelId = wstring(L"World").append( _toString( (i+1) ) ); + std::wstring levelId = std::wstring(L"World").append( _toString( (i+1) ) ); LevelData *levelData = getDataTagFor(saveFile, levelId); if (levelData != NULL) @@ -45,10 +45,10 @@ void DirectoryLevelStorageSource::clearAll() { } -LevelData *DirectoryLevelStorageSource::getDataTagFor(ConsoleSaveFile *saveFile, const wstring& levelId) +LevelData *DirectoryLevelStorageSource::getDataTagFor(ConsoleSaveFile *saveFile, const std::wstring& levelId) { //File dataFile(dir, L"level.dat"); - ConsoleSavePath dataFile = ConsoleSavePath( wstring( L"level.dat" ) ); + ConsoleSavePath dataFile = ConsoleSavePath( std::wstring( L"level.dat" ) ); if ( saveFile->doesFileExist( dataFile ) ) { ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(saveFile, dataFile); @@ -62,12 +62,12 @@ LevelData *DirectoryLevelStorageSource::getDataTagFor(ConsoleSaveFile *saveFile, return NULL; } -void DirectoryLevelStorageSource::renameLevel(const wstring& levelId, const wstring& newLevelName) +void DirectoryLevelStorageSource::renameLevel(const std::wstring& levelId, const std::wstring& newLevelName) { ConsoleSaveFileOriginal tempSave(levelId); //File dataFile = File(dir, L"level.dat"); - ConsoleSavePath dataFile = ConsoleSavePath( wstring( L"level.dat" ) ); + ConsoleSavePath dataFile = ConsoleSavePath( std::wstring( L"level.dat" ) ); if ( tempSave.doesFileExist( dataFile ) ) { ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(&tempSave, dataFile); @@ -80,7 +80,7 @@ void DirectoryLevelStorageSource::renameLevel(const wstring& levelId, const wstr } } -bool DirectoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) +bool DirectoryLevelStorageSource::isNewLevelIdAcceptable(const std::wstring& levelId) { // 4J Jev, removed try/catch. @@ -95,7 +95,7 @@ bool DirectoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) return true; } -void DirectoryLevelStorageSource::deleteLevel(const wstring& levelId) +void DirectoryLevelStorageSource::deleteLevel(const std::wstring& levelId) { File dir = File(baseDir, levelId); if (!dir.exists()) return; @@ -118,22 +118,22 @@ void DirectoryLevelStorageSource::deleteRecursive(vector *files) } } -std::shared_ptr DirectoryLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) +std::shared_ptr DirectoryLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, bool createPlayerDir) { return std::shared_ptr (new DirectoryLevelStorage(saveFile, baseDir, levelId, createPlayerDir)); } -bool DirectoryLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId) +bool DirectoryLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const std::wstring& levelId) { return false; } -bool DirectoryLevelStorageSource::requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId) +bool DirectoryLevelStorageSource::requiresConversion(ConsoleSaveFile *saveFile, const std::wstring& levelId) { return false; } -bool DirectoryLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress) +bool DirectoryLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, ProgressListener *progress) { return false; } diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h b/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h index 929982fa6..92eba4922 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.h @@ -15,20 +15,20 @@ protected: public: DirectoryLevelStorageSource(const File dir); - virtual wstring getName(); + virtual std::wstring getName(); virtual vector *getLevelList(); virtual void clearAll(); - virtual LevelData *getDataTagFor(ConsoleSaveFile *saveFile, const wstring& levelId); - virtual void renameLevel(const wstring& levelId, const wstring& newLevelName); - virtual bool isNewLevelIdAcceptable(const wstring& levelId); - virtual void deleteLevel(const wstring& levelId); + virtual LevelData *getDataTagFor(ConsoleSaveFile *saveFile, const std::wstring& levelId); + virtual void renameLevel(const std::wstring& levelId, const std::wstring& newLevelName); + virtual bool isNewLevelIdAcceptable(const std::wstring& levelId); + virtual void deleteLevel(const std::wstring& levelId); protected: static void deleteRecursive(vector *files); public: - virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir); - virtual bool isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId); - virtual bool requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId); - virtual bool convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress); + virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, bool createPlayerDir); + virtual bool isConvertible(ConsoleSaveFile *saveFile, const std::wstring& levelId); + virtual bool requiresConversion(ConsoleSaveFile *saveFile, const std::wstring& levelId); + virtual bool convertLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, ProgressListener *progress); }; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/EntityIO.cpp b/Minecraft.World/Level/Storage/EntityIO.cpp index 1ae6226c1..e2c35e336 100644 --- a/Minecraft.World/Level/Storage/EntityIO.cpp +++ b/Minecraft.World/Level/Storage/EntityIO.cpp @@ -14,25 +14,25 @@ #include "../../Headers/com.mojang.nbt.h" #include "EntityIO.h" -std::unordered_map *EntityIO::idCreateMap = new std::unordered_map; -std::unordered_map *EntityIO::classIdMap = new std::unordered_map; +std::unordered_map *EntityIO::idCreateMap = new std::unordered_map; +std::unordered_map *EntityIO::classIdMap = new std::unordered_map; std::unordered_map *EntityIO::numCreateMap = new std::unordered_map; std::unordered_map *EntityIO::numClassMap = new std::unordered_map; std::unordered_map *EntityIO::classNumMap = new std::unordered_map; -std::unordered_map *EntityIO::idNumMap = new std::unordered_map; +std::unordered_map *EntityIO::idNumMap = new std::unordered_map; std::unordered_map EntityIO::idsSpawnableInCreative; -void EntityIO::setId(entityCreateFn createFn, eINSTANCEOF clas, const wstring &id, int idNum) +void EntityIO::setId(entityCreateFn createFn, eINSTANCEOF clas, const std::wstring &id, int idNum) { - idCreateMap->insert( std::unordered_map::value_type(id, createFn) ); - classIdMap->insert( std::unordered_map::value_type(clas,id ) ); + idCreateMap->insert( std::unordered_map::value_type(id, createFn) ); + classIdMap->insert( std::unordered_map::value_type(clas,id ) ); numCreateMap->insert( std::unordered_map::value_type(idNum, createFn) ); numClassMap->insert( std::unordered_map::value_type(idNum, clas) ); classNumMap->insert( std::unordered_map::value_type(clas, idNum) ); - idNumMap->insert( std::unordered_map::value_type(id, idNum) ); + idNumMap->insert( std::unordered_map::value_type(id, idNum) ); } -void EntityIO::setId(entityCreateFn createFn, eINSTANCEOF clas, const wstring &id, int idNum, eMinecraftColour color1, eMinecraftColour color2, int nameId) +void EntityIO::setId(entityCreateFn createFn, eINSTANCEOF clas, const std::wstring &id, int idNum, eMinecraftColour color1, eMinecraftColour color2, int nameId) { setId(createFn, clas, id, idNum); @@ -98,7 +98,7 @@ void EntityIO::staticCtor() setId(DragonFireball::create, eTYPE_DRAGON_FIREBALL, L"DragonFireball", 1000); } -std::shared_ptr EntityIO::newEntity(const wstring& id, Level *level) +std::shared_ptr EntityIO::newEntity(const std::wstring& id, Level *level) { std::shared_ptr entity; @@ -181,16 +181,16 @@ int EntityIO::getId(std::shared_ptr entity) return (*it).second; } -wstring EntityIO::getEncodeId(std::shared_ptr entity) +std::wstring EntityIO::getEncodeId(std::shared_ptr entity) { - std::unordered_map::iterator it = classIdMap->find( entity->GetType() ); + std::unordered_map::iterator it = classIdMap->find( entity->GetType() ); if( it != classIdMap->end() ) return (*it).second; else return L""; } -int EntityIO::getId(const wstring &encodeId) +int EntityIO::getId(const std::wstring &encodeId) { AUTO_VAR(it, idNumMap->find(encodeId)); if (it == idNumMap->end()) @@ -201,7 +201,7 @@ int EntityIO::getId(const wstring &encodeId) return it->second; } -wstring EntityIO::getEncodeId(int entityIoValue) +std::wstring EntityIO::getEncodeId(int entityIoValue) { //Class class1 = numClassMap.get(entityIoValue); //if (class1 != null) @@ -212,7 +212,7 @@ wstring EntityIO::getEncodeId(int entityIoValue) AUTO_VAR(it, numClassMap->find(entityIoValue)); if(it != numClassMap->end() ) { - std::unordered_map::iterator classIdIt = classIdMap->find( it->second ); + std::unordered_map::iterator classIdIt = classIdMap->find( it->second ); if( classIdIt != classIdMap->end() ) return (*classIdIt).second; else @@ -235,7 +235,7 @@ int EntityIO::getNameId(int entityIoValue) return id; } -eINSTANCEOF EntityIO::getType(const wstring &idString) +eINSTANCEOF EntityIO::getType(const std::wstring &idString) { AUTO_VAR(it, numClassMap->find(getId(idString))); if(it != numClassMap->end() ) diff --git a/Minecraft.World/Level/Storage/EntityIO.h b/Minecraft.World/Level/Storage/EntityIO.h index b5e87b5e2..c96bcb8e8 100644 --- a/Minecraft.World/Level/Storage/EntityIO.h +++ b/Minecraft.World/Level/Storage/EntityIO.h @@ -28,32 +28,32 @@ public: }; private: - static std::unordered_map *idCreateMap; - static std::unordered_map *classIdMap; + static std::unordered_map *idCreateMap; + static std::unordered_map *classIdMap; static std::unordered_map *numCreateMap; static std::unordered_map *numClassMap; static std::unordered_map *classNumMap; - static std::unordered_map *idNumMap; + static std::unordered_map *idNumMap; public: static std::unordered_map idsSpawnableInCreative; private: - static void setId(entityCreateFn createFn, eINSTANCEOF clas, const wstring &id, int idNum); - static void setId(entityCreateFn createFn, eINSTANCEOF clas, const wstring &id, int idNum, eMinecraftColour color1, eMinecraftColour color2, int nameId); + static void setId(entityCreateFn createFn, eINSTANCEOF clas, const std::wstring &id, int idNum); + static void setId(entityCreateFn createFn, eINSTANCEOF clas, const std::wstring &id, int idNum, eMinecraftColour color1, eMinecraftColour color2, int nameId); public: static void staticCtor(); - static std::shared_ptr newEntity(const wstring& id, Level *level); + static std::shared_ptr newEntity(const std::wstring& id, Level *level); static std::shared_ptr loadStatic(CompoundTag *tag, Level *level); static std::shared_ptr newById(int id, Level *level); static std::shared_ptr newByEnumType(eINSTANCEOF eType, Level *level); static int getId(std::shared_ptr entity); - static wstring getEncodeId(std::shared_ptr entity); - static int getId(const wstring &encodeId); - static wstring getEncodeId(int entityIoValue); + static std::wstring getEncodeId(std::shared_ptr entity); + static int getId(const std::wstring &encodeId); + static std::wstring getEncodeId(int entityIoValue); static int getNameId(int entityIoValue); - static eINSTANCEOF getType(const wstring &idString); + static eINSTANCEOF getType(const std::wstring &idString); static eINSTANCEOF getClass(int id); // 4J-JEV, added for enumerating mobs. diff --git a/Minecraft.World/Level/Storage/LevelSettings.cpp b/Minecraft.World/Level/Storage/LevelSettings.cpp index 4f6729038..71fc56bb0 100644 --- a/Minecraft.World/Level/Storage/LevelSettings.cpp +++ b/Minecraft.World/Level/Storage/LevelSettings.cpp @@ -16,7 +16,7 @@ void GameType::staticCtor() ADVENTURE = new GameType(2, L"adventure"); } -GameType::GameType(int id, const wstring &name) +GameType::GameType(int id, const std::wstring &name) { this->id = id; this->name = name; @@ -27,7 +27,7 @@ int GameType::getId() return id; } -wstring GameType::getName() +std::wstring GameType::getName() { return name; } @@ -75,7 +75,7 @@ GameType *GameType::byId(int id) return SURVIVAL; } -GameType *GameType::byName(const wstring &name) +GameType *GameType::byName(const std::wstring &name) { if(name.compare(NOT_SET->name) == 0) return NOT_SET; else if(name.compare(SURVIVAL->name) == 0) return SURVIVAL; diff --git a/Minecraft.World/Level/Storage/LevelSettings.h b/Minecraft.World/Level/Storage/LevelSettings.h index c183df8c1..dd3d26a66 100644 --- a/Minecraft.World/Level/Storage/LevelSettings.h +++ b/Minecraft.World/Level/Storage/LevelSettings.h @@ -17,19 +17,19 @@ public: private: int id; - wstring name; + std::wstring name; - GameType(int id, const wstring &name); + GameType(int id, const std::wstring &name); public: int getId(); - wstring getName(); + std::wstring getName(); void updatePlayerAbilities(Abilities *abilities); bool isReadOnly(); bool isCreative(); bool isSurvival(); static GameType *byId(int id); - static GameType *byName(const wstring &name); + static GameType *byName(const std::wstring &name); }; class LevelSettings diff --git a/Minecraft.World/Level/Storage/LevelStorage.cpp b/Minecraft.World/Level/Storage/LevelStorage.cpp index c04f11324..e6d45e7ca 100644 --- a/Minecraft.World/Level/Storage/LevelStorage.cpp +++ b/Minecraft.World/Level/Storage/LevelStorage.cpp @@ -2,5 +2,5 @@ #include "LevelStorage.h" -const wstring LevelStorage::NETHER_FOLDER = L"DIM-1"; -const wstring LevelStorage::ENDER_FOLDER = L"DIM1/"; \ No newline at end of file +const std::wstring LevelStorage::NETHER_FOLDER = L"DIM-1"; +const std::wstring LevelStorage::ENDER_FOLDER = L"DIM1/"; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/LevelStorage.h b/Minecraft.World/Level/Storage/LevelStorage.h index 487be5662..485dbe4ff 100644 --- a/Minecraft.World/Level/Storage/LevelStorage.h +++ b/Minecraft.World/Level/Storage/LevelStorage.h @@ -15,8 +15,8 @@ class ConsoleSaveFile; class LevelStorage { public: - static const wstring NETHER_FOLDER; - static const wstring ENDER_FOLDER; + static const std::wstring NETHER_FOLDER; + static const std::wstring ENDER_FOLDER; virtual LevelData *prepareLevel() = 0; virtual void checkSession() = 0; @@ -25,8 +25,8 @@ public: virtual void saveLevelData(LevelData *levelData) = 0; virtual PlayerIO *getPlayerIO() = 0; virtual void closeAll() = 0; - virtual ConsoleSavePath getDataFile(const wstring& id) = 0; - virtual wstring getLevelId() = 0; + virtual ConsoleSavePath getDataFile(const std::wstring& id) = 0; + virtual std::wstring getLevelId() = 0; public: virtual ConsoleSaveFile *getSaveFile() { return NULL; } diff --git a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp b/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp index a2d9cca5c..154efd666 100644 --- a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp +++ b/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.cpp @@ -46,12 +46,12 @@ void LevelStorageProfilerDecorator::closeAll() capsulated->closeAll(); } -ConsoleSavePath LevelStorageProfilerDecorator::getDataFile(const wstring& id) +ConsoleSavePath LevelStorageProfilerDecorator::getDataFile(const std::wstring& id) { return capsulated->getDataFile(id); } -wstring LevelStorageProfilerDecorator::getLevelId() +std::wstring LevelStorageProfilerDecorator::getLevelId() { return capsulated->getLevelId(); } \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.h b/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.h index bd1751cca..0f697caf4 100644 --- a/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.h +++ b/Minecraft.World/Level/Storage/LevelStorageProfilerDecorator.h @@ -22,6 +22,6 @@ public: void saveLevelData(LevelData *levelData); PlayerIO *getPlayerIO(); void closeAll(); - ConsoleSavePath getDataFile(const wstring& id); - wstring getLevelId(); + ConsoleSavePath getDataFile(const std::wstring& id); + std::wstring getLevelId(); }; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/LevelStorageSource.h b/Minecraft.World/Level/Storage/LevelStorageSource.h index 9b6db3946..d6eb86387 100644 --- a/Minecraft.World/Level/Storage/LevelStorageSource.h +++ b/Minecraft.World/Level/Storage/LevelStorageSource.h @@ -12,11 +12,11 @@ class ConsoleSaveFile; class LevelStorageSource { public: - virtual wstring getName() = 0; - virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) = 0; + virtual std::wstring getName() = 0; + virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, bool createPlayerDir) = 0; virtual vector *getLevelList() = 0; virtual void clearAll() = 0; - virtual LevelData *getDataTagFor(ConsoleSaveFile *saveFile, const wstring& levelId) = 0; + virtual LevelData *getDataTagFor(ConsoleSaveFile *saveFile, const std::wstring& levelId) = 0; /** * Tests if a levelId can be used to store a level. For example, a levelId @@ -28,10 +28,10 @@ public: * @param levelId * @return */ - virtual bool isNewLevelIdAcceptable(const wstring& levelId) = 0; - virtual void deleteLevel(const wstring& levelId) = 0; - virtual void renameLevel(const wstring& levelId, const wstring& newLevelName) = 0; - virtual bool isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId) = 0; - virtual bool requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId) = 0; - virtual bool convertLevel(ConsoleSaveFile *saveFile, const wstring &levelId, ProgressListener *progress) = 0; + virtual bool isNewLevelIdAcceptable(const std::wstring& levelId) = 0; + virtual void deleteLevel(const std::wstring& levelId) = 0; + virtual void renameLevel(const std::wstring& levelId, const std::wstring& newLevelName) = 0; + virtual bool isConvertible(ConsoleSaveFile *saveFile, const std::wstring& levelId) = 0; + virtual bool requiresConversion(ConsoleSaveFile *saveFile, const std::wstring& levelId) = 0; + virtual bool convertLevel(ConsoleSaveFile *saveFile, const std::wstring &levelId, ProgressListener *progress) = 0; }; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/LevelSummary.cpp b/Minecraft.World/Level/Storage/LevelSummary.cpp index 5b8948676..7e37acee1 100644 --- a/Minecraft.World/Level/Storage/LevelSummary.cpp +++ b/Minecraft.World/Level/Storage/LevelSummary.cpp @@ -1,7 +1,7 @@ #include "../../Build/stdafx.h" #include "LevelSummary.h" -LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : +LevelSummary::LevelSummary(const std::wstring& levelId, const std::wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : levelId( levelId ), levelName( levelName ), lastPlayed( lastPlayed ), @@ -13,12 +13,12 @@ LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __i { } -wstring LevelSummary::getLevelId() +std::wstring LevelSummary::getLevelId() { return levelId; } -wstring LevelSummary::getLevelName() +std::wstring LevelSummary::getLevelName() { return levelName; } diff --git a/Minecraft.World/Level/Storage/LevelSummary.h b/Minecraft.World/Level/Storage/LevelSummary.h index bbf391ff6..b8eaee32e 100644 --- a/Minecraft.World/Level/Storage/LevelSummary.h +++ b/Minecraft.World/Level/Storage/LevelSummary.h @@ -5,8 +5,8 @@ class GameType; class LevelSummary { - const wstring levelId; - const wstring levelName; + const std::wstring levelId; + const std::wstring levelName; const __int64 lastPlayed; const __int64 sizeOnDisk; const bool requiresConversion; @@ -15,9 +15,9 @@ class LevelSummary const bool _hasCheats; public: - LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); - wstring getLevelId(); - wstring getLevelName(); + LevelSummary(const std::wstring& levelId, const std::wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); + std::wstring getLevelId(); + std::wstring getLevelName(); __int64 getSizeOnDisk(); bool isRequiresConversion(); __int64 getLastPlayed(); diff --git a/Minecraft.World/Level/Storage/LevelType.cpp b/Minecraft.World/Level/Storage/LevelType.cpp index ac272d3e6..b7a67f3b3 100644 --- a/Minecraft.World/Level/Storage/LevelType.cpp +++ b/Minecraft.World/Level/Storage/LevelType.cpp @@ -30,12 +30,12 @@ void LevelType::staticCtor() lvl_normal_1_1->setSelectableByUser(false); } -LevelType::LevelType(int id, wstring generatorName) +LevelType::LevelType(int id, std::wstring generatorName) { init(id, generatorName, 0); } -LevelType::LevelType(int id, wstring generatorName, int version) +LevelType::LevelType(int id, std::wstring generatorName, int version) { m_generatorName = generatorName; m_version = version; @@ -44,7 +44,7 @@ LevelType::LevelType(int id, wstring generatorName, int version) } -void LevelType::init(int id, wstring generatorName, int version) +void LevelType::init(int id, std::wstring generatorName, int version) { m_generatorName = generatorName; m_version = version; @@ -52,12 +52,12 @@ void LevelType::init(int id, wstring generatorName, int version) levelTypes[id] = this; } -wstring LevelType::getGeneratorName() +std::wstring LevelType::getGeneratorName() { return m_generatorName; } -wstring LevelType::getDescriptionId() +std::wstring LevelType::getDescriptionId() { return L"generator." + m_generatorName; } @@ -98,7 +98,7 @@ bool LevelType::hasReplacement() return m_replacement; } -LevelType *LevelType::getLevelType(wstring name) +LevelType *LevelType::getLevelType(std::wstring name) { if(name.length()>0) { diff --git a/Minecraft.World/Level/Storage/LevelType.h b/Minecraft.World/Level/Storage/LevelType.h index 7d5b41293..5689c90ba 100644 --- a/Minecraft.World/Level/Storage/LevelType.h +++ b/Minecraft.World/Level/Storage/LevelType.h @@ -14,17 +14,17 @@ public: static void staticCtor(); private: - wstring m_generatorName; + std::wstring m_generatorName; int m_version; bool m_selectable; bool m_replacement; - LevelType(int id, wstring generatorName); - LevelType(int id, wstring generatorName, int version); - void init(int id, wstring generatorName, int version); + LevelType(int id, std::wstring generatorName); + LevelType(int id, std::wstring generatorName, int version); + void init(int id, std::wstring generatorName, int version); public: - wstring getGeneratorName(); - wstring getDescriptionId(); + std::wstring getGeneratorName(); + std::wstring getDescriptionId(); int getVersion(); LevelType *getReplacementForVersion(int oldVersion); private: @@ -35,5 +35,5 @@ private: LevelType *setHasReplacement(); public: bool hasReplacement(); - static LevelType *getLevelType(wstring name); + static LevelType *getLevelType(std::wstring name); }; diff --git a/Minecraft.World/Level/Storage/MapItemSavedData.cpp b/Minecraft.World/Level/Storage/MapItemSavedData.cpp index 03d320c51..8e1dc10f9 100644 --- a/Minecraft.World/Level/Storage/MapItemSavedData.cpp +++ b/Minecraft.World/Level/Storage/MapItemSavedData.cpp @@ -153,7 +153,7 @@ charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket(std::shared_ptrdoesFileExist(currentFile)) { @@ -293,7 +293,7 @@ void McRegionChunkStorage::flush() { #ifdef SPLIT_SAVES PIXBeginNamedEvent(0, "Flushing entity data"); - ConsoleSavePath currentFile = ConsoleSavePath( m_prefix + wstring( L"entities.dat" ) ); + ConsoleSavePath currentFile = ConsoleSavePath( m_prefix + std::wstring( L"entities.dat" ) ); ConsoleSaveFileOutputStream fos = ConsoleSaveFileOutputStream( m_saveFile, currentFile ); BufferedOutputStream bos(&fos, 1024*1024); DataOutputStream dos(&bos); diff --git a/Minecraft.World/Level/Storage/McRegionChunkStorage.h b/Minecraft.World/Level/Storage/McRegionChunkStorage.h index e63bc3957..9cd1b00b5 100644 --- a/Minecraft.World/Level/Storage/McRegionChunkStorage.h +++ b/Minecraft.World/Level/Storage/McRegionChunkStorage.h @@ -12,7 +12,7 @@ class ConsoleSaveFile; class McRegionChunkStorage : public ChunkStorage { private: - const wstring m_prefix; + const std::wstring m_prefix; ConsoleSaveFile *m_saveFile; static CRITICAL_SECTION cs_memory; @@ -23,7 +23,7 @@ private: static C4JThread *s_saveThreads[3]; public: - McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstring &prefix); + McRegionChunkStorage(ConsoleSaveFile *saveFile, const std::wstring &prefix); ~McRegionChunkStorage(); static void staticCtor(); diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp b/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp index 6fd3b310f..eb0fc03b1 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp @@ -7,7 +7,7 @@ #include "../../IO/Files/File.h" #include "McRegionLevelStorage.h" -McRegionLevelStorage::McRegionLevelStorage(ConsoleSaveFile *saveFile, File dir, const wstring& levelName, bool createPlayerDir) +McRegionLevelStorage::McRegionLevelStorage(ConsoleSaveFile *saveFile, File dir, const std::wstring& levelName, bool createPlayerDir) : DirectoryLevelStorage(saveFile, dir, levelName, createPlayerDir) { RegionFileCache::clear(); diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorage.h b/Minecraft.World/Level/Storage/McRegionLevelStorage.h index 72d5cc07f..ccc0b514b 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorage.h +++ b/Minecraft.World/Level/Storage/McRegionLevelStorage.h @@ -13,7 +13,7 @@ protected: static const int MCREGION_VERSION_ID = 0x4abc; public: - McRegionLevelStorage(ConsoleSaveFile *saveFile, File dir, const wstring& levelName, bool createPlayerDir); + McRegionLevelStorage(ConsoleSaveFile *saveFile, File dir, const std::wstring& levelName, bool createPlayerDir); ~McRegionLevelStorage(); virtual ChunkStorage *createChunkStorage(Dimension *dimension); diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp b/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp index c49fb9fa8..b6e5b4ba6 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp +++ b/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp @@ -27,7 +27,7 @@ McRegionLevelStorageSource::McRegionLevelStorageSource(File dir) : DirectoryLeve { } -wstring McRegionLevelStorageSource::getName() +std::wstring McRegionLevelStorageSource::getName() { return L"Scaevolus' McRegion"; } @@ -49,13 +49,13 @@ vector *McRegionLevelStorageSource::getLevelList() continue; } - wstring levelId = file->getName(); + std::wstring levelId = file->getName(); LevelData *levelData = getDataTagFor(levelId); if (levelData != NULL) { bool requiresConversion = levelData->getVersion() != McRegionLevelStorage::MCREGION_VERSION_ID; - wstring levelName = levelData->getLevelName(); + std::wstring levelName = levelData->getLevelName(); if (levelName.empty()) // 4J Jev TODO: levelName can't be NULL? if (levelName == NULL || isEmpty(levelName)) { @@ -74,13 +74,13 @@ void McRegionLevelStorageSource::clearAll() { } -std::shared_ptr McRegionLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) +std::shared_ptr McRegionLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, bool createPlayerDir) { // return new LevelStorageProfilerDecorator(new McRegionLevelStorage(baseDir, levelId, createPlayerDir)); return std::shared_ptr(new McRegionLevelStorage(saveFile, baseDir, levelId, createPlayerDir)); } -bool McRegionLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId) +bool McRegionLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const std::wstring& levelId) { // check if there is old file format level data LevelData *levelData = getDataTagFor(saveFile, levelId); @@ -94,7 +94,7 @@ bool McRegionLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const return true; } -bool McRegionLevelStorageSource::requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId) +bool McRegionLevelStorageSource::requiresConversion(ConsoleSaveFile *saveFile, const std::wstring& levelId) { LevelData *levelData = getDataTagFor(saveFile, levelId); if (levelData == NULL || levelData->getVersion() != 0) @@ -107,7 +107,7 @@ bool McRegionLevelStorageSource::requiresConversion(ConsoleSaveFile *saveFile, c return true; } -bool McRegionLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress) +bool McRegionLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, ProgressListener *progress) { assert(false); // I removed this while updating the saves to use the single save file @@ -300,7 +300,7 @@ bool McRegionLevelStorageSource::FolderFilter::accept(File *file) } -bool McRegionLevelStorageSource::ChunkFilter::accept(File *dir, const wstring& name) +bool McRegionLevelStorageSource::ChunkFilter::accept(File *dir, const std::wstring& name) { Matcher matcher( chunkFilePattern, name ); return matcher.matches(); diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.h b/Minecraft.World/Level/Storage/McRegionLevelStorageSource.h index f4bc23788..e6da7adb4 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.h +++ b/Minecraft.World/Level/Storage/McRegionLevelStorageSource.h @@ -14,13 +14,13 @@ public: class ChunkFile; McRegionLevelStorageSource(File dir); - virtual wstring getName(); + virtual std::wstring getName(); virtual vector *getLevelList(); virtual void clearAll(); - virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir); - virtual bool isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId); - virtual bool requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId); - virtual bool convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress); + virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, bool createPlayerDir); + virtual bool isConvertible(ConsoleSaveFile *saveFile, const std::wstring& levelId); + virtual bool requiresConversion(ConsoleSaveFile *saveFile, const std::wstring& levelId); + virtual bool convertLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, ProgressListener *progress); private: #if 0 @@ -44,7 +44,7 @@ public: { public: static const std::tr1::wregex chunkFilePattern; // was Pattern - bool accept(File *dir, const wstring& name); + bool accept(File *dir, const std::wstring& name); }; static class ChunkFile // implements Comparable diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorage.cpp b/Minecraft.World/Level/Storage/MemoryLevelStorage.cpp index 68c3c453a..d6df23444 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/MemoryLevelStorage.cpp @@ -52,12 +52,12 @@ bool MemoryLevelStorage::load(std::shared_ptr player) return false; } -CompoundTag *MemoryLevelStorage::loadPlayerDataTag(const wstring& playerName) +CompoundTag *MemoryLevelStorage::loadPlayerDataTag(const std::wstring& playerName) { return NULL; } -ConsoleSavePath MemoryLevelStorage::getDataFile(const wstring& id) +ConsoleSavePath MemoryLevelStorage::getDataFile(const std::wstring& id) { - return ConsoleSaveFile(wstring(L"")); + return ConsoleSaveFile(std::wstring(L"")); } \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorage.h b/Minecraft.World/Level/Storage/MemoryLevelStorage.h index 93eff457d..980a18171 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorage.h +++ b/Minecraft.World/Level/Storage/MemoryLevelStorage.h @@ -26,6 +26,6 @@ public: virtual void closeAll(); virtual void save(std::shared_ptr player); virtual bool load(std::shared_ptr player); - virtual CompoundTag *loadPlayerDataTag(const wstring& playerName); - virtual ConsoleSavePath getDataFile(const wstring& id); + virtual CompoundTag *loadPlayerDataTag(const std::wstring& playerName); + virtual ConsoleSavePath getDataFile(const std::wstring& id); }; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp b/Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp index 46c549bc9..398052cc6 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp +++ b/Minecraft.World/Level/Storage/MemoryLevelStorageSource.cpp @@ -8,12 +8,12 @@ MemoryLevelStorageSource::MemoryLevelStorageSource() { } -wstring MemoryLevelStorageSource::getName() +std::wstring MemoryLevelStorageSource::getName() { return L"Memory Storage"; } -std::shared_ptr MemoryLevelStorageSource::selectLevel(const wstring& levelId, bool createPlayerDir) +std::shared_ptr MemoryLevelStorageSource::selectLevel(const std::wstring& levelId, bool createPlayerDir) { return std::shared_ptr () new MemoryLevelStorage()); } @@ -27,35 +27,35 @@ void MemoryLevelStorageSource::clearAll() { } -LevelData *MemoryLevelStorageSource::getDataTagFor(const wstring& levelId) +LevelData *MemoryLevelStorageSource::getDataTagFor(const std::wstring& levelId) { return NULL; } -bool MemoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) +bool MemoryLevelStorageSource::isNewLevelIdAcceptable(const std::wstring& levelId) { return true; } -void MemoryLevelStorageSource::deleteLevel(const wstring& levelId) +void MemoryLevelStorageSource::deleteLevel(const std::wstring& levelId) { } -void MemoryLevelStorageSource::renameLevel(const wstring& levelId, const wstring& newLevelName) +void MemoryLevelStorageSource::renameLevel(const std::wstring& levelId, const std::wstring& newLevelName) { } -bool MemoryLevelStorageSource::isConvertible(const wstring& levelId) +bool MemoryLevelStorageSource::isConvertible(const std::wstring& levelId) { return false; } -bool MemoryLevelStorageSource::requiresConversion(const wstring& levelId) +bool MemoryLevelStorageSource::requiresConversion(const std::wstring& levelId) { return false; } -bool MemoryLevelStorageSource::convertLevel(const wstring& levelId, ProgressListener *progress) +bool MemoryLevelStorageSource::convertLevel(const std::wstring& levelId, ProgressListener *progress) { return false; } \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.h b/Minecraft.World/Level/Storage/MemoryLevelStorageSource.h index 2d3de863b..734f8c81e 100644 --- a/Minecraft.World/Level/Storage/MemoryLevelStorageSource.h +++ b/Minecraft.World/Level/Storage/MemoryLevelStorageSource.h @@ -7,15 +7,15 @@ class MemoryLevelStorageSource : public LevelStorageSource { public: MemoryLevelStorageSource(); - wstring getName(); - std::shared_ptr selectLevel(const wstring& levelId, bool createPlayerDir); + std::wstring getName(); + std::shared_ptr selectLevel(const std::wstring& levelId, bool createPlayerDir); vector *getLevelList(); void clearAll(); - LevelData *getDataTagFor(const wstring& levelId); - bool isNewLevelIdAcceptable(const wstring& levelId); - void deleteLevel(const wstring& levelId); - void renameLevel(const wstring& levelId, const wstring& newLevelName); - bool isConvertible(const wstring& levelId); - bool requiresConversion(const wstring& levelId); - bool convertLevel(const wstring& levelId, ProgressListener *progress); + LevelData *getDataTagFor(const std::wstring& levelId); + bool isNewLevelIdAcceptable(const std::wstring& levelId); + void deleteLevel(const std::wstring& levelId); + void renameLevel(const std::wstring& levelId, const std::wstring& newLevelName); + bool isConvertible(const std::wstring& levelId); + bool requiresConversion(const std::wstring& levelId); + bool convertLevel(const std::wstring& levelId, ProgressListener *progress); }; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/MockedLevelStorage.cpp b/Minecraft.World/Level/Storage/MockedLevelStorage.cpp index 46e1c0d1f..18dcd9e4a 100644 --- a/Minecraft.World/Level/Storage/MockedLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/MockedLevelStorage.cpp @@ -38,12 +38,12 @@ void MockedLevelStorage::closeAll() { } -ConsoleSavePath MockedLevelStorage::getDataFile(const wstring& id) +ConsoleSavePath MockedLevelStorage::getDataFile(const std::wstring& id) { - return ConsoleSavePath(wstring(L"")); + return ConsoleSavePath(std::wstring(L"")); } -wstring MockedLevelStorage::getLevelId() +std::wstring MockedLevelStorage::getLevelId() { return L"none"; } \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/MockedLevelStorage.h b/Minecraft.World/Level/Storage/MockedLevelStorage.h index e045b03a9..da80d37e0 100644 --- a/Minecraft.World/Level/Storage/MockedLevelStorage.h +++ b/Minecraft.World/Level/Storage/MockedLevelStorage.h @@ -15,8 +15,8 @@ public: virtual void saveLevelData(LevelData *levelData); virtual PlayerIO *getPlayerIO(); virtual void closeAll(); - virtual ConsoleSavePath getDataFile(const wstring& id); - virtual wstring getLevelId(); + virtual ConsoleSavePath getDataFile(const std::wstring& id); + virtual std::wstring getLevelId(); public: virtual ConsoleSaveFile *getSaveFile() { return NULL; } }; \ No newline at end of file diff --git a/Minecraft.World/Level/Storage/OldChunkStorage.cpp b/Minecraft.World/Level/Storage/OldChunkStorage.cpp index 5d49c7ddd..ce89aef11 100644 --- a/Minecraft.World/Level/Storage/OldChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/OldChunkStorage.cpp @@ -75,7 +75,7 @@ File OldChunkStorage::getFile(int x, int z) _itow(z & 63,path2,36); #endif //sprintf(file,"%s\\%s",dir,path1); - File file( dir, wstring( path1 ) ); + File file( dir, std::wstring( path1 ) ); if( !file.exists() ) { if(create) file.mkdir(); @@ -87,7 +87,7 @@ File OldChunkStorage::getFile(int x, int z) //strcat(file,"\\"); //strcat(file,path2); - file = File( file, wstring( path2 ) ); + file = File( file, std::wstring( path2 ) ); if( !file.exists() ) { if(create) file.mkdir(); @@ -100,7 +100,7 @@ File OldChunkStorage::getFile(int x, int z) //strcat(file,"\\"); //strcat(file,name); //sprintf(file,"%s\\%s",file,name); - file = File( file, wstring( name ) ); + file = File( file, std::wstring( name ) ); if ( !file.exists() ) { if (!create) diff --git a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp b/Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp index 76ebb55dd..2232faf78 100644 --- a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp +++ b/Minecraft.World/Level/Storage/ReadOnlyChunkCache.cpp @@ -84,7 +84,7 @@ bool ReadOnlyChunkCache::shouldSave() return false; } -wstring ReadOnlyChunkCache::gatherStats() +std::wstring ReadOnlyChunkCache::gatherStats() { return L"ReadOnlyChunkCache"; } @@ -94,7 +94,7 @@ vector *ReadOnlyChunkCache::getMobsAt(MobCategory *mobC return NULL; } -TilePos *ReadOnlyChunkCache::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *ReadOnlyChunkCache::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { return NULL; } diff --git a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.h b/Minecraft.World/Level/Storage/ReadOnlyChunkCache.h index dea121cf0..745725e09 100644 --- a/Minecraft.World/Level/Storage/ReadOnlyChunkCache.h +++ b/Minecraft.World/Level/Storage/ReadOnlyChunkCache.h @@ -32,8 +32,8 @@ public: virtual bool save(bool force, ProgressListener *progressListener); virtual bool tick(); virtual bool shouldSave(); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/Level/Storage/RegionFileCache.cpp b/Minecraft.World/Level/Storage/RegionFileCache.cpp index 9f75c1841..0f9ae968e 100644 --- a/Minecraft.World/Level/Storage/RegionFileCache.cpp +++ b/Minecraft.World/Level/Storage/RegionFileCache.cpp @@ -17,7 +17,7 @@ bool RegionFileCache::useSplitSaves(ESavePlatform platform) }; } -RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) // 4J - TODO was synchronized +RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) // 4J - TODO was synchronized { // 4J Jev - changed back to use of the File class. //char file[MAX_PATH_SIZE]; @@ -25,16 +25,16 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst //File regionDir(basePath, L"region"); - //File file(regionDir, wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); + //File file(regionDir, std::wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); MemSect(31); File file; if(useSplitSaves(saveFile->getSavePlatform())) { - file = File( prefix + wstring(L"r.") + _toString(chunkX>>4) + L"." + _toString(chunkZ>>4) + L".mcr" ); + file = File( prefix + std::wstring(L"r.") + _toString(chunkX>>4) + L"." + _toString(chunkZ>>4) + L".mcr" ); } else { - file = File( prefix + wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); + file = File( prefix + std::wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); } MemSect(0); @@ -87,13 +87,13 @@ void RegionFileCache::_clear() // 4J - TODO was synchronized cache.clear(); } -int RegionFileCache::_getSizeDelta(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) +int RegionFileCache::_getSizeDelta(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { RegionFile *r = _getRegionFile(saveFile, prefix, chunkX, chunkZ); return r->getSizeDelta(); } -DataInputStream *RegionFileCache::_getChunkDataInputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) +DataInputStream *RegionFileCache::_getChunkDataInputStream(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { RegionFile* r = _getRegionFile(saveFile, prefix, chunkX, chunkZ); if(useSplitSaves(saveFile->getSavePlatform())) @@ -107,7 +107,7 @@ DataInputStream *RegionFileCache::_getChunkDataInputStream(ConsoleSaveFile *save } } -DataOutputStream *RegionFileCache::_getChunkDataOutputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) +DataOutputStream *RegionFileCache::_getChunkDataOutputStream(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { RegionFile* r = _getRegionFile(saveFile, prefix, chunkX, chunkZ); if(useSplitSaves(saveFile->getSavePlatform())) diff --git a/Minecraft.World/Level/Storage/RegionFileCache.h b/Minecraft.World/Level/Storage/RegionFileCache.h index abad6b060..2115f9cf6 100644 --- a/Minecraft.World/Level/Storage/RegionFileCache.h +++ b/Minecraft.World/Level/Storage/RegionFileCache.h @@ -17,18 +17,18 @@ public: // Made public and non-static so we can have a cache for input and output files RegionFileCache() {} - RegionFile *_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); // 4J - TODO was synchronized + RegionFile *_getRegionFile(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ); // 4J - TODO was synchronized void _clear(); // 4J - TODO was synchronized - int _getSizeDelta(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); - DataInputStream *_getChunkDataInputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); - DataOutputStream *_getChunkDataOutputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); + int _getSizeDelta(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ); + DataInputStream *_getChunkDataInputStream(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ); + DataOutputStream *_getChunkDataOutputStream(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ); // Keep static version for general game usage - static RegionFile *getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getRegionFile(saveFile, prefix, chunkX, chunkZ); } + static RegionFile *getRegionFile(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getRegionFile(saveFile, prefix, chunkX, chunkZ); } static void clear() { s_defaultCache._clear(); } - static int getSizeDelta(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getSizeDelta(saveFile, prefix, chunkX, chunkZ); } - static DataInputStream *getChunkDataInputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getChunkDataInputStream(saveFile, prefix, chunkX, chunkZ); } - static DataOutputStream *getChunkDataOutputStream(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getChunkDataOutputStream(saveFile, prefix, chunkX, chunkZ); } + static int getSizeDelta(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getSizeDelta(saveFile, prefix, chunkX, chunkZ); } + static DataInputStream *getChunkDataInputStream(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getChunkDataInputStream(saveFile, prefix, chunkX, chunkZ); } + static DataOutputStream *getChunkDataOutputStream(ConsoleSaveFile *saveFile, const std::wstring &prefix, int chunkX, int chunkZ) { return s_defaultCache._getChunkDataOutputStream(saveFile, prefix, chunkX, chunkZ); } private: bool useSplitSaves(ESavePlatform platform); diff --git a/Minecraft.World/Level/Storage/SavedData.cpp b/Minecraft.World/Level/Storage/SavedData.cpp index 63ba1567d..74b51d67a 100644 --- a/Minecraft.World/Level/Storage/SavedData.cpp +++ b/Minecraft.World/Level/Storage/SavedData.cpp @@ -3,7 +3,7 @@ -SavedData::SavedData(const wstring& id) : id( id ) +SavedData::SavedData(const std::wstring& id) : id( id ) { dirty = false; } diff --git a/Minecraft.World/Level/Storage/SavedData.h b/Minecraft.World/Level/Storage/SavedData.h index e4d0ba3f7..6a57aec25 100644 --- a/Minecraft.World/Level/Storage/SavedData.h +++ b/Minecraft.World/Level/Storage/SavedData.h @@ -8,13 +8,13 @@ class CompoundTag; class SavedData : public enable_shared_from_this { public: - const wstring id; + const std::wstring id; private: bool dirty; public: - SavedData(const wstring& id); + SavedData(const std::wstring& id); virtual void load(CompoundTag *tag) = 0; virtual void save(CompoundTag *tag) = 0; diff --git a/Minecraft.World/Level/Storage/SavedDataStorage.cpp b/Minecraft.World/Level/Storage/SavedDataStorage.cpp index e52d058e6..1303e36ee 100644 --- a/Minecraft.World/Level/Storage/SavedDataStorage.cpp +++ b/Minecraft.World/Level/Storage/SavedDataStorage.cpp @@ -11,16 +11,16 @@ SavedDataStorage::SavedDataStorage(LevelStorage *levelStorage) { /* - cache = new std::unordered_map >; + cache = new std::unordered_map >; savedDatas = new vector >; - usedAuxIds = new std::unordered_map; + usedAuxIds = new std::unordered_map; */ this->levelStorage = levelStorage; loadAuxValues(); } -std::shared_ptr SavedDataStorage::get(const type_info& clazz, const wstring& id) +std::shared_ptr SavedDataStorage::get(const type_info& clazz, const std::wstring& id) { AUTO_VAR(it, cache.find( id )); if (it != cache.end()) return (*it).second; @@ -59,13 +59,13 @@ std::shared_ptr SavedDataStorage::get(const type_info& clazz, const w if (data != NULL) { - cache.insert( std::unordered_map >::value_type( id , data ) ); + cache.insert( std::unordered_map >::value_type( id , data ) ); savedDatas.push_back(data); } return data; } -void SavedDataStorage::set(const wstring& id, std::shared_ptr data) +void SavedDataStorage::set(const std::wstring& id, std::shared_ptr data) { if (data == NULL) { @@ -145,7 +145,7 @@ void SavedDataStorage::loadAuxValues() if (dynamic_cast(tag) != NULL) { ShortTag *sTag = (ShortTag *) tag; - wstring id = sTag->getName(); + std::wstring id = sTag->getName(); short val = sTag->data; usedAuxIds.insert( uaiMapType::value_type( id, val ) ); } @@ -154,7 +154,7 @@ void SavedDataStorage::loadAuxValues() } } -int SavedDataStorage::getFreeAuxValueFor(const wstring& id) +int SavedDataStorage::getFreeAuxValueFor(const std::wstring& id) { AUTO_VAR(it, usedAuxIds.find( id )); short val = 0; diff --git a/Minecraft.World/Level/Storage/SavedDataStorage.h b/Minecraft.World/Level/Storage/SavedDataStorage.h index 16128040e..599a0de98 100644 --- a/Minecraft.World/Level/Storage/SavedDataStorage.h +++ b/Minecraft.World/Level/Storage/SavedDataStorage.h @@ -9,18 +9,18 @@ class SavedDataStorage private: LevelStorage *levelStorage; - typedef std::unordered_map > cacheMapType; + typedef std::unordered_map > cacheMapType; cacheMapType cache; vector > savedDatas; - typedef std::unordered_map uaiMapType; + typedef std::unordered_map uaiMapType; uaiMapType usedAuxIds; public: SavedDataStorage(LevelStorage *); - std::shared_ptr get(const type_info& clazz, const wstring& id); - void set(const wstring& id, std::shared_ptr data); + std::shared_ptr get(const type_info& clazz, const std::wstring& id); + void set(const std::wstring& id, std::shared_ptr data); void save(); private: @@ -28,7 +28,7 @@ private: void loadAuxValues(); public: - int getFreeAuxValueFor(const wstring& id); + int getFreeAuxValueFor(const std::wstring& id); // 4J Added int getAuxValueForMap(PlayerUID xuid, int dimension, int centreXC, int centreZC, int scale); diff --git a/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp b/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp index 4adadbb7f..b4c76ebbd 100644 --- a/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp @@ -29,7 +29,7 @@ ZonedChunkStorage::ZonedChunkStorage(File dir) tickCount = 0; //this->dir = dir; - this->dir = File( dir, wstring( L"data" ) ); + this->dir = File( dir, std::wstring( L"data" ) ); if( !this->dir.exists() ) this->dir.mkdirs(); } @@ -58,7 +58,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create) wchar_t zRadix36[64]; _itow(x,xRadix36,36); _itow(z,zRadix36,36); - File file = File(dir, wstring( L"zone_") + _toString( xRadix36 ) + L"_" + _toString( zRadix36 ) + L".dat" ); + File file = File(dir, std::wstring( L"zone_") + _toString( xRadix36 ) + L"_" + _toString( zRadix36 ) + L".dat" ); if ( !file.exists() ) { @@ -67,7 +67,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create) CloseHandle(ch); } - File entityFile = File(dir, wstring( L"entities_") + _toString( xRadix36 ) + L"_" + _toString( zRadix36 ) + L".dat" ); + File entityFile = File(dir, std::wstring( L"entities_") + _toString( xRadix36 ) + L"_" + _toString( zRadix36 ) + L".dat" ); zoneFiles[key] = new ZoneFile(key, file, entityFile); } diff --git a/Minecraft.World/Network/Connection.cpp b/Minecraft.World/Network/Connection.cpp index 2627c23ee..d8839a279 100644 --- a/Minecraft.World/Network/Connection.cpp +++ b/Minecraft.World/Network/Connection.cpp @@ -70,7 +70,7 @@ Connection::~Connection() dis = NULL; } -Connection::Connection(Socket *socket, const wstring& id, PacketListener *packetListener) // throws IOException +Connection::Connection(Socket *socket, const std::wstring& id, PacketListener *packetListener) // throws IOException { _init(); @@ -121,7 +121,7 @@ Connection::Connection(Socket *socket, const wstring& id, PacketListener *packet /* 4J JEV, java: - new Thread(wstring(id).append(L" read thread")) { + new Thread(std::wstring(id).append(L" read thread")) { }; @@ -347,7 +347,7 @@ void Connection::close(DisconnectPacket::eDisconnectReason reason, ...) va_list input; va_start( input, reason ); - disconnectReason = reason;//va_arg( input, const wstring ); + disconnectReason = reason;//va_arg( input, const std::wstring ); vector objs = vector(); void *i = NULL; diff --git a/Minecraft.World/Network/Connection.h b/Minecraft.World/Network/Connection.h index 1a39dea96..6cb92e912 100644 --- a/Minecraft.World/Network/Connection.h +++ b/Minecraft.World/Network/Connection.h @@ -95,7 +95,7 @@ private: public: // 4J Jev, need to delete the critical section. ~Connection(); - Connection(Socket *socket, const wstring& id, PacketListener *packetListener); // throws IOException + Connection(Socket *socket, const std::wstring& id, PacketListener *packetListener); // throws IOException void setListener(PacketListener *packetListener); void send(std::shared_ptr packet); diff --git a/Minecraft.World/Network/Packets/AddPaintingPacket.h b/Minecraft.World/Network/Packets/AddPaintingPacket.h index 0a002ddb5..0ec0c73f9 100644 --- a/Minecraft.World/Network/Packets/AddPaintingPacket.h +++ b/Minecraft.World/Network/Packets/AddPaintingPacket.h @@ -11,7 +11,7 @@ public: int id; int x, y, z; int dir; - wstring motive; + std::wstring motive; public: AddPaintingPacket(); diff --git a/Minecraft.World/Network/Packets/AddPlayerPacket.h b/Minecraft.World/Network/Packets/AddPlayerPacket.h index 909cfee9c..b1a39e1b5 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.h +++ b/Minecraft.World/Network/Packets/AddPlayerPacket.h @@ -15,7 +15,7 @@ private: public: int id; - wstring name; + std::wstring name; int x, y, z; char yRot, xRot; int carriedItem; diff --git a/Minecraft.World/Network/Packets/ChatPacket.cpp b/Minecraft.World/Network/Packets/ChatPacket.cpp index 227fd2d7c..a21bb1df0 100644 --- a/Minecraft.World/Network/Packets/ChatPacket.cpp +++ b/Minecraft.World/Network/Packets/ChatPacket.cpp @@ -14,7 +14,7 @@ ChatPacket::ChatPacket() } // Old chat packet constructor, adds message, custom data and additional message to arg vectors -ChatPacket::ChatPacket(const wstring& message, EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const wstring& additionalMessage /*= L""*/) +ChatPacket::ChatPacket(const std::wstring& message, EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const std::wstring& additionalMessage /*= L""*/) { m_messageType = type; if (customData != -1) m_intArgs.push_back(customData); diff --git a/Minecraft.World/Network/Packets/ChatPacket.h b/Minecraft.World/Network/Packets/ChatPacket.h index 2481e903a..10af4c3f5 100644 --- a/Minecraft.World/Network/Packets/ChatPacket.h +++ b/Minecraft.World/Network/Packets/ChatPacket.h @@ -79,12 +79,12 @@ public: }; public: - vector m_stringArgs; + vector m_stringArgs; vector m_intArgs; EChatPacketMessage m_messageType; ChatPacket(); - ChatPacket(const wstring& message, EChatPacketMessage type = e_ChatCustom, int customData = -1, const wstring& additionalMessage = L""); + ChatPacket(const std::wstring& message, EChatPacketMessage type = e_ChatCustom, int customData = -1, const std::wstring& additionalMessage = L""); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/Network/Packets/CustomPayloadPacket.cpp b/Minecraft.World/Network/Packets/CustomPayloadPacket.cpp index 236f2fc3e..2419eadda 100644 --- a/Minecraft.World/Network/Packets/CustomPayloadPacket.cpp +++ b/Minecraft.World/Network/Packets/CustomPayloadPacket.cpp @@ -5,20 +5,20 @@ #include "CustomPayloadPacket.h" // Mojang-defined custom packets -const wstring CustomPayloadPacket::CUSTOM_BOOK_PACKET = L"MC|BEdit"; -const wstring CustomPayloadPacket::CUSTOM_BOOK_SIGN_PACKET = L"MC|BSign"; -const wstring CustomPayloadPacket::TEXTURE_PACK_PACKET = L"MC|TPack"; -const wstring CustomPayloadPacket::TRADER_LIST_PACKET = L"MC|TrList"; -const wstring CustomPayloadPacket::TRADER_SELECTION_PACKET = L"MC|TrSel"; -const wstring CustomPayloadPacket::SET_ADVENTURE_COMMAND_PACKET = L"MC|AdvCdm"; -const wstring CustomPayloadPacket::SET_BEACON_PACKET = L"MC|Beacon"; -const wstring CustomPayloadPacket::SET_ITEM_NAME_PACKET = L"MC|ItemName"; +const std::wstring CustomPayloadPacket::CUSTOM_BOOK_PACKET = L"MC|BEdit"; +const std::wstring CustomPayloadPacket::CUSTOM_BOOK_SIGN_PACKET = L"MC|BSign"; +const std::wstring CustomPayloadPacket::TEXTURE_PACK_PACKET = L"MC|TPack"; +const std::wstring CustomPayloadPacket::TRADER_LIST_PACKET = L"MC|TrList"; +const std::wstring CustomPayloadPacket::TRADER_SELECTION_PACKET = L"MC|TrSel"; +const std::wstring CustomPayloadPacket::SET_ADVENTURE_COMMAND_PACKET = L"MC|AdvCdm"; +const std::wstring CustomPayloadPacket::SET_BEACON_PACKET = L"MC|Beacon"; +const std::wstring CustomPayloadPacket::SET_ITEM_NAME_PACKET = L"MC|ItemName"; CustomPayloadPacket::CustomPayloadPacket() { } -CustomPayloadPacket::CustomPayloadPacket(const wstring &identifier, byteArray data) +CustomPayloadPacket::CustomPayloadPacket(const std::wstring &identifier, byteArray data) { this->identifier = identifier; this->data = data; diff --git a/Minecraft.World/Network/Packets/CustomPayloadPacket.h b/Minecraft.World/Network/Packets/CustomPayloadPacket.h index b794631bd..7c199ce27 100644 --- a/Minecraft.World/Network/Packets/CustomPayloadPacket.h +++ b/Minecraft.World/Network/Packets/CustomPayloadPacket.h @@ -8,21 +8,21 @@ class CustomPayloadPacket : public Packet, public enable_shared_from_this Server -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest) +LoginPacket::LoginPacket(const std::wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest) { this->userName = userName; this->clientVersion = clientVersion; @@ -65,7 +65,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o } // Server -> Client -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) +LoginPacket::LoginPacket(const std::wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) { this->userName = userName; this->clientVersion = clientVersion; @@ -97,7 +97,7 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException { clientVersion = dis->readInt(); userName = readUtf(dis, Player::MAX_NAME_LENGTH); - wstring typeName = readUtf(dis, 16); + std::wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); if (m_pLevelType == NULL) { diff --git a/Minecraft.World/Network/Packets/LoginPacket.h b/Minecraft.World/Network/Packets/LoginPacket.h index 682270455..08709fbee 100644 --- a/Minecraft.World/Network/Packets/LoginPacket.h +++ b/Minecraft.World/Network/Packets/LoginPacket.h @@ -8,7 +8,7 @@ class LoginPacket : public Packet, public enable_shared_from_this { public: int clientVersion; - wstring userName; + std::wstring userName; __int64 seed; char dimension; PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added @@ -31,8 +31,8 @@ public: BYTE maxPlayers; LoginPacket(); - LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client - LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server + LoginPacket(const std::wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client + LoginPacket(const std::wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/Network/Packets/Packet.cpp b/Minecraft.World/Network/Packets/Packet.cpp index 74da9b782..5208a991d 100644 --- a/Minecraft.World/Network/Packets/Packet.cpp +++ b/Minecraft.World/Network/Packets/Packet.cpp @@ -144,17 +144,17 @@ void Packet::staticCtor() map(255, true, true, true, false, typeid(DisconnectPacket), DisconnectPacket::create); } -IllegalArgumentException::IllegalArgumentException(const wstring& information) +IllegalArgumentException::IllegalArgumentException(const std::wstring& information) { this->information = information; } -IOException::IOException(const wstring& information) +IOException::IOException(const std::wstring& information) { this->information = information; } -RuntimeException::RuntimeException(const wstring& /*information*/) +RuntimeException::RuntimeException(const std::wstring& /*information*/) { } @@ -178,7 +178,7 @@ int Packet::renderPos = 0; void Packet::map(int id, bool receiveOnClient, bool receiveOnServer, bool sendToAnyClient, bool renderStats, const type_info& clazz, packetCreateFn createFn) { #if 0 - if (idToClassMap.count(id) > 0) throw new IllegalArgumentException(wstring(L"Duplicate packet id:") + _toString(id)); + if (idToClassMap.count(id) > 0) throw new IllegalArgumentException(std::wstring(L"Duplicate packet id:") + _toString(id)); if (classToIdMap.count(clazz) > 0) throw new IllegalArgumentException(L"Duplicate packet class:"); // TODO + clazz); #endif @@ -389,7 +389,7 @@ std::shared_ptr Packet::readPacket(DataInputStream *dis, bool isServer) // Close the stream to prevent further reads on a desynced stream dis->close(); return nullptr; - // throw new IOException(wstring(L"Bad packet id ") + _toString(id)); + // throw new IOException(std::wstring(L"Bad packet id ") + _toString(id)); } // Record successfully read packet ID @@ -437,7 +437,7 @@ void Packet::writePacket(std::shared_ptr packet, DataOutputStream *dos) packet->write(dos); } -void Packet::writeUtf(const wstring& value, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws? +void Packet::writeUtf(const std::wstring& value, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws? { #if 0 if (value.length() > Short::MAX_VALUE) @@ -450,7 +450,7 @@ void Packet::writeUtf(const wstring& value, DataOutputStream *dos) // throws IOE dos->writeChars(value); } -wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOException TODO 4J JEV, should this declare a throws? +std::wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOException TODO 4J JEV, should this declare a throws? { short stringLength = dis->readShort(); @@ -465,7 +465,7 @@ wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOExcepti return L""; } - wstring builder = L""; + std::wstring builder = L""; for (int i = 0; i < stringLength; i++) { wchar_t rc = dis->readChar(); @@ -530,7 +530,7 @@ __int64 Packet::PacketStatistics::getCountSample(int samplePos) return countSamples[samplePos] * 10; } -wstring Packet::PacketStatistics::getLegendString() +std::wstring Packet::PacketStatistics::getLegendString() { static wchar_t string[128]; double bps = 0.0; diff --git a/Minecraft.World/Network/Packets/Packet.h b/Minecraft.World/Network/Packets/Packet.h index d4bd38525..2e4d0e441 100644 --- a/Minecraft.World/Network/Packets/Packet.h +++ b/Minecraft.World/Network/Packets/Packet.h @@ -40,7 +40,7 @@ public: // 4J Added void renderStats(); __int64 getCountSample(int samplePos); - wstring getLegendString(); + std::wstring getLegendString(); }; // 4J JEV, replaces the static blocks. @@ -93,8 +93,8 @@ private : public: static std::shared_ptr readPacket(DataInputStream *dis, bool isServer); static void writePacket(std::shared_ptr packet, DataOutputStream *dos); - static void writeUtf(const wstring& value, DataOutputStream *dos); - static wstring readUtf(DataInputStream *dis, int maxLength); + static void writeUtf(const std::wstring& value, DataOutputStream *dos); + static std::wstring readUtf(DataInputStream *dis, int maxLength); virtual void read(DataInputStream *dis) = 0; // throws IOException = 0; TODO 4J JEV, should this declare a throws? virtual void write(DataOutputStream *dos) = 0; // throws IOException = 0; TODO 4J JEV, should this declare a throws? virtual void handle(PacketListener *listener) = 0; diff --git a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp b/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp index dd3e33a3c..4b132a14a 100644 --- a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp +++ b/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp @@ -61,7 +61,7 @@ int PlayerAbilitiesPacket::getEstimatedSize() return 2; } -//wstring getDebugInfo() +//std::wstring getDebugInfo() //{ // return String.format("invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f", isInvulnerable(), isFlying(), canFly(), canInstabuild(), getFlyingSpeed(), getWalkingSpeed()); //} diff --git a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.h b/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.h index 8a6e43a37..42f82a5dd 100644 --- a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.h +++ b/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.h @@ -28,7 +28,7 @@ public: void write(DataOutputStream *dos); void handle(PacketListener *listener); int getEstimatedSize(); - //wstring getDebugInfo(); + //std::wstring getDebugInfo(); bool isInvulnerable(); void setInvulnerable(bool invulnerable); bool isFlying(); diff --git a/Minecraft.World/Network/Packets/PlayerInfoPacket.h b/Minecraft.World/Network/Packets/PlayerInfoPacket.h index f4ad972fa..d7724e83a 100644 --- a/Minecraft.World/Network/Packets/PlayerInfoPacket.h +++ b/Minecraft.World/Network/Packets/PlayerInfoPacket.h @@ -8,7 +8,7 @@ class PlayerInfoPacket : public Packet, public enable_shared_from_this player); diff --git a/Minecraft.World/Network/Packets/PreLoginPacket.cpp b/Minecraft.World/Network/Packets/PreLoginPacket.cpp index 1087e3967..bea92ebaa 100644 --- a/Minecraft.World/Network/Packets/PreLoginPacket.cpp +++ b/Minecraft.World/Network/Packets/PreLoginPacket.cpp @@ -18,7 +18,7 @@ PreLoginPacket::PreLoginPacket() m_netcodeVersion = 0; } -PreLoginPacket::PreLoginPacket(wstring userName) +PreLoginPacket::PreLoginPacket(std::wstring userName) { this->loginKey = userName; m_playerXuids = NULL; @@ -32,7 +32,7 @@ PreLoginPacket::PreLoginPacket(wstring userName) m_netcodeVersion = 0; } -PreLoginPacket::PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId) +PreLoginPacket::PreLoginPacket(std::wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId) { this->loginKey = userName; m_playerXuids = playerXuids; diff --git a/Minecraft.World/Network/Packets/PreLoginPacket.h b/Minecraft.World/Network/Packets/PreLoginPacket.h index 2d73d6300..9b12d78b7 100644 --- a/Minecraft.World/Network/Packets/PreLoginPacket.h +++ b/Minecraft.World/Network/Packets/PreLoginPacket.h @@ -21,11 +21,11 @@ public: DWORD m_texturePackId; SHORT m_netcodeVersion; - wstring loginKey; + std::wstring loginKey; PreLoginPacket(); - PreLoginPacket(wstring userName); - PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId); + PreLoginPacket(std::wstring userName); + PreLoginPacket(std::wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId); ~PreLoginPacket(); virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/Network/Packets/RespawnPacket.cpp b/Minecraft.World/Network/Packets/RespawnPacket.cpp index b3eb778b4..e02684cd8 100644 --- a/Minecraft.World/Network/Packets/RespawnPacket.cpp +++ b/Minecraft.World/Network/Packets/RespawnPacket.cpp @@ -45,7 +45,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException dimension = dis->readByte(); playerGameType = GameType::byId(dis->readByte()); mapHeight = dis->readShort(); - wstring typeName = readUtf(dis, 16); + std::wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); if (m_pLevelType == NULL) { diff --git a/Minecraft.World/Network/Packets/SignUpdatePacket.cpp b/Minecraft.World/Network/Packets/SignUpdatePacket.cpp index c8a0ae158..be3ffd001 100644 --- a/Minecraft.World/Network/Packets/SignUpdatePacket.cpp +++ b/Minecraft.World/Network/Packets/SignUpdatePacket.cpp @@ -18,7 +18,7 @@ SignUpdatePacket::SignUpdatePacket() } -SignUpdatePacket::SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, wstring lines[]) +SignUpdatePacket::SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, std::wstring lines[]) { shouldDelay = true; this->m_bVerified=bVerified; diff --git a/Minecraft.World/Network/Packets/SignUpdatePacket.h b/Minecraft.World/Network/Packets/SignUpdatePacket.h index e3284ab1f..339fd46fc 100644 --- a/Minecraft.World/Network/Packets/SignUpdatePacket.h +++ b/Minecraft.World/Network/Packets/SignUpdatePacket.h @@ -9,10 +9,10 @@ public: int x, y, z; bool m_bVerified; bool m_bCensored; - wstring lines[4]; + std::wstring lines[4]; SignUpdatePacket(); - SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, wstring lines[]); + SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, std::wstring lines[]); bool GetVerified() {return m_bVerified;} bool GetCensored() {return m_bCensored;} virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp b/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp index a2ebf9b49..d38fe8908 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp +++ b/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.cpp @@ -15,11 +15,11 @@ TextureAndGeometryChangePacket::TextureAndGeometryChangePacket() dwSkinID = 0; } -TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(std::shared_ptr e, const wstring &path) +TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(std::shared_ptr e, const std::wstring &path) { id = e->entityId; this->path = path; - wstring skinValue = path.substr(7,path.size()); + std::wstring skinValue = path.substr(7,path.size()); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); std::wstringstream ss; ss << std::dec << skinValue.c_str(); diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.h b/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.h index e13b547e8..1a83be0a8 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.h +++ b/Minecraft.World/Network/Packets/TextureAndGeometryChangePacket.h @@ -8,11 +8,11 @@ class TextureAndGeometryChangePacket : public Packet, public enable_shared_from_ public: int id; - wstring path; + std::wstring path; DWORD dwSkinID; TextureAndGeometryChangePacket(); - TextureAndGeometryChangePacket(std::shared_ptr e, const wstring &path); + TextureAndGeometryChangePacket(std::shared_ptr e, const std::wstring &path); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp index 10e243dab..f39ee8f43 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp +++ b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp @@ -30,11 +30,11 @@ TextureAndGeometryPacket::~TextureAndGeometryPacket() // } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes) +TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes) { this->textureName = textureName; - wstring skinValue = textureName.substr(7,textureName.size()); + std::wstring skinValue = textureName.substr(7,textureName.size()); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); std::wstringstream ss; ss << std::dec << skinValue.c_str(); @@ -47,11 +47,11 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P this->uiAnimOverrideBitmask=0; } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile) +TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile) { this->textureName = textureName; - wstring skinValue = textureName.substr(7,textureName.size()); + std::wstring skinValue = textureName.substr(7,textureName.size()); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); std::wstringstream ss; ss << std::dec << skinValue.c_str(); @@ -80,11 +80,11 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes,vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) +TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes,vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) { this->textureName = textureName; - wstring skinValue = textureName.substr(7,textureName.size()); + std::wstring skinValue = textureName.substr(7,textureName.size()); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); std::wstringstream ss; ss << std::dec << skinValue.c_str(); diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h index e5ac02705..016291f88 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h +++ b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h @@ -10,7 +10,7 @@ class DLCSkinFile; class TextureAndGeometryPacket : public Packet, public enable_shared_from_this { public: - wstring textureName; + std::wstring textureName; DWORD dwSkinID; PBYTE pbData; DWORD dwTextureBytes; @@ -20,9 +20,9 @@ public: TextureAndGeometryPacket(); ~TextureAndGeometryPacket(); - TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes); - TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile); - TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); + TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes); + TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile); + TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/Network/Packets/TextureChangePacket.cpp b/Minecraft.World/Network/Packets/TextureChangePacket.cpp index 649d25fd7..c7c0d85b7 100644 --- a/Minecraft.World/Network/Packets/TextureChangePacket.cpp +++ b/Minecraft.World/Network/Packets/TextureChangePacket.cpp @@ -14,7 +14,7 @@ TextureChangePacket::TextureChangePacket() path = L""; } -TextureChangePacket::TextureChangePacket(std::shared_ptr e, ETextureChangeType action, const wstring &path) +TextureChangePacket::TextureChangePacket(std::shared_ptr e, ETextureChangeType action, const std::wstring &path) { id = e->entityId; this->action = action; diff --git a/Minecraft.World/Network/Packets/TextureChangePacket.h b/Minecraft.World/Network/Packets/TextureChangePacket.h index 7d99b3b32..9fa86418a 100644 --- a/Minecraft.World/Network/Packets/TextureChangePacket.h +++ b/Minecraft.World/Network/Packets/TextureChangePacket.h @@ -14,10 +14,10 @@ public: int id; ETextureChangeType action; - wstring path; + std::wstring path; TextureChangePacket(); - TextureChangePacket(std::shared_ptr e, ETextureChangeType action, const wstring &path); + TextureChangePacket(std::shared_ptr e, ETextureChangeType action, const std::wstring &path); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/Network/Packets/TexturePacket.cpp b/Minecraft.World/Network/Packets/TexturePacket.cpp index 5d0593123..730c588d9 100644 --- a/Minecraft.World/Network/Packets/TexturePacket.cpp +++ b/Minecraft.World/Network/Packets/TexturePacket.cpp @@ -22,7 +22,7 @@ TexturePacket::~TexturePacket() // } } -TexturePacket::TexturePacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes) +TexturePacket::TexturePacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes) { this->textureName = textureName; this->pbData = pbData; diff --git a/Minecraft.World/Network/Packets/TexturePacket.h b/Minecraft.World/Network/Packets/TexturePacket.h index 6f8b36bc1..2aee039bf 100644 --- a/Minecraft.World/Network/Packets/TexturePacket.h +++ b/Minecraft.World/Network/Packets/TexturePacket.h @@ -6,13 +6,13 @@ using namespace std; class TexturePacket : public Packet, public enable_shared_from_this { public: - wstring textureName; + std::wstring textureName; PBYTE pbData; DWORD dwBytes; TexturePacket(); ~TexturePacket(); - TexturePacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes); + TexturePacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp b/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp index e796623d2..665d2ae2c 100644 --- a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp +++ b/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.cpp @@ -14,7 +14,7 @@ UpdateGameRuleProgressPacket::UpdateGameRuleProgressPacket() m_dataTag = 0; } -UpdateGameRuleProgressPacket::UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength) +UpdateGameRuleProgressPacket::UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const std::wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength) { m_definitionType = definitionType; m_messageId = messageId; diff --git a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.h b/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.h index 65df6dfe6..c68edd9af 100644 --- a/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.h +++ b/Minecraft.World/Network/Packets/UpdateGameRuleProgressPacket.h @@ -7,13 +7,13 @@ class UpdateGameRuleProgressPacket : public Packet, public enable_shared_from_th { public: ConsoleGameRules::EGameRuleType m_definitionType; - wstring m_messageId; + std::wstring m_messageId; int m_icon, m_auxValue; int m_dataTag; byteArray m_data; UpdateGameRuleProgressPacket(); - UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength); + UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const std::wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/Player/Player.cpp b/Minecraft.World/Player/Player.cpp index 4c998d7fa..ae41306a2 100644 --- a/Minecraft.World/Player/Player.cpp +++ b/Minecraft.World/Player/Player.cpp @@ -777,11 +777,11 @@ void Player::setCustomCape(DWORD capeId) { if(app.DefaultCapeExists()) { - this->customTextureUrl2= wstring(L"Special_Cape.png"); + this->customTextureUrl2= std::wstring(L"Special_Cape.png"); } else { - this->customTextureUrl2= wstring(L""); + this->customTextureUrl2= std::wstring(L""); } } @@ -791,17 +791,17 @@ void Player::setCustomCape(DWORD capeId) // if there is a custom default cloak, then set it here if(app.DefaultCapeExists()) { - this->customTextureUrl2= wstring(L"Special_Cape.png"); + this->customTextureUrl2= std::wstring(L"Special_Cape.png"); } else { - this->customTextureUrl2 =wstring(L""); + this->customTextureUrl2 =std::wstring(L""); } } } } -DWORD Player::getCapeIdFromPath(const wstring &cape) +DWORD Player::getCapeIdFromPath(const std::wstring &cape) { bool dlcCape = false; unsigned int capeId = 0; @@ -810,7 +810,7 @@ DWORD Player::getCapeIdFromPath(const wstring &cape) { dlcCape = cape.substr(0,3).compare(L"dlc") == 0; - wstring capeValue = cape.substr(7,cape.size()); + std::wstring capeValue = cape.substr(7,cape.size()); capeValue = capeValue.substr(0,capeValue.find_first_of(L'.')); std::wstringstream ss; @@ -827,7 +827,7 @@ DWORD Player::getCapeIdFromPath(const wstring &cape) return capeId; } -wstring Player::getCapePathFromId(DWORD capeId) +std::wstring Player::getCapePathFromId(DWORD capeId) { // 4J Stu - This function maps the encoded DWORD we store in the player profile // to a filename that is stored as a memory texture and shared between systems in game @@ -899,11 +899,11 @@ void Player::prepareCustomTextures() //{ // if(app.DefaultCapeExists()) // { - // this->customTextureUrl2= wstring(L"Default_Cape.png"); + // this->customTextureUrl2= std::wstring(L"Default_Cape.png"); // } // else // { - // this->customTextureUrl2= wstring(L""); + // this->customTextureUrl2= std::wstring(L""); // } //} @@ -914,15 +914,15 @@ void Player::prepareCustomTextures() // if there is a custom default cloak, then set it here //if(app.DefaultCapeExists()) //{ - // this->customTextureUrl2= wstring(L"Default_Cape.png"); + // this->customTextureUrl2= std::wstring(L"Default_Cape.png"); //} //else //{ - // this->customTextureUrl2 =wstring(L""); + // this->customTextureUrl2 =std::wstring(L""); //} } - /*cloakTexture = wstring(L"http://s3.amazonaws.com/MinecraftCloaks/").append( name ).append( L".png" );*/ + /*cloakTexture = std::wstring(L"http://s3.amazonaws.com/MinecraftCloaks/").append( name ).append( L".png" );*/ //this->customTextureUrl2 = cloakTexture; } @@ -2455,7 +2455,7 @@ bool Player::isAlwaysExperienceDropper() return true; } -wstring Player::getAName() +std::wstring Player::getAName() { return name; } @@ -2502,12 +2502,12 @@ void Player::setGameMode(GameType *mode) { } -wstring Player::getName() +std::wstring Player::getName() { return name; } -wstring Player::getDisplayName() +std::wstring Player::getDisplayName() { return displayName; } diff --git a/Minecraft.World/Player/Player.h b/Minecraft.World/Player/Player.h index 087f78e9b..39275541e 100644 --- a/Minecraft.World/Player/Player.h +++ b/Minecraft.World/Player/Player.h @@ -70,7 +70,7 @@ public: bool swinging; int swingTime; - wstring name; + std::wstring name; int dimension; int takeXpDelay; @@ -78,13 +78,13 @@ public: unsigned int m_uiPlayerCurrentSkin; void ChangePlayerSkin(); - // 4J-PB - not needed, since cutomtextureurl2 is the same thing wstring cloakTexture; + // 4J-PB - not needed, since cutomtextureurl2 is the same thing std::wstring cloakTexture; double xCloakO, yCloakO, zCloakO; double xCloak, yCloak, zCloak; // 4J-HEG - store display name, added for Xbox One - wstring displayName; + std::wstring displayName; protected: // player sleeping in bed? @@ -361,7 +361,7 @@ protected: virtual bool isAlwaysExperienceDropper(); public: - virtual wstring getAName(); + virtual std::wstring getAName(); virtual void changeDimension(int i); virtual void restoreFrom(std::shared_ptr oldPlayer, bool restoreAll); @@ -372,8 +372,8 @@ protected: public: void onUpdateAbilities(); void setGameMode(GameType *mode); - wstring getName(); - wstring getDisplayName(); // 4J added + std::wstring getName(); + std::wstring getDisplayName(); // 4J added //Language getLanguage() { return Language.getInstance(); } //String localize(String key, Object... args) { return getLanguage().getElement(key, args); } @@ -393,7 +393,7 @@ public: virtual void onCrafted(std::shared_ptr item) {} // 4J Overriding this so that we can have some different default skins - virtual int getTexture(); // 4J changed from wstring to int + virtual int getTexture(); // 4J changed from std::wstring to int void setPlayerDefaultSkin(EDefaultSkins skin); EDefaultSkins getPlayerDefaultSkin() { return m_skinIndex; } virtual void setCustomSkin(DWORD skinId); @@ -401,8 +401,8 @@ public: virtual void setCustomCape(DWORD capeId); DWORD getCustomCape() {return m_dwCapeId; } - static DWORD getCapeIdFromPath(const wstring &cape); - static wstring getCapePathFromId(DWORD capeId); + static DWORD getCapeIdFromPath(const std::wstring &cape); + static std::wstring getCapePathFromId(DWORD capeId); static unsigned int getSkinAnimOverrideBitmask(DWORD skinId); // 4J Added @@ -410,8 +410,8 @@ public: PlayerUID getXuid() { return m_xuid; } void setOnlineXuid(PlayerUID xuid) { m_OnlineXuid = xuid; } PlayerUID getOnlineXuid() { return m_OnlineXuid; } - void setUUID(const wstring &UUID) { m_UUID = UUID; } - wstring getUUID() { return m_UUID; } + void setUUID(const std::wstring &UUID) { m_UUID = UUID; } + std::wstring getUUID() { return m_UUID; } void setPlayerIndex(DWORD dwIndex) { m_playerIndex = dwIndex; } DWORD getPlayerIndex() { return m_playerIndex; } @@ -422,13 +422,13 @@ public: void setShowOnMaps(bool bVal) { m_bShownOnMaps = bVal; } bool canShowOnMaps() { return m_bShownOnMaps && !getPlayerGamePrivilege(ePlayerGamePrivilege_Invisible); } - virtual void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L"") { } + virtual void sendMessage(const std::wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const std::wstring& additionalMessage = L"") { } private: PlayerUID m_xuid; PlayerUID m_OnlineXuid; protected: - wstring m_UUID; // 4J Added + std::wstring m_UUID; // 4J Added bool m_bShownOnMaps; diff --git a/Minecraft.World/Recipes/ArmorRecipes.cpp b/Minecraft.World/Recipes/ArmorRecipes.cpp index 2604e4561..6d837a7c0 100644 --- a/Minecraft.World/Recipes/ArmorRecipes.cpp +++ b/Minecraft.World/Recipes/ArmorRecipes.cpp @@ -10,7 +10,7 @@ #include "ArmorRecipes.h" // 4J-PB - adding "" on the end of these so we can detect it -wstring ArmorRecipes::shapes[][4] = +std::wstring ArmorRecipes::shapes[][4] = { {L"XXX", // L"X X",L""},// diff --git a/Minecraft.World/Recipes/ArmorRecipes.h b/Minecraft.World/Recipes/ArmorRecipes.h index b6a693727..0ab9321bb 100644 --- a/Minecraft.World/Recipes/ArmorRecipes.h +++ b/Minecraft.World/Recipes/ArmorRecipes.h @@ -23,7 +23,7 @@ public: ArmorRecipes() {_init();} private: // 4J-PB - this wasn't static in java, so might not be right - static wstring shapes[][4]; + static std::wstring shapes[][4]; private: vector *map; diff --git a/Minecraft.World/Recipes/Recipes.cpp b/Minecraft.World/Recipes/Recipes.cpp index 2c96ddbb5..ca1a6c82d 100644 --- a/Minecraft.World/Recipes/Recipes.cpp +++ b/Minecraft.World/Recipes/Recipes.cpp @@ -925,7 +925,7 @@ Recipes::Recipes() // 4J-PB - this function has been substantially changed due to the differences with a va_list of classes in C++ and Java ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) { - wstring map = L""; + std::wstring map = L""; int p = 0; int width = 0; int height = 0; @@ -933,8 +933,8 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) va_list vl; wchar_t *wchTypes; wchar_t *pwchString; - wstring wString; - wstring *wStringA; + std::wstring wString; + std::wstring *wStringA; ItemInstance *pItemInstance; Tile *pTile; Item *pItem; @@ -981,7 +981,7 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) map += wString; break; case L'w': - wStringA=va_arg(vl,wstring *); + wStringA=va_arg(vl,std::wstring *); iCount=0; do { @@ -1077,7 +1077,7 @@ void Recipes::addShapelessRecipy(ItemInstance *result,... ) { va_list vl; wchar_t *szTypes; - wstring String; + std::wstring String; ItemInstance *pItemInstance; Tile *pTile; Item *pItem; diff --git a/Minecraft.World/Recipes/ToolRecipes.cpp b/Minecraft.World/Recipes/ToolRecipes.cpp index e4958fcb5..d9a1b56e3 100644 --- a/Minecraft.World/Recipes/ToolRecipes.cpp +++ b/Minecraft.World/Recipes/ToolRecipes.cpp @@ -10,7 +10,7 @@ #include "ToolRecipes.h" // 4J-PB - adding "" on the end of these so we can detect it -wstring ToolRecipies::shapes[][4] = +std::wstring ToolRecipies::shapes[][4] = { {L"XXX", // L" # ",// diff --git a/Minecraft.World/Recipes/ToolRecipes.h b/Minecraft.World/Recipes/ToolRecipes.h index 7c433b4c0..5b3ddfdb0 100644 --- a/Minecraft.World/Recipes/ToolRecipes.h +++ b/Minecraft.World/Recipes/ToolRecipes.h @@ -16,7 +16,7 @@ public: ToolRecipies() {_init();} private: - static wstring shapes[][4]; + static std::wstring shapes[][4]; vector *map; public: diff --git a/Minecraft.World/Recipes/WeaponRecipes.cpp b/Minecraft.World/Recipes/WeaponRecipes.cpp index 1cd8433d8..32169a352 100644 --- a/Minecraft.World/Recipes/WeaponRecipes.cpp +++ b/Minecraft.World/Recipes/WeaponRecipes.cpp @@ -7,7 +7,7 @@ #include "WeaponRecipes.h" // 4J-PB - adding "" on the end of these so we can detect it -wstring WeaponRecipies::shapes[][4] = +std::wstring WeaponRecipies::shapes[][4] = { {L"X", // L"X",// diff --git a/Minecraft.World/Recipes/WeaponRecipes.h b/Minecraft.World/Recipes/WeaponRecipes.h index 105fba450..d8793a917 100644 --- a/Minecraft.World/Recipes/WeaponRecipes.h +++ b/Minecraft.World/Recipes/WeaponRecipes.h @@ -14,7 +14,7 @@ public: WeaponRecipies() {_init();} private: - static wstring shapes[][4]; + static std::wstring shapes[][4]; vector *map; public: diff --git a/Minecraft.World/Stats/Achievement.cpp b/Minecraft.World/Stats/Achievement.cpp index 514f9276f..e2a228028 100644 --- a/Minecraft.World/Stats/Achievement.cpp +++ b/Minecraft.World/Stats/Achievement.cpp @@ -15,18 +15,18 @@ void Achievement::_init() if (y > Achievements::yMax) Achievements::yMax = y; } -Achievement::Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const std::wstring& name, int x, int y, Item *icon, Achievement *requires) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(std::wstring(L"achievement.").append(name)) ), desc( I18n::get(std::wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) { } -Achievement::Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const std::wstring& name, int x, int y, Tile *icon, Achievement *requires) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(std::wstring(L"achievement.").append(name)) ), desc( I18n::get(std::wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) { } -Achievement::Achievement(int id, const wstring& name, int x, int y, std::shared_ptr icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const std::wstring& name, int x, int y, std::shared_ptr icon, Achievement *requires) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(std::wstring(L"achievement.").append(name)) ), desc( I18n::get(std::wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requires(requires) { } @@ -56,7 +56,7 @@ bool Achievement::isAchievement() return true; } -wstring Achievement::getDescription() +std::wstring Achievement::getDescription() { if (descFormatter != NULL) { diff --git a/Minecraft.World/Stats/Achievement.h b/Minecraft.World/Stats/Achievement.h index 057147372..2c51f709f 100644 --- a/Minecraft.World/Stats/Achievement.h +++ b/Minecraft.World/Stats/Achievement.h @@ -12,7 +12,7 @@ public: Achievement *requires; private: - const wstring desc; + const std::wstring desc; DescFormatter *descFormatter; public: @@ -23,15 +23,15 @@ private: void _init(); public: - Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, std::shared_ptr icon, Achievement *requires); + Achievement(int id, const std::wstring& name, int x, int y, Item *icon, Achievement *requires); + Achievement(int id, const std::wstring& name, int x, int y, Tile *icon, Achievement *requires); + Achievement(int id, const std::wstring& name, int x, int y, std::shared_ptr icon, Achievement *requires); Achievement *setAwardLocallyOnly(); Achievement *setGolden(); Achievement *postConstruct(); bool isAchievement(); - wstring getDescription(); + std::wstring getDescription(); Achievement *setDescFormatter(DescFormatter *descFormatter); bool isGolden(); int getAchievementID(); diff --git a/Minecraft.World/Stats/DurangoStats.cpp b/Minecraft.World/Stats/DurangoStats.cpp index 9f4cba22f..eb5c9f370 100644 --- a/Minecraft.World/Stats/DurangoStats.cpp +++ b/Minecraft.World/Stats/DurangoStats.cpp @@ -35,7 +35,7 @@ string DsItemEvent::nameMethods[] = { "itemBought", "itemSmithed", "blockMined", "blockPlaced", "MAX" }; -DsItemEvent::DsItemEvent(int id, const wstring &name) : Stat(id,name) {} +DsItemEvent::DsItemEvent(int id, const std::wstring &name) : Stat(id,name) {} bool DsItemEvent::onLeaderboard(ELeaderboardId leaderboard, eAcquisitionMethod methodId, Param *param) { @@ -203,7 +203,7 @@ byteArray DsItemEvent::createParamBlob(eAcquisitionMethod eMethod, int itemId, i // Ds Mob Killed // /////////////////// -DsMobKilled::DsMobKilled(int id, const wstring &name) : Stat(id,name) {} +DsMobKilled::DsMobKilled(int id, const std::wstring &name) : Stat(id,name) {} void DsMobKilled::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { @@ -321,7 +321,7 @@ string DsMobInteract::nameInteract[] = { "unknownMobInteraction", "mobBred", "mobTamed", "mobCured", "mobCrafted", "mobSheared" }; -DsMobInteract::DsMobInteract(int id, const wstring &name) : Stat(id,name) {} +DsMobInteract::DsMobInteract(int id, const std::wstring &name) : Stat(id,name) {} void DsMobInteract::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { @@ -373,7 +373,7 @@ unsigned int DsTravel::CACHE_SIZES[eMethod_MAX] = 20*60*5, // TIME - GameTicks (20*60*5 ~ 5 mins) }; -DsTravel::DsTravel(int id, const wstring &name) : Stat(id,name) +DsTravel::DsTravel(int id, const std::wstring &name) : Stat(id,name) { ZeroMemory(¶m_cache, sizeof(unsigned int)*eMethod_MAX*MAX_LOCAL_PLAYERS); } @@ -475,7 +475,7 @@ void DsTravel::write(std::shared_ptr player, eMethod method, int di // Ds Item Used // ////////////////// -DsItemUsed::DsItemUsed(int id, const wstring &name) : Stat(id,name) {} +DsItemUsed::DsItemUsed(int id, const std::wstring &name) : Stat(id,name) {} void DsItemUsed::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { @@ -518,7 +518,7 @@ byteArray DsItemUsed::createParamBlob(int itemId, int aux, int count, int health // Ds Achievement // //////////////////// -DsAchievement::DsAchievement(int id, const wstring &name) : Stat(id,name) {} +DsAchievement::DsAchievement(int id, const std::wstring &name) : Stat(id,name) {} void DsAchievement::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { @@ -614,7 +614,7 @@ byteArray DsAchievement::createLargeParamBlob(eAward award, int count) // Ds Changed Dimension // ////////////////////////// -DsChangedDimension::DsChangedDimension(int id, const wstring &name) : Stat(id,name) {} +DsChangedDimension::DsChangedDimension(int id, const std::wstring &name) : Stat(id,name) {} void DsChangedDimension::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { @@ -642,7 +642,7 @@ byteArray DsChangedDimension::createParamBlob(int fromDimId, int toDimId) // Ds Entered Biome // ////////////////////// -DsEnteredBiome::DsEnteredBiome(int id, const wstring &name) : Stat(id,name) {} +DsEnteredBiome::DsEnteredBiome(int id, const std::wstring &name) : Stat(id,name) {} void DsEnteredBiome::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { @@ -1121,7 +1121,7 @@ LPCWSTR DurangoStats::getUserId(std::shared_ptr player) LPCWSTR DurangoStats::getUserId(int iPad) { - static wstring cache = L""; + static std::wstring cache = L""; PlayerUID uid = INVALID_XUID; ProfileManager.GetXUID(iPad, &uid, true); cache = uid.toString(); diff --git a/Minecraft.World/Stats/DurangoStats.h b/Minecraft.World/Stats/DurangoStats.h index bea8c2d91..ee95a8c10 100644 --- a/Minecraft.World/Stats/DurangoStats.h +++ b/Minecraft.World/Stats/DurangoStats.h @@ -39,7 +39,7 @@ public: int methodId, itemId, itemAux, itemCount; } Param; - DsItemEvent(int id, const wstring &name); + DsItemEvent(int id, const std::wstring &name); bool onLeaderboard(ELeaderboardId leaderboard, eAcquisitionMethod methodId, Param *param); int mergeIds(int itemId); @@ -56,7 +56,7 @@ public: static const int SPIDER_JOCKEY_ID = 49; - DsMobKilled(int id, const wstring &name); + DsMobKilled(int id, const std::wstring &name); typedef struct { bool isRanged; int mobType, weaponId, distance, damage; } Param; virtual void handleParamBlob(std::shared_ptr plr, byteArray param); @@ -79,7 +79,7 @@ public: eInteract_Sheared }; - DsMobInteract(int id, const wstring &name); + DsMobInteract(int id, const std::wstring &name); typedef struct { int interactionType, mobId; } Param; virtual void handleParamBlob(std::shared_ptr plr, byteArray param); @@ -107,7 +107,7 @@ public: static unsigned int CACHE_SIZES[eMethod_MAX]; - DsTravel(int id, const wstring &name); + DsTravel(int id, const std::wstring &name); typedef struct { eMethod method; int distance; } Param; virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); @@ -124,7 +124,7 @@ protected: class DsItemUsed : public Stat { public: - DsItemUsed(int id, const wstring &name); + DsItemUsed(int id, const std::wstring &name); typedef struct { int itemId, aux, count, health, hunger; } Param; virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(int itemId, int aux, int count, int health, int hunger); @@ -133,7 +133,7 @@ public: class DsAchievement : public Stat { public: - DsAchievement(int id, const wstring &name); + DsAchievement(int id, const std::wstring &name); virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); @@ -147,7 +147,7 @@ public: class DsChangedDimension : public Stat { public: - DsChangedDimension(int id, const wstring &name); + DsChangedDimension(int id, const std::wstring &name); typedef struct { int fromDimId, toDimId; } Param; virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(int fromDimId, int toDimId); @@ -156,7 +156,7 @@ public: class DsEnteredBiome : public Stat { public: - DsEnteredBiome(int id, const wstring &name); + DsEnteredBiome(int id, const std::wstring &name); typedef struct { int biomeId; } Param; virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(int biomeId); diff --git a/Minecraft.World/Stats/GeneralStat.cpp b/Minecraft.World/Stats/GeneralStat.cpp index 0307645cd..eade3d693 100644 --- a/Minecraft.World/Stats/GeneralStat.cpp +++ b/Minecraft.World/Stats/GeneralStat.cpp @@ -2,11 +2,11 @@ #include "../Headers/net.minecraft.stats.h" #include "GeneralStat.h" -GeneralStat::GeneralStat(int id, const wstring& name, StatFormatter *formatter) : Stat(id, name, formatter) +GeneralStat::GeneralStat(int id, const std::wstring& name, StatFormatter *formatter) : Stat(id, name, formatter) { } -GeneralStat::GeneralStat(int id, const wstring& name) : Stat(id, name) +GeneralStat::GeneralStat(int id, const std::wstring& name) : Stat(id, name) { } diff --git a/Minecraft.World/Stats/GeneralStat.h b/Minecraft.World/Stats/GeneralStat.h index 27fe1b549..6d49c1a7f 100644 --- a/Minecraft.World/Stats/GeneralStat.h +++ b/Minecraft.World/Stats/GeneralStat.h @@ -6,7 +6,7 @@ using namespace std; class GeneralStat : public Stat { public: - GeneralStat(int id, const wstring& name, StatFormatter *formatter); - GeneralStat(int id, const wstring& name); + GeneralStat(int id, const std::wstring& name, StatFormatter *formatter); + GeneralStat(int id, const std::wstring& name); Stat *postConstruct(); }; diff --git a/Minecraft.World/Stats/ItemStat.cpp b/Minecraft.World/Stats/ItemStat.cpp index 9e2db9777..81d31748b 100644 --- a/Minecraft.World/Stats/ItemStat.cpp +++ b/Minecraft.World/Stats/ItemStat.cpp @@ -1,7 +1,7 @@ #include "../Build/stdafx.h" #include "ItemStat.h" -ItemStat::ItemStat(int id, const wstring& name, int itemId) : Stat( id, name ), itemId(itemId) +ItemStat::ItemStat(int id, const std::wstring& name, int itemId) : Stat( id, name ), itemId(itemId) { } diff --git a/Minecraft.World/Stats/ItemStat.h b/Minecraft.World/Stats/ItemStat.h index 80e4d8634..80fbe861a 100644 --- a/Minecraft.World/Stats/ItemStat.h +++ b/Minecraft.World/Stats/ItemStat.h @@ -9,6 +9,6 @@ private: const int itemId; public: - ItemStat(int id, const wstring& name, int itemId); + ItemStat(int id, const std::wstring& name, int itemId); int getItemId(); }; diff --git a/Minecraft.World/Stats/Stat.cpp b/Minecraft.World/Stats/Stat.cpp index 987919f52..ff44e3811 100644 --- a/Minecraft.World/Stats/Stat.cpp +++ b/Minecraft.World/Stats/Stat.cpp @@ -16,12 +16,12 @@ void Stat::_init() awardLocallyOnly = false; } -Stat::Stat(int id, const wstring& name, StatFormatter *formatter) : id(id), name(name), formatter(formatter) +Stat::Stat(int id, const std::wstring& name, StatFormatter *formatter) : id(id), name(name), formatter(formatter) { _init(); } -Stat::Stat(int id, const wstring& name) : id(id), name(name), formatter(defaultFormatter) +Stat::Stat(int id, const std::wstring& name) : id(id), name(name), formatter(defaultFormatter) { _init(); } @@ -55,17 +55,17 @@ bool Stat::isAchievement() return false; } -wstring Stat::format(int value) +std::wstring Stat::format(int value) { return ((StatFormatter *)formatter)->format(value); } -wstring Stat::toString() +std::wstring Stat::toString() { return name; } -wstring Stat::TimeFormatter::format(int value) +std::wstring Stat::TimeFormatter::format(int value) { double seconds = value / 20.0; double minutes = seconds / 60.0; @@ -93,12 +93,12 @@ wstring Stat::TimeFormatter::format(int value) return _toString(seconds) + L" s"; } -wstring Stat::DefaultFormat::format(int value) +std::wstring Stat::DefaultFormat::format(int value) { return NumberFormat::format( value ); //numberFormat->format(value); } -wstring Stat::DistanceFormatter::format(int cm) +std::wstring Stat::DistanceFormatter::format(int cm) { double meters = cm / 100.0; double kilometers = meters / 1000.0; diff --git a/Minecraft.World/Stats/Stat.h b/Minecraft.World/Stats/Stat.h index c9751d1c4..e6c29afb2 100644 --- a/Minecraft.World/Stats/Stat.h +++ b/Minecraft.World/Stats/Stat.h @@ -10,7 +10,7 @@ class Stat { public: const int id; - const wstring name; + const std::wstring name; bool awardLocallyOnly; private: @@ -18,13 +18,13 @@ private: void _init(); public: - Stat(int id, const wstring& name, StatFormatter *formatter); - Stat(int id, const wstring& name); + Stat(int id, const std::wstring& name, StatFormatter *formatter); + Stat(int id, const std::wstring& name); Stat *setAwardLocallyOnly(); virtual Stat *postConstruct(); virtual bool isAchievement(); - wstring format(int value); + std::wstring format(int value); private: //static NumberFormat *numberFormat; @@ -33,7 +33,7 @@ public: class DefaultFormat : public StatFormatter { public: - wstring format(int value); + std::wstring format(int value); } static *defaultFormatter; private: @@ -44,16 +44,16 @@ public: class TimeFormatter : public StatFormatter { public: - wstring format(int value); + std::wstring format(int value); } static *timeFormatter; class DistanceFormatter : public StatFormatter { public: - wstring format(int cm); + std::wstring format(int cm); } static *distanceFormatter; - wstring toString(); + std::wstring toString(); public: // 4J-JEV, for Durango stats diff --git a/Minecraft.World/Stats/StatFormatter.h b/Minecraft.World/Stats/StatFormatter.h index bc502c27a..118651cf9 100644 --- a/Minecraft.World/Stats/StatFormatter.h +++ b/Minecraft.World/Stats/StatFormatter.h @@ -4,5 +4,5 @@ using namespace std; class StatFormatter { public: - virtual wstring format(int value) = 0; + virtual std::wstring format(int value) = 0; }; diff --git a/Minecraft.World/Util/AABB.cpp b/Minecraft.World/Util/AABB.cpp index b6b28023e..f12834eec 100644 --- a/Minecraft.World/Util/AABB.cpp +++ b/Minecraft.World/Util/AABB.cpp @@ -334,7 +334,7 @@ void AABB::set(AABB *b) this->z1 = b->z1; } -wstring AABB::toString() +std::wstring AABB::toString() { return L"box[" + _toString(x0) + L", " + _toString(y0) + L", " + _toString(z0) + L" -> " + _toString(x1) + L", " + _toString(y1) + L", " + _toString(z1) + L"]"; diff --git a/Minecraft.World/Util/AABB.h b/Minecraft.World/Util/AABB.h index 81405ea1c..36bc15f5c 100644 --- a/Minecraft.World/Util/AABB.h +++ b/Minecraft.World/Util/AABB.h @@ -61,5 +61,5 @@ public: bool containsY(Vec3 *v); bool containsZ(Vec3 *v); void set(AABB *b); - wstring toString(); + std::wstring toString(); }; diff --git a/Minecraft.World/Util/BasicTypeContainers.cpp b/Minecraft.World/Util/BasicTypeContainers.cpp index 73ad2a13c..93f96e187 100644 --- a/Minecraft.World/Util/BasicTypeContainers.cpp +++ b/Minecraft.World/Util/BasicTypeContainers.cpp @@ -14,7 +14,7 @@ const float Float::MAX_VALUE = FLT_MAX; const double Double::MAX_VALUE = DBL_MAX; -int Integer::parseInt(wstring &str, int radix /* = 10*/) +int Integer::parseInt(std::wstring &str, int radix /* = 10*/) { return wcstol( str.c_str(), NULL, radix ); } \ No newline at end of file diff --git a/Minecraft.World/Util/BasicTypeContainers.h b/Minecraft.World/Util/BasicTypeContainers.h index 6f72ab593..aa24e0bc1 100644 --- a/Minecraft.World/Util/BasicTypeContainers.h +++ b/Minecraft.World/Util/BasicTypeContainers.h @@ -22,7 +22,7 @@ class Integer { public: static const int MAX_VALUE = INT_MAX; - static int parseInt(wstring &str, int radix = 10); + static int parseInt(std::wstring &str, int radix = 10); }; class Float diff --git a/Minecraft.World/Util/BoundingBox.cpp b/Minecraft.World/Util/BoundingBox.cpp index 8e9d75169..3e281cdc4 100644 --- a/Minecraft.World/Util/BoundingBox.cpp +++ b/Minecraft.World/Util/BoundingBox.cpp @@ -160,7 +160,7 @@ int BoundingBox::getZCenter() return z0 + (z1 - z0 + 1) / 2; } -wstring BoundingBox::toString() +std::wstring BoundingBox::toString() { return L"(" + _toString(x0) + L", " + _toString(y0) + L", " + _toString(z0) + L"; " + _toString(x1) + L", " + _toString(y1) + L", " + _toString(z1) + L")"; } \ No newline at end of file diff --git a/Minecraft.World/Util/BoundingBox.h b/Minecraft.World/Util/BoundingBox.h index 23abd66dc..7f3480dec 100644 --- a/Minecraft.World/Util/BoundingBox.h +++ b/Minecraft.World/Util/BoundingBox.h @@ -27,5 +27,5 @@ public: int getYCenter(); int getZCenter(); - wstring toString(); + std::wstring toString(); }; \ No newline at end of file diff --git a/Minecraft.World/Util/DamageSource.cpp b/Minecraft.World/Util/DamageSource.cpp index 4a7454a76..3b063b7ad 100644 --- a/Minecraft.World/Util/DamageSource.cpp +++ b/Minecraft.World/Util/DamageSource.cpp @@ -90,7 +90,7 @@ bool DamageSource::isBypassInvul() } -//DamageSource::DamageSource(const wstring &msgId) +//DamageSource::DamageSource(const std::wstring &msgId) DamageSource::DamageSource(ChatPacket::EChatPacketMessage msgId) { // 4J added initialisors @@ -158,7 +158,7 @@ DamageSource *DamageSource::setMagic() return this; } -//wstring DamageSource::getLocalizedDeathMessage(std::shared_ptr player) +//std::wstring DamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name; // //return I18n.get(L"death." + msgId, player.name); diff --git a/Minecraft.World/Util/DamageSource.h b/Minecraft.World/Util/DamageSource.h index 9047c2396..40436df23 100644 --- a/Minecraft.World/Util/DamageSource.h +++ b/Minecraft.World/Util/DamageSource.h @@ -56,11 +56,11 @@ public: float getFoodExhaustion(); bool isBypassInvul(); - //wstring msgId; + //std::wstring msgId; ChatPacket::EChatPacketMessage m_msgId; // 4J Made int so we can localise protected: - //DamageSource(const wstring &msgId); + //DamageSource(const std::wstring &msgId); DamageSource(ChatPacket::EChatPacketMessage msgId); public: @@ -82,7 +82,7 @@ public: DamageSource *setMagic(); // 4J Stu - Made return a packet - //virtual wstring getLocalizedDeathMessage(std::shared_ptr player); + //virtual std::wstring getLocalizedDeathMessage(std::shared_ptr player); virtual std::shared_ptr getDeathMessagePacket(std::shared_ptr player); bool isFire(); diff --git a/Minecraft.World/Util/DescFormatter.h b/Minecraft.World/Util/DescFormatter.h index 5682f910e..6ab9f2250 100644 --- a/Minecraft.World/Util/DescFormatter.h +++ b/Minecraft.World/Util/DescFormatter.h @@ -4,5 +4,5 @@ using namespace std; class DescFormatter { public: - virtual wstring format(const wstring& i18nValue); + virtual std::wstring format(const std::wstring& i18nValue); }; \ No newline at end of file diff --git a/Minecraft.World/Util/Exceptions.h b/Minecraft.World/Util/Exceptions.h index 6f3ba75e6..098aa817d 100644 --- a/Minecraft.World/Util/Exceptions.h +++ b/Minecraft.World/Util/Exceptions.h @@ -9,21 +9,21 @@ class EOFException : public std::exception class IllegalArgumentException : public std::exception { public: - wstring information; + std::wstring information; - IllegalArgumentException(const wstring& information); + IllegalArgumentException(const std::wstring& information); }; class IOException : public std::exception { public: - wstring information; + std::wstring information; - IOException(const wstring& information); + IOException(const std::wstring& information); }; class RuntimeException : public std::exception { public: - RuntimeException(const wstring& information); + RuntimeException(const std::wstring& information); }; \ No newline at end of file diff --git a/Minecraft.World/Util/FlippedIcon.cpp b/Minecraft.World/Util/FlippedIcon.cpp index 38f18e3a2..4f0e3b3d4 100644 --- a/Minecraft.World/Util/FlippedIcon.cpp +++ b/Minecraft.World/Util/FlippedIcon.cpp @@ -62,7 +62,7 @@ float FlippedIcon::getV(double offset, bool adjust/*=false*/) const return getV0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION)); } -wstring FlippedIcon::getName() const +std::wstring FlippedIcon::getName() const { return base->getName(); } diff --git a/Minecraft.World/Util/FlippedIcon.h b/Minecraft.World/Util/FlippedIcon.h index 169ceafc8..3c46a3e49 100644 --- a/Minecraft.World/Util/FlippedIcon.h +++ b/Minecraft.World/Util/FlippedIcon.h @@ -23,7 +23,7 @@ public: float getV0(bool adjust = false) const; float getV1(bool adjust = false) const; float getV(double offset, bool adjust = false) const; - wstring getName() const; + std::wstring getName() const; int getSourceWidth() const; int getSourceHeight() const; int getFlags() const; // 4J added diff --git a/Minecraft.World/Util/Hasher.cpp b/Minecraft.World/Util/Hasher.cpp index 83df5dbd9..5a143b6d7 100644 --- a/Minecraft.World/Util/Hasher.cpp +++ b/Minecraft.World/Util/Hasher.cpp @@ -9,17 +9,17 @@ #endif // _WIN32 #include "Hasher.h" -Hasher::Hasher(wstring &salt) +Hasher::Hasher(std::wstring &salt) { this->salt = salt; } -wstring Hasher::getHash(wstring &name) +std::wstring Hasher::getHash(std::wstring &name) { #if defined(_WIN32) // 4J Stu - Removed try/catch //try { - wstring s = wstring( salt ).append( name ); + std::wstring s = std::wstring( salt ).append( name ); //MessageDigest m; //m = MessageDigest.getInstance("MD5"); //m.update(s.getBytes(), 0, s.length()); diff --git a/Minecraft.World/Util/Hasher.h b/Minecraft.World/Util/Hasher.h index 325a95b87..5229bf7f0 100644 --- a/Minecraft.World/Util/Hasher.h +++ b/Minecraft.World/Util/Hasher.h @@ -4,9 +4,9 @@ using namespace std; class Hasher { private: - wstring salt; + std::wstring salt; public: - Hasher(wstring &salt); - wstring getHash(wstring &name); + Hasher(std::wstring &salt); + std::wstring getHash(std::wstring &name); }; \ No newline at end of file diff --git a/Minecraft.World/Util/I18n.cpp b/Minecraft.World/Util/I18n.cpp index 1da2fc5b0..743305170 100644 --- a/Minecraft.World/Util/I18n.cpp +++ b/Minecraft.World/Util/I18n.cpp @@ -3,7 +3,7 @@ #include "I18n.h" Language *I18n::lang = Language::getInstance(); -wstring I18n::get(const wstring& id, ...) +std::wstring I18n::get(const std::wstring& id, ...) { #ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway return L""; @@ -14,7 +14,7 @@ wstring I18n::get(const wstring& id, ...) #endif } -wstring I18n::get(const wstring& id, va_list args) +std::wstring I18n::get(const std::wstring& id, va_list args) { return lang->getElement(id, args); } diff --git a/Minecraft.World/Util/I18n.h b/Minecraft.World/Util/I18n.h index a39ab1331..1e6b063ef 100644 --- a/Minecraft.World/Util/I18n.h +++ b/Minecraft.World/Util/I18n.h @@ -10,6 +10,6 @@ private: static Language *lang; public: - static wstring get(const wstring& id, ...); - static wstring get(const wstring& id, va_list args); + static std::wstring get(const std::wstring& id, ...); + static std::wstring get(const std::wstring& id, va_list args); }; \ No newline at end of file diff --git a/Minecraft.World/Util/Icon.h b/Minecraft.World/Util/Icon.h index 1435c7b0e..3d1f7c030 100644 --- a/Minecraft.World/Util/Icon.h +++ b/Minecraft.World/Util/Icon.h @@ -26,7 +26,7 @@ public: virtual float getV0(bool adjust = false) const = 0; virtual float getV1(bool adjust = false) const = 0; virtual float getV(double offset, bool adjust = false) const = 0; - virtual wstring getName() const = 0; + virtual std::wstring getName() const = 0; virtual int getSourceWidth() const = 0; virtual int getSourceHeight() const = 0; virtual int getFlags() const = 0; // 4J added diff --git a/Minecraft.World/Util/IconRegister.h b/Minecraft.World/Util/IconRegister.h index 3ea80bb86..5deece75e 100644 --- a/Minecraft.World/Util/IconRegister.h +++ b/Minecraft.World/Util/IconRegister.h @@ -7,6 +7,6 @@ class IconRegister { public: // 4J Stu - register is a reserved keyword in C++ - virtual Icon *registerIcon(const wstring &name) = 0; + virtual Icon *registerIcon(const std::wstring &name) = 0; virtual int getIconType() = 0; }; \ No newline at end of file diff --git a/Minecraft.World/Util/Language.cpp b/Minecraft.World/Util/Language.cpp index 2679918e1..bf2921bc7 100644 --- a/Minecraft.World/Util/Language.cpp +++ b/Minecraft.World/Util/Language.cpp @@ -15,12 +15,12 @@ Language *Language::getInstance() } /* 4J Jev, creates 2 identical functions. -wstring Language::getElement(const wstring& elementId) +std::wstring Language::getElement(const std::wstring& elementId) { return elementId; } */ -wstring Language::getElement(const wstring& elementId, ...) +std::wstring Language::getElement(const std::wstring& elementId, ...) { #ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway return L""; @@ -31,18 +31,18 @@ wstring Language::getElement(const wstring& elementId, ...) #endif } -wstring Language::getElement(const wstring& elementId, va_list args) +std::wstring Language::getElement(const std::wstring& elementId, va_list args) { // 4J TODO return elementId; } -wstring Language::getElementName(const wstring& elementId) +std::wstring Language::getElementName(const std::wstring& elementId) { return elementId; } -wstring Language::getElementDescription(const wstring& elementId) +std::wstring Language::getElementDescription(const std::wstring& elementId) { return elementId; } \ No newline at end of file diff --git a/Minecraft.World/Util/Language.h b/Minecraft.World/Util/Language.h index 10e2951f2..3720258b4 100644 --- a/Minecraft.World/Util/Language.h +++ b/Minecraft.World/Util/Language.h @@ -7,8 +7,8 @@ private: public: Language(); static Language *getInstance(); - wstring getElement(const wstring& elementId, ...); - wstring getElement(const wstring& elementId, va_list args); - wstring getElementName(const wstring& elementId); - wstring getElementDescription(const wstring& elementId); + std::wstring getElement(const std::wstring& elementId, ...); + std::wstring getElement(const std::wstring& elementId, va_list args); + std::wstring getElementName(const std::wstring& elementId); + std::wstring getElementDescription(const std::wstring& elementId); }; \ No newline at end of file diff --git a/Minecraft.World/Util/NumberFormatters.h b/Minecraft.World/Util/NumberFormatters.h index 5f641819f..6d3f658b8 100644 --- a/Minecraft.World/Util/NumberFormatters.h +++ b/Minecraft.World/Util/NumberFormatters.h @@ -5,12 +5,12 @@ using namespace std; class NumberFormat { public: - static wstring format(int value) + static std::wstring format(int value) { // TODO 4J Stu - Change the length of the formatted number wchar_t output[256]; swprintf( output, 256, L"%d", value); - wstring result = wstring( output ); + std::wstring result = std::wstring( output ); return result; } }; @@ -19,17 +19,17 @@ public: class DecimalFormat { private: - const wstring formatString; + const std::wstring formatString; public: - wstring format(double value) + std::wstring format(double value) { // TODO 4J Stu - Change the length of the formatted number wchar_t output[256]; swprintf( output, 256, formatString.c_str(), value); - wstring result = wstring( output ); + std::wstring result = std::wstring( output ); return result; } // 4J Stu - The java code took a string format, we take a printf format string - DecimalFormat(wstring x) : formatString( x ) {}; + DecimalFormat(std::wstring x) : formatString( x ) {}; }; \ No newline at end of file diff --git a/Minecraft.World/Util/PerformanceTimer.cpp b/Minecraft.World/Util/PerformanceTimer.cpp index 6a4c3fb8f..f577a3174 100644 --- a/Minecraft.World/Util/PerformanceTimer.cpp +++ b/Minecraft.World/Util/PerformanceTimer.cpp @@ -20,7 +20,7 @@ void PerformanceTimer::Reset() #endif } -void PerformanceTimer::PrintElapsedTime(const wstring &description) +void PerformanceTimer::PrintElapsedTime(const std::wstring &description) { #if !defined (__linux__) LARGE_INTEGER qwNewTime, qwDeltaTime; diff --git a/Minecraft.World/Util/PerformanceTimer.h b/Minecraft.World/Util/PerformanceTimer.h index 04a36949d..5ceaa2480 100644 --- a/Minecraft.World/Util/PerformanceTimer.h +++ b/Minecraft.World/Util/PerformanceTimer.h @@ -9,5 +9,5 @@ private: public: PerformanceTimer(); void Reset(); - void PrintElapsedTime(const wstring &description); + void PrintElapsedTime(const std::wstring &description); }; \ No newline at end of file diff --git a/Minecraft.World/Util/ProgressListener.h b/Minecraft.World/Util/ProgressListener.h index f0148ce7e..328914d1e 100644 --- a/Minecraft.World/Util/ProgressListener.h +++ b/Minecraft.World/Util/ProgressListener.h @@ -11,5 +11,5 @@ public: virtual void progressStage(int stringId) = 0; // 4J-PB - added to display bytes retrieved of a save transfer - virtual void progressStage(wstring &wstrText) = 0; + virtual void progressStage(std::wstring &wstrText) = 0; }; \ No newline at end of file diff --git a/Minecraft.World/Util/Rarity.cpp b/Minecraft.World/Util/Rarity.cpp index 2f9ba0690..a4892d3ee 100644 --- a/Minecraft.World/Util/Rarity.cpp +++ b/Minecraft.World/Util/Rarity.cpp @@ -7,6 +7,6 @@ const Rarity *Rarity::uncommon = new Rarity(eHTMLColor_e, L"Uncommon"); const Rarity *Rarity::rare = new Rarity(eHTMLColor_b, L"Rare"); const Rarity *Rarity::epic = new Rarity(eHTMLColor_d, L"Epic"); -Rarity::Rarity(eMinecraftColour color, const wstring &name) : color(color), name(name) +Rarity::Rarity(eMinecraftColour color, const std::wstring &name) : color(color), name(name) { } \ No newline at end of file diff --git a/Minecraft.World/Util/Rarity.h b/Minecraft.World/Util/Rarity.h index 8b0164ac0..d53c1b4ff 100644 --- a/Minecraft.World/Util/Rarity.h +++ b/Minecraft.World/Util/Rarity.h @@ -9,7 +9,7 @@ public: static const Rarity *epic; const eMinecraftColour color; - const wstring name; + const std::wstring name; - Rarity(eMinecraftColour color, const wstring &name); + Rarity(eMinecraftColour color, const std::wstring &name); }; \ No newline at end of file diff --git a/Minecraft.World/Util/SharedConstants.cpp b/Minecraft.World/Util/SharedConstants.cpp index 66cbfec2b..cae6265e7 100644 --- a/Minecraft.World/Util/SharedConstants.cpp +++ b/Minecraft.World/Util/SharedConstants.cpp @@ -3,18 +3,18 @@ #include "../IO/Streams/InputOutputStream.h" #include "SharedConstants.h" -const wstring SharedConstants::VERSION_STRING = L"1.2.3"; +const std::wstring SharedConstants::VERSION_STRING = L"1.2.3"; const bool SharedConstants::TEXTURE_LIGHTING = true; -wstring SharedConstants::readAcceptableChars() +std::wstring SharedConstants::readAcceptableChars() { // 4J-PB - I've added ã in (for Portuguese in bed string) and added the character at the same place in the default.png font - wstring result = L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'abcdefghijklmnopqrstuvwxyz{|}~ ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»ã"; + std::wstring result = L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'abcdefghijklmnopqrstuvwxyz{|}~ ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»ã"; #if 0 // 4J - do we actually really need to get this from a file? //try { //BufferedReader br = new BufferedReader(new InputStreamReader(SharedConstants.class.getResourceAsStream("/font.txt"), "UTF-8")); - BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( new File( wstring(L"/font.txt") ) ) ) ); - wstring line; + BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( new File( std::wstring(L"/font.txt") ) ) ) ); + std::wstring line; while ( !(line = br->readLine()).empty()) { if (!( wcscmp( &line[0], L"#") == 0 ) ) @@ -37,7 +37,7 @@ bool SharedConstants::isAllowedChatCharacter(char ch) return true; } -wstring SharedConstants::acceptableLetters = SharedConstants::readAcceptableChars(); +std::wstring SharedConstants::acceptableLetters = SharedConstants::readAcceptableChars(); void SharedConstants::staticCtor() { diff --git a/Minecraft.World/Util/SharedConstants.h b/Minecraft.World/Util/SharedConstants.h index 80751d6d8..998f03829 100644 --- a/Minecraft.World/Util/SharedConstants.h +++ b/Minecraft.World/Util/SharedConstants.h @@ -6,7 +6,7 @@ class SharedConstants { public: static void staticCtor(); - static const wstring VERSION_STRING; + static const std::wstring VERSION_STRING; static const int NETWORK_PROTOCOL_VERSION = 39; // NOT texture resolution. How many sub-blocks each block face is made up of. @@ -15,11 +15,11 @@ class SharedConstants static bool isAllowedChatCharacter(char ch); // why private?????????? - static wstring readAcceptableChars(); + static std::wstring readAcceptableChars(); public: static const int maxChatLength = 100; - static wstring acceptableLetters; + static std::wstring acceptableLetters; static const int ILLEGAL_FILE_CHARACTERS_LENGTH = 15; static const wchar_t ILLEGAL_FILE_CHARACTERS[ILLEGAL_FILE_CHARACTERS_LENGTH]; diff --git a/Minecraft.World/Util/StringHelpers.cpp b/Minecraft.World/Util/StringHelpers.cpp index 30512764e..f91f8dac2 100644 --- a/Minecraft.World/Util/StringHelpers.cpp +++ b/Minecraft.World/Util/StringHelpers.cpp @@ -1,28 +1,28 @@ #include "../Build/stdafx.h" -wstring toLower(const wstring& a) +std::wstring toLower(const std::wstring& a) { - wstring out = wstring(a); + std::wstring out = std::wstring(a); std::transform(out.begin(), out.end(), out.begin(), ::tolower); return out; } -wstring trimString(const wstring& a) +std::wstring trimString(const std::wstring& a) { - wstring b; + std::wstring b; int start = (int)a.find_first_not_of(L" \t\n\r"); int end = (int)a.find_last_not_of(L" \t\n\r"); - if( start == wstring::npos ) start = 0; - if( end == wstring::npos ) end = (int)a.size()-1; + if( start == std::wstring::npos ) start = 0; + if( end == std::wstring::npos ) end = (int)a.size()-1; b = a.substr(start,(end-start)+1); return b; } -wstring replaceAll(const wstring& in, const wstring& replace, const wstring& with) +std::wstring replaceAll(const std::wstring& in, const std::wstring& replace, const std::wstring& with) { - wstring out = in; + std::wstring out = in; size_t pos = 0; - while( ( pos = out.find(replace, pos) ) != wstring::npos ) + while( ( pos = out.find(replace, pos) ) != std::wstring::npos ) { out.replace( pos, replace.length(), with ); pos++; @@ -30,26 +30,26 @@ wstring replaceAll(const wstring& in, const wstring& replace, const wstring& wit return out; } -bool equalsIgnoreCase(const wstring& a, const wstring& b) +bool equalsIgnoreCase(const std::wstring& a, const std::wstring& b) { bool out; - wstring c = toLower(a); - wstring d = toLower(b); + std::wstring c = toLower(a); + std::wstring d = toLower(b); out = c.compare(d) == 0; return out; } -wstring convStringToWstring(const string& converting) +std::wstring convStringToWstring(const string& converting) { - wstring converted(converting.length(), L' '); + std::wstring converted(converting.length(), L' '); copy(converting.begin(), converting.end(), converted.begin()); return converted; } -// Convert for filename wstrings to a straight character pointer for Xbox APIs. The returned string is only valid until +// Convert for filename std::wstrings to a straight character pointer for Xbox APIs. The returned string is only valid until // this function is called again, and it isn't thread-safe etc. as I'm just storing the returned name in a local static // to save having to clear it up everywhere this is used. -const char *wstringtofilename(const wstring& name) +const char *wstringtofilename(const std::wstring& name) { static char buf[256]; assert(name.length()<256); @@ -68,7 +68,7 @@ const char *wstringtofilename(const wstring& name) return buf; } -wstring filenametowstring(const char *name) +std::wstring filenametowstring(const char *name) { return convStringToWstring(name); } @@ -93,7 +93,7 @@ std::vector stringSplit(const std::wstring &s, wchar_t delim) bool BothAreSpaces(wchar_t lhs, wchar_t rhs) { return (lhs == rhs) && (lhs == L' '); } -void stripWhitespaceForHtml(wstring &string, bool bRemoveNewline) +void stripWhitespaceForHtml(std::wstring &string, bool bRemoveNewline) { // Strip newline chars if(bRemoveNewline) @@ -110,9 +110,9 @@ void stripWhitespaceForHtml(wstring &string, bool bRemoveNewline) string = trimString(string); } -wstring escapeXML(const wstring &in) +std::wstring escapeXML(const std::wstring &in) { - wstring out = in; + std::wstring out = in; out = replaceAll(out, L"&", L"&"); //out = replaceAll(out, L"\"", L"""); //out = replaceAll(out, L"'", L"'"); @@ -121,9 +121,9 @@ wstring escapeXML(const wstring &in) return out; } -wstring parseXMLSpecials(const wstring &in) +std::wstring parseXMLSpecials(const std::wstring &in) { - wstring out = in; + std::wstring out = in; out = replaceAll(out, L"&", L"&"); //out = replaceAll(out, L"\"", L"""); //out = replaceAll(out, L"'", L"'"); diff --git a/Minecraft.World/Util/StringHelpers.h b/Minecraft.World/Util/StringHelpers.h index 609fdf5af..439e3bda6 100644 --- a/Minecraft.World/Util/StringHelpers.h +++ b/Minecraft.World/Util/StringHelpers.h @@ -1,11 +1,11 @@ #pragma once using namespace std; -wstring toLower(const wstring& a); -wstring trimString(const wstring& a); -wstring replaceAll(const wstring& in, const wstring& replace, const wstring& with); +std::wstring toLower(const std::wstring& a); +std::wstring trimString(const std::wstring& a); +std::wstring replaceAll(const std::wstring& in, const std::wstring& replace, const std::wstring& with); -bool equalsIgnoreCase(const wstring& a, const wstring& b); +bool equalsIgnoreCase(const std::wstring& a, const std::wstring& b); // 4J-PB - for use in the ::toString template std::wstring _toString(T t) { @@ -28,13 +28,13 @@ template T _fromHEXString(const std::wstring& s) return t; } -wstring convStringToWstring(const string& converting); -const char *wstringtofilename(const wstring& name); -wstring filenametowstring(const char *name); +std::wstring convStringToWstring(const string& converting); +const char *wstringtofilename(const std::wstring& name); +std::wstring filenametowstring(const char *name); std::vector &stringSplit(const std::wstring &s, wchar_t delim, std::vector &elems); std::vector stringSplit(const std::wstring &s, wchar_t delim); -void stripWhitespaceForHtml(wstring &string, bool bRemoveNewline=true); -wstring escapeXML(const wstring &in); -wstring parseXMLSpecials(const wstring &in); +void stripWhitespaceForHtml(std::wstring &string, bool bRemoveNewline=true); +std::wstring escapeXML(const std::wstring &in); +std::wstring parseXMLSpecials(const std::wstring &in); diff --git a/Minecraft.World/Util/Vec3.cpp b/Minecraft.World/Util/Vec3.cpp index dce9ee75e..f96155e14 100644 --- a/Minecraft.World/Util/Vec3.cpp +++ b/Minecraft.World/Util/Vec3.cpp @@ -190,11 +190,11 @@ Vec3 *Vec3::clipZ(Vec3 *b, double zt) return Vec3::newTemp(x + xd * d, y + yd * d, z + zd * d); } -wstring Vec3::toString() +std::wstring Vec3::toString() { static wchar_t buf[128]; swprintf(buf, 128, L"(%f,%f,%f)",x,y,z); - return wstring(buf); + return std::wstring(buf); } Vec3 *Vec3::lerp(Vec3 *v, double a) diff --git a/Minecraft.World/Util/Vec3.h b/Minecraft.World/Util/Vec3.h index 00a741039..f7131f0bd 100644 --- a/Minecraft.World/Util/Vec3.h +++ b/Minecraft.World/Util/Vec3.h @@ -48,7 +48,7 @@ public: Vec3 *clipX(Vec3 *b, double xt); Vec3 *clipY(Vec3 *b, double yt); Vec3 *clipZ(Vec3 *b, double zt); - wstring toString(); + std::wstring toString(); Vec3 *lerp(Vec3 *v, double a); void xRot(float degs); void yRot(float degs); diff --git a/Minecraft.World/WorldGen/Biomes/Biome.cpp b/Minecraft.World/WorldGen/Biomes/Biome.cpp index 7259639f2..d26e47907 100644 --- a/Minecraft.World/WorldGen/Biomes/Biome.cpp +++ b/Minecraft.World/WorldGen/Biomes/Biome.cpp @@ -188,7 +188,7 @@ Biome *Biome::setSnowCovered() return this; } -Biome *Biome::setName(const wstring &name) +Biome *Biome::setName(const std::wstring &name) { this->m_name = name; return this; diff --git a/Minecraft.World/WorldGen/Biomes/Biome.h b/Minecraft.World/WorldGen/Biomes/Biome.h index 018b0d389..38a48cfc9 100644 --- a/Minecraft.World/WorldGen/Biomes/Biome.h +++ b/Minecraft.World/WorldGen/Biomes/Biome.h @@ -50,7 +50,7 @@ public: static const int BIOME_COUNT = 23; // 4J Stu added public: - wstring m_name; + std::wstring m_name; int color; uint8_t topMaterial; uint8_t material; @@ -122,7 +122,7 @@ public: protected: Biome *setSnowCovered(); - Biome *setName(const wstring &name); + Biome *setName(const std::wstring &name); Biome *setLeafColor(int leafColor); Biome *setColor(int color); diff --git a/Minecraft.World/WorldGen/Features/LargeFeature.cpp b/Minecraft.World/WorldGen/Features/LargeFeature.cpp index fcfbeb8f6..3d0cd76da 100644 --- a/Minecraft.World/WorldGen/Features/LargeFeature.cpp +++ b/Minecraft.World/WorldGen/Features/LargeFeature.cpp @@ -2,7 +2,7 @@ #include "../../Headers/net.minecraft.world.level.h" #include "LargeFeature.h" -const wstring LargeFeature::STRONGHOLD = L"StrongHold"; +const std::wstring LargeFeature::STRONGHOLD = L"StrongHold"; LargeFeature::LargeFeature() { diff --git a/Minecraft.World/WorldGen/Features/LargeFeature.h b/Minecraft.World/WorldGen/Features/LargeFeature.h index c79c5dc58..0bbce2c92 100644 --- a/Minecraft.World/WorldGen/Features/LargeFeature.h +++ b/Minecraft.World/WorldGen/Features/LargeFeature.h @@ -6,7 +6,7 @@ class Level; class LargeFeature { public: - static const wstring STRONGHOLD; + static const std::wstring STRONGHOLD; protected: int radius; Random *random; diff --git a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp b/Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp index 3204b7adf..44e68f1b1 100644 --- a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp +++ b/Minecraft.World/WorldGen/Features/MonsterRoomFeature.cpp @@ -129,12 +129,12 @@ std::shared_ptr MonsterRoomFeature::randomItem(Random *random) return std::shared_ptr(); } -wstring MonsterRoomFeature::randomEntityId(Random *random) +std::wstring MonsterRoomFeature::randomEntityId(Random *random) { int id = random->nextInt(4); - if (id == 0) return wstring(L"Skeleton"); - if (id == 1) return wstring(L"Zombie"); - if (id == 2) return wstring(L"Zombie"); - if (id == 3) return wstring(L"Spider"); - return wstring(L""); + if (id == 0) return std::wstring(L"Skeleton"); + if (id == 1) return std::wstring(L"Zombie"); + if (id == 2) return std::wstring(L"Zombie"); + if (id == 3) return std::wstring(L"Spider"); + return std::wstring(L""); } \ No newline at end of file diff --git a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.h b/Minecraft.World/WorldGen/Features/MonsterRoomFeature.h index add5e413d..d2b90de5b 100644 --- a/Minecraft.World/WorldGen/Features/MonsterRoomFeature.h +++ b/Minecraft.World/WorldGen/Features/MonsterRoomFeature.h @@ -12,5 +12,5 @@ public: private: std::shared_ptr randomItem(Random *random); - wstring randomEntityId(Random *random); + std::wstring randomEntityId(Random *random); }; diff --git a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp b/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp index 5a29b2eb9..acfb4e7f3 100644 --- a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp @@ -10,7 +10,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) m_biomeOverride = byteArray( width * height ); #ifdef _UNICODE - wstring path = L"GAME:\\GameRules\\biomemap.bin"; + std::wstring path = L"GAME:\\GameRules\\biomemap.bin"; HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #else #ifdef _WINDOWS64 diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp b/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp index e1110ab93..382cbd700 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp @@ -132,7 +132,7 @@ bool FlatLevelSource::shouldSave() return true; } -wstring FlatLevelSource::gatherStats() +std::wstring FlatLevelSource::gatherStats() { return L"FlatLevelSource"; } @@ -147,7 +147,7 @@ vector *FlatLevelSource::getMobsAt(MobCategory *mobCate return biome->getMobs(mobCategory); } -TilePos *FlatLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *FlatLevelSource::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { return NULL; } diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.h b/Minecraft.World/WorldGen/Sources/FlatLevelSource.h index 069cb1d39..0f735a758 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/FlatLevelSource.h @@ -38,7 +38,7 @@ public: virtual bool save(bool force, ProgressListener *progressListener); virtual bool tick(); virtual bool shouldSave(); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp index 10b6811b8..f3eebf014 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp @@ -203,7 +203,7 @@ bool HellFlatLevelSource::shouldSave() return true; } -wstring HellFlatLevelSource::gatherStats() +std::wstring HellFlatLevelSource::gatherStats() { return L"HellFlatLevelSource"; } @@ -218,7 +218,7 @@ vector *HellFlatLevelSource::getMobsAt(MobCategory *mob return biome->getMobs(mobCategory); } -TilePos *HellFlatLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *HellFlatLevelSource::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { return NULL; } diff --git a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h index 405f196ba..4d677f6bb 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.h @@ -45,7 +45,7 @@ public: bool save(bool force, ProgressListener *progressListener); bool tick(); bool shouldSave(); - wstring gatherStats(); + std::wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp index 2194ce47d..090090f90 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp @@ -517,7 +517,7 @@ bool HellRandomLevelSource::shouldSave() return true; } -wstring HellRandomLevelSource::gatherStats() +std::wstring HellRandomLevelSource::gatherStats() { return L"HellRandomLevelSource"; } @@ -538,7 +538,7 @@ vector *HellRandomLevelSource::getMobsAt(MobCategory *m return biome->getMobs(mobCategory); } -TilePos *HellRandomLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *HellRandomLevelSource::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { return NULL; } diff --git a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h index b1aa2b2ba..fcb7ab046 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.h @@ -65,8 +65,8 @@ public: bool save(bool force, ProgressListener *progressListener); bool tick(); bool shouldSave(); - wstring gatherStats(); + std::wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp index 3c3632f2f..e65a637e7 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp @@ -399,7 +399,7 @@ bool TheEndLevelRandomLevelSource::shouldSave() return true; } -wstring TheEndLevelRandomLevelSource::gatherStats() +std::wstring TheEndLevelRandomLevelSource::gatherStats() { return L"RandomLevelSource"; } @@ -414,7 +414,7 @@ vector *TheEndLevelRandomLevelSource::getMobsAt(MobCate return biome->getMobs(mobCategory); } -TilePos *TheEndLevelRandomLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z) +TilePos *TheEndLevelRandomLevelSource::findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z) { return NULL; } diff --git a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h index 86e78c211..c2e7d7b48 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h +++ b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.h @@ -52,9 +52,9 @@ public: virtual bool save(bool force, ProgressListener *progressListener); virtual bool tick(); virtual bool shouldSave(); - virtual wstring gatherStats(); + virtual std::wstring gatherStats(); public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const std::wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/WorldGen/Structures/Village.cpp b/Minecraft.World/WorldGen/Structures/Village.cpp index 61f34606e..afd21fba5 100644 --- a/Minecraft.World/WorldGen/Structures/Village.cpp +++ b/Minecraft.World/WorldGen/Structures/Village.cpp @@ -287,7 +287,7 @@ std::shared_ptr Village::getClosestBadStandingPlayer(std::shared_ptrfirst; + std::wstring player = it->first; if (isVeryBadStanding(player)) { std::shared_ptr mob = level->getPlayerByName(player); @@ -380,7 +380,7 @@ void Village::calcInfo() radius = max(doorDist, (int) sqrt((float)maxRadiusSqr) + 1); } -int Village::getStanding(const wstring &playerName) +int Village::getStanding(const std::wstring &playerName) { AUTO_VAR(it,playerStanding.find(playerName)); if (it != playerStanding.end()) @@ -390,25 +390,25 @@ int Village::getStanding(const wstring &playerName) return 0; } -int Village::modifyStanding(const wstring &playerName, int delta) +int Village::modifyStanding(const std::wstring &playerName, int delta) { int current = getStanding(playerName); int newValue = Mth::clamp(current + delta, -30, 10); - playerStanding.insert(pair(playerName, newValue)); + playerStanding.insert(pair(playerName, newValue)); return newValue; } -bool Village::isGoodStanding(const wstring &playerName) +bool Village::isGoodStanding(const std::wstring &playerName) { return getStanding(playerName) >= 0; } -bool Village::isBadStanding(const wstring &playerName) +bool Village::isBadStanding(const std::wstring &playerName) { return getStanding(playerName) <= -5; } -bool Village::isVeryBadStanding(const wstring playerName) +bool Village::isVeryBadStanding(const std::wstring playerName) { return getStanding(playerName) <= -15; } @@ -441,7 +441,7 @@ void Village::readAdditionalSaveData(CompoundTag *tag) for (int i = 0; i < playerTags->size(); i++) { CompoundTag *pTag = playerTags->get(i); - playerStanding.insert(pair(pTag->getString(L"Name"), pTag->getInt(L"S"))); + playerStanding.insert(pair(pTag->getString(L"Name"), pTag->getInt(L"S"))); } } @@ -480,7 +480,7 @@ void Village::addAdditonalSaveData(CompoundTag *tag) //for (String player : playerStanding.keySet()) for(AUTO_VAR(it, playerStanding.begin()); it != playerStanding.end(); ++it) { - wstring player = it->first; + std::wstring player = it->first; CompoundTag *playerTag = new CompoundTag(player); playerTag->putString(L"Name", player); playerTag->putInt(L"S", it->second); diff --git a/Minecraft.World/WorldGen/Structures/Village.h b/Minecraft.World/WorldGen/Structures/Village.h index 2ab17f4bb..f3fd5e6c7 100644 --- a/Minecraft.World/WorldGen/Structures/Village.h +++ b/Minecraft.World/WorldGen/Structures/Village.h @@ -14,7 +14,7 @@ private: int populationSize; int noBreedTimer; - std::unordered_map playerStanding; + std::unordered_map playerStanding; class Aggressor { @@ -68,11 +68,11 @@ private: void calcInfo(); public: - int getStanding(const wstring &playerName); - int modifyStanding(const wstring &playerName, int delta); - bool isGoodStanding(const wstring &playerName); - bool isBadStanding(const wstring &playerName); - bool isVeryBadStanding(const wstring playerName); + int getStanding(const std::wstring &playerName); + int modifyStanding(const std::wstring &playerName, int delta); + bool isGoodStanding(const std::wstring &playerName); + bool isBadStanding(const std::wstring &playerName); + bool isVeryBadStanding(const std::wstring playerName); void readAdditionalSaveData(CompoundTag *tag); void addAdditonalSaveData(CompoundTag *tag); void resetNoBreedTimer(); diff --git a/Minecraft.World/WorldGen/Structures/Villages.cpp b/Minecraft.World/WorldGen/Structures/Villages.cpp index 30038072f..7483f2d8d 100644 --- a/Minecraft.World/WorldGen/Structures/Villages.cpp +++ b/Minecraft.World/WorldGen/Structures/Villages.cpp @@ -6,9 +6,9 @@ #include "../../Util/BasicTypeContainers.h" #include "Villages.h" -const wstring Villages::VILLAGE_FILE_ID = L"villages"; +const std::wstring Villages::VILLAGE_FILE_ID = L"villages"; -Villages::Villages(const wstring &id) : SavedData(id) +Villages::Villages(const std::wstring &id) : SavedData(id) { _tick = 0; level = NULL; diff --git a/Minecraft.World/WorldGen/Structures/Villages.h b/Minecraft.World/WorldGen/Structures/Villages.h index 6e8b0ddeb..e25afc2cd 100644 --- a/Minecraft.World/WorldGen/Structures/Villages.h +++ b/Minecraft.World/WorldGen/Structures/Villages.h @@ -5,7 +5,7 @@ class Villages : public SavedData { public: - static const wstring VILLAGE_FILE_ID; + static const std::wstring VILLAGE_FILE_ID; static const int MaxDoorDist = 32; @@ -17,7 +17,7 @@ private: int _tick; public: - Villages(const wstring &id); + Villages(const std::wstring &id); Villages(Level *level); ~Villages();