]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_sdl.c
R_Q1BSP_GetLightInfo now uses BSP tree recursion as an optimization for a small speed...
[xonotic/darkplaces.git] / sys_sdl.c
index bc48f44049ef53cf6a54215ddded806de7ed7c37..6f1653177c2536aa67cab1c4a039a29671a35701 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -42,10 +42,14 @@ void Sys_Error (const char *error, ...)
 #endif
 
        va_start (argptr,error);
-       vsnprintf (string, sizeof (string), error, argptr);
+       dpvsnprintf (string, sizeof (string), error, argptr);
        va_end (argptr);
        fprintf(stderr, "Error: %s\n", string);
 
+       Con_Print ("Quake Error: ");
+       Con_Print (string);
+       Con_Print ("\n");
+
        Host_Shutdown ();
        exit (1);
 }
@@ -178,14 +182,41 @@ void Sys_Sleep(int milliseconds)
        SDL_Delay(milliseconds);
 }
 
-int SDL_main (int argc, char *argv[])
+char *Sys_GetClipboardData (void)
+{
+#ifdef WIN32
+       char *data = NULL;
+       char *cliptext;
+
+       if (OpenClipboard (NULL) != 0)
+       {
+               HANDLE hClipboardData;
+
+               if ((hClipboardData = GetClipboardData (CF_TEXT)) != 0)
+               {
+                       if ((cliptext = GlobalLock (hClipboardData)) != 0) 
+                       {
+                               data = malloc (GlobalSize(hClipboardData)+1);
+                               strcpy (data, cliptext);
+                               GlobalUnlock (hClipboardData);
+                       }
+               }
+               CloseClipboard ();
+       }
+       return data;
+#else
+       return NULL;
+#endif
+}
+
+int main (int argc, char *argv[])
 {
        double frameoldtime, framenewtime;
 
        signal(SIGFPE, SIG_IGN);
 
        com_argc = argc;
-       com_argv = argv;
+       com_argv = (const char **)argv;
 
 #ifndef WIN32
        fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);