Browse Source

Convert dbgln to r-value reference like the callee's to fix compiler ambiguous warnings

master
Riyyi 4 years ago
parent
commit
839bef091f
  1. 4
      inferno/src/inferno/log.h
  2. 8
      inferno/src/inferno/systems/camera.cpp
  3. 2
      inferno/src/inferno/systems/render.cpp

4
inferno/src/inferno/log.h

@ -104,7 +104,7 @@ namespace Inferno {
template<typename T, typename... P> template<typename T, typename... P>
void dbgln(const char* format, T value, P&&... parameters) void dbgln(const char* format, T value, P&&... parameters)
{ {
dbgln(Log::None, true, format, value, std::forward<P>(parameters)...); dbgln(Log::None, format, value, std::forward<P>(parameters)...);
} }
template<typename T, typename... P> template<typename T, typename... P>
@ -115,7 +115,7 @@ namespace Inferno {
// https://en.cppreference.com/w/cpp/language/parameter_pack#Example // https://en.cppreference.com/w/cpp/language/parameter_pack#Example
template<typename T, typename... P> template<typename T, typename... P>
void dbgln(Log type, bool newline, const char* format, T value, const P&... parameters) void dbgln(Log type, bool newline, const char* format, T value, P&&... parameters)
{ {
std::string_view view { format }; std::string_view view { format };

8
inferno/src/inferno/systems/camera.cpp

@ -26,13 +26,13 @@ namespace Inferno {
{ {
auto orthoView = m_registry->view<TransformComponent, OrthographicCameraComponment>(); auto orthoView = m_registry->view<TransformComponent, OrthographicCameraComponment>();
for(auto&& [entity, transform, orthographic] : orthoView.each()) { for (auto [entity, transform, orthographic] : orthoView.each()) {
updateOrthographic(transform, orthographic); updateOrthographic(transform, orthographic);
} }
auto perspectiveView = m_registry->view<TransformComponent, PerspectiveCameraComponent>(); auto perspectiveView = m_registry->view<TransformComponent, PerspectiveCameraComponent>();
for(auto&& [entity, transform, perspective] : perspectiveView.each()) { for (auto [entity, transform, perspective] : perspectiveView.each()) {
updatePerspective(transform, perspective); updatePerspective(transform, perspective);
} }
} }
@ -47,13 +47,13 @@ namespace Inferno {
{ {
auto orthoView = m_registry->view<TransformComponent, OrthographicCameraComponment>(); auto orthoView = m_registry->view<TransformComponent, OrthographicCameraComponment>();
for(auto&& [entity, transform, orthographic] : orthoView.each()) { for (auto [entity, transform, orthographic] : orthoView.each()) {
return orthographic.projection * transform.transform; return orthographic.projection * transform.transform;
} }
auto perspectiveView = m_registry->view<TransformComponent, PerspectiveCameraComponent>(); auto perspectiveView = m_registry->view<TransformComponent, PerspectiveCameraComponent>();
for(auto&& [entity, transform, perspective] : perspectiveView.each()) { for (auto [entity, transform, perspective] : perspectiveView.each()) {
return perspective.projection * transform.transform; return perspective.projection * transform.transform;
} }

2
inferno/src/inferno/systems/render.cpp

@ -23,7 +23,7 @@ namespace Inferno {
{ {
auto group = m_registry->group<TransformComponent, SpriteComponent>(); auto group = m_registry->group<TransformComponent, SpriteComponent>();
for(auto&& [entity, transform, sprite] : group.each()) { for (auto [entity, transform, sprite] : group.each()) {
Renderer2D::the().drawQuad(transform, sprite.color, sprite.texture); Renderer2D::the().drawQuad(transform, sprite.color, sprite.texture);
} }
} }

Loading…
Cancel
Save