Skyscraper 2.0
Skyscraper::VM Class Reference

#include <vm.h>

Collaboration diagram for Skyscraper::VM:

Public Member Functions

 VM ()
 
 ~VM ()
 
void SetParent (wxWindow *parent)
 
HALGetHAL ()
 
SkySystemGetSkySystem ()
 
GUIGetGUI ()
 
EngineContextGetActiveEngine ()
 
EngineContextGetEngine (int number)
 
EngineContextCreateEngine (EngineContext *parent=0, const Vector3 &position=Vector3::ZERO, Real rotation=0.0, const Vector3 &area_min=Vector3::ZERO, const Vector3 &area_max=Vector3::ZERO)
 
bool DeleteEngine (EngineContext *engine)
 
void DeleteEngines ()
 
int GetEngineCount (bool loading_only=false)
 
int GetEngineListSize ()
 
EngineContextFindActiveEngine ()
 
void SetActiveEngine (int number, bool switch_engines=false, bool force=false)
 
bool IsEngineLoading ()
 
bool IsValidEngine (EngineContext *engine)
 
bool IsValidSystem (::SBS::SBS *sbs)
 
int RegisterEngine (EngineContext *engine)
 
EngineContextGetFirstValidEngine ()
 
int GetFreeInstanceNumber ()
 
int Run (std::vector< EngineContext * > &newengine)
 
bool StartEngine (EngineContext *engine, std::vector< Ogre::Camera * > &cameras)
 
::SBS::SBSGetActiveSystem ()
 
ScriptProcessorGetActiveScriptProcessor ()
 
bool Load (bool clear, const std::string &filename, EngineContext *parent=0, const Vector3 &position=Vector3::ZERO, Real rotation=0.0, const Vector3 &area_min=Vector3::ZERO, const Vector3 &area_max=Vector3::ZERO)
 
void ShowPlatform ()
 
wxWindow * GetParent ()
 
bool UpdateProgress ()
 
bool ReportMissingFiles (std::vector< std::string > &missing_files)
 
void StartConsole ()
 
void ProcessConsole ()
 
VMConsoleGetConsole ()
 
EngineContextInitialize (bool clear, EngineContext *parent=0, const Vector3 &position=Vector3::ZERO, Real rotation=0.0, const Vector3 &area_min=Vector3::ZERO, const Vector3 &area_max=Vector3::ZERO)
 
void SetRenderOnStartup (bool value)
 
bool GetRenderOnStartup ()
 
unsigned long Uptime ()
 
unsigned long GetElapsedTime (int instance)
 
void ListPlayingSounds ()
 

Public Attributes

bool Shutdown
 
bool ConcurrentLoads
 
bool CheckScript
 
bool Pause
 
bool CutLandscape
 
bool CutBuildings
 
bool CutExternal
 
bool CutFloors
 
bool Verbose
 
bool showconsole
 
bool loadstart
 
bool unloaded
 
unsigned long time_stat
 
unsigned long current_time
 
std::string version
 
std::string version_rev
 
std::string version_state
 
std::string version_frontend
 
std::string Bits
 
std::string Platform
 
std::string Architecture
 
int macos_major
 
int macos_minor
 
std::string data_path
 

Private Member Functions

bool RunEngines (std::vector< EngineContext * > &newengines)
 
void CheckCamera ()
 
void HandleEngineShutdown ()
 
void HandleReload ()
 
void SwitchEngines ()
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
bool ReportFatalError (const std::string &message)
 

Private Attributes

EngineContextactive_engine
 
std::vector< EngineContext * > engines
 
HALhal
 
SkySystemskysystem
 
GUIgui
 
VMConsolevmconsole
 
wxWindow * parent
 
bool first_run
 
bool RenderOnStartup
 

Friends

class VMConsole
 

Detailed Description

Definition at line 70 of file vm.h.

Constructor & Destructor Documentation

◆ VM()

Skyscraper::VM::VM ( )

◆ ~VM()

Skyscraper::VM::~VM ( )

Definition at line 94 of file vm.cpp.

References gui, hal, Report(), skysystem, and vmconsole.

Here is the call graph for this function:

Member Function Documentation

◆ CheckCamera()

void Skyscraper::VM::CheckCamera ( )
private

Definition at line 580 of file vm.cpp.

References active_engine, FindActiveEngine(), and Skyscraper::EngineContext::IsCameraActive().

Referenced by Run().

Here is the call graph for this function:

◆ CreateEngine()

