X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=sys_sdl.c;h=d3564bac89fb0a76a699f9da6ddd092ef9b213ed;hb=9aa980a4b04477b881d75285469885a82281be61;hp=7bfb041f6c7345cf919d649cfbe3eb0a4b374bc3;hpb=f56e47c2febca63f8bdd3356e3a2574417973282;p=xonotic%2Fdarkplaces.git diff --git a/sys_sdl.c b/sys_sdl.c index 7bfb041f..d3564bac 100644 --- a/sys_sdl.c +++ b/sys_sdl.c @@ -67,6 +67,10 @@ void Sys_Error (const char *error, ...) Con_Printf ("Quake Error: %s\n", string); +#ifdef WIN32 + MessageBox(NULL, string, "Quake Error", MB_OK | MB_SETFOREGROUND | MB_ICONSTOP); +#endif + Host_Shutdown (); exit (1); } @@ -169,7 +173,21 @@ char *Sys_ConsoleInput(void) char *Sys_GetClipboardData (void) { -#ifdef WIN32 +#if SDL_MAJOR_VERSION != 1 + char *data = NULL; + char *cliptext; + + cliptext = SDL_GetClipboardText(); + if (cliptext != NULL) { + size_t allocsize; + allocsize = strlen(cliptext) + 1; + data = (char *)Z_Malloc (allocsize); + strlcpy (data, cliptext, allocsize); + SDL_free(cliptext); + } + + return data; +#elif defined(WIN32) char *data = NULL; char *cliptext;