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
+15 -15
View File
@@ -107,32 +107,32 @@ sfxcache_t *S_LoadSound (sfx_t *s)
if (sc)
return sc;
// Con_Printf ("S_LoadSound: %x\n", (int)stackbuf);
// console::info ("S_LoadSound: %x\n", (int)stackbuf);
// load it in
q_strlcpy(namebuffer, "sound/", sizeof(namebuffer));
q_strlcat(namebuffer, s->name, sizeof(namebuffer));
// Con_Printf ("loading %s\n",namebuffer);
// console::info ("loading %s\n",namebuffer);
data = COM_LoadStackFile(namebuffer, stackbuf, sizeof(stackbuf), NULL);
if (!data)
{
Con_Printf ("Couldn't load %s\n", namebuffer);
console::info ("Couldn't load %s\n", namebuffer);
return NULL;
}
info = GetWavinfo (s->name, data, com_filesize);
if (info.channels != 1)
{
Con_Printf ("%s is a stereo sample\n",s->name);
console::info ("%s is a stereo sample\n",s->name);
return NULL;
}
if (info.width != 1 && info.width != 2)
{
Con_Printf("%s is not 8 or 16 bit\n", s->name);
console::info("%s is not 8 or 16 bit\n", s->name);
return NULL;
}
@@ -143,7 +143,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
if (info.samples == 0 || len == 0)
{
Con_Printf("%s has zero samples\n", s->name);
console::info("%s has zero samples\n", s->name);
return NULL;
}
@@ -214,7 +214,7 @@ static void FindNextChunk (const char *name)
if (iff_chunk_len < 0 || iff_chunk_len > iff_end - data_p)
{
data_p = NULL;
Con_DPrintf2("bad \"%s\" chunk length (%d)\n", name, iff_chunk_len);
console::trace("bad \"%s\" chunk length (%d)\n", name, iff_chunk_len);
return;
}
last_chunk = data_p + ((iff_chunk_len + 1) & ~1);
@@ -242,7 +242,7 @@ static void DumpChunks (void)
memcpy (str, data_p, 4);
data_p += 4;
iff_chunk_len = GetLittleLong();
Con_Printf ("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len);
console::info ("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len);
data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end);
}
@@ -272,7 +272,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
FindChunk("RIFF");
if (!(data_p && !strncmp((char *)data_p + 8, "WAVE", 4)))
{
Con_Printf("%s missing RIFF/WAVE chunks\n", name);
console::info("%s missing RIFF/WAVE chunks\n", name);
return info;
}
@@ -285,14 +285,14 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
FindChunk("fmt ");
if (!data_p)
{
Con_Printf("%s is missing fmt chunk\n", name);
console::info("%s is missing fmt chunk\n", name);
return info;
}
data_p += 8;
format = GetLittleShort();
if (format != WAV_FORMAT_PCM)
{
Con_Printf("%s is not Microsoft PCM format\n", name);
console::info("%s is not Microsoft PCM format\n", name);
return info;
}
@@ -310,7 +310,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
{
data_p += 32;
info.loopstart = GetLittleLong();
// Con_Printf("loopstart=%d\n", sfx->loopstart);
// console::info("loopstart=%d\n", sfx->loopstart);
// if the next chunk is a LIST chunk, look for a cue length marker
FindNextChunk ("LIST");
@@ -321,7 +321,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
data_p += 24;
i = GetLittleLong(); // samples in loop
info.samples = info.loopstart + i;
// Con_Printf("looped length: %i\n", i);
// console::info("looped length: %i\n", i);
}
}
}
@@ -332,7 +332,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
FindChunk("data");
if (!data_p)
{
Con_Printf("%s is missing data chunk\n", name);
console::info("%s is missing data chunk\n", name);
return info;
}
@@ -349,7 +349,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
if (info.loopstart >= info.samples)
{
Con_Warning ("%s has loop start >= end\n", name);
console::warn ("%s has loop start >= end\n", name);
info.loopstart = -1;
info.samples = samples;
}