Skyscraper 2.0
|
#include <hal.h>
Public Member Functions | |
HAL (VM *vm) | |
~HAL () | |
bool | Initialize (const std::string &data_path, Ogre::Root *root=0, Ogre::OverlaySystem *overlay=0) |
bool | Render () |
void | ClickedObject (bool left, bool shift, bool ctrl, bool alt, bool right, Real scale, bool center_only) |
void | UnclickedObject () |
int | GetConfigInt (Ogre::ConfigFile *file, const std::string &key, int default_value) |
std::string | GetConfigString (Ogre::ConfigFile *file, const std::string &key, const std::string &default_value) |
bool | GetConfigBool (Ogre::ConfigFile *file, const std::string &key, bool default_value) |
Real | GetConfigFloat (Ogre::ConfigFile *file, const std::string &key, Real default_value) |
bool | PlaySound (const std::string &filename, Real volume=1.0) |
void | StopSound () |
void | ClearScene () |
void | ToggleStats () |
void | EnableStats (bool value) |
FMOD::System * | GetSoundSystem () |
Ogre::RenderWindow * | GetRenderWindow () |
void | Clear () |
Ogre::SceneManager * | GetSceneManager () |
Ogre::RenderWindow * | CreateRenderWindow (const std::string &name, int width, int height, const Ogre::NameValuePairList ¶ms) |
void | DestroyRenderWindow () |
void | RefreshViewport () |
void | UpdateOpenXR () |
void | ReInit () |
void | Report (const std::string &message, const std::string &prompt) |
bool | ReportError (const std::string &message, const std::string &prompt) |
bool | ReportFatalError (const std::string &message, const std::string &prompt) |
void | LoadConfiguration (const std::string data_path, bool show_console) |
bool | LoadSystem (const std::string &data_path, Ogre::RenderWindow *renderwindow) |
void | ConsoleOut (const std::string &message, const std::string &color="white") |
std::string | GetColors (const std::string &color) |
unsigned long | GetCurrentTime () |
Public Attributes | |
bool | RTSS |
std::string | Renderer |
bool | DisableSound |
std::vector< Ogre::Camera * > | mCameras |
Ogre::Root * | mRoot |
Ogre::RenderWindow * | mRenderWindow |
std::vector< Ogre::Viewport * > | mViewports |
bool | DX11 |
Ogre::ConfigFile * | configfile |
Ogre::ConfigFile * | keyconfigfile |
Ogre::ConfigFile * | joyconfigfile |
Private Member Functions | |
void | Report (const std::string &message) |
bool | ReportError (const std::string &message) |
bool | ReportFatalError (const std::string &message) |
Ogre::ConfigFile * | ConfigLoad (const std::string &filename, bool delete_after_use=false) |
void | messageLogged (const std::string &message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string &logName, bool &skipThisMessage) |
Private Attributes | |
Ogre::SceneManager * | mSceneMgr |
Ogre::OverlaySystem * | mOverlaySystem |
Ogre::LogManager * | logger |
Ogre::Log * | log |
FMOD::System * | soundsys |
FMOD::Sound * | sound |
FMOD::Channel * | channel |
OgreBites::TrayManager * | mTrayMgr |
int | show_stats |
Ogre::Timer * | timer |
VM * | vm |
Skyscraper::HAL::HAL | ( | VM * | vm | ) |
Definition at line 68 of file hal.cpp.
References channel, configfile, DisableSound, DX11, joyconfigfile, keyconfigfile, log, logger, mOverlaySystem, mRenderWindow, mRoot, mSceneMgr, mTrayMgr, RTSS, show_stats, sound, soundsys, timer, and vm.
Skyscraper::HAL::~HAL | ( | ) |
Definition at line 91 of file hal.cpp.
References configfile, joyconfigfile, keyconfigfile, log, logger, mOverlaySystem, mRoot, and soundsys.
void Skyscraper::HAL::Clear | ( | ) |
void Skyscraper::HAL::ClearScene | ( | ) |
Definition at line 743 of file hal.cpp.
References mSceneMgr.
Referenced by Skyscraper::VM::Initialize().
void Skyscraper::HAL::ClickedObject | ( | bool | left, |
bool | shift, | ||
bool | ctrl, | ||
bool | alt, | ||
bool | right, | ||
Real | scale, | ||
bool | center_only ) |
Definition at line 124 of file hal.cpp.
References SBS::SBS::camera, SBS::Camera::ClickedObject(), Skyscraper::VM::GetActiveEngine(), Skyscraper::VM::GetEngine(), Skyscraper::VM::GetEngineCount(), Skyscraper::EngineContext::GetSystem(), SBS::Camera::MouseLeftDown, SBS::Camera::MouseRightDown, and vm.
Referenced by Skyscraper::Skyscraper::mousePressed(), and Skyscraper::Skyscraper::touchPressed().
|
private |
Definition at line 265 of file hal.cpp.
References ReportFatalError().
Referenced by LoadConfiguration().
void Skyscraper::HAL::ConsoleOut | ( | const std::string & | message, |
const std::string & | color = "white" ) |
Definition at line 985 of file hal.cpp.
References GetColors().
Referenced by Skyscraper::VMConsole::Report().
Ogre::RenderWindow * Skyscraper::HAL::CreateRenderWindow | ( | const std::string & | name, |
int | width, | ||
int | height, | ||
const Ogre::NameValuePairList & | params ) |
Definition at line 900 of file hal.cpp.
References configfile, CreateOpenXRRenderWindow(), GetConfigBool(), mRenderWindow, and mRoot.
void Skyscraper::HAL::DestroyRenderWindow | ( | ) |
Definition at line 920 of file hal.cpp.
References mRenderWindow.
void Skyscraper::HAL::EnableStats | ( | bool | value | ) |
Definition at line 773 of file hal.cpp.
References show_stats, and ToggleStats().
Referenced by ReInit(), and Skyscraper::Skyscraper::Start().
std::string Skyscraper::HAL::GetColors | ( | const std::string & | color | ) |
Definition at line 993 of file hal.cpp.
Referenced by ConsoleOut().
bool Skyscraper::HAL::GetConfigBool | ( | Ogre::ConfigFile * | file, |
const std::string & | key, | ||
bool | default_value ) |
Definition at line 299 of file hal.cpp.
References SBS::BoolToString(), and SBS::ToBool().
Referenced by CreateRenderWindow(), Skyscraper::SkySystem::CreateSky(), Skyscraper::StartScreen::DrawBackground(), Skyscraper::SkySystem::InitSky(), LoadConfiguration(), LoadSystem(), Skyscraper::Skyscraper::OnInit(), Skyscraper::ScriptProcessor::Section::Section(), Skyscraper::Skyscraper::Start(), and UpdateOpenXR().
Real Skyscraper::HAL::GetConfigFloat | ( | Ogre::ConfigFile * | file, |
const std::string & | key, | ||
Real | default_value ) |
Definition at line 307 of file hal.cpp.
References SBS::ToFloat(), and SBS::ToString().
Referenced by Skyscraper::StartScreen::DrawBackground(), Skyscraper::SkySystem::InitSky(), and Skyscraper::Skyscraper::Start().
int Skyscraper::HAL::GetConfigInt | ( | Ogre::ConfigFile * | file, |
const std::string & | key, | ||
int | default_value ) |
Definition at line 286 of file hal.cpp.
References SBS::ToInt(), and SBS::ToString().
Referenced by Skyscraper::GUI::CreateDebugPanel(), Skyscraper::StartScreen::DrawBackground(), LoadSystem(), Skyscraper::Skyscraper::OnInit(), Skyscraper::GUI::ShowConsole(), Skyscraper::GUI::ShowDebugPanel(), and Skyscraper::Skyscraper::Start().
std::string Skyscraper::HAL::GetConfigString | ( | Ogre::ConfigFile * | file, |
const std::string & | key, | ||
const std::string & | default_value ) |
Definition at line 292 of file hal.cpp.
Referenced by Skyscraper::StartScreen::Click(), Skyscraper::StartScreen::DrawBackground(), Skyscraper::VM::Initialize(), and Skyscraper::Skyscraper::OnInit().
unsigned long Skyscraper::HAL::GetCurrentTime | ( | ) |
Definition at line 1019 of file hal.cpp.
References timer.
Referenced by Skyscraper::EngineContext::Gather(), Skyscraper::EngineContext::GatherReset(), Skyscraper::VM::Run(), and Skyscraper::VM::Uptime().
Ogre::RenderWindow * Skyscraper::HAL::GetRenderWindow | ( | ) |
Definition at line 847 of file hal.cpp.
References mRenderWindow.
Referenced by Skyscraper::StartScreen::DrawImage(), and Skyscraper::VM::Initialize().
Ogre::SceneManager * Skyscraper::HAL::GetSceneManager | ( | ) |
Definition at line 895 of file hal.cpp.
References mSceneMgr.
Referenced by Skyscraper::VM::CreateEngine(), Skyscraper::StartScreen::DrawImage(), Skyscraper::SkySystem::InitSky(), and Skyscraper::Skyscraper::Start().
FMOD::System * Skyscraper::HAL::GetSoundSystem | ( | ) |
Definition at line 842 of file hal.cpp.
References soundsys.
Referenced by Skyscraper::VM::CreateEngine().
bool Skyscraper::HAL::Initialize | ( | const std::string & | data_path, |
Ogre::Root * | root = 0, | ||
Ogre::OverlaySystem * | overlay = 0 ) |
Definition at line 315 of file hal.cpp.
References log, logger, mOverlaySystem, mRoot, Report(), ReportFatalError(), Skyscraper::VM::showconsole, Skyscraper::VM::version_frontend, and vm.
Referenced by Skyscraper::Skyscraper::OnInit().
void Skyscraper::HAL::LoadConfiguration | ( | const std::string | data_path, |
bool | show_console ) |
Definition at line 954 of file hal.cpp.
References configfile, ConfigLoad(), GetConfigBool(), Skyscraper::VM::GetGUI(), joyconfigfile, keyconfigfile, Skyscraper::GUI::ShowConsole(), Skyscraper::VM::showconsole, and vm.
Referenced by Skyscraper::Skyscraper::OnInit().
bool Skyscraper::HAL::LoadSystem | ( | const std::string & | data_path, |
Ogre::RenderWindow * | renderwindow ) |
Definition at line 438 of file hal.cpp.
References configfile, DisableSound, DX11, GetConfigBool(), GetConfigInt(), mCameras, mOverlaySystem, mRenderWindow, mRoot, mSceneMgr, mTrayMgr, mViewports, Renderer, Report(), ReportFatalError(), RTSS, soundsys, and SBS::ToString().
Referenced by Skyscraper::Skyscraper::OnInit().
|
private |
Definition at line 976 of file hal.cpp.
References Skyscraper::VM::GetGUI(), vm, and Skyscraper::GUI::WriteToConsole().
bool Skyscraper::HAL::PlaySound | ( | const std::string & | filename, |
Real | volume = 1.0 ) |
void Skyscraper::HAL::RefreshViewport | ( | ) |
Definition at line 929 of file hal.cpp.
References mViewports.
Referenced by Skyscraper::VM::HandleEngineShutdown(), Skyscraper::VM::RunEngines(), and Skyscraper::Skyscraper::Start().
void Skyscraper::HAL::ReInit | ( | ) |
Definition at line 789 of file hal.cpp.
References EnableStats(), mOverlaySystem, mRenderWindow, mSceneMgr, mTrayMgr, ReportFatalError(), and show_stats.
Referenced by Clear().
bool Skyscraper::HAL::Render | ( | ) |
Definition at line 674 of file hal.cpp.
References mRoot, mTrayMgr, ReportFatalError(), and SBS_PROFILE_MAIN.
Referenced by Skyscraper::VM::Run().
|
private |
void Skyscraper::HAL::Report | ( | const std::string & | message, |
const std::string & | prompt ) |
Definition at line 219 of file hal.cpp.
References Skyscraper::VM::GetGUI(), Skyscraper::prompt, Skyscraper::GUI::ShowError(), and vm.
Referenced by Initialize(), Skyscraper::Skyscraper::keyPressed(), LoadSystem(), Skyscraper::EngineContext::Report(), Report(), Skyscraper::SkySystem::Report(), Skyscraper::VM::Report(), Skyscraper::GUI::ReportMissingFiles(), and Skyscraper::VM::ShowPlatform().
|
private |
Definition at line 944 of file hal.cpp.
References ReportError().
bool Skyscraper::HAL::ReportError | ( | const std::string & | message, |
const std::string & | prompt ) |
Definition at line 237 of file hal.cpp.
References Skyscraper::VM::GetGUI(), Skyscraper::prompt, Skyscraper::GUI::ShowError(), and vm.
Referenced by PlaySound(), Skyscraper::EngineContext::ReportError(), ReportError(), Skyscraper::SkySystem::ReportError(), Skyscraper::VM::ReportError(), and ReportFatalError().
|
private |
Definition at line 949 of file hal.cpp.
References ReportFatalError().
bool Skyscraper::HAL::ReportFatalError | ( | const std::string & | message, |
const std::string & | prompt ) |
Definition at line 256 of file hal.cpp.
References Skyscraper::VM::GetGUI(), Skyscraper::prompt, ReportError(), Skyscraper::GUI::ShowError(), and vm.
Referenced by ConfigLoad(), Skyscraper::StartScreen::DrawImage(), Initialize(), LoadSystem(), ReInit(), Render(), ReportFatalError(), Skyscraper::SkySystem::ReportFatalError(), and Skyscraper::VM::ReportFatalError().
void Skyscraper::HAL::StopSound | ( | ) |
Definition at line 731 of file hal.cpp.
References channel, and sound.
Referenced by Skyscraper::Skyscraper::Start().
void Skyscraper::HAL::ToggleStats | ( | ) |
Definition at line 750 of file hal.cpp.
References mTrayMgr, and show_stats.
Referenced by EnableStats().
void Skyscraper::HAL::UnclickedObject | ( | ) |
Definition at line 171 of file hal.cpp.
References SBS::SBS::camera, Skyscraper::VM::GetActiveEngine(), Skyscraper::EngineContext::GetSystem(), SBS::Camera::MouseLeftDown, SBS::Camera::MouseRightDown, SBS::Camera::UnclickedObject(), and vm.
void Skyscraper::HAL::UpdateOpenXR | ( | ) |
Definition at line 191 of file hal.cpp.
References SBS::SBS::camera, configfile, Skyscraper::VM::GetActiveEngine(), GetConfigBool(), SBS::Camera::GetOgreCamera(), SBS::Camera::GetPosition(), SBS::SceneNode::GetPosition(), SBS::Object::GetSceneNode(), Skyscraper::EngineContext::GetSystem(), SBS_PROFILE_MAIN, SetOpenXRParameters(), SBS::SBS::ToRemote(), and vm.
Referenced by Skyscraper::VM::Run().
|
private |
Definition at line 114 of file hal.h.
Referenced by HAL(), PlaySound(), and StopSound().
Ogre::ConfigFile* Skyscraper::HAL::configfile |
Definition at line 97 of file hal.h.
Referenced by Skyscraper::StartScreen::Click(), Skyscraper::GUI::CreateDebugPanel(), CreateRenderWindow(), Skyscraper::SkySystem::CreateSky(), Skyscraper::StartScreen::DrawBackground(), HAL(), Skyscraper::VM::Initialize(), Skyscraper::SkySystem::InitSky(), LoadConfiguration(), LoadSystem(), Skyscraper::Skyscraper::OnInit(), Skyscraper::ScriptProcessor::Section::Section(), Skyscraper::GUI::ShowConsole(), Skyscraper::GUI::ShowDebugPanel(), Skyscraper::Skyscraper::Start(), UpdateOpenXR(), and ~HAL().
bool Skyscraper::HAL::DisableSound |
Definition at line 89 of file hal.h.
Referenced by HAL(), and LoadSystem().
bool Skyscraper::HAL::DX11 |
Definition at line 94 of file hal.h.
Referenced by HAL(), LoadSystem(), and Skyscraper::EngineContext::StartSim().
Ogre::ConfigFile* Skyscraper::HAL::joyconfigfile |
Definition at line 99 of file hal.h.
Referenced by HAL(), LoadConfiguration(), and ~HAL().
Ogre::ConfigFile* Skyscraper::HAL::keyconfigfile |
Definition at line 98 of file hal.h.
Referenced by HAL(), LoadConfiguration(), and ~HAL().
|
private |
Definition at line 109 of file hal.h.
Referenced by HAL(), Initialize(), and ~HAL().
|
private |
Definition at line 108 of file hal.h.
Referenced by HAL(), Initialize(), and ~HAL().
std::vector<Ogre::Camera*> Skyscraper::HAL::mCameras |
Definition at line 90 of file hal.h.
Referenced by LoadSystem(), Skyscraper::VM::SetActiveEngine(), Skyscraper::Skyscraper::Start(), and Skyscraper::SkySystem::UpdateSky().
|
private |
Definition at line 105 of file hal.h.
Referenced by HAL(), Initialize(), LoadSystem(), ReInit(), and ~HAL().
Ogre::RenderWindow* Skyscraper::HAL::mRenderWindow |
Definition at line 92 of file hal.h.
Referenced by CreateRenderWindow(), DestroyRenderWindow(), GetRenderWindow(), HAL(), LoadSystem(), and ReInit().
Ogre::Root* Skyscraper::HAL::mRoot |
Definition at line 91 of file hal.h.
Referenced by CreateRenderWindow(), HAL(), Initialize(), Skyscraper::SkySystem::InitSky(), Skyscraper::Skyscraper::keyPressed(), LoadSystem(), Render(), and ~HAL().
|
private |
Definition at line 104 of file hal.h.
Referenced by Clear(), ClearScene(), GetSceneManager(), HAL(), LoadSystem(), and ReInit().
|
private |
Definition at line 124 of file hal.h.
Referenced by HAL(), LoadSystem(), ReInit(), Render(), and ToggleStats().
std::vector<Ogre::Viewport*> Skyscraper::HAL::mViewports |
Definition at line 93 of file hal.h.
Referenced by Skyscraper::SkySystem::InitSky(), LoadSystem(), and RefreshViewport().
std::string Skyscraper::HAL::Renderer |
Definition at line 88 of file hal.h.
Referenced by Skyscraper::CrashHandlerExceptionFilter(), Skyscraper::SkySystem::InitSky(), LoadSystem(), and Skyscraper::Stats::OnInit().
bool Skyscraper::HAL::RTSS |
Definition at line 87 of file hal.h.
Referenced by Clear(), HAL(), and LoadSystem().
|
private |
Definition at line 125 of file hal.h.
Referenced by EnableStats(), HAL(), ReInit(), and ToggleStats().
|
private |
Definition at line 113 of file hal.h.
Referenced by HAL(), PlaySound(), and StopSound().
|
private |
Definition at line 112 of file hal.h.
Referenced by Clear(), GetSoundSystem(), HAL(), LoadSystem(), PlaySound(), and ~HAL().
|
private |
Definition at line 128 of file hal.h.
Referenced by GetCurrentTime(), and HAL().
|
private |
Definition at line 130 of file hal.h.
Referenced by ClickedObject(), HAL(), Initialize(), LoadConfiguration(), messageLogged(), Report(), ReportError(), ReportFatalError(), UnclickedObject(), and UpdateOpenXR().