Fixed compiler warnings on VS.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14602 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
77db3a2a6e
commit
ad0fd41d52
@ -198,7 +198,7 @@ void BubbleEffectProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
}
|
||||
else
|
||||
{
|
||||
transparency = 1.0 - diff;
|
||||
transparency = 1.0f - diff;
|
||||
}
|
||||
|
||||
transparency = clampf(transparency, 0, 1);
|
||||
@ -211,7 +211,7 @@ void BubbleEffectProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
|
||||
void RainEffectProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
{
|
||||
const float screenw = UserConfigParams::m_width;
|
||||
const float screenw = (float)UserConfigParams::m_width;
|
||||
const float time = irr_driver->getDevice()->getTimer()->getTime() / 90.0f;
|
||||
const matrix4 viewm = srv->getVideoDriver()->getTransform(ETS_VIEW);
|
||||
const vector3df campos = irr_driver->getSceneManager()->getActiveCamera()->getPosition();
|
||||
@ -286,8 +286,8 @@ void MipVizProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
const dimension2du size = tex->getSize();
|
||||
|
||||
const float texsize[2] = {
|
||||
size.Width,
|
||||
size.Height
|
||||
(float)size.Width,
|
||||
(float)size.Height
|
||||
};
|
||||
|
||||
srv->setVertexShaderConstant("texsize", texsize, 2);
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
|
||||
bool contains(const scene::IMeshBuffer * const mb) const
|
||||
{
|
||||
return m_bubbles.count(mb);
|
||||
return m_bubbles.count(mb)!=0;
|
||||
}
|
||||
|
||||
private:
|
||||
@ -282,7 +282,7 @@ public:
|
||||
m_pixel[1] = 1.0f / UserConfigParams::m_height;
|
||||
}
|
||||
|
||||
void setResolution(float x, float y)
|
||||
void setResolution(int x, int y)
|
||||
{
|
||||
m_pixel[0] = 1.0f / x;
|
||||
m_pixel[1] = 1.0f / y;
|
||||
@ -327,10 +327,10 @@ class GlowProvider: public CallBase
|
||||
public:
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
|
||||
|
||||
void setResolution(float x, float y)
|
||||
void setResolution(int x, int y)
|
||||
{
|
||||
m_res[0] = x;
|
||||
m_res[1] = y;
|
||||
m_res[0] = (float)x;
|
||||
m_res[1] = (float)y;
|
||||
}
|
||||
|
||||
private:
|
||||
@ -360,8 +360,8 @@ class PointLightProvider: public CallBase
|
||||
public:
|
||||
PointLightProvider()
|
||||
{
|
||||
m_screen[0] = UserConfigParams::m_width;
|
||||
m_screen[1] = UserConfigParams::m_height;
|
||||
m_screen[0] = (float)UserConfigParams::m_width;
|
||||
m_screen[1] = (float)UserConfigParams::m_height;
|
||||
|
||||
m_specular = 200;
|
||||
}
|
||||
@ -426,8 +426,8 @@ class SunLightProvider: public CallBase
|
||||
public:
|
||||
SunLightProvider()
|
||||
{
|
||||
m_screen[0] = UserConfigParams::m_width;
|
||||
m_screen[1] = UserConfigParams::m_height;
|
||||
m_screen[0] = (float)UserConfigParams::m_width;
|
||||
m_screen[1] = (float)UserConfigParams::m_height;
|
||||
|
||||
m_wind[0] = m_wind[1] = 0;
|
||||
}
|
||||
@ -580,7 +580,7 @@ class CollapseProvider: public CallBase
|
||||
public:
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
|
||||
|
||||
void setResolution(const float x, const float y)
|
||||
void setResolution(const int x, const int y)
|
||||
{
|
||||
m_pixel[0] = 1.0f / x;
|
||||
m_pixel[1] = 1.0f / y;
|
||||
@ -599,7 +599,7 @@ public:
|
||||
std::swap(m_multi[0], m_multi[1]);
|
||||
}
|
||||
|
||||
m_size = std::max(x, y);
|
||||
m_size = (int)std::max(x, y);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -662,8 +662,8 @@ public:
|
||||
|
||||
DisplaceProvider()
|
||||
{
|
||||
m_screen[0] = UserConfigParams::m_width;
|
||||
m_screen[1] = UserConfigParams::m_height;
|
||||
m_screen[0] = (float)UserConfigParams::m_width;
|
||||
m_screen[1] = (float)UserConfigParams::m_height;
|
||||
|
||||
m_dir[0] = m_dir[1] = m_dir2[0] = m_dir2[1] = 0;
|
||||
}
|
||||
|
@ -1422,7 +1422,7 @@ void IrrDriver::displayFPS()
|
||||
else
|
||||
{
|
||||
sprintf(buffer, "FPS: %i/%i/%i - %i KTris", min, fps, max,
|
||||
(int)round(kilotris));
|
||||
(int)roundf(kilotris));
|
||||
}
|
||||
|
||||
core::stringw fpsString = buffer;
|
||||
|
@ -188,7 +188,7 @@ class WindAffector : public scene::IParticleAffector
|
||||
public:
|
||||
WindAffector(float speed): m_speed(speed)
|
||||
{
|
||||
m_seed = (rand() % 1000) - 500;
|
||||
m_seed = (float)((rand() % 1000) - 500);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -390,7 +390,7 @@ void PostProcessing::render()
|
||||
if (globalbloom || bloomsize)
|
||||
{
|
||||
// Clear the alpha to a suitable value, stencil
|
||||
glClearColor(0, 0, 0, 0.1);
|
||||
glClearColor(0, 0, 0, 0.1f);
|
||||
glColorMask(0, 0, 0, 1);
|
||||
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
@ -79,8 +79,8 @@ public:
|
||||
buf.Vertices[i] = S3DVertex(x, y, z, 0, 0, 0, SColor(255, 255, 0, 0), 0, 0);
|
||||
}
|
||||
|
||||
box.addInternalPoint(vector3df(-area/2));
|
||||
box.addInternalPoint(vector3df(area/2));
|
||||
box.addInternalPoint(vector3df((float)(-area/2)));
|
||||
box.addInternalPoint(vector3df((float)( area/2)));
|
||||
}
|
||||
|
||||
~RainNode()
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
buf.Vertices[i] = S3DVertex(xpos, ypos, 0, 0, 0, 0,
|
||||
SColor(255, 255, 255, 255), 0, 0);
|
||||
|
||||
glVertex2s(roundf(xpos * 32767), roundf(ypos * 32767));
|
||||
glVertex2s((int)roundf(xpos * 32767), (int)roundf(ypos * 32767));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
Wind::Wind()
|
||||
{
|
||||
m_seed = (rand() % 1000) - 500;
|
||||
m_seed = (float)((rand() % 1000) - 500);
|
||||
}
|
||||
|
||||
vector3df Wind::getWind() const
|
||||
|
@ -323,10 +323,10 @@ void LayoutManager::applyCoords(Widget* self, AbstractTopLevelContainer* topLeve
|
||||
else if (self->m_relative_y > -1) self->m_y = (int)(parent_y + parent_h*self->m_relative_y/100);
|
||||
|
||||
if (self->m_absolute_w > -1) self->m_w = self->m_absolute_w;
|
||||
else if (self->m_relative_w > -1) self->m_w = (int)round(parent_w*self->m_relative_w/100.0);
|
||||
else if (self->m_relative_w > -1) self->m_w = (int)roundf(parent_w*self->m_relative_w/100.0);
|
||||
|
||||
if (self->m_absolute_h > -1) self->m_h = self->m_absolute_h;
|
||||
else if (self->m_relative_h > -1) self->m_h = (int)round(parent_h*self->m_relative_h/100.0);
|
||||
else if (self->m_relative_h > -1) self->m_h = (int)roundf(parent_h*self->m_relative_h/100.0);
|
||||
|
||||
// ---- can't make widget bigger than parent
|
||||
if (self->m_h > (int)parent_h)
|
||||
|
@ -327,7 +327,7 @@ void DynamicRibbonWidget::buildInternalStructure()
|
||||
// ---- determine column amount
|
||||
const float row_height = (float)(m_h - m_label_height)/(float)m_row_amount;
|
||||
float ratio_zoom = (float)row_height / (float)(m_child_height - m_label_height);
|
||||
m_col_amount = (int)round( m_w / ( m_child_width*ratio_zoom ) );
|
||||
m_col_amount = (int)roundf( m_w / ( m_child_width*ratio_zoom ) );
|
||||
|
||||
// ajust column amount to not add more item slots than we actually need
|
||||
const int item_count = m_items.size();
|
||||
@ -810,7 +810,7 @@ void DynamicRibbonWidget::propagateSelection()
|
||||
{
|
||||
if (ribbon != selected_ribbon)
|
||||
{
|
||||
ribbon->m_selection[p] = (int)round(where*(ribbon->m_children.size()-1));
|
||||
ribbon->m_selection[p] = (int)roundf(where*(ribbon->m_children.size()-1));
|
||||
ribbon->updateSelection();
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ void RibbonWidget::add()
|
||||
//free_w_space = (int)(m_w - total_needed_space*global_zoom);
|
||||
|
||||
const int one_button_space =
|
||||
(int)round((float)m_w / (float)subbuttons_amount);
|
||||
(int)roundf((float)m_w / (float)subbuttons_amount);
|
||||
|
||||
int widget_x = -1;
|
||||
|
||||
|
@ -134,10 +134,10 @@ static inline float permute(float x) {
|
||||
float noise2d(float v1, float v2) {
|
||||
|
||||
const float C[] = {
|
||||
0.211324865405187,
|
||||
0.366025403784439,
|
||||
-0.577350269189626,
|
||||
0.024390243902439 };
|
||||
0.211324865405187f,
|
||||
0.366025403784439f,
|
||||
-0.577350269189626f,
|
||||
0.024390243902439f };
|
||||
|
||||
// First corner
|
||||
float i[2];
|
||||
@ -174,9 +174,9 @@ float noise2d(float v1, float v2) {
|
||||
p[2] = permute(permute(i[1] + 1) + i[0] + 1);
|
||||
|
||||
float m[3];
|
||||
m[0] = std::max<float>(0.5 - x0[0]*x0[0] - x0[1]*x0[1], 0);
|
||||
m[1] = std::max<float>(0.5 - x12[0]*x12[0] - x12[1]*x12[1], 0);
|
||||
m[2] = std::max<float>(0.5 - x12[2]*x12[2] - x12[3]*x12[3], 0);
|
||||
m[0] = std::max<float>(0.5f - x0[0]*x0[0] - x0[1]*x0[1], 0);
|
||||
m[1] = std::max<float>(0.5f - x12[0]*x12[0] - x12[1]*x12[1], 0);
|
||||
m[2] = std::max<float>(0.5f - x12[2]*x12[2] - x12[3]*x12[3], 0);
|
||||
|
||||
m[0] = m[0] * m[0] * m[0] * m[0];
|
||||
m[1] = m[1] * m[1] * m[1] * m[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user