Skyscraper 2.0
Skyscraper::HAL Class Reference

#include <hal.h>

Inheritance diagram for Skyscraper::HAL:
Collaboration diagram for Skyscraper::HAL:

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 &params)
 
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
 
VMvm
 

Detailed Description

Definition at line 51 of file hal.h.

Constructor & Destructor Documentation

◆ HAL()

Skyscraper::HAL::HAL ( VM * vm)

◆ ~HAL()

Skyscraper::HAL::~HAL ( )

Definition at line 91 of file hal.cpp.

References configfile, joyconfigfile, keyconfigfile, log, logger, mOverlaySystem, mRoot, and soundsys.

Member Function Documentation

◆ Clear()

void Skyscraper::HAL::Clear ( )

Definition at line 852 of file hal.cpp.

References mSceneMgr, ReInit(), RTSS, and soundsys.

Here is the call graph for this function:

◆ ClearScene()

void Skyscraper::HAL::ClearScene ( )

Definition at line 743 of file hal.cpp.

References mSceneMgr.

Referenced by Skyscraper::VM::Initialize().

◆ ClickedObject()

void Skyscraper::HAL::ClickedObject ( bool left,
bool shift,
bool ctrl,
bool alt,
bool right,
Real scale,
bool center_only )

◆ ConfigLoad()

Ogre::ConfigFile * Skyscraper::HAL::ConfigLoad ( const std::string & filename,
bool delete_after_use = false )
private

Definition at line 265 of file hal.cpp.

References ReportFatalError().

Referenced by LoadConfiguration().

Here is the call graph for this function:

◆ ConsoleOut()

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().

Here is the call graph for this function:

◆ CreateRenderWindow()

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.

Here is the call graph for this function:

◆ DestroyRenderWindow()

void Skyscraper::HAL::DestroyRenderWindow ( )

Definition at line 920 of file hal.cpp.

References mRenderWindow.

◆ EnableStats()

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().

Here is the call graph for this function:

◆ GetColors()

std::string Skyscraper::HAL::GetColors ( const std::string & color)

Definition at line 993 of file hal.cpp.

Referenced by ConsoleOut().

◆ GetConfigBool()

bool Skyscraper::HAL::GetConfigBool ( Ogre::ConfigFile * file,
const std::string & key,
bool default_value )

◆ GetConfigFloat()

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().

Here is the call graph for this function:

◆ GetConfigInt()

int Skyscraper::HAL::GetConfigInt ( Ogre::ConfigFile * file,
const std::string & key,
int default_value )

◆ GetConfigString()

std::string Skyscraper::HAL::GetConfigString ( Ogre::ConfigFile * file,
const std::string & key,
const std::string & default_value )

◆ GetCurrentTime()

unsigned long Skyscraper::HAL::GetCurrentTime ( )

◆ GetRenderWindow()

Ogre::RenderWindow * Skyscraper::HAL::GetRenderWindow ( )

Definition at line 847 of file hal.cpp.

References mRenderWindow.

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

◆ GetSceneManager()

Ogre::SceneManager * Skyscraper::HAL::GetSceneManager ( )

◆ GetSoundSystem()

FMOD::System * Skyscraper::HAL::GetSoundSystem ( )

Definition at line 842 of file hal.cpp.

References soundsys.

Referenced by Skyscraper::VM::CreateEngine().

◆ Initialize()

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().

Here is the call graph for this function:

◆ LoadConfiguration()

void Skyscraper::HAL::LoadConfiguration ( const std::string data_path,
bool show_console )

◆ LoadSystem()

bool Skyscraper::HAL::LoadSystem ( const std::string & data_path,
Ogre::RenderWindow * renderwindow )

◆ messageLogged()

void Skyscraper::HAL::messageLogged ( const std::string & message,
Ogre::LogMessageLevel lml,
bool maskDebug,
const std::string & logName,
bool & skipThisMessage )
private

Definition at line 976 of file hal.cpp.

References Skyscraper::VM::GetGUI(), vm, and Skyscraper::GUI::WriteToConsole().

Here is the call graph for this function:

◆ PlaySound()

bool Skyscraper::HAL::PlaySound ( const std::string & filename,
Real volume = 1.0 )

Definition at line 696 of file hal.cpp.

References channel, ReportError(), sound, and soundsys.

Here is the call graph for this function:

◆ RefreshViewport()

void Skyscraper::HAL::RefreshViewport ( )

◆ ReInit()

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().

Here is the call graph for this function:

◆ Render()

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().

Here is the call graph for this function:

◆ Report() [1/2]

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

Definition at line 939 of file hal.cpp.

References Report().

Here is the call graph for this function:

◆ Report() [2/2]

void Skyscraper::HAL::Report ( const std::string & message,
const std::string & prompt )

◆ ReportError() [1/2]

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

Definition at line 944 of file hal.cpp.

References ReportError().

Here is the call graph for this function:

◆ ReportError() [2/2]

bool Skyscraper::HAL::ReportError ( const std::string & message,
const std::string & prompt )

◆ ReportFatalError() [1/2]

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

Definition at line 949 of file hal.cpp.

References ReportFatalError().

Here is the call graph for this function:

◆ ReportFatalError() [2/2]

bool Skyscraper::HAL::ReportFatalError ( const std::string & message,
const std::string & prompt )

◆ StopSound()

void Skyscraper::HAL::StopSound ( )

Definition at line 731 of file hal.cpp.

References channel, and sound.

Referenced by Skyscraper::Skyscraper::Start().

◆ ToggleStats()

void Skyscraper::HAL::ToggleStats ( )

Definition at line 750 of file hal.cpp.

References mTrayMgr, and show_stats.

Referenced by EnableStats().

◆ UnclickedObject()

void Skyscraper::HAL::UnclickedObject ( )

◆ UpdateOpenXR()

Member Data Documentation

◆ channel

FMOD::Channel* Skyscraper::HAL::channel
private

Definition at line 114 of file hal.h.

Referenced by HAL(), PlaySound(), and StopSound().

◆ configfile

◆ DisableSound

bool Skyscraper::HAL::DisableSound

Definition at line 89 of file hal.h.

Referenced by HAL(), and LoadSystem().

◆ DX11

bool Skyscraper::HAL::DX11

Definition at line 94 of file hal.h.

Referenced by HAL(), LoadSystem(), and Skyscraper::EngineContext::StartSim().

◆ joyconfigfile

Ogre::ConfigFile* Skyscraper::HAL::joyconfigfile

Definition at line 99 of file hal.h.

Referenced by HAL(), LoadConfiguration(), and ~HAL().

◆ keyconfigfile

Ogre::ConfigFile* Skyscraper::HAL::keyconfigfile

Definition at line 98 of file hal.h.

Referenced by HAL(), LoadConfiguration(), and ~HAL().

◆ log

Ogre::Log* Skyscraper::HAL::log
private

Definition at line 109 of file hal.h.

Referenced by HAL(), Initialize(), and ~HAL().

◆ logger

Ogre::LogManager* Skyscraper::HAL::logger
private

Definition at line 108 of file hal.h.

Referenced by HAL(), Initialize(), and ~HAL().

◆ mCameras

std::vector<Ogre::Camera*> Skyscraper::HAL::mCameras

◆ mOverlaySystem

Ogre::OverlaySystem* Skyscraper::HAL::mOverlaySystem
private

Definition at line 105 of file hal.h.

Referenced by HAL(), Initialize(), LoadSystem(), ReInit(), and ~HAL().

◆ mRenderWindow

Ogre::RenderWindow* Skyscraper::HAL::mRenderWindow

Definition at line 92 of file hal.h.

Referenced by CreateRenderWindow(), DestroyRenderWindow(), GetRenderWindow(), HAL(), LoadSystem(), and ReInit().

◆ mRoot

Ogre::Root* Skyscraper::HAL::mRoot

◆ mSceneMgr

Ogre::SceneManager* Skyscraper::HAL::mSceneMgr
private

Definition at line 104 of file hal.h.

Referenced by Clear(), ClearScene(), GetSceneManager(), HAL(), LoadSystem(), and ReInit().

◆ mTrayMgr

OgreBites::TrayManager* Skyscraper::HAL::mTrayMgr
private

Definition at line 124 of file hal.h.

Referenced by HAL(), LoadSystem(), ReInit(), Render(), and ToggleStats().

◆ mViewports

std::vector<Ogre::Viewport*> Skyscraper::HAL::mViewports

Definition at line 93 of file hal.h.

Referenced by Skyscraper::SkySystem::InitSky(), LoadSystem(), and RefreshViewport().

◆ Renderer

std::string Skyscraper::HAL::Renderer

◆ RTSS

bool Skyscraper::HAL::RTSS

Definition at line 87 of file hal.h.

Referenced by Clear(), HAL(), and LoadSystem().

◆ show_stats

int Skyscraper::HAL::show_stats
private

Definition at line 125 of file hal.h.

Referenced by EnableStats(), HAL(), ReInit(), and ToggleStats().

◆ sound

FMOD::Sound* Skyscraper::HAL::sound
private

Definition at line 113 of file hal.h.

Referenced by HAL(), PlaySound(), and StopSound().

◆ soundsys

FMOD::System* Skyscraper::HAL::soundsys
private

Definition at line 112 of file hal.h.

Referenced by Clear(), GetSoundSystem(), HAL(), LoadSystem(), PlaySound(), and ~HAL().

◆ timer

Ogre::Timer* Skyscraper::HAL::timer
private

Definition at line 128 of file hal.h.

Referenced by GetCurrentTime(), and HAL().

◆ vm

VM* Skyscraper::HAL::vm
private

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