diff --git a/build.ps1 b/build.ps1 index f95b0b0..e554cfc 100644 --- a/build.ps1 +++ b/build.ps1 @@ -220,14 +220,15 @@ if (-not $NoCpp -and -not $NoBuild) { Write-Step "NDK build (arm64-v8a)" # NDK r14b on Windows hits the 32K CreateProcess limit with long paths. # Work around it by building through a short junction C:\m -> repo root. - $junctionBase = "C:\m" - if (-not (Test-Path $junctionBase)) { - & cmd.exe /c "mklink /J `"$junctionBase`" `"$repo`"" | Out-Null + # Use forward slashes in the build paths to prevent the NDK toolchain from stripping backslashes. + $junctionBase = "C:/m" + if (-not (Test-Path "C:\m")) { + & cmd.exe /c "mklink /J `"C:\m`" `"$repo`"" | Out-Null } - Push-Location "$junctionBase\project\android\jni" - $env:NDK_MODULE_PATH = "$junctionBase\project\lib_projects" + Push-Location "$junctionBase/project/android/jni" + $env:NDK_MODULE_PATH = "$junctionBase/project/lib_projects" # run ndk-build and capture everything; let user see full output for debugging - $ndkOutput = & "$ndk\ndk-build.cmd" NDK_PROJECT_PATH="$junctionBase\project\android" APP_BUILD_SCRIPT="$junctionBase\project\android\jni\Android.mk" 2>&1 | Tee-Object -Variable ndkOutput + $ndkOutput = & "$ndk\ndk-build.cmd" NDK_PROJECT_PATH="$junctionBase/project/android" APP_BUILD_SCRIPT="$junctionBase/project/android/jni/Android.mk" 2>&1 | Tee-Object -Variable ndkOutput # dump entire output for diagnosis Write-Host "---- NDK BUILD OUTPUT BEGIN ----" $ndkOutput | ForEach-Object { Write-Host $_ } diff --git a/project/android/jni/Android.mk b/project/android/jni/Android.mk index 603fca7..3deb435 100755 --- a/project/android/jni/Android.mk +++ b/project/android/jni/Android.mk @@ -1,4 +1,6 @@ LOCAL_PATH := $(call my-dir) +# Convert Windows backslashes to forward slashes so NDK toolchain doesn’t treat them as escapes. +LOCAL_PATH := $(subst \,/,$(LOCAL_PATH)) include $(CLEAR_VARS) @@ -12,6 +14,7 @@ LOCAL_SRC_FILES := ../../../src/main.cpp \ ../../../src/platform/input/Multitouch.cpp \ ../../../src/platform/time.cpp \ ../../../src/platform/CThread.cpp \ + ../../../src/platform/HttpClient.cpp \ ../../../src/NinecraftApp.cpp \ ../../../src/Performance.cpp \ ../../../src/SharedConstants.cpp \ diff --git a/project/android/jni/Application.mk b/project/android/jni/Application.mk index bea0653..9853b52 100755 --- a/project/android/jni/Application.mk +++ b/project/android/jni/Application.mk @@ -2,4 +2,5 @@ APP_PLATFORM := android-21 APP_STL := gnustl_static APP_OPTIM := release APP_ABI := arm64-v8a +APP_SHORT_COMMANDS := true #APP_ABI := armeabi-v7a x86 diff --git a/src/client/player/LocalPlayer.cpp b/src/client/player/LocalPlayer.cpp index 8e76115..bfa9691 100755 --- a/src/client/player/LocalPlayer.cpp +++ b/src/client/player/LocalPlayer.cpp @@ -413,7 +413,7 @@ void LocalPlayer::tick() { printf("armor %d: %d\n", i, a->getAuxValue()); } -/**/ +*/ updateArmorTypeHash(); #ifndef STANDALONE_SERVER diff --git a/src/client/renderer/entity/HumanoidMobRenderer.cpp b/src/client/renderer/entity/HumanoidMobRenderer.cpp index 2b49aba..b6f68f0 100755 --- a/src/client/renderer/entity/HumanoidMobRenderer.cpp +++ b/src/client/renderer/entity/HumanoidMobRenderer.cpp @@ -74,7 +74,7 @@ void HumanoidMobRenderer::additionalRendering(Mob* mob, float a) { // Render player cape if available { - Player* player = dynamic_cast(mob); + Player* player = Player::asPlayer(mob); if (player) { const std::string capeTex = player->getCapeTexture(); if (!capeTex.empty()) { diff --git a/src/platform/HttpClient.cpp b/src/platform/HttpClient.cpp index a5bd252..3647373 100644 --- a/src/platform/HttpClient.cpp +++ b/src/platform/HttpClient.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #if defined(_WIN32) @@ -176,7 +177,9 @@ bool resolveAndConnect(const std::string& host, int port, int& outSock) { hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - const std::string portStr = std::to_string(port); + std::ostringstream portStream; + portStream << port; + const std::string portStr = portStream.str(); if (getaddrinfo(host.c_str(), portStr.c_str(), &hints, &result) != 0) return false;