|
|
|
|
/******************************************************************************
|
|
|
|
|
* File - editor.cpp
|
|
|
|
|
* Author - Joey Pollack
|
|
|
|
|
* Date - 2021/11/01 (y/m/d)
|
|
|
|
|
* Mod Date - 2021/11/01 (y/m/d)
|
|
|
|
|
* Description - Entry point for the editor run mode.
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "editor.h"
|
|
|
|
|
|
|
|
|
|
#include "panels/mainPanel.h"
|
|
|
|
|
#include <core/core.h>
|
|
|
|
|
#include <utils/logger.h>
|
|
|
|
|
|
|
|
|
|
namespace lunarium
|
|
|
|
|
{
|
|
|
|
|
Editor::Editor()
|
|
|
|
|
: mLogCat(-1), mpMainPanel(nullptr)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OpRes Editor::Initialize()
|
|
|
|
|
{
|
|
|
|
|
//Core::MainWindow().Hide();
|
|
|
|
|
|
|
|
|
|
mLogCat = Logger::RegisterCategory("EDITOR");
|
|
|
|
|
mpMainPanel = &MainPanel::GetInstance();
|
|
|
|
|
mpMainPanel->SetEditor(this);
|
|
|
|
|
|
|
|
|
|
Core::MainWindow().GetPosition(&sx, &sy);
|
|
|
|
|
return OpRes::OK();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Editor::Shutdown()
|
|
|
|
|
{
|
|
|
|
|
MainPanel::FreeInstance();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Editor::OnTick(double delta)
|
|
|
|
|
{
|
|
|
|
|
//int x, y, w, h;
|
|
|
|
|
//mpMainPanel->GetPosition(x, y);
|
|
|
|
|
// mpMainPanel->GetSize(w, h);
|
|
|
|
|
|
|
|
|
|
// if (w > 0 && h > 0)
|
|
|
|
|
// {
|
|
|
|
|
// // NOTE: Should not be able to run in full screen while in editor mode
|
|
|
|
|
// // Unless testing the game maybe?
|
|
|
|
|
// Core::MainWindow().ChangeDisplayMode(false, x, y, w, h);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// if (x > 0 && y > 0)
|
|
|
|
|
// {
|
|
|
|
|
// if (sx != x || sy != y)
|
|
|
|
|
// {
|
|
|
|
|
// Core::MainWindow().Hide();
|
|
|
|
|
// mpMainPanel->Focus();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Editor::OnRender(IGraphics* g)
|
|
|
|
|
{
|
|
|
|
|
if (!mpMainPanel->DoFrame())
|
|
|
|
|
{
|
|
|
|
|
Core::GetInstance().SignalShutdown();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t Editor::GetLogCat() const
|
|
|
|
|
{
|
|
|
|
|
return mLogCat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
// HELPER METHODS
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
void Editor::CreatePanels()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|