--- hatari/src/gui-osx/Shared.m 2019/04/01 07:13:04 1.1.1.1 +++ hatari/src/gui-osx/Shared.m 2019/04/09 08:49:22 1.1.1.5 @@ -26,13 +26,13 @@ [window setDelegate:self]; // Change emulation and UI state - GuiOsx_PauseAndSwitchToCocoaUI(); + GuiOsx_Pause(); // Run it as modal [NSApp runModalForWindow:window]; // Restore emulation and UI state - GuiOsx_ResumeFromCocoaUI(); + GuiOsx_Resume(); } // On closure of the NSWindow, end the modal session @@ -60,7 +60,7 @@ void GuiOsx_ExportPathString(NSString* p NSCAssert((cchTarget > 0), @"Target buffer size must be greater than zero."); // Copy the string - strncpy(szTarget, [[path stringByExpandingTildeInPath] cString], cchTarget); + strncpy(szTarget, [[path stringByExpandingTildeInPath] cStringUsingEncoding:[NSString defaultCStringEncoding]], cchTarget); // Make sure it is null terminated (as strncpy does not null-terminate if the buffer is too small) szTarget[cchTarget - 1] = 0; @@ -68,30 +68,20 @@ void GuiOsx_ExportPathString(NSString* p /*-----------------------------------------------------------------------*/ /* - Pauses emulation and gets ready to use Cocoa UI + Pauses emulation */ -void GuiOsx_PauseAndSwitchToCocoaUI() +void GuiOsx_Pause(void) { // Pause emulation - Main_PauseEmulation(); - - // Enable the alert hooks, so that any messages are shown in Cocoa alerts instead of SDL alerts -#ifdef ALERT_HOOKS - useAlertHooks = TRUE; -#endif + Main_PauseEmulation(false); } /*-----------------------------------------------------------------------*/ /* - Switches back to emulation mode and resume emulation + Switches back to emulation mode */ -void GuiOsx_ResumeFromCocoaUI() +void GuiOsx_Resume(void) { - // Disable the alert hooks, so that SDL handle messages -#ifdef ALERT_HOOKS - useAlertHooks = FALSE; -#endif - // Resume emulation Main_UnPauseEmulation(); }