Skip to content

Commit 075e215

Browse files
committed
Merge branch 'master' into wip-translator
2 parents 46e42d5 + 61b3f90 commit 075e215

File tree

13 files changed

+120
-44
lines changed

13 files changed

+120
-44
lines changed

.github/workflows/windows-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
extra_options: "-DCMAKE_PREFIX_PATH=\"C:/Qt/5.6.3-i686/\" -DCMAKE_TOOLCHAIN_FILE=`pwd`/_common/ci_windows_mingw_toolchain_x32.cmake",
4848
build_type: "Release",
4949
upload_directory: "www/win32/moondust-win32/",
50-
mingw_download: "https://wohlsoft.ru/docs/Software/MinGW/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z", mingw_install_dir: "C:/MinGW-w64/",
51-
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.6.3-i686-mingw-w64-8.1.0-shared-release.7z", qt_install_dir: "C:/Qt/",
50+
mingw_download: "https://wohlsoft.ru/docs/Software/MinGW/i686-12.2.0-release-posix-dwarf-rt_v10-rev1.7z", mingw_install_dir: "C:/MinGW-w64/",
51+
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.6.3-i686-mingw-w64-12.2.0-shared-release.7z", qt_install_dir: "C:/Qt/",
5252
qt_dir: "C:/Qt/5.6.3-i686/bin",
5353
ninja_download: "https://wohlsoft.ru/docs/Software/Ninja-Build/ninja-win.zip", ninja_install_dir: "C:/MinGW-w64/mingw32/bin",
5454
lftp_download: "https://wohlsoft.ru/docs/Software/lftp-4.4.15.win64-openssl-1.0.1g.7z", lftp_install_dir: "C:/MinGW-w64/mingw32/"

.gitmodules

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[submodule "_common/PGE_File_Formats"]
2-
path = _common/PGE_File_Formats
3-
url = https://github.com/WohlSoft/PGE-File-Library-STL.git
4-
branch = master
5-
2+
path = _common/PGE_File_Formats
3+
url = https://github.com/WohlSoft/PGE-File-Library-STL.git
4+
branch = master
65
[submodule "_Libs/FreeImage"]
76
path = _Libs/FreeImage
87
url = https://github.com/WohlSoft/libFreeImage.git
9-
branch = master
10-
8+
branch = master
119
[submodule "_Libs/AudioCodecs"]
1210
path = _Libs/AudioCodecs
1311
url = https://github.com/WohlSoft/AudioCodecs.git
@@ -27,7 +25,7 @@
2725
[submodule "_Libs/LuaJIT"]
2826
path = _Libs/LuaJIT
2927
url = https://github.com/WohlSoft/LuaJIT.git
30-
branch = 2.1
28+
branch = v2.1
3129
[submodule "_Libs/libjpeg"]
3230
path = _Libs/libjpeg
3331
url = https://github.com/WohlSoft/libjpeg.git

Editor/testing/luna_tester_engine.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#endif
2626

2727
#ifdef _WIN32
28+
#define PSAPI_VERSION 1
2829
#include <windows.h>
2930
#include <psapi.h>
3031
#include <stdio.h>
@@ -231,7 +232,7 @@ void LunaTesterEngine::init()
231232
this, &LunaTesterEngine::gameReadyReadStandardError);
232233
QObject::connect(&m_lunaGameIPC, &QProcess::readyReadStandardOutput,
233234
this, &LunaTesterEngine::gameReadyReadStandardOutput);
234-
235+
235236
QObject::connect(&g_intEngine, &IntEngineSignals::sendPlacingBlock,
236237
this, &LunaTesterEngine::sendPlacingBlock);
237238
QObject::connect(&g_intEngine, &IntEngineSignals::sendPlacingNPC,
@@ -685,7 +686,7 @@ bool LunaTesterEngine::sendItemPlacing(const QString &rawData, PendingCmd ipcPen
685686
{
686687
//{"jsonrpc": "2.0", "method": "sendItemPlacing", "params":
687688
// {"sendItemPlacing": <RAW ITEM DATA> }}
688-
689+
689690
if(!isEngineActive())
690691
return false;
691692

@@ -701,9 +702,9 @@ bool LunaTesterEngine::sendItemPlacing(const QString &rawData, PendingCmd ipcPen
701702
jsonObj["params"] = JSONparams;
702703
jsonObj["id"] = static_cast<int>(ipcPendCmd);
703704
jsonOut.setObject(jsonObj);
704-
705+
705706
LogDebug("ENGINE: Place item command: " + rawData);
706-
707+
707708
if(writeToIPC(jsonOut))
708709
{
709710
m_pendingCommands += ipcPendCmd;

_Libs/IniProcessor

_Libs/LuaJIT

_common/StackWalker/StackWalker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro
12111211
if(this->m_sw->pSGLFA(this->m_hProcess, s.AddrPC.Offset, &(csEntry.offsetFromLine), &Line) != FALSE)
12121212
{
12131213
csEntry.lineNumber = Line.LineNumber;
1214-
MyStrCpy(csEntry.lineFileName, STACKWALK_MAX_NAMELEN, Line.FileName);
1214+
MyStrCpy(csEntry.lineFileName, STACKWALK_MAX_NAMELEN - 1, Line.FileName);
12151215
}
12161216
else
12171217
{

_common/build_env_pge.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ else()
2323
set(PGE_ARCHITECTURE_BITS "unk")
2424
endif()
2525

26+
include(${CMAKE_CURRENT_LIST_DIR}/TargetArch.cmake)
27+
target_architecture(TARGET_PROCESSOR)
28+
message(STATUS "Target architecture: ${TARGET_PROCESSOR}")
29+
2630
# Date and time when build was initiated
2731
string(TIMESTAMP MOONDUST_DATETIME "%Y-%m-%d %H:%m:%S UTC" UTC)
2832
# Keep this string being fixed to don't lead unfair rebuilds during local debugs

_common/build_props.cmake

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ endif()
1313

1414
# =========================== Architecture info ===============================
1515

16-
include(${CMAKE_CURRENT_LIST_DIR}/TargetArch.cmake)
17-
target_architecture(TARGET_PROCESSOR)
18-
message(STATUS "Target architecture: ${TARGET_PROCESSOR}")
16+
if(NOT DEFINED TARGET_PROCESSOR)
17+
include(${CMAKE_CURRENT_LIST_DIR}/TargetArch.cmake)
18+
target_architecture(TARGET_PROCESSOR)
19+
message(STATUS "Target architecture: ${TARGET_PROCESSOR}")
20+
endif()
1921

2022
test_big_endian(MOONDUST_IS_BIG_ENDIAN)
2123
if(MOONDUST_IS_BIG_ENDIAN)
@@ -280,6 +282,20 @@ endif()
280282

281283
# ================================ Tweaks ====================================
282284

285+
if(WIN32)
286+
add_definitions(-DWINVER=0x0501 -D_WIN32_WINNT=0x0501)
287+
endif()
288+
289+
# Get rid of the rest of SIMD on 32bit Windows (Maintain compatibility with Pentium III and older processors)
290+
if(WIN32 AND "${TARGET_PROCESSOR}" STREQUAL "i386")
291+
pge_add_opt_flag("-mno-sse2" FLAG_NO_SSE2)
292+
pge_add_opt_flag("-mno-sse3" FLAG_NO_SSE3)
293+
pge_add_opt_flag("-mno-mmx" FLAG_NO_MMX)
294+
pge_add_opt_flag("-mno-3dnow" FLAG_NO_3DNOW)
295+
pge_add_opt_flag("-mno-avx2" FLAG_NO_AVX2)
296+
pge_add_opt_flag("-mfpmath=387" FLAG_FPMATH387)
297+
endif()
298+
283299
# -fPIC thing
284300
if(LIBRARY_PROJECT AND NOT WIN32)
285301
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

_common/library_AudioCodecs.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ if(EMSCRIPTEN)
2222
set(AUDIOCODECS_EMSCRIPTEN_CMAKE_FLAGS -DADLMIDI_USE_DOSBOX_EMULATOR=ON)
2323
endif()
2424

25+
set(AUDIO_CODECS_BUILD_ARGS)
2526
set(AudioCodecs_Deps)
27+
2628
if(NOT SDL2_USE_SYSTEM)
2729
list(APPEND AudioCodecs_Deps SDL2_Local)
28-
set(AudioCodecs_SDL2Flag "-DSDL2_REPO_PATH=${DEPENDENCIES_INSTALL_DIR}")
29-
else()
30-
unset(AudioCodecs_SDL2Flag)
30+
list(APPEND AUDIO_CODECS_BUILD_ARGS "-DSDL2_REPO_PATH=${DEPENDENCIES_INSTALL_DIR}")
31+
endif()
32+
33+
if(WIN32 AND "${TARGET_PROCESSOR}" STREQUAL "i386")
34+
# Disable SIMD on 32-bit Windows architecture to allow running on old computers
35+
list(APPEND AUDIO_CODECS_BUILD_ARGS
36+
-DDISABLE_SIMD=ON
37+
)
3138
endif()
3239

3340
set(AudioCodecs_Libs
@@ -59,12 +66,12 @@ ExternalProject_Add(
5966
"-DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL_DIR}"
6067
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
6168
"-DCMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}"
62-
${AudioCodecs_SDL2Flag}
6369
"-DCMAKE_DEBUG_POSTFIX=${PGE_LIBS_DEBUG_SUFFIX}"
6470
"-DBUILD_OGG_VORBIS=OFF"
6571
"-DBUILD_FLAC=OFF"
6672
"-DBUILD_MPG123=OFF"
6773
"-DBUILD_WAVPACK=OFF"
74+
${AUDIO_CODECS_BUILD_ARGS}
6875
${ANDROID_CMAKE_FLAGS}
6976
${APPLE_CMAKE_FLAGS}
7077
${AUDIOCODECS_EMSCRIPTEN_CMAKE_FLAGS}

_common/library_SDL2.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,21 @@ else()
188188
set(SDL2_EMSCRIPTEN_CMAKE_FLAGS "-DEXTRA_CFLAGS=-s USE_PTHREADS=1" -DPTHREADS=ON -DPTHREADS_SEM=ON)
189189
endif()
190190

191+
set(SDL2_CMAKE_NOSIMD_FLAGS)
192+
if(WIN32 AND "${TARGET_PROCESSOR}" STREQUAL "i386")
193+
set(SDL2_CMAKE_NOSIMD_FLAGS
194+
"-DSDL_SSEMATH=OFF"
195+
"-DSDL_SSE=OFF"
196+
"-DSDL_SSE2=OFF"
197+
"-DSDL_SSE3=OFF"
198+
"-DSDL_MMX=OFF"
199+
"-DSDL_3DNOW=OFF"
200+
"-DSDL_ALTIVEC=OFF"
201+
"-DSDL_ARMSIMD=OFF"
202+
"-DSDL_ARMNEON=OFF"
203+
)
204+
endif()
205+
191206
ExternalProject_Add(
192207
SDL2_Local
193208
PREFIX ${CMAKE_BINARY_DIR}/external/SDL2
@@ -210,6 +225,7 @@ else()
210225
# $<$<BOOL:WIN32>:-DWASAPI=OFF> #For some experiment, enable WASAPI support
211226
${SDL2_WIN32_CMAKE_FLAGS}
212227
${SDL2_LINUX_CMAKE_FLAGS}
228+
${SDL2_CMAKE_NOSIMD_FLAGS}
213229
${SDL2_ANDROID_CMAKE_FLAGS}
214230
${ANDROID_CMAKE_FLAGS}
215231
${SDL2_EMSCRIPTEN_CMAKE_FLAGS}

0 commit comments

Comments
 (0)