--- hatari/src/gui-osx/Shared.m 2019/04/01 07:14:42 1.1.1.2 +++ hatari/src/gui-osx/Shared.m 2019/04/09 08:51:01 1.1.1.6 @@ -1,5 +1,5 @@ /* - Hatari - CreateFloppyController.m + Hatari - Shared.m This file is distributed under the GNU Public License, version 2 or at your option any later version. Read the file gpl.txt for details. @@ -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(FALSE); - - // 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(); }