Overhaul to console structure, a bit

This commit is contained in:
iikorni
2026-08-30 00:50:23 -05:00
parent de75b014b3
commit 216dd1aecd
70 changed files with 2081 additions and 2260 deletions
+28 -28
View File
@@ -689,7 +689,7 @@ void *SZ_GetSpace(sizebuf_t *buf, int length) {
Sys_Error("SZ_GetSpace: %i is > full buffer size", length);
buf->overflowed = true;
Con_Printf("SZ_GetSpace: overflow\n");
console::info("SZ_GetSpace: overflow\n");
SZ_Clear(buf);
}
@@ -1069,7 +1069,7 @@ static void COM_CheckRegistered(void) {
if (h == -1) {
convar::set_rom("registered", "0");
Con_Printf("Playing shareware version.\n");
console::info("Playing shareware version.\n");
if (com_modified)
Sys_Error("You must have the registered version to use modified games.\n\n"
"Basedir is: %s\n\n"
@@ -1098,7 +1098,7 @@ static void COM_CheckRegistered(void) {
convar::set_rom("cmdline", &com_cmdline[i]);
convar::set_rom("registered", "1");
Con_Printf("Playing registered version.\n");
console::info("Playing registered version.\n");
}
@@ -1129,7 +1129,7 @@ void COM_InitArgv(int argc, char **argv) {
if (n > 0 && com_cmdline[n - 1] == ' ')
com_cmdline[n - 1] = 0; //johnfitz -- kill the trailing space
Con_Printf("Command line: %s\n", com_cmdline);
console::info("Command line: %s\n", com_cmdline);
for (com_argc = 0; (com_argc < MAX_NUM_ARGVS) && (com_argc < argc); com_argc++) {
largv[com_argc] = argv[com_argc];
@@ -1226,12 +1226,12 @@ COM_Path_f
static void COM_Path_f(void) {
searchpath_t *s;
Con_Printf("Current search path:\n");
console::info("Current search path:\n");
for (s = com_searchpaths; s; s = s->next) {
if (s->pack) {
Con_Printf("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
console::info("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
} else
Con_Printf("%s\n", s->filename);
console::info("%s\n", s->filename);
}
}
@@ -1380,8 +1380,8 @@ static int COM_FindFile(const char *filename, int *handle, FILE **file,
&& strcmp(COM_FileGetExtension(filename), "lit") != 0
&& strcmp(COM_FileGetExtension(filename), "vis") != 0
&& strcmp(COM_FileGetExtension(filename), "ent") != 0)
Con_DPrintf("FindFile: can't find %s\n", filename);
else Con_DPrintf2("FindFile: can't find %s\n", filename);
console::debug("FindFile: can't find %s\n", filename);
else console::trace("FindFile: can't find %s\n", filename);
if (handle)
*handle = -1;
@@ -1760,22 +1760,22 @@ static void COM_Game_f(void) {
if (!registered.value) //disable shareware quake
{
Con_Printf("You must have the registered version to use modified games\n");
console::info("You must have the registered version to use modified games\n");
return;
}
if (!*p || !strcmp(p, ".") || strstr(p, "..") || strstr(p, "/") || strstr(p, "\\") || strstr(p, ":")) {
Con_Printf("gamedir should be a single directory name, not a path\n");
console::info("gamedir should be a single directory name, not a path\n");
return;
}
if (*p2) {
if (strcmp(p2, "-hipnotic") && strcmp(p2, "-rogue") && strcmp(p2, "-quoth")) {
Con_Printf("invalid mission pack argument to \"game\"\n");
console::info("invalid mission pack argument to \"game\"\n");
return;
}
if (!q_strcasecmp(p, GAMENAME)) {
Con_Printf("no mission pack arguments to %s game\n", GAMENAME);
console::info("no mission pack arguments to %s game\n", GAMENAME);
return;
}
}
@@ -1783,7 +1783,7 @@ static void COM_Game_f(void) {
if (Sys_FileType(va("%s/%s", com_basedir, p)) != FS_ENT_DIRECTORY) {
if (host_parms->userdir == host_parms->basedir || (
Sys_FileType(va("%s/%s", host_parms->userdir, p)) != FS_ENT_DIRECTORY)) {
Con_Printf("No such game directory \"%s\"\n", p);
console::info("No such game directory \"%s\"\n", p);
return;
}
}
@@ -1797,13 +1797,13 @@ static void COM_Game_f(void) {
// as '-missionpack', otherwise would be a mess
if (!q_strcasecmp(p, &p2[1]))
goto _same;
Con_Printf("reloading game \"%s\" with \"%s\" support\n", p, &p2[1]);
console::info("reloading game \"%s\" with \"%s\" support\n", p, &p2[1]);
} else if (!*p2 && com_searchpaths->path_id > 2)
Con_Printf("reloading game \"%s\" without mission pack support\n", p);
console::info("reloading game \"%s\" without mission pack support\n", p);
else goto _same;
} else {
_same:
Con_Printf("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir));
console::info("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir));
return;
}
}
@@ -1874,13 +1874,13 @@ static void COM_Game_f(void) {
Host_Resetdemos();
DemoList_Rebuild();
Con_Printf("\"game\" changed to \"%s\"\n", COM_SkipPath(com_gamedir));
console::info("\"game\" changed to \"%s\"\n", COM_SkipPath(com_gamedir));
VID_Lock();
command::buffer::add_text("exec quake.rc\n");
command::buffer::add_text("vid_unlock\n");
} else //Diplay the current gamedir
Con_Printf("\"game\" is \"%s\"\n", COM_SkipPath(com_gamedir));
console::info("\"game\" is \"%s\"\n", COM_SkipPath(com_gamedir));
}
/*
@@ -2208,7 +2208,7 @@ void LOC_LoadFile(const char *file) {
if (!file || !*file)
return;
Con_Printf("\nLanguage initialization\n");
console::info("\nLanguage initialization\n");
memset(&archive, 0, sizeof(archive));
q_snprintf(path, sizeof(path), "%s/%s", com_basedir, file);
@@ -2249,7 +2249,7 @@ void LOC_LoadFile(const char *file) {
mz_zip_reader_end(&archive);
if (rw)
SDL_RWclose(rw);
Con_Printf("Couldn't load '%s'\nfrom '%s'\n", file, com_basedir);
console::info("Couldn't load '%s'\nfrom '%s'\n", file, com_basedir);
return;
}
SDL_RWread(rw, localization.text, 1, sz);
@@ -2284,7 +2284,7 @@ void LOC_LoadFile(const char *file) {
if (line[0] == '/') {
if (line[1] != '/')
Con_DPrintf("LOC_LoadFile: malformed comment on line %d\n", lineno);
console::debug("LOC_LoadFile: malformed comment on line %d\n", lineno);
} else if (equals) {
char *key_end = equals;
bool leading_quote;
@@ -2333,7 +2333,7 @@ void LOC_LoadFile(const char *file) {
break;
default:
Con_Printf("LOC_LoadFile: unrecognized escape sequence \\%c on line %d\n", c, lineno);
console::info("LOC_LoadFile: unrecognized escape sequence \\%c on line %d\n", c, lineno);
*value_dst++ = c;
break;
}
@@ -2379,7 +2379,7 @@ void LOC_LoadFile(const char *file) {
localization.numindices = localization.numentries * 2; // 50% load factor
if (localization.numindices == 0) {
Con_Printf("No localized strings in file '%s'\n", file);
console::info("No localized strings in file '%s'\n", file);
return;
}
@@ -2406,7 +2406,7 @@ void LOC_LoadFile(const char *file) {
}
}
Con_Printf("Loaded %d strings from '%s'\n", localization.numentries, file);
console::info("Loaded %d strings from '%s'\n", localization.numentries, file);
}
/*
@@ -2538,7 +2538,7 @@ size_t LOC_Format(const char *format, const char * (*getarg_fn)(int idx, void *u
int numargs = 0;
if (!len) {
Con_DPrintf("LOC_Format: no output space\n");
console::debug("LOC_Format: no output space\n");
return 0;
}
--len; // reserve space for the terminator
@@ -2559,7 +2559,7 @@ size_t LOC_Format(const char *format, const char * (*getarg_fn)(int idx, void *u
insert_len = std::strlen(insert);
if (insert_len > space_left) {
Con_DPrintf("LOC_Format: overflow at argument #%d\n", numargs);
console::debug("LOC_Format: overflow at argument #%d\n", numargs);
insert_len = space_left;
}
@@ -2568,7 +2568,7 @@ size_t LOC_Format(const char *format, const char * (*getarg_fn)(int idx, void *u
}
if (*format)
Con_DPrintf("LOC_Format: overflow\n");
console::debug("LOC_Format: overflow\n");
out[written] = 0;