From 83f32848277c864ba0c6c7a2a2a9263c44b65691 Mon Sep 17 00:00:00 2001 From: 66hh <49398720+66hh@users.noreply.github.com> Date: Sat, 21 Mar 2026 18:32:09 +0800 Subject: [PATCH] fix msvc build & mingw build 1. Include unified header files using lowercase filenames 2. Change special characters to escape sequences to solve encoding issues --- misc/windows/WinSock2.h | 2 -- misc/windows/Ws2tcpip.h | 2 -- .../lib_projects/raknet/jni/RaknetSources/WindowsIncludes.h | 4 ++-- src/client/gui/Font.cpp | 6 +++--- src/client/renderer/gles.h | 2 +- src/main_win32.h | 2 +- src/network/command/CommandServer.h | 2 +- src/raknet/WindowsIncludes.h | 4 ++-- 8 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 misc/windows/WinSock2.h delete mode 100644 misc/windows/Ws2tcpip.h diff --git a/misc/windows/WinSock2.h b/misc/windows/WinSock2.h deleted file mode 100644 index 46c802c..0000000 --- a/misc/windows/WinSock2.h +++ /dev/null @@ -1,2 +0,0 @@ -// For mingw, cuz on linux it case-sensitive -#include \ No newline at end of file diff --git a/misc/windows/Ws2tcpip.h b/misc/windows/Ws2tcpip.h deleted file mode 100644 index feed9e3..0000000 --- a/misc/windows/Ws2tcpip.h +++ /dev/null @@ -1,2 +0,0 @@ -// For mingw, cuz on linux it case-sensitive -#include \ No newline at end of file diff --git a/project/lib_projects/raknet/jni/RaknetSources/WindowsIncludes.h b/project/lib_projects/raknet/jni/RaknetSources/WindowsIncludes.h index 7e504dc..828614c 100755 --- a/project/lib_projects/raknet/jni/RaknetSources/WindowsIncludes.h +++ b/project/lib_projects/raknet/jni/RaknetSources/WindowsIncludes.h @@ -1,8 +1,8 @@ #if defined(X360__) #elif defined (_WIN32) -#include +#include #include -#include +#include // Must always include Winsock2.h before windows.h // or else: diff --git a/src/client/gui/Font.cpp b/src/client/gui/Font.cpp index 48efbf7..3f88fc6 100755 --- a/src/client/gui/Font.cpp +++ b/src/client/gui/Font.cpp @@ -186,7 +186,7 @@ void Font::draw( const std::string& str, float x, float y, int color, bool darke glPushMatrix2(); glTranslatef2((GLfloat)x, (GLfloat)y, 0.0f); for (unsigned int i = 0; i < str.length(); i++) { - while (str.length() > i + 1 && str[i] == '§') { + while (str.length() > i + 1 && str[i] == '\xa7') { int cc = hex.find((char)tolower(str[i + 1])); if (cc < 0 || cc > 15) cc = 15; lists[index++] = listPos + 256 + cc + (darken ? 16 : 0); @@ -235,7 +235,7 @@ int Font::width( const std::string& str ) int len = 0; for (unsigned int i = 0; i < str.length(); i++) { - if (str[i] == '§') { + if (str[i] == '\xa7') { i++; } else { //int ch = SharedConstants.acceptableLetters.indexOf(str.charAt(i)); @@ -274,7 +274,7 @@ std::string Font::sanitize( const std::string& str ) int j = 0; for (unsigned int i = 0; i < str.length(); i++) { - if (str[i] == '§') { + if (str[i] == '\xa7') { i++; //} else if (SharedConstants.acceptableLetters.indexOf(str.charAt(i)) >= 0) { } else { diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index 32b16d2..7b7e4fd 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -31,7 +31,7 @@ // #else // // Uglyness to fix redeclaration issues // #ifdef WIN32 -// #include +// #include // #include // #endif // #include diff --git a/src/main_win32.h b/src/main_win32.h index a008a07..69d0165 100755 --- a/src/main_win32.h +++ b/src/main_win32.h @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include "SharedConstants.h" diff --git a/src/network/command/CommandServer.h b/src/network/command/CommandServer.h index ff80ee2..e2aa4bb 100755 --- a/src/network/command/CommandServer.h +++ b/src/network/command/CommandServer.h @@ -5,7 +5,7 @@ #include #ifdef WIN32 - #include + #include #else #include #include diff --git a/src/raknet/WindowsIncludes.h b/src/raknet/WindowsIncludes.h index 7e504dc..828614c 100755 --- a/src/raknet/WindowsIncludes.h +++ b/src/raknet/WindowsIncludes.h @@ -1,8 +1,8 @@ #if defined(X360__) #elif defined (_WIN32) -#include +#include #include -#include +#include // Must always include Winsock2.h before windows.h // or else: