SDL3 fixes (#31)

This commit is contained in:
Christian Semmler 2024-07-28 10:18:01 -07:00 committed by GitHub
parent c0bd989dc5
commit be12560248
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 8 deletions

View File

@ -179,8 +179,8 @@ MxS32 IsleApp::SetupLegoOmni()
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
// [library:window] For now, get the underlying Windows HWND to pass into Omni
HWND hwnd =
(HWND) SDL_GetProperty(SDL_GetWindowProperties(m_windowHandle), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
HWND hwnd = (HWND
) SDL_GetPointerProperty(SDL_GetWindowProperties(m_windowHandle), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
#ifdef COMPAT_MODE
MxS32 failure;
@ -512,7 +512,6 @@ MxResult IsleApp::SetupWindow()
// FUNCTION: ISLE 0x4028d0
void IsleApp::LoadConfig()
{
char* basePath = SDL_GetBasePath();
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
char* iniConfig;
if (m_iniPath) {
@ -528,7 +527,7 @@ void IsleApp::LoadConfig()
dictionary* dict = iniparser_load(iniConfig);
const char* hdPath = iniparser_getstring(dict, "isle:diskpath", basePath);
const char* hdPath = iniparser_getstring(dict, "isle:diskpath", SDL_GetBasePath());
m_hdPath = new char[strlen(hdPath) + 1];
strcpy(m_hdPath, hdPath);
MxOmni::SetHD(m_hdPath);
@ -581,7 +580,6 @@ void IsleApp::LoadConfig()
iniparser_freedict(dict);
delete[] iniConfig;
SDL_free(prefPath);
SDL_free(basePath);
}
// FUNCTION: ISLE 0x402c20

View File

@ -35,5 +35,5 @@ void MxSemaphore::Wait()
void MxSemaphore::Release()
{
// [library:synchronization] Removed release count since only 1 is ever requested
SDL_PostSemaphore(m_semaphore);
SDL_SignalSemaphore(m_semaphore);
}

View File

@ -28,8 +28,8 @@ MxResult MxThread::Start(MxS32 p_stack, MxS32 p_flag)
if (m_semaphore.Init(0, 1) == SUCCESS) {
const SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void*) MxThread::ThreadProc);
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, this);
SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void*) MxThread::ThreadProc);
SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, this);
SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, p_stack << 2);
if ((m_thread = SDL_CreateThreadWithProperties(props))) {