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
+23 -23
View File
@@ -102,17 +102,17 @@ static convar _snd_mixahead = {"_snd_mixahead", "0.1", {.archive = true}};
static void S_SoundInfo_f(void) {
if (!sound_started || !shm) {
Con_Printf("sound system not started\n");
console::info("sound system not started\n");
return;
}
Con_Printf("%d bit, %s, %d Hz\n", shm->samplebits,
console::info("%d bit, %s, %d Hz\n", shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", shm->speed);
Con_Printf("%5d samples\n", shm->samples);
Con_Printf("%5d samplepos\n", shm->samplepos);
Con_Printf("%5d submission_chunk\n", shm->submission_chunk);
Con_Printf("%5d total_channels\n", total_channels);
Con_Printf("%p dma buffer\n", shm->buffer);
console::info("%5d samples\n", shm->samples);
console::info("%5d samplepos\n", shm->samplepos);
console::info("%5d submission_chunk\n", shm->submission_chunk);
console::info("%5d total_channels\n", total_channels);
console::info("%p dma buffer\n", shm->buffer);
}
@@ -122,7 +122,7 @@ static void SND_Callback_sfxvolume(convar *var) {
static void SND_Callback_snd_filterquality(convar *var) {
if (snd_filterquality.value < 1 || snd_filterquality.value > 5) {
Con_Printf("snd_filterquality must be between 1 and 5\n");
console::info("snd_filterquality must be between 1 and 5\n");
snd_filterquality.set(SND_FILTERQUALITY_DEFAULT);
}
}
@@ -139,9 +139,9 @@ void S_Startup(void) {
sound_started = SNDDMA_Init(&sn);
if (!sound_started) {
Con_Printf("Failed initializing sound\n");
console::info("Failed initializing sound\n");
} else {
Con_Printf("Audio: %d bit, %s, %d Hz\n", shm->samplebits,
console::info("Audio: %d bit, %s, %d Hz\n", shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", shm->speed);
}
}
@@ -154,7 +154,7 @@ S_Init
*/
void S_Init(void) {
if (snd_initialized) {
Con_Printf("Sound is already initialized\n");
console::info("Sound is already initialized\n");
return;
}
@@ -175,7 +175,7 @@ void S_Init(void) {
if (safemode || common::check_param("-nosound").has_value())
return;
Con_Printf("\nSound Initialization\n");
console::info("\nSound Initialization\n");
command::add("play", S_Play);
command::add("playvol", S_PlayVol);
@@ -195,7 +195,7 @@ void S_Init(void) {
if (host_parms->memsize < 0x800000) {
loadas8bit.set("1");
Con_Printf("loading all sounds as 8bit\n");
console::info("loading all sounds as 8bit\n");
}
sfxvolume.set_callback(SND_Callback_sfxvolume);
@@ -554,7 +554,7 @@ void S_StaticSound(sfx_t *sfx, vec3_t origin, float vol, float attenuation) {
return;
if (total_channels == MAX_CHANNELS) {
Con_Printf("total_channels == MAX_CHANNELS\n");
console::info("total_channels == MAX_CHANNELS\n");
return;
}
@@ -566,7 +566,7 @@ void S_StaticSound(sfx_t *sfx, vec3_t origin, float vol, float attenuation) {
return;
if (sc->loopstart == -1) {
Con_Printf("Sound %s not looped\n", sfx->name);
console::info("Sound %s not looped\n", sfx->name);
return;
}
@@ -777,12 +777,12 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) {
ch = snd_channels;
for (i = 0; i < total_channels; i++, ch++) {
if (ch->sfx && (ch->leftvol || ch->rightvol)) {
// Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
// console::info ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
total++;
}
}
Con_Printf("----(%i)----\n", total);
console::info("----(%i)----\n", total);
}
// add raw data from streamed samples
@@ -841,7 +841,7 @@ static void S_Update_(void) {
// check to make sure that we haven't overshot
if (paintedtime < soundtime) {
// Con_Printf ("S_Update_ : overflow\n");
// console::info ("S_Update_ : overflow\n");
paintedtime = soundtime;
}
@@ -939,12 +939,12 @@ static void S_SoundList(void) {
size = sc->length * sc->width * (sc->stereo + 1);
total += size;
if (sc->loopstart >= 0)
Con_SafePrintf("L"); //johnfitz -- was Con_Printf
console::safe_print("L"); //johnfitz -- was console::info
else
Con_SafePrintf(" "); //johnfitz -- was Con_Printf
Con_SafePrintf("(%2db) %6i : %s\n", sc->width * 8, size, sfx->name); //johnfitz -- was Con_Printf
console::safe_print(" "); //johnfitz -- was console::info
console::safe_print("(%2db) %6i : %s\n", sc->width * 8, size, sfx->name); //johnfitz -- was console::info
}
Con_Printf("%i sounds, %i bytes\n", num_sfx, total); //johnfitz -- added count
console::info("%i sounds, %i bytes\n", num_sfx, total); //johnfitz -- added count
}
@@ -958,7 +958,7 @@ void S_LocalSound(const char *name) {
sfx = S_PrecacheSound(name);
if (!sfx) {
Con_Printf("S_LocalSound: can't cache %s\n", name);
console::info("S_LocalSound: can't cache %s\n", name);
return;
}
S_StartSound(cl.viewentity, -1, sfx, vec3_origin, 1, 1);