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. 2
      inferno/src/inferno/application.cpp
  2. 4
      inferno/src/inferno/log.h
  3. 8
      inferno/src/inferno/systems/camera.cpp
  4. 2
      inferno/src/inferno/systems/render.cpp

2
inferno/src/inferno/application.cpp

@ -126,7 +126,7 @@ namespace Inferno {
// bordercolor
// offse
while(!m_window->shouldClose()) {
while (!m_window->shouldClose()) {
float time = Time::time();
float deltaTime = time - m_lastFrameTime;

4
inferno/src/inferno/log.h

@ -104,7 +104,7 @@ namespace Inferno {
template<typename T, typename... P>
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>
@ -115,7 +115,7 @@ namespace Inferno {
// https://en.cppreference.com/w/cpp/language/parameter_pack#Example
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 };

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

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

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

@ -23,7 +23,7 @@ namespace Inferno {
{
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);
}
}

Loading…
Cancel
Save