2929#include " CalChartSheet.h"
3030#include " CalChartShowMode.h"
3131#include " CalChartSizes.h"
32+ #include " CalChartUtils.h"
3233#include " CalChartView.h"
3334#include " draw.h"
34- #include " math_utils.h"
3535#include " platconf.h"
3636
3737#include < wx/dcbuffer.h>
@@ -106,17 +106,17 @@ void AnimationView::OnDrawDots(wxDC& dc, CalChartConfiguration const& config)
106106 dc.SetPen (brushAndPen.second );
107107 }
108108 } else if (mView ->IsSelected (info.index )) {
109- switch (info.mDirection ) {
110- case CalChart::AnimateDir::SW :
111- case CalChart::AnimateDir::W :
112- case CalChart::AnimateDir::NW : {
109+ switch (AngleToDirection ( info.mFacingDirection ) ) {
110+ case CalChart::Direction::SouthWest :
111+ case CalChart::Direction::West :
112+ case CalChart::Direction::NorthWest : {
113113 auto brushAndPen = config.Get_CalChartBrushAndPen (COLOR_POINT_ANIM_HILIT_BACK);
114114 dc.SetBrush (brushAndPen.first );
115115 dc.SetPen (brushAndPen.second );
116116 } break ;
117- case CalChart::AnimateDir::SE :
118- case CalChart::AnimateDir::E :
119- case CalChart::AnimateDir::NE : {
117+ case CalChart::Direction::SouthEast :
118+ case CalChart::Direction::East :
119+ case CalChart::Direction::NorthEast : {
120120 auto brushAndPen = config.Get_CalChartBrushAndPen (COLOR_POINT_ANIM_HILIT_FRONT);
121121 dc.SetBrush (brushAndPen.first );
122122 dc.SetPen (brushAndPen.second );
@@ -128,17 +128,17 @@ void AnimationView::OnDrawDots(wxDC& dc, CalChartConfiguration const& config)
128128 }
129129 }
130130 } else {
131- switch (info.mDirection ) {
132- case CalChart::AnimateDir::SW :
133- case CalChart::AnimateDir::W :
134- case CalChart::AnimateDir::NW : {
131+ switch (AngleToDirection ( info.mFacingDirection ) ) {
132+ case CalChart::Direction::SouthWest :
133+ case CalChart::Direction::West :
134+ case CalChart::Direction::NorthWest : {
135135 auto brushAndPen = config.Get_CalChartBrushAndPen (COLOR_POINT_ANIM_BACK);
136136 dc.SetBrush (brushAndPen.first );
137137 dc.SetPen (brushAndPen.second );
138138 } break ;
139- case CalChart::AnimateDir::SE :
140- case CalChart::AnimateDir::E :
141- case CalChart::AnimateDir::NE : {
139+ case CalChart::Direction::SouthEast :
140+ case CalChart::Direction::East :
141+ case CalChart::Direction::NorthEast : {
142142 auto brushAndPen = config.Get_CalChartBrushAndPen (COLOR_POINT_ANIM_FRONT);
143143 dc.SetBrush (brushAndPen.first );
144144 dc.SetPen (brushAndPen.second );
@@ -154,7 +154,7 @@ void AnimationView::OnDrawDots(wxDC& dc, CalChartConfiguration const& config)
154154 auto x = position.x + mView ->GetShowMode ().Offset ().x ;
155155 auto y = position.y + mView ->GetShowMode ().Offset ().y ;
156156 auto drawPosition = fDIP (wxPoint (x, y));
157- auto rectangleSize = fDIP (wxSize (Int2CoordUnits (1 ), Int2CoordUnits (1 )));
157+ auto rectangleSize = fDIP (wxSize (CalChart:: Int2CoordUnits (1 ), CalChart:: Int2CoordUnits (1 )));
158158
159159 dc.DrawRectangle (drawPosition - rectangleSize / 2 , rectangleSize);
160160 }
@@ -169,7 +169,7 @@ void AnimationView::OnDrawSprites(wxDC& dc, CalChartConfiguration const& config)
169169 for (auto info : mAnimation ->GetAllAnimateInfo ()) {
170170 auto image_offset = !GetAnimationFrame ()->TimerOn () ? 0 : OnBeat () ? 1
171171 : 2 ;
172- auto image_index = static_cast < int > (info.mDirection ) + image_offset * 8 ;
172+ auto image_index = AngleToQuadrant (info.mFacingDirection ) + image_offset * 8 ;
173173 auto image = mSpriteImages [image_index];
174174 image = image.Scale (image.GetWidth () * scale, image.GetHeight () * scale);
175175 if (mView ->IsSelected (info.index )) {
@@ -331,13 +331,13 @@ MarcherInfo AnimationView::GetMarcherInfo(int which) const
331331 MarcherInfo info{};
332332 if (mAnimation ) {
333333 auto anim_info = mAnimation ->GetAnimateInfo (which);
334- info.direction = NormalizeAngleRad ((anim_info.mRealDirection * M_PI / 180.0 ));
334+ info.direction = NormalizeAngleRad ((anim_info.mFacingDirection * M_PI / 180.0 ));
335335
336336 auto position = anim_info.mPosition ;
337- info.x = CoordUnits2Float (position.x );
337+ info.x = CalChart:: CoordUnits2Float (position.x );
338338 // because the coordinate system for continuity and OpenGL are different,
339339 // correct here.
340- info.y = -1.0 * CoordUnits2Float (position.y );
340+ info.y = -1.0 * CalChart:: CoordUnits2Float (position.y );
341341 }
342342 return info;
343343}
0 commit comments