mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 05:48:03 -04:00
demote some messages to debug verbosity (#1962)
* demote some messages to debug verbosity Fixes #1959 * report music lump format in S_ChangeMusic() messages * apply patch by @rfomin, thanks * remove some unneccessary includes
This commit is contained in:
parent
6b4d22565e
commit
f3ce1aad1c
12
src/g_game.c
12
src/g_game.c
@ -2015,7 +2015,7 @@ static void G_DoPlayDemo(void)
|
||||
M_ReadFile(filename, &demobuffer);
|
||||
demolength = M_FileLength(filename);
|
||||
demo_p = demobuffer;
|
||||
I_Printf(VB_INFO, "G_DoPlayDemo: %s", filename);
|
||||
I_Printf(VB_DEMO, "G_DoPlayDemo: %s", filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2024,7 +2024,7 @@ static void G_DoPlayDemo(void)
|
||||
int lumpnum = W_GetNumForName(lumpname);
|
||||
demolength = W_LumpLength(lumpnum);
|
||||
demobuffer = demo_p = W_CacheLumpNum(lumpnum, PU_STATIC); // killough
|
||||
I_Printf(VB_INFO, "G_DoPlayDemo: %s (%s)", lumpname, W_WadNameForLump(lumpnum));
|
||||
I_Printf(VB_DEMO, "G_DoPlayDemo: %s (%s)", lumpname, W_WadNameForLump(lumpnum));
|
||||
}
|
||||
|
||||
// [FG] ignore too short demo lumps
|
||||
@ -2790,12 +2790,12 @@ static void PrintLevelTimes(void)
|
||||
{
|
||||
if (totalleveltimes)
|
||||
{
|
||||
I_Printf(VB_INFO, "(%d:%02d) ",
|
||||
I_Printf(VB_DEBUG, "(%d:%02d) ",
|
||||
((totalleveltimes + leveltime) / TICRATE) / 60,
|
||||
((totalleveltimes + leveltime) / TICRATE) % 60);
|
||||
}
|
||||
|
||||
I_Printf(VB_INFO, "%d:%05.2f", leveltime / TICRATE / 60,
|
||||
I_Printf(VB_DEBUG, "%d:%05.2f", leveltime / TICRATE / 60,
|
||||
(float)(leveltime % (60 * TICRATE)) / TICRATE);
|
||||
}
|
||||
|
||||
@ -2804,7 +2804,7 @@ static void G_DoLoadGame(void)
|
||||
if (DoLoadGame(false))
|
||||
{
|
||||
const int slot_num = 10 * savepage + savegameslot;
|
||||
I_Printf(VB_INFO, "G_DoLoadGame: Slot %02d, Time ", slot_num);
|
||||
I_Printf(VB_DEBUG, "G_DoLoadGame: Slot %02d, Time ", slot_num);
|
||||
PrintLevelTimes();
|
||||
MN_SetQuickSaveSlot(savegameslot);
|
||||
}
|
||||
@ -2814,7 +2814,7 @@ static void G_DoLoadAutoSave(void)
|
||||
{
|
||||
if (DoLoadGame(true))
|
||||
{
|
||||
I_Printf(VB_INFO, "G_DoLoadGame: Auto Save, Time ");
|
||||
I_Printf(VB_DEBUG, "G_DoLoadGame: Auto Save, Time ");
|
||||
PrintLevelTimes();
|
||||
}
|
||||
}
|
||||
|
@ -317,6 +317,8 @@ static boolean I_FL_InitStream(int device)
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char *music_format = "Unknown";
|
||||
|
||||
static boolean I_FL_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
ALsizei *freq, ALsizei *frame_size)
|
||||
{
|
||||
@ -344,6 +346,7 @@ static boolean I_FL_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
if (IsMid(data, size))
|
||||
{
|
||||
result = fluid_player_add_mem(player, data, size);
|
||||
music_format = "MIDI (FluidSynth)";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -364,6 +367,7 @@ static boolean I_FL_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
|
||||
mem_fclose(instream);
|
||||
mem_fclose(outstream);
|
||||
music_format = "MUS (FluidSynth)";
|
||||
}
|
||||
|
||||
if (result != FLUID_OK)
|
||||
@ -481,6 +485,11 @@ static void I_FL_BindVariables(void)
|
||||
BIND_BOOL_MIDI(mus_reverb, false, "FluidSynth reverb");
|
||||
}
|
||||
|
||||
static const char *I_FL_MusicFormat(void)
|
||||
{
|
||||
return music_format;
|
||||
}
|
||||
|
||||
stream_module_t stream_fl_module =
|
||||
{
|
||||
I_FL_InitStream,
|
||||
@ -491,4 +500,5 @@ stream_module_t stream_fl_module =
|
||||
I_FL_ShutdownStream,
|
||||
I_FL_DeviceList,
|
||||
I_FL_BindVariables,
|
||||
I_FL_MusicFormat,
|
||||
};
|
||||
|
@ -1412,6 +1412,8 @@ static void I_MID_ResumeSong(void *handle)
|
||||
SDL_UnlockMutex(music_lock);
|
||||
}
|
||||
|
||||
static const char *music_format = "Unknown";
|
||||
|
||||
static void *I_MID_RegisterSong(void *data, int len)
|
||||
{
|
||||
if (!music_initialized)
|
||||
@ -1419,7 +1421,15 @@ static void *I_MID_RegisterSong(void *data, int len)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!IsMid(data, len) && !IsMus(data, len))
|
||||
if (IsMid(data, len))
|
||||
{
|
||||
music_format = "MIDI (Native)";
|
||||
}
|
||||
else if (IsMus(data, len))
|
||||
{
|
||||
music_format = "MUS (Native)";
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -1493,6 +1503,11 @@ static midiplayertype_t I_MID_MidiPlayerType(void)
|
||||
return midiplayer_native;
|
||||
}
|
||||
|
||||
static const char *I_MID_MusicFormat(void)
|
||||
{
|
||||
return music_format;
|
||||
}
|
||||
|
||||
static void I_MID_BindVariables(void)
|
||||
{
|
||||
BIND_NUM_MIDI(midi_complevel, COMP_STANDARD, 0, COMP_NUM - 1,
|
||||
@ -1520,4 +1535,5 @@ music_module_t music_mid_module =
|
||||
I_MID_DeviceList,
|
||||
I_MID_BindVariables,
|
||||
I_MID_MidiPlayerType,
|
||||
I_MID_MusicFormat,
|
||||
};
|
||||
|
@ -486,6 +486,15 @@ static void I_OAL_BindVariables(void)
|
||||
}
|
||||
}
|
||||
|
||||
static const char *I_OAL_MusicFormat(void)
|
||||
{
|
||||
if (active_module)
|
||||
{
|
||||
return active_module->I_MusicFormat();
|
||||
}
|
||||
return "None";
|
||||
}
|
||||
|
||||
music_module_t music_oal_module =
|
||||
{
|
||||
I_OAL_InitMusic,
|
||||
@ -500,4 +509,5 @@ music_module_t music_oal_module =
|
||||
I_OAL_DeviceList,
|
||||
I_OAL_BindVariables,
|
||||
I_OAL_MidiPlayerType,
|
||||
I_OAL_MusicFormat,
|
||||
};
|
||||
|
@ -32,6 +32,7 @@ typedef struct
|
||||
void (*I_ShutdownStream)(void);
|
||||
const char **(*I_DeviceList)(void);
|
||||
void (*BindVariables)(void);
|
||||
const char *(*I_MusicFormat)(void);
|
||||
} stream_module_t;
|
||||
|
||||
extern stream_module_t stream_opl_module;
|
||||
|
@ -1517,6 +1517,8 @@ static boolean I_OPL_InitStream(int device)
|
||||
|
||||
static midi_file_t *midifile;
|
||||
|
||||
static const char *music_format = "Unknown";
|
||||
|
||||
static boolean I_OPL_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
ALsizei *freq, ALsizei *frame_size)
|
||||
{
|
||||
@ -1534,6 +1536,7 @@ static boolean I_OPL_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
if (IsMid(data, size) /* && size < MAXMIDLENGTH */)
|
||||
{
|
||||
midifile = MIDI_LoadFile(data, size);
|
||||
music_format = "MIDI (OPL)";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1558,6 +1561,7 @@ static boolean I_OPL_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
|
||||
mem_fclose(instream);
|
||||
mem_fclose(outstream);
|
||||
music_format = "MUS (OPL)";
|
||||
}
|
||||
|
||||
if (midifile == NULL)
|
||||
@ -1685,6 +1689,11 @@ static const char **I_OPL_DeviceList(void)
|
||||
return devices;
|
||||
}
|
||||
|
||||
static const char *I_OPL_MusicFormat(void)
|
||||
{
|
||||
return music_format;
|
||||
}
|
||||
|
||||
static void I_OPL_BindVariables(void)
|
||||
{
|
||||
BIND_NUM_MIDI(num_opl_chips, 1, 1, OPL_MAX_CHIPS,
|
||||
@ -1703,4 +1712,5 @@ stream_module_t stream_opl_module =
|
||||
I_OPL_ShutdownStream,
|
||||
I_OPL_DeviceList,
|
||||
I_OPL_BindVariables,
|
||||
I_OPL_MusicFormat,
|
||||
};
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define __I_PRINT__
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "d_event.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@ -30,6 +31,8 @@ typedef enum
|
||||
VB_MAX
|
||||
} verbosity_t;
|
||||
|
||||
#define VB_DEMO (gameaction == ga_playdemo ? VB_INFO : VB_DEBUG)
|
||||
|
||||
int I_ConsoleStdout(void);
|
||||
|
||||
void I_InitPrintf(void);
|
||||
|
@ -738,6 +738,28 @@ static void I_SND_BindVariables(void)
|
||||
;
|
||||
}
|
||||
|
||||
static const char *I_SND_MusicFormat(void)
|
||||
{
|
||||
static SF_FORMAT_INFO format_info;
|
||||
|
||||
int count;
|
||||
sf_command(NULL, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof(count));
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
format_info.format = i;
|
||||
sf_command(NULL, SFC_GET_SIMPLE_FORMAT, &format_info,
|
||||
sizeof(format_info));
|
||||
if (format_info.format == stream.sfinfo.format)
|
||||
{
|
||||
return format_info.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
stream_module_t stream_snd_module =
|
||||
{
|
||||
I_SND_InitStream,
|
||||
@ -748,4 +770,5 @@ stream_module_t stream_snd_module =
|
||||
I_SND_ShutdownStream,
|
||||
I_SND_DeviceList,
|
||||
I_SND_BindVariables,
|
||||
I_SND_MusicFormat,
|
||||
};
|
||||
|
@ -726,6 +726,15 @@ const char **I_DeviceList(void)
|
||||
return devices;
|
||||
}
|
||||
|
||||
const char *I_MusicFormat(void)
|
||||
{
|
||||
if (active_module)
|
||||
{
|
||||
return active_module->I_MusicFormat();
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
void I_BindSoundVariables(void)
|
||||
{
|
||||
M_BindNum("sfx_volume", &snd_SfxVolume, NULL, 8, 0, 15, ss_none, wad_no,
|
||||
|
@ -167,6 +167,7 @@ typedef struct
|
||||
const char **(*I_DeviceList)(void);
|
||||
void (*I_BindVariables)(void);
|
||||
midiplayertype_t (*I_MidiPlayerType)(void);
|
||||
const char *(*I_MusicFormat)(void);
|
||||
} music_module_t;
|
||||
|
||||
extern music_module_t music_oal_module;
|
||||
@ -207,6 +208,8 @@ boolean IsMid(byte *mem, int len);
|
||||
// Determine whether memory block is a .mus file
|
||||
boolean IsMus(byte *mem, int len);
|
||||
|
||||
const char *I_MusicFormat(void);
|
||||
|
||||
void I_BindSoundVariables(void);
|
||||
|
||||
#endif
|
||||
|
13
src/i_xmp.c
13
src/i_xmp.c
@ -155,6 +155,18 @@ static void I_XMP_BindVariables(void)
|
||||
;
|
||||
}
|
||||
|
||||
static const char *I_XMP_MusicFormat(void)
|
||||
{
|
||||
if (!context)
|
||||
{
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
static struct xmp_module_info info;
|
||||
xmp_get_module_info(context, &info);
|
||||
return info.mod->type;
|
||||
}
|
||||
|
||||
stream_module_t stream_xmp_module =
|
||||
{
|
||||
I_XMP_InitStream,
|
||||
@ -165,4 +177,5 @@ stream_module_t stream_xmp_module =
|
||||
I_XMP_ShutdownStream,
|
||||
I_XMP_DeviceList,
|
||||
I_XMP_BindVariables,
|
||||
I_XMP_MusicFormat,
|
||||
};
|
||||
|
@ -1704,7 +1704,7 @@ void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
|
||||
R_PrecacheLevel();
|
||||
|
||||
// [FG] log level setup
|
||||
I_Printf(VB_INFO, "P_SetupLevel: %.8s (%s), Skill %d, %s%s%s, %s",
|
||||
I_Printf(VB_DEMO, "P_SetupLevel: %.8s (%s), Skill %d, %s%s%s, %s",
|
||||
lumpname, W_WadNameForLump(lumpnum),
|
||||
gameskill + 1,
|
||||
mapformat >= MFMT_UNSUPPORTED ? "NanoBSP" :
|
||||
|
@ -682,8 +682,10 @@ void S_ChangeMusic(int musicnum, int looping)
|
||||
I_PlaySong((void *)music->handle, looping);
|
||||
|
||||
// [crispy] log played music
|
||||
I_Printf(VB_INFO, "S_ChangeMusic: %.8s (%s)", lumpinfo[music->lumpnum].name,
|
||||
W_WadNameForLump(music->lumpnum));
|
||||
I_Printf(VB_DEBUG, "S_ChangeMusic: %.8s (%s), %s",
|
||||
lumpinfo[music->lumpnum].name,
|
||||
W_WadNameForLump(music->lumpnum),
|
||||
I_MusicFormat());
|
||||
|
||||
mus_playing = music;
|
||||
|
||||
@ -729,8 +731,10 @@ void S_ChangeMusInfoMusic(int lumpnum, int looping)
|
||||
I_PlaySong((void *)music->handle, looping);
|
||||
|
||||
// [crispy] log played music
|
||||
I_Printf(VB_INFO, "S_ChangeMusInfoMusic: %.8s (%s)",
|
||||
lumpinfo[music->lumpnum].name, W_WadNameForLump(music->lumpnum));
|
||||
I_Printf(VB_DEBUG, "S_ChangeMusInfoMusic: %.8s (%s), %s",
|
||||
lumpinfo[music->lumpnum].name,
|
||||
W_WadNameForLump(music->lumpnum),
|
||||
I_MusicFormat());
|
||||
|
||||
mus_playing = music;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user