diff --git a/src/guiengine/CGUIFont.cpp b/src/guiengine/CGUIFont.cpp index 567120f9a..783fa5b4a 100644 --- a/src/guiengine/CGUIFont.cpp +++ b/src/guiengine/CGUIFont.cpp @@ -572,7 +572,7 @@ void ScalableFont::draw(const core::stringw& text, const core::rect& positi offsets.push_back(offset); } - offset.X += (area.width + area.overhang + GlobalKerningWidth) * m_scale; + offset.X += (int)((area.width + area.overhang + GlobalKerningWidth) * m_scale); } //SpriteBank->draw2DSpriteBatch(indices, offsets, clip, color); diff --git a/src/guiengine/skin.cpp b/src/guiengine/skin.cpp index 49d8a37eb..4bfa4a89f 100644 --- a/src/guiengine/skin.cpp +++ b/src/guiengine/skin.cpp @@ -589,12 +589,12 @@ void Skin::drawButton(Widget* w, const core::rect< s32 > &rect, const bool press { core::rect< s32 > sized_rect = rect; core::position2d center = core::position2d(irr_driver->getFrameSize()/2); - const float size = sin(m_dialog_size*M_PI_2); + const float size = sin(m_dialog_size*M_PI*0.5f); - sized_rect.UpperLeftCorner.X = center.X + (int)(rect.UpperLeftCorner.X - center.X)*size; - sized_rect.UpperLeftCorner.Y = center.Y + (int)(rect.UpperLeftCorner.Y - center.Y)*size; - sized_rect.LowerRightCorner.X = center.X + (int)(rect.LowerRightCorner.X - center.X)*size; - sized_rect.LowerRightCorner.Y = center.Y + (int)(rect.LowerRightCorner.Y - center.Y)*size; + sized_rect.UpperLeftCorner.X = center.X + (int)((rect.UpperLeftCorner.X - center.X)*size); + sized_rect.UpperLeftCorner.Y = center.Y + (int)((rect.UpperLeftCorner.Y - center.Y)*size); + sized_rect.LowerRightCorner.X = center.X + (int)((rect.LowerRightCorner.X - center.X)*size); + sized_rect.LowerRightCorner.Y = center.Y + (int)((rect.LowerRightCorner.Y - center.Y)*size); if (focused) drawBoxFromStretchableTexture(w, sized_rect, SkinConfig::m_render_params["button::focused"]); @@ -1140,12 +1140,12 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor, bool f if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL && widget->m_parent->getType() == gui::EGUIET_WINDOW) { core::position2d center = core::position2d(irr_driver->getFrameSize()/2); - const float size = sin(m_dialog_size*M_PI_2); + const float size = sin(m_dialog_size*M_PI*0.5f); - borderArea.UpperLeftCorner.X = center.X + (int)(rect.UpperLeftCorner.X - center.X)*size; - borderArea.UpperLeftCorner.Y = center.Y + (int)(rect.UpperLeftCorner.Y - center.Y)*size; - borderArea.LowerRightCorner.X = center.X + (int)(rect.LowerRightCorner.X - center.X)*size; - borderArea.LowerRightCorner.Y = center.Y + (int)(rect.LowerRightCorner.Y - center.Y)*size; + borderArea.UpperLeftCorner.X = center.X + (int)((rect.UpperLeftCorner.X - center.X)*size); + borderArea.UpperLeftCorner.Y = center.Y + (int)((rect.UpperLeftCorner.Y - center.Y)*size); + borderArea.LowerRightCorner.X = center.X + (int)((rect.LowerRightCorner.X - center.X)*size); + borderArea.LowerRightCorner.Y = center.Y + (int)((rect.LowerRightCorner.Y - center.Y)*size); } GUIEngine::getDriver()->draw2DRectangle( colorFocus, borderArea ); @@ -1160,12 +1160,12 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor, bool f if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL && widget->m_parent->getType() == gui::EGUIET_WINDOW) { core::position2d center = core::position2d(irr_driver->getFrameSize()/2); - const float size = sin(m_dialog_size*M_PI_2); + const float size = sin(m_dialog_size*M_PI*0.5f); core::rect< s32 > sizedRect; - sizedRect.UpperLeftCorner.X = center.X + (int)(rect.UpperLeftCorner.X - center.X)*size; - sizedRect.UpperLeftCorner.Y = center.Y + (int)(rect.UpperLeftCorner.Y - center.Y)*size; - sizedRect.LowerRightCorner.X = center.X + (int)(rect.LowerRightCorner.X - center.X)*size; - sizedRect.LowerRightCorner.Y = center.Y + (int)(rect.LowerRightCorner.Y - center.Y)*size; + sizedRect.UpperLeftCorner.X = center.X + (int)((rect.UpperLeftCorner.X - center.X)*size); + sizedRect.UpperLeftCorner.Y = center.Y + (int)((rect.UpperLeftCorner.Y - center.Y)*size); + sizedRect.LowerRightCorner.X = center.X + (int)((rect.LowerRightCorner.X - center.X)*size); + sizedRect.LowerRightCorner.Y = center.Y + (int)((rect.LowerRightCorner.Y - center.Y)*size); GUIEngine::getDriver()->draw2DRectangle( color, sizedRect ); } else @@ -1190,7 +1190,7 @@ void Skin::drawBGFadeColor() { // fade out background SColor color = SkinConfig::m_colors["dialog_background::neutral"]; - if (m_dialog_size < 1.0f) color.setAlpha( color.getAlpha()*m_dialog_size ); + if (m_dialog_size < 1.0f) color.setAlpha( (unsigned int)(color.getAlpha()*m_dialog_size )); GUIEngine::getDriver()->draw2DRectangle( color, core::rect< s32 >(position2d< s32 >(0,0) , GUIEngine::getDriver()->getCurrentRenderTargetSize()) ); @@ -1207,7 +1207,7 @@ core::rect< s32 > Skin::draw3DWindowBackground (IGUIElement *element, bool drawT core::position2d center = sized_rect.getCenter(); const int w = sized_rect.getWidth(); const int h = sized_rect.getHeight(); - const float size = sin(m_dialog_size*M_PI_2); + const float size = sin(m_dialog_size*M_PI*0.5f); sized_rect.UpperLeftCorner.X = (int)(center.X - (w/2.0f)*size); sized_rect.UpperLeftCorner.Y = (int)(center.Y - (h/2.0f)*size); sized_rect.LowerRightCorner.X = (int)(center.X + (w/2.0f)*size); diff --git a/src/ide/vc9/supertuxkart.vcproj b/src/ide/vc9/supertuxkart.vcproj index 960e188cd..a6b964d68 100644 --- a/src/ide/vc9/supertuxkart.vcproj +++ b/src/ide/vc9/supertuxkart.vcproj @@ -296,6 +296,10 @@ RelativePath="..\..\guiengine\abstract_state_manager.cpp" > + + @@ -982,6 +986,10 @@ RelativePath="..\..\guiengine\abstract_state_manager.hpp" > + + diff --git a/src/states_screens/feature_unlocked.cpp b/src/states_screens/feature_unlocked.cpp index 2ffa048c2..76e381908 100644 --- a/src/states_screens/feature_unlocked.cpp +++ b/src/states_screens/feature_unlocked.cpp @@ -189,13 +189,13 @@ void FeatureUnlockedCutScene::onUpdate(float dt, irr::video::IVideoDriver* drive //printf("m_key_angle = %f\n", m_key_angle); m_key->setRotation( core::vector3df(0, m_key_angle*90.0f, -m_key_angle*90.0f) ); - const int GIFT_EXIT_FROM = 7.0f; - const int GIFT_EXIT_TO = 20.0f; + const int GIFT_EXIT_FROM = 7; + const int GIFT_EXIT_TO = 20; if (m_global_time > GIFT_EXIT_FROM && m_global_time < GIFT_EXIT_TO && m_root_gift_node != NULL) { const double chest_top_angle = ((double)(m_global_time - GIFT_EXIT_FROM)*3/(double)GIFT_EXIT_TO)*110.0; - m_chest_top->setRotation( core::vector3df( 360-std::min(110.0, chest_top_angle), 0, 0 )); + m_chest_top->setRotation( core::vector3df( 360.0f-(float)std::min(110.0, chest_top_angle), 0, 0 )); if (chest_top_angle < 110.0) { core::vector3df chestpos = m_chest_top->getPosition(); @@ -204,7 +204,7 @@ void FeatureUnlockedCutScene::onUpdate(float dt, irr::video::IVideoDriver* drive } core::vector3df pos = m_root_gift_node->getPosition(); - pos.Y = sin( (m_global_time - GIFT_EXIT_FROM)*M_PI*1.5/GIFT_EXIT_TO )*50; + pos.Y = sin( (float)((m_global_time - GIFT_EXIT_FROM)*M_PI*1.5/GIFT_EXIT_TO) )*50.0f; pos.X += 5*dt; pos.Z += 5*dt;