xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aurora::IFOFile Class Reference

An IFO (module information) file, describing global module properties in many Aurora games. More...

#include <ifofile.h>

Inheritance diagram for Aurora::IFOFile:
Inheritance graph
[legend]
Collaboration diagram for Aurora::IFOFile:
Collaboration graph
[legend]

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 GFF3StructgetGFF () 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::UStringgetTag () const
 Return the module's tag. More...
 
const LocStringgetName () const
 Return the name of the module. More...
 
const LocStringgetDescription () const
 Return the description of the module. More...
 
const Common::UStringgetTLK () 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::UStringgetStartMovie () const
 Return the starting movie. More...
 
const Common::UStringgetEntryArea () 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...
 

Detailed Description

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.

Definition at line 69 of file ifofile.h.

Constructor & Destructor Documentation

◆ IFOFile()

Aurora::IFOFile::IFOFile ( )

Definition at line 44 of file ifofile.cpp.

References clear().

Here is the call graph for this function:

◆ ~IFOFile()

Aurora::IFOFile::~IFOFile ( )

Definition at line 48 of file ifofile.cpp.

Member Function Documentation

◆ clear()

void Aurora::IFOFile::clear ( )
private

◆ getAreas()

const std::vector< Common::UString > & Aurora::IFOFile::getAreas ( ) const

◆ getCreatorID()

uint32 Aurora::IFOFile::getCreatorID ( ) const

Return the ID of the IFO file creator.

Definition at line 255 of file ifofile.cpp.

References _creatorID.

◆ getDawnHour()

uint8 Aurora::IFOFile::getDawnHour ( ) const

Return the hour dawn starts.

Definition at line 342 of file ifofile.cpp.

References _hourDawn.

◆ getDescription()

const LocString & Aurora::IFOFile::getDescription ( ) const

Return the description of the module.

Definition at line 271 of file ifofile.cpp.

References _description.

◆ getDuskHour()

uint8 Aurora::IFOFile::getDuskHour ( ) const

Return the hour dusk starts.

Definition at line 346 of file ifofile.cpp.

References _hourDusk.

◆ getEntryArea()

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().

Here is the caller graph for this function:

◆ getEntryDirection()

void Aurora::IFOFile::getEntryDirection ( float &  x,
float &  y 
) const

◆ getEntryPosition()

void Aurora::IFOFile::getEntryPosition ( float &  x,
float &  y,
float &  z 
) const

◆ getExpansions()

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().

Here is the caller graph for this function:

◆ getGFF()

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().

Here is the caller graph for this function:

◆ getHAKs()

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().

Here is the caller graph for this function:

◆ getMaxWeatherIntensity()

int32 Aurora::IFOFile::getMaxWeatherIntensity ( ) const

Return the maximum weather intensity.

Definition at line 358 of file ifofile.cpp.

References _maxWeatherIntensity.

◆ getMinutesPerHour()

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.

◆ getMinVersion()

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.

◆ getMinWeatherIntensity()

int32 Aurora::IFOFile::getMinWeatherIntensity ( ) const

Return the minimum weather intensity.

Definition at line 354 of file ifofile.cpp.

References _minWeatherIntensity.

◆ getMonsterNPCs()

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.

◆ getName()

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().

Here is the caller graph for this function:

◆ getNSSCache()

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.

◆ getQuestDBs()

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.

◆ getQuests()

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.

◆ getRainChance()

int32 Aurora::IFOFile::getRainChance ( ) const

Return the chance that it's going to rain.

Definition at line 362 of file ifofile.cpp.

References _rainChance.

◆ getSnowChance()

int32 Aurora::IFOFile::getSnowChance ( ) const

Return the chance that it's going to snow.

Definition at line 366 of file ifofile.cpp.

References _snowChance.

◆ getStartMovie()

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().

Here is the caller graph for this function:

◆ getStartTime()

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.

◆ getStoryNPCs()

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.

◆ getTag()

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().

Here is the caller graph for this function:

◆ getTLK()

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().

Here is the caller graph for this function:

◆ getVersion()

uint32 Aurora::IFOFile::getVersion ( ) const

Return the version of this IFO file.

Definition at line 251 of file ifofile.cpp.

References _version.

◆ getXPScale()

float Aurora::IFOFile::getXPScale ( ) const

