xoreos  0.0.5
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Engines::Sonic::SonicEngine Class Reference

#include <sonic.h>

Inheritance diagram for Engines::Sonic::SonicEngine:
Inheritance graph
[legend]
Collaboration diagram for Engines::Sonic::SonicEngine:
Collaboration graph
[legend]

Public Member Functions

 SonicEngine ()
 
 ~SonicEngine ()
 
bool detectLanguages (Aurora::GameID game, const Common::UString &target, Aurora::Platform platform, std::vector< Aurora::Language > &languages) const
 Detect which languages this game instance supports. More...
 
bool getLanguage (Aurora::Language &language) const
 Return the game's current language. More...
 
bool changeLanguage ()
 Change the game's current language. More...
 
GamegetGame ()
 Return the context running the actual game. More...
 
- Public Member Functions inherited from Engines::Engine
 Engine ()
 
virtual ~Engine ()
 
virtual bool detectLanguages (Aurora::GameID game, const Common::UString &target, Aurora::Platform platform, std::vector< Aurora::Language > &languagesText, std::vector< Aurora::Language > &languagesVoice) const
 Detect which languages this game instance supports. More...
 
bool detectLanguages (std::vector< Aurora::Language > &languages) const
 
bool detectLanguages (std::vector< Aurora::Language > &languagesText, std::vector< Aurora::Language > &languagesVoice) const
 
virtual bool getLanguage (Aurora::Language &languageText, Aurora::Language &languageVoice) const
 Return the game's current language. More...
 
void start (Aurora::GameID game, const Common::UString &target, Aurora::Platform platform)
 
void showFPS ()
 Evaluate the FPS display setting and show/hide the FPS display. More...
 

Protected Member Functions

void run ()
 Run the game. More...
 
- Protected Member Functions inherited from Engines::Engine
bool evaluateLanguage (bool find, Aurora::Language &language) const
 
bool evaluateLanguage (bool find, Aurora::Language &languageVoice, Aurora::Language &languageText) const
 

Private Member Functions

void init ()
 
void declareLanguages ()
 
void declareResources ()
 
void initResources (LoadProgress &progress)
 
void initConfig ()
 
void initGameConfig ()
 
void unloadLanguageFiles ()
 
void loadLanguageFiles (LoadProgress &progress, Aurora::Language language)
 
void loadLanguageFiles (Aurora::Language language)
 
void deinit ()
 

Static Private Member Functions

static Common::UString getLanguageHERF (Aurora::Language language)
 
static Common::UString getLanguageTLK (Aurora::Language language)
 

Private Attributes

Aurora::Language _language
 
Common::ChangeID _languageHERF
 
Common::ChangeID _languageTLK
 
Common::ScopedPtr< Game_game
 

Additional Inherited Members

- Protected Attributes inherited from Engines::Engine
Aurora::GameID _game
 
Aurora::Platform _platform
 
Common::UString _target
 
Common::ScopedPtr< Console_console
 
Common::ScopedPtr< Graphics::Aurora::FPS_fps
 

Detailed Description

Definition at line 44 of file sonic.h.

Constructor & Destructor Documentation

◆ SonicEngine()

Engines::Sonic::SonicEngine::SonicEngine ( )

Definition at line 62 of file sonic.cpp.

References Engines::Engine::_console.

◆ ~SonicEngine()

Engines::Sonic::SonicEngine::~SonicEngine ( )

Definition at line 66 of file sonic.cpp.

Member Function Documentation

◆ changeLanguage()

bool Engines::Sonic::SonicEngine::changeLanguage ( )
virtual

Change the game's current language.

Reimplemented from Engines::Engine.

Definition at line 140 of file sonic.cpp.

References _language, Engines::Engine::evaluateLanguage(), and loadLanguageFiles().

Here is the call graph for this function:

◆ declareLanguages()

void Engines::Sonic::SonicEngine::declareLanguages ( )
private

◆ declareResources()

void Engines::Sonic::SonicEngine::declareResources ( )
private

Definition at line 249 of file sonic.cpp.

References ARRAYSIZE, Engines::Sonic::kFiles, and ResMan.

Referenced by initResources().

Here is the caller graph for this function:

◆ deinit()

void Engines::Sonic::SonicEngine::deinit ( )
private

Definition at line 286 of file sonic.cpp.

References _game, and unloadLanguageFiles().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectLanguages()

bool Engines::Sonic::SonicEngine::detectLanguages ( Aurora::GameID  game,
const Common::UString target,
Aurora::Platform  platform,
std::vector< Aurora::Language > &  languages 
) const
virtual

Detect which languages this game instance supports.

Reimplemented from Engines::Engine.

Definition at line 111 of file sonic.cpp.

References Common::UString::empty(), getLanguageHERF(), getLanguageTLK(), Aurora::NDSFile::hasResource(), and Aurora::kLanguageMAX.

Here is the call graph for this function:

◆ getGame()

Game & Engines::Sonic::SonicEngine::getGame ( )

Return the context running the actual game.

Definition at line 164 of file sonic.cpp.

References _game.

Referenced by Engines::Sonic::Console::cmdGotoArea().

Here is the caller graph for this function:

◆ getLanguage()

bool Engines::Sonic::SonicEngine::getLanguage ( Aurora::Language language) const
virtual

Return the game's current language.

Reimplemented from Engines::Engine.

Definition at line 135 of file sonic.cpp.

References _language.

Referenced by Engines::Sonic::Game::Game(), and Engines::Sonic::Game::showQuote().

Here is the caller graph for this function:

◆ getLanguageHERF()

Common::UString Engines::Sonic::SonicEngine::getLanguageHERF ( Aurora::Language  language)
staticprivate

◆ getLanguageTLK()

Common::UString Engines::Sonic::SonicEngine::getLanguageTLK ( Aurora::Language  language)
staticprivate

◆ init()

void Engines::Sonic::SonicEngine::init ( )
private

◆ initConfig()

void Engines::Sonic::SonicEngine::initConfig ( )
private

Definition at line 280 of file sonic.cpp.

Referenced by init().

Here is the caller graph for this function:

◆ initGameConfig()

void Engines::Sonic::SonicEngine::initGameConfig ( )
private

Definition at line 283 of file sonic.cpp.

Referenced by init().

Here is the caller graph for this function:

◆ initResources()

void Engines::Sonic::SonicEngine::initResources ( LoadProgress progress)
private

Definition at line 228 of file sonic.cpp.

References _language, Engines::Engine::_target, declareResources(), FontMan, GfxMan, Engines::indexMandatoryArchive(), Graphics::Aurora::kFontFormatNFTR, Common::kHashDJB2, loadLanguageFiles(), Engines::registerModelLoader(), ResMan, and Engines::LoadProgress::step().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadLanguageFiles() [1/2]

void Engines::Sonic::SonicEngine::loadLanguageFiles ( LoadProgress progress,
Aurora::Language  language 
)
private

Definition at line 260 of file sonic.cpp.

References Common::UString::format(), LangMan, and Engines::LoadProgress::step().

Referenced by changeLanguage(), and initResources().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadLanguageFiles() [2/2]

void Engines::Sonic::SonicEngine::loadLanguageFiles ( Aurora::Language  language)
private

Definition at line 267 of file sonic.cpp.

References _languageHERF, _languageTLK, getLanguageHERF(), getLanguageTLK(), Engines::indexMandatoryArchive(), LangMan, TalkMan, and unloadLanguageFiles().

Here is the call graph for this function:

◆ run()

void Engines::Sonic::SonicEngine::run ( )
protectedvirtual

Run the game.

Implements Engines::Engine.

Definition at line 170 of file sonic.cpp.

References Engines::Engine::_console, _game, CursorMan, deinit(), EventMan, and init().

Here is the call graph for this function:

◆ unloadLanguageFiles()

void Engines::Sonic::SonicEngine::unloadLanguageFiles ( )
private

Definition at line 254 of file sonic.cpp.

References _languageHERF, _languageTLK, Engines::deindexResources(), and TalkMan.

Referenced by deinit(), and loadLanguageFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _game

Common::ScopedPtr<Game> Engines::Sonic::SonicEngine::_game
private

Definition at line 70 of file sonic.h.

Referenced by deinit(), getGame(), and run().

◆ _language

Aurora::Language Engines::Sonic::SonicEngine::_language
private

Definition at line 65 of file sonic.h.

Referenced by changeLanguage(), getLanguage(), init(), and initResources().

◆ _languageHERF

Common::ChangeID Engines::Sonic::SonicEngine::_languageHERF
private

Definition at line 67 of file sonic.h.

Referenced by loadLanguageFiles(), and unloadLanguageFiles().

◆ _languageTLK

Common::ChangeID Engines::Sonic::SonicEngine::_languageTLK
private

Definition at line 68 of file sonic.h.

Referenced by loadLanguageFiles(), and unloadLanguageFiles().


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