Code cleanup
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#include <memory> // unique_ptr
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <memory> // unique_ptr
|
||||
#include <memory> // std::unique_ptr
|
||||
|
||||
namespace Inferno {
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef CORE_H
|
||||
#define CORE_H
|
||||
|
||||
#include <csignal> // raise
|
||||
#include <functional> // bind
|
||||
#include <csignal> // raise
|
||||
#include <functional> // std::bind
|
||||
|
||||
#define BIT(x) (1 << x)
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ int main(int argc, char* argv[])
|
||||
(void)argv;
|
||||
|
||||
// Initialize Log
|
||||
Inferno::Log::init();
|
||||
NF_CORE_INFO("Initialized Log!");
|
||||
Inferno::Log::initialize();
|
||||
|
||||
// Start application
|
||||
auto app = Inferno::createApplication();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef APPLICATIONEVENT_H
|
||||
#define APPLICATIONEVENT_H
|
||||
|
||||
#include <sstream> // stringstream
|
||||
#include <sstream> // std::stringstream
|
||||
|
||||
#include "inferno/event/event.h"
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace Inferno {
|
||||
WindowResizeEvent(int width, int height) :
|
||||
m_width(width), m_height(height) {}
|
||||
|
||||
virtual std::string toString() const override {
|
||||
virtual std::string toString() const override
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "WindowResize: " << m_width << "x" << m_height;
|
||||
return ss.str();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EVENT_H
|
||||
#define EVENT_H
|
||||
|
||||
#include <ostream> // ostream
|
||||
#include <ostream> // std::ostream
|
||||
|
||||
#include "inferno/core.h"
|
||||
|
||||
|
||||
@@ -6,12 +6,14 @@ namespace Inferno {
|
||||
std::shared_ptr<Logger> Log::m_coreLogger;
|
||||
std::shared_ptr<Logger> Log::m_gameLogger;
|
||||
|
||||
void Log::init()
|
||||
void Log::initialize()
|
||||
{
|
||||
// Create engine Logger
|
||||
m_coreLogger = std::make_shared<Logger>("Inferno");
|
||||
// Create game Logger
|
||||
m_gameLogger = std::make_shared<Logger>("Game");
|
||||
|
||||
NF_CORE_INFO("Log initialized");
|
||||
}
|
||||
|
||||
Logger::Logger(const char* name) :
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
#include <cstdio> // sprintf, printf
|
||||
#include <cstdio> // printf, sprintf
|
||||
#include <cstring> // strlen
|
||||
#include <memory> // shared_ptr
|
||||
#include <string> // string
|
||||
#include <memory> // std::shared_ptr
|
||||
#include <string> // std::string
|
||||
|
||||
namespace Inferno {
|
||||
|
||||
class Logger;
|
||||
|
||||
class Log
|
||||
{
|
||||
class Log {
|
||||
public:
|
||||
static void init();
|
||||
static void initialize();
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
@@ -25,8 +24,7 @@ namespace Inferno {
|
||||
static std::shared_ptr<Logger> m_gameLogger;
|
||||
};
|
||||
|
||||
class Logger
|
||||
{
|
||||
class Logger {
|
||||
public:
|
||||
Logger(const char* name);
|
||||
~Logger();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <fstream> // std::ifstream, std::ofstream
|
||||
#include <iomanip> // std::setfill, std::setw
|
||||
#include <string> // std::string
|
||||
#include <string> // std::string
|
||||
|
||||
#include "inferno/core.h"
|
||||
#include "inferno/log.h"
|
||||
@@ -26,7 +26,7 @@ namespace Inferno {
|
||||
|
||||
void Settings::initialize()
|
||||
{
|
||||
nlohmann::json m_json = load();
|
||||
nlohmann::json m_json = this->load();
|
||||
|
||||
try {
|
||||
m_properties.title = m_json["window"]["title"].get<std::string>().c_str();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
|
||||
#include <functional> // function
|
||||
#include <functional> // std::function
|
||||
|
||||
class GLFWwindow;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user