Fix some warnings

This commit is contained in:
Lynix 2017-10-18 22:02:21 +02:00
parent b47b89ed8b
commit be38aee1fa
4 changed files with 11 additions and 11 deletions

View File

@ -322,17 +322,17 @@ namespace Ndk
if (lua.IsOfType(argIndex, Nz::LuaType_Number)) if (lua.IsOfType(argIndex, Nz::LuaType_Number))
{ {
std::size_t matIndex(lua.Check<std::size_t>(&argIndex)); std::size_t matIndex(lua.Check<std::size_t>(&argIndex));
Nz::MaterialRef material(lua.Check<Nz::MaterialRef>(&argIndex)); Nz::MaterialRef mat(lua.Check<Nz::MaterialRef>(&argIndex));
instance->SetMaterial(matIndex, std::move(material)); instance->SetMaterial(matIndex, std::move(mat));
return 0; return 0;
} }
else if (lua.IsOfType(argIndex, Nz::LuaType_String)) else if (lua.IsOfType(argIndex, Nz::LuaType_String))
{ {
Nz::String subMesh(lua.Check<Nz::String>(&argIndex)); Nz::String subMesh(lua.Check<Nz::String>(&argIndex));
Nz::MaterialRef material(lua.Check<Nz::MaterialRef>(&argIndex)); Nz::MaterialRef mat(lua.Check<Nz::MaterialRef>(&argIndex));
instance->SetMaterial(subMesh, std::move(material)); instance->SetMaterial(subMesh, std::move(mat));
return 0; return 0;
} }
@ -346,9 +346,9 @@ namespace Ndk
{ {
std::size_t skinIndex(lua.Check<std::size_t>(&argIndex)); std::size_t skinIndex(lua.Check<std::size_t>(&argIndex));
std::size_t matIndex(lua.Check<std::size_t>(&argIndex)); std::size_t matIndex(lua.Check<std::size_t>(&argIndex));
Nz::MaterialRef material(lua.Check<Nz::MaterialRef>(&argIndex)); Nz::MaterialRef mat(lua.Check<Nz::MaterialRef>(&argIndex));
instance->SetMaterial(skinIndex, matIndex, std::move(material)); instance->SetMaterial(skinIndex, matIndex, std::move(mat));
return 0; return 0;
} }
else if (lua.IsOfType(argIndex, Nz::LuaType_String)) else if (lua.IsOfType(argIndex, Nz::LuaType_String))

View File

@ -146,9 +146,9 @@ namespace Nz
if (resizeBillboard) if (resizeBillboard)
{ {
if (const MaterialRef& material = GetMaterial()) if (const MaterialRef& newMat = GetMaterial())
{ {
const TextureRef& diffuseMap = material->GetDiffuseMap(); const TextureRef& diffuseMap = newMat->GetDiffuseMap();
if (diffuseMap && diffuseMap->IsValid()) if (diffuseMap && diffuseMap->IsValid())
SetSize(Vector2f(Vector2ui(diffuseMap->GetSize()))); SetSize(Vector2f(Vector2ui(diffuseMap->GetSize())));
} }

View File

@ -200,9 +200,9 @@ namespace Nz
if (resizeSprite) if (resizeSprite)
{ {
if (const MaterialRef& material = GetMaterial()) if (const MaterialRef& newMat = GetMaterial())
{ {
const TextureRef& diffuseMap = material->GetDiffuseMap(); const TextureRef& diffuseMap = newMat->GetDiffuseMap();
if (diffuseMap && diffuseMap->IsValid()) if (diffuseMap && diffuseMap->IsValid())
SetSize(Vector2f(Vector2ui(diffuseMap->GetSize()))); SetSize(Vector2f(Vector2ui(diffuseMap->GetSize())));
} }

View File

@ -53,7 +53,7 @@ namespace Nz
inline bool Create(NetProtocol protocol, UInt16 port, std::size_t peerCount, std::size_t channelCount = 0); inline bool Create(NetProtocol protocol, UInt16 port, std::size_t peerCount, std::size_t channelCount = 0);
bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount = 0); bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount = 0);
bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount, UInt32 incomingBandwidth, UInt32 outgoingBandwidth); bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount, UInt32 incomingBandwidth, UInt32 outgoingBandwidth);
void Destroy(); inline void Destroy();
void Flush(); void Flush();