Skip to content

Commit

Permalink
вернул x32 билд
Browse files Browse the repository at this point in the history
  • Loading branch information
HPW-dev committed Oct 3, 2024
1 parent 7f8ffe8 commit 87c72bd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
"command": "python",
"args": ["script/build-game-debug-x32.py"]
},
{
"label": "build game x32 (release)",
"type": "shell",
"command": "python",
"args": ["script/build-game-release-x32.py"]
},
{
"label": "build game (fast)",
"type": "shell",
Expand Down
15 changes: 15 additions & 0 deletions script/build-game-release-x32.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python
import helper

opts = \
' -Q enable_omp=1' \
' -Q enable_asan=0' \
' -Q host=glfw3' \
' -Q compiler=gcc' \
' -Q opt_level=stable' \
' -Q bitness=x32' \
' -Q log_mode=release'
helper.exec_cmd('scons -j15 -Q script=src/game/SConscript' + opts)
helper.exec_cmd('scons -j15 -Q script=src/plugin/graphic-effect/cxx/SConscript' + opts)
helper.rem_all("build/plugin/effect/*.a") # удалить ненужные .a файлы
helper.exec_cmd('build/bin/HPW')
2 changes: 1 addition & 1 deletion src/game/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def accept_config():
inc_path.extend([thirdparty_dir + "include/_windows_only"])
used_libs.extend(["OpenAL32.dll"])
lib_path.extend([
thirdparty_dir + "lib/yaml-cpp/",
thirdparty_dir + "lib/yaml-cpp/" + ("x64" if hpw_config.bitness == Bitness.x64 else "x32"),
thirdparty_dir + "lib/OpenAL-soft/" + ("x64" if hpw_config.bitness == Bitness.x64 else "x32"),
])
case System.linux:
Expand Down
5 changes: 5 additions & 0 deletions src/util/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ inline void std_sleep_until(const Seconds seconds)
inline void win_sleep(const Seconds seconds) { ::Sleep(seconds * 1'000); }

inline void win_htimer(const Seconds seconds) {
#ifdef is_x32
// TODO x32 версия таймера
win_sleep(seconds);
#else // x64
::LARGE_INTEGER ft;
ft.QuadPart = -static_cast<std::int64_t>(seconds * 10'000'000); // '-' using relative time
::HANDLE timer = ::CreateWaitableTimerExW(NULL, NULL,
CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS);
::SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0);
::WaitForSingleObject(timer, INFINITE);
::CloseHandle(timer);
#endif
}

inline void win_bussy_loop(const Seconds seconds, const double scale) {
Expand Down

0 comments on commit 87c72bd

Please sign in to comment.