5 extern cvar_t timestamps;
6 extern cvar_t timeformat;
8 static int sys_nostdout = false;
10 /* The translation table between the graphical font and plain ASCII --KB */
11 static char qfont_table[256] = {
12 '\0', '#', '#', '#', '#', '.', '#', '#',
13 '#', 9, 10, '#', ' ', 13, '.', '.',
14 '[', ']', '0', '1', '2', '3', '4', '5',
15 '6', '7', '8', '9', '.', '<', '=', '>',
16 ' ', '!', '"', '#', '$', '%', '&', '\'',
17 '(', ')', '*', '+', ',', '-', '.', '/',
18 '0', '1', '2', '3', '4', '5', '6', '7',
19 '8', '9', ':', ';', '<', '=', '>', '?',
20 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
21 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
22 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
23 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
24 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
25 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
26 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
27 'x', 'y', 'z', '{', '|', '}', '~', '<',
29 '<', '=', '>', '#', '#', '.', '#', '#',
30 '#', '#', ' ', '#', ' ', '>', '.', '.',
31 '[', ']', '0', '1', '2', '3', '4', '5',
32 '6', '7', '8', '9', '.', '<', '=', '>',
33 ' ', '!', '"', '#', '$', '%', '&', '\'',
34 '(', ')', '*', '+', ',', '-', '.', '/',
35 '0', '1', '2', '3', '4', '5', '6', '7',
36 '8', '9', ':', ';', '<', '=', '>', '?',
37 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
38 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
39 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
40 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
41 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
42 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
43 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
44 'x', 'y', 'z', '{', '|', '}', '~', '<'
48 extern HANDLE hinput, houtput;
51 #define MAX_PRINT_MSG 16384
52 void Sys_Printf (char *fmt, ...)
55 char start[MAX_PRINT_MSG]; // String we started with
56 char stamp[MAX_PRINT_MSG]; // Time stamp
57 char final[MAX_PRINT_MSG]; // String we print
60 struct tm *local = NULL;
67 va_start (argptr, fmt);
69 vsnprintf (start, sizeof(start), fmt, argptr);
71 vsprintf (start, fmt, argptr);
81 local = localtime (&mytime);
82 strftime (stamp, sizeof (stamp), timeformat.string, local);
84 snprintf (final, sizeof (final), "%s%s", stamp, start);
87 snprintf (final, sizeof (final), "%s", start);
89 for (p = (unsigned char *) final; *p; p++)
92 if (cls.state == ca_dedicated)
93 WriteFile(houtput, final, strlen (final), &dummy, NULL);
97 // for (p = (unsigned char *) final; *p; p++)
98 // putc (qfont_table[*p], stdout);
104 void Sys_Shared_Init(void)
106 if (COM_CheckParm("-nostdout"))
110 #if defined(__linux__)
111 fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
112 printf ("DarkPlaces Linux GL %.2f build %3i", (float) VERSION, buildnumber);
114 printf ("DarkPlaces Windows GL %.2f build %3i", (float) VERSION, buildnumber);
116 printf ("DarkPlaces Unknown GL %.2f build %3i", (float) VERSION, buildnumber);