EngineContext * Skyscraper::VM::CreateEngine ( EngineContext * parent = 0,
const Vector3 & position = Vector3::ZERO,
Real rotation = 0.0,
const Vector3 & area_min = Vector3::ZERO,
const Vector3 & area_max = Vector3::ZERO )

Definition at line 147 of file vm.cpp.

References Skyscraper::HAL::GetSceneManager(), Skyscraper::HAL::GetSoundSystem(), hal, and parent.

Referenced by Initialize().

Here is the call graph for this function:

◆ DeleteEngine()

bool Skyscraper::VM::DeleteEngine ( EngineContext * engine)

◆ DeleteEngines()

void Skyscraper::VM::DeleteEngines ( )

Definition at line 196 of file vm.cpp.

References active_engine, engines, Report(), and unloaded.

Referenced by Skyscraper::VMConsole::Process().

Here is the call graph for this function:

◆ FindActiveEngine()

EngineContext * Skyscraper::VM::FindActiveEngine ( )

Definition at line 211 of file vm.cpp.

References active_engine, and engines.

Referenced by CheckCamera().

◆ GetActiveEngine()

◆ GetActiveScriptProcessor()

ScriptProcessor * Skyscraper::VM::GetActiveScriptProcessor ( )

Definition at line 607 of file vm.cpp.

References active_engine, and Skyscraper::EngineContext::GetScriptProcessor().

Referenced by Skyscraper::VMConsole::Process().

Here is the call graph for this function:

◆ GetActiveSystem()

SBS::SBS * Skyscraper::VM::GetActiveSystem ( )

Definition at line 598 of file vm.cpp.

References active_engine, and Skyscraper::EngineContext::GetSystem().

Referenced by Skyscraper::DebugPanel::Loop(), and Skyscraper::DebugPanel::OnInit().

Here is the call graph for this function:

◆ GetConsole()

VMConsole * Skyscraper::VM::GetConsole ( )

Definition at line 955 of file vm.cpp.

References vmconsole.

Referenced by Skyscraper::Console::On_bSend_Click().

◆ GetElapsedTime()

unsigned long Skyscraper::VM::GetElapsedTime ( int instance)

Definition at line 984 of file vm.cpp.

References engines.

Referenced by Skyscraper::VMConsole::Process().

◆ GetEngine()

◆ GetEngineCount()

◆ GetEngineListSize()

int Skyscraper::VM::GetEngineListSize ( )
inline

Definition at line 87 of file vm.h.

Referenced by Skyscraper::EngineManager::Loop().

◆ GetFirstValidEngine()

EngineContext * Skyscraper::VM::GetFirstValidEngine ( )

Definition at line 568 of file vm.cpp.

References engines.

Referenced by Skyscraper::GUI::CreateProgressDialog(), DeleteEngine(), and Initialize().

◆ GetFreeInstanceNumber()

int Skyscraper::VM::GetFreeInstanceNumber ( )

Definition at line 539 of file vm.cpp.

References engines.

Referenced by RegisterEngine().

◆ GetGUI()

◆ GetHAL()

◆ GetParent()

◆ GetRenderOnStartup()

bool Skyscraper::VM::GetRenderOnStartup ( )

◆ GetSkySystem()

◆ HandleEngineShutdown()

void Skyscraper::VM::HandleEngineShutdown ( )
private

Definition at line 367 of file vm.cpp.

References DeleteEngine(), engines, hal, Skyscraper::HAL::RefreshViewport(), Report(), and SBS::ToString().

Referenced by Run().

Here is the call graph for this function:

◆ HandleReload()

void Skyscraper::VM::HandleReload ( )
private

Definition at line 405 of file vm.cpp.

References Skyscraper::SkySystem::CreateSky(), engines, Pause, Report(), skysystem, SBS::ToString(), and Skyscraper::SkySystem::UnloadSky().

Referenced by Run().

Here is the call graph for this function:

◆ Initialize()

EngineContext * Skyscraper::VM::Initialize ( bool clear,
EngineContext * parent = 0,
const Vector3 & position = Vector3::ZERO,
Real rotation = 0.0,
const Vector3 & area_min = Vector3::ZERO,
const Vector3 & area_max = Vector3::ZERO )

◆ IsEngineLoading()

bool Skyscraper::VM::IsEngineLoading ( )

Definition at line 351 of file vm.cpp.

References engines.

Referenced by Run(), and RunEngines().

◆ IsValidEngine()

bool Skyscraper::VM::IsValidEngine ( EngineContext * engine)

