Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/game-editor' into g…
Browse files Browse the repository at this point in the history
…ame-editor
  • Loading branch information
PharaEthan committed Jan 9, 2024
2 parents f810cda + 87fc64e commit fffeffd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Exodia/src/Layer/EditorLayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace Exodia {
Scope<ContentBrowser> _ContentBrowser;
SceneHierarchy _SceneHierarchy;
StatistcsPanel _StatisticsPanel;
Console _Console;
Console _Console;

// Entity
GameObject _HoveredEntity;
Expand Down
10 changes: 4 additions & 6 deletions Exodia/src/Panel/Console/Console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ namespace Exodia {
// Methods //
/////////////

void Console::OnImGuiRender()
{
void Console::OnImGuiRender() {
ImGui::Begin("Console");

for (std::string &log : GetLogs())
Expand All @@ -28,10 +27,9 @@ namespace Exodia {
// Getters & Setters //
///////////////////////

std::vector<std::string> Console::GetLogs()
{
std::vector<std::string> Console::GetLogs() {
LogHistory coreHistory = Log::GetCoreLoggerHistory();
std::vector <std::string> logs;
std::vector<std::string> logs;

for (const std::string &logFileName : coreHistory.GetLogs()) {
std::ifstream logFile(logFileName);
Expand All @@ -47,4 +45,4 @@ namespace Exodia {

return logs;
}
};
}; // namespace Exodia
27 changes: 12 additions & 15 deletions Exodia/src/Panel/Console/Console.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*/

#ifndef CONSOLE_HPP_
#define CONSOLE_HPP_
#define CONSOLE_HPP_

// External includes
#include <vector>
#include <string>
// External includes
#include <vector>
#include <string>

namespace Exodia {

Expand All @@ -19,25 +19,22 @@ namespace Exodia {
//////////////////////////////
// Constructor & Destructor //
//////////////////////////////
public:

Console() = default;
~Console() = default;
public:
Console() = default;
~Console() = default;

/////////////
// Methods //
/////////////
public:
public:
void OnImGuiRender();

void OnImGuiRender();

///////////////////////
// Getters & Setters //
///////////////////////
private:

std::vector<std::string> GetLogs();
private:
std::vector<std::string> GetLogs();
};
};
}; // namespace Exodia

#endif /* !CONSOLE_HPP_ */
6 changes: 2 additions & 4 deletions Library/Debug/src/Logger/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ namespace Exodia {
// Getters & Setters //
///////////////////////

LogHistory Log::GetCoreLoggerHistory()
{
LogHistory Log::GetCoreLoggerHistory() {
LogHistory history;

for (const auto &sink : _CoreLogger->sinks()) {
Expand All @@ -70,8 +69,7 @@ namespace Exodia {
return history;
}

LogHistory Log::GetClientLoggerHistory()
{
LogHistory Log::GetClientLoggerHistory() {
LogHistory history;

for (const auto &sink : _ClientLogger->sinks()) {
Expand Down
10 changes: 2 additions & 8 deletions Library/Debug/src/Logger/Log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ namespace Exodia {
struct LogHistory {
std::vector<std::string> Logs;

void AddLog(const std::string &log)
{
Logs.push_back(log);
}
void AddLog(const std::string &log) { Logs.push_back(log); }

const std::vector<std::string> &GetLogs() const
{
return Logs;
}
const std::vector<std::string> &GetLogs() const { return Logs; }
};

/**
Expand Down

0 comments on commit fffeffd

Please sign in to comment.