10 Commits

Author SHA1 Message Date
6bfae5a14e Merge branch 'main' of https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1 2026-03-21 13:43:29 +02:00
4034cf243d FIX: glfw crash when closing the game 2026-03-21 13:43:28 +02:00
b6e7414f04 Merge pull request 'fix msvc build & mingw build' (#10) from evildebugger/minecraft-pe-0.6.1:main into main
Reviewed-on: https://192.168.0.2:3000/Kolyah35/minecraft-pe-0.6.1/pulls/10
2026-03-21 12:48:51 +02:00
66hh
83f3284827 fix msvc build & mingw build
1. Include unified header files using lowercase filenames
2. Change special characters to escape sequences to solve encoding issues
2026-03-21 18:32:09 +08:00
3dab395af3 fix workflow and im done 2026-03-21 02:45:06 +03:00
011c8f7123 fix mingw build 2026-03-21 02:35:04 +03:00
f69c009da9 replace pwd with workspace 2026-03-21 01:38:17 +03:00
b66b4a2dc2 wtf im dumb 2026-03-21 01:35:40 +03:00
7037b2b5f2 create build dir 2026-03-21 01:33:57 +03:00
d54e39b332 -_- 2026-03-21 01:32:47 +03:00
13 changed files with 77 additions and 61 deletions

View File

@@ -27,7 +27,7 @@ jobs:
- name: Setup caches
uses: ./.github/actions/setup-cache
with:
host: win
host: linux
target: win
- name: Setup Ninja
@@ -41,15 +41,21 @@ jobs:
tar -xf llvm-mingw.tar.xz
mv llvm-mingw-* llvm-mingw
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake -B build \
cmake $GITHUB_WORKSPACE \
-G Ninja \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER=$PWD/llvm-mingw/bin/x86_64-w64-mingw32-clang \
-DCMAKE_CXX_COMPILER=$PWD/llvm-mingw/bin/x86_64-w64-mingw32-clang++ \
-DCMAKE_RC_COMPILER=$PWD/llvm-mingw/bin/x86_64-w64-mingw32-windres \
-DCMAKE_C_COMPILER=$GITHUB_WORKSPACE/llvm-mingw/bin/x86_64-w64-mingw32-clang \
-DCMAKE_CXX_COMPILER=$GITHUB_WORKSPACE/llvm-mingw/bin/x86_64-w64-mingw32-clang++ \
-DCMAKE_RC_COMPILER=$GITHUB_WORKSPACE/llvm-mingw/bin/x86_64-w64-mingw32-windres \
-DALSOFT_BACKEND_PIPEWIRE=OFF \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
@@ -61,11 +67,11 @@ jobs:
with:
name: mcpe-windows
path: |
${{github.workspace}}/build/${{ env.BUILD_TYPE }}/MinecraftPE.exe
${{github.workspace}}/build/${{ env.BUILD_TYPE }}/glfw3.dll
${{github.workspace}}/build/${{ env.BUILD_TYPE }}/libpng16.dll
${{github.workspace}}/build/${{ env.BUILD_TYPE }}/OpenAL32.dll
${{github.workspace}}/build/${{ env.BUILD_TYPE }}/z.dll
${{github.workspace}}/build/MinecraftPE.exe
${{github.workspace}}/build/glfw3.dll
${{github.workspace}}/build/libpng16.dll
${{github.workspace}}/build/OpenAL32.dll
${{github.workspace}}/build/z.dll
build-linux:
name: Linux Build

View File

@@ -28,7 +28,8 @@ if (${PLATFORM} STREQUAL "Desktop")
if (WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(EXTRA_LIBS ws2_32)
include_directories(misc/windows)
set(EXTRA_LIBS ws2_32 winhttp)
elseif(UNIX)
find_library(pthread NAMES pthread)
set(EXTRA_LIBS pthread m)

View File

@@ -1,8 +1,8 @@
#if defined(X360__)
#elif defined (_WIN32)
#include <WinSock2.h>
#include <winsock2.h>
#include <windows.h>
#include <Ws2tcpip.h>
#include <ws2tcpip.h>
// Must always include Winsock2.h before windows.h
// or else:

View File

@@ -109,7 +109,7 @@ public:
virtual bool supportsTouchscreen() override { return true; }
virtual void hideCursor(bool hide) {
virtual void hideCursor(bool hide) override {
int isHide = hide ? GLFW_CURSOR_NORMAL : GLFW_CURSOR_HIDDEN;
glfwSetInputMode(window, GLFW_CURSOR, isHide);
}

View File

@@ -4,10 +4,11 @@
#include <errno.h>
#include <platform/log.h>
#if !defined(_WIN32)
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#if defined(_WIN32)
#include <direct.h>
#else
#include <sys/stat.h>
#include <sys/types.h>
#endif
OptionsFile::OptionsFile() {
@@ -27,39 +28,44 @@ void OptionsFile::setOptionsPath(const std::string& path) {
std::string OptionsFile::getOptionsPath() const {
return settingsPath;
}
void OptionsFile::save(const StringVector& settings) {
FILE* pFile = fopen(settingsPath.c_str(), "w");
if(pFile != NULL) {
for(StringVector::const_iterator it = settings.begin(); it != settings.end(); ++it) {
fprintf(pFile, "%s\n", it->c_str());
}
fclose(pFile);
} else {
if (errno != ENOENT)
LOGI("OptionsFile::save failed to open '%s' for writing: %s", settingsPath.c_str(), strerror(errno));
FILE* pFile = fopen(settingsPath.c_str(), "w");
// Ensure parent directory exists for safekeeping if path contains directories
std::string dir = settingsPath;
size_t fpos = dir.find_last_of("/\\");
if (fpos != std::string::npos) {
dir.resize(fpos);
struct stat st;
if (stat(dir.c_str(), &st) != 0) {
// attempt recursive mkdir
std::string toCreate;
for (size_t i = 0; i <= dir.size(); ++i) {
if (i == dir.size() || dir[i] == '/' || dir[i] == '\\') {
if (!toCreate.empty()) {
mkdir(toCreate.c_str(), 0755);
}
}
if (i < dir.size())
toCreate.push_back(dir[i]);
}
}
}
}
if (!pFile && errno == ENOENT) {
std::string dir = settingsPath;
size_t fpos = dir.find_last_of("/\\");
if (fpos != std::string::npos) {
dir.resize(fpos);
std::string toCreate;
for (size_t i = 0; i <= dir.size(); ++i) {
if (i == dir.size() || dir[i] == '/' || dir[i] == '\\') {
if (!toCreate.empty()) {
#if defined(_WIN32)
_mkdir(toCreate.c_str());
#else
mkdir(toCreate.c_str(), 0755);
#endif
}
}
if (i < dir.size())
toCreate.push_back(dir[i]);
}
}
pFile = fopen(settingsPath.c_str(), "w");
}
if (!pFile) {
LOGI("OptionsFile::save failed: %s", strerror(errno));
return;
}
for (const auto& s : settings) {
fprintf(pFile, "%s\n", s.c_str());
}
fclose(pFile);
}

View File

@@ -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 {

View File

@@ -28,6 +28,7 @@
#if defined(_WIN32)
#include <direct.h>
#include <sys/stat.h>
#else
#include <sys/stat.h>
#include <sys/types.h>

View File

@@ -31,7 +31,7 @@
// #else
// // Uglyness to fix redeclaration issues
// #ifdef WIN32
// #include <WinSock2.h>
// #include <winsock2.h>
// #include <Windows.h>
// #endif
// #include <gl/glew.h>

View File

@@ -205,16 +205,16 @@ int main(void) {
delete app;
appContext.platform->finish();
delete appContext.platform;
#ifndef STANDALONE_SERVER
// Exit.
glfwDestroyWindow(platform->window);
glfwTerminate();
#endif
appContext.platform->finish();
delete appContext.platform;
return 0;
}

View File

@@ -14,7 +14,7 @@
#include <windows.h>
#include <windowsx.h>
#include <WinSock2.h>
#include <winsock2.h>
#include <process.h>
#include "SharedConstants.h"

View File

@@ -5,7 +5,7 @@
#include <vector>
#ifdef WIN32
#include <WinSock2.h>
#include <winsock2.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>

View File

@@ -140,7 +140,9 @@ RakNet::TimeUS GetTimeUS_Windows( void )
#if _MSC_VER >= 1400 && defined (_M_X64)
GetProcessAffinityMask(mProc, (PDWORD_PTR)&mProcMask, (PDWORD_PTR)&mSysMask);
#else
#ifndef __MINGW32__
GetProcessAffinityMask(mProc, &mProcMask, &mSysMask);
#endif
#endif
mThread = GetCurrentThread();

View File

@@ -1,8 +1,8 @@
#if defined(X360__)
#elif defined (_WIN32)
#include <WinSock2.h>
#include <winsock2.h>
#include <windows.h>
#include <Ws2tcpip.h>
#include <ws2tcpip.h>
// Must always include Winsock2.h before windows.h
// or else: