xoreos  0.0.5
sonic.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_SONIC_SONIC_H
26 #define ENGINES_SONIC_SONIC_H
27 
28 #include "src/common/scopedptr.h"
29 #include "src/common/ustring.h"
30 #include "src/common/changeid.h"
31 
32 #include "src/aurora/types.h"
33 
34 #include "src/engines/engine.h"
35 
36 namespace Engines {
37 
38 class LoadProgress;
39 
40 namespace Sonic {
41 
42 class Game;
43 
44 class SonicEngine : public Engines::Engine {
45 public:
46  SonicEngine();
47  ~SonicEngine();
48 
49  bool detectLanguages(Aurora::GameID game, const Common::UString &target,
50  Aurora::Platform platform,
51  std::vector<Aurora::Language> &languages) const;
52 
53  bool getLanguage(Aurora::Language &language) const;
54  bool changeLanguage();
55 
57  Game &getGame();
58 
59 
60 protected:
61  void run();
62 
63 
64 private:
66 
69 
71 
72 
73  void init();
74  void declareLanguages();
75  void declareResources();
76  void initResources(LoadProgress &progress);
77  void initConfig();
78  void initGameConfig();
79 
80  void unloadLanguageFiles();
81  void loadLanguageFiles(LoadProgress &progress, Aurora::Language language);
82  void loadLanguageFiles(Aurora::Language language);
83 
84  void deinit();
85 
86 
89 };
90 
91 } // End of namespace Sonic
92 
93 } // End of namespace Engines
94 
95 #endif // ENGINES_SONIC_SONIC_H
GameID
Definition: types.h:393
Generic engine interface.
A class holding an UTF-8 string.
Definition: ustring.h:48
void initResources(LoadProgress &progress)
Definition: sonic.cpp:228
bool changeLanguage()
Change the game&#39;s current language.
Definition: sonic.cpp:140
Aurora::Language _language
Definition: sonic.h:65
void run()
Run the game.
Definition: sonic.cpp:170
Language
Definition: language.h:46
A simple scoped smart pointer template.
bool getLanguage(Aurora::Language &language) const
Return the game&#39;s current language.
Definition: sonic.cpp:135
Helper class to represent an undoable change.
Game & getGame()
Return the context running the actual game.
Definition: sonic.cpp:164
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
static Common::UString getLanguageHERF(Aurora::Language language)
Definition: sonic.cpp:69
Unicode string handling.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
The base class for an engine within BioWare&#39;s Aurora family.
Definition: engine.h:49
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.
Definition: sonic.cpp:111
Common::ChangeID _languageTLK
Definition: sonic.h:68
A class representing an undoable change.
Definition: changeid.h:35
Common::ScopedPtr< Game > _game
Definition: sonic.h:70
Common::ChangeID _languageHERF
Definition: sonic.h:67
static Common::UString getLanguageTLK(Aurora::Language language)
Definition: sonic.cpp:90
void loadLanguageFiles(LoadProgress &progress, Aurora::Language language)
Definition: sonic.cpp:260
Platform
Definition: types.h:429