windows build fix

Я не знаю на сколько игра будет корректно работать в будущем с этими изменениями, но по крайней мере я добился того что бы оно хотя бы сбилдилось на винде под винду

билдинг я проводил из под msys2 с помощью ninja(make у меня почему то запускал обычный cmd):
Запускал `cmake` с аргументами `cmake -B build/ -G Ninja`(правда мне ещё пришлось указать путь до xxd, но скорее всего это я где то накосячил) и после `ninja` в `/build`
This commit is contained in:
Issac332 2026-04-28 19:02:02 +03:00
parent 8970eeb62e
commit 5a337f173b
4 changed files with 19 additions and 5 deletions

View file

@ -337,7 +337,11 @@ target_link_libraries(${PROJECT_NAME}
${PLATFORM_LIBRARIES}
${Ruby_LIBRARIES}
Boost::boost ${Boost_LIBRARIES}
${VORBISFILE_LIBRARIES})
${VORBISFILE_LIBRARIES}
winmm
z
)
IF(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND cmake -P "${CMAKE_SOURCE_DIR}/patches/mac/CompleteBundle.cmake" VERBATIM)

View file

@ -32,7 +32,7 @@ void _attemptLinkSdk() {
_playAnimation = (PluginPlayAnimation) GetProcAddress(hLib, "PluginPlayAnimation");
INIT_SUCCESS &= _playAnimation != NULL;
Debug() << "Plugin method @" << (long)_playAnimation;
Debug() << "Plugin method @" << reinterpret_cast<void*>(_playAnimation);
_openAnimation = (PluginOpenAnimation) GetProcAddress(hLib, "PluginOpenAnimation");
INIT_SUCCESS &= _openAnimation != NULL;

View file

@ -142,7 +142,17 @@ RB_METHOD(nikoStart)
POINT pos;
pos.x = NIKO_X;
pos.y = NIKO_Y;
ClientToScreen(syswindow.info.win.window, &pos);
// idk if shState->rtData().window will work, i inserted it here so that project would at least be build
SDL_PropertiesID props = SDL_GetWindowProperties(shState->rtData().window);
HWND hwnd = (HWND)SDL_GetPointerProperty(
props,
SDL_PROP_WINDOW_WIN32_HWND_POINTER,
NULL
);
ClientToScreen(hwnd, &pos);
// Start process
WCHAR path[MAX_PATH];
WCHAR args[MAX_PATH];

View file

@ -182,7 +182,7 @@ static void setGamePathInRegistry() {
#if defined WIN32
// this logic is currently windows specific
char* dataDir = SDL_GetBasePath();
const char* dataDir = SDL_GetBasePath();
if (dataDir){
HKEY key;
long keyOpenError = RegOpenKey(HKEY_CURRENT_USER, TEXT("Software\\OneShot\\"), &key);
@ -208,7 +208,7 @@ static void setGamePathInRegistry() {
}
RegCloseKey(key);
}
SDL_free(dataDir);
SDL_free((void*)dataDir);
}
#endif
//TODO handle this for Linux/Mac