Fix a lot of warnings from Clang/GCC
This commit is contained in:
parent
56498af1a8
commit
5a07bbd001
|
|
@ -374,8 +374,8 @@ namespace Ndk
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Application::WindowInfo::WindowInfo(std::unique_ptr<Nz::Window>&& window) :
|
inline Application::WindowInfo::WindowInfo(std::unique_ptr<Nz::Window>&& window) :
|
||||||
window(std::move(window)),
|
renderTarget(nullptr),
|
||||||
renderTarget(nullptr)
|
window(std::move(window))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ namespace Ndk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline BaseSystem::BaseSystem(SystemIndex systemId) :
|
inline BaseSystem::BaseSystem(SystemIndex systemId) :
|
||||||
m_updateEnabled(true),
|
m_systemIndex(systemId),
|
||||||
m_systemIndex(systemId)
|
m_updateEnabled(true)
|
||||||
{
|
{
|
||||||
SetUpdateRate(30);
|
SetUpdateRate(30);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,11 @@ namespace Ndk
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderable(Renderable&& renderable) noexcept :
|
Renderable(Renderable&& renderable) noexcept :
|
||||||
|
renderableInvalidationSlot(std::move(renderable.renderableInvalidationSlot)),
|
||||||
|
renderableReleaseSlot(std::move(renderable.renderableReleaseSlot)),
|
||||||
data(std::move(renderable.data)),
|
data(std::move(renderable.data)),
|
||||||
renderable(std::move(renderable.renderable)),
|
renderable(std::move(renderable.renderable)),
|
||||||
dataUpdated(renderable.dataUpdated),
|
dataUpdated(renderable.dataUpdated)
|
||||||
renderableInvalidationSlot(std::move(renderable.renderableInvalidationSlot)),
|
|
||||||
renderableReleaseSlot(std::move(renderable.renderableReleaseSlot))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,6 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
NazaraAssert(m_entity && m_entity->HasComponent<NodeComponent>(), "GraphicsComponent requires NodeComponent");
|
NazaraAssert(m_entity && m_entity->HasComponent<NodeComponent>(), "GraphicsComponent requires NodeComponent");
|
||||||
|
|
||||||
Ndk::RenderSystem& renderSystem = m_entity->GetWorld()->GetSystem<Ndk::RenderSystem>();
|
|
||||||
|
|
||||||
m_transformMatrix = m_entity->GetComponent<NodeComponent>().GetTransformMatrix();
|
m_transformMatrix = m_entity->GetComponent<NodeComponent>().GetTransformMatrix();
|
||||||
m_transformMatrixUpdated = true;
|
m_transformMatrixUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,6 @@ namespace Ndk
|
||||||
for (const Ndk::EntityHandle& drawable : m_drawables)
|
for (const Ndk::EntityHandle& drawable : m_drawables)
|
||||||
{
|
{
|
||||||
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
||||||
NodeComponent& drawableNode = drawable->GetComponent<NodeComponent>();
|
|
||||||
|
|
||||||
graphicsComponent.AddToRenderQueue(renderQueue);
|
graphicsComponent.AddToRenderQueue(renderQueue);
|
||||||
}
|
}
|
||||||
|
|
@ -217,7 +216,6 @@ namespace Ndk
|
||||||
for (const Ndk::EntityHandle& drawable : m_drawables)
|
for (const Ndk::EntityHandle& drawable : m_drawables)
|
||||||
{
|
{
|
||||||
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
||||||
NodeComponent& drawableNode = drawable->GetComponent<NodeComponent>();
|
|
||||||
|
|
||||||
graphicsComponent.AddToRenderQueue(renderQueue);
|
graphicsComponent.AddToRenderQueue(renderQueue);
|
||||||
}
|
}
|
||||||
|
|
@ -290,7 +288,6 @@ namespace Ndk
|
||||||
for (const Ndk::EntityHandle& drawable : m_drawables)
|
for (const Ndk::EntityHandle& drawable : m_drawables)
|
||||||
{
|
{
|
||||||
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
||||||
NodeComponent& drawableNode = drawable->GetComponent<NodeComponent>();
|
|
||||||
|
|
||||||
graphicsComponent.AddToRenderQueue(renderQueue);
|
graphicsComponent.AddToRenderQueue(renderQueue);
|
||||||
}
|
}
|
||||||
|
|
@ -318,7 +315,6 @@ namespace Ndk
|
||||||
for (const Ndk::EntityHandle& drawable : m_drawables)
|
for (const Ndk::EntityHandle& drawable : m_drawables)
|
||||||
{
|
{
|
||||||
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
|
||||||
NodeComponent& drawableNode = drawable->GetComponent<NodeComponent>();
|
|
||||||
|
|
||||||
graphicsComponent.AddToRenderQueue(renderQueue);
|
graphicsComponent.AddToRenderQueue(renderQueue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,9 +123,8 @@ namespace Nz
|
||||||
* \see CountOf
|
* \see CountOf
|
||||||
*/
|
*/
|
||||||
template<typename T, std::size_t N>
|
template<typename T, std::size_t N>
|
||||||
constexpr std::size_t CountOf(T(&name)[N]) noexcept
|
constexpr std::size_t CountOf(T(&)[N]) noexcept
|
||||||
{
|
{
|
||||||
// NazaraUnused(name); //< Because "body of function is not a return-statement" >.>
|
|
||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ namespace Nz
|
||||||
template<typename T>
|
template<typename T>
|
||||||
HandledObject<T>& HandledObject<T>::operator=(const HandledObject& object)
|
HandledObject<T>& HandledObject<T>::operator=(const HandledObject& object)
|
||||||
{
|
{
|
||||||
|
NazaraUnused(object);
|
||||||
|
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace Nz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline IpAddress::IpAddress(const UInt8& a, const UInt8& b, const UInt8& c, const UInt8& d, UInt16 port) :
|
inline IpAddress::IpAddress(const UInt8& a, const UInt8& b, const UInt8& c, const UInt8& d, UInt16 port) :
|
||||||
IpAddress(IPv4{a, b, c, d}, port)
|
IpAddress(IPv4{{a, b, c, d}}, port)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Nz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline IpAddress::IpAddress(const UInt16& a, const UInt16& b, const UInt16& c, const UInt16& d, const UInt16& e, const UInt16& f, const UInt16& g, const UInt16& h, UInt16 port) :
|
inline IpAddress::IpAddress(const UInt16& a, const UInt16& b, const UInt16& c, const UInt16& d, const UInt16& e, const UInt16& f, const UInt16& g, const UInt16& h, UInt16 port) :
|
||||||
IpAddress(IPv6{a, b, c, d, e, f, g, h}, port)
|
IpAddress(IPv6{{a, b, c, d, e, f, g, h}}, port)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ namespace Nz
|
||||||
PendingPacket m_pendingPacket;
|
PendingPacket m_pendingPacket;
|
||||||
UInt64 m_keepAliveInterval;
|
UInt64 m_keepAliveInterval;
|
||||||
UInt64 m_keepAliveTime;
|
UInt64 m_keepAliveTime;
|
||||||
bool m_isLowDelayEnabled;
|
|
||||||
bool m_isKeepAliveEnabled;
|
bool m_isKeepAliveEnabled;
|
||||||
|
bool m_isLowDelayEnabled;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,8 @@ namespace Nz
|
||||||
if (content <= PixelFormatContent_Undefined || content > PixelFormatContent_Max)
|
if (content <= PixelFormatContent_Undefined || content > PixelFormatContent_Max)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::array<const Nz::Bitset<>*, 4> masks = {&redMask, &greenMask, &blueMask, &alphaMask};
|
std::array<const Nz::Bitset<>*, 4> masks = { {&redMask, &greenMask, &blueMask, &alphaMask} };
|
||||||
std::array<PixelFormatSubType, 4> types = {redType, greenType, blueType, alphaType};
|
std::array<PixelFormatSubType, 4> types = { {redType, greenType, blueType, alphaType} };
|
||||||
|
|
||||||
for (unsigned int i = 0; i < 4; ++i)
|
for (unsigned int i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,6 @@ namespace Nz
|
||||||
{
|
{
|
||||||
for (auto& pipelinePair : layer.opaqueModels)
|
for (auto& pipelinePair : layer.opaqueModels)
|
||||||
{
|
{
|
||||||
const MaterialPipeline* pipeline = pipelinePair.first;
|
|
||||||
auto& pipelineEntry = pipelinePair.second;
|
auto& pipelineEntry = pipelinePair.second;
|
||||||
|
|
||||||
if (pipelineEntry.maxInstanceCount > 0)
|
if (pipelineEntry.maxInstanceCount > 0)
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,6 @@ namespace Nz
|
||||||
|
|
||||||
for (auto& matIt : pipelinePair.second.materialMap)
|
for (auto& matIt : pipelinePair.second.materialMap)
|
||||||
{
|
{
|
||||||
const Material* material = matIt.first;
|
|
||||||
auto& entry = matIt.second;
|
auto& entry = matIt.second;
|
||||||
auto& billboardVector = entry.billboards;
|
auto& billboardVector = entry.billboards;
|
||||||
|
|
||||||
|
|
@ -551,9 +550,7 @@ namespace Nz
|
||||||
const MeshData& meshData = meshIt.first;
|
const MeshData& meshData = meshIt.first;
|
||||||
auto& meshEntry = meshIt.second;
|
auto& meshEntry = meshIt.second;
|
||||||
|
|
||||||
const Spheref& squaredBoundingSphere = meshEntry.squaredBoundingSphere;
|
|
||||||
std::vector<Matrix4f>& instances = meshEntry.instances;
|
std::vector<Matrix4f>& instances = meshEntry.instances;
|
||||||
|
|
||||||
if (!instances.empty())
|
if (!instances.empty())
|
||||||
{
|
{
|
||||||
const IndexBuffer* indexBuffer = meshData.indexBuffer;
|
const IndexBuffer* indexBuffer = meshData.indexBuffer;
|
||||||
|
|
|
||||||
|
|
@ -542,9 +542,7 @@ namespace Nz
|
||||||
auto& overlayMap = matEntry.overlayMap;
|
auto& overlayMap = matEntry.overlayMap;
|
||||||
for (auto& overlayIt : overlayMap)
|
for (auto& overlayIt : overlayMap)
|
||||||
{
|
{
|
||||||
const Texture* overlay = overlayIt.first;
|
|
||||||
auto& spriteChainVector = overlayIt.second.spriteChains;
|
auto& spriteChainVector = overlayIt.second.spriteChains;
|
||||||
|
|
||||||
spriteChainVector.clear();
|
spriteChainVector.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -563,9 +561,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
for (auto& materialPair : pipelineEntry.materialMap)
|
for (auto& materialPair : pipelineEntry.materialMap)
|
||||||
{
|
{
|
||||||
const Material* material = materialPair.first;
|
|
||||||
auto& matEntry = materialPair.second;
|
auto& matEntry = materialPair.second;
|
||||||
|
|
||||||
if (matEntry.enabled)
|
if (matEntry.enabled)
|
||||||
{
|
{
|
||||||
MeshInstanceContainer& meshInstances = matEntry.meshMap;
|
MeshInstanceContainer& meshInstances = matEntry.meshMap;
|
||||||
|
|
@ -573,7 +569,6 @@ namespace Nz
|
||||||
for (auto& meshIt : meshInstances)
|
for (auto& meshIt : meshInstances)
|
||||||
{
|
{
|
||||||
auto& meshEntry = meshIt.second;
|
auto& meshEntry = meshIt.second;
|
||||||
|
|
||||||
meshEntry.instances.clear();
|
meshEntry.instances.clear();
|
||||||
}
|
}
|
||||||
matEntry.enabled = false;
|
matEntry.enabled = false;
|
||||||
|
|
|
||||||
|
|
@ -508,7 +508,6 @@ namespace Nz
|
||||||
|
|
||||||
for (auto& matIt : pipelinePair.second.materialMap)
|
for (auto& matIt : pipelinePair.second.materialMap)
|
||||||
{
|
{
|
||||||
const Material* material = matIt.first;
|
|
||||||
auto& entry = matIt.second;
|
auto& entry = matIt.second;
|
||||||
auto& billboardVector = entry.billboards;
|
auto& billboardVector = entry.billboards;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
RigidBody2D::RigidBody2D(RigidBody2D&& object) :
|
RigidBody2D::RigidBody2D(RigidBody2D&& object) :
|
||||||
m_geom(std::move(object.m_geom)),
|
|
||||||
m_shapes(std::move(object.m_shapes)),
|
m_shapes(std::move(object.m_shapes)),
|
||||||
|
m_geom(std::move(object.m_geom)),
|
||||||
m_handle(object.m_handle),
|
m_handle(object.m_handle),
|
||||||
m_world(object.m_world),
|
m_world(object.m_world),
|
||||||
m_gravityFactor(object.m_gravityFactor),
|
m_gravityFactor(object.m_gravityFactor),
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
class ContextParameters;
|
struct ContextParameters;
|
||||||
|
|
||||||
class ContextImpl
|
class ContextImpl
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ namespace Nz
|
||||||
const Material& mat = pair.second;
|
const Material& mat = pair.second;
|
||||||
|
|
||||||
Emit("newmtl ");
|
Emit("newmtl ");
|
||||||
EmitLine(pair.first);
|
EmitLine(matName);
|
||||||
EmitLine();
|
EmitLine();
|
||||||
|
|
||||||
Emit("Ka ");
|
Emit("Ka ");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue