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
+27 -27
View File
@@ -66,7 +66,7 @@ static void CDAudio_Eject(void)
SDL_CDStop(cd_handle); /* see CDAudio_Stop() */
#endif
if (SDL_CDEject(cd_handle) < 0)
Con_Printf ("Unable to eject CD-ROM: %s\n", SDL_GetError ());
console::info ("Unable to eject CD-ROM: %s\n", SDL_GetError ());
}
static int CDAudio_GetAudioDiskInfo(void)
@@ -102,13 +102,13 @@ int CDAudio_Play(byte track, bool looping)
if (track < 1 || track > cd_handle->numtracks)
{
Con_Printf ("CDAudio_Play: Bad track number %d.\n", track);
console::info ("CDAudio_Play: Bad track number %d.\n", track);
return -1;
}
if (cd_handle->track[track-1].type == SDL_DATA_TRACK)
{
Con_Printf ("CDAudio_Play: track %d is not audio\n", track);
console::info ("CDAudio_Play: track %d is not audio\n", track);
return -1;
}
@@ -121,7 +121,7 @@ int CDAudio_Play(byte track, bool looping)
if (SDL_CDPlay(cd_handle, cd_handle->track[track-1].offset, cd_handle->track[track-1].length) < 0)
{
Con_Printf ("CDAudio_Play: Unable to play track %d: %s\n", track, SDL_GetError ());
console::info ("CDAudio_Play: Unable to play track %d: %s\n", track, SDL_GetError ());
return -1;
}
@@ -161,10 +161,10 @@ void CDAudio_Stop(void)
* Samsung DVD r/w drive running under 2.6.35.6 kernel.
* Therefore, avoid dead stops if playback may be resumed shortly. */
if (SDL_CDPause(cd_handle) < 0)
Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
console::info ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
#else
if (SDL_CDStop(cd_handle) < 0)
Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
console::info ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
#endif
wasPlaying = false;
@@ -182,7 +182,7 @@ void CDAudio_Pause(void)
return;
if (SDL_CDPause(cd_handle) < 0)
Con_Printf ("Unable to pause CD-ROM: %s\n", SDL_GetError());
console::info ("Unable to pause CD-ROM: %s\n", SDL_GetError());
wasPlaying = playing;
playing = false;
@@ -201,7 +201,7 @@ void CDAudio_Resume(void)
return;
if (SDL_CDResume(cd_handle) < 0)
Con_Printf ("Unable to resume CD-ROM: %s\n", SDL_GetError());
console::info ("Unable to resume CD-ROM: %s\n", SDL_GetError());
playing = true;
endOfTrack += realtime - pausetime;
pausetime = -1.0;
@@ -223,10 +223,10 @@ static void CD_f (void)
if (command::argc() < 2)
{
Con_Printf("commands:");
Con_Printf("on, off, reset, remap, \n");
Con_Printf("play, stop, loop, pause, resume\n");
Con_Printf("eject, info, next, prev\n");
console::info("commands:");
console::info("on, off, reset, remap, \n");
console::info("play, stop, loop, pause, resume\n");
console::info("eject, info, next, prev\n");
return;
}
@@ -264,7 +264,7 @@ static void CD_f (void)
{
for (n = 1; n < 100; n++)
if (remap[n] != n)
Con_Printf(" %u -> %u\n", n, remap[n]);
console::info(" %u -> %u\n", n, remap[n]);
return;
}
for (n = 1; n <= ret; n++)
@@ -277,7 +277,7 @@ static void CD_f (void)
CDAudio_GetAudioDiskInfo();
if (!cdValid)
{
Con_Printf("No CD in player.\n");
console::info("No CD in player.\n");
return;
}
}
@@ -329,12 +329,12 @@ static void CD_f (void)
int current_min, current_sec, current_frame;
int length_min, length_sec, length_frame;
Con_Printf ("%u tracks\n", cd_handle->numtracks);
console::info ("%u tracks\n", cd_handle->numtracks);
if (playing)
Con_Printf("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);
console::info("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);
else if (wasPlaying)
Con_Printf("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);
console::info("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);
if (playing || wasPlaying)
{
@@ -342,11 +342,11 @@ static void CD_f (void)
FRAMES_TO_MSF(cd_handle->cur_frame, &current_min, &current_sec, &current_frame);
FRAMES_TO_MSF(cd_handle->track[playTrack-1].length, &length_min, &length_sec, &length_frame);
Con_Printf ("Current position: %d:%02d.%02d (of %d:%02d.%02d)\n",
console::info ("Current position: %d:%02d.%02d (of %d:%02d.%02d)\n",
current_min, current_sec, current_frame * 60 / CD_FPS,
length_min, length_sec, length_frame * 60 / CD_FPS);
}
Con_Printf("Volume is %f\n", bgmvolume.value);
console::info("Volume is %f\n", bgmvolume.value);
return;
}
@@ -367,7 +367,7 @@ static void CD_f (void)
return;
}
Con_Printf ("cd: unknown command \"%s\"\n", command);
console::info ("cd: unknown command \"%s\"\n", command);
}
static bool CD_GetVolume (void *unused)
@@ -504,12 +504,12 @@ int CDAudio_Init(void)
if (SDL_InitSubSystem(SDL_INIT_CDROM) < 0)
{
Con_Printf("Couldn't init SDL cdrom: %s\n", SDL_GetError());
console::info("Couldn't init SDL cdrom: %s\n", SDL_GetError());
return -1;
}
const int sdl_num_drives = SDL_CDNumDrives();
Con_Printf ("SDL detected %d CD-ROM drive%c\n", sdl_num_drives,
console::info ("SDL detected %d CD-ROM drive%c\n", sdl_num_drives,
sdl_num_drives == 1 ? ' ' : 's');
if (sdl_num_drives < 1)
@@ -520,7 +520,7 @@ int CDAudio_Init(void)
const char *userdev = get_cddev_arg(com_argv[dev.value()+1]);
if (!userdev)
{
Con_Printf("Invalid argument to -cddev\n");
console::info("Invalid argument to -cddev\n");
return -1;
}
for (auto i = 0; i < sdl_num_drives; i++)
@@ -533,7 +533,7 @@ int CDAudio_Init(void)
}
if (cd_dev == -1)
{
Con_Printf("SDL couldn't find cdrom device %s\n", userdev);
console::info("SDL couldn't find cdrom device %s\n", userdev);
return -1;
}
}
@@ -544,7 +544,7 @@ int CDAudio_Init(void)
cd_handle = SDL_CDOpen(cd_dev);
if (!cd_handle)
{
Con_Printf ("CDAudio_Init: Unable to open CD-ROM drive %s (%s)\n",
console::info ("CDAudio_Init: Unable to open CD-ROM drive %s (%s)\n",
SDL_CDName(cd_dev), SDL_GetError());
return -1;
}
@@ -554,11 +554,11 @@ int CDAudio_Init(void)
enabled = true;
old_cdvolume = bgmvolume.value;
Con_Printf("CDAudio initialized (SDL, using %s)\n", SDL_CDName(cd_dev));
console::info("CDAudio initialized (SDL, using %s)\n", SDL_CDName(cd_dev));
if (CDAudio_GetAudioDiskInfo())
{
Con_Printf("CDAudio_Init: No CD in drive\n");
console::info("CDAudio_Init: No CD in drive\n");
cdValid = false;
}