Fix the remaining msvc warnings

This commit is contained in:
Benau 2017-10-17 10:51:52 +08:00
parent fb6a0d7631
commit fa48d099f2
7 changed files with 13 additions and 13 deletions

View File

@ -101,12 +101,12 @@ void CAnimatedMeshSceneNode::buildFrameNr(u32 timeMs)
if (FramesPerSecond > 0.f) //forwards...
{
if (CurrentFrameNr > EndFrame)
CurrentFrameNr = StartFrame + fmod(CurrentFrameNr - StartFrame, (f32)(EndFrame-StartFrame));
CurrentFrameNr = StartFrame + fmodf(CurrentFrameNr - StartFrame, (f32)(EndFrame-StartFrame));
}
else //backwards...
{
if (CurrentFrameNr < StartFrame)
CurrentFrameNr = EndFrame - fmod(EndFrame - CurrentFrameNr, (f32)(EndFrame-StartFrame));
CurrentFrameNr = EndFrame - fmodf(EndFrame - CurrentFrameNr, (f32)(EndFrame-StartFrame));
}
}
else

View File

@ -1488,7 +1488,7 @@ void CSkinnedMesh::computeWeightInfluence(SJoint *joint, size_t &index, WeightIn
{
SWeight& weight = joint->Weights[i];
JointInfluence tmp;
tmp.joint_idx = index;
tmp.joint_idx = (int)index;
tmp.weight = weight.strength;
wi[weight.buffer_id][weight.vertex_id].push_back(tmp);
}

View File

@ -302,7 +302,7 @@ void CPUParticleManager::drawAll()
}
glBindVertexArray(std::get<0>(m_gl_particles[p.second]));
glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4,
m_particles_generated.at(p.second).size());
(unsigned)m_particles_generated.at(p.second).size());
}
} // drawAll

View File

@ -253,11 +253,11 @@ void STKParticle::generate(std::vector<CPUParticle>* out)
{
if (m_hm != NULL)
{
stimulateHeightMap(i, active_count, NULL);
stimulateHeightMap((float)i, active_count, NULL);
}
else
{
stimulateNormal(i, active_count, NULL);
stimulateNormal((float)i, active_count, NULL);
}
}
m_first_execution = false;

View File

@ -270,7 +270,7 @@ namespace Scripting
{
if (memory)
{
return ((scene::IAnimatedMeshSceneNode*)(memory))->getFrameNr();
return (int)((scene::IAnimatedMeshSceneNode*)(memory))->getFrameNr();
}
return -1;
}
@ -290,7 +290,7 @@ namespace Scripting
{
if (memory)
{
((scene::IAnimatedMeshSceneNode*)(memory))->setCurrentFrame(frame);
((scene::IAnimatedMeshSceneNode*)(memory))->setCurrentFrame((float)frame);
}
}

View File

@ -159,7 +159,7 @@ void CheckCannon::removeFlyable(Flyable *flyable)
m_all_flyables.end(),
flyable);
assert(i != m_all_flyables.end());
int index = i - m_all_flyables.begin(); // get the index
size_t index = i - m_all_flyables.begin(); // get the index
m_all_flyables.erase(i);
m_flyable_previous_position.erase(m_flyable_previous_position.begin() + index);
} // removeFlyable

View File

@ -180,12 +180,12 @@ void Profiler::pushCPUMarker(const char* name, const video::SColor& colour)
double start = getTimeMilliseconds() - m_time_last_sync;
if (i != td.m_all_event_data.end())
{
i->second.setStart(m_current_frame, start, td.m_event_stack.size());
i->second.setStart(m_current_frame, start, (int)td.m_event_stack.size());
}
else
{
EventData ed(colour, m_max_frames);
ed.setStart(m_current_frame, start, td.m_event_stack.size());
ed.setStart(m_current_frame, start, (int)td.m_event_stack.size());
td.m_all_event_data[name] = ed;
// Ordered headings is used to determine the order in which the
// bar graph is drawn. Outer profiling events will be added first,
@ -392,8 +392,8 @@ void Profiler::draw()
start_xpos += factor*marker.getDuration();
// Reduce vertically the size of the markers according to their layer
pos.UpperLeftCorner.Y += 2 * marker.getLayer();
pos.LowerRightCorner.Y -= 2 * marker.getLayer();
pos.UpperLeftCorner.Y += 2 * (int)marker.getLayer();
pos.LowerRightCorner.Y -= 2 * (int)marker.getLayer();
GL32_draw2DRectangle(j->second.getColour(), pos);
// If the mouse cursor is over the marker, get its information