Get the number creature kill XP is multiplied by.

Definition at line 370 of file ifofile.cpp.

References _xpScale.

◆ isSave()

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().

Here is the caller graph for this function:

◆ load() [1/2]

void Aurora::IFOFile::load ( Common::SeekableReadStream stream,
bool  repairNWNPremium = false 
)

◆ load() [2/2]

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().

Here is the call graph for this function:

◆ parseVersion()

void Aurora::IFOFile::parseVersion ( const Common::UString version)
private

Definition at line 239 of file ifofile.cpp.

References _minVersionMajor, _minVersionMinor, and Common::UString::c_str().

Referenced by load().

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

◆ unload()

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().

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

Member Data Documentation

◆ _areas

std::vector<Common::UString> Aurora::IFOFile::_areas
private

Areas found in the module.

Definition at line 225 of file ifofile.h.

Referenced by clear(), getAreas(), and load().

◆ _creatorID

uint32 Aurora::IFOFile::_creatorID
private

ID of the IFO file creator.

Definition at line 203 of file ifofile.h.

Referenced by getCreatorID(), and load().

◆ _customTLK

Common::UString Aurora::IFOFile::_customTLK
private

The custom TLK the module uses.

Definition at line 212 of file ifofile.h.

Referenced by clear(), getTLK(), and load().

◆ _description

LocString Aurora::IFOFile::_description
private

The module's localized description.

Definition at line 200 of file ifofile.h.

Referenced by clear(), getDescription(), and load().

◆ _entryArea

Common::UString Aurora::IFOFile::_entryArea
private

The area the PC starts in.

Definition at line 216 of file ifofile.h.

Referenced by clear(), getEntryArea(), and load().

◆ _entryDirX

float Aurora::IFOFile::_entryDirX
private

The X orientation the PC starts in.

Definition at line 221 of file ifofile.h.

Referenced by clear(), getEntryDirection(), and load().

◆ _entryDirY

float Aurora::IFOFile::_entryDirY
private

The Y orientation the PC starts in.

Definition at line 222 of file ifofile.h.

Referenced by clear(), getEntryDirection(), and load().

◆ _entryX

float Aurora::IFOFile::_entryX
private

The X position the PC starts in.

Definition at line 218 of file ifofile.h.

Referenced by clear(), getEntryPosition(), and load().

◆ _entryY

float Aurora::IFOFile::_entryY
private

The Y position the PC starts in.

Definition at line 219 of file ifofile.h.

Referenced by clear(), getEntryPosition(), and load().

◆ _entryZ

float Aurora::IFOFile::_entryZ
private

The Z position the PC starts in.

Definition at line 220 of file ifofile.h.

Referenced by clear(), getEntryPosition(), and load().

◆ _expansions

uint16 Aurora::IFOFile::_expansions
private

Bitfield of required expansions.

Definition at line 208 of file ifofile.h.

Referenced by clear(), getExpansions(), and load().

◆ _gff

Common::ScopedPtr<GFF3File> Aurora::IFOFile::_gff
private

The module.ifo GFF.

Definition at line 193 of file ifofile.h.

Referenced by clear(), getGFF(), and load().

◆ _haks

std::vector<Common::UString> Aurora::IFOFile::_haks
private

HAKs required by the module.

Definition at line 224 of file ifofile.h.

Referenced by clear(), getHAKs(), and load().

◆ _hourDawn

uint8 Aurora::IFOFile::_hourDawn
private

The hour dawn starts.

Definition at line 234 of file ifofile.h.

Referenced by clear(), getDawnHour(), and load().

◆ _hourDusk

uint8 Aurora::IFOFile::_hourDusk
private

The hour dusk starts.

Definition at line 235 of file ifofile.h.

Referenced by clear(), getDuskHour(), and load().

◆ _id

byte Aurora::IFOFile::_id[32]
private

The module's unique ID.

Definition at line 195 of file ifofile.h.

Referenced by clear(), and load().

◆ _isSave

bool Aurora::IFOFile::_isSave
private

Is this module a save?

Definition at line 210 of file ifofile.h.

Referenced by clear(), isSave(), and load().

◆ _maxWeatherIntensity

int32 Aurora::IFOFile::_maxWeatherIntensity
private

