diff --git a/src/inferno.h b/src/inferno.h index 60aa1a8..04df536 100644 --- a/src/inferno.h +++ b/src/inferno.h @@ -7,6 +7,5 @@ #include "inferno/core.h" #include "inferno/application.h" -#include "inferno/io/log.h" // ----------------------------------------- diff --git a/src/inferno/application.cpp b/src/inferno/application.cpp index b45a5ac..039517d 100644 --- a/src/inferno/application.cpp +++ b/src/inferno/application.cpp @@ -1,4 +1,5 @@ #include "glm/gtc/type_ptr.hpp" // glm::make_mat4 +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/application.h" @@ -9,7 +10,6 @@ #include "inferno/event/mouseevent.h" // #include "inferno/io/gltffile.h" #include "inferno/io/input.h" -#include "inferno/io/log.h" #include "inferno/keycodes.h" #include "inferno/render/buffer.h" #include "inferno/render/context.h" @@ -45,11 +45,11 @@ Application::Application(s) m_font = FontManager::the().load("assets/fnt/dejavu-sans"); // auto bla = GlTFFile::read("assets/gltf/box.glb"); - // success() << "@" << bla.first.get() << "@"; + // ruc::success("@{}@", bla.first.get()); // auto bla2 = GlTFFile::read("assets/gltf/boxtextured.glb"); - // info() << "@" << bla2.first.get() << "@"; + // ruc::info("@{}@", bla2.first.get()); // auto bla3 = GlTFFile::read("assets/gltf/guinea-pig-cage-fleece.glb"); - // warn() << "@" << bla3.first.get() << "@"; + // ruc::warn("@{}@", bla3.first.get()); // Gltf model = Gltf("assets/gltf/box.glb"); @@ -76,7 +76,7 @@ Application::~Application() int Application::run() { - dbg() << "Application startup"; + ruc::debug("Application startup"); std::array character; @@ -87,7 +87,7 @@ int Application::run() auto f = FontManager::the().get("assets/fnt/dejavu-sans"); auto c = f->get('5'); - // dbg() << c->position << " " << c->size; + // ruc::debug(c->position << " " << c->size); uint32_t textureWidth = f->texture()->width(); uint32_t textureHeight = f->texture()->height(); @@ -109,7 +109,7 @@ int Application::run() (textureHeight - c->position.y - c->size.y) / (float)textureHeight, (textureHeight - c->position.y) / (float)textureHeight }; - // dbg() < y; + // ruc::debug(y); character.at(0).quad.textureCoordinates = { x.x, y.x }; character.at(1).quad.textureCoordinates = { x.y, y.x }; @@ -131,7 +131,7 @@ int Application::run() float time = Time::time(); float deltaTime = time - m_lastFrameTime; m_lastFrameTime = time; - // dbg() << "Frametime " << deltaTime * 1000 << "ms"; + // ruc::debug("Frametime " << deltaTime * 1000 << "ms"); // Update @@ -156,7 +156,7 @@ int Application::run() m_window->render(); } - dbg() << "Application shutdown"; + ruc::debug("Application shutdown"); return m_status; } @@ -175,8 +175,7 @@ bool Application::onWindowClose(WindowCloseEvent& e) // Suppress unused warning (void)e; - info() << "WindowCloseEvent triggered"; - infoln("{}Event triggered", e.toString()); + ruc::info("WindowCloseEvent"); m_window->setShouldClose(true); @@ -188,7 +187,7 @@ bool Application::onWindowResize(WindowResizeEvent& e) // Suppress unused warning (void)e; - infoln("WindowResizeEvent {}x{} triggered", e.getWidth(), e.getHeight()); + ruc::info("WindowResizeEvent {}x{}", e.getWidth(), e.getHeight()); RenderCommand::setViewport(0, 0, e.getWidth(), e.getHeight()); @@ -200,9 +199,7 @@ bool Application::onKeyPress(KeyPressEvent& e) // Suppress unused warning (void)e; - infoln("KeyPressEvent {} ({}) triggered", - Input::getKeyName(e.getKey()), - e.getKey()); + ruc::info("KeyPressEvent {} ({})", Input::getKeyName(e.getKey()), e.getKey()); // Stop the main loop on 'Escape' keypress if (e.getKey() == keyCode("GLFW_KEY_ESCAPE")) { @@ -214,6 +211,8 @@ bool Application::onKeyPress(KeyPressEvent& e) bool Application::onMousePosition(MousePositionEvent& e) { + // ruc::info("MousePositionEvent {:.0}x{:.0}", e.getXPos(), e.getYPos()); + return Input::onMousePosition(e); } diff --git a/src/inferno/component/transformcomponent.cpp b/src/inferno/component/transformcomponent.cpp index 0c9e0e4..5b710a4 100644 --- a/src/inferno/component/transformcomponent.cpp +++ b/src/inferno/component/transformcomponent.cpp @@ -1,47 +1,39 @@ #include "inferno/component/transformcomponent.h" -namespace Inferno { - -const LogStream& operator<<(const LogStream& stream, const glm::vec2& value) +void ruc::format::Formatter::format(Builder& builder, glm::vec2 value) const { - return stream << "{ " - << (value.x >= 0.0f ? " " : "") << value.x << ", " - << (value.y >= 0.0f ? " " : "") << value.y - << " }"; + return Formatter>::format(builder, { value.x, value.y }); } -const LogStream& operator<<(const LogStream& stream, const glm::vec3& value) +void ruc::format::Formatter::format(Builder& builder, glm::vec3 value) const { - return stream << "{ " - << (value.x >= 0.0f ? " " : "") << value.x << ", " - << (value.y >= 0.0f ? " " : "") << value.y << ", " - << (value.z >= 0.0f ? " " : "") << value.z - << " }"; + return Formatter>::format(builder, { value.x, value.y, value.z }); } -const LogStream& operator<<(const LogStream& stream, const glm::vec4& value) +void ruc::format::Formatter::format(Builder& builder, glm::vec4 value) const { - return stream << "{ " - << (value.x >= 0.0f ? " " : "") << value.x << ", " - << (value.y >= 0.0f ? " " : "") << value.y << ", " - << (value.z >= 0.0f ? " " : "") << value.z << ", " - << (value.w >= 0.0f ? " " : "") << value.w - << " }"; + return Formatter>::format(builder, { value.x, value.y, value.z, value.w }); } -const LogStream& operator<<(const LogStream& stream, const glm::mat4& value) +void ruc::format::Formatter::format(Builder& builder, glm::mat4 value) const { - return stream << "mat4 " - << value[0] << "\n " << value[1] << "\n " - << value[2] << "\n " << value[3]; + builder.putString("mat4 "); + Formatter::format(builder, value[0]); + builder.putString("\n "); + Formatter::format(builder, value[1]); + builder.putString("\n "); + Formatter::format(builder, value[2]); + builder.putString("\n "); + return Formatter::format(builder, value[3]); } -const LogStream& operator<<(const LogStream& stream, const TransformComponent& value) +void ruc::format::Formatter::format(Builder& builder, Inferno::TransformComponent value) const { - return stream << "transform " - << value.translate << " t\n " - << value.rotate << " r\n " - << value.scale << " s"; + builder.putString("transform "); + Formatter::format(builder, value.translate); + builder.putString(" t\n "); + Formatter::format(builder, value.rotate); + builder.putString(" r\n "); + Formatter::format(builder, value.scale); + builder.putString(" s"); } - -} // namespace Inferno diff --git a/src/inferno/component/transformcomponent.h b/src/inferno/component/transformcomponent.h index f52a304..58b1375 100644 --- a/src/inferno/component/transformcomponent.h +++ b/src/inferno/component/transformcomponent.h @@ -2,8 +2,7 @@ #include "glm/ext/matrix_float4x4.hpp" // glm::mat4 #include "glm/ext/vector_float3.hpp" // glm::vec3 - -#include "inferno/io/log.h" +#include "ruc/format/format.h" namespace Inferno { @@ -14,11 +13,29 @@ struct TransformComponent { glm::mat4 transform { 1.0f }; // Identity matrix }; -// ----------------------------------------- - -const LogStream& operator<<(const LogStream& stream, const glm::vec2& value); -const LogStream& operator<<(const LogStream& stream, const glm::vec3& value); -const LogStream& operator<<(const LogStream& stream, const glm::vec4& value); -const LogStream& operator<<(const LogStream& stream, const glm::mat4& value); -const LogStream& operator<<(const LogStream& stream, const TransformComponent& value); } // namespace Inferno + +template<> +struct ruc::format::Formatter : Formatter> { + void format(Builder& builder, glm::vec2 value) const; +}; + +template<> +struct ruc::format::Formatter : Formatter> { + void format(Builder& builder, glm::vec3 value) const; +}; + +template<> +struct ruc::format::Formatter : Formatter> { + void format(Builder& builder, glm::vec4 value) const; +}; + +template<> +struct ruc::format::Formatter : Formatter { + void format(Builder& builder, glm::mat4 value) const; +}; + +template<> +struct ruc::format::Formatter : Formatter { + void format(Builder& builder, Inferno::TransformComponent value) const; +}; diff --git a/src/inferno/io/gltffile.cpp b/src/inferno/io/gltffile.cpp index a06e7c0..ce848bc 100644 --- a/src/inferno/io/gltffile.cpp +++ b/src/inferno/io/gltffile.cpp @@ -6,7 +6,6 @@ #include "ruc/meta/assert.h" #include "inferno/io/gltffile.h" -#include "inferno/io/log.h" #include "inferno/util/json.h" #include "inferno/util/string.h" diff --git a/src/inferno/io/input.cpp b/src/inferno/io/input.cpp index 7b32b13..ff9951c 100644 --- a/src/inferno/io/input.cpp +++ b/src/inferno/io/input.cpp @@ -1,9 +1,9 @@ #include "GLFW/glfw3.h" +#include "ruc/format/log.h" #include "inferno/application.h" #include "inferno/event/mouseevent.h" #include "inferno/io/input.h" -#include "inferno/io/log.h" #include "inferno/window.h" namespace Inferno { @@ -20,7 +20,7 @@ void Input::initialize() m_xPosLast = Application::the().getWindow().getWidth() / 2.0f; m_yPosLast = Application::the().getWindow().getHeight() / 2.0f; - info() << "Input initialized"; + ruc::info("Input initialized"); } void Input::update() diff --git a/src/inferno/render/buffer.cpp b/src/inferno/render/buffer.cpp index c586158..6586b2a 100644 --- a/src/inferno/render/buffer.cpp +++ b/src/inferno/render/buffer.cpp @@ -1,7 +1,6 @@ #include "glad/glad.h" #include "inferno/core.h" -#include "inferno/io/log.h" #include "inferno/render/buffer.h" #include "ruc/meta/assert.h" diff --git a/src/inferno/render/context.cpp b/src/inferno/render/context.cpp index c3fc62b..9074c7a 100644 --- a/src/inferno/render/context.cpp +++ b/src/inferno/render/context.cpp @@ -2,10 +2,10 @@ #include "glad/glad.h" // glad needs to come before GLFW #include "GLFW/glfw3.h" // clang-format on +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/core.h" -#include "inferno/io/log.h" #include "inferno/render/context.h" #include "inferno/window.h" @@ -26,10 +26,10 @@ void Context::initialize() VERIFY(glad, "Failed to initialize glad!"); // Log OpenGL properties - comment() << "OpenGL Info:"; - comment() << " Vendor: " << glGetString(GL_VENDOR); - comment() << " Renderer: " << glGetString(GL_RENDERER); - comment() << " Version: " << glGetString(GL_VERSION); + ruc::trace("OpenGL Info:"); + ruc::trace(" Vendor: {}", glGetString(GL_VENDOR)); + ruc::trace(" Renderer: {}", glGetString(GL_RENDERER)); + ruc::trace(" Version: {}", glGetString(GL_VERSION)); // Check OpenGL version VERIFY(GLVersion.major > 4 || (GLVersion.major == 4 && GLVersion.minor >= 5), diff --git a/src/inferno/render/font.cpp b/src/inferno/render/font.cpp index 48ba387..fcf121c 100644 --- a/src/inferno/render/font.cpp +++ b/src/inferno/render/font.cpp @@ -3,6 +3,7 @@ #include // std::move #include "ruc/file.h" +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/render/font.h" @@ -105,7 +106,7 @@ const std::string Font::findValue(const std::string& key, const std::vector font) } } -// ----------------------------------------- +} // namespace Inferno -const LogStream& operator<<(const LogStream& stream, const glm::ivec2& value) +void ruc::format::Formatter::format(Builder& builder, glm::ivec2 value) const { - return stream << "{ " << value.x << ", " << value.y << " }"; + return Formatter>::format(builder, { value.x, value.y }); } - -} // namespace Inferno diff --git a/src/inferno/render/font.h b/src/inferno/render/font.h index 452ae33..b3035da 100644 --- a/src/inferno/render/font.h +++ b/src/inferno/render/font.h @@ -1,6 +1,6 @@ #pragma once -#include // uint32_t +#include // int32_t, uint32_t #include // std::shared_ptr #include // std::string #include // std::unordered_map @@ -8,10 +8,9 @@ #include "glm/ext/vector_int2.hpp" // glm::ivec2 #include "glm/ext/vector_uint2.hpp" // glm::uvec2 +#include "ruc/format/format.h" #include "ruc/singleton.h" -#include "inferno/io/log.h" - namespace Inferno { class Texture; @@ -68,12 +67,13 @@ private: std::unordered_map> m_fontList; }; -// ------------------------------------- - -const LogStream& operator<<(const LogStream& stream, const glm::ivec2& value); - } // namespace Inferno +template<> +struct ruc::format::Formatter : Formatter> { + void format(Builder& builder, glm::ivec2 value) const; +}; + // FontManager fm; // Font f = fm.load("path/to/font"); // Font f2("path/to/font"); diff --git a/src/inferno/render/renderer.cpp b/src/inferno/render/renderer.cpp index 5524b60..3620490 100644 --- a/src/inferno/render/renderer.cpp +++ b/src/inferno/render/renderer.cpp @@ -2,6 +2,7 @@ #include // std::move #include "glad/glad.h" +#include "ruc/format/log.h" #include "inferno/render/buffer.h" #include "inferno/render/renderer.h" @@ -18,7 +19,7 @@ void RenderCommand::initialize() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - info() << "RenderCommand initialized"; + ruc::info("RenderCommand initialized"); } void RenderCommand::destroy() @@ -201,7 +202,7 @@ Renderer2D::Renderer2D(s) m_vertexArray->setIndexBuffer(indexBuffer); delete[] indices; - info() << "Renderer2D initialized"; + ruc::info("Renderer2D initialized"); } Renderer2D::~Renderer2D() @@ -355,7 +356,7 @@ RendererCharacter::RendererCharacter(s) m_vertexArray->setIndexBuffer(indexBuffer); delete[] indices; - info() << "RendererCharacter initialized"; + ruc::info("RendererCharacter initialized"); } RendererCharacter::~RendererCharacter() diff --git a/src/inferno/render/shader.cpp b/src/inferno/render/shader.cpp index dae057a..deda5e0 100644 --- a/src/inferno/render/shader.cpp +++ b/src/inferno/render/shader.cpp @@ -4,10 +4,10 @@ #include "glad/glad.h" #include "glm/gtc/type_ptr.hpp" // glm::value_ptr #include "ruc/file.h" +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/core.h" -#include "inferno/io/log.h" #include "inferno/render/shader.h" namespace Inferno { @@ -185,7 +185,7 @@ int32_t Shader::checkStatus(uint32_t check, bool isProgram) const ? glGetShaderInfoLog(check, maxLength, nullptr, &infoLog[0]) : glGetProgramInfoLog(check, maxLength, nullptr, &infoLog[0]); - warn() << "Shader " << infoLog.data(); + ruc::warn("Shader {}", infoLog.data()); } VERIFY(success == GL_TRUE, "Shader program creation failed!"); @@ -197,7 +197,7 @@ int32_t Shader::checkStatus(uint32_t check, bool isProgram) const ShaderManager::ShaderManager(s) { - info() << "ShaderManager initialized"; + ruc::info("ShaderManager initialized"); } ShaderManager::~ShaderManager() diff --git a/src/inferno/render/texture.cpp b/src/inferno/render/texture.cpp index 6071ff7..edcecc1 100644 --- a/src/inferno/render/texture.cpp +++ b/src/inferno/render/texture.cpp @@ -3,11 +3,11 @@ #include // std::move #include "glad/glad.h" +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #define STB_IMAGE_IMPLEMENTATION #include "stb/stb_image.h" -#include "inferno/io/log.h" #include "inferno/render/texture.h" namespace Inferno { @@ -106,7 +106,7 @@ void Texture::create(unsigned char* data) TextureManager::TextureManager(s) { - info() << "TextureManager initialized"; + ruc::info("TextureManager initialized"); } TextureManager::~TextureManager() diff --git a/src/inferno/scene/scene.cpp b/src/inferno/scene/scene.cpp index 1930fd5..73554ed 100644 --- a/src/inferno/scene/scene.cpp +++ b/src/inferno/scene/scene.cpp @@ -1,3 +1,4 @@ +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/component/cameracomponent.h" @@ -67,7 +68,7 @@ void Scene::initialize() addComponent(text, "HelloWorld!", "assets/fnt/dejavu-sans", 0, 150, 3); // addComponent(text, "@#$%^&*()qygij!", "assets/fnt/dejavu-sans-test", 0, 150, 3); - info() << "Scene initialized"; + ruc::info("Scene initialized"); } void Scene::update(float deltaTime) @@ -117,11 +118,9 @@ void Scene::validEntity(uint32_t entity) const VERIFY(m_registry->valid(entt::entity { entity }), "Entity is not valid"); } -// ------------------------------------- +} // namespace Inferno -const LogStream& operator<<(const LogStream& stream, entt::entity entity) +void ruc::format::Formatter::format(Builder& builder, entt::entity value) const { - return stream << static_cast(entity); + return Formatter::format(builder, static_cast(value)); } - -} // namespace Inferno diff --git a/src/inferno/scene/scene.h b/src/inferno/scene/scene.h index ceb1759..5740d69 100644 --- a/src/inferno/scene/scene.h +++ b/src/inferno/scene/scene.h @@ -5,8 +5,7 @@ #include "entt/entity/registry.hpp" // entt::entity, entt::registry #include "glm/ext/matrix_float4x4.hpp" // glm::mat4 - -#include "inferno/io/log.h" +#include "ruc/format/format.h" namespace Inferno { @@ -74,12 +73,13 @@ private: std::shared_ptr m_registry; }; -// ----------------------------------------- - -const LogStream& operator<<(const LogStream& stream, entt::entity handle); - } // namespace Inferno +template<> +struct ruc::format::Formatter : Formatter { + void format(Builder& builder, entt::entity value) const; +}; + // @Todo // - Convert registry to stack variable // - Convert registry to scene pointer in systems diff --git a/src/inferno/script/registration.h b/src/inferno/script/registration.h index 5140a09..8c14e74 100644 --- a/src/inferno/script/registration.h +++ b/src/inferno/script/registration.h @@ -1,10 +1,9 @@ #pragma once +#include "ruc/format/format.h" #include "sol/overload.hpp" // sol::overload #include "sol/state_view.hpp" // sol::state_view -#include "inferno/io/log.h" - namespace Inferno { class Registration final { @@ -55,9 +54,7 @@ private: template static std::string string(const T& t) { - std::string result; - str(&result) << t; - return result; + return format("{}", t); } }; diff --git a/src/inferno/settings.cpp b/src/inferno/settings.cpp index 2fe5795..ee7c9b8 100644 --- a/src/inferno/settings.cpp +++ b/src/inferno/settings.cpp @@ -2,9 +2,9 @@ #include // std::string #include "ruc/file.h" +#include "ruc/format/log.h" #include "ruc/json/json.h" -#include "inferno/io/log.h" #include "inferno/settings.h" #include "inferno/window.h" @@ -17,7 +17,7 @@ void Settings::initialize() { Settings::load(); - info() << "Settings initialized"; + ruc::info("Settings initialized"); Settings::save(); } @@ -31,7 +31,7 @@ bool Settings::load() auto object = ruc::Json::parse(ruc::File(m_path).data()); if (object.type() != ruc::Json::Type::Object) { - warn() << "Settings invalid formatting, using default values"; + ruc::warn("Settings invalid formatting, using default values"); return false; } @@ -50,7 +50,7 @@ bool Settings::save() file.append("\n"); file.flush(); - info() << "Settings saved"; + ruc::info("Settings saved"); return true; } diff --git a/src/inferno/system/camerasystem.cpp b/src/inferno/system/camerasystem.cpp index f6d6804..452d963 100644 --- a/src/inferno/system/camerasystem.cpp +++ b/src/inferno/system/camerasystem.cpp @@ -1,12 +1,12 @@ #include "glm/ext/matrix_clip_space.hpp" // glm::perspective, glm::ortho #include "glm/ext/matrix_transform.hpp" // glm::radians, glm::lookAt +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/application.h" #include "inferno/component/cameracomponent.h" #include "inferno/component/transformcomponent.h" #include "inferno/io/input.h" -#include "inferno/io/log.h" #include "inferno/system/camerasystem.h" #include "inferno/window.h" @@ -14,7 +14,7 @@ namespace Inferno { CameraSystem::CameraSystem(s) { - info() << "CameraSystem initialized"; + ruc::info("CameraSystem initialized"); } CameraSystem::~CameraSystem() diff --git a/src/inferno/system/rendersystem.cpp b/src/inferno/system/rendersystem.cpp index 6349ce7..1122e6e 100644 --- a/src/inferno/system/rendersystem.cpp +++ b/src/inferno/system/rendersystem.cpp @@ -1,8 +1,8 @@ #include "glm/ext/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale, glm::radians +#include "ruc/format/log.h" #include "inferno/component/spritecomponent.h" #include "inferno/component/transformcomponent.h" -#include "inferno/io/log.h" #include "inferno/render/renderer.h" #include "inferno/system/rendersystem.h" @@ -10,7 +10,7 @@ namespace Inferno { RenderSystem::RenderSystem(s) { - info() << "RenderSystem initialized"; + ruc::info("RenderSystem initialized"); } RenderSystem::~RenderSystem() diff --git a/src/inferno/system/scriptsystem.cpp b/src/inferno/system/scriptsystem.cpp index ad60d1d..d26174e 100644 --- a/src/inferno/system/scriptsystem.cpp +++ b/src/inferno/system/scriptsystem.cpp @@ -1,9 +1,9 @@ #include "entt/entity/registry.hpp" // entt::entity, entt::registry +#include "ruc/format/log.h" #include "inferno/component/luascriptcomponent.h" #include "inferno/component/nativescriptcomponent.h" #include "inferno/component/transformcomponent.h" -#include "inferno/io/log.h" #include "inferno/scene/scene.h" #include "inferno/script/luascript.h" #include "inferno/script/nativescript.h" @@ -13,7 +13,7 @@ namespace Inferno { ScriptSystem::ScriptSystem(s) { - info() << "ScriptSystem initialized"; + ruc::info("ScriptSystem initialized"); } ScriptSystem::~ScriptSystem() diff --git a/src/inferno/system/textareasystem.cpp b/src/inferno/system/textareasystem.cpp index abceacb..6d3fbcc 100644 --- a/src/inferno/system/textareasystem.cpp +++ b/src/inferno/system/textareasystem.cpp @@ -1,3 +1,4 @@ +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/application.h" @@ -13,7 +14,7 @@ namespace Inferno { TextAreaSystem::TextAreaSystem(s) { - info() << "TextAreaSystem initialized"; + ruc::info("TextAreaSystem initialized"); } TextAreaSystem::~TextAreaSystem() @@ -89,7 +90,7 @@ std::optional TextAreaSystem::calculateCharacterQuad(unsigned cha quad.quad.position.x += advance; } - // dbgln("character: {} ({}) width: {} height: {} advance: {} x: {}", + // ruc::debug("character: {} ({}) width: {} height: {} advance: {} x: {}", // character, (int)character, quadWidth, quadHeight, advance, characterQuad.at(0).quad.position.x); // Jump to the next glyph diff --git a/src/inferno/system/transformsystem.cpp b/src/inferno/system/transformsystem.cpp index f22995a..9a9917f 100644 --- a/src/inferno/system/transformsystem.cpp +++ b/src/inferno/system/transformsystem.cpp @@ -1,14 +1,14 @@ #include "glm/ext/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale, glm::radians +#include "ruc/format/log.h" #include "inferno/component/transformcomponent.h" -#include "inferno/io/log.h" #include "inferno/system/transformsystem.h" namespace Inferno { TransformSystem::TransformSystem(s) { - info() << "TransformSystem initialized"; + ruc::info("TransformSystem initialized"); } TransformSystem::~TransformSystem() diff --git a/src/inferno/util/json.h b/src/inferno/util/json.h index 2db8a67..c6579d2 100644 --- a/src/inferno/util/json.h +++ b/src/inferno/util/json.h @@ -7,6 +7,7 @@ #include "nlohmann/json.hpp" #include "ruc/meta/assert.h" + #include "ruc/format/log.h" namespace Inferno { @@ -121,7 +122,7 @@ namespace Inferno { values.emplace_back(typedValue.value()); } else { - warnln("Json array property '{}' has type inconsistency", property); + ruc::warn("Json array property '{}' has type inconsistency", property); } } @@ -160,7 +161,7 @@ namespace Inferno { values.emplace(std::move(key), typedValue.value()); } else { - warnln("Json array property '{}' has type inconsistency", property); + ruc::warn("Json array property '{}' has type inconsistency", property); } } diff --git a/src/inferno/window.cpp b/src/inferno/window.cpp index fc3a186..bd57720 100644 --- a/src/inferno/window.cpp +++ b/src/inferno/window.cpp @@ -1,6 +1,7 @@ #include // signal #include "GLFW/glfw3.h" +#include "ruc/format/log.h" #include "ruc/meta/assert.h" #include "inferno/application.h" @@ -9,7 +10,6 @@ #include "inferno/event/keyevent.h" #include "inferno/event/mouseevent.h" #include "inferno/io/input.h" -#include "inferno/io/log.h" #include "inferno/keycodes.h" #include "inferno/render/context.h" #include "inferno/render/renderer.h" @@ -83,7 +83,7 @@ void Window::initialize() // Error callback glfwSetErrorCallback([](int error, const char* description) { - dbgln("GLFW Error {}: {}", error, description); + ruc::error("GLFW Error: {}: {}", error, description); }); // Window close callback