Make qfs developer prints a little more controllable.

This commit is contained in:
Bill Currie 2010-12-28 09:08:51 +09:00
parent 7946fec523
commit 6e18c3df85
2 changed files with 25 additions and 22 deletions

View file

@ -77,9 +77,12 @@ double Sys_DoubleTime (void);
void Sys_TimeOfDay(date_t *date);
void Sys_MaskPrintf (int mask, const char *fmt, ...) __attribute__((format(printf,2,3)));
#define SYS_DEV 1
#define SYS_WARN 3 // bit 0 so developer 1 will pick it up
#define SYS_VID 5
#define SYS_DEV (1|0)
#define SYS_WARN (1|2) // bit 0 so developer 1 will pick it up
#define SYS_VID (1|4)
#define SYS_FS_NF (1|8)
#define SYS_FS_F (1|16)
#define SYS_FS (1|32)
int Sys_CheckInput (int idle, int net_socket);
const char *Sys_ConsoleInput (void);

View file

@ -549,15 +549,15 @@ qfs_build_gamedir (const char **list)
gamedir->dir.maps = nva ("%s/maps", gamedir->dir.def);
qfs_gamedir = gamedir;
Sys_MaskPrintf (SYS_DEV, "%s\n", qfs_gamedir->name);
Sys_MaskPrintf (SYS_DEV, " gamedir : %s\n", qfs_gamedir->gamedir);
Sys_MaskPrintf (SYS_DEV, " path : %s\n", qfs_gamedir->path);
Sys_MaskPrintf (SYS_DEV, " gamecode: %s\n", qfs_gamedir->gamecode);
Sys_MaskPrintf (SYS_DEV, " def : %s\n", qfs_gamedir->dir.def);
Sys_MaskPrintf (SYS_DEV, " skins : %s\n", qfs_gamedir->dir.skins);
Sys_MaskPrintf (SYS_DEV, " models : %s\n", qfs_gamedir->dir.models);
Sys_MaskPrintf (SYS_DEV, " sound : %s\n", qfs_gamedir->dir.sound);
Sys_MaskPrintf (SYS_DEV, " maps : %s\n", qfs_gamedir->dir.maps);
Sys_MaskPrintf (SYS_FS, "%s\n", qfs_gamedir->name);
Sys_MaskPrintf (SYS_FS, " gamedir : %s\n", qfs_gamedir->gamedir);
Sys_MaskPrintf (SYS_FS, " path : %s\n", qfs_gamedir->path);
Sys_MaskPrintf (SYS_FS, " gamecode: %s\n", qfs_gamedir->gamecode);
Sys_MaskPrintf (SYS_FS, " def : %s\n", qfs_gamedir->dir.def);
Sys_MaskPrintf (SYS_FS, " skins : %s\n", qfs_gamedir->dir.skins);
Sys_MaskPrintf (SYS_FS, " models : %s\n", qfs_gamedir->dir.models);
Sys_MaskPrintf (SYS_FS, " sound : %s\n", qfs_gamedir->dir.sound);
Sys_MaskPrintf (SYS_FS, " maps : %s\n", qfs_gamedir->dir.maps);
qfs_process_path (qfs_gamedir->path, dir);
free (path);
Hash_DelTable (dirs);
@ -575,7 +575,7 @@ qfs_load_config (void)
if (*fs_dirconf->string) {
dirconf = Sys_ExpandSquiggle (fs_dirconf->string);
if (!(f = Qopen (dirconf, "rt")))
Sys_MaskPrintf (SYS_DEV,
Sys_MaskPrintf (SYS_FS,
"Could not load `%s', using builtin defaults\n",
dirconf);
free (dirconf);
@ -827,7 +827,7 @@ open_file (searchpath_t *search, const char *filename, QFile **gzfile,
packfile = pack_find_file (search->pack, filename);
if (packfile) {
Sys_MaskPrintf (SYS_DEV, "PackFile: %s : %s\n",
Sys_MaskPrintf (SYS_FS_F, "PackFile: %s : %s\n",
search->pack->filename, packfile->name);
// open a new file on the pakfile
if (foundname) {
@ -853,7 +853,7 @@ open_file (searchpath_t *search, const char *filename, QFile **gzfile,
return -1;
}
Sys_MaskPrintf (SYS_DEV, "FindFile: %s\n", netpath->str);
Sys_MaskPrintf (SYS_FS_F, "FindFile: %s\n", netpath->str);
*gzfile = qfs_openread (netpath->str, -1, -1, zip);
dstring_delete (netpath);
@ -882,7 +882,7 @@ _QFS_FOpenFile (const char *filename, QFile **gzfile,
// make sure they're not trying to do weird stuff with our private files
path = QFS_CompressPath (filename);
if (qfs_contains_updir(path, 1)) {
Sys_MaskPrintf (SYS_DEV,
Sys_MaskPrintf (SYS_FS,
"FindFile: %s: attempt to escape directory tree!\n",
path);
goto error;
@ -919,7 +919,7 @@ _QFS_FOpenFile (const char *filename, QFile **gzfile,
goto ok;
}
Sys_MaskPrintf (SYS_DEV, "FindFile: can't find %s\n", filename);
Sys_MaskPrintf (SYS_FS_NF, "FindFile: can't find %s\n", filename);
error:
*gzfile = NULL;
qfs_filesize = -1;
@ -1030,7 +1030,7 @@ qfs_load_pakfile (char *packfile)
pack_t *pack = pack_open (packfile);
if (pack)
Sys_MaskPrintf (SYS_DEV, "Added packfile %s (%i files)\n",
Sys_MaskPrintf (SYS_FS, "Added packfile %s (%i files)\n",
packfile, pack->numfiles);
return pack;
}
@ -1080,7 +1080,7 @@ qfs_load_gamedir (const char *dir)
char **pakfiles = NULL;
int i = 0, bufsize = 0, count = 0;
Sys_MaskPrintf (SYS_DEV, "qfs_load_gamedir (\"%s\")\n", dir);
Sys_MaskPrintf (SYS_FS, "qfs_load_gamedir (\"%s\")\n", dir);
pakfiles = calloc (1, FBLOCK_SIZE * sizeof (char *));
@ -1188,7 +1188,7 @@ qfs_add_gamedir (const char *dir)
Sys_Printf ("dropping bad directory %s\n", dir);
break;
}
Sys_MaskPrintf (SYS_DEV, "qfs_add_gamedir (\"%s\")\n",
Sys_MaskPrintf (SYS_FS, "qfs_add_gamedir (\"%s\")\n",
f_dir->str);
qfs_add_dir (f_dir->str);
@ -1198,7 +1198,7 @@ qfs_add_gamedir (const char *dir)
}
qfs_expand_userpath (f_dir, dir);
Sys_MaskPrintf (SYS_DEV, "qfs_add_gamedir (\"%s\")\n", f_dir->str);
Sys_MaskPrintf (SYS_FS, "qfs_add_gamedir (\"%s\")\n", f_dir->str);
qfs_add_dir (f_dir->str);
dstring_delete (f_dir);
@ -1413,7 +1413,7 @@ QFS_Open (const char *path, const char *mode)
int write = 0;
if (qfs_expand_userpath (full_path, path) == 0) {
Sys_MaskPrintf (SYS_DEV, "QFS_Open: %s %s\n", full_path->str, mode);
Sys_MaskPrintf (SYS_FS, "QFS_Open: %s %s\n", full_path->str, mode);
for (m = mode; *m; m++)
if (*m == 'w' || *m == '+' || *m == 'a')
write = 1;