Maximum weather intensity.

Definition at line 245 of file ifofile.h.

Referenced by getMaxWeatherIntensity(), and load().

◆ _minutesPerHour

uint8 Aurora::IFOFile::_minutesPerHour
private

Number of real time minutes per game hour.

Definition at line 237 of file ifofile.h.

Referenced by clear(), getMinutesPerHour(), and load().

◆ _minVersionMajor

int Aurora::IFOFile::_minVersionMajor
private

Minimum major game version this module needs.

Definition at line 205 of file ifofile.h.

Referenced by clear(), getMinVersion(), and parseVersion().

◆ _minVersionMinor

int Aurora::IFOFile::_minVersionMinor
private

Minimum minor game version this module needs.

Definition at line 206 of file ifofile.h.

Referenced by clear(), getMinVersion(), and parseVersion().

◆ _minWeatherIntensity

int32 Aurora::IFOFile::_minWeatherIntensity
private

Minimum weather intensity.

Definition at line 244 of file ifofile.h.

Referenced by getMinWeatherIntensity(), and load().

◆ _monsterNPCs

std::vector<Common::UString> Aurora::IFOFile::_monsterNPCs
private

List of monster NPCs used in the module.

Definition at line 232 of file ifofile.h.

Referenced by getMonsterNPCs(), and load().

◆ _name

LocString Aurora::IFOFile::_name
private

The module's localized name.

Definition at line 199 of file ifofile.h.

Referenced by clear(), getName(), and load().

◆ _nssCache

std::vector<Common::UString> Aurora::IFOFile::_nssCache
private

Scripts that should be cached.

Definition at line 226 of file ifofile.h.

Referenced by clear(), getNSSCache(), and load().

◆ _questDBs

std::vector<Common::UString> Aurora::IFOFile::_questDBs
private

List of quest databases used in the module.

Definition at line 229 of file ifofile.h.

Referenced by getQuestDBs(), and load().

◆ _quests

std::vector<Common::UString> Aurora::IFOFile::_quests
private

List of quests used in the module.

Definition at line 228 of file ifofile.h.

Referenced by getQuests(), and load().

◆ _rainChance

int32 Aurora::IFOFile::_rainChance
private

Chance for rain.

Definition at line 246 of file ifofile.h.

Referenced by getRainChance(), and load().

◆ _snowChance

int32 Aurora::IFOFile::_snowChance
private

Chance for snow.

Definition at line 247 of file ifofile.h.

Referenced by getSnowChance(), and load().

◆ _startDay

uint8 Aurora::IFOFile::_startDay
private

Day the module starts.

Definition at line 240 of file ifofile.h.

Referenced by clear(), getStartTime(), and load().

◆ _startHour

uint8 Aurora::IFOFile::_startHour
private

Hour the module starts.

Definition at line 239 of file ifofile.h.

Referenced by clear(), getStartTime(), and load().

◆ _startMonth

uint8 Aurora::IFOFile::_startMonth
private

Month the module starts.

Definition at line 241 of file ifofile.h.

Referenced by clear(), getStartTime(), and load().

◆ _startMovie

Common::UString Aurora::IFOFile::_startMovie
private

The movie the module starts with.

Definition at line 214 of file ifofile.h.

Referenced by clear(), getStartMovie(), and load().

◆ _startYear

uint32 Aurora::IFOFile::_startYear
private

Year the module starts.

Definition at line 242 of file ifofile.h.

Referenced by clear(), getStartTime(), and load().

◆ _storyNPCs

std::vector<Common::UString> Aurora::IFOFile::_storyNPCs
private

List of story NPCs used in the module.

Definition at line 231 of file ifofile.h.

Referenced by getStoryNPCs(), and load().

◆ _tag

Common::UString Aurora::IFOFile::_tag
private

The module's tag.

Definition at line 197 of file ifofile.h.

Referenced by clear(), getTag(), and load().

◆ _version

uint32 Aurora::IFOFile::_version
private

Version of this IFO file.

Definition at line 202 of file ifofile.h.

Referenced by getVersion(), and load().

◆ _xpScale

float Aurora::IFOFile::_xpScale
private

The number creature kill XP is multiplied by.

Definition at line 249 of file ifofile.h.

Referenced by clear(), getXPScale(), and load().


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