mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-19 13:51:16 +00:00
SDL3 fixes (#31)
This commit is contained in:
parent
c0bd989dc5
commit
be12560248
@ -179,8 +179,8 @@ MxS32 IsleApp::SetupLegoOmni()
|
|||||||
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
|
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
|
||||||
|
|
||||||
// [library:window] For now, get the underlying Windows HWND to pass into Omni
|
// [library:window] For now, get the underlying Windows HWND to pass into Omni
|
||||||
HWND hwnd =
|
HWND hwnd = (HWND
|
||||||
(HWND) SDL_GetProperty(SDL_GetWindowProperties(m_windowHandle), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
|
) SDL_GetPointerProperty(SDL_GetWindowProperties(m_windowHandle), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
|
||||||
|
|
||||||
#ifdef COMPAT_MODE
|
#ifdef COMPAT_MODE
|
||||||
MxS32 failure;
|
MxS32 failure;
|
||||||
@ -512,7 +512,6 @@ MxResult IsleApp::SetupWindow()
|
|||||||
// FUNCTION: ISLE 0x4028d0
|
// FUNCTION: ISLE 0x4028d0
|
||||||
void IsleApp::LoadConfig()
|
void IsleApp::LoadConfig()
|
||||||
{
|
{
|
||||||
char* basePath = SDL_GetBasePath();
|
|
||||||
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
||||||
char* iniConfig;
|
char* iniConfig;
|
||||||
if (m_iniPath) {
|
if (m_iniPath) {
|
||||||
@ -528,7 +527,7 @@ void IsleApp::LoadConfig()
|
|||||||
|
|
||||||
dictionary* dict = iniparser_load(iniConfig);
|
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];
|
m_hdPath = new char[strlen(hdPath) + 1];
|
||||||
strcpy(m_hdPath, hdPath);
|
strcpy(m_hdPath, hdPath);
|
||||||
MxOmni::SetHD(m_hdPath);
|
MxOmni::SetHD(m_hdPath);
|
||||||
@ -581,7 +580,6 @@ void IsleApp::LoadConfig()
|
|||||||
iniparser_freedict(dict);
|
iniparser_freedict(dict);
|
||||||
delete[] iniConfig;
|
delete[] iniConfig;
|
||||||
SDL_free(prefPath);
|
SDL_free(prefPath);
|
||||||
SDL_free(basePath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: ISLE 0x402c20
|
// FUNCTION: ISLE 0x402c20
|
||||||
|
|||||||
@ -35,5 +35,5 @@ void MxSemaphore::Wait()
|
|||||||
void MxSemaphore::Release()
|
void MxSemaphore::Release()
|
||||||
{
|
{
|
||||||
// [library:synchronization] Removed release count since only 1 is ever requested
|
// [library:synchronization] Removed release count since only 1 is ever requested
|
||||||
SDL_PostSemaphore(m_semaphore);
|
SDL_SignalSemaphore(m_semaphore);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,8 @@ MxResult MxThread::Start(MxS32 p_stack, MxS32 p_flag)
|
|||||||
|
|
||||||
if (m_semaphore.Init(0, 1) == SUCCESS) {
|
if (m_semaphore.Init(0, 1) == SUCCESS) {
|
||||||
const SDL_PropertiesID props = SDL_CreateProperties();
|
const SDL_PropertiesID props = SDL_CreateProperties();
|
||||||
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void*) MxThread::ThreadProc);
|
SDL_SetPointerProperty(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_USERDATA_POINTER, this);
|
||||||
SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, p_stack << 2);
|
SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, p_stack << 2);
|
||||||
|
|
||||||
if ((m_thread = SDL_CreateThreadWithProperties(props))) {
|
if ((m_thread = SDL_CreateThreadWithProperties(props))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user