Cmd_AddCommand(CF_SHARED, "condump", Con_ConDump_f, "output console history to a file (see also log_file)");
con_initialized = true;
-
- Con_Print("Console initialized.\n");
}
void Con_Shutdown (void)
Memory_Init_Commands();
// initialize console and logging and its cvars/commands
+ // this enables Con_Printf() messages to be coloured
Con_Init();
// initialize various cvars that could not be initialized earlier
if ((key == 'v' && KM_CTRL) || ((key == K_INS || key == K_KP_INS) && KM_SHIFT))
{
char *cbd, *p;
- if ((cbd = Sys_GetClipboardData()) != 0)
+ if ((cbd = Sys_SDL_GetClipboardData()) != 0)
{
int i;
#if 1
# note that builddate.c is very intentionally not compiled to a .o before
# being linked, because it should be recompiled every time an executable is
# built to give the executable a proper date string
-OBJ_SV= builddate.c sys_unix.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_COMMON)
+OBJ_SV= builddate.c sys_null.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_COMMON)
OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_MENU) $(OBJ_SND_COMMON) $(OBJ_SND_XMP) snd_sdl.o $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
/// (may) output text to terminal which launched program
void Sys_Print(const char *text);
+/// for the console to report failures inside Con_Printf()
void Sys_Printf(const char *fmt, ...);
/// INFO: This is only called by Host_Shutdown so we dont need testing for recursion
void Sys_ProvideSelfFD (void);
+/// Reads a line from POSIX stdin or the Windows console
char *Sys_ConsoleInput (void);
/// called to yield for a little bit so as not to hog cpu when paused or debugging
/// Perform Key_Event () callbacks until the input que is empty
void Sys_SDL_HandleEvents(void);
-char *Sys_GetClipboardData (void);
+char *Sys_SDL_GetClipboardData (void);
extern qbool sys_supportsdlgetticks;
unsigned int Sys_SDL_GetTicks (void); // wrapper to call SDL_GetTicks
--- /dev/null
+
+#include "darkplaces.h"
+
+
+// =======================================================================
+// General routines
+// =======================================================================
+
+void Sys_SDL_Shutdown(void)
+{
+}
+
+void Sys_SDL_Dialog(const char *title, const char *string)
+{
+}
+
+char *Sys_SDL_GetClipboardData (void)
+{
+ return NULL;
+}
+
+void Sys_SDL_Init(void)
+{
+}
+
+qbool sys_supportsdlgetticks = false;
+unsigned int Sys_SDL_GetTicks (void)
+{
+ Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");
+ return 0;
+}
+void Sys_SDL_Delay (unsigned int milliseconds)
+{
+ Sys_Error("Called Sys_SDL_Delay on non-SDL target");
+}
-#ifdef WIN32
-#else
-#include <sys/time.h>
-#endif
-
/*
* Include this BEFORE darkplaces.h because it breaks wrapping
* _Static_assert. Cloudwalk has no idea how or why so don't ask.
#endif
#endif
-sys_t sys;
// =======================================================================
// General routines
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, string, NULL);
}
-char *Sys_GetClipboardData (void)
+char *Sys_SDL_GetClipboardData (void)
{
char *data = NULL;
char *cliptext;
#include "thread.h"
#include "libcurl.h"
+sys_t sys;
+
static char sys_timestring[128];
char *Sys_TimeString(const char *timeformat)
{
}
if(sys_debugsleep.integer)
- Sys_Printf("sys_debugsleep: requesting %u ", microseconds);
+ Con_Printf("sys_debugsleep: requesting %u ", microseconds);
dt = Sys_DirtyTime();
// less important on newer libcurl so no need to disturb dedicated servers
dt = Sys_DirtyTime() - dt;
if(sys_debugsleep.integer)
- Sys_Printf(" got %u oversleep %d\n", (unsigned int)(dt * 1000000), (unsigned int)(dt * 1000000) - microseconds);
+ Con_Printf(" got %u oversleep %d\n", (unsigned int)(dt * 1000000), (unsigned int)(dt * 1000000) - microseconds);
return (dt < 0 || dt >= 1800) ? 0 : dt;
}
+
+/*
+===============================================================================
+
+STDIO
+
+===============================================================================
+*/
+
void Sys_Print(const char *text)
{
#ifdef __ANDROID__
#endif
}
+/// for the console to report failures inside Con_Printf()
void Sys_Printf(const char *fmt, ...)
{
va_list argptr;
Sys_Print(msg);
}
+/// Reads a line from POSIX stdin or the Windows console
char *Sys_ConsoleInput(void)
{
static char text[MAX_INPUTLINE];
}
+/*
+===============================================================================
+
+Startup and Shutdown
+
+===============================================================================
+*/
+
void Sys_Error (const char *error, ...)
{
va_list argptr;
+++ /dev/null
-
-#ifdef WIN32
-#include <windows.h>
-#include <mmsystem.h>
-#else
-#include <sys/time.h>
-#endif
-
-#include "darkplaces.h"
-
-sys_t sys;
-
-// =======================================================================
-// General routines
-// =======================================================================
-void Sys_SDL_Shutdown(void)
-{
-}
-
-void Sys_SDL_Dialog(const char *title, const char *string)
-{
-}
-
-char *Sys_GetClipboardData (void)
-{
- return NULL;
-}
-
-void Sys_SDL_Init(void)
-{
-}
-
-qbool sys_supportsdlgetticks = false;
-unsigned int Sys_SDL_GetTicks (void)
-{
- Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");
- return 0;
-}
-void Sys_SDL_Delay (unsigned int milliseconds)
-{
- Sys_Error("Called Sys_SDL_Delay on non-SDL target");
-}