From 10766f116c3d177097f944b0492e518e57728fa4 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 11 Aug 2017 19:52:21 +0100 Subject: [PATCH] Debug logging: add sound category --- src/debug.cpp | 2 ++ src/debug.h | 1 + src/sound.cpp | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/debug.cpp b/src/debug.cpp index 97611c1bfe..d85e74a793 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -47,6 +47,7 @@ int _debug_desync_level; int _debug_yapfdesync_level; int _debug_console_level; int _debug_linkgraph_level; +int _debug_sound_level; #ifdef RANDOM_DEBUG int _debug_random_level; #endif @@ -77,6 +78,7 @@ struct DebugLevel { DEBUG_LEVEL(yapfdesync), DEBUG_LEVEL(console), DEBUG_LEVEL(linkgraph), + DEBUG_LEVEL(sound), #ifdef RANDOM_DEBUG DEBUG_LEVEL(random), #endif diff --git a/src/debug.h b/src/debug.h index 47e90cd03f..82e7edeca7 100644 --- a/src/debug.h +++ b/src/debug.h @@ -55,6 +55,7 @@ extern int _debug_yapfdesync_level; extern int _debug_console_level; extern int _debug_linkgraph_level; + extern int _debug_sound_level; #ifdef RANDOM_DEBUG extern int _debug_random_level; #endif diff --git a/src/sound.cpp b/src/sound.cpp index 8c23dd2e87..0fa27a020f 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -46,7 +46,7 @@ static void OpenBankFile(const char *filename) /* Corrupt sample data? Just leave the allocated memory as those tell * there is no sound to play (size = 0 due to calloc). Not allocating * the memory disables valid NewGRFs that replace sounds. */ - DEBUG(misc, 6, "Incorrect number of sounds in '%s', ignoring.", filename); + DEBUG(sound, 6, "Incorrect number of sounds in '%s', ignoring.", filename); return; } @@ -152,7 +152,7 @@ static bool SetBankSource(MixerChannel *mc, const SoundEntry *sound) void InitializeSound() { - DEBUG(misc, 1, "Loading sound effects..."); + DEBUG(sound, 1, "Loading sound effects..."); OpenBankFile(BaseSounds::GetUsedSet()->files->filename); }