yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::Controller Class Reference

Main controller for the application. More...

#include <controller.h>

Collaboration diagram for yaze::Controller:

Classes

struct  ScreenshotRequest
 

Public Member Functions

bool IsActive () const
 
absl::Status OnEntry (std::string filename="")
 
void OnInput ()
 
absl::Status OnLoad ()
 
void DoRender () const
 
void OnExit ()
 
void RequestScreenshot (const ScreenshotRequest &request)
 
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::EditorManagereditor_manager ()
 
platform::IWindowBackendwindow_backend ()
 
absl::Status LoadRomForTesting (const std::string &rom_path)
 

Private Member Functions

friend int::main (int argc, char **argv)
 
void ProcessScreenshotRequests () const
 

Private Attributes

bool active_ = false
 
std::unique_ptr< platform::IWindowBackendwindow_backend_
 
editor::EditorManager editor_manager_
 
std::unique_ptr< gfx::IRendererrenderer_
 
std::mutex screenshot_mutex_
 
std::queue< ScreenshotRequestscreenshot_requests_
 

Detailed Description

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 32 of file controller.h.

Member Function Documentation

◆ IsActive()

bool yaze::Controller::IsActive ( ) const
inline

Definition at line 39 of file controller.h.

References active_.

◆ OnEntry()

◆ OnInput()

◆ OnLoad()

◆ DoRender()

◆ OnExit()

void yaze::Controller::OnExit ( )

Definition at line 219 of file controller.cc.

References renderer_, and window_backend_.

◆ RequestScreenshot()

void yaze::Controller::RequestScreenshot ( const ScreenshotRequest & request)

Definition at line 237 of file controller.cc.

References screenshot_mutex_, and screenshot_requests_.

◆ SetStartupEditor()

void yaze::Controller::SetStartupEditor ( const std::string & editor_name,
const std::string & cards )

Definition at line 73 of file controller.cc.

References editor_manager_, and yaze::editor::EditorManager::OpenEditorAndPanelsFromFlags().

Here is the call graph for this function:

◆ window()

auto yaze::Controller::window ( ) -> SDL_Window*
inline

Definition at line 53 of file controller.h.

References window_backend_.

◆ set_active()

void yaze::Controller::set_active ( bool active)
inline

Definition at line 56 of file controller.h.

References active(), and active_.

Here is the call graph for this function:

◆ active()

auto yaze::Controller::active ( ) const
inline

Definition at line 57 of file controller.h.

References active_.

Referenced by set_active().

◆ overworld()

auto yaze::Controller::overworld ( ) -> yaze::zelda3::Overworld*
inline

Definition at line 58 of file controller.h.

References editor_manager_, and yaze::editor::EditorManager::overworld().

Here is the call graph for this function:

◆ GetCurrentRom()

auto yaze::Controller::GetCurrentRom ( ) -> Rom*
inline

Definition at line 61 of file controller.h.

References editor_manager_, and yaze::editor::EditorManager::GetCurrentRom().

Here is the call graph for this function:

◆ renderer()

auto yaze::Controller::renderer ( ) -> gfx::IRenderer*
inline

Definition at line 62 of file controller.h.

References renderer_.

◆ editor_manager()

editor::EditorManager * yaze::Controller::editor_manager ( )
inline

Definition at line 65 of file controller.h.

References editor_manager_.

Referenced by yaze::app::GetGlobalEditorManager(), and yaze::app::GetGlobalEmulator().

◆ window_backend()

platform::IWindowBackend * yaze::Controller::window_backend ( )
inline

Definition at line 68 of file controller.h.

References window_backend_.

◆ LoadRomForTesting()

absl::Status yaze::Controller::LoadRomForTesting ( const std::string & rom_path)

Definition at line 228 of file controller.cc.

References editor_manager_, and yaze::editor::EditorManager::OpenRomOrProject().

Here is the call graph for this function:

◆ int::main()

yaze::Controller::int::main ( int argc,
char ** argv )
private

◆ ProcessScreenshotRequests()

void yaze::Controller::ProcessScreenshotRequests ( ) const
private

Definition at line 242 of file controller.cc.

References screenshot_mutex_, and screenshot_requests_.

Referenced by DoRender().

Member Data Documentation

◆ active_

bool yaze::Controller::active_ = false
private

Definition at line 83 of file controller.h.

Referenced by active(), IsActive(), OnEntry(), OnInput(), OnLoad(), and set_active().

◆ window_backend_

std::unique_ptr<platform::IWindowBackend> yaze::Controller::window_backend_
private

Definition at line 84 of file controller.h.

Referenced by DoRender(), OnEntry(), OnExit(), OnInput(), OnLoad(), window(), and window_backend().

◆ editor_manager_

editor::EditorManager yaze::Controller::editor_manager_
private

◆ renderer_

std::unique_ptr<gfx::IRenderer> yaze::Controller::renderer_
private

Definition at line 86 of file controller.h.

Referenced by DoRender(), OnEntry(), OnExit(), and renderer().

◆ screenshot_mutex_

std::mutex yaze::Controller::screenshot_mutex_
mutableprivate

Definition at line 89 of file controller.h.

Referenced by ProcessScreenshotRequests(), and RequestScreenshot().

◆ screenshot_requests_

std::queue<ScreenshotRequest> yaze::Controller::screenshot_requests_
mutableprivate

Definition at line 90 of file controller.h.

Referenced by ProcessScreenshotRequests(), and RequestScreenshot().


The documentation for this class was generated from the following files: