Main controller for the application. More...
#include <controller.h>

Public Member Functions | |
| bool | IsActive () const |
| absl::Status | OnEntry (std::string filename="") |
| void | OnInput () |
| absl::Status | OnLoad () |
| void | DoRender () const |
| void | OnExit () |
| void | SetStartupEditor (const std::string &editor_name, const std::string &cards) |
| auto | window () -> SDL_Window * |
| void | set_active (bool active) |
| auto | active () const |
| auto | overworld () -> yaze::zelda3::Overworld * |
| auto | GetCurrentRom () -> Rom * |
| auto | renderer () -> gfx::IRenderer * |
| editor::EditorManager * | editor_manager () |
| platform::IWindowBackend * | window_backend () |
| absl::Status | LoadRomForTesting (const std::string &rom_path) |
Private Member Functions | |
| friend | int::main (int argc, char **argv) |
Private Attributes | |
| bool | active_ = false |
| std::unique_ptr< platform::IWindowBackend > | window_backend_ |
| editor::EditorManager | editor_manager_ |
| std::unique_ptr< gfx::IRenderer > | renderer_ |
Main controller for the application.
This class is responsible for managing the main window and the main editor. It is the main entry point for the application.
Definition at line 26 of file controller.h.
|
inline |
Definition at line 28 of file controller.h.
References active_.
| absl::Status yaze::Controller::OnEntry | ( | std::string | filename = "" | ) |
Definition at line 21 of file controller.cc.
References active_, yaze::gfx::RendererFactory::Create(), yaze::platform::WindowBackendFactory::Create(), editor_manager_, yaze::editor::EditorManager::emulator(), yaze::gfx::Arena::Get(), yaze::platform::WindowBackendFactory::GetDefaultType(), yaze::platform::WindowConfig::high_dpi, yaze::editor::EditorManager::Initialize(), yaze::gfx::Arena::Initialize(), renderer_, yaze::platform::WindowConfig::resizable, RETURN_IF_ERROR, yaze::platform::WindowConfig::title, and window_backend_.
| void yaze::Controller::OnInput | ( | ) |
Definition at line 68 of file controller.cc.
References active_, yaze::platform::Close, editor_manager_, yaze::editor::EditorManager::emulator(), yaze::platform::WindowEvent::has_native_event, yaze::platform::WindowEvent::native_event, yaze::platform::Quit, yaze::platform::WindowEvent::type, and window_backend_.

| absl::Status yaze::Controller::OnLoad | ( | ) |
Definition at line 92 of file controller.cc.
References active_, yaze::gui::DockSpaceRenderer::BeginEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::BeginFrame(), yaze::editor::EditorManager::DrawMenuBar(), yaze::editor::UICoordinator::DrawMenuBarRestoreButton(), editor_manager_, yaze::gui::DockSpaceRenderer::EndEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::EndFrame(), yaze::editor::EditorManager::GetBottomLayoutOffset(), yaze::editor::EditorManager::GetLeftLayoutOffset(), yaze::editor::EditorManager::GetRightLayoutOffset(), yaze::gui::WidgetIdRegistry::Instance(), yaze::editor::UICoordinator::IsMenuBarVisible(), yaze::editor::EditorManager::quit(), RETURN_IF_ERROR, yaze::editor::EditorManager::ui_coordinator(), yaze::editor::EditorManager::Update(), and window_backend_.
| void yaze::Controller::DoRender | ( | ) | const |
Definition at line 172 of file controller.cc.
References yaze::gfx::Arena::Get(), yaze::TimingManager::Get(), yaze::gfx::Arena::ProcessTextureQueue(), renderer_, yaze::TimingManager::Update(), and window_backend_.

| void yaze::Controller::OnExit | ( | ) |
Definition at line 195 of file controller.cc.
References renderer_, and window_backend_.
| void yaze::Controller::SetStartupEditor | ( | const std::string & | editor_name, |
| const std::string & | cards ) |
Definition at line 59 of file controller.cc.
References editor_manager_, and yaze::editor::EditorManager::OpenEditorAndPanelsFromFlags().

|
inline |
Definition at line 39 of file controller.h.
References window_backend_.
|
inline |
Definition at line 42 of file controller.h.
References active(), and active_.

|
inline |
|
inline |
Definition at line 44 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::overworld().

|
inline |
Definition at line 47 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::GetCurrentRom().

|
inline |
Definition at line 48 of file controller.h.
References renderer_.
|
inline |
Definition at line 51 of file controller.h.
References editor_manager_.
Referenced by yaze::app::GetGlobalEditorManager(), and yaze::app::GetGlobalEmulator().
|
inline |
Definition at line 54 of file controller.h.
References window_backend_.
| absl::Status yaze::Controller::LoadRomForTesting | ( | const std::string & | rom_path | ) |
Definition at line 204 of file controller.cc.
References editor_manager_, and yaze::editor::EditorManager::OpenRomOrProject().

|
private |
|
private |
Definition at line 69 of file controller.h.
Referenced by active(), IsActive(), OnEntry(), OnInput(), OnLoad(), and set_active().
|
private |
Definition at line 70 of file controller.h.
Referenced by DoRender(), OnEntry(), OnExit(), OnInput(), OnLoad(), window(), and window_backend().
|
private |
Definition at line 71 of file controller.h.
Referenced by editor_manager(), GetCurrentRom(), LoadRomForTesting(), OnEntry(), OnInput(), OnLoad(), overworld(), and SetStartupEditor().
|
private |
Definition at line 72 of file controller.h.
Referenced by DoRender(), OnEntry(), OnExit(), and renderer().