diff --git a/CMake/DefineOptions.cmake b/CMake/DefineOptions.cmake index d9f626e354..677d6000eb 100644 --- a/CMake/DefineOptions.cmake +++ b/CMake/DefineOptions.cmake @@ -38,6 +38,9 @@ option(WITH_MP3 "Build with MP3 Support." ON) # Turn this option off to disable using OGG files with the game. option(WITH_OGG "Build with OGG/Vorbis Support." ON) +# Turn this option on to log every segment added or removed. +option(WITH_LOGGING_TIMING_DATA "Build with logging all Add and Erase Segment calls." OFF) + if(NOT MSVC) # Turn this option off to disable using FFMEPG. option(WITH_FFMPEG "Build with FFMPEG." ON) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index cb1386d894..0d7b24aa85 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -535,7 +535,7 @@ TimingSegment* TimingData::GetSegmentAtRow( int iNoteRow, TimingSegmentType tst static void EraseSegment( vector &vSegs, int index, TimingSegment *cur ) { -#ifdef DEBUG +#ifdef WITH_LOGGING_TIMING_DATA LOG->Trace( "EraseSegment(%d, %p)", index, cur ); cur->DebugPrint(); #endif @@ -548,7 +548,7 @@ static void EraseSegment( vector &vSegs, int index, TimingSegmen // so we must deep-copy it (with ::Copy) for new allocations. void TimingData::AddSegment( const TimingSegment *seg ) { -#ifdef DEBUG +#ifdef WITH_LOGGING_TIMING_DATA LOG->Trace( "AddSegment( %s )", TimingSegmentTypeToString(seg->GetType()).c_str() ); seg->DebugPrint(); #endif @@ -667,7 +667,7 @@ void TimingData::AddSegment( const TimingSegment *seg ) // the segment at or before this row is equal to the new one; ignore it if( bOnSameRow && (*cur) == (*seg) ) { -#if defined(DEBUG) +#ifdef WITH_LOGGING_TIMING_DATA LOG->Trace( "equals previous segment, ignoring" ); #endif return; @@ -1100,7 +1100,7 @@ float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds if( speeds.size() == 0 ) { #ifdef DEBUG - LOG->Trace("No speed segments"); + LOG->Trace("No speed segments found: using default value."); #endif return 1.0f; } diff --git a/src/config.in.hpp b/src/config.in.hpp index 327336f455..a8fdd07910 100644 --- a/src/config.in.hpp +++ b/src/config.in.hpp @@ -135,6 +135,9 @@ typedef long ssize_t; /* Defined to 1 if building on a windows system, and thus uses the windows loading window. */ #cmakedefine NEED_WINDOWS_LOADING_WINDOW 1 +/* Defined to 1 if logging timing segment additions and removals. */ +#cmakedefine WITH_LOGGING_TIMING_DATA 1 + /* Defined to 1 if the PBS_MARQUEE symbol was found. */ #cmakedefine HAVE_PBS_MARQUEE 1