From fa48d099f2b66e4d2d9c2c6534aae9f91e0bc33c Mon Sep 17 00:00:00 2001 From: Benau Date: Tue, 17 Oct 2017 10:51:52 +0800 Subject: [PATCH] Fix the remaining msvc warnings --- lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp | 4 ++-- lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp | 2 +- src/graphics/cpu_particle_manager.cpp | 2 +- src/graphics/stk_particle.cpp | 4 ++-- src/scriptengine/script_track.cpp | 4 ++-- src/tracks/check_cannon.cpp | 2 +- src/utils/profiler.cpp | 8 ++++---- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp b/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp index 030b107e2..52c9b5636 100644 --- a/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp +++ b/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp @@ -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 diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp index 411ba1077..162ffd6fc 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp @@ -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); } diff --git a/src/graphics/cpu_particle_manager.cpp b/src/graphics/cpu_particle_manager.cpp index 46c2fe2db..fdd3b275e 100644 --- a/src/graphics/cpu_particle_manager.cpp +++ b/src/graphics/cpu_particle_manager.cpp @@ -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 diff --git a/src/graphics/stk_particle.cpp b/src/graphics/stk_particle.cpp index 5868c46d7..c2883421b 100644 --- a/src/graphics/stk_particle.cpp +++ b/src/graphics/stk_particle.cpp @@ -253,11 +253,11 @@ void STKParticle::generate(std::vector* 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; diff --git a/src/scriptengine/script_track.cpp b/src/scriptengine/script_track.cpp index 114657ba7..a377bade7 100644 --- a/src/scriptengine/script_track.cpp +++ b/src/scriptengine/script_track.cpp @@ -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); } } diff --git a/src/tracks/check_cannon.cpp b/src/tracks/check_cannon.cpp index b28fdf399..8f3757af1 100644 --- a/src/tracks/check_cannon.cpp +++ b/src/tracks/check_cannon.cpp @@ -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 diff --git a/src/utils/profiler.cpp b/src/utils/profiler.cpp index 76af5680b..1c45bc16d 100644 --- a/src/utils/profiler.cpp +++ b/src/utils/profiler.cpp @@ -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