61 _hasXP1(false), _hasXP2(false), _hasXP3(false) {
71 std::vector<Aurora::Language> &languages)
const {
89 languages.push_back(language);
139 progress.
step(
"Declare languages");
142 progress.
step(
"Detecting game version");
148 warning(
"Failed to detect this game's language");
152 progress.
step(
"Loading user game config");
164 progress.
step(
"Loading game cursors");
170 progress.
step(
"Initializing internal game config");
173 progress.
step(
"Successfully initialized the engine");
180 status(
"This is Neverwinter Nights %s v%s",
184 warning(
"Your version of Neverwinter Nights is too old");
185 warning(
"Please update to v%s for optimal support",
_version->getOptimumVersionString().c_str());
187 warning(
"Your version of Neverwinter Nights is too new!?");
188 warning(
"Please contact us with detailed information about your version");
192 warning(
"Failed to detect the patch version of your Neverwinter Nights installation");
210 LangMan.addLanguages(kLanguageDeclarations,
ARRAYSIZE(kLanguageDeclarations));
214 progress.
step(
"Setting base directory");
217 progress.
step(
"Adding extra archive directories");
224 progress.
step(
"Loading main KEY");
227 progress.
step(
"Loading expansions and patch KEYs");
247 progress.
step(
"Loading GUI textures");
252 progress.
step(
"Indexing extra sound resources");
254 progress.
step(
"Indexing extra music resources");
256 progress.
step(
"Indexing extra movie resources");
258 progress.
step(
"Indexing extra image resources");
260 progress.
step(
"Indexing extra talktables");
262 progress.
step(
"Indexing databases");
267 progress.
step(
"Indexing override files");
273 progress.
step(
"Loading main talk table");
274 TalkMan.addTable(
"dialog",
"dialogf",
false, 0);
276 progress.
step(
"Registering file formats");
288 static const char *
const kBogusTextures[] = {
318 for (
size_t i = 0; i <
ARRAYSIZE(kBogusTextures); i++)
319 TextureMan.addBogusTexture(kBogusTextures[i]);
323 CursorMan.add(
"gui_mp_defaultd" ,
"default",
"down");
324 CursorMan.add(
"gui_mp_defaultu" ,
"default",
"up" );
326 CursorMan.add(
"gui_mp_actiond" ,
"action" ,
"down");
327 CursorMan.add(
"gui_mp_actionu" ,
"action" ,
"up" );
328 CursorMan.add(
"gui_mp_attackd" ,
"attack" ,
"down");
329 CursorMan.add(
"gui_mp_attacku" ,
"attack" ,
"up" );
330 CursorMan.add(
"gui_mp_created" ,
"create" ,
"down");
331 CursorMan.add(
"gui_mp_createu" ,
"create" ,
"up" );
332 CursorMan.add(
"gui_mp_disarmd" ,
"disarm" ,
"down");
333 CursorMan.add(
"gui_mp_disarmu" ,
"disarm" ,
"up" );
334 CursorMan.add(
"gui_mp_doord" ,
"door" ,
"down");
335 CursorMan.add(
"gui_mp_dooru" ,
"door" ,
"up" );
336 CursorMan.add(
"gui_mp_examined" ,
"examine" ,
"down");
337 CursorMan.add(
"gui_mp_examineu" ,
"examine" ,
"up" );
338 CursorMan.add(
"gui_mp_followd" ,
"follow" ,
"down");
339 CursorMan.add(
"gui_mp_followu" ,
"follow" ,
"up" );
340 CursorMan.add(
"gui_mp_heald" ,
"heal" ,
"down");
341 CursorMan.add(
"gui_mp_healu" ,
"heal" ,
"up" );
342 CursorMan.add(
"gui_mp_killd" ,
"kill" ,
"down");
343 CursorMan.add(
"gui_mp_killu" ,
"kill" ,
"up" );
344 CursorMan.add(
"gui_mp_lockd" ,
"lock" ,
"down");
345 CursorMan.add(
"gui_mp_locku" ,
"lock" ,
"up" );
346 CursorMan.add(
"gui_mp_magicd" ,
"magic" ,
"down");
347 CursorMan.add(
"gui_mp_magicu" ,
"magic" ,
"up" );
348 CursorMan.add(
"gui_mp_pickupd" ,
"pickup" ,
"down");
349 CursorMan.add(
"gui_mp_pickupu" ,
"pickup" ,
"up" );
350 CursorMan.add(
"gui_mp_pushpind" ,
"pushpin" ,
"down");
351 CursorMan.add(
"gui_mp_pushpinu" ,
"pushpin" ,
"up" );
352 CursorMan.add(
"gui_mp_talkd" ,
"talk" ,
"down");
353 CursorMan.add(
"gui_mp_talku" ,
"talk" ,
"up" );
354 CursorMan.add(
"gui_mp_transd" ,
"trans" ,
"down");
355 CursorMan.add(
"gui_mp_transu" ,
"trans" ,
"up" );
356 CursorMan.add(
"gui_mp_used" ,
"use" ,
"down");
357 CursorMan.add(
"gui_mp_useu" ,
"use" ,
"up" );
358 CursorMan.add(
"gui_mp_walkd" ,
"walk" ,
"down");
359 CursorMan.add(
"gui_mp_walku" ,
"walk" ,
"up" );
361 CursorMan.add(
"gui_mp_noactiond",
"noaction" ,
"down");
362 CursorMan.add(
"gui_mp_noactionu",
"noaction" ,
"up" );
363 CursorMan.add(
"gui_mp_noatckd" ,
"noattack" ,
"down");
364 CursorMan.add(
"gui_mp_noatcku" ,
"noattack" ,
"up" );
365 CursorMan.add(
"gui_mp_nocreatd" ,
"nocreate" ,
"down");
366 CursorMan.add(
"gui_mp_nocreatu" ,
"nocreate" ,
"up" );
367 CursorMan.add(
"gui_mp_nodisarmd",
"nodisarm" ,
"down");
368 CursorMan.add(
"gui_mp_nodisarmu",
"nodisarm" ,
"up" );
369 CursorMan.add(
"gui_mp_noexamd" ,
"noexamine",
"down");
370 CursorMan.add(
"gui_mp_noexamu" ,
"noexamine",
"up" );
371 CursorMan.add(
"gui_mp_noheald" ,
"noheal" ,
"down");
372 CursorMan.add(
"gui_mp_nohealu" ,
"noheal" ,
"up" );
373 CursorMan.add(
"gui_mp_nokilld" ,
"nokill" ,
"down");
374 CursorMan.add(
"gui_mp_nokillu" ,
"nokill" ,
"up" );
375 CursorMan.add(
"gui_mp_nolockd" ,
"nolock" ,
"down");
376 CursorMan.add(
"gui_mp_nolocku" ,
"nolock" ,
"up" );
377 CursorMan.add(
"gui_mp_nomagicd" ,
"nomagic" ,
"down");
378 CursorMan.add(
"gui_mp_nomagicu" ,
"nomagic" ,
"up" );
379 CursorMan.add(
"gui_mp_notalkd" ,
"notalk" ,
"down");
380 CursorMan.add(
"gui_mp_notalku" ,
"notalk" ,
"up" );
381 CursorMan.add(
"gui_mp_noused" ,
"nouse" ,
"down");
382 CursorMan.add(
"gui_mp_nouseu" ,
"nouse" ,
"up" );
383 CursorMan.add(
"gui_mp_nowalkd" ,
"nowalk" ,
"down");
384 CursorMan.add(
"gui_mp_nowalku" ,
"nowalk" ,
"up" );
386 CursorMan.add(
"gui_mp_arwalk00",
"arrowwalk",
"N");
387 CursorMan.add(
"gui_mp_arwalk01",
"arrowwalk",
"NNE");
388 CursorMan.add(
"gui_mp_arwalk02",
"arrowwalk",
"NE");
389 CursorMan.add(
"gui_mp_arwalk03",
"arrowwalk",
"ENE");
390 CursorMan.add(
"gui_mp_arwalk04",
"arrowwalk",
"E");
391 CursorMan.add(
"gui_mp_arwalk05",
"arrowwalk",
"ESE");
392 CursorMan.add(
"gui_mp_arwalk06",
"arrowwalk",
"SE");
393 CursorMan.add(
"gui_mp_arwalk07",
"arrowwalk",
"SSE");
394 CursorMan.add(
"gui_mp_arwalk08",
"arrowwalk",
"S");
395 CursorMan.add(
"gui_mp_arwalk09",
"arrowwalk",
"SSW");
396 CursorMan.add(
"gui_mp_arwalk10",
"arrowwalk",
"SW");
397 CursorMan.add(
"gui_mp_arwalk11",
"arrowwalk",
"WSW");
398 CursorMan.add(
"gui_mp_arwalk12",
"arrowwalk",
"W");
399 CursorMan.add(
"gui_mp_arwalk13",
"arrowwalk",
"WNW");
400 CursorMan.add(
"gui_mp_arwalk14",
"arrowwalk",
"NW");
401 CursorMan.add(
"gui_mp_arwalk15",
"arrowwalk",
"NNW");
403 CursorMan.add(
"gui_mp_arrun00",
"arrowrun",
"N");
404 CursorMan.add(
"gui_mp_arrun01",
"arrowrun",
"NNE");
405 CursorMan.add(
"gui_mp_arrun02",
"arrowrun",
"NE");
406 CursorMan.add(
"gui_mp_arrun03",
"arrowrun",
"ENE");
407 CursorMan.add(
"gui_mp_arrun04",
"arrowrun",
"E");
408 CursorMan.add(
"gui_mp_arrun05",
"arrowrun",
"ESE");
409 CursorMan.add(
"gui_mp_arrun06",
"arrowrun",
"SE");
410 CursorMan.add(
"gui_mp_arrun07",
"arrowrun",
"SSE");
411 CursorMan.add(
"gui_mp_arrun08",
"arrowrun",
"S");
412 CursorMan.add(
"gui_mp_arrun09",
"arrowrun",
"SSW");
413 CursorMan.add(
"gui_mp_arrun10",
"arrowrun",
"SW");
414 CursorMan.add(
"gui_mp_arrun11",
"arrowrun",
"WSW");
415 CursorMan.add(
"gui_mp_arrun12",
"arrowrun",
"W");
416 CursorMan.add(
"gui_mp_arrun13",
"arrowrun",
"WNW");
417 CursorMan.add(
"gui_mp_arrun14",
"arrowrun",
"NW");
418 CursorMan.add(
"gui_mp_arrun15",
"arrowrun",
"NNW");
448 TokenMan.set(
"<StartCheck>" ,
"<cFF0000FF>");
449 TokenMan.set(
"<StartAction>" ,
"<c00FF00FF>");
450 TokenMan.set(
"<StartHighlight>",
"<c0000FFFF>");
#define ResMan
Shortcut for accessing the sound manager.
Aurora::Platform _platform
bool getLanguage(Aurora::Language &language) const
Return the game's current language.
void playVideo(const Common::UString &video)
Play this video resource.
Generic Aurora engines resource utility functions.
#define TalkMan
Shortcut for accessing the talk manager.
Engine class handling Neverwinter Nights.
A class holding an UTF-8 string.
Temporary game settings/properties.
#define TextureMan
Shortcut for accessing the texture manager.
Common::ScopedPtr< Game > _game
The global config manager.
Common::ScopedPtr< Console > _console
bool indexOptionalArchive(const Common::UString &file, uint32 priority, const std::vector< byte > &password, Common::ChangeID *changeID)
The Aurora texture manager.
bool evaluateLanguage(bool find, Aurora::Language &language) const
Game & getGame()
Return the context running the actual game.
Utility functions to handle files used in BioWare's Aurora engine.
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
Neverwinter Nights installation version detection.
Aurora::Language _language
bool indexOptionalDirectory(const Common::UString &dir, const char *glob, int depth, uint32 priority, Common::ChangeID *changeID)
Add a directory to the resource manager, if it exists.
void declareBogusTextures()
UString findFirst(const UString &str, bool caseInsensitive) const
Find the first file ending with the given string.
void indexMandatoryArchive(const Common::UString &file, uint32 priority, const std::vector< byte > &password, Common::ChangeID *changeID)
Neverwinter Nights (debug) console.
Neverwinter Nights model loader.
#define ConfigMan
Shortcut for accessing the config manager.
Windows codepage 950 (Traditional Chinese, similar to Big5).
Utility templates and functions.
void initResources(LoadProgress &progress)
void unregisterModelLoader()
The global events manager.
Types and functions related to language.
bool changeLanguage()
Change the game's current language.
bool empty() const
Is the string empty?
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.
Handling BioWare's TLK talk tables.
void warning(const char *s,...)
#define CursorMan
Shortcut for accessing the cursor manager.
#define EventMan
Shortcut for accessing the events manager.
The Aurora cursor manager.
Displaying the progress in loading a game.
Textured font, used by NWN and KotOR/KotOR2.
Common::ScopedPtr< Version > _version
void indexMandatoryDirectory(const Common::UString &dir, const char *glob, int depth, uint32 priority, Common::ChangeID *changeID)
Add a directory to the resource manager, erroring out if it does not exist.
void registerModelLoader(ModelLoader *loader)
Application or game defaults.
#define LangMan
Shortcut for accessing the language manager.
Windows codepage 932 (Japanese, extended Shift-JIS).
The global talk manager for Aurora strings.
void step(const Common::UString &description)
Take a step in advancing the progress.
void status(const char *s,...)
void checkConfigInt(const Common::UString &key, int min, int max)
Make sure that an int config value is in the right range.
Windows codepage 1250 (Eastern European, Latin alphabet).
bool addDirectory(const UString &directory, int recurseDepth=0)
Add a directory to the list.
Generic Aurora engines utility functions.
The context handling the gameplay in Neverwinter Nights.
Windows codepage 1252 (Western European, Latin alphabet).
Manager for tokens in Aurora engines text strings.
Windows codepage 949 (Korean, similar to EUC-KR).
uint32 getLanguageID() const
Return the language ID (ungendered) of the talk table.
Windows codepage 936 (Simplified Chinese, extended GB2312 with GBK codepoints).
#define TokenMan
Shortcut for accessing the token manager.
Texture, DirectDraw Surface.
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
#define FontMan
Shortcut for accessing the font manager.
static UString findSubDirectory(const UString &directory, const UString &subDirectory, bool caseInsensitive=false)
Find a directory's subdirectory.
Generic Aurora engines model functions.