From c1b729822c2115e37f5b74adcabce2a0e9ba14a6 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 30 Oct 2018 15:42:05 -0400 Subject: [PATCH] Remove unused arguments of some drawing functions --- src/TrackPanel.cpp | 26 +++++++++++--------------- src/TrackPanel.h | 8 ++++---- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index ab29e3185..fce6b30a3 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1608,13 +1608,12 @@ void TrackPanel::DrawOutside const Track * t, const wxRect & rec) { auto dc = &context.dc; - const auto wt = track_cast(t); // Draw things that extend right of track control panel { // Start with whole track rect wxRect rect = rec; - DrawOutsideOfTrack(context, t, rect); + DrawOutsideOfTrack(context, rect); { auto channels = TrackList::Channels(t); @@ -1632,8 +1631,7 @@ void TrackPanel::DrawOutside rect.height -= kTopInset; int labelw = GetLabelWidth(); - int vrul = GetVRulerOffset(); - mTrackInfo.DrawBackground(dc, rect, t->GetSelected(), (wt != nullptr), labelw, vrul); + mTrackInfo.DrawBackground( dc, rect, t->GetSelected(), labelw ); // Vaughan, 2010-08-24: No longer doing this. // Draw sync-lock tiles in ruler area. @@ -1644,6 +1642,7 @@ void TrackPanel::DrawOutside // TrackArtist::DrawSyncLockTiles(dc, tileFill); //} + int vrul = GetVRulerOffset(); DrawBordersAroundTrack(dc, rect, vrul); { auto channels = TrackList::Channels(t); @@ -1654,7 +1653,7 @@ void TrackPanel::DrawOutside DrawBordersAroundSash(channel, dc, rect, labelw); } - DrawShadow(t, dc, rect); + DrawShadow( dc, rect ); } // Draw things within the track control panel @@ -1674,9 +1673,8 @@ void TrackPanel::DrawOutside // If linked to a following channel, also paint the separator area, which // overlaps the next track rectangle's top void TrackPanel::DrawOutsideOfTrack -(TrackPanelDrawingContext &context, const Track * t, const wxRect & rect) +(TrackPanelDrawingContext &context, const wxRect & rect) { - (void)t;// Compiler food auto dc = &context.dc; // Fill in area outside of the track @@ -1933,7 +1931,7 @@ void TrackPanel::DrawBordersAroundSash(const Track * t, wxDC * dc, // Given rectangle has insets subtracted left, right, and top // Stroke lines along bottom and right, which are slightly short at // bottom-left and top-right -void TrackPanel::DrawShadow(const Track * /* t */ , wxDC * dc, const wxRect & rect) +void TrackPanel::DrawShadow( wxDC * dc, const wxRect & rect ) { int right = rect.x + rect.width - 1; int bottom = rect.y + rect.height - 1; @@ -2512,13 +2510,9 @@ void TrackInfo::DrawBordersWithin //#define USE_BEVELS // Paint the whole given rectangle some fill color -void TrackInfo::DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, - bool bHasMuteSolo, const int labelw, const int vrul) const +void TrackInfo::DrawBackground( + wxDC * dc, const wxRect & rect, bool bSelected, const int labelw) const { - //compiler food. - static_cast(bHasMuteSolo); - static_cast(vrul); - // fill in label wxRect fill = rect; fill.width = labelw - kLeftInset; @@ -2527,7 +2521,9 @@ void TrackInfo::DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, #ifdef USE_BEVELS // This branch is not now used - // PRL: todo: banish magic numbers + // PRL: todo: banish magic numbers. + // PRL: vrul was the x coordinate of left edge of the vertical ruler. + // PRL: bHasMuteSolo was true iff the track was WaveTrack. if( bHasMuteSolo ) { int ylast = rect.height-20; diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 552757b48..439f929fb 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -151,7 +151,8 @@ public: static void SetTrackInfoFont(wxDC *dc); - void DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const; + void DrawBackground( + wxDC * dc, const wxRect & rect, bool bSelected, const int labelw ) const; void DrawBordersWithin(wxDC * dc, const wxRect & rect, const Track &track ) const; static void GetCloseBoxHorizontalBounds( const wxRect & rect, wxRect &dest ); @@ -373,14 +374,13 @@ protected: const Track *leaderTrack, const wxRect & teamRect); void HighlightFocusedTrack (wxDC* dc, const wxRect &rect); - void DrawShadow (const Track *t, wxDC* dc, const wxRect & rect); + void DrawShadow ( wxDC* dc, const wxRect & rect ); void DrawBordersAroundTrack(wxDC* dc, const wxRect & rect, const int vrul); void DrawBordersAroundSash (const Track *t, wxDC* dc, const wxRect & rect, const int labelw); void DrawOutsideOfTrack ( - TrackPanelDrawingContext &context, - const Track *t, const wxRect & rect); + TrackPanelDrawingContext &context, const wxRect & rect ); void DrawSash (const Track *t, wxDC* dc, const wxRect & rect); public: