Removed VS compiler warnings.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4390 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-01-03 03:38:49 +00:00
parent b44d1ded78
commit 20ac0d3230
2 changed files with 4 additions and 4 deletions

View File

@ -59,13 +59,13 @@ void IconButtonWidget::add()
}
int suggested_h = h;
int suggested_w = (useAspectRatio < 0 ? w : useAspectRatio*suggested_h);
int suggested_w = (int)((useAspectRatio < 0 ? w : useAspectRatio*suggested_h));
if (suggested_w > w)
{
const float needed_scale_factor = (float)w / (float)suggested_w;
suggested_w *= needed_scale_factor;
suggested_h *= needed_scale_factor;
suggested_w = (int)(suggested_w*needed_scale_factor);
suggested_h = (int)(suggested_h*needed_scale_factor);
}
const int x_from = x + (w - suggested_w)/2; // center horizontally
const int y_from = y + (h - suggested_h)/2; // center vertically

View File

@ -167,7 +167,7 @@ void RibbonWidget::add()
core::dimension2d< u32 > dim = GUIEngine::getFont()->getDimension( m_children[i].m_text.c_str() );
if ((int)dim.Width > one_button_space)
{
line_count = std::ceil((float)dim.Width/(float)one_button_space);
line_count = (int)(std::ceil((float)dim.Width/(float)one_button_space));
}
const int needed_space_under_button = has_label ? GUIEngine::getFontHeight()*line_count : 10;