some w4 level warnings fixed

This commit is contained in:
Mikulas Florek 2016-04-28 14:47:46 +02:00
parent 4998c88fb1
commit 917a42f661
6 changed files with 12 additions and 10 deletions

View file

@ -393,6 +393,8 @@ public:
void installLuaPackageLoader() const
{
lua_getglobal(m_state, "package");
lua_getfield(m_state, -1, "searchers");
int numLoaders = 0;
lua_pushnil(m_state);
while (lua_next(m_state, -2) != 0)

View file

@ -102,7 +102,7 @@ static bool isSkinned(const aiScene* scene, const aiMaterial* material)
static const aiNode* getOwner(const aiNode* node, int mesh_index)
{
for (int i = 0; i < (int)node->mNumMeshes; ++i)
for (unsigned int i = 0; i < (int)node->mNumMeshes; ++i)
{
if (node->mMeshes[i] == mesh_index) return node;
}
@ -1051,7 +1051,6 @@ struct ConvertTask : public Lumix::MT::Task
static ConvertTask* that = nullptr;
that = this;
auto cmpMeshes = [](const void* a, const void* b) -> int {
auto scene = that->m_dialog.m_importers.back().GetScene();
auto a_mesh = static_cast<const ImportMesh*>(a);
auto b_mesh = static_cast<const ImportMesh*>(b);
return a_mesh->lod - b_mesh->lod;
@ -1111,9 +1110,9 @@ struct ConvertTask : public Lumix::MT::Task
ASSERT(bone_index >= 0);
for (unsigned int k = 0; k < bone->mNumWeights; ++k)
{
int idx = mesh.map_from_input[bone->mWeights[k].mVertexId];
auto idx = mesh.map_from_input[bone->mWeights[k].mVertexId];
ASSERT(idx == bone->mWeights[k].mVertexId);
ASSERT(idx < mesh.map_to_input.size());
ASSERT(idx < (unsigned int)mesh.map_to_input.size());
auto& info = infos[idx];
addBoneInfluence(info, bone->mWeights[k].mWeight, bone_index);
}
@ -2437,6 +2436,8 @@ static bool createBillboard(ImportAssetDialog& dialog,
auto light_entity = universe.createEntity({0, 0, 0}, {0, 0, 0, 0});
auto light_cmp = render_scene->createComponent(Lumix::crc32("global_light"), light_entity);
render_scene->setGlobalLightIntensity(light_cmp, 0);
render_scene->setLightAmbientIntensity(light_cmp, 1);
while (engine.getFileSystem().hasWork()) engine.getFileSystem().updateAsyncTransactions();

View file

@ -293,7 +293,6 @@ void Material::deserializeUniforms(JsonSerializer& serializer)
serializer.nextArrayItem();
serializer.deserializeObjectBegin();
char label[256];
auto uniform_type = bgfx::UniformType::End;
while (!serializer.isObjectEnd())
{
serializer.deserializeLabel(label, 255);

View file

@ -11,7 +11,7 @@ namespace Lumix
class LUMIX_RENDERER_API ModelManager : public ResourceManagerBase
{
public:
ModelManager(IAllocator& allocator, Renderer& renderer)
ModelManager(IAllocator& allocator)
: ResourceManagerBase(allocator)
, m_allocator(allocator)
{}

View file

@ -611,7 +611,7 @@ struct RendererImpl : public Renderer
: m_engine(engine)
, m_allocator(engine.getAllocator())
, m_texture_manager(m_allocator)
, m_model_manager(m_allocator, *this)
, m_model_manager(m_allocator)
, m_material_manager(*this, m_allocator)
, m_shader_manager(*this, m_allocator)
, m_shader_binary_manager(*this, m_allocator)

View file

@ -291,13 +291,13 @@ int Terrain::getGrassTypeDensity(int index) const
void Terrain::setGrassTypeDistance(int index, float distance)
{
forceGrassUpdate();
GrassType& type = *m_grass_types[index];
type.m_distance = Math::clamp(distance, 1.0f, FLT_MAX);
m_grass_distance = 0;
for (auto* type : m_grass_types)
{
m_grass_distance = Math::maximum(m_grass_distance, int(distance / GRASS_QUAD_RADIUS + 0.99f));
m_grass_distance = Math::maximum(m_grass_distance, int(type->m_distance / GRASS_QUAD_RADIUS + 0.99f));
}
GrassType& type = *m_grass_types[index];
type.m_distance = Math::clamp(distance, 1.0f, FLT_MAX);
}