1
0
Fork 0
forked from fte/fteqw

Cleanup, removal of dead code, cosmetics, etc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1185 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2005-08-01 15:08:05 +00:00
parent 625f6b8527
commit 7bdacbbaa3

View file

@ -52,9 +52,6 @@ int nostdout = 0;
char *basedir = "."; char *basedir = ".";
char *cachedir = "/tmp"; char *cachedir = "/tmp";
cvar_t sys_linerefresh = {"sys_linerefresh","0"};// set for entity display
qboolean Sys_InitTerminal (void) //we either have one or we don't. qboolean Sys_InitTerminal (void) //we either have one or we don't.
{ {
return true; return true;
@ -74,53 +71,6 @@ void Sys_DebugNumber(int y, int val)
{ {
} }
/*
void Sys_Printf (char *fmt, ...)
{
va_list argptr;
char text[1024];
va_start (argptr,fmt);
_vsnprintf (text,sizeof(text)-1, fmt,argptr);
va_end (argptr);
fprintf(stderr, "%s", text);
Con_Print (text);
}
void Sys_Printf (char *fmt, ...)
{
va_list argptr;
char text[1024], *t_p;
int l, r;
if (nostdout)
return;
va_start (argptr,fmt);
_vsnprintf (text,sizeof(text)-1, fmt,argptr);
va_end (argptr);
l = strlen(text);
t_p = text;
// make sure everything goes through, even though we are non-blocking
while (l)
{
r = write (1, text, l);
if (r != l)
sleep (0);
if (r > 0)
{
t_p += r;
l -= r;
}
}
}
*/
void Sys_Printf (char *fmt, ...) void Sys_Printf (char *fmt, ...)
{ {
va_list argptr; va_list argptr;
@ -171,11 +121,8 @@ void Sys_Error (const char *error, ...)
va_end (argptr); va_end (argptr);
fprintf(stderr, "Error: %s\n", string); fprintf(stderr, "Error: %s\n", string);
Host_Shutdown (); Host_Shutdown ();
exit (1); exit (1);
} }
void Sys_Warn (char *warning, ...) void Sys_Warn (char *warning, ...)
@ -186,6 +133,7 @@ void Sys_Warn (char *warning, ...)
va_start (argptr,warning); va_start (argptr,warning);
_vsnprintf (string,sizeof(string)-1, warning,argptr); _vsnprintf (string,sizeof(string)-1, warning,argptr);
va_end (argptr); va_end (argptr);
fprintf(stderr, "Warning: %s", string); fprintf(stderr, "Warning: %s", string);
} }
@ -211,6 +159,7 @@ void Sys_mkdir (char *path)
{ {
mkdir (path, 0777); mkdir (path, 0777);
} }
qboolean Sys_remove (char *path) qboolean Sys_remove (char *path)
{ {
return system(va("rm \"%s\"", path)); return system(va("rm \"%s\"", path));
@ -221,7 +170,6 @@ int Sys_FileOpenRead (char *path, int *handle)
int h; int h;
struct stat fileinfo; struct stat fileinfo;
h = open (path, O_RDONLY, 0666); h = open (path, O_RDONLY, 0666);
*handle = h; *handle = h;
if (h == -1) if (h == -1)
@ -239,8 +187,7 @@ int Sys_FileOpenWrite (char *path)
umask (0); umask (0);
handle = open(path,O_RDWR | O_CREAT | O_TRUNC handle = open(path,O_RDWR | O_CREAT | O_TRUNC, 0666);
, 0666);
if (handle == -1) if (handle == -1)
Sys_Error ("Error opening %s: %s", path,strerror(errno)); Sys_Error ("Error opening %s: %s", path,strerror(errno));
@ -280,35 +227,13 @@ void Sys_DebugLog(char *file, char *fmt, ...)
if (strlen(data) > sizeof(data)) if (strlen(data) > sizeof(data))
Sys_Error("Sys_DebugLog's buffer was stomped\n"); Sys_Error("Sys_DebugLog's buffer was stomped\n");
// fd = open(file, O_WRONLY | O_BINARY | O_CREAT | O_APPEND, 0666); // fd = open(file, O_WRONLY | O_BINARY | O_CREAT | O_APPEND, 0666);
fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666); fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
write(fd, data, strlen(data)); write(fd, data, strlen(data));
close(fd); close(fd);
} }
void Sys_EditFile(char *filename)
{
char cmd[256];
char *term;
char *editor;
term = getenv("TERM");
if (term && !strcmp(term, "xterm"))
{
editor = getenv("VISUAL");
if (!editor)
editor = getenv("EDITOR");
if (!editor)
editor = getenv("EDIT");
if (!editor)
editor = "vi";
sprintf(cmd, "xterm -e %s %s", editor, filename);
system(cmd);
}
}
int Sys_EnumerateFiles (char *gpath, char *match, int (*func)(char *, int, void *), void *parm) int Sys_EnumerateFiles (char *gpath, char *match, int (*func)(char *, int, void *), void *parm)
{ {
#include <dirent.h> #include <dirent.h>
@ -404,10 +329,10 @@ double Sys_DoubleTime (void)
return (tp.tv_sec - secbase) + tp.tv_usec/1000000.0; return (tp.tv_sec - secbase) + tp.tv_usec/1000000.0;
} }
void Sys_UnloadGame (void) void Sys_UnloadGame (void)
{ {
} }
void *Sys_GetGameAPI (void *parms) void *Sys_GetGameAPI (void *parms)
{ {
return NULL; return NULL;
@ -424,26 +349,18 @@ void alarm_handler(int x)
oktogo=1; oktogo=1;
} }
void Sys_LineRefresh(void)
{
}
void floating_point_exception_handler(int whatever)
{
// Sys_Warn("floating point exception\n");
signal(SIGFPE, floating_point_exception_handler);
}
char *Sys_ConsoleInput(void) char *Sys_ConsoleInput(void)
{ {
#if 0 #if 0
static char text[256]; static char text[256];
int len; int len;
if (cls.state == ca_dedicated) { if (cls.state == ca_dedicated)
{
len = read (0, text, sizeof(text)); len = read (0, text, sizeof(text));
if (len < 1) if (len < 1)
return NULL; return NULL;
text[len-1] = 0; // rip off the /n and terminate text[len-1] = 0; // rip off the /n and terminate
return text; return text;
@ -462,18 +379,14 @@ void Sys_LowFPPrecision (void)
} }
#endif #endif
int skipframes;
int main (int c, char **v) int main (int c, char **v)
{ {
double time, oldtime, newtime; double time, oldtime, newtime;
quakeparms_t parms; quakeparms_t parms;
int j; int j;
// static char cwd[1024]; // static char cwd[1024];
// signal(SIGFPE, floating_point_exception_handler);
signal(SIGFPE, SIG_IGN); signal(SIGFPE, SIG_IGN);
memset(&parms, 0, sizeof(parms)); memset(&parms, 0, sizeof(parms));
@ -488,6 +401,7 @@ int main (int c, char **v)
j = COM_CheckParm("-mem"); j = COM_CheckParm("-mem");
if (j && j+1 < com_argc) if (j && j+1 < com_argc)
parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024); parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024);
parms.membase = malloc (parms.memsize); parms.membase = malloc (parms.memsize);
parms.basedir = basedir; parms.basedir = basedir;
@ -515,7 +429,6 @@ int main (int c, char **v)
Host_Frame(time); Host_Frame(time);
oldtime = newtime; oldtime = newtime;
} }
} }