Overhaul to console structure, a bit
This commit is contained in:
+40
-40
@@ -178,7 +178,7 @@ static byte *Mod_DecompressVis (byte *in, qmodel_t *model)
|
||||
{
|
||||
if(!model->viswarn) {
|
||||
model->viswarn = true;
|
||||
Con_Warning("Mod_DecompressVis: output overrun on model \"%s\"\n", model->name);
|
||||
console::warn("Mod_DecompressVis: output overrun on model \"%s\"\n", model->name);
|
||||
}
|
||||
return mod_decompressed;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ static void Mod_LoadTextures (lump_t *l)
|
||||
//johnfitz -- don't return early if no textures; still need to create dummy texture
|
||||
if (!l->filelen)
|
||||
{
|
||||
Con_Printf ("Mod_LoadTextures: no textures in bsp file\n");
|
||||
console::info ("Mod_LoadTextures: no textures in bsp file\n");
|
||||
nummiptex = 0;
|
||||
m = NULL; // avoid bogus compiler warning
|
||||
}
|
||||
@@ -499,14 +499,14 @@ static void Mod_LoadTextures (lump_t *l)
|
||||
|
||||
if (mt->width == 0 || mt->height == 0)
|
||||
{
|
||||
Con_Warning ("Zero sized texture %s in %s!\n", mt->name, loadmodel->name);
|
||||
console::warn ("Zero sized texture %s in %s!\n", mt->name, loadmodel->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( (mt->width & 15) || (mt->height & 15) )
|
||||
{
|
||||
if (loadmodel->bspversion != BSPVERSION_QUAKE64)
|
||||
Con_Warning ("Texture %s (%d x %d) is not 16 aligned\n", mt->name, mt->width, mt->height);
|
||||
console::warn ("Texture %s (%d x %d) is not 16 aligned\n", mt->name, mt->width, mt->height);
|
||||
}
|
||||
|
||||
pixels = mt->width*mt->height; // only copy the first mip, the rest are auto-generated
|
||||
@@ -524,7 +524,7 @@ static void Mod_LoadTextures (lump_t *l)
|
||||
// the end of the .bsp file buffer
|
||||
if (((byte*)(mt+1) + pixels) > (mod_base + l->fileofs + l->filelen))
|
||||
{
|
||||
Con_DPrintf("Texture %s extends past end of lump\n", mt->name);
|
||||
console::debug("Texture %s extends past end of lump\n", mt->name);
|
||||
pixels = std::max(0L, (long)((mod_base + l->fileofs + l->filelen) - (byte*)(mt+1)));
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ static void Mod_LoadLighting (lump_t *l)
|
||||
if (path_id < loadmodel->path_id)
|
||||
{
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_DPrintf("ignored %s from a gamedir with lower priority\n", litfilename);
|
||||
console::debug("ignored %s from a gamedir with lower priority\n", litfilename);
|
||||
}
|
||||
else
|
||||
if (data[0] == 'Q' && data[1] == 'L' && data[2] == 'I' && data[3] == 'T')
|
||||
@@ -797,23 +797,23 @@ static void Mod_LoadLighting (lump_t *l)
|
||||
{
|
||||
if (8+l->filelen*3 == com_filesize)
|
||||
{
|
||||
Con_DPrintf2("%s loaded\n", litfilename);
|
||||
console::trace("%s loaded\n", litfilename);
|
||||
loadmodel->lightdata = data + 8;
|
||||
return;
|
||||
}
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_Printf("Outdated .lit file (%s should be %u bytes, not %u)\n", litfilename, 8+l->filelen*3, com_filesize);
|
||||
console::info("Outdated .lit file (%s should be %u bytes, not %u)\n", litfilename, 8+l->filelen*3, com_filesize);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_Printf("Unknown .lit file version (%d)\n", i);
|
||||
console::info("Unknown .lit file version (%d)\n", i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_Printf("Corrupt .lit file (old version?), ignoring\n");
|
||||
console::info("Corrupt .lit file (old version?), ignoring\n");
|
||||
}
|
||||
}
|
||||
// LordHavoc: no .lit found, expand the white lighting data to color
|
||||
@@ -900,13 +900,13 @@ static void Mod_LoadEntities (lump_t *l)
|
||||
COM_StripExtension(basemapname, basemapname, sizeof(basemapname));
|
||||
|
||||
q_snprintf(entfilename, sizeof(entfilename), "%s@%04x.ent", basemapname, crc);
|
||||
Con_DPrintf2("trying to load %s\n", entfilename);
|
||||
console::trace("trying to load %s\n", entfilename);
|
||||
ents = (char *) COM_LoadHunkFile (entfilename, &path_id);
|
||||
|
||||
if (!ents)
|
||||
{
|
||||
q_snprintf(entfilename, sizeof(entfilename), "%s.ent", basemapname);
|
||||
Con_DPrintf2("trying to load %s\n", entfilename);
|
||||
console::trace("trying to load %s\n", entfilename);
|
||||
ents = (char *) COM_LoadHunkFile (entfilename, &path_id);
|
||||
}
|
||||
|
||||
@@ -917,12 +917,12 @@ static void Mod_LoadEntities (lump_t *l)
|
||||
if (path_id < loadmodel->path_id)
|
||||
{
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_DPrintf("ignored %s from a gamedir with lower priority\n", entfilename);
|
||||
console::debug("ignored %s from a gamedir with lower priority\n", entfilename);
|
||||
}
|
||||
else
|
||||
{
|
||||
loadmodel->entities = ents;
|
||||
Con_DPrintf("Loaded external entity file %s\n", entfilename);
|
||||
console::debug("Loaded external entity file %s\n", entfilename);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1067,7 +1067,7 @@ static void Mod_LoadTexinfo (lump_t *l)
|
||||
|
||||
//johnfitz: report missing textures
|
||||
if (missing && loadmodel->numtextures > 1)
|
||||
Con_Printf ("Mod_LoadTexinfo: %d texture(s) missing from BSP file\n", missing);
|
||||
console::info ("Mod_LoadTexinfo: %d texture(s) missing from BSP file\n", missing);
|
||||
//johnfitz
|
||||
}
|
||||
|
||||
@@ -1248,7 +1248,7 @@ static void Mod_LoadFaces (lump_t *l, bool bsp2)
|
||||
|
||||
//johnfitz -- warn mappers about exceeding old limits
|
||||
if (count > 32767 && !bsp2)
|
||||
Con_DWarning ("%i faces exceeds standard limit of 32767.\n", count);
|
||||
console::dev_warn ("%i faces exceeds standard limit of 32767.\n", count);
|
||||
//johnfitz
|
||||
|
||||
loadmodel->surfaces = out;
|
||||
@@ -1283,7 +1283,7 @@ static void Mod_LoadFaces (lump_t *l, bool bsp2)
|
||||
|
||||
out->flags = 0;
|
||||
if (out->numedges < 3)
|
||||
Con_Warning("surfnum %d: bad numedges %d\n", surfnum, out->numedges);
|
||||
console::warn("surfnum %d: bad numedges %d\n", surfnum, out->numedges);
|
||||
|
||||
if (side)
|
||||
out->flags |= SURF_PLANEBACK;
|
||||
@@ -1318,7 +1318,7 @@ static void Mod_LoadFaces (lump_t *l, bool bsp2)
|
||||
out->flags |= SURF_DRAWTILED;
|
||||
else if (out->samples && !loadmodel->haslitwater)
|
||||
{
|
||||
Con_DPrintf ("Map has lit water\n");
|
||||
console::debug ("Map has lit water\n");
|
||||
loadmodel->haslitwater = true;
|
||||
}
|
||||
|
||||
@@ -1393,7 +1393,7 @@ static void Mod_LoadNodes_S (lump_t *l)
|
||||
|
||||
//johnfitz -- warn mappers about exceeding old limits
|
||||
if (count > 32767)
|
||||
Con_DWarning ("%i nodes exceeds standard limit of 32767.\n", count);
|
||||
console::dev_warn ("%i nodes exceeds standard limit of 32767.\n", count);
|
||||
//johnfitz
|
||||
|
||||
loadmodel->nodes = out;
|
||||
@@ -1426,7 +1426,7 @@ static void Mod_LoadNodes_S (lump_t *l)
|
||||
out->children[j] = (mnode_t *)(loadmodel->leafs + p);
|
||||
else
|
||||
{
|
||||
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
|
||||
console::info("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
|
||||
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
|
||||
}
|
||||
}
|
||||
@@ -1478,7 +1478,7 @@ static void Mod_LoadNodes_L1 (lump_t *l)
|
||||
out->children[j] = (mnode_t *)(loadmodel->leafs + p);
|
||||
else
|
||||
{
|
||||
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
|
||||
console::info("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
|
||||
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
|
||||
}
|
||||
}
|
||||
@@ -1530,7 +1530,7 @@ static void Mod_LoadNodes_L2 (lump_t *l)
|
||||
out->children[j] = (mnode_t *)(loadmodel->leafs + p);
|
||||
else
|
||||
{
|
||||
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
|
||||
console::info("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
|
||||
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
|
||||
}
|
||||
}
|
||||
@@ -1736,7 +1736,7 @@ static void Mod_LoadClipnodes (lump_t *l, bool bsp2)
|
||||
|
||||
//johnfitz -- warn about exceeding old limits
|
||||
if (count > 32767 && !bsp2)
|
||||
Con_DWarning ("%i clipnodes exceeds standard limit of 32767.\n", count);
|
||||
console::dev_warn ("%i clipnodes exceeds standard limit of 32767.\n", count);
|
||||
//johnfitz
|
||||
|
||||
loadmodel->clipnodes = out;
|
||||
@@ -1890,7 +1890,7 @@ static void Mod_LoadMarksurfaces (lump_t *l, int bsp2)
|
||||
|
||||
//johnfitz -- warn mappers about exceeding old limits
|
||||
if (count > 32767)
|
||||
Con_DWarning ("%i marksurfaces exceeds standard limit of 32767.\n", count);
|
||||
console::dev_warn ("%i marksurfaces exceeds standard limit of 32767.\n", count);
|
||||
//johnfitz
|
||||
|
||||
for (i=0 ; i<count ; i++)
|
||||
@@ -2022,7 +2022,7 @@ static void Mod_LoadSubmodels (lump_t *l)
|
||||
out = loadmodel->submodels;
|
||||
|
||||
if (out->visleafs > 8192)
|
||||
Con_DWarning ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs);
|
||||
console::dev_warn ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs);
|
||||
//johnfitz
|
||||
}
|
||||
|
||||
@@ -2102,23 +2102,23 @@ static FILE *Mod_FindVisibilityExternal(void)
|
||||
q_snprintf(visfilename, sizeof(visfilename), "maps/%s.vis", loadname);
|
||||
if (COM_FOpenFile(visfilename, &f, &path_id) < 0)
|
||||
{
|
||||
Con_DPrintf("%s not found, trying ", visfilename);
|
||||
console::debug("%s not found, trying ", visfilename);
|
||||
q_snprintf(visfilename, sizeof(visfilename), "%s.vis", COM_SkipPath(com_gamedir));
|
||||
Con_DPrintf("%s\n", visfilename);
|
||||
console::debug("%s\n", visfilename);
|
||||
if (COM_FOpenFile(visfilename, &f, &path_id) < 0)
|
||||
{
|
||||
Con_DPrintf("external vis not found\n");
|
||||
console::debug("external vis not found\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (path_id < loadmodel->path_id)
|
||||
{
|
||||
fclose(f);
|
||||
Con_DPrintf("ignored %s from a gamedir with lower priority\n", visfilename);
|
||||
console::debug("ignored %s from a gamedir with lower priority\n", visfilename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Con_DPrintf("Found external VIS %s\n", visfilename);
|
||||
console::debug("Found external VIS %s\n", visfilename);
|
||||
|
||||
shortname = COM_SkipPath(loadmodel->name);
|
||||
pos = 0;
|
||||
@@ -2136,7 +2136,7 @@ static FILE *Mod_FindVisibilityExternal(void)
|
||||
}
|
||||
if (r != VISPATCH_HEADER_LEN) {
|
||||
fclose(f);
|
||||
Con_DPrintf("%s not found in %s\n", shortname, visfilename);
|
||||
console::debug("%s not found in %s\n", shortname, visfilename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2152,7 +2152,7 @@ static byte *Mod_LoadVisibilityExternal(FILE* f)
|
||||
if (!fread(&filelen, 4, 1, f)) return NULL;
|
||||
filelen = LittleLong(filelen);
|
||||
if (filelen <= 0) return NULL;
|
||||
Con_DPrintf("...%d bytes visibility data\n", filelen);
|
||||
console::debug("...%d bytes visibility data\n", filelen);
|
||||
visdata = (byte *) Hunk_AllocName(filelen, "EXT_VIS");
|
||||
if (!fread(visdata, filelen, 1, f))
|
||||
return NULL;
|
||||
@@ -2168,7 +2168,7 @@ static void Mod_LoadLeafsExternal(FILE* f)
|
||||
if (!fread(&filelen, 4, 1, f)) return;
|
||||
filelen = LittleLong(filelen);
|
||||
if (filelen <= 0) return;
|
||||
Con_DPrintf("...%d bytes leaf data\n", filelen);
|
||||
console::debug("...%d bytes leaf data\n", filelen);
|
||||
in = Hunk_AllocName(filelen, "EXT_LEAF");
|
||||
if (!fread(in, filelen, 1, f))
|
||||
return;
|
||||
@@ -2234,13 +2234,13 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
|
||||
if (mod->bspversion == BSPVERSION && external_vis.value && sv.modelname[0] && !q_strcasecmp(loadname, sv.name))
|
||||
{
|
||||
FILE* fvis;
|
||||
Con_DPrintf("trying to open external vis file\n");
|
||||
console::debug("trying to open external vis file\n");
|
||||
fvis = Mod_FindVisibilityExternal();
|
||||
if (fvis) {
|
||||
int mark = Hunk_LowMark();
|
||||
loadmodel->leafs = NULL;
|
||||
loadmodel->numleafs = 0;
|
||||
Con_DPrintf("found valid external .vis file for map\n");
|
||||
console::debug("found valid external .vis file for map\n");
|
||||
loadmodel->visdata = Mod_LoadVisibilityExternal(fvis);
|
||||
if (loadmodel->visdata) {
|
||||
Mod_LoadLeafsExternal(fvis);
|
||||
@@ -2250,7 +2250,7 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
|
||||
goto visdone;
|
||||
}
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_DPrintf("External VIS data failed, using standard vis.\n");
|
||||
console::debug("External VIS data failed, using standard vis.\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2781,7 +2781,7 @@ static void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
|
||||
pheader->skinheight = LittleLong (pinmodel->skinheight);
|
||||
|
||||
if (pheader->skinheight > MAX_LBM_HEIGHT)
|
||||
Con_DWarning ("model %s has a skin taller than %d", mod->name,
|
||||
console::dev_warn ("model %s has a skin taller than %d", mod->name,
|
||||
MAX_LBM_HEIGHT);
|
||||
|
||||
pheader->numverts = LittleLong (pinmodel->numverts);
|
||||
@@ -3084,11 +3084,11 @@ static void Mod_Print (void)
|
||||
int i;
|
||||
qmodel_t *mod;
|
||||
|
||||
Con_SafePrintf ("Cached models:\n"); //johnfitz -- safeprint instead of print
|
||||
console::safe_print ("Cached models:\n"); //johnfitz -- safeprint instead of print
|
||||
for (i=0, mod=mod_known ; i < mod_numknown ; i++, mod++)
|
||||
{
|
||||
Con_SafePrintf ("%8p : %s\n", mod->cache.data, mod->name); //johnfitz -- safeprint instead of print
|
||||
console::safe_print ("%8p : %s\n", mod->cache.data, mod->name); //johnfitz -- safeprint instead of print
|
||||
}
|
||||
Con_Printf ("%i models\n",mod_numknown); //johnfitz -- print the total too
|
||||
console::info ("%i models\n",mod_numknown); //johnfitz -- print the total too
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user