◆ IsValidSystem()

bool Skyscraper::VM::IsValidSystem ( ::SBS::SBS * sbs)

Definition at line 521 of file vm.cpp.

References engines.

◆ ListPlayingSounds()

void Skyscraper::VM::ListPlayingSounds ( )

◆ Load()

bool Skyscraper::VM::Load ( bool clear,
const std::string & filename,
EngineContext * parent = 0,
const Vector3 & position = Vector3::ZERO,
Real rotation = 0.0,
const Vector3 & area_min = Vector3::ZERO,
const Vector3 & area_max = Vector3::ZERO )

◆ ProcessConsole()

void Skyscraper::VM::ProcessConsole ( )

Definition at line 947 of file vm.cpp.

References Skyscraper::VMConsole::Process(), and vmconsole.

Here is the call graph for this function:

◆ RegisterEngine()

int Skyscraper::VM::RegisterEngine ( EngineContext * engine)

Definition at line 551 of file vm.cpp.

References engines, GetFreeInstanceNumber(), and Skyscraper::EngineContext::time_stat.

Referenced by Skyscraper::EngineContext::Init().

Here is the call graph for this function:

◆ Report()

void Skyscraper::VM::Report ( const std::string & message)
private

Definition at line 770 of file vm.cpp.

References hal, and Skyscraper::HAL::Report().

Referenced by DeleteEngine(), DeleteEngines(), HandleEngineShutdown(), HandleReload(), ListPlayingSounds(), Load(), Run(), SetActiveEngine(), StartEngine(), SwitchEngines(), VM(), and ~VM().

Here is the call graph for this function:

◆ ReportError()

bool Skyscraper::VM::ReportError ( const std::string & message)
private

Definition at line 775 of file vm.cpp.

References hal, and Skyscraper::HAL::ReportError().

Here is the call graph for this function:

◆ ReportFatalError()

bool Skyscraper::VM::ReportFatalError ( const std::string & message)
private

Definition at line 780 of file vm.cpp.

References hal, and Skyscraper::HAL::ReportFatalError().

Referenced by Initialize().

Here is the call graph for this function:

◆ ReportMissingFiles()

bool Skyscraper::VM::ReportMissingFiles ( std::vector< std::string > & missing_files)

Definition at line 931 of file vm.cpp.

References gui, and Skyscraper::GUI::ReportMissingFiles().

Referenced by Skyscraper::EngineContext::Run().

Here is the call graph for this function:

◆ Run()

◆ RunEngines()

bool Skyscraper::VM::RunEngines ( std::vector< EngineContext * > & newengines)
private

◆ SetActiveEngine()

◆ SetParent()

void Skyscraper::VM::SetParent ( wxWindow * parent)

Definition at line 121 of file vm.cpp.

References parent.

◆ SetRenderOnStartup()

void Skyscraper::VM::SetRenderOnStartup ( bool value)

Definition at line 960 of file vm.cpp.

References engines, and RenderOnStartup.

Referenced by Skyscraper::EngineManager::On_chkRender_Click().

◆ ShowPlatform()

void Skyscraper::VM::ShowPlatform ( )

Definition at line 820 of file vm.cpp.

References Architecture, Bits, Skyscraper::get_macos_version(), GetHAL(), macos_major, macos_minor, Platform, Skyscraper::HAL::Report(), and SBS::ToString().

Here is the call graph for this function:

◆ StartConsole()

void Skyscraper::VM::StartConsole ( )

Definition at line 941 of file vm.cpp.

References VMConsole, and vmconsole.

◆ StartEngine()

bool Skyscraper::VM::StartEngine ( EngineContext * engine,
std::vector< Ogre::Camera * > & cameras )

Definition at line 590 of file vm.cpp.

References Report(), and Skyscraper::EngineContext::Start().

Here is the call graph for this function:

◆ SwitchEngines()

void Skyscraper::VM::SwitchEngines ( )
private

◆ UpdateProgress()

bool Skyscraper::VM::UpdateProgress ( )

Definition at line 909 of file vm.cpp.

References GetEngine(), GetEngineCount(), Skyscraper::EngineContext::GetProgress(), gui, and Skyscraper::GUI::UpdateProgress().

Referenced by Skyscraper::EngineContext::UpdateProgress().

Here is the call graph for this function:

◆ Uptime()

unsigned long Skyscraper::VM::Uptime ( )

Definition at line 977 of file vm.cpp.

References Skyscraper::HAL::GetCurrentTime(), and hal.

