diff --git a/src/gui/credits_menu.cpp b/src/gui/credits_menu.cpp index 58a8890fe..8ead80e34 100644 --- a/src/gui/credits_menu.cpp +++ b/src/gui/credits_menu.cpp @@ -77,7 +77,7 @@ CreditsMenu::CreditsMenu() //FIXME: maybe I should make scroll names more consistent widget_manager->enableWgtScroll( WTOK_CREDITS ); widget_manager->setWgtYScrollPos( WTOK_CREDITS, WGT_SCROLL_START_BOTTOM ); - widget_manager->setWgtYScrollSpeed( WTOK_CREDITS, -0.25f ); + widget_manager->setWgtYScrollSpeed( WTOK_CREDITS, -100 ); widget_manager->breakLine(); widget_manager->addWgt( WTOK_QUIT, 40, 7); diff --git a/src/widget.cpp b/src/widget.cpp index ed7b07872..427339810 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -264,8 +264,8 @@ void Widget::update(const float DELTA) if(m_enable_scroll) { //TODO: constrain speed to sane values - m_scroll_pos_x += m_scroll_speed_x; - m_scroll_pos_y += m_scroll_speed_y; + m_scroll_pos_x += m_scroll_speed_x * DELTA; + m_scroll_pos_y += m_scroll_speed_y * DELTA; //Y-axis wrapping if(m_scroll_pos_y * 2 > Y_LIMIT) diff --git a/src/widget.hpp b/src/widget.hpp index 900be4cc8..85b1273bf 100644 --- a/src/widget.hpp +++ b/src/widget.hpp @@ -154,8 +154,8 @@ class Widget bool m_enable_scroll; float m_scroll_pos_x; float m_scroll_pos_y; - float m_scroll_speed_x; - float m_scroll_speed_y; + int m_scroll_speed_x; + int m_scroll_speed_y; //The widget calls the Track::drawScaled2D() function to draw a given //track, and m_track_num tells which track to draw. diff --git a/src/widget_manager.cpp b/src/widget_manager.cpp index 069c37af3..6b16b4661 100644 --- a/src/widget_manager.cpp +++ b/src/widget_manager.cpp @@ -87,8 +87,8 @@ bool WidgetManager::addWgt new_id.widget->m_enable_scroll = m_default_enable_scroll; new_id.widget->m_scroll_pos_x = (float)m_default_scroll_preset_x; new_id.widget->m_scroll_pos_y = (float)m_default_scroll_preset_y; - new_id.widget->m_scroll_speed_x = (float)m_default_scroll_x_speed; - new_id.widget->m_scroll_speed_y = (float)m_default_scroll_y_speed; + new_id.widget->m_scroll_speed_x = m_default_scroll_x_speed; + new_id.widget->m_scroll_speed_y = m_default_scroll_y_speed; new_id.widget->m_enable_track = m_default_show_track; new_id.widget->m_track_num = m_default_track_num; @@ -1076,7 +1076,7 @@ void WidgetManager::setWgtYScrollPos } //----------------------------------------------------------------------------- - void WidgetManager::setWgtXScrollSpeed( const int TOKEN, const float SPEED ) + void WidgetManager::setWgtXScrollSpeed( const int TOKEN, const int SPEED ) { const int ID = findId(TOKEN); if( ID != WGT_NONE ) m_widgets[ID].widget->m_scroll_speed_x = SPEED; @@ -1088,7 +1088,7 @@ void WidgetManager::setWgtYScrollPos } //----------------------------------------------------------------------------- - void WidgetManager::setWgtYScrollSpeed( const int TOKEN, const float SPEED ) + void WidgetManager::setWgtYScrollSpeed( const int TOKEN, const int SPEED ) { const int ID = findId(TOKEN); if( ID != WGT_NONE ) m_widgets[ID].widget->m_scroll_speed_y = SPEED; diff --git a/src/widget_manager.hpp b/src/widget_manager.hpp index 166f03262..4b4b7ac76 100644 --- a/src/widget_manager.hpp +++ b/src/widget_manager.hpp @@ -229,8 +229,8 @@ public: void disableWgtScroll( const int TOKEN ); void setWgtXScrollPos( const int TOKEN, const WidgetScrollPos POS ); void setWgtYScrollPos( const int TOKEN, const WidgetScrollPos POS ); - void setWgtXScrollSpeed( const int TOKEN, const float SPEED ); - void setWgtYScrollSpeed( const int TOKEN, const float SPEED ); + void setWgtXScrollSpeed( const int TOKEN, const int SPEED ); + void setWgtYScrollSpeed( const int TOKEN, const int SPEED ); void showWgtTrack( const int TOKEN ); void hideWgtTrack( const int TOKEN );