diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf new file mode 100644 index 00000000..c31bf921 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf new file mode 100644 index 00000000..f7c64ef0 Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf differ diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index f438c73d..90ac05b3 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -222,23 +222,11 @@ static wstring GetControlTypeSkinPath(int controlType, bool hd) break; } - if(skinName == L"windows") { - if (hd) - { - return L"skinHDWin.swf"; - } - - return L"skinWin.swf"; - } - else + if(hd) { - if(hd) - { - return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf"; - } - - return wstring(L"Graphics\\ControlType\\") + skinName + L".swf"; + return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf"; } + return wstring(L"Graphics\\ControlType\\") + skinName + L".swf"; } #endif diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index f255b0d5..0813623b 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -3608,7 +3608,18 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } // 4J-JEV: Don't set tooltips when we're reloading the skin, it'll crash. - if (!ui.IsReloadingSkin()) ui.SetTooltips( iPad, iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS); + if (!ui.IsReloadingSkin()) + { + int uiControlType = app.GetGameSettings(iPad, eGameSetting_ControlType); + if (uiControlType == 0) + { + ui.SetTooltips(iPad, iA, iB, iX, iY, iRT, iLT, iLB, iRB, iLS, iRS); // flip left and right triggers on kbm + } + else + { + ui.SetTooltips(iPad, iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS); + } + } int wheel = 0; if (InputManager.GetValue(iPad, MINECRAFT_ACTION_LEFT_SCROLL, true) > 0 && gameMode->isInputAllowed(MINECRAFT_ACTION_LEFT_SCROLL) ) diff --git a/Minecraft.World/StringHelpers.cpp b/Minecraft.World/StringHelpers.cpp index 785cb755..e15a0939 100644 --- a/Minecraft.World/StringHelpers.cpp +++ b/Minecraft.World/StringHelpers.cpp @@ -70,40 +70,76 @@ wstring convStringToWstring(const string& converting) // to save having to clear it up everywhere this is used. const char *wstringtofilename(const wstring& name) { - static std::string buf; - buf.clear(); - buf.reserve(name.length()); - for(unsigned int i = 0; i < name.length(); i++ ) - { - wchar_t c = name[i]; -#if defined __PS3__ || defined __ORBIS__ - if(c=='\\') c='/'; -#else - if(c=='/') c='\\'; + static thread_local char buf[4][8192]; + static thread_local int bufIndex = 0; + + char *out = buf[bufIndex]; + bufIndex = (bufIndex + 1) % 4; + + size_t len = name.length(); + if (len >= sizeof(buf[0])) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("wstringtofilename: path too long, truncating from %zu to %zu\n", len, sizeof(buf[0]) - 1); #endif - // assert(c<128); // Will we have to do any conversion of non-ASCII characters in filenames? - if (c >= 128) { - printf("Non-ASCII character in filename: %lc\n", c); - c = '?'; - } - // buf[i] = static_cast(c); does nothing - buf.push_back(static_cast(c)); - } - return buf.c_str(); + len = sizeof(buf[0]) - 1; + } + + for (size_t i = 0; i < len; ++i) + { + wchar_t c = name[i]; +#if defined __PS3__ || defined __ORBIS__ + if (c == L'\\') c = L'/'; +#else + if (c == L'/') c = L'\\'; +#endif + if (c >= 128) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("Non-ASCII character in filename: %lc\n", c); +#endif + c = L'?'; + } + out[i] = static_cast(c); + } + out[len] = '\0'; + + return out; } const char *wstringtochararray(const wstring& name) { - static std::string buf; - buf.clear(); - buf.reserve(name.length()); - for(unsigned int i = 0; i < name.length(); i++ ) - { - wchar_t c = name[i]; - assert(c<128); // Will we have to do any conversion of non-ASCII characters in filenames? - buf.push_back(static_cast(c)); - } - return buf.c_str(); + static thread_local char buf[4][8192]; + static thread_local int bufIndex = 0; + + char *out = buf[bufIndex]; + bufIndex = (bufIndex + 1) % 4; + + size_t len = name.length(); + if (len >= sizeof(buf[0])) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("wstringtochararray: string too long, truncating from %zu to %zu\n", len, sizeof(buf[0]) - 1); +#endif + len = sizeof(buf[0]) - 1; + } + + for (size_t i = 0; i < len; ++i) + { + wchar_t c = name[i]; + if (c >= 128) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("Non-ASCII character in string conversion: %lc\n", c); +#endif + c = L'?'; + } + out[i] = static_cast(c); + } + out[len] = '\0'; + + return out; + } wstring filenametowstring(const char *name) diff --git a/Minecraft.World/WallTile.cpp b/Minecraft.World/WallTile.cpp index 9b9ff947..dc292a0f 100644 --- a/Minecraft.World/WallTile.cpp +++ b/Minecraft.World/WallTile.cpp @@ -155,7 +155,13 @@ AABB *WallTile::getAABB(Level *level, int x, int y, int z) bool WallTile::connectsTo(LevelSource *level, int x, int y, int z) { int tile = level->getTile(x, y, z); - if (tile == id || tile == Tile::fence_gate_Id) + if (tile == id || tile == Tile::fence_gate_Id || + tile == Tile::birch_fence_gate_Id || + tile == Tile::spruce_fence_gate_Id || + tile == Tile::jungle_fence_gate_Id || + tile == Tile::acacia_fence_gate_Id || + tile == Tile::dark_oak_fence_gate_Id + ) // fix: walls only connecting to the regular fence gate { return true; }