Referenced by Skyscraper::VMConsole::Process().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ VMConsole

friend class VMConsole
friend

Definition at line 72 of file vm.h.

Referenced by StartConsole().

Member Data Documentation

◆ active_engine

◆ Architecture

std::string Skyscraper::VM::Architecture

Definition at line 133 of file vm.h.

Referenced by Skyscraper::VMConsole::Process(), and ShowPlatform().

◆ Bits

std::string Skyscraper::VM::Bits

Definition at line 131 of file vm.h.

Referenced by Skyscraper::VMConsole::Process(), and ShowPlatform().

◆ CheckScript

bool Skyscraper::VM::CheckScript

Definition at line 117 of file vm.h.

Referenced by Skyscraper::ScriptProcessor::Reset(), Run(), and VM().

◆ ConcurrentLoads

◆ current_time

unsigned long Skyscraper::VM::current_time

Definition at line 124 of file vm.h.

Referenced by Run().

◆ CutBuildings

◆ CutExternal

◆ CutFloors

◆ CutLandscape

◆ data_path

std::string Skyscraper::VM::data_path

◆ engines

◆ first_run

bool Skyscraper::VM::first_run
private

Definition at line 160 of file vm.h.

Referenced by Run(), and VM().

◆ gui

GUI* Skyscraper::VM::gui
private

Definition at line 155 of file vm.h.

Referenced by GetGUI(), ReportMissingFiles(), UpdateProgress(), VM(), and ~VM().

◆ hal

HAL* Skyscraper::VM::hal
private

◆ loadstart

bool Skyscraper::VM::loadstart

Definition at line 122 of file vm.h.

Referenced by Initialize(), and VM().

◆ macos_major

int Skyscraper::VM::macos_major

Definition at line 134 of file vm.h.

Referenced by Skyscraper::StartScreen::DrawImage(), ShowPlatform(), and VM().

◆ macos_minor

int Skyscraper::VM::macos_minor

Definition at line 135 of file vm.h.

Referenced by Skyscraper::StartScreen::DrawImage(), ShowPlatform(), and VM().

◆ parent

wxWindow* Skyscraper::VM::parent
private

Definition at line 158 of file vm.h.

Referenced by CreateEngine(), GetParent(), Initialize(), Load(), SetParent(), SwitchEngines(), and VM().

◆ Pause

◆ Platform

std::string Skyscraper::VM::Platform

◆ RenderOnStartup

bool Skyscraper::VM::RenderOnStartup
private

Definition at line 161 of file vm.h.

Referenced by GetRenderOnStartup(), Run(), RunEngines(), SetRenderOnStartup(), and VM().

◆ showconsole

bool Skyscraper::VM::showconsole

Definition at line 121 of file vm.h.

Referenced by Skyscraper::HAL::Initialize(), Skyscraper::HAL::LoadConfiguration(), and VM().

◆ Shutdown

bool Skyscraper::VM::Shutdown

Definition at line 115 of file vm.h.

Referenced by DeleteEngine(), Run(), and VM().

◆ skysystem

SkySystem* Skyscraper::VM::skysystem
private

Definition at line 154 of file vm.h.

Referenced by GetSkySystem(), HandleReload(), Initialize(), Run(), VM(), and ~VM().

◆ time_stat

unsigned long Skyscraper::VM::time_stat

Definition at line 124 of file vm.h.

Referenced by Skyscraper::VMConsole::Process(), and Run().

◆ unloaded

bool Skyscraper::VM::unloaded

Definition at line 123 of file vm.h.

Referenced by DeleteEngines(), and VM().

◆ Verbose

bool Skyscraper::VM::Verbose

Definition at line 120 of file vm.h.

Referenced by Skyscraper::EngineContext::StartSim(), and VM().

◆ version

std::string Skyscraper::VM::version

Definition at line 126 of file vm.h.

Referenced by Skyscraper::VMConsole::Process().

◆ version_frontend

std::string Skyscraper::VM::version_frontend

◆ version_rev

std::string Skyscraper::VM::version_rev

Definition at line 127 of file vm.h.

◆ version_state

std::string Skyscraper::VM::version_state

Definition at line 128 of file vm.h.

Referenced by Skyscraper::VMConsole::Process().

◆ vmconsole

VMConsole* Skyscraper::VM::vmconsole
private

Definition at line 156 of file vm.h.

Referenced by GetConsole(), ProcessConsole(), StartConsole(), VM(), and ~VM().


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