From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.Client/StringTable.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'Minecraft.Client/StringTable.cpp') diff --git a/Minecraft.Client/StringTable.cpp b/Minecraft.Client/StringTable.cpp index b0c46a7b..a29da179 100644 --- a/Minecraft.Client/StringTable.cpp +++ b/Minecraft.Client/StringTable.cpp @@ -11,6 +11,20 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) { src = byteArray(pbData, dwSize); + ProcessStringTableData(); +} + + +void StringTable::ReloadStringTable() +{ + m_stringsMap.clear(); + m_stringsVec.clear(); + + ProcessStringTableData(); +} + +void StringTable::ProcessStringTableData(void) +{ ByteArrayInputStream bais(src); DataInputStream dis(&bais); @@ -35,8 +49,8 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) // for( AUTO_VAR(it_locales, locales.begin()); - it_locales!=locales.end() && (!foundLang); - it_locales++ + it_locales!=locales.end() && (!foundLang); + it_locales++ ) { bytesToSkip = 0; @@ -72,7 +86,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) // Read the language file for the selected language int langVersion = dis2.readInt(); - + isStatic = false; // 4J-JEV: Versions 1 and up could use if (langVersion > 0) // integers rather than wstrings as keys. isStatic = dis2.readBoolean(); @@ -80,6 +94,8 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) wstring langId = dis2.readUTF(); int totalStrings = dis2.readInt(); + app.DebugPrintf("IsStatic=%d totalStrings = %d\n",isStatic?1:0,totalStrings); + if (!isStatic) { for(int i = 0; i < totalStrings; ++i) @@ -109,11 +125,12 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) isStatic = false; } - + // We can't delete this data in the dtor, so clear the reference bais.reset(); } + StringTable::~StringTable(void) { // delete src.data; TODO 4J-JEV: ? -- cgit v1.2.3