From f873521f1d34adafe16be18dcc08545556d66e67 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 13 May 2010 22:14:36 +0200 Subject: [PATCH] Changed: #825 Remove all warning when compiling Ryzom on Linux --- code/nel/src/3d/animation.cpp | 8 +-- code/nel/src/3d/animation_optimizer.cpp | 8 +-- code/nel/src/3d/animation_set.cpp | 10 ++-- code/nel/src/3d/async_texture_manager.cpp | 8 +-- code/nel/src/3d/channel_mixer.cpp | 4 +- code/nel/src/3d/coarse_mesh_build.cpp | 2 +- code/nel/src/3d/deform_2d.cpp | 4 +- .../direct3d/driver_direct3d_material.cpp | 4 +- .../direct3d/driver_direct3d_shader.cpp | 6 +-- .../driver_direct3d_vertex_program.cpp | 2 +- .../opengl/driver_opengl_vertex_program.cpp | 6 +-- code/nel/src/3d/driver_user.cpp | 4 +- code/nel/src/3d/dru.cpp | 4 +- code/nel/src/3d/fast_ptr_list.cpp | 4 +- code/nel/src/3d/font_manager.cpp | 2 +- code/nel/src/3d/hls_texture_bank.cpp | 10 ++-- code/nel/src/3d/ig_surface_light_build.cpp | 6 +-- code/nel/src/3d/instance_lighter.cpp | 8 +-- code/nel/src/3d/landscape.cpp | 4 +- .../src/3d/landscape_face_vector_manager.cpp | 2 +- .../src/3d/light_influence_interpolator.cpp | 4 +- code/nel/src/3d/lod_character_builder.cpp | 2 +- code/nel/src/3d/lod_character_manager.cpp | 2 +- code/nel/src/3d/lod_character_shape.cpp | 6 +-- code/nel/src/3d/lod_character_shape_bank.cpp | 4 +- code/nel/src/3d/material.cpp | 2 +- code/nel/src/3d/mesh.cpp | 18 +++---- code/nel/src/3d/mesh_base.cpp | 6 +-- code/nel/src/3d/mesh_base_instance.cpp | 12 ++--- code/nel/src/3d/mesh_block_manager.cpp | 6 +-- code/nel/src/3d/mesh_morpher.cpp | 2 +- code/nel/src/3d/mesh_mrm.cpp | 52 +++++++++---------- code/nel/src/3d/mesh_mrm_skin.cpp | 2 +- code/nel/src/3d/mesh_mrm_skin_template.cpp | 4 +- code/nel/src/3d/mesh_mrm_skinned.cpp | 34 ++++++------ code/nel/src/3d/mesh_multi_lod.cpp | 8 +-- code/nel/src/3d/mesh_multi_lod_instance.cpp | 2 +- code/nel/src/3d/mrm_builder.cpp | 32 ++++++------ code/nel/src/3d/mrm_internal.cpp | 8 +-- code/nel/src/3d/mrm_mesh.cpp | 2 +- code/nel/src/3d/packed_zone.cpp | 18 +++---- code/nel/src/3d/particle_system.cpp | 10 ++-- code/nel/src/3d/particle_system_shape.cpp | 2 +- code/nel/src/3d/patch_vegetable.cpp | 4 +- code/nel/src/3d/point_light_named_array.cpp | 4 +- code/nel/src/3d/portal.cpp | 4 +- code/nel/src/3d/ps_color.cpp | 2 +- code/nel/src/3d/ps_emitter.cpp | 48 ++++++++--------- code/nel/src/3d/ps_face.cpp | 6 +-- code/nel/src/3d/ps_float.cpp | 2 +- code/nel/src/3d/ps_located.cpp | 14 ++--- code/nel/src/3d/ps_mesh.cpp | 10 ++-- code/nel/src/3d/ps_ribbon.cpp | 12 ++--- code/nel/src/3d/ps_zone.cpp | 10 ++-- code/nel/src/3d/quad_effect.cpp | 2 +- code/nel/src/3d/ray_mesh.cpp | 4 +- code/nel/src/3d/scene.cpp | 16 +++--- code/nel/src/3d/scene_group.cpp | 20 +++---- code/nel/src/3d/shadow_map_manager.cpp | 2 +- code/nel/src/3d/shadow_poly_receiver.cpp | 14 ++--- code/nel/src/3d/shadow_skin.cpp | 2 +- code/nel/src/3d/shape_bank.cpp | 2 +- code/nel/src/3d/skeleton_model.cpp | 4 +- code/nel/src/3d/skeleton_shape.cpp | 2 +- code/nel/src/3d/skeleton_spawn_script.cpp | 4 +- code/nel/src/3d/skeleton_weight.cpp | 2 +- code/nel/src/3d/text_context.cpp | 4 +- code/nel/src/3d/texture_font.cpp | 2 +- code/nel/src/3d/texture_near.cpp | 2 +- code/nel/src/3d/tile_bank.cpp | 18 +++---- code/nel/src/3d/tile_vegetable_desc.cpp | 2 +- code/nel/src/3d/track_sampled_common.cpp | 8 +-- code/nel/src/3d/track_sampled_quat.cpp | 4 +- code/nel/src/3d/track_sampled_vector.cpp | 4 +- code/nel/src/3d/transform.cpp | 2 +- code/nel/src/3d/u_instance.cpp | 2 +- code/nel/src/3d/u_skeleton.cpp | 2 +- code/nel/src/3d/vegetable_manager.cpp | 8 +-- code/nel/src/3d/vegetablevb_allocator.cpp | 2 +- code/nel/src/3d/vertex_buffer.cpp | 2 +- code/nel/src/3d/visual_collision_entity.cpp | 2 +- code/nel/src/3d/visual_collision_mesh.cpp | 2 +- code/nel/src/3d/water_model.cpp | 22 ++++---- code/nel/src/3d/water_pool_manager.cpp | 4 +- code/nel/src/3d/zone.cpp | 16 +++--- code/nel/src/3d/zone_lighter.cpp | 34 ++++++------ code/nel/src/georges/form.cpp | 2 +- code/nel/src/georges/form_dfn.cpp | 16 +++--- code/nel/src/georges/form_elm.cpp | 8 +-- code/nel/src/georges/type.cpp | 14 ++--- code/nel/src/ligo/ligo_error.cpp | 2 +- code/nel/src/ligo/primitive.cpp | 16 +++--- code/nel/src/ligo/primitive_configuration.cpp | 4 +- code/nel/src/ligo/zone_edge.cpp | 2 +- code/nel/src/ligo/zone_edge.h | 2 +- code/nel/src/ligo/zone_template.cpp | 4 +- code/nel/src/logic/logic_state_machine.cpp | 2 +- 97 files changed, 374 insertions(+), 374 deletions(-) diff --git a/code/nel/src/3d/animation.cpp b/code/nel/src/3d/animation.cpp index ac495f818..551387bb1 100644 --- a/code/nel/src/3d/animation.cpp +++ b/code/nel/src/3d/animation.cpp @@ -189,7 +189,7 @@ TAnimationTime CAnimation::getBeginTime () const if (_BeginTimeTouched) { // Track count - uint trackCount=_TrackVector.size(); + uint trackCount=(uint)_TrackVector.size(); // Track count empty ? if (trackCount==0) @@ -220,7 +220,7 @@ TAnimationTime CAnimation::getEndTime () const if (_EndTimeTouched) { // Track count - uint trackCount=_TrackVector.size(); + uint trackCount=(uint)_TrackVector.size(); // Track count empty ? if (trackCount==0) @@ -254,7 +254,7 @@ bool CAnimation::allTrackLoop() const if(_AnimLoopTouched) { // Track count - uint trackCount=_TrackVector.size(); + uint trackCount=(uint)_TrackVector.size(); // Default is true _AnimLoop= true; @@ -393,7 +393,7 @@ void CAnimation::applyTrackQuatHeaderCompression() _TrackSamplePack= new CTrackSamplePack; // just copy the built track headers - _TrackSamplePack->TrackHeaders.resize(sampleCounter.TrackHeaders.size()); + _TrackSamplePack->TrackHeaders.resize((uint32)sampleCounter.TrackHeaders.size()); for(i=0;i<_TrackSamplePack->TrackHeaders.size();i++) { _TrackSamplePack->TrackHeaders[i]= sampleCounter.TrackHeaders[i]; diff --git a/code/nel/src/3d/animation_optimizer.cpp b/code/nel/src/3d/animation_optimizer.cpp index 46dafe868..f69b1af62 100644 --- a/code/nel/src/3d/animation_optimizer.cpp +++ b/code/nel/src/3d/animation_optimizer.cpp @@ -319,7 +319,7 @@ void CAnimationOptimizer::sampleQuatTrack(const ITrack *trackIn, float beginTim // *************************************************************************** bool CAnimationOptimizer::testConstantQuatTrack() { - uint numSamples= _QuatKeyList.size(); + uint numSamples= (uint)_QuatKeyList.size(); nlassert(numSamples>0); // Get the first sample as the reference quaternion, and test others from this one. @@ -339,7 +339,7 @@ bool CAnimationOptimizer::testConstantQuatTrack() // *************************************************************************** void CAnimationOptimizer::optimizeQuatTrack() { - uint numSamples= _QuatKeyList.size(); + uint numSamples= (uint)_QuatKeyList.size(); nlassert(numSamples>0); // <=2 key? => no opt possible.. @@ -477,7 +477,7 @@ void CAnimationOptimizer::sampleVectorTrack(const ITrack *trackIn, float beginT // *************************************************************************** bool CAnimationOptimizer::testConstantVectorTrack() { - uint numSamples= _VectorKeyList.size(); + uint numSamples= (uint)_VectorKeyList.size(); nlassert(numSamples>0); // Get the first sample as the reference Vectorer, and test others from this one. @@ -497,7 +497,7 @@ bool CAnimationOptimizer::testConstantVectorTrack() // *************************************************************************** void CAnimationOptimizer::optimizeVectorTrack() { - uint numSamples= _VectorKeyList.size(); + uint numSamples= (uint)_VectorKeyList.size(); nlassert(numSamples>0); // <=2 key? => no opt possible.. diff --git a/code/nel/src/3d/animation_set.cpp b/code/nel/src/3d/animation_set.cpp index cebe14893..1b0c54760 100644 --- a/code/nel/src/3d/animation_set.cpp +++ b/code/nel/src/3d/animation_set.cpp @@ -54,7 +54,7 @@ CAnimationSet::~CAnimationSet () // *************************************************************************** uint CAnimationSet::getNumChannelId () const { - return _ChannelIdByName.size (); + return (uint)_ChannelIdByName.size (); } // *************************************************************************** @@ -76,10 +76,10 @@ uint CAnimationSet::addAnimation (const char* name, CAnimation* animation) _AnimationName.push_back (name); // Add an entry name / animation - _AnimationIdByName.insert (std::map ::value_type (name, _Animation.size()-1)); + _AnimationIdByName.insert (std::map ::value_type (name, (uint32)_Animation.size()-1)); // Return animation id - return _Animation.size()-1; + return (uint)_Animation.size()-1; } // *************************************************************************** @@ -90,10 +90,10 @@ uint CAnimationSet::addSkeletonWeight (const char* name, CSkeletonWeight* skelet _SkeletonWeightName.push_back (name); // Add an entry name / animation - _SkeletonWeightIdByName.insert (std::map ::value_type (name, _SkeletonWeight.size()-1)); + _SkeletonWeightIdByName.insert (std::map ::value_type (name, (uint32)_SkeletonWeight.size()-1)); // Return animation id - return _SkeletonWeight.size()-1; + return (uint)_SkeletonWeight.size()-1; } // *************************************************************************** diff --git a/code/nel/src/3d/async_texture_manager.cpp b/code/nel/src/3d/async_texture_manager.cpp index 1360c3bea..a08375371 100644 --- a/code/nel/src/3d/async_texture_manager.cpp +++ b/code/nel/src/3d/async_texture_manager.cpp @@ -157,7 +157,7 @@ uint CAsyncTextureManager::addTextureRef(const string &textNameNotLwr, CMeshBa if(it==_TextureEntryMap.end()) { // search a free id. - uint i= _TextureEntries.size(); + uint i= (uint)_TextureEntries.size(); if(!_FreeTextureIds.empty()) { i= _FreeTextureIds.back(); @@ -301,7 +301,7 @@ void CAsyncTextureManager::releaseTexture(uint id, CMeshBaseInstance *instance // find an instance in this texture an remove it. CTextureEntry *text= _TextureEntries[id]; - uint instSize= text->Instances.size(); + uint instSize= (uint)text->Instances.size(); for(uint i=0;iInstances[i]== instance) @@ -701,7 +701,7 @@ void CAsyncTextureManager::updateTextureLodSystem(IDriver *pDriver) uint pivot= 0; uint currentWantedSize= currentBaseSize; uint currentLoadedSize= currentBaseSize; - for(i=lodArray.size()-1;i>=0;i--) + for(i=(sint)lodArray.size()-1;i>=0;i--) { uint lodSize= lodArray[i].Lod->ExtraSize; currentWantedSize+= lodSize; @@ -731,7 +731,7 @@ void CAsyncTextureManager::updateTextureLodSystem(IDriver *pDriver) { unload= false; // search from end of the list to pivot (included), the first LOD (ie the most important) to load. - for(i=lodArray.size()-1;i>=(sint)pivot;i--) + for(i=(sint)lodArray.size()-1;i>=(sint)pivot;i--) { if(!lodArray[i].Lod->UpLoaded) { diff --git a/code/nel/src/3d/channel_mixer.cpp b/code/nel/src/3d/channel_mixer.cpp index 7264131a5..bb04aa76e 100644 --- a/code/nel/src/3d/channel_mixer.cpp +++ b/code/nel/src/3d/channel_mixer.cpp @@ -187,7 +187,7 @@ void CChannelMixer::eval (bool detail, uint64 evalDetailDate) uint numChans; if(detail) { - numChans= _DetailListToEval.size(); + numChans= (uint)_DetailListToEval.size(); if(numChans) channelArrayPtr= &_DetailListToEval[0]; else @@ -195,7 +195,7 @@ void CChannelMixer::eval (bool detail, uint64 evalDetailDate) } else { - numChans= _GlobalListToEval.size(); + numChans= (uint)_GlobalListToEval.size(); if(numChans) channelArrayPtr= &_GlobalListToEval[0]; else diff --git a/code/nel/src/3d/coarse_mesh_build.cpp b/code/nel/src/3d/coarse_mesh_build.cpp index a7b90feed..14c2da789 100644 --- a/code/nel/src/3d/coarse_mesh_build.cpp +++ b/code/nel/src/3d/coarse_mesh_build.cpp @@ -35,7 +35,7 @@ bool CCoarseMeshBuild::build (const std::vector& coarseMeshes, return false; // 2. remap coordinates - remapCoordinates (coarseMeshes, desc, bitmaps.size ()); + remapCoordinates (coarseMeshes, desc, (uint)bitmaps.size ()); // 3. ok return true; diff --git a/code/nel/src/3d/deform_2d.cpp b/code/nel/src/3d/deform_2d.cpp index ae7352b70..dcaf2067a 100644 --- a/code/nel/src/3d/deform_2d.cpp +++ b/code/nel/src/3d/deform_2d.cpp @@ -134,7 +134,7 @@ void CDeform2d::doDeform(const TPoint2DVect &surf, IDriver *drv, IPerturbUV *uvp /** setup the whole vertex buffer * we don't share vertices here, as we work with unaligned quads */ - vb.setNumVertices(dest.size() << 2); + vb.setNumVertices((uint32)dest.size() << 2); mat.setTexture(0, _Tex); { CVertexBufferReadWrite vba; @@ -173,7 +173,7 @@ void CDeform2d::doDeform(const TPoint2DVect &surf, IDriver *drv, IPerturbUV *uvp } drv->activeVertexBuffer(vb); - drv->renderRawQuads(mat, 0, dest.size()); + drv->renderRawQuads(mat, 0, (uint32)dest.size()); } } // NL3D diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index 33af72d22..8a9e864cc 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -1401,7 +1401,7 @@ bool CDriverD3D::needsConstants (uint &numConstant, uint &firstConstant, uint &s alphaPipe[0].clear(); } add(rgbPipe[0], alphaPipe[0]); - numConstant = rgbPipe[0].size(); + numConstant = (uint)rgbPipe[0].size(); if (numConstant) { firstConstant = *(rgbPipe[0].begin()); @@ -1919,7 +1919,7 @@ IDirect3DPixelShader9 *CDriverD3D::buildPixelShader (const CNormalShaderDesc &no // Assemble and create the shader LPD3DXBUFFER pShader; LPD3DXBUFFER pErrorMsgs; - if (D3DXAssembleShader (shaderText.c_str(), shaderText.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) + if (D3DXAssembleShader (shaderText.c_str(), (UINT)shaderText.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) { IDirect3DPixelShader9 *shader; if (_DeviceInterface->CreatePixelShader((DWORD*)pShader->GetBufferPointer(), &shader) == D3D_OK) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 67cd20b0c..4bb65d436 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -167,7 +167,7 @@ HRESULT CDriverD3D::SetTexture (DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) H_AUTO_D3D(CDriverD3D_SetTexture ) // Look for the current texture uint i; - const uint count = _CurrentShaderTextures.size(); + const uint count = (uint)_CurrentShaderTextures.size(); for (i=0; igetText(), strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs) + if (D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs) == D3D_OK) { // Get the texture handle @@ -3713,7 +3713,7 @@ HRESULT STDMETHODCALLTYPE CFXPassRecorder::SetTexture(DWORD Stage, LPDIRECT3DBAS nlassert(Target); // Look for the current texture uint i; - const uint count = Driver->getCurrentShaderTextures().size(); + const uint count = (uint)Driver->getCurrentShaderTextures().size(); for (i=0; igetCurrentShaderTextures()[i]; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp index 2a8c081b1..f0e68cd20 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp @@ -334,7 +334,7 @@ bool CDriverD3D::activeVertexProgram (CVertexProgram *program) LPD3DXBUFFER pShader; LPD3DXBUFFER pErrorMsgs; - if (D3DXAssembleShader (dest.c_str(), dest.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) + if (D3DXAssembleShader (dest.c_str(), (UINT)dest.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) { if (_DeviceInterface->CreateVertexShader((DWORD*)pShader->GetBufferPointer(), &(getVertexProgramD3D(*program)->Shader)) != D3D_OK) return false; diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index e02920f78..cf6855ab2 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -120,7 +120,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) program->_DrvInfo=drvInfo; // Compile the program - nglLoadProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID, program->getProgram().length(), (const GLubyte*)program->getProgram().c_str()); + nglLoadProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID, (GLsizei)program->getProgram().length(), (const GLubyte*)program->getProgram().c_str()); // Get loading error code GLint errorOff; @@ -130,7 +130,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) if (errorOff>=0) { // String length - uint length = program->getProgram ().length(); + uint length = (uint)program->getProgram ().length(); const char* sString= program->getProgram ().c_str(); // Line count and char count @@ -1392,7 +1392,7 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra // nglBindProgramARB( GL_VERTEX_PROGRAM_ARB, id); glGetError(); - nglProgramStringARB( GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, code.size(), code.c_str() ); + nglProgramStringARB( GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)code.size(), code.c_str() ); GLenum err = glGetError(); if (err != GL_NO_ERROR) { diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 69d75d1aa..fce33c526 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -861,7 +861,7 @@ void CDriverUser::drawQuads(const std::vector &q, UMater H_AUTO2; const CQuadColorUV *qptr = &(q[0]); - drawQuads(qptr , q.size(), mat); + drawQuads(qptr , (uint32)q.size(), mat); } // *************************************************************************** @@ -870,7 +870,7 @@ void CDriverUser::drawQuads(const std::vector &q, UMate H_AUTO2; const CQuadColorUV2 *qptr = &(q[0]); - drawQuads(qptr , q.size(), mat); + drawQuads(qptr , (uint32)q.size(), mat); } // *************************************************************************** diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 3ddff9128..5e18f760b 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -490,7 +490,7 @@ void CDRU::drawTrianglesUnlit(const std::vector &trilist, if(trilist.size()==0) return; - CDRU::drawTrianglesUnlit( &(*trilist.begin()), trilist.size(), mat, driver); + CDRU::drawTrianglesUnlit( &(*trilist.begin()), (uint)trilist.size(), mat, driver); } @@ -529,7 +529,7 @@ void CDRU::drawLinesUnlit(const std::vector &linelist, CMateria { if(linelist.size()==0) return; - CDRU::drawLinesUnlit( &(*linelist.begin()), linelist.size(), mat, driver); + CDRU::drawLinesUnlit( &(*linelist.begin()), (sint)linelist.size(), mat, driver); } // *************************************************************************** void CDRU::drawLine(const CVector &a, const CVector &b, CRGBA color, IDriver& driver) diff --git a/code/nel/src/3d/fast_ptr_list.cpp b/code/nel/src/3d/fast_ptr_list.cpp index 40e5095b5..b4df6c152 100644 --- a/code/nel/src/3d/fast_ptr_list.cpp +++ b/code/nel/src/3d/fast_ptr_list.cpp @@ -71,7 +71,7 @@ void CFastPtrListBase::insert(void *element, CFastPtrListNode *node) _Elements.push_back(element); _Nodes.push_back(node); node->_Owner= this; - node->_IndexInOwner= _Nodes.size()-1; + node->_IndexInOwner= (uint32)_Nodes.size()-1; } // *************************************************************************** @@ -83,7 +83,7 @@ void CFastPtrListBase::erase(CFastPtrListNode *node) // Take the indexes, uint nodeIndex= node->_IndexInOwner; - uint lastIndex= _Nodes.size()-1; + uint lastIndex= (uint)_Nodes.size()-1; // swap the last element and the erased one. swap(_Elements[nodeIndex], _Elements[lastIndex]); diff --git a/code/nel/src/3d/font_manager.cpp b/code/nel/src/3d/font_manager.cpp index 882992a04..92de5f44d 100644 --- a/code/nel/src/3d/font_manager.cpp +++ b/code/nel/src/3d/font_manager.cpp @@ -100,7 +100,7 @@ void CFontManager::computeString (const ucstring &s, } // Setting vertices format - output.Vertices.setNumVertices (4 * s.size()); + output.Vertices.setNumVertices (4 * (uint32)s.size()); // 1 character <-> 1 quad sint32 penx = 0, dx; diff --git a/code/nel/src/3d/hls_texture_bank.cpp b/code/nel/src/3d/hls_texture_bank.cpp index f14c05510..fe8eee1a5 100644 --- a/code/nel/src/3d/hls_texture_bank.cpp +++ b/code/nel/src/3d/hls_texture_bank.cpp @@ -47,7 +47,7 @@ void CHLSTextureBank::reset() uint32 CHLSTextureBank::addColorTexture(const CHLSColorTexture &tex) { _ColorTextures.push_back(tex); - return _ColorTextures.size()-1; + return (uint32)_ColorTextures.size()-1; } // *************************************************************************** void CHLSTextureBank::addTextureInstance(const std::string &name, uint32 colorTextureId, const vector &cols) @@ -62,14 +62,14 @@ void CHLSTextureBank::addTextureInstance(const std::string &name, uint32 color // new instance CTextureInstance textInst; textInst._ColorTextureId= colorTextureId; - textInst._DataIndex= _TextureInstanceData.size(); + textInst._DataIndex= (uint32)_TextureInstanceData.size(); // leave ptrs undefined textInst._DataPtr= NULL; textInst._ColorTexturePtr= NULL; // allocate/fill data - uint32 nameSize= (nameLwr.size()+1); - uint32 colSize= cols.size()*sizeof(CHLSColorDelta); + uint32 nameSize= (uint32)(nameLwr.size()+1); + uint32 colSize= (uint32)cols.size()*sizeof(CHLSColorDelta); _TextureInstanceData.resize(_TextureInstanceData.size() + nameSize + colSize); // copy name memcpy(&_TextureInstanceData[textInst._DataIndex], nameLwr.c_str(), nameSize); @@ -176,7 +176,7 @@ bool CHLSTextureBank::CTextureInstance::sameName(const char *str) void CHLSTextureBank::CTextureInstance::buildColorVersion(NLMISC::CBitmap &out) { // get ptr to color deltas. - uint nameSize= strlen((const char*)_DataPtr)+1; + uint nameSize= (uint)strlen((const char*)_DataPtr)+1; CHLSColorDelta *colDeltas= (CHLSColorDelta*)(_DataPtr + nameSize); // build the texture. diff --git a/code/nel/src/3d/ig_surface_light_build.cpp b/code/nel/src/3d/ig_surface_light_build.cpp index 3f8cf5575..1cc388aa1 100644 --- a/code/nel/src/3d/ig_surface_light_build.cpp +++ b/code/nel/src/3d/ig_surface_light_build.cpp @@ -51,7 +51,7 @@ void CIGSurfaceLightBuild::buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, // Resize vector. uint wVert= surface.Width; uint hVert= surface.Height; - uint vId0= meshBuild.Vertices.size(); + uint vId0= (uint)meshBuild.Vertices.size(); // Allocate vertices / colors meshBuild.Vertices.resize(vId0 + wVert*hVert); vector colors; @@ -98,7 +98,7 @@ void CIGSurfaceLightBuild::buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMes meshBuild.VertexFlags= CVertexBuffer::PositionFlag | CVertexBuffer::PrimaryColorFlag; // Get the number of lights in Ig. - uint numLight= igOut.getPointLightList().size(); + uint numLight= (uint)igOut.getPointLightList().size(); numLight= raiseToNextPowerOf2(numLight); uint idMultiplier= 256/ numLight; @@ -132,7 +132,7 @@ void CIGSurfaceLightBuild::buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMes // Resize vector. uint wVert= surface.Width; uint hVert= surface.Height; - uint vId0= meshBuild.Vertices.size(); + uint vId0= (uint)meshBuild.Vertices.size(); // Allocate vertices / colors meshBuild.Vertices.resize(vId0 + wVert*hVert); vector colors; diff --git a/code/nel/src/3d/instance_lighter.cpp b/code/nel/src/3d/instance_lighter.cpp index af3f406d5..47c5dddf1 100644 --- a/code/nel/src/3d/instance_lighter.cpp +++ b/code/nel/src/3d/instance_lighter.cpp @@ -83,7 +83,7 @@ void CInstanceLighter::addTriangles (CLandscape &landscape, std::vector &l landscape.getTessellationLeaves(leaves); // Number of leaves - uint leavesCount=leaves.size(); + uint leavesCount=(uint)leaves.size(); // Reserve the array triangleArray.reserve (triangleArray.size()+leavesCount); @@ -332,7 +332,7 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut, // For all retrievers Infos in _IGSurfaceLightBuild while(itSrc!=_IGSurfaceLightBuild->RetrieverGridMap.end()) { - uint numSurfaces= itSrc->second.Grids.size(); + uint numSurfaces= (uint)itSrc->second.Grids.size(); // If !empty retriever. if(numSurfaces>0) { @@ -355,7 +355,7 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut, surfDst.Origin= surfSrc.Origin; surfDst.Width= surfSrc.Width; surfDst.Height= surfSrc.Height; - surfDst.Cells.resize(surfSrc.Cells.size()); + surfDst.Cells.resize((uint32)surfSrc.Cells.size()); surfDst.Cells.fill(defaultCellCorner); // The grid must be valid an not empty nlassert( surfDst.Cells.size() == surfDst.Width*surfDst.Height ); @@ -1050,7 +1050,7 @@ void CInstanceLighter::compilePointLightRT(uint gridSize, float gridCellSize, // =========== CQuadGrid obstacleGrid; obstacleGrid.create(gridSize, gridCellSize); - uint size= obstacles.size(); + uint size= (uint)obstacles.size(); for(i=0; i { // append a PointLightInfluence pointLightList.push_back(CPointLightInfluence()); - sint id= pointLightList.size()-1; + sint id= (sint)pointLightList.size()-1; // setup the PointLightInfluence corner.Lights[0]->_IdInInfluenceList= id; pointLightList[id].PointLight= corner.Lights[0]; @@ -82,7 +82,7 @@ void CLightInfluenceInterpolator::interpolate(std::vector { // append a PointLightInfluence pointLightList.push_back(CPointLightInfluence()); - sint id= pointLightList.size()-1; + sint id= (sint)pointLightList.size()-1; // setup the PointLightInfluence corner.Lights[1]->_IdInInfluenceList= id; pointLightList[id].PointLight= corner.Lights[1]; diff --git a/code/nel/src/3d/lod_character_builder.cpp b/code/nel/src/3d/lod_character_builder.cpp index 1b5bcee95..af24cbed8 100644 --- a/code/nel/src/3d/lod_character_builder.cpp +++ b/code/nel/src/3d/lod_character_builder.cpp @@ -189,7 +189,7 @@ void CLodCharacterBuilder::addAnim(const char *animName, CAnimation *animation // *************************************************************************** void CLodCharacterBuilder::applySkin(CSkeletonModel *skeleton, CVector *dstVertices) { - uint numVerts= _LodBuild->Vertices.size(); + uint numVerts= (uint)_LodBuild->Vertices.size(); // for all vertices. for(uint i=0; i &triangleIndices= lodBuild.TriangleIndices; const vector &skinWeights= lodBuild.SkinWeights; const vector &uvs= lodBuild.UVs; @@ -372,7 +372,7 @@ void CLodCharacterShape::buildMesh(const std::string &name, const CLodCharacte // Copy data. _Name= name; _NumVertices= numVertices; - _NumTriangles= triangleIndices.size()/3; + _NumTriangles= (uint32)triangleIndices.size()/3; #ifdef NL_LOD_CHARACTER_INDEX16 _TriangleIndices.resize(triangleIndices.size()); for(uint k = 0; k < triangleIndices.size(); ++k) @@ -492,7 +492,7 @@ bool CLodCharacterShape::addAnim(const CAnimBuild &animBuild) // Add the anim to the array, and add an entry to the map _Anims.push_back(dstAnim); - _AnimMap.insert(make_pair(dstAnim.Name, _Anims.size()-1)); + _AnimMap.insert(make_pair(dstAnim.Name, (uint32)_Anims.size()-1)); return true; } diff --git a/code/nel/src/3d/lod_character_shape_bank.cpp b/code/nel/src/3d/lod_character_shape_bank.cpp index 943d9e02b..d5288da77 100644 --- a/code/nel/src/3d/lod_character_shape_bank.cpp +++ b/code/nel/src/3d/lod_character_shape_bank.cpp @@ -46,7 +46,7 @@ uint32 CLodCharacterShapeBank::addShape() // Alloc a new shape _ShapeArray.resize(_ShapeArray.size()+1); - return _ShapeArray.size()-1; + return (uint32)_ShapeArray.size()-1; } // *************************************************************************** @@ -105,7 +105,7 @@ bool CLodCharacterShapeBank::compile() // *************************************************************************** uint CLodCharacterShapeBank::getNumShapes() const { - return _ShapeArray.size(); + return (uint)_ShapeArray.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/material.cpp b/code/nel/src/3d/material.cpp index d4e872c8f..91924eac7 100644 --- a/code/nel/src/3d/material.cpp +++ b/code/nel/src/3d/material.cpp @@ -226,7 +226,7 @@ void CMaterial::serial(NLMISC::IStream &f) } else { - n = _LightMaps.size(); + n = (uint32)_LightMaps.size(); f.serial(n); } for (uint32 i = 0; i < n; ++i) diff --git a/code/nel/src/3d/mesh.cpp b/code/nel/src/3d/mesh.cpp index 9093103e2..e61522aaf 100644 --- a/code/nel/src/3d/mesh.cpp +++ b/code/nel/src/3d/mesh.cpp @@ -290,7 +290,7 @@ void CMeshGeom::build (CMesh::CMeshBuild &m, uint numMaxMaterial) TCornerSet corners; const CFaceTmp *pFace= &(*tmpFaces.begin()); uint32 nFaceMB = 0; - sint N= tmpFaces.size(); + sint N= (sint)tmpFaces.size(); sint currentVBIndex=0; m.VertLink.clear (); @@ -336,7 +336,7 @@ void CMeshGeom::build (CMesh::CMeshBuild &m, uint numMaxMaterial) /// 4. Then, for all faces, build the RdrPass PBlock. //=================================================== pFace= &(*tmpFaces.begin()); - N= tmpFaces.size(); + N= (sint)tmpFaces.size(); for(;N>0;N--, pFace++) { sint mbId= pFace->MatrixBlockId; @@ -1302,7 +1302,7 @@ void CMeshGeom::buildSkin(CMesh::CMeshBuild &m, std::vector &tmpFaces) } // to Which matrixblock this face is inserted. - face.MatrixBlockId= _MatrixBlocks.size()-1; + face.MatrixBlockId= (sint)_MatrixBlocks.size()-1; // remove the face from remain face list. itFace= remainingFaces.erase(itFace); @@ -1450,13 +1450,13 @@ float CMeshGeom::getNumTriangles (float distance) uint32 triCount=0; // For each matrix block - uint mbCount=_MatrixBlocks.size(); + uint mbCount=(uint)_MatrixBlocks.size(); for (uint mb=0; mbbuild (m, mbase.Materials.size()); + _MeshGeom->build (m, (uint)mbase.Materials.size()); // compile some stuff compileRunTime(); diff --git a/code/nel/src/3d/mesh_base.cpp b/code/nel/src/3d/mesh_base.cpp index c8a997a7d..8b78d46e4 100644 --- a/code/nel/src/3d/mesh_base.cpp +++ b/code/nel/src/3d/mesh_base.cpp @@ -396,7 +396,7 @@ void CMeshBase::applyMaterialUsageOptim(const std::vector &materialUsed, s } // apply the remap to LightMaps infos - const uint count = _LightInfos.size (); + const uint count = (uint)_LightInfos.size (); for (i=0; i &materialUsed, s void CMeshBase::flushTextures(IDriver &driver, uint selectedTexture) { // Mat count - uint matCount=_Materials.size(); + uint matCount=(uint)_Materials.size(); // Flush each material textures for (uint mat=0; mat_LightInfos.size(); + return (uint32)pMesh->_LightInfos.size(); } // *************************************************************************** @@ -132,7 +132,7 @@ void CMeshBaseInstance::getLightMapName( uint32 nLightMapNb, std::string &LightM // *************************************************************************** uint32 CMeshBaseInstance::getNbBlendShape() { - return _AnimatedMorphFactor.size(); + return (uint32)_AnimatedMorphFactor.size(); } // *************************************************************************** @@ -228,8 +228,8 @@ void CMeshBaseInstance::traverseAnimDetail() // Lightmap automatic animation // Animated lightmap must have the same size than shape info lightmap. - const uint count0 = _AnimatedLightmap.size(); - const uint count1 = mb->_LightInfos.size (); + const uint count0 = (uint)_AnimatedLightmap.size(); + const uint count1 = (uint)mb->_LightInfos.size (); nlassert (count0 == count1); if (count0 == count1) { @@ -316,7 +316,7 @@ void CMeshBaseInstance::initAnimatedLightIndex (const CScene &scene) // For each lightmap in the shape CMeshBase *pMB = static_cast (static_cast (Shape)); - const uint count = pMB->_LightInfos.size (); + const uint count = (uint)pMB->_LightInfos.size (); uint i; // Resize the index array @@ -339,7 +339,7 @@ void CMeshBaseInstance::initAnimatedLightIndex (const CScene &scene) // *************************************************************************** uint CMeshBaseInstance::getNumMaterial () const { - return Materials.size (); + return (uint)Materials.size (); } diff --git a/code/nel/src/3d/mesh_block_manager.cpp b/code/nel/src/3d/mesh_block_manager.cpp index 8da305079..a78e86dd8 100644 --- a/code/nel/src/3d/mesh_block_manager.cpp +++ b/code/nel/src/3d/mesh_block_manager.cpp @@ -94,7 +94,7 @@ void CMeshBlockManager::addInstance(IMeshGeom *meshGeom, CMeshBaseInstance *in // link to the head of the list. instInfo.NextInstance= meshGeom->_RootInstanceId; - meshGeom->_RootInstanceId= hb->RdrInstances.size(); + meshGeom->_RootInstanceId= (sint32)hb->RdrInstances.size(); // add this instance hb->RdrInstances.push_back(instInfo); @@ -311,7 +311,7 @@ void CMeshBlockManager::allocateMeshVBHeap(IMeshGeom *mesh) // else, must add to the array else { - meshId= vbHeapBlock->AllocatedMeshGeoms.size(); + meshId= (uint)vbHeapBlock->AllocatedMeshGeoms.size(); vbHeapBlock->AllocatedMeshGeoms.push_back(mesh); } @@ -414,7 +414,7 @@ bool CMeshBlockManager::addVBHeap(IDriver *drv, uint vertexFormat, uint maxVer // add an entry to the array, and the map. _VBHeapBlocks.push_back(hb); - _VBHeapMap[vertexFormat]= _VBHeapBlocks.size()-1; + _VBHeapMap[vertexFormat]= (uint)_VBHeapBlocks.size()-1; return true; } diff --git a/code/nel/src/3d/mesh_morpher.cpp b/code/nel/src/3d/mesh_morpher.cpp index aed1b1dc6..7027864c9 100644 --- a/code/nel/src/3d/mesh_morpher.cpp +++ b/code/nel/src/3d/mesh_morpher.cpp @@ -405,7 +405,7 @@ void CMeshMorpher::updateRawSkin (CVertexBuffer *vbOri, if (rFactor != 0.0f) { rFactor*= 0.01f; - uint32 numVertices= rBS.VertRefs.size(); + uint32 numVertices= (uint32)rBS.VertRefs.size(); // don't know why, but cases happen where deltaNorm not empty while deltaPos is bool hasPos= rBS.deltaPos.size()>0; bool hasNorm= rBS.deltaNorm.size()>0; diff --git a/code/nel/src/3d/mesh_mrm.cpp b/code/nel/src/3d/mesh_mrm.cpp index 3f67d79cb..ab6332964 100644 --- a/code/nel/src/3d/mesh_mrm.cpp +++ b/code/nel/src/3d/mesh_mrm.cpp @@ -107,7 +107,7 @@ void CMeshMRMGeom::CLod::buildSkinVertexBlocks() uint i; for(i=0;i // LodOffset is filled in serial() when stream is input. } // After build, all lods are present in memory. - _NbLodLoaded= _Lods.size(); + _NbLodLoaded= (uint)_Lods.size(); // For load balancing. @@ -549,7 +549,7 @@ void CMeshMRMGeom::applyGeomorphWithVBHardPtr(std::vector &geoms // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; /* NB: optimisation: lot of "if" in this Loop, but because of BTB, they always cost nothing (prediction is good). @@ -751,7 +751,7 @@ void CMeshMRMGeom::applyGeomorphWithVBHardPtr(std::vector &geoms // For all stages after 4. for(i=4;i &geoms, // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; for(; nGeoms>0; nGeoms--, ptrGeom++, destPtr+= vertexSize ) @@ -1355,7 +1355,7 @@ sint CMeshMRMGeom::renderSkinGroupGeom(CMeshMRMInstance *mi, float alphaMRM, uin applyRawSkinWithNormal (lod, *(mi->_RawSkinCache), skeleton, vbDest, alphaLod); // Vertices are packed in RawSkin mode (ie no holes due to MRM!) - return mi->_RawSkinCache->Geomorphs.size() + + return (sint)mi->_RawSkinCache->Geomorphs.size() + mi->_RawSkinCache->TotalSoftVertices + mi->_RawSkinCache->TotalHardVertices; } @@ -1519,7 +1519,7 @@ void CMeshMRMGeom::updateShiftedTriangleCache(CMeshMRMInstance *mi, sint curLodI } // Build RdrPass - mi->_ShiftedTriangleCache->RdrPass.resize(pbList.size()); + mi->_ShiftedTriangleCache->RdrPass.resize((uint32)pbList.size()); // First pass, count number of triangles, and fill header info uint totalTri= 0; @@ -1764,7 +1764,7 @@ void CMeshMRMGeom::load(NLMISC::IStream &f) throw(NLMISC::EStream) } // Now, all lods are loaded. - _NbLodLoaded= _Lods.size(); + _NbLodLoaded= (uint)_Lods.size(); // If version doen't have boneNames, must build BoneId now. if(verHeader <= 2) @@ -1951,7 +1951,7 @@ void CMeshMRMGeom::loadFirstLod(NLMISC::IStream &f) */ uint numLodToLoad; if(verHeader<4) - numLodToLoad= _LodInfos.size(); + numLodToLoad= (uint)_LodInfos.size(); else numLodToLoad= 1; @@ -2152,7 +2152,7 @@ void CMeshMRMGeom::restoreOriginalSkinPart(CLod &lod) //=========================== for(uint i=0;i &vertice // **** count number of vertices really used (skip geomorphs) uint numUsedVertices=0; - for(i=geomorphs.size();i=0) numUsedVertices++; @@ -2607,13 +2607,13 @@ bool CMeshMRMGeom::buildGeometryForLod(uint lodId, std::vector &vertice _VBufferFinal.lock(vba); // get the start vert, beginning at end of geomorphs - const uint8 *pSrcVert= (const uint8*)vba.getVertexCoordPointer(geomorphs.size()); + const uint8 *pSrcVert= (const uint8*)vba.getVertexCoordPointer((uint)geomorphs.size()); uint32 vertSize= _VBufferFinal.getVertexSize(); CVector *pDstVert= &vertices[0]; uint dstIndex= 0; // Then run all input vertices (skip geomorphs) - for(i=geomorphs.size();i=0) @@ -2710,7 +2710,7 @@ uint CMeshMRMGeom::getNumRdrPassesForMesh() const // *************************************************************************** uint CMeshMRMGeom::getNumRdrPassesForInstance(CMeshBaseInstance *inst) const { - return _Lods[_MBRCurrentLodId].RdrPass.size(); + return (uint)_Lods[_MBRCurrentLodId].RdrPass.size(); } // *************************************************************************** void CMeshMRMGeom::beginMesh(CMeshGeomRenderContext &rdrCtx) @@ -2884,7 +2884,7 @@ void CMeshMRM::build (CMeshBase::CMeshBaseBuild &mBase, CMesh::CMeshBuild &m, CMeshBase::buildMeshBase (mBase); // Then build the geom. - _MeshMRMGeom.build (m, listBS, mBase.Materials.size(), params); + _MeshMRMGeom.build (m, listBS, (uint)mBase.Materials.size(), params); } // *************************************************************************** void CMeshMRM::build (CMeshBase::CMeshBaseBuild &m, const CMeshMRMGeom &mgeom) @@ -3196,10 +3196,10 @@ void CMeshMRMGeom::updateRawSkinNormal(bool enabled, CMeshMRMInstance *mi, sint // Resize the dest array. - skinLod.Vertices1.resize(lod.InfluencedVertices[0].size()); - skinLod.Vertices2.resize(lod.InfluencedVertices[1].size()); - skinLod.Vertices3.resize(lod.InfluencedVertices[2].size()); - skinLod.Vertices4.resize(lod.InfluencedVertices[3].size()); + skinLod.Vertices1.resize((uint32)lod.InfluencedVertices[0].size()); + skinLod.Vertices2.resize((uint32)lod.InfluencedVertices[1].size()); + skinLod.Vertices3.resize((uint32)lod.InfluencedVertices[2].size()); + skinLod.Vertices4.resize((uint32)lod.InfluencedVertices[3].size()); // Remap for BlendShape. Lasts 2 bits tells what RawSkin Array to seek (1 to 4), // low Bits indicate the number in them. 0xFFFFFFFF is a special value indicating "NotUsed in this lod" @@ -3308,7 +3308,7 @@ void CMeshMRMGeom::updateRawSkinNormal(bool enabled, CMeshMRMInstance *mi, sint // Remap Geomorphs. //======== - uint numGeoms= lod.Geomorphs.size(); + uint numGeoms= (uint)lod.Geomorphs.size(); skinLod.Geomorphs.resize( numGeoms ); for(i=0;i0) { - skinLod.VertexRemap.resize(vertexFinalRemap.size()); + skinLod.VertexRemap.resize((uint32)vertexFinalRemap.size()); for(i=0;i &shadowVerti // *************************************************************************** uint CMeshMRMGeom::getNumShadowSkinVertices() const { - return _ShadowSkin.Vertices.size(); + return (uint)_ShadowSkin.Vertices.size(); } // *************************************************************************** sint CMeshMRMGeom::renderShadowSkinGeom(CMeshMRMInstance *mi, uint remainingVertices, uint8 *vbDest) { - uint numVerts= _ShadowSkin.Vertices.size(); + uint numVerts= (uint)_ShadowSkin.Vertices.size(); // if no verts, no draw if(numVerts==0) @@ -3496,7 +3496,7 @@ void CMeshMRMGeom::renderShadowSkinPrimitives(CMeshMRMInstance *mi, CMaterial if(shiftedTris.getNumIndexes()<_ShadowSkin.Triangles.size()) { shiftedTris.setFormat(NL_MESH_MRM_INDEX_FORMAT); - shiftedTris.setNumIndexes(_ShadowSkin.Triangles.size()); + shiftedTris.setNumIndexes((uint32)_ShadowSkin.Triangles.size()); } shiftedTris.setPreferredMemory(CIndexBuffer::RAMVolatile, false); { @@ -3504,7 +3504,7 @@ void CMeshMRMGeom::renderShadowSkinPrimitives(CMeshMRMInstance *mi, CMaterial shiftedTris.lock(iba); const uint32 *src= &_ShadowSkin.Triangles[0]; TMeshMRMIndexType *dst= (TMeshMRMIndexType *) iba.getPtr(); - for(uint n= _ShadowSkin.Triangles.size();n>0;n--, src++, dst++) + for(uint n= (uint)_ShadowSkin.Triangles.size();n>0;n--, src++, dst++) { *dst= (TMeshMRMIndexType)(*src + baseVertex); } @@ -3513,7 +3513,7 @@ void CMeshMRMGeom::renderShadowSkinPrimitives(CMeshMRMInstance *mi, CMaterial // Render Triangles with cache //=========== - uint numTris= _ShadowSkin.Triangles.size()/3; + uint numTris= (uint)_ShadowSkin.Triangles.size()/3; // Render with the Materials of the MeshInstance. drv->activeIndexBuffer(shiftedTris); diff --git a/code/nel/src/3d/mesh_mrm_skin.cpp b/code/nel/src/3d/mesh_mrm_skin.cpp index e0111d7aa..af02a49e4 100644 --- a/code/nel/src/3d/mesh_mrm_skin.cpp +++ b/code/nel/src/3d/mesh_mrm_skin.cpp @@ -204,7 +204,7 @@ void CMeshMRMGeom::applySkin(CLod &lod, const CSkeletonModel *skeleton) nlassert(NL3D_MESH_SKINNING_MAX_MATRIX==4); for(uint i=0;i // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; for(; nGeoms>0; nGeoms--, ptrGeom++, destPtr+= vertexSize ) @@ -472,7 +472,7 @@ void CMeshMRMSkinnedGeom::applyGeomorphPosNormalUV0(std::vector void CMeshMRMSkinnedGeom::applyGeomorphPosNormalUV0Int(std::vector &geoms, uint8 *vertexPtr, uint8 *vertexDestPtr, sint32 vertexSize, sint a, sint a1) { // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; for(; nGeoms>0; nGeoms--, ptrGeom++, destPtr+= vertexSize ) @@ -567,7 +567,7 @@ inline sint CMeshMRMSkinnedGeom::chooseLod(float alphaMRM, float &alphaLod) /// Ensure numLod is correct if(numLod>=(sint)_Lods.size()) { - numLod= _Lods.size()-1; + numLod= (sint)_Lods.size()-1; alphaLod= 1; } @@ -799,7 +799,7 @@ sint CMeshMRMSkinnedGeom::renderSkinGroupGeom(CMeshMRMSkinnedInstance *mi, float applyRawSkinWithNormal (lod, *(mi->_RawSkinCache), skeleton, vbDest, alphaLod); // Vertices are packed in RawSkin mode (ie no holes due to MRM!) - return mi->_RawSkinCache->Geomorphs.size() + + return (sint)mi->_RawSkinCache->Geomorphs.size() + mi->_RawSkinCache->TotalSoftVertices + mi->_RawSkinCache->TotalHardVertices; } @@ -951,7 +951,7 @@ void CMeshMRMSkinnedGeom::updateShiftedTriangleCache(CMeshMRMSkinnedInstance *mi } // Build RdrPass - mi->_ShiftedTriangleCache->RdrPass.resize(pbList.size()); + mi->_ShiftedTriangleCache->RdrPass.resize((uint32)pbList.size()); // First pass, count number of triangles, and fill header info uint totalTri= 0; @@ -1463,7 +1463,7 @@ void CMeshMRMSkinned::build (CMeshBase::CMeshBaseBuild &mBase, CMesh::CMeshBui CMeshBase::buildMeshBase (mBase); // Then build the geom. - _MeshMRMGeom.build (m, mBase.Materials.size(), params); + _MeshMRMGeom.build (m, (uint)mBase.Materials.size(), params); } // *************************************************************************** void CMeshMRMSkinned::build (CMeshBase::CMeshBaseBuild &m, const CMeshMRMSkinnedGeom &mgeom) @@ -1736,10 +1736,10 @@ void CMeshMRMSkinnedGeom::updateRawSkinNormal(bool enabled, CMeshMRMSkinnedInst // Resize the dest array. - skinLod.Vertices1.resize(lod.InfluencedVertices[0].size()); - skinLod.Vertices2.resize(lod.InfluencedVertices[1].size()); - skinLod.Vertices3.resize(lod.InfluencedVertices[2].size()); - skinLod.Vertices4.resize(lod.InfluencedVertices[3].size()); + skinLod.Vertices1.resize((uint32)lod.InfluencedVertices[0].size()); + skinLod.Vertices2.resize((uint32)lod.InfluencedVertices[1].size()); + skinLod.Vertices3.resize((uint32)lod.InfluencedVertices[2].size()); + skinLod.Vertices4.resize((uint32)lod.InfluencedVertices[3].size()); // Vertex buffer pointers const CPackedVertexBuffer::CPackedVertex *vertices = _VBufferFinal.getPackedVertices(); @@ -1846,7 +1846,7 @@ void CMeshMRMSkinnedGeom::updateRawSkinNormal(bool enabled, CMeshMRMSkinnedInst // Remap Geomorphs. //======== - uint numGeoms= lod.Geomorphs.size(); + uint numGeoms= (uint)lod.Geomorphs.size(); skinLod.Geomorphs.resize( numGeoms ); for(i=0;i &shad // *************************************************************************** uint CMeshMRMSkinnedGeom::getNumShadowSkinVertices() const { - return _ShadowSkin.Vertices.size(); + return (uint)_ShadowSkin.Vertices.size(); } // *************************************************************************** sint CMeshMRMSkinnedGeom::renderShadowSkinGeom(CMeshMRMSkinnedInstance *mi, uint remainingVertices, uint8 *vbDest) { - uint numVerts= _ShadowSkin.Vertices.size(); + uint numVerts= (uint)_ShadowSkin.Vertices.size(); // if no verts, no draw if(numVerts==0) @@ -1991,14 +1991,14 @@ void CMeshMRMSkinnedGeom::renderShadowSkinPrimitives(CMeshMRMSkinnedInstance * //if(shiftedTris.getNumIndexes()<_ShadowSkin.Triangles.size()) //{ shiftedTris.setFormat(NL_SKINNED_MESH_MRM_INDEX_FORMAT); - shiftedTris.setNumIndexes(_ShadowSkin.Triangles.size()); + shiftedTris.setNumIndexes((uint32)_ShadowSkin.Triangles.size()); //} { CIndexBufferReadWrite iba; shiftedTris.lock(iba); const uint32 *src= &_ShadowSkin.Triangles[0]; TSkinnedMeshMRMIndexType *dst= (TSkinnedMeshMRMIndexType*) iba.getPtr(); - for(uint n= _ShadowSkin.Triangles.size();n>0;n--, src++, dst++) + for(uint n= (uint)_ShadowSkin.Triangles.size();n>0;n--, src++, dst++) { *dst= (TSkinnedMeshMRMIndexType)(*src + baseVertex); } @@ -2007,7 +2007,7 @@ void CMeshMRMSkinnedGeom::renderShadowSkinPrimitives(CMeshMRMSkinnedInstance * // Render Triangles with cache //=========== - uint numTris= _ShadowSkin.Triangles.size()/3; + uint numTris= (uint)_ShadowSkin.Triangles.size()/3; // Render with the Materials of the MeshInstance. drv->activeIndexBuffer(shiftedTris); diff --git a/code/nel/src/3d/mesh_multi_lod.cpp b/code/nel/src/3d/mesh_multi_lod.cpp index b9b25a41b..47ba62b79 100644 --- a/code/nel/src/3d/mesh_multi_lod.cpp +++ b/code/nel/src/3d/mesh_multi_lod.cpp @@ -115,7 +115,7 @@ void CMeshMultiLod::build(CMeshMultiLodBuild &mbuild) } // Sort the slot by the distance... - for (int i=mbuild.LodMeshes.size()-1; i>0; i--) + for (int i=(uint)mbuild.LodMeshes.size()-1; i>0; i--) for (int j=0; j &pyramid, const CMatrix &worldMatrix) { // Look for the biggest mesh - uint meshCount=_MeshVector.size(); + uint meshCount=(uint)_MeshVector.size(); for (uint i=0; i0) @@ -378,7 +378,7 @@ float CMeshMultiLod::getNumTrianglesWithCoarsestDist(float distance, float coars void CMeshMultiLod::getAABBox(NLMISC::CAABBox &bbox) const { // Get count - uint count=_MeshVector.size(); + uint count=(uint)_MeshVector.size(); for (uint slot=0; slot_MeshVector.size(); + uint meshCount=(uint)shape->_MeshVector.size(); Lod0=0; if (meshCount>1) { diff --git a/code/nel/src/3d/mrm_builder.cpp b/code/nel/src/3d/mrm_builder.cpp index d19eeb064..5820a575a 100644 --- a/code/nel/src/3d/mrm_builder.cpp +++ b/code/nel/src/3d/mrm_builder.cpp @@ -137,7 +137,7 @@ float CMRMBuilder::getDeltaFaceNormals(sint numvertex) CMRMVertex &vert= TmpVertices[numvertex]; float delta=0; CVector refNormal; - sint nfaces=vert.SharedFaces.size(); + sint nfaces=(sint)vert.SharedFaces.size(); for(sint i=0;inWantedFaces) @@ -1278,7 +1278,7 @@ void CMRMBuilder::makeFromMesh(const CMRMMesh &baseMesh, CMRMMeshGeom &lodMesh, void CMRMBuilder::buildAllLods(const CMRMMesh &baseMesh, std::vector &lodMeshs, uint nWantedLods, uint divisor) { - sint nFaces= baseMesh.Faces.size(); + sint nFaces= (sint)baseMesh.Faces.size(); sint nBaseFaces; sint i; CMRMMesh srcMesh = baseMesh; @@ -1328,7 +1328,7 @@ void CMRMBuilder::buildFinalMRM(std::vector &lodMeshs, CMRMMeshFin { sint i,j; sint lodId, attId; - sint nLods= lodMeshs.size(); + sint nLods= (sint)lodMeshs.size(); // Init. // =============== @@ -1401,7 +1401,7 @@ void CMRMBuilder::buildFinalMRM(std::vector &lodMeshs, CMRMMeshFin } // Here, the number of wedge indicate the max number of wedge this LOD needs. - finalMRM.Lods[lodId].NWedges= finalMRM.Wedges.size(); + finalMRM.Lods[lodId].NWedges= (sint)finalMRM.Wedges.size(); } @@ -1647,7 +1647,7 @@ sint CMRMBuilder::findInsertAttributeInBaseMesh(CMRMMesh &baseMesh, sint attId // if attribute not found in the map, then insert a new one. if(it==_AttributeMap[attId].end()) { - sint idx= baseMesh.Attributes[attId].size(); + sint idx= (sint)baseMesh.Attributes[attId].size(); // insert into the array. baseMesh.Attributes[attId].push_back(att); // insert into the map. @@ -1779,7 +1779,7 @@ uint32 CMRMBuilder::buildMrmBaseMesh(const CMesh::CMeshBuild &mbuild, CMRMMesh if(_HasMeshInterfaces) baseMesh.InterfaceLinks= mbuild.InterfaceLinks; // Resize faces. - nFaces= mbuild.Faces.size(); + nFaces= (sint)mbuild.Faces.size(); baseMesh.Faces.resize(nFaces); for(i=0; i::iterator it= matrixInfMap.find(matId); if( it==matrixInfMap.end() ) { - uint matInfId= destLod.MatrixInfluences.size(); + uint matInfId= (uint)destLod.MatrixInfluences.size(); matrixInfMap.insert( make_pair(matId, matInfId) ); // create the new MatrixInfluence. destLod.MatrixInfluences.push_back(matId); @@ -2244,7 +2244,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMGeo for (k = 0; k < (sint)mbuild.BlendShapes.size(); ++k) { CBlendShape &rBS = mbuild.BlendShapes[k]; - sint32 nNbVertVB = finalMRM.Wedges.size(); + sint32 nNbVertVB = (sint32)finalMRM.Wedges.size(); bool bIsDeltaPos = false; rBS.deltaPos.resize (nNbVertVB, CVector(0.0f,0.0f,0.0f)); bool bIsDeltaNorm = false; @@ -2489,7 +2489,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki // Setup the VertexBuffer. // ======================== // resize the VB. - mbuild.VBuffer.setNumVertices(finalMRM.Wedges.size()); + mbuild.VBuffer.setNumVertices((uint32)finalMRM.Wedges.size()); CVertexBufferReadWrite vba; mbuild.VBuffer.lock (vba); @@ -2603,7 +2603,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki else { // map material to rdrPass. - sint idRdrPass= destLod.RdrPass.size(); + sint idRdrPass= (sint)destLod.RdrPass.size(); rdrPassIndex[j]= idRdrPass; // create a rdrPass. destLod.RdrPass.push_back(CMeshMRMSkinnedGeom::CRdrPass()); @@ -2719,7 +2719,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki map::iterator it= matrixInfMap.find(matId); if( it==matrixInfMap.end() ) { - uint matInfId= destLod.MatrixInfluences.size(); + uint matInfId= (uint)destLod.MatrixInfluences.size(); matrixInfMap.insert( make_pair(matId, matInfId) ); // create the new MatrixInfluence. destLod.MatrixInfluences.push_back(matId); @@ -2746,7 +2746,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki for (k = 0; k < (sint)mbuild.BlendShapes.size(); ++k) { CBlendShape &rBS = mbuild.BlendShapes[k]; - sint32 nNbVertVB = finalMRM.Wedges.size(); + sint32 nNbVertVB = (sint32)finalMRM.Wedges.size(); bool bIsDeltaPos = false; rBS.deltaPos.resize (nNbVertVB, CVector(0.0f,0.0f,0.0f)); bool bIsDeltaNorm = false; diff --git a/code/nel/src/3d/mrm_internal.cpp b/code/nel/src/3d/mrm_internal.cpp index 3e8645b2b..3fa17794b 100644 --- a/code/nel/src/3d/mrm_internal.cpp +++ b/code/nel/src/3d/mrm_internal.cpp @@ -50,7 +50,7 @@ sint CMRMSewingMesh::mustCollapseEdge(uint lod, const CMRMEdge &edge, uint &vert sint CMRMSewingMesh::getNumCollapseEdge(uint lod) const { nlassert(lod<_Lods.size()); - return _Lods[lod].EdgeToCollapse.size(); + return (sint)_Lods[lod].EdgeToCollapse.size(); } @@ -65,7 +65,7 @@ void CMRMSewingMesh::build(const CMesh::CInterface &meshInt, uint nWantedLods, u // build edge list std::vector edgeList; - uint nMaxEdges= meshInt.Vertices.size(); + uint nMaxEdges= (uint)meshInt.Vertices.size(); edgeList.resize(nMaxEdges); for(uint i=0;i 01 12 23... becomes 02 23 (NB: 1 is collapsed to 2) - uint precEdgeId= (bestEdgeId+edgeList.size()-1)%edgeList.size(); + uint precEdgeId= (uint)((bestEdgeId+edgeList.size()-1)%edgeList.size()); edgeList[precEdgeId].v1= edgeList[bestEdgeId].v1; // and erase the edge from the current list edgeList.erase( edgeList.begin()+bestEdgeId ); diff --git a/code/nel/src/3d/mrm_mesh.cpp b/code/nel/src/3d/mrm_mesh.cpp index 2bcc6dc9f..104d81b11 100644 --- a/code/nel/src/3d/mrm_mesh.cpp +++ b/code/nel/src/3d/mrm_mesh.cpp @@ -48,7 +48,7 @@ sint CMRMMeshFinal::findInsertWedge(const CWedge &w) // if not found, must add it. if(it==_WedgeMap.end()) { - ret= Wedges.size(); + ret= (sint)Wedges.size(); // insert into the map, with good id. _WedgeMap.insert(make_pair(w, ret)); // add it to the array. diff --git a/code/nel/src/3d/packed_zone.cpp b/code/nel/src/3d/packed_zone.cpp index f62104028..9f45d74a3 100644 --- a/code/nel/src/3d/packed_zone.cpp +++ b/code/nel/src/3d/packed_zone.cpp @@ -175,7 +175,7 @@ void CVectorPacker::flush(CBitMemStream &bits) bits.serial(isRLE, 1); bits.serial(_LastTag, 2); nlassert(_LastDeltas.size() <= 255); - uint8 length = _LastDeltas.size(); + uint8 length = (uint8)_LastDeltas.size(); //nlwarning("begin RLE, length = %d, tag = %d", (int) length, (int) repeatTag); bits.serial(length); for(uint k = 0; k < _LastDeltas.size(); ++k) @@ -223,7 +223,7 @@ void CVectorPacker::serialPackedVector16(std::vector &v,NLMISC::IStream CBitMemStream bits(true); std::vector datas; f.serialCont(datas); - bits.fill(&datas[0], datas.size()); + bits.fill(&datas[0], (uint32)datas.size()); uint32 numValues = 0; bits.serial(numValues); v.resize(numValues); @@ -312,7 +312,7 @@ void CVectorPacker::serialPackedVector16(std::vector &v,NLMISC::IStream _Repeated[AbsOrRLE] = 0; // CBitMemStream bits(false); - uint32 numValues = v.size(); + uint32 numValues = (uint32)v.size(); bits.serial(numValues); _LastTag = std::numeric_limits::max(); _LastDeltas.clear(); @@ -723,7 +723,7 @@ void CPackedZone32::build(std::vector &leaves, { if (!triListGrid(x, y).empty()) { - Grid(x, y) = TriLists.size(); + Grid(x, y) = (uint32)TriLists.size(); std::copy(triListGrid(x, y).begin(), triListGrid(x, y).end(), std::back_inserter(TriLists)); TriLists.push_back(UndefIndex); // mark the end of the list } @@ -902,7 +902,7 @@ void CPackedZone32::addTri(const CTriangle &tri, TVertexGrid &vertexGrid, TTriLi { if (x < 0) continue; if (x >= (sint) triListGrid.getWidth()) break; - triListGrid(x, gridY).push_back(Tris.size() - 1); + triListGrid(x, gridY).push_back((uint32)Tris.size() - 1); } } } @@ -940,8 +940,8 @@ uint32 CPackedZone32::allocVertex(const CVector &src, TVertexGrid &vertexGrid) // create a new vertex Verts.push_back(pv); - vertList.push_front(Verts.size() - 1); - return Verts.size() - 1; + vertList.push_front((uint32)Verts.size() - 1); + return (uint32)Verts.size() - 1; } // *************************************************************************************** @@ -1013,7 +1013,7 @@ void CPackedZone32::render(CVertexBuffer &vb, IDriver &drv, CMaterial &material, } } vba.unlock(); - uint numRemainingTris = batchSize - ((endDest - dest) / 3); + uint numRemainingTris = batchSize - (uint)((endDest - dest) / 3); if (numRemainingTris) { drv.setPolygonMode(IDriver::Filled); @@ -1236,7 +1236,7 @@ void CPackedZone16::render(CVertexBuffer &vb, IDriver &drv, CMaterial &material, } } vba.unlock(); - uint numRemainingTris = batchSize - ((endDest - dest) / 3); + uint numRemainingTris = batchSize - (uint)((endDest - dest) / 3); if (numRemainingTris) { drv.setPolygonMode(IDriver::Filled); diff --git a/code/nel/src/3d/particle_system.cpp b/code/nel/src/3d/particle_system.cpp index 4e9eeff29..c4d02d8b0 100644 --- a/code/nel/src/3d/particle_system.cpp +++ b/code/nel/src/3d/particle_system.cpp @@ -603,10 +603,10 @@ void CParticleSystem::step(TPass pass, TAnimationTime ellapsedTime, CParticleSys // nodes sorted by degree InsideSimLoop = true; // make enough room for spawns - uint numProcess = _ProcessVect.size(); + uint numProcess = (uint)_ProcessVect.size(); if (numProcess > _Spawns.size()) { - uint oldSize = _Spawns.size(); + uint oldSize = (uint)_Spawns.size(); _Spawns.resize(numProcess); for(uint k = oldSize; k < numProcess; ++k) { @@ -1044,7 +1044,7 @@ bool CParticleSystem::attach(CParticleSystemProcess *ptr) //nlassert(ptr->getOwner() == NULL); _ProcessVect.push_back(ptr); ptr->setOwner(this); - ptr->setIndex(_ProcessVect.size() - 1); + ptr->setIndex((uint32)_ProcessVect.size() - 1); //notifyMaxNumFacesChanged(); if (getBypassMaxNumIntegrationSteps()) { @@ -1299,7 +1299,7 @@ void CParticleSystem::unregisterLocatedBindableExternID(CPSLocatedBindable *lb) uint CParticleSystem::getNumLocatedBindableByExternID(uint32 id) const { NL_PS_FUNC_MAIN(CParticleSystem_getNumLocatedBindableByExternID) - return _LBMap.count(id); + return (uint)_LBMap.count(id); } ///======================================================================================= @@ -1502,7 +1502,7 @@ uint CParticleSystem::getIndexOf(const CParticleSystemProcess &process) const uint CParticleSystem::getNumID() const { NL_PS_FUNC_MAIN(CParticleSystem_getNumID) - return _LBMap.size(); + return (uint)_LBMap.size(); } ///======================================================================================= diff --git a/code/nel/src/3d/particle_system_shape.cpp b/code/nel/src/3d/particle_system_shape.cpp index d7d8aeab0..5e41ba530 100644 --- a/code/nel/src/3d/particle_system_shape.cpp +++ b/code/nel/src/3d/particle_system_shape.cpp @@ -125,7 +125,7 @@ void CParticleSystemShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) { std::vector buf; f.serialCont(buf); - _ParticleSystemProto.fill(&buf[0], buf.size()); + _ParticleSystemProto.fill(&buf[0], (uint32)buf.size()); } else { diff --git a/code/nel/src/3d/patch_vegetable.cpp b/code/nel/src/3d/patch_vegetable.cpp index fb089ee35..ffa5b0b92 100644 --- a/code/nel/src/3d/patch_vegetable.cpp +++ b/code/nel/src/3d/patch_vegetable.cpp @@ -59,7 +59,7 @@ void CPatch::generateTileVegetable(CVegetableInstanceGroup *vegetIg, uint distT const CTileVegetableDesc &tileVegetDesc= getLandscape()->getTileVegetableDesc(tileId); const std::vector &vegetableList= tileVegetDesc.getVegetableList(distType); uint distAddSeed= tileVegetDesc.getVegetableSeed(distType); - uint numVegetable= vegetableList.size(); + uint numVegetable= (uint)vegetableList.size(); // If no vegetables at all, skip. if(numVegetable==0) @@ -221,7 +221,7 @@ void CPatch::generateTileVegetable(CVegetableInstanceGroup *vegetIg, uint distT // reseve instance space for this vegetable. // instanceUVArray[i].size() is the number of instances to create. - veget.reserveIgAddInstances(vegetIgReserve, (CVegetable::TVegetableWater)vegetWaterState, instanceUVArray[i].size()); + veget.reserveIgAddInstances(vegetIgReserve, (CVegetable::TVegetableWater)vegetWaterState, (uint)instanceUVArray[i].size()); } // actual reseve memory of the ig. getLandscape()->_VegetableManager->reserveIgCompile(vegetIg, vegetIgReserve); diff --git a/code/nel/src/3d/point_light_named_array.cpp b/code/nel/src/3d/point_light_named_array.cpp index fd387c6dc..e8f2950cc 100644 --- a/code/nel/src/3d/point_light_named_array.cpp +++ b/code/nel/src/3d/point_light_named_array.cpp @@ -130,7 +130,7 @@ void CPointLightNamedArray::build(const std::vector &pointLi void CPointLightNamedArray::setPointLightFactor(const CScene &scene) { // Search in the map. - const uint count = _PointLightGroupMap.size (); + const uint count = (uint)_PointLightGroupMap.size (); uint i; for (i=0; i &pyramid) // Clip portal with pyramid CPolygon p; p.Vertices = _Poly; - p.clip( &pyramid[1], pyramid.size()-1 ); + p.clip( &pyramid[1], (uint)pyramid.size()-1 ); // Construct pyramid with clipped portal if( p.Vertices.size() > 2 ) @@ -292,7 +292,7 @@ bool CPortal::clipRay(const NLMISC::CVector &startWorld, const NLMISC::CVector & // Do convex test on each border sint sign= 0; - uint polySize= _Poly.size(); + uint polySize= (uint)_Poly.size(); for(uint i=0;iget(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); } @@ -591,7 +591,7 @@ void CPSEmitter::processRegularEmissionWithNoLOD(uint firstInstanceIndex) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); } @@ -618,7 +618,7 @@ void CPSEmitter::processRegularEmissionWithNoLOD(uint firstInstanceIndex) { *phaseIt -= ::floorf(*phaseIt / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); ++*numEmitIt; @@ -643,7 +643,7 @@ void CPSEmitter::processRegularEmissionWithNoLOD(uint firstInstanceIndex) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); ++*numEmitIt; @@ -744,7 +744,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf(*phaseIt / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -788,7 +788,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -820,7 +820,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf(*phaseIt / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -874,7 +874,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -1112,7 +1112,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float uint numEmissions = (uint) ::floorf(*phaseIt / *currEmitPeriod); *phaseIt -= *currEmitPeriod * numEmissions; - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1149,7 +1149,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1201,7 +1201,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); /// process each emission at the right pos at the right date - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1235,7 +1235,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1275,7 +1275,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1314,7 +1314,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - _Phase.begin(); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1375,7 +1375,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1413,7 +1413,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1535,7 +1535,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(0.f, *phaseIt); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); /// compute the position of the emitter for the needed dates numEmissions = GenEmitterPositions(_Owner, @@ -1563,7 +1563,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); } @@ -1592,7 +1592,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); /// compute the position of the emitter for the needed date numEmissions = GenEmitterPositions(_Owner, _EmittedType, @@ -1618,7 +1618,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); } @@ -1653,7 +1653,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1684,7 +1684,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - _Phase.begin(); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); ++*numEmitIt; @@ -1717,7 +1717,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1748,7 +1748,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); ++*numEmitIt; diff --git a/code/nel/src/3d/ps_face.cpp b/code/nel/src/3d/ps_face.cpp index 5db3d70c8..ae0f16c90 100644 --- a/code/nel/src/3d/ps_face.cpp +++ b/code/nel/src/3d/ps_face.cpp @@ -310,7 +310,7 @@ void CPSFace::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } else { - uint32 nbConfigurations = _PrecompBasis.size(); + uint32 nbConfigurations = (uint32)_PrecompBasis.size(); f.serial(nbConfigurations); if (nbConfigurations) { @@ -364,7 +364,7 @@ void CPSFace::hintRotateTheSame(uint32 nbConfiguration void CPSFace::fillIndexesInPrecompBasis(void) { NL_PS_FUNC(CPSFace_fillIndexesInPrecompBasis) - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (_Owner) { _IndexInPrecompBasis.resize( _Owner->getMaxSize() ); @@ -381,7 +381,7 @@ void CPSFace::newElement(const CPSEmitterInfo &info) NL_PS_FUNC(CPSFace_newElement) CPSQuad::newElement(info); newPlaneBasisElement(info); - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (nbConf) // do we use precomputed basis ? { _IndexInPrecompBasis[_Owner->getNewElementIndex()] = rand() % nbConf; diff --git a/code/nel/src/3d/ps_float.cpp b/code/nel/src/3d/ps_float.cpp index 16a1a856c..9f5933adc 100644 --- a/code/nel/src/3d/ps_float.cpp +++ b/code/nel/src/3d/ps_float.cpp @@ -113,7 +113,7 @@ float CPSFloatCurveFunctor::getValue(float date) const else // hermite interpolation { float width = it->Date - precIt->Date; - uint index = precIt - _CtrlPoints.begin(); + uint index = (uint)(precIt - _CtrlPoints.begin()); float t1 = getSlope(index) * width, t2 = getSlope(index + 1) * width; const float lambda2 = NLMISC::sqr(lambda); const float lambda3 = lambda2 * lambda; diff --git a/code/nel/src/3d/ps_located.cpp b/code/nel/src/3d/ps_located.cpp index 0bb243aa6..a62162ab9 100644 --- a/code/nel/src/3d/ps_located.cpp +++ b/code/nel/src/3d/ps_located.cpp @@ -1853,7 +1853,7 @@ void CPSLocated::updateCollisions() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } currCollision = currCollision->Next; @@ -1899,7 +1899,7 @@ void CPSLocated::updateCollisions() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } } currCollision = currCollision->Next; @@ -2012,7 +2012,7 @@ void CPSLocated::updateLife() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[k] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[k] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } ++itTime; ++itTimeInc; @@ -2040,7 +2040,7 @@ void CPSLocated::updateLife() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[k] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[k] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } ++ itTime; } @@ -2068,7 +2068,7 @@ void CPSLocated::updateLife() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[k] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[k] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } } } @@ -2396,7 +2396,7 @@ void CPSLocated::addNewlySpawnedParticles() { sint32 insertionIndex = newElement(*it, false, CParticleSystem::EllapsedTime); #ifdef NL_DEBUG - nlassert(insertionIndex != -1) + nlassert(insertionIndex != -1); #endif if (_Time[insertionIndex] >= 1.f) { @@ -2407,7 +2407,7 @@ void CPSLocated::addNewlySpawnedParticles() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[insertionIndex] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[insertionIndex] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } } //CParticleSystem::InsideSimLoop = true; diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index adf2a5dd0..6d4ee0704 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -723,7 +723,7 @@ public: do { - const uint numShapes = m._Meshes.size(); + const uint numShapes = (uint)m._Meshes.size(); const uint8 *m0, *m1; float lambda; float opLambda; @@ -1105,7 +1105,7 @@ uint CPSConstraintMesh::getNumShapes() const { const_cast(this)->update(); } - return _MeshShapeFileName.size(); + return (uint)_MeshShapeFileName.size(); } //==================================================================================== @@ -1434,7 +1434,7 @@ void CPSConstraintMesh::fillIndexesInPrecompBasis(void) { NL_PS_FUNC(CPSConstraintMesh_fillIndexesInPrecompBasis) // TODO : avoid code duplication with CPSFace ... - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (_Owner) { _IndexInPrecompBasis.resize( _Owner->getMaxSize() ); @@ -1475,7 +1475,7 @@ void CPSConstraintMesh::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } else { - uint32 nbConfigurations = _PrecompBasis.size(); + uint32 nbConfigurations = (uint32)_PrecompBasis.size(); f.serial(nbConfigurations); if (nbConfigurations) { @@ -1977,7 +1977,7 @@ void CPSConstraintMesh::newElement(const CPSEmitterInfo &info) newSizeElement(info); newPlaneBasisElement(info); // TODO : avoid code cuplication with CPSFace ... - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (nbConf) // do we use precomputed basis ? { _IndexInPrecompBasis[_Owner->getNewElementIndex()] = rand() % nbConf; diff --git a/code/nel/src/3d/ps_ribbon.cpp b/code/nel/src/3d/ps_ribbon.cpp index 21dcfc9af..457d94fe2 100644 --- a/code/nel/src/3d/ps_ribbon.cpp +++ b/code/nel/src/3d/ps_ribbon.cpp @@ -288,11 +288,11 @@ inline uint CPSRibbon::getNumVerticesInSlice() const NL_PS_FUNC(CPSRibbon_getNumVerticesInSlice) if (_BraceMode) { - return _Shape.size(); + return (uint)_Shape.size(); } else { - return _Shape.size() + (_Tex == NULL ? 0 : 1); + return (uint)_Shape.size() + (_Tex == NULL ? 0 : 1); } } @@ -724,7 +724,7 @@ void CPSRibbon::displayRibbons(uint32 nbRibbons, uint32 srcStep) // Compute ribbons // ///////////////////// const uint numVerticesInSlice = getNumVerticesInSlice(); - const uint numVerticesInShape = _Shape.size(); + const uint numVerticesInShape = (uint)_Shape.size(); // static std::vector sizes; static std::vector ribbonPos; // this is where the position of each ribbon slice center i stored @@ -943,7 +943,7 @@ CPSRibbon::CVBnPB &CPSRibbon::getVBnPB() ]; const uint numVerticesInSlice = getNumVerticesInSlice(); /// 1 vertex added for textured ribbon (to avoid texture stretching) - const uint numVerticesInShape = _Shape.size(); + const uint numVerticesInShape = (uint)_Shape.size(); // The number of slice is encoded in the upper word of the vb index @@ -974,11 +974,11 @@ CPSRibbon::CVBnPB &CPSRibbon::getVBnPB() // set the primitive block size if (_BraceMode) { - pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * (_Shape.size() / 2)); + pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * (uint32)(_Shape.size() / 2)); } else { - pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * _Shape.size()); + pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * (uint32)_Shape.size()); } // CIndexBufferReadWrite ibaWrite; diff --git a/code/nel/src/3d/ps_zone.cpp b/code/nel/src/3d/ps_zone.cpp index be8fdc331..4a804df15 100644 --- a/code/nel/src/3d/ps_zone.cpp +++ b/code/nel/src/3d/ps_zone.cpp @@ -235,7 +235,7 @@ void CPSZonePlane::computeCollisions(CPSLocated &target, uint firstInstanceIndex ci.Dist = startEnd.norm(); // we translate the particle from an epsilon so that it won't get hooked to the plane ci.NewPos = *itPosBefore + startEnd + PSCollideEpsilon * p.getNormal(); - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * p.getNormal()) * p.getNormal()); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); @@ -346,7 +346,7 @@ void CPSZoneSphere::computeCollisions(CPSLocated &target, uint firstInstanceInde ci.Dist = startEnd.norm(); // we translate the particle from an epsilon so that it won't get hooked to the sphere ci.NewPos = pos + startEnd + PSCollideEpsilon * normal; - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * normal) * normal); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); @@ -503,7 +503,7 @@ void CPSZoneDisc::computeCollisions(CPSLocated &target, uint firstInstanceIndex, hitRadius2 = (ci.NewPos - center) * (ci.NewPos - center); if (hitRadius2 < radiusIt->R2) // check collision against disc { - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * p.getNormal()) * p.getNormal()); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); @@ -953,7 +953,7 @@ void CPSZoneCylinder::computeCollisions(CPSLocated &target, uint firstInstanceIn if (alphaCyl < 0.f) alphaCyl = 1.f; } - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; // now, choose the minimum positive dist if (alphaTop < alphaBottom && alphaTop < alphaCyl) { @@ -1175,7 +1175,7 @@ void CPSZoneRectangle::computeCollisions(CPSLocated &target, uint firstInstanceI if ( fabs( (ci.NewPos - center) * X ) < *widthIt && fabs( (ci.NewPos - center) * Y ) < *heightIt) // check collision against rectangle { ci.NewPos += PSCollideEpsilon * p.getNormal(); - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * p.getNormal()) * p.getNormal()); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); diff --git a/code/nel/src/3d/quad_effect.cpp b/code/nel/src/3d/quad_effect.cpp index 7c516063a..c1b6bb76d 100644 --- a/code/nel/src/3d/quad_effect.cpp +++ b/code/nel/src/3d/quad_effect.cpp @@ -58,7 +58,7 @@ void CQuadEffect::makeRasters(const TPoint2DVect &poly dest.clear(); const float epsilon = 10E-5f; - sint size = poly.size(); + sint size = (sint)poly.size(); uint aelSize = 0; // size of active edge list sint k; // loop counter diff --git a/code/nel/src/3d/ray_mesh.cpp b/code/nel/src/3d/ray_mesh.cpp index f8eb2b78e..c9176b316 100644 --- a/code/nel/src/3d/ray_mesh.cpp +++ b/code/nel/src/3d/ray_mesh.cpp @@ -41,7 +41,7 @@ template static bool getRayIntersectionT(std::vector &vertices, const std::vector &tris, float &dist2D, float &distZ, bool computeDist2D) { - uint numTris= tris.size()/3; + uint numTris= (uint)tris.size()/3; if(!numTris) return false; @@ -243,7 +243,7 @@ bool CRayMesh::fastIntersect(const NLMISC::CMatrix &worldMatrix, const NLMISC:: // *** Make all points in ray space - uint numVerts= Vertices.size(); + uint numVerts= (uint)Vertices.size(); const CVector *src= &Vertices[0]; // enlarge temp buffer static std::vector meshInRaySpace; diff --git a/code/nel/src/3d/scene.cpp b/code/nel/src/3d/scene.cpp index 4c5e8e8c5..d00229061 100644 --- a/code/nel/src/3d/scene.cpp +++ b/code/nel/src/3d/scene.cpp @@ -840,7 +840,7 @@ void CScene::animate( TGlobalAnimationTime atTime ) //---------------- // First list all current AnimatedLightmaps (for faster vector iteration per ig) - const uint count = _AnimatedLightPtr.size (); + const uint count = (uint)_AnimatedLightPtr.size (); uint i; for (i=0; iinitModel(); // Ensure all the Traversals has enough space for visible list. - ClipTrav.reserveVisibleList(_Models.size()); - AnimDetailTrav.reserveVisibleList(_Models.size()); - LoadBalancingTrav.reserveVisibleList(_Models.size()); - LightTrav.reserveLightedList(_Models.size()); - RenderTrav.reserveRenderList(_Models.size()); + ClipTrav.reserveVisibleList((uint)_Models.size()); + AnimDetailTrav.reserveVisibleList((uint)_Models.size()); + LoadBalancingTrav.reserveVisibleList((uint)_Models.size()); + LightTrav.reserveLightedList((uint)_Models.size()); + RenderTrav.reserveRenderList((uint)_Models.size()); return m; } @@ -1309,9 +1309,9 @@ void CScene::setAutomaticAnimationSet(CAnimationSet *as) cm->setAnimationSet( _AutomaticAnimationSet ); // Add an automatic animation - _AnimatedLight.push_back ( CAnimatedLightmap (_LightGroupColor.size ()) ); + _AnimatedLight.push_back ( CAnimatedLightmap ((uint)_LightGroupColor.size ()) ); _AnimatedLightPtr.push_back ( &_AnimatedLight.back () ); - _AnimatedLightNameToIndex.insert ( std::map::value_type (lightName, _AnimatedLightPtr.size ()-1 ) ); + _AnimatedLightNameToIndex.insert ( std::map::value_type (lightName, (uint32)_AnimatedLightPtr.size ()-1 ) ); CAnimatedLightmap &animLM = _AnimatedLight.back (); animLM.setName( *itSel ); diff --git a/code/nel/src/3d/scene_group.cpp b/code/nel/src/3d/scene_group.cpp index a149e9fb9..5424ec50d 100644 --- a/code/nel/src/3d/scene_group.cpp +++ b/code/nel/src/3d/scene_group.cpp @@ -168,7 +168,7 @@ void CInstanceGroup::CInstance::serial (NLMISC::IStream& f) uint CInstanceGroup::getNumInstance () const { - return _InstancesInfos.size(); + return (uint)_InstancesInfos.size(); } // *************************************************************************** @@ -483,11 +483,11 @@ void CInstanceGroup::serial (NLMISC::IStream& f) uint32 i, j; for (i = 0; i < _ClusterInfos.size(); ++i) { - uint32 nNbPortals = _ClusterInfos[i]._Portals.size(); + uint32 nNbPortals = (uint32)_ClusterInfos[i]._Portals.size(); f.serial (nNbPortals); for (j = 0; j < nNbPortals; ++j) { - sint32 nPortalNb = (_ClusterInfos[i]._Portals[j] - &_Portals[0]); + sint32 nPortalNb = (sint32)(_ClusterInfos[i]._Portals[j] - &_Portals[0]); f.serial (nPortalNb); } } @@ -546,7 +546,7 @@ bool CInstanceGroup::addToScene (CScene& scene, IDriver *driver, uint selectedTe _Instances.resize (_InstancesInfos.size(), NULL); if (_IGAddBeginCallback) - _IGAddBeginCallback->startAddingIG(_InstancesInfos.size()); + _IGAddBeginCallback->startAddingIG((uint)_InstancesInfos.size()); // Creation and positionning of the new instance @@ -740,7 +740,7 @@ bool CInstanceGroup::addToSceneWhenAllShapesLoaded (CScene& scene, IDriver *driv if (_Portals[i]._Clusters[j]) { sint32 nClusterNb; - nClusterNb = (_Portals[i]._Clusters[j] - &_ClusterInfos[0]); + nClusterNb = (sint32)(_Portals[i]._Clusters[j] - &_ClusterInfos[0]); _Portals[i]._Clusters[j] = _ClusterInstances[nClusterNb]; } } @@ -828,7 +828,7 @@ bool CInstanceGroup::addToSceneAsync (CScene& scene, IDriver *driver, uint selec _Instances.resize (_InstancesInfos.size(), NULL); if (_IGAddBeginCallback) - _IGAddBeginCallback->startAddingIG(_InstancesInfos.size()); + _IGAddBeginCallback->startAddingIG((uint)_InstancesInfos.size()); // Creation and positionning of the new instance @@ -1374,14 +1374,14 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx // count the number of vertices / triangles / lines to add if(poly.Vertices.size()>=3) { - numTotalVertices+= poly.Vertices.size(); + numTotalVertices+= (uint)poly.Vertices.size(); } } // **** count the number of portals vertices for(j=0;j_Portals.size();j++) { - numTotalVertices+= cluster->_Portals[j]->_Poly.size(); + numTotalVertices+= (uint)cluster->_Portals[j]->_Poly.size(); } // **** Draw those cluster polygons, and portals @@ -1436,7 +1436,7 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx } } - iVert+= poly.Vertices.size(); + iVert+= (uint)poly.Vertices.size(); } } @@ -1489,7 +1489,7 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx } } - iVert+= portalVerts.size(); + iVert+= (uint)portalVerts.size(); } } diff --git a/code/nel/src/3d/shadow_map_manager.cpp b/code/nel/src/3d/shadow_map_manager.cpp index 36d87ec85..34ab87bcd 100644 --- a/code/nel/src/3d/shadow_map_manager.cpp +++ b/code/nel/src/3d/shadow_map_manager.cpp @@ -308,7 +308,7 @@ void CShadowMapManager::renderGenerate(CScene *scene) // Allow Writing on alpha only. => don't write on RGB objects! driverForShadowGeneration->setColorMask(false, false, false, true); - uint numSC= _GenerateShadowCasters.size(); + uint numSC= (uint)_GenerateShadowCasters.size(); uint baseSC= 0; while(numSC>0) { diff --git a/code/nel/src/3d/shadow_poly_receiver.cpp b/code/nel/src/3d/shadow_poly_receiver.cpp index 02797babd..51acd7037 100644 --- a/code/nel/src/3d/shadow_poly_receiver.cpp +++ b/code/nel/src/3d/shadow_poly_receiver.cpp @@ -59,9 +59,9 @@ uint CShadowPolyReceiver::addTriangle(const NLMISC::CTriangle &tri) if(_FreeTriangles.empty()) { _Triangles.push_back(TTriangleGrid::CIterator()); - id= _Triangles.size()-1; + id= (uint)_Triangles.size()-1; // enlarge render size. - _RenderTriangles.setNumIndexes(_Triangles.size() * 3); + _RenderTriangles.setNumIndexes((uint32)_Triangles.size() * 3); } else { @@ -140,10 +140,10 @@ uint CShadowPolyReceiver::allocateVertex(const CVector &v) { // Add the vertex, and init refCount to 0. _Vertices.push_back(v); - id= _Vertices.size()-1; + id= (uint)_Vertices.size()-1; // Resize the VBuffer at max possible - _VB.setNumVertices(_Vertices.size()); + _VB.setNumVertices((uint32)_Vertices.size()); } else { @@ -223,8 +223,8 @@ inline void CShadowPolyReceiver::renderSelection(IDriver *drv, CMaterial &shadow uint currentTriIdx= 0; { // Volatile: must resize before lock - _VB.setNumVertices(_Vertices.size()); - _RenderTriangles.setNumIndexes(_Triangles.size() * 3); + _VB.setNumVertices((uint32)_Vertices.size()); + _RenderTriangles.setNumIndexes((uint32)_Triangles.size() * 3); // lock volatile, to avoid cpu stall CVertexBufferReadWrite vba; @@ -401,7 +401,7 @@ void CShadowPolyReceiver::computeClippedTrisWithPolyClip(const CShadowMap *shado } } - uint numVisibleTris = visibleTris.size(); + uint numVisibleTris = (uint)visibleTris.size(); // compute normals if needed if (colorUpfacingVertices) { diff --git a/code/nel/src/3d/shadow_skin.cpp b/code/nel/src/3d/shadow_skin.cpp index 3f764236b..340453c49 100644 --- a/code/nel/src/3d/shadow_skin.cpp +++ b/code/nel/src/3d/shadow_skin.cpp @@ -42,7 +42,7 @@ void CShadowSkin::applySkin(CVector *dst, std::vector &boneMat3x4) { if(Vertices.empty()) return; - uint numVerts= Vertices.size(); + uint numVerts= (uint)Vertices.size(); CShadowVertex *src= &Vertices[0]; // Then do the skin diff --git a/code/nel/src/3d/shape_bank.cpp b/code/nel/src/3d/shape_bank.cpp index 7108d1243..387d89a02 100644 --- a/code/nel/src/3d/shape_bank.cpp +++ b/code/nel/src/3d/shape_bank.cpp @@ -712,7 +712,7 @@ sint CShapeBank::getShapeCacheFreeSpace(const std::string &shapeCacheName) const TShapeCacheMap::const_iterator scmIt = ShapeCacheNameToShapeCache.find( shapeCacheName ); if( scmIt != ShapeCacheNameToShapeCache.end() ) { - return scmIt->second.MaxSize - scmIt->second.Elements.size(); + return scmIt->second.MaxSize - (sint)scmIt->second.Elements.size(); } return 0; } diff --git a/code/nel/src/3d/skeleton_model.cpp b/code/nel/src/3d/skeleton_model.cpp index bd1896b4a..f21a67b42 100644 --- a/code/nel/src/3d/skeleton_model.cpp +++ b/code/nel/src/3d/skeleton_model.cpp @@ -807,7 +807,7 @@ void CSkeletonModel::traverseAnimDetail() // must test / update the hierarchy of Bones. // Since they are orderd in depth-first order, we are sure that parent are computed before sons. - uint numBoneToCompute= _BoneToCompute.size(); + uint numBoneToCompute= (uint)_BoneToCompute.size(); CSkeletonModel::CBoneCompute *pBoneCompute= numBoneToCompute? &_BoneToCompute[0] : NULL; // traverse only bones which need to be computed for(;numBoneToCompute>0;numBoneToCompute--, pBoneCompute++) @@ -951,7 +951,7 @@ void CSkeletonModel::computeLodTexture() // Ok, compute influence of this instance on the Lod. // ---- Build all bmps of the instance with help of the asyncTextureManager - uint numMats= mbi->Materials.size(); + uint numMats= (uint)mbi->Materials.size(); // 256 materials possibles for the lod Manager numMats= min(numMats, 256U); // for endTexturecompute diff --git a/code/nel/src/3d/skeleton_shape.cpp b/code/nel/src/3d/skeleton_shape.cpp index a1d60ca36..01ab60fca 100644 --- a/code/nel/src/3d/skeleton_shape.cpp +++ b/code/nel/src/3d/skeleton_shape.cpp @@ -238,7 +238,7 @@ void CSkeletonShape::getAABBox(NLMISC::CAABBox &bbox) const uint CSkeletonShape::getLodForDistance(float dist) const { uint start=0; - uint end= _Lods.size(); + uint end= (uint)_Lods.size(); // find lower_bound by dichotomy while(end-1>start) { diff --git a/code/nel/src/3d/skeleton_spawn_script.cpp b/code/nel/src/3d/skeleton_spawn_script.cpp index 35733084b..6291d846f 100644 --- a/code/nel/src/3d/skeleton_spawn_script.cpp +++ b/code/nel/src/3d/skeleton_spawn_script.cpp @@ -155,7 +155,7 @@ void CSkeletonSpawnScript::parseCache(CScene *scene, CSkeletonModel *skeleton) // Delay the model creation at end of CScene::render() CSSSModelRequest req; req.Skel= skeleton; - req.InstanceId= _Instances.size()-1; + req.InstanceId= (uint)_Instances.size()-1; req.Shape= words[2]; // World Spawned Objects are sticked to the root bone (for CLod hiding behavior) req.BoneId= 0; @@ -211,7 +211,7 @@ void CSkeletonSpawnScript::parseCache(CScene *scene, CSkeletonModel *skeleton) // Delay the model creation at end of CScene::render() CSSSModelRequest req; req.Skel= skeleton; - req.InstanceId= _Instances.size()-1; + req.InstanceId= (uint)_Instances.size()-1; req.Shape= words[2]; req.BoneId= boneId; req.SSSWO= false; diff --git a/code/nel/src/3d/skeleton_weight.cpp b/code/nel/src/3d/skeleton_weight.cpp index c01ad9dbb..cbbd63295 100644 --- a/code/nel/src/3d/skeleton_weight.cpp +++ b/code/nel/src/3d/skeleton_weight.cpp @@ -28,7 +28,7 @@ namespace NL3D uint CSkeletonWeight::getNumNode () const { - return _Elements.size(); + return (uint)_Elements.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/text_context.cpp b/code/nel/src/3d/text_context.cpp index c7e7afba0..32d842a50 100644 --- a/code/nel/src/3d/text_context.cpp +++ b/code/nel/src/3d/text_context.cpp @@ -73,7 +73,7 @@ uint32 CTextContext::textPush (const char *format, ...) _CacheStrings.push_back (csTmp); if (_CacheFreePlaces.size() == 0) _CacheFreePlaces.resize (1); - _CacheFreePlaces[0] = _CacheStrings.size()-1; + _CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1; _CacheNbFreePlaces = 1; } @@ -99,7 +99,7 @@ uint32 CTextContext::textPush (const ucstring &str) _CacheStrings.push_back (csTmp); if (_CacheFreePlaces.size() == 0) _CacheFreePlaces.resize (1); - _CacheFreePlaces[0] = _CacheStrings.size()-1; + _CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1; _CacheNbFreePlaces = 1; } diff --git a/code/nel/src/3d/texture_font.cpp b/code/nel/src/3d/texture_font.cpp index 078782696..0ff997282 100644 --- a/code/nel/src/3d/texture_font.cpp +++ b/code/nel/src/3d/texture_font.cpp @@ -350,7 +350,7 @@ CTextureFont::SLetterInfo* CTextureFont::getLetterInfo (SLetterKey& k) Accel.insert (map::value_type(k.getVal(),Front[cat])); // Invalidate the zone - sint index = (Front[cat] - &Letters[cat][0]);// / sizeof (SLetterInfo); + sint index = (sint)(Front[cat] - &Letters[cat][0]);// / sizeof (SLetterInfo); sint sizex = TextureSizeX / Categories[cat]; sint x = index % sizex; sint y = index / sizex; diff --git a/code/nel/src/3d/texture_near.cpp b/code/nel/src/3d/texture_near.cpp index 2d45edb9f..2b7f555ce 100644 --- a/code/nel/src/3d/texture_near.cpp +++ b/code/nel/src/3d/texture_near.cpp @@ -55,7 +55,7 @@ CTextureNear::CTextureNear(sint size) // *************************************************************************** sint CTextureNear::getNbAvailableTiles() { - return _FreeTiles.size(); + return (sint)_FreeTiles.size(); } // *************************************************************************** uint CTextureNear::getTileAndFillRect(CRGBA map[NL_TILE_LIGHTMAP_SIZE*NL_TILE_LIGHTMAP_SIZE]) diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 779d0133c..0a187ad21 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -162,7 +162,7 @@ void CTileBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // *************************************************************************** sint CTileBank::addLand (const std::string& name) { - sint last=_LandVector.size(); + sint last=(sint)_LandVector.size(); _LandVector.push_back(CTileLand()); _LandVector[last].setName (name); return last; @@ -179,7 +179,7 @@ void CTileBank::removeLand (sint landIndex) // *************************************************************************** sint CTileBank::addTileSet (const std::string& name) { - sint last=_TileSetVector.size(); + sint last=(sint)_TileSetVector.size(); _TileSetVector.push_back(CTileSet()); _TileSetVector[last].setName (name); for (int i=0; i &vegetables) { _VegetableSeed[i]= sumVeget; // add number of vegetable for next seed. - sumVeget+= _VegetableList[i].size(); + sumVeget+= (uint)_VegetableList[i].size(); } // compile some data diff --git a/code/nel/src/3d/track_sampled_common.cpp b/code/nel/src/3d/track_sampled_common.cpp index eaad3f825..3da3f9921 100644 --- a/code/nel/src/3d/track_sampled_common.cpp +++ b/code/nel/src/3d/track_sampled_common.cpp @@ -100,7 +100,7 @@ void CTrackSampledCommon::buildCommon(const std::vector &timeList, float uint i; // reset. - uint numKeys= timeList.size(); + uint numKeys= (uint)timeList.size(); _TimeBlocks.clear(); // Special case of 0 or 1 key. @@ -158,7 +158,7 @@ void CTrackSampledCommon::buildCommon(const std::vector &timeList, float } // Build the timeBlocks. - _TimeBlocks.resize(timeBlockKeyId.size()); + _TimeBlocks.resize((uint32)timeBlockKeyId.size()); for(i=0; i &timeList, const std::ve uint i; // reset. - uint numKeys= keyList.size(); + uint numKeys= (uint)keyList.size(); _Keys.clear(); _TimeBlocks.clear(); @@ -230,7 +230,7 @@ void CTrackSampledQuat::applySampleDivisor(uint sampleDivisor) // **** rebuild the keys NLMISC::CObjectVector newKeys; - newKeys.resize(keepKeys.size()); + newKeys.resize((uint32)keepKeys.size()); for(uint i=0;i &timeList, const std:: uint i; // reset. - uint numKeys= keyList.size(); + uint numKeys= (uint)keyList.size(); _Keys.clear(); _TimeBlocks.clear(); @@ -134,7 +134,7 @@ void CTrackSampledVector::applySampleDivisor(uint sampleDivisor) // **** rebuild the keys NLMISC::CObjectVector newKeys; - newKeys.resize(keepKeys.size()); + newKeys.resize((uint32)keepKeys.size()); for(uint i=0;iParent==parent) diff --git a/code/nel/src/3d/u_instance.cpp b/code/nel/src/3d/u_instance.cpp index 3d3bd8c68..e50d71bf5 100644 --- a/code/nel/src/3d/u_instance.cpp +++ b/code/nel/src/3d/u_instance.cpp @@ -244,7 +244,7 @@ uint UInstance::getNumMaterials() const { CMeshBaseInstance *mi= dynamic_cast(_Object); if(mi) - return mi->Materials.size(); + return (uint)mi->Materials.size(); else return 0; } diff --git a/code/nel/src/3d/u_skeleton.cpp b/code/nel/src/3d/u_skeleton.cpp index e0ae9a032..2d704d9ad 100644 --- a/code/nel/src/3d/u_skeleton.cpp +++ b/code/nel/src/3d/u_skeleton.cpp @@ -161,7 +161,7 @@ uint USkeleton::getNumBones() const { NL3D_HAUTO_UI_SKELETON; CSkeletonModel *object = getObjectPtr(); - return object->Bones.size(); + return (uint)object->Bones.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index 85f6c1fdf..656f99dfe 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -891,7 +891,7 @@ void CVegetableManager::reserveIgAddInstances(CVegetableInstanceGroupReserve & // Reserve space in the rdrPass. vegetRdrPass.NVertices+= numInstances * shape->VB.getNumVertices(); - vegetRdrPass.NTriangles+= numInstances * shape->TriangleIndices.size()/3; + vegetRdrPass.NTriangles+= numInstances * (uint)shape->TriangleIndices.size()/3; // if the instances are lighted, reserve space for lighting updates if(instanceLighted) vegetRdrPass.NLightedInstances+= numInstances; @@ -1206,8 +1206,8 @@ void CVegetableManager::addInstance(CVegetableInstanceGroup *ig, // Vertex/triangle Info. uint numNewVertices= shape->VB.getNumVertices(); - uint numNewTris= shape->TriangleIndices.size()/3; - uint numNewIndices= shape->TriangleIndices.size(); + uint numNewTris= (uint)shape->TriangleIndices.size()/3; + uint numNewIndices= (uint)shape->TriangleIndices.size(); // src info. uint srcNormalOff= (instanceLighted? shape->VB.getNormalOff() : 0); @@ -2519,7 +2519,7 @@ uint CVegetableManager::updateInstanceLighting(CVegetableInstanceGroup *ig, uin CMatrix &normalMat= vegetLI.NormalMat; // array of vertex id to update uint32 *ptrVid= vegetRdrPass.Vertices.getPtr() + vegetLI.StartIdInRdrPass; - uint numVertices= shape->InstanceVertices.size(); + uint numVertices= (uint)shape->InstanceVertices.size(); // Copy Dynamic Lightmap UV in Alpha part (save memory for an extra cost of 1 VP instruction) primaryRGBA.A= vegetLI.DlmUV.U; diff --git a/code/nel/src/3d/vegetablevb_allocator.cpp b/code/nel/src/3d/vegetablevb_allocator.cpp index 8bb781a3b..b36df6918 100644 --- a/code/nel/src/3d/vegetablevb_allocator.cpp +++ b/code/nel/src/3d/vegetablevb_allocator.cpp @@ -170,7 +170,7 @@ void CVegetableVBAllocator::unlockBuffer() uint CVegetableVBAllocator::getNumUserVerticesAllocated() const { // get the number of vertices which are allocated by allocateVertex(). - return _NumVerticesAllocated - _VertexFreeMemory.size(); + return _NumVerticesAllocated - (uint)_VertexFreeMemory.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/vertex_buffer.cpp b/code/nel/src/3d/vertex_buffer.cpp index c52ab0622..42d271c03 100644 --- a/code/nel/src/3d/vertex_buffer.cpp +++ b/code/nel/src/3d/vertex_buffer.cpp @@ -463,7 +463,7 @@ void CVertexBuffer::initEx () // Compute new capacity if (_VertexSize) - _Capacity = _NonResidentVertices.size()/_VertexSize; + _Capacity = (uint32)_NonResidentVertices.size()/_VertexSize; else _Capacity = 0; diff --git a/code/nel/src/3d/visual_collision_entity.cpp b/code/nel/src/3d/visual_collision_entity.cpp index ef719c23a..625f87c2e 100644 --- a/code/nel/src/3d/visual_collision_entity.cpp +++ b/code/nel/src/3d/visual_collision_entity.cpp @@ -149,7 +149,7 @@ CTrianglePatch *CVisualCollisionEntity::getPatchTriangleUnderUs(const CVector & CPatchQuadBlock &qb= *_PatchQuadBlocks[qbId]; // Build the 2 triangles of this tile Id. - sint idStart= testTriangles.size(); + sint idStart= (sint)testTriangles.size(); testTriangles.resize(idStart+2); qb.buildTileTriangles((uint8)ptr->QuadId, &testTriangles[idStart]); diff --git a/code/nel/src/3d/visual_collision_mesh.cpp b/code/nel/src/3d/visual_collision_mesh.cpp index fb2f82bd9..22984f3ff 100644 --- a/code/nel/src/3d/visual_collision_mesh.cpp +++ b/code/nel/src/3d/visual_collision_mesh.cpp @@ -276,7 +276,7 @@ bool CVisualCollisionMesh::build(const std::vector &vertices, const localBBox.extend(vertices[i]); // Build the Static Grid - uint numTris= triangles.size()/3; + uint numTris= (uint)triangles.size()/3; _QuadGrid.create(16, numTris, localBBox); // Add all triangles for(i=0;i gives grid cells that must be clipped to fit the shape boundaries // Make sure that rasters array for inside has the same size that raster array for borders (by inserting NULL rasters) - sint height = border.size(); + sint height = (sint)border.size(); if (_Inside.empty()) { _MinYInside = minYBorder; } - sint bottomGap = border.size() - _Inside.size(); + sint bottomGap = (sint)(border.size() - _Inside.size()); _Inside.resize(height); nlassert(minYBorder == _MinYInside); @@ -1285,7 +1285,7 @@ uint CWaterModel::getNumWantedVertices() const CVector2f *prevVert = &projPoly.Vertices.back(); const CVector2f *currVert = &projPoly.Vertices.front(); - uint numVerts = projPoly.Vertices.size(); + uint numVerts = (uint)projPoly.Vertices.size(); bool ccw = projPoly.isCCWOriented(); clipPlanes.resize(numVerts); for(uint k = 0; k < numVerts; ++k) @@ -1324,11 +1324,11 @@ uint CWaterModel::getNumWantedVertices() if (!clipPoly.Vertices.empty()) { // backup result (will be unprojected later) - _ClippedTriNumVerts.push_back(clipPoly.Vertices.size()); - uint prevSize = _ClippedTris.size(); + _ClippedTriNumVerts.push_back((uint)clipPoly.Vertices.size()); + uint prevSize = (uint)_ClippedTris.size(); _ClippedTris.resize(_ClippedTris.size() + clipPoly.Vertices.size()); std::copy(clipPoly.Vertices.begin(), clipPoly.Vertices.end(), _ClippedTris.begin() + prevSize); // append to packed list - totalNumVertices += (clipPoly.Vertices.size() - 2) * 3; + totalNumVertices += ((uint)clipPoly.Vertices.size() - 2) * 3; } } // middle block, are not clipped, but count the number of wanted vertices @@ -1348,11 +1348,11 @@ uint CWaterModel::getNumWantedVertices() if (!clipPoly.Vertices.empty()) { // backup result (will be unprojected later) - _ClippedTriNumVerts.push_back(clipPoly.Vertices.size()); - uint prevSize = _ClippedTris.size(); + _ClippedTriNumVerts.push_back((uint)clipPoly.Vertices.size()); + uint prevSize = (uint)_ClippedTris.size(); _ClippedTris.resize(_ClippedTris.size() + clipPoly.Vertices.size()); std::copy(clipPoly.Vertices.begin(), clipPoly.Vertices.end(), _ClippedTris.begin() + prevSize); // append to packed list - totalNumVertices += (clipPoly.Vertices.size() - 2) * 3; + totalNumVertices += ((uint)clipPoly.Vertices.size() - 2) * 3; } } } @@ -1512,7 +1512,7 @@ uint CWaterModel::fillVBSoft(void *datas, uint startTri) } } nlassert((dest - (uint8 * ) datas) % (3 * WATER_VERTEX_SOFT_SIZE) == 0); - uint endTri = (dest - (uint8 * ) datas) / (3 * WATER_VERTEX_SOFT_SIZE); + uint endTri = (uint)(dest - (uint8 * ) datas) / (3 * WATER_VERTEX_SOFT_SIZE); _NumTris = endTri - _StartTri; return endTri; } @@ -1600,7 +1600,7 @@ uint CWaterModel::fillVBHard(void *datas, uint startTri) } } nlassert((dest - (uint8 * ) datas) % (3 * WATER_VERTEX_HARD_SIZE) == 0); - uint endTri = (dest - (uint8 * ) datas) / (3 * WATER_VERTEX_HARD_SIZE); + uint endTri = (uint)(dest - (uint8 * ) datas) / (3 * WATER_VERTEX_HARD_SIZE); _NumTris = endTri - _StartTri; return endTri; } diff --git a/code/nel/src/3d/water_pool_manager.cpp b/code/nel/src/3d/water_pool_manager.cpp index 969bab32b..4babd29f7 100644 --- a/code/nel/src/3d/water_pool_manager.cpp +++ b/code/nel/src/3d/water_pool_manager.cpp @@ -187,7 +187,7 @@ bool CWaterPoolManager::isWaterShapeObserver(const CWaterShape *shape) const uint CWaterPoolManager::getNumPools() const { - return _PoolMap.size(); + return (uint)_PoolMap.size(); } //=============================================================================================== @@ -219,7 +219,7 @@ void CWaterPoolManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream) TPoolMap::iterator it; if (!f.isReading()) { - size = _PoolMap.size(); + size = (uint32)_PoolMap.size(); it = _PoolMap.begin(); } else diff --git a/code/nel/src/3d/zone.cpp b/code/nel/src/3d/zone.cpp index 579aa5d2e..ef43668b8 100644 --- a/code/nel/src/3d/zone.cpp +++ b/code/nel/src/3d/zone.cpp @@ -230,8 +230,8 @@ void CZone::build(const CZoneInfo &zoneInfo, uint32 numVertices) NumVertices= max((uint32)NumVertices, numVertices); // Init the Clip Arrays - _PatchRenderClipped.resize(Patchs.size()); - _PatchOldRenderClipped.resize(Patchs.size()); + _PatchRenderClipped.resize((uint)Patchs.size()); + _PatchOldRenderClipped.resize((uint)Patchs.size()); _PatchRenderClipped.setAll(); _PatchOldRenderClipped.setAll(); @@ -373,8 +373,8 @@ void CZone::build(const CZone &zone) PatchConnects= zone.PatchConnects; // Init the Clip Arrays - _PatchRenderClipped.resize(Patchs.size()); - _PatchOldRenderClipped.resize(Patchs.size()); + _PatchRenderClipped.resize((uint)Patchs.size()); + _PatchOldRenderClipped.resize((uint)Patchs.size()); _PatchRenderClipped.setAll(); _PatchOldRenderClipped.setAll(); @@ -488,8 +488,8 @@ void CZone::serial(NLMISC::IStream &f) // If read, must create and init Patch Clipped state to true (clipped even if not compiled) if(f.isReading()) { - _PatchRenderClipped.resize(Patchs.size()); - _PatchOldRenderClipped.resize(Patchs.size()); + _PatchRenderClipped.resize((uint)Patchs.size()); + _PatchOldRenderClipped.resize((uint)Patchs.size()); _PatchRenderClipped.setAll(); _PatchOldRenderClipped.setAll(); } @@ -999,7 +999,7 @@ void CZone::clip(const std::vector &pyramid) // get BitSet as Raw Array of uint32 uint32 *oldRenderClip= const_cast(&_PatchOldRenderClipped.getVector()[0]); const uint32 *newRenderClip= &_PatchRenderClipped.getVector()[0]; - uint numPatchs= Patchs.size(); + uint numPatchs= (uint)Patchs.size(); // Then, we must test by patch. for(uint i=0;i &patchInfo, NL3D::CZoneSymmetrisation &zoneSymmetry, const NL3D::CTileBank &bank, bool symmetry, uint rotate, float snapCell, float weldThreshold, const NLMISC::CMatrix &toOriginalSpace) { - uint patchCount = patchInfo.size (); + uint patchCount = (uint)patchInfo.size (); uint i; // --- Export tile info Symmetry of the bind info. diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 982c6df7d..7c23c6f5c 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -970,7 +970,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight CVector center = zoneBB.getCenter (); // *** Compute planes - const uint size=obstacles.size(); + const uint size=(uint)obstacles.size(); uint triangleId; for (triangleId=0; triangleIdobstacles.size ()) - lastTriangle=obstacles.size (); + lastTriangle=(uint)obstacles.size (); // Create a thread CRenderZBuffer *runnable = new CRenderZBuffer (process, this, &description, firstTriangle, lastTriangle - firstTriangle, &obstacles); @@ -1132,7 +1132,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight pZone->retrieve (_PatchInfo, _BorderVertices); // Number of patch - uint patchCount=_PatchInfo.size(); + uint patchCount=(uint)_PatchInfo.size(); // Bit array to know if the lumel is shadowed if (description.Shadow) @@ -1150,7 +1150,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight } // Number of patch - uint patchCount=_PatchInfo.size(); + uint patchCount=(uint)_PatchInfo.size(); // Reset patch count { @@ -1294,7 +1294,7 @@ void CZoneLighter::processCalc (uint process, const CLightDesc& description) std::vector &lumels=_Lumels[patch]; // Lumel count - uint lumelCount=lumels.size(); + uint lumelCount=(uint)lumels.size(); CPatchInfo &patchInfo=_PatchInfo[patch]; nlassert (patchInfo.Lumels.size()==lumelCount); @@ -1315,7 +1315,7 @@ void CZoneLighter::processCalc (uint process, const CLightDesc& description) std::vector &lumels=_Lumels[patch]; // Lumel count - uint lumelCount=lumels.size(); + uint lumelCount=(uint)lumels.size(); CPatchInfo &patchInfo=_PatchInfo[patch]; nlassert (patchInfo.Lumels.size()==lumelCount); @@ -1613,7 +1613,7 @@ void CZoneLighter::addTriangles (CLandscape &landscape, vector &listZone, landscape.getTessellationLeaves(leaves); // Number of leaves - uint leavesCount=leaves.size(); + uint leavesCount=(uint)leaves.size(); // Reserve the array triangleArray.reserve (triangleArray.size()+leavesCount); @@ -1997,7 +1997,7 @@ void CZoneLighter::buildZoneInformation (CLandscape &landscape, const vector > visited; // Zone count - uint zoneCount=listZone.size(); + uint zoneCount=(uint)listZone.size(); // Resize arries _Locator.resize (zoneCount); @@ -2164,7 +2164,7 @@ void CZoneLighter::buildZoneInformation (CLandscape &landscape, const vector obstacleGrid; obstacleGrid.create(gridSize, gridCellSize); - uint size= obstacles.size(); + uint size= (uint)obstacles.size(); for(i=0; i::iterator it = tessFaces.begin(); it != tessFaces.end(); ++it, ++triCount) @@ -3673,7 +3673,7 @@ void CZoneLighter::computeTileFlagsForPositionTowardWater(const CLightDesc &ligh NLMISC::CPolygon2D tilePoly; tilePoly.Vertices.resize(4); - uint tileCount = 0, totalTileCount = tiles.size(); + uint tileCount = 0, totalTileCount = (uint)tiles.size(); for (TTileOfPatchMap::iterator tileIt = tiles.begin(); tileIt != tiles.end(); ++tileIt, ++tileCount) { diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 4e6da4b5b..407a94cfd 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -320,7 +320,7 @@ const std::string &CForm::getParentFilename (uint parent) const uint CForm::getParentCount () const { - return ParentList.size (); + return (uint)ParentList.size (); } // *************************************************************************** diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index a973ed73e..6f9cc42f5 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -390,7 +390,7 @@ void CFormDfn::getParentDfn (std::vector &array, uint32 round) uint CFormDfn::getNumParent () const { - return Parents.size (); + return (uint)Parents.size (); } // *************************************************************************** @@ -411,7 +411,7 @@ const string& CFormDfn::getParentFilename (uint parent) const uint CFormDfn::getNumEntry () const { - return Entries.size(); + return (uint)Entries.size(); } // *************************************************************************** @@ -586,11 +586,11 @@ CFormDfn *CFormDfn::getSubDfn (uint index, uint &dfnIndex) // For each parent uint dfn; dfnIndex = index; - uint parentSize = parentDfn.size(); + uint parentSize = (uint)parentDfn.size(); for (dfn=0; dfnEntries.size (); + uint size = (uint)parentDfn[dfn]->Entries.size (); if (dfnIndexEntries.size (); + uint size = (uint)parentDfn[dfn]->Entries.size (); if (dfnIndex=0) { CEntry *entryPtr=&Entries[entryIndex]; @@ -783,7 +783,7 @@ bool CFormDfn::getEntryType (uint entry, UType **type) uint CFormDfn::getNumParents () const { - return Parents.size (); + return (uint)Parents.size (); } // *************************************************************************** diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index 37cbd7ae7..0f6cfaa65 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -1153,7 +1153,7 @@ bool CFormElm::getInternalNodeByName (CForm *form, const char *name, const CForm // The array pointer CFormElmArray *array = safe_cast(*node); - uint oldSize = array->Elements.size (); + uint oldSize = (uint)array->Elements.size (); array->Elements.resize (arrayIndex+1); // Insert empty element @@ -1358,7 +1358,7 @@ exit:; // Get the path name string formName; backupFirstElm->getFormName (formName); - uint formNameSize = formName.size (); + uint formNameSize = (uint)formName.size (); if ((formNameSize > 0) && (formName[formNameSize-1] != '.') && (formName[formNameSize-1] != '[')) formName += "."; formName += name; @@ -1712,7 +1712,7 @@ bool CFormElmStruct::isStruct () const bool CFormElmStruct::getStructSize (uint &size) const { - size = Elements.size(); + size = (uint)Elements.size(); return true; } @@ -2275,7 +2275,7 @@ bool CFormElmArray::isArray () const bool CFormElmArray::getArraySize (uint &size) const { - size = Elements.size (); + size = (uint)Elements.size (); return true; } diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index 3eb5fc347..c120df9a8 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -340,7 +340,7 @@ public: // While the filename as a number sint i; - for (i=filename.size ()-1; i>=0; i--) + for (i=(sint)filename.size ()-1; i>=0; i--) { if ((filename[i]<'0') || (filename[i]>'9')) break; @@ -575,7 +575,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod { // Evaluate predefinition uint i; - uint predefCount = Definitions.size (); + uint predefCount = (uint)Definitions.size (); for (i=0; igetFilename ().c_str (), "getValue", "Missing closing quote\n%s\n%s", result.c_str (), msg); return false; } @@ -702,7 +702,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod { // Build a nice error output in warning char msg[512]; - buildError (msg, result.size ()); + buildError (msg, (uint)result.size ()); warning (false, formName, form->getFilename ().c_str (), "getValue", "Missing double quote\n%s\n%s", result.c_str (), msg); return false; } @@ -757,7 +757,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod { // Evaluate predefinition uint i; - uint predefCount = Definitions.size (); + uint predefCount = (uint)Definitions.size (); for (i=0; i::iterator first(_Properties.begin()), last(_Properties.end()); for (; first != last; ++first) @@ -1100,7 +1100,7 @@ void IPrimitive::serial (NLMISC::IStream &f) void IPrimitive::updateChildId (uint index) { uint i; - uint count = _Children.size (); + uint count = (uint)_Children.size (); for (i=index; i_ChildId = i; } @@ -1598,7 +1598,7 @@ bool IPrimitive::insertChild (IPrimitive *primitive, uint index) { // At the end ? if (index == AtTheEnd) - index = _Children.size (); + index = (uint)_Children.size (); // Index valid ? if (index>_Children.size ()) @@ -1854,7 +1854,7 @@ void IPrimitive::initDefaultValues (CLigoConfig &config) if (primitiveClass) { // For each properties - uint count = primitiveClass->Parameters.size (); + uint count = (uint)primitiveClass->Parameters.size (); uint i; for (i=0; i &pairs = matchGroup.Pairs[rules]; diff --git a/code/nel/src/ligo/zone_edge.cpp b/code/nel/src/ligo/zone_edge.cpp index 8adfba0d0..235ba0880 100644 --- a/code/nel/src/ligo/zone_edge.cpp +++ b/code/nel/src/ligo/zone_edge.cpp @@ -53,7 +53,7 @@ bool CZoneEdge::build (const std::vector &theEdge, const std::v } // Check last position - uint lastIndex = theEdge.size()-1; + uint lastIndex = (uint)theEdge.size()-1; toCheck = CVector (theEdge[lastIndex].x, theEdge[lastIndex].y, 0); if (((toCheck-CVector (config.CellSize, 0, 0)).norm())>config.Snap) { diff --git a/code/nel/src/ligo/zone_edge.h b/code/nel/src/ligo/zone_edge.h index 661977f91..1a433b781 100644 --- a/code/nel/src/ligo/zone_edge.h +++ b/code/nel/src/ligo/zone_edge.h @@ -64,7 +64,7 @@ public: void invert (const CLigoConfig &config); /// Return the vertex count - uint getNumVertex () const { return _TheEdge.size(); } + uint getNumVertex () const { return (uint)_TheEdge.size(); } /// Return the vertex const NLMISC::CVector& getVertex (uint id) const { return _TheEdge[id]; } diff --git a/code/nel/src/ligo/zone_template.cpp b/code/nel/src/ligo/zone_template.cpp index feca42e44..a42ae50aa 100644 --- a/code/nel/src/ligo/zone_template.cpp +++ b/code/nel/src/ligo/zone_template.cpp @@ -104,7 +104,7 @@ bool CZoneTemplate::build (const std::vector &vertices, const s vector boundaryFlags; // Vertices count - uint vertexCount = vertices.size(); + uint vertexCount = (uint)vertices.size(); // Resize the array boundaryFlags.resize (vertexCount, 0); @@ -131,7 +131,7 @@ bool CZoneTemplate::build (const std::vector &vertices, const s multimap edgePairReverse; // Index count - uint edgeCount = indexes.size(); + uint edgeCount = (uint)indexes.size(); // For each vertices uint edge; diff --git a/code/nel/src/logic/logic_state_machine.cpp b/code/nel/src/logic/logic_state_machine.cpp index 092c90263..dd4166bdb 100644 --- a/code/nel/src/logic/logic_state_machine.cpp +++ b/code/nel/src/logic/logic_state_machine.cpp @@ -504,7 +504,7 @@ bool testNameWithFilter( sint8 filter, string motif, string varName ) // *xxx case 1 : { - sint beginIndex = varName.size() - motif.size() - 1; + sint beginIndex = (sint)(varName.size() - motif.size() - 1); string endOfVarName = varName.substr(beginIndex,motif.size()); if( endOfVarName == motif ) {