From 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Fri, 6 Mar 2026 02:11:18 +0700 Subject: Remove AUTO_VAR macro and _toString function (#592) --- Minecraft.Client/Options.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'Minecraft.Client/Options.cpp') diff --git a/Minecraft.Client/Options.cpp b/Minecraft.Client/Options.cpp index c18c136b..fac7fe13 100644 --- a/Minecraft.Client/Options.cpp +++ b/Minecraft.Client/Options.cpp @@ -328,7 +328,7 @@ wstring Options::getMessage(const Options::Option *item) { return caption + language->getElement(L"options.sensitivity.max"); } - return caption + _toString((int) (progressValue * 200)) + L"%"; + return caption + std::to_wstring(static_cast(progressValue * 200)) + L"%"; } else if (item == Option::FOV) { if (progressValue == 0) @@ -339,7 +339,7 @@ wstring Options::getMessage(const Options::Option *item) { return caption + language->getElement(L"options.fov.max"); } - return caption + _toString((int) (70 + progressValue * 40)); + return caption + std::to_wstring(static_cast(70.0f + progressValue * 40.0f)); } else if (item == Option::GAMMA) { if (progressValue == 0) @@ -350,7 +350,7 @@ wstring Options::getMessage(const Options::Option *item) { return caption + language->getElement(L"options.gamma.max"); } - return caption + L"+" + _toString((int) (progressValue * 100)) + L"%"; + return caption + L"+" + std::to_wstring( static_cast(progressValue * 100.0f)) + L"%"; } else { @@ -358,7 +358,7 @@ wstring Options::getMessage(const Options::Option *item) { return caption + language->getElement(L"options.off"); } - return caption + _toString((int) (progressValue * 100)) + L"%"; + return caption + std::to_wstring(static_cast(progressValue * 100.0f)) + L"%"; } } else if (item->isBoolean()) { @@ -410,7 +410,7 @@ void Options::load() if (!optionsFile.exists()) return; // 4J - was new BufferedReader(new FileReader(optionsFile)); BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( optionsFile ) ) ); - + 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? { @@ -486,29 +486,29 @@ void Options::save() DataOutputStream dos = DataOutputStream(&fos); // PrintWriter pw = new PrintWriter(new FileWriter(optionsFile)); - dos.writeChars(L"music:" + _toString(music) + L"\n"); - dos.writeChars(L"sound:" + _toString(sound) + L"\n"); + dos.writeChars(L"music:" + std::to_wstring(music) + L"\n"); + dos.writeChars(L"sound:" + std::to_wstring(sound) + L"\n"); dos.writeChars(L"invertYMouse:" + 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"mouseSensitivity:" + std::to_wstring(sensitivity)); + dos.writeChars(L"fov:" + std::to_wstring(fov)); + dos.writeChars(L"gamma:" + std::to_wstring(gamma)); + dos.writeChars(L"viewDistance:" + std::to_wstring(viewDistance)); + dos.writeChars(L"guiScale:" + std::to_wstring(guiScale)); + dos.writeChars(L"particles:" + std::to_wstring(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"fpsLimit:" + _toString(framerateLimit)); - dos.writeChars(L"difficulty:" + _toString(difficulty)); + dos.writeChars(L"fpsLimit:" + std::to_wstring(framerateLimit)); + dos.writeChars(L"difficulty:" + std::to_wstring(difficulty)); dos.writeChars(L"fancyGraphics:" + wstring(fancyGraphics ? L"true" : L"false")); - dos.writeChars(L"ao:" + wstring(ambientOcclusion ? L"true" : L"false")); - dos.writeChars(L"clouds:" + _toString(renderClouds)); + dos.writeChars(ambientOcclusion ? L"ao:true" : L"ao:false"); + dos.writeChars(renderClouds ? L"clouds:true" : L"clouds:false"); dos.writeChars(L"skin:" + skin); dos.writeChars(L"lastServer:" + lastMpIp); for (int i = 0; i < keyMappings_length; i++) { - dos.writeChars(L"key_" + keyMappings[i]->name + L":" + _toString(keyMappings[i]->key)); + dos.writeChars(L"key_" + keyMappings[i]->name + L":" + std::to_wstring(keyMappings[i]->key)); } dos.close(); -- cgit v1.2.3