xoreos
0.0.5
|
An IFO (module information) file, describing global module properties in many Aurora games. More...
#include <ifofile.h>
Public Member Functions | |
IFOFile () | |
~IFOFile () | |
void | load (Common::SeekableReadStream *stream, bool repairNWNPremium=false) |
Take over this stream and load an IFO out of it. More... | |
void | load (bool repairNWNPremium=false) |
Load the currently available module.ifo. More... | |
void | unload () |
Unload a currently loaded IFO. More... | |
const GFF3Struct * | getGFF () const |
Return the IFO's GFF struct. More... | |
uint32 | getVersion () const |
Return the version of this IFO file. More... | |
uint32 | getCreatorID () const |
Return the ID of the IFO file creator. More... | |
bool | isSave () const |
Is the module a save file? More... | |
const Common::UString & | getTag () const |
Return the module's tag. More... | |
const LocString & | getName () const |
Return the name of the module. More... | |
const LocString & | getDescription () const |
Return the description of the module. More... | |
const Common::UString & | getTLK () const |
Return the custom TLK table this module uses. More... | |
void | getMinVersion (int &major, int &minor) const |
Return the minimum game version the module needs to run. More... | |
uint16 | getExpansions () const |
Return the list of required expansions. More... | |
const std::vector< Common::UString > & | getHAKs () const |
Return the list of required HAK files. More... | |
const Common::UString & | getStartMovie () const |
Return the starting movie. More... | |
const Common::UString & | getEntryArea () const |
Return the entry area. More... | |
void | getEntryPosition (float &x, float &y, float &z) const |
Return the entry position. More... | |
void | getEntryDirection (float &x, float &y) const |
Return the entry direction. More... | |
const std::vector< Common::UString > & | getAreas () const |
Return the list of areas in the module. More... | |
const std::vector< Common::UString > & | getNSSCache () const |
Return the list of NSS (script) files that should be cached. More... | |
const std::vector< Common::UString > & | getQuests () const |
Returns the list of quests used in the module. More... | |
const std::vector< Common::UString > & | getQuestDBs () const |
Returns the list of quest databases used in the module. More... | |
const std::vector< Common::UString > & | getStoryNPCs () const |
Returns the list of story NPCs used in the module. More... | |
const std::vector< Common::UString > & | getMonsterNPCs () const |
Returns the list of monster NPCs used in the module. More... | |
void | getStartTime (uint8 &hour, uint8 &day, uint8 &month, uint32 &year) const |
Return the module's starting time. More... | |
uint8 | getDawnHour () const |
Return the hour dawn starts. More... | |
uint8 | getDuskHour () const |
Return the hour dusk starts. More... | |
uint32 | getMinutesPerHour () const |
Return the number of real time minutes per game hour. More... | |
int32 | getMinWeatherIntensity () const |
Return the minimum weather intensity. More... | |
int32 | getMaxWeatherIntensity () const |
Return the maximum weather intensity. More... | |
int32 | getRainChance () const |
Return the chance that it's going to rain. More... | |
int32 | getSnowChance () const |
Return the chance that it's going to snow. More... | |
float | getXPScale () const |
Get the number creature kill XP is multiplied by. More... | |
Private Member Functions | |
void | clear () |
void | parseVersion (const Common::UString &version) |
Private Attributes | |
Common::ScopedPtr< GFF3File > | _gff |
The module.ifo GFF. More... | |
byte | _id [32] |
The module's unique ID. More... | |
Common::UString | _tag |
The module's tag. More... | |
LocString | _name |
The module's localized name. More... | |
LocString | _description |
The module's localized description. More... | |
uint32 | _version |
Version of this IFO file. More... | |
uint32 | _creatorID |
ID of the IFO file creator. More... | |
int | _minVersionMajor |
Minimum major game version this module needs. More... | |
int | _minVersionMinor |
Minimum minor game version this module needs. More... | |
uint16 | _expansions |
Bitfield of required expansions. More... | |
bool | _isSave |
Is this module a save? More... | |
Common::UString | _customTLK |
The custom TLK the module uses. More... | |
Common::UString | _startMovie |
The movie the module starts with. More... | |
Common::UString | _entryArea |
The area the PC starts in. More... | |
float | _entryX |
The X position the PC starts in. More... | |
float | _entryY |
The Y position the PC starts in. More... | |
float | _entryZ |
The Z position the PC starts in. More... | |
float | _entryDirX |
The X orientation the PC starts in. More... | |
float | _entryDirY |
The Y orientation the PC starts in. More... | |
std::vector< Common::UString > | _haks |
HAKs required by the module. More... | |
std::vector< Common::UString > | _areas |
Areas found in the module. More... | |
std::vector< Common::UString > | _nssCache |
Scripts that should be cached. More... | |
std::vector< Common::UString > | _quests |
List of quests used in the module. More... | |
std::vector< Common::UString > | _questDBs |
List of quest databases used in the module. More... | |
std::vector< Common::UString > | _storyNPCs |
List of story NPCs used in the module. More... | |
std::vector< Common::UString > | _monsterNPCs |
List of monster NPCs used in the module. More... | |
uint8 | _hourDawn |
The hour dawn starts. More... | |
uint8 | _hourDusk |
The hour dusk starts. More... | |
uint8 | _minutesPerHour |
Number of real time minutes per game hour. More... | |
uint8 | _startHour |
Hour the module starts. More... | |
uint8 | _startDay |
Day the module starts. More... | |
uint8 | _startMonth |
Month the module starts. More... | |
uint32 | _startYear |
Year the module starts. More... | |
int32 | _minWeatherIntensity |
Minimum weather intensity. More... | |
int32 | _maxWeatherIntensity |
Maximum weather intensity. More... | |
int32 | _rainChance |
Chance for rain. More... | |
int32 | _snowChance |
Chance for snow. More... | |
float | _xpScale |
The number creature kill XP is multiplied by. More... | |
An IFO (module information) file, describing global module properties in many Aurora games.
Information commonly found in IFO files include: the name and description
The base file format of an IFO file is a GFF3.
Especially for Neverwinter Nights, Neverwinter Nights 2 and The Witcher, this file is serves as the global description of the module file as a whole, even more so if this is a standalone adventure module.
In the two Knights of the Old Republic games, the IFO file is less important, but still contains vital information.
Jade Empire does not use an IFO file. Neither do Sonic Chronicles or the two Dragon Age games.
Aurora::IFOFile::IFOFile | ( | ) |
Definition at line 44 of file ifofile.cpp.
References clear().
Aurora::IFOFile::~IFOFile | ( | ) |
Definition at line 48 of file ifofile.cpp.
|
private |
Definition at line 51 of file ifofile.cpp.
References _areas, _customTLK, _description, _entryArea, _entryDirX, _entryDirY, _entryX, _entryY, _entryZ, _expansions, _gff, _haks, _hourDawn, _hourDusk, _id, _isSave, _minutesPerHour, _minVersionMajor, _minVersionMinor, _name, _nssCache, _startDay, _startHour, _startMonth, _startMovie, _startYear, _tag, _xpScale, Aurora::LocString::clear(), and Common::UString::clear().
Referenced by IFOFile(), and unload().
const std::vector< Common::UString > & Aurora::IFOFile::getAreas | ( | ) | const |
Return the list of areas in the module.
Definition at line 311 of file ifofile.cpp.
References _areas.
Referenced by Engines::NWN2::Console::cmdGotoArea(), Engines::Witcher::Console::cmdGotoArea(), Engines::NWN::Console::cmdGotoArea(), Engines::NWN2::Console::cmdListAreas(), Engines::Witcher::Console::cmdListAreas(), Engines::NWN::Console::cmdListAreas(), Engines::Witcher::Module::loadAreas(), Engines::NWN2::Module::loadAreas(), Engines::NWN::Module::loadAreas(), Engines::NWN2::Console::updateAreas(), Engines::Witcher::Console::updateAreas(), and Engines::NWN::Console::updateAreas().
uint32 Aurora::IFOFile::getCreatorID | ( | ) | const |
Return the ID of the IFO file creator.
Definition at line 255 of file ifofile.cpp.
References _creatorID.
uint8 Aurora::IFOFile::getDawnHour | ( | ) | const |
const LocString & Aurora::IFOFile::getDescription | ( | ) | const |
Return the description of the module.
Definition at line 271 of file ifofile.cpp.
References _description.
uint8 Aurora::IFOFile::getDuskHour | ( | ) | const |
const Common::UString & Aurora::IFOFile::getEntryArea | ( | ) | const |
Return the entry area.
Definition at line 292 of file ifofile.cpp.
References _entryArea.
Referenced by Engines::NWN2::Module::enter(), Engines::NWN::Module::enter(), Engines::Witcher::Module::getEntryIFOLocation(), Engines::KotOR2::Module::loadArea(), and Engines::KotOR::Module::loadArea().
void Aurora::IFOFile::getEntryDirection | ( | float & | x, |
float & | y | ||
) | const |
Return the entry direction.
Definition at line 302 of file ifofile.cpp.
References _entryDirX, and _entryDirY.
Referenced by Engines::NWN2::Module::enter(), Engines::NWN::Module::enter(), Engines::Witcher::Module::getEntryIFOLocation(), Engines::KotOR2::Module::getEntryIFOLocation(), and Engines::KotOR::Module::getEntryIFOLocation().
void Aurora::IFOFile::getEntryPosition | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
Return the entry position.
Definition at line 296 of file ifofile.cpp.
References _entryX, _entryY, and _entryZ.
Referenced by Engines::NWN2::Module::enter(), Engines::NWN::Module::enter(), Engines::Witcher::Module::getEntryIFOLocation(), Engines::KotOR2::Module::getEntryIFOLocation(), and Engines::KotOR::Module::getEntryIFOLocation().
uint16 Aurora::IFOFile::getExpansions | ( | ) | const |
Return the list of required expansions.
This is a bitfield, storing the information whether expansion 1 to expansion 16 is required, from LSB to MSB. If the Nth bit is set, the expansion N is required. Otherwise, it isn't.
Definition at line 284 of file ifofile.cpp.
References _expansions.
Referenced by Engines::NWN2::Module::checkXPs(), and Engines::NWN::Module::checkXPs().
const GFF3Struct * Aurora::IFOFile::getGFF | ( | ) | const |
Return the IFO's GFF struct.
Definition at line 244 of file ifofile.cpp.
References _gff.
Referenced by Engines::KotOR2::Module::loadIFO(), Engines::KotOR::Module::loadIFO(), Engines::Witcher::Module::loadModule(), Engines::NWN2::Module::loadModule(), and Engines::NWN::Module::loadModule().
const std::vector< Common::UString > & Aurora::IFOFile::getHAKs | ( | ) | const |
Return the list of required HAK files.
A HAK file is an extra ERF resource archive that contains resources used by this module.
Definition at line 307 of file ifofile.cpp.
References _haks.
Referenced by Engines::NWN2::Module::checkHAKs(), Engines::NWN::Module::checkHAKs(), Engines::NWN2::Module::loadHAKs(), and Engines::NWN::Module::loadHAKs().
int32 Aurora::IFOFile::getMaxWeatherIntensity | ( | ) | const |
Return the maximum weather intensity.
Definition at line 358 of file ifofile.cpp.
References _maxWeatherIntensity.
uint32 Aurora::IFOFile::getMinutesPerHour | ( | ) | const |
Return the number of real time minutes per game hour.
Definition at line 350 of file ifofile.cpp.
References _minutesPerHour.
void Aurora::IFOFile::getMinVersion | ( | int & | major, |
int & | minor | ||
) | const |
Return the minimum game version the module needs to run.
Definition at line 279 of file ifofile.cpp.
References _minVersionMajor, and _minVersionMinor.
int32 Aurora::IFOFile::getMinWeatherIntensity | ( | ) | const |
Return the minimum weather intensity.
Definition at line 354 of file ifofile.cpp.
References _minWeatherIntensity.
const std::vector< Common::UString > & Aurora::IFOFile::getMonsterNPCs | ( | ) | const |
Returns the list of monster NPCs used in the module.
Definition at line 331 of file ifofile.cpp.
References _monsterNPCs.
const LocString & Aurora::IFOFile::getName | ( | ) | const |
Return the name of the module.
Definition at line 267 of file ifofile.cpp.
References _name.
Referenced by Engines::NWN::Module::enter(), Engines::KotOR2::Module::loadIFO(), Engines::KotOR::Module::loadIFO(), Engines::Witcher::Module::loadModule(), Engines::NWN2::Module::loadModule(), and Engines::NWN::Module::loadModule().
const std::vector< Common::UString > & Aurora::IFOFile::getNSSCache | ( | ) | const |
Return the list of NSS (script) files that should be cached.
Definition at line 315 of file ifofile.cpp.
References _nssCache.
const std::vector< Common::UString > & Aurora::IFOFile::getQuestDBs | ( | ) | const |
Returns the list of quest databases used in the module.
Definition at line 323 of file ifofile.cpp.
References _questDBs.
const std::vector< Common::UString > & Aurora::IFOFile::getQuests | ( | ) | const |
Returns the list of quests used in the module.
Definition at line 319 of file ifofile.cpp.
References _quests.
int32 Aurora::IFOFile::getRainChance | ( | ) | const |
Return the chance that it's going to rain.
Definition at line 362 of file ifofile.cpp.
References _rainChance.
int32 Aurora::IFOFile::getSnowChance | ( | ) | const |
Return the chance that it's going to snow.
Definition at line 366 of file ifofile.cpp.
References _snowChance.
const Common::UString & Aurora::IFOFile::getStartMovie | ( | ) | const |
Return the starting movie.
Definition at line 288 of file ifofile.cpp.
References _startMovie.
Referenced by Engines::NWN2::Module::enter(), Engines::KotOR2::Module::enter(), Engines::Witcher::Module::enter(), Engines::NWN::Module::enter(), and Engines::KotOR::Module::enter().
void Aurora::IFOFile::getStartTime | ( | uint8 & | hour, |
uint8 & | day, | ||
uint8 & | month, | ||
uint32 & | year | ||
) | const |
Return the module's starting time.
Definition at line 335 of file ifofile.cpp.
References _startDay, _startHour, _startMonth, and _startYear.
const std::vector< Common::UString > & Aurora::IFOFile::getStoryNPCs | ( | ) | const |
Returns the list of story NPCs used in the module.
Definition at line 327 of file ifofile.cpp.
References _storyNPCs.
const Common::UString & Aurora::IFOFile::getTag | ( | ) | const |
Return the module's tag.
Definition at line 263 of file ifofile.cpp.
References _tag.
Referenced by Engines::KotOR2::Module::loadIFO(), Engines::KotOR::Module::loadIFO(), Engines::Witcher::Module::loadModule(), Engines::NWN2::Module::loadModule(), and Engines::NWN::Module::loadModule().
const Common::UString & Aurora::IFOFile::getTLK | ( | ) | const |
Return the custom TLK table this module uses.
Definition at line 275 of file ifofile.cpp.
References _customTLK.
Referenced by Engines::NWN2::Module::loadTLK(), and Engines::NWN::Module::loadTLK().
uint32 Aurora::IFOFile::getVersion | ( | ) | const |
Return the version of this IFO file.
Definition at line 251 of file ifofile.cpp.
References _version.
float Aurora::IFOFile::getXPScale | ( | ) | const |
Get the number creature kill XP is multiplied by.
Definition at line 370 of file ifofile.cpp.
References _xpScale.
bool Aurora::IFOFile::isSave | ( | ) | const |
Is the module a save file?
Definition at line 259 of file ifofile.cpp.
References _isSave.
Referenced by Engines::Witcher::Module::loadModule(), Engines::NWN2::Module::loadModule(), and Engines::NWN::Module::loadModule().
void Aurora::IFOFile::load | ( | Common::SeekableReadStream * | stream, |
bool | repairNWNPremium = false |
||
) |
Take over this stream and load an IFO out of it.
Since this is a GFF3 file, which might be found in a Neverwinter Nights premium module and therefore mangled, the parameter repairNWNPremium indicates whether we want to try to repair such mangled module.ifo files.
Definition at line 101 of file ifofile.cpp.
References _areas, _creatorID, _customTLK, _description, _entryArea, _entryDirX, _entryDirY, _entryX, _entryY, _entryZ, _expansions, _gff, _haks, _hourDawn, _hourDusk, _id, _isSave, _maxWeatherIntensity, _minutesPerHour, _minWeatherIntensity, _monsterNPCs, _name, _nssCache, _questDBs, _quests, _rainChance, _snowChance, _startDay, _startHour, _startMonth, _startMovie, _startYear, _storyNPCs, _tag, _version, _xpScale, Common::UString::empty(), Aurora::GFF3Struct::getData(), Aurora::GFF3Struct::getDouble(), Aurora::GFF3Struct::getList(), Aurora::GFF3Struct::getLocString(), Aurora::GFF3Struct::getSint(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), Aurora::GFF3Struct::hasField(), MKTAG, parseVersion(), and unload().
Referenced by load(), Engines::KotOR2::Module::loadIFO(), Engines::KotOR::Module::loadIFO(), Engines::Witcher::Module::loadModule(), Engines::NWN2::Module::loadModule(), and Engines::NWN::Module::loadModule().
void Aurora::IFOFile::load | ( | bool | repairNWNPremium = false | ) |
Load the currently available module.ifo.
Since this is a GFF3 file, which might be found in a Neverwinter Nights premium module and therefore mangled, the parameter repairNWNPremium indicates whether we want to try to repair such mangled module.ifo files.
Definition at line 229 of file ifofile.cpp.
References Aurora::kFileTypeIFO, load(), ResMan, and unload().
|
private |
Definition at line 239 of file ifofile.cpp.
References _minVersionMajor, _minVersionMinor, and Common::UString::c_str().
Referenced by load().
void Aurora::IFOFile::unload | ( | ) |
Unload a currently loaded IFO.
Definition at line 97 of file ifofile.cpp.
References clear().
Referenced by load(), Engines::KotOR2::Module::unloadIFO(), Engines::KotOR::Module::unloadIFO(), Engines::NWN2::Module::unloadModule(), Engines::Witcher::Module::unloadModule(), and Engines::NWN::Module::unloadModule().
|
private |
Areas found in the module.
Definition at line 225 of file ifofile.h.
Referenced by clear(), getAreas(), and load().
|
private |
ID of the IFO file creator.
Definition at line 203 of file ifofile.h.
Referenced by getCreatorID(), and load().
|
private |
|
private |
The module's localized description.
Definition at line 200 of file ifofile.h.
Referenced by clear(), getDescription(), and load().
|
private |
The area the PC starts in.
Definition at line 216 of file ifofile.h.
Referenced by clear(), getEntryArea(), and load().
|
private |
The X orientation the PC starts in.
Definition at line 221 of file ifofile.h.
Referenced by clear(), getEntryDirection(), and load().
|
private |
The Y orientation the PC starts in.
Definition at line 222 of file ifofile.h.
Referenced by clear(), getEntryDirection(), and load().
|
private |
The X position the PC starts in.
Definition at line 218 of file ifofile.h.
Referenced by clear(), getEntryPosition(), and load().
|
private |
The Y position the PC starts in.
Definition at line 219 of file ifofile.h.
Referenced by clear(), getEntryPosition(), and load().
|
private |
The Z position the PC starts in.
Definition at line 220 of file ifofile.h.
Referenced by clear(), getEntryPosition(), and load().
|
private |
Bitfield of required expansions.
Definition at line 208 of file ifofile.h.
Referenced by clear(), getExpansions(), and load().
|
private |
|
private |
|
private |
The hour dawn starts.
Definition at line 234 of file ifofile.h.
Referenced by clear(), getDawnHour(), and load().
|
private |
The hour dusk starts.
Definition at line 235 of file ifofile.h.
Referenced by clear(), getDuskHour(), and load().
|
private |
|
private |
|
private |
Maximum weather intensity.
Definition at line 245 of file ifofile.h.
Referenced by getMaxWeatherIntensity(), and load().
|
private |
Number of real time minutes per game hour.
Definition at line 237 of file ifofile.h.
Referenced by clear(), getMinutesPerHour(), and load().
|
private |
Minimum major game version this module needs.
Definition at line 205 of file ifofile.h.
Referenced by clear(), getMinVersion(), and parseVersion().
|
private |
Minimum minor game version this module needs.
Definition at line 206 of file ifofile.h.
Referenced by clear(), getMinVersion(), and parseVersion().
|
private |
Minimum weather intensity.
Definition at line 244 of file ifofile.h.
Referenced by getMinWeatherIntensity(), and load().
|
private |
List of monster NPCs used in the module.
Definition at line 232 of file ifofile.h.
Referenced by getMonsterNPCs(), and load().
|
private |
|
private |
Scripts that should be cached.
Definition at line 226 of file ifofile.h.
Referenced by clear(), getNSSCache(), and load().
|
private |
List of quest databases used in the module.
Definition at line 229 of file ifofile.h.
Referenced by getQuestDBs(), and load().
|
private |
List of quests used in the module.
Definition at line 228 of file ifofile.h.
Referenced by getQuests(), and load().
|
private |
Chance for rain.
Definition at line 246 of file ifofile.h.
Referenced by getRainChance(), and load().
|
private |
Chance for snow.
Definition at line 247 of file ifofile.h.
Referenced by getSnowChance(), and load().
|
private |
Day the module starts.
Definition at line 240 of file ifofile.h.
Referenced by clear(), getStartTime(), and load().
|
private |
Hour the module starts.
Definition at line 239 of file ifofile.h.
Referenced by clear(), getStartTime(), and load().
|
private |
Month the module starts.
Definition at line 241 of file ifofile.h.
Referenced by clear(), getStartTime(), and load().
|
private |
The movie the module starts with.
Definition at line 214 of file ifofile.h.
Referenced by clear(), getStartMovie(), and load().
|
private |
Year the module starts.
Definition at line 242 of file ifofile.h.
Referenced by clear(), getStartTime(), and load().
|
private |
List of story NPCs used in the module.
Definition at line 231 of file ifofile.h.
Referenced by getStoryNPCs(), and load().
|
private |
|
private |
Version of this IFO file.
Definition at line 202 of file ifofile.h.
Referenced by getVersion(), and load().
|
private |
The number creature kill XP is multiplied by.
Definition at line 249 of file ifofile.h.
Referenced by clear(), getXPScale(), and load().