Fix some GCC warnings

Former-commit-id: 31c8460b4656c29ac165d7aa28f335851f2565df
This commit is contained in:
Lynix
2016-05-25 13:52:10 +02:00
parent 840b03691a
commit 8a3339badf
19 changed files with 113 additions and 54 deletions

View File

@@ -145,6 +145,7 @@ namespace Ndk
{
case Nz::Keyboard::Down:
case Nz::Keyboard::Up:
{
if (event.key.code == Nz::Keyboard::Up)
m_historyPosition = std::min<std::size_t>(m_commandHistory.size(), m_historyPosition + 1);
else
@@ -159,6 +160,10 @@ namespace Ndk
m_inputDrawer.SetText(s_inputPrefix + text);
m_inputTextSprite->Update(m_inputDrawer);
break;
}
default:
break;
}
break;
}

View File

@@ -29,8 +29,8 @@ namespace Ndk
// SDK
application("Application"),
nodeComponent("NodeComponent"),
entityClass("Entity"),
nodeComponent("NodeComponent"),
velocityComponent("VelocityComponent"),
worldClass("World")
@@ -39,9 +39,9 @@ namespace Ndk
// Audio
musicClass("Music"),
soundClass("Sound"),
soundBuffer("SoundBuffer"),
soundEmitter("SoundEmitter"),
soundClass("Sound"),
// Graphics
instancedRenderable("InstancedRenderable"),

View File

@@ -76,6 +76,8 @@ namespace Ndk
/*********************************** Nz::SoundBuffer **********************************/
soundBuffer.SetConstructor([] (Nz::LuaInstance& lua, Nz::SoundBufferRef* instance)
{
NazaraUnused(lua);
Nz::PlacementNew(instance, Nz::SoundBuffer::New());
return true;
});
@@ -115,16 +117,16 @@ namespace Ndk
return 1;
});
soundBuffer.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::SoundBufferRef& soundBuffer) -> int
soundBuffer.BindMethod("__tostring", [] (Nz::LuaInstance& lua, Nz::SoundBufferRef& instance) -> int
{
Nz::StringStream stream("SoundBuffer(");
if (soundBuffer->IsValid())
if (instance->IsValid())
{
Nz::String filePath = soundBuffer->GetFilePath();
Nz::String filePath = instance->GetFilePath();
if (!filePath.IsEmpty())
stream << "File: " << filePath << ", ";
stream << "Duration: " << soundBuffer->GetDuration() / 1000.f << "s";
stream << "Duration: " << instance->GetDuration() / 1000.f << "s";
}
stream << ')';
@@ -148,17 +150,17 @@ namespace Ndk
soundEmitter.BindMethod("IsLooping", &Nz::SoundEmitter::IsLooping);
soundEmitter.BindMethod("IsSpatialized", &Nz::SoundEmitter::IsSpatialized);
soundEmitter.BindMethod("Pause", &Nz::SoundEmitter::Pause);
soundEmitter.BindMethod("Play", &Nz::SoundEmitter::Play);
soundEmitter.BindMethod("SetAttenuation", &Nz::SoundEmitter::SetAttenuation);
soundEmitter.BindMethod("SetMinDistance", &Nz::SoundEmitter::SetMinDistance);
soundEmitter.BindMethod("SetPitch", &Nz::SoundEmitter::SetPitch);
soundEmitter.BindMethod("SetPosition", (void(Nz::SoundEmitter::*)(const Nz::Vector3f&)) &Nz::SoundEmitter::SetPosition);
soundEmitter.BindMethod("SetVelocity", (void(Nz::SoundEmitter::*)(const Nz::Vector3f&)) &Nz::SoundEmitter::SetVelocity);
soundEmitter.BindMethod("SetVolume", &Nz::SoundEmitter::SetVolume);
soundEmitter.BindMethod("Stop", &Nz::SoundEmitter::Stop);
}

View File

@@ -238,9 +238,15 @@ namespace Ndk
case 'h':
lua.Push(instance.height);
return true;
default:
break;
}
break;
}
default:
break;
}
return false;
@@ -290,6 +296,9 @@ namespace Ndk
}
break;
}
default:
break;
}
return false;
@@ -313,7 +322,7 @@ namespace Ndk
Nz::PlacementNew(quaternion, *static_cast<Nz::Quaterniond*>(lua.ToUserdata(1)));
else
break;
return true;
}
@@ -389,6 +398,9 @@ namespace Ndk
case 'z':
instance.z = value;
return true;
default:
break;
}
return false;
@@ -455,9 +467,15 @@ namespace Ndk
case 'y':
lua.Push(instance.y);
return true;
default:
break;
}
break;
}
default:
break;
}
return false;
@@ -496,9 +514,15 @@ namespace Ndk
case 'y':
instance.y = value;
return true;
default:
break;
}
break;
}
default:
break;
}
return false;
@@ -582,9 +606,15 @@ namespace Ndk
case 'z':
lua.Push(instance.z);
return true;
default:
break;
}
break;
}
default:
break;
}
return false;
@@ -627,9 +657,15 @@ namespace Ndk
case 'z':
instance.z = value;
return true;
default:
break;
}
break;
}
default:
break;
}
return false;