xoreos  0.0.5
witcher.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_WITCHER_WITCHER_H
26 #define ENGINES_WITCHER_WITCHER_H
27 
28 #include <list>
29 
30 #include "src/common/scopedptr.h"
31 #include "src/common/ustring.h"
32 #include "src/common/changeid.h"
33 
34 #include "src/aurora/types.h"
35 
36 #include "src/engines/engine.h"
37 
38 namespace Engines {
39 
40 class LoadProgress;
41 
42 namespace Witcher {
43 
44 class Game;
45 
47 public:
48  WitcherEngine();
50 
51  bool detectLanguages(Aurora::GameID game, const Common::UString &target,
52  Aurora::Platform platform,
53  std::vector<Aurora::Language> &languagesText,
54  std::vector<Aurora::Language> &languagesVoice) const;
55 
56  bool getLanguage(Aurora::Language &languageText, Aurora::Language &languageVoice) const;
57  bool changeLanguage();
58 
60  Game &getGame();
61 
62 
63 protected:
64  void run();
65 
66 
67 private:
70 
71  std::list<Common::ChangeID> _languageResources;
73 
75 
76 
77  void init();
78  void declareLanguages();
79  void initResources(LoadProgress &progress);
80  void initCursors();
81  void initConfig();
82  void initGameConfig();
83  void initLua();
84 
85  void unloadLanguageFiles();
86  void loadLanguageFiles(LoadProgress &progress, Aurora::Language langText, Aurora::Language langVoice);
87  void loadLanguageFiles(Aurora::Language langText, Aurora::Language langVoice);
88 
89  void deinit();
90 
91  void playIntroVideos();
92 };
93 
94 } // End of namespace Witcher
95 
96 } // End of namespace Engines
97 
98 #endif // ENGINES_WITCHER_WITCHER_H
GameID
Definition: types.h:393
Generic engine interface.
A class holding an UTF-8 string.
Definition: ustring.h:48
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.
Definition: witcher.cpp:66
Game & getGame()
Return the context running the actual game.
Definition: witcher.cpp:133
Common::ChangeID _languageTLK
Definition: witcher.h:72
bool changeLanguage()
Change the game&#39;s current language.
Definition: witcher.cpp:104
void run()
Run the game.
Definition: witcher.cpp:139
Language
Definition: language.h:46
std::list< Common::ChangeID > _languageResources
Definition: witcher.h:71
void initResources(LoadProgress &progress)
Definition: witcher.cpp:213
A simple scoped smart pointer template.
Helper class to represent an undoable change.
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
bool getLanguage(Aurora::Language &languageText, Aurora::Language &languageVoice) const
Return the game&#39;s current language.
Definition: witcher.cpp:97
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
Common::ScopedPtr< Game > _game
Definition: witcher.h:74
A class representing an undoable change.
Definition: changeid.h:35
void loadLanguageFiles(LoadProgress &progress, Aurora::Language langText, Aurora::Language langVoice)
Definition: witcher.cpp:289
Aurora::Language _languageVoice
Definition: witcher.h:69
Aurora::Language _languageText
Definition: witcher.h:68
Platform
Definition: types.h:429