50 using ::Aurora::GFF4File;
51 using ::Aurora::GFF4Struct;
76 read(cifPath, manifestPath);
106 if (!manifestPath.
empty())
109 _uid =
"Single Player";
119 if (manifestPath.
empty())
142 GFF4File cif(cifFile,
kCIFID);
146 const GFF4Struct &cifTop = cif.getTopLevel();
189 std::vector<Common::UString> rims;
193 if (rims.size() != 2)
195 rim->tag.c_str(), rim->area.c_str(), (
uint) rims.size());
197 rim->environment = rims[0];
203 rim->children.reserve(children.size());
205 for (GFF4List::const_iterator c = children.begin(); c != children.end(); ++c)
207 rim->children.push_back(
readRIMs(**c, rim.get()));
210 if (!rim->area.empty()) {
211 _areaMap.insert(std::make_pair(rim->area, rim.get()));
213 _areas.push_back(rim->area);
216 return rim.release();
239 for (Common::XMLNode::Children::const_iterator c = addinItems.begin(); c != addinItems.end(); ++c) {
240 if ((*c)->getName() ==
"addinitem") {
280 AreaMap::const_iterator a =
_areaMap.find(area);
282 return a->second->rim;
307 for (
size_t i = 0; i <
_packages.size(); i++) {
329 GFF4File cif(cifFile,
kCIFID);
333 const GFF4Struct &cifTop = cif.getTopLevel();
379 float entryPosX, entryPosY, entryPosZ, entryOrientX, entryOrientY, entryOrientZ;
390 float orientX, orientY, orientZ, orientAngle;
392 _currentArea->getEntryLocation(entryPosX, entryPosY, entryPosZ, orientX, orientY, orientZ, orientAngle);
400 CameraMan.setPosition(entryPosX, entryPosY, entryPosZ + 1.8f);
401 CameraMan.setOrientation(entryOrientX + 90.0f, entryOrientY, entryOrientZ);
467 _currentArea.reset(
new Area(*
this, area->second->area, area->second->environment, area->second->rim));
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
void setString(Language language, LanguageGender gender, const Common::UString &str)
Set the string of that language.
void setPosition(float x, float y, float z)
Set the creature's position.
static void loadTexturePack(const Common::UString &dir, uint32 priority, ChangeList &res, TextureQuality quality)
A class holding an UTF-8 string.
Class to parse a ReadStream into a simple XML tree.
std::vector< Common::UString > _packages
Area * getCurrentArea() const
Return the area the PC is currently in.
The context holding a Dragon Age: Origins campaign.
static const uint32 kVersion01
const UString & getName() const
bool isLoaded() const
Is this campaign currently loaded?
Common::UString _entryClientScript
virtual void enter()
The cursor entered the object.
A creature in a Dragon Age: Origins area.
void readCIFStatic(const Common::UString &path)
void unload()
Unload the campaign after playing.
void enterArea(bool startArea=false)
A simple streaming file reading class.
void readCIFDynamic(const Common::UString &path)
Common::UString _addinBase
const std::vector< Common::UString > & getAreas() const
bool isEnabled() const
Is this Campaign enabled?
Utility templates and functions for working with strings and streams.
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
std::vector< Common::UString > _areas
const Aurora::LocString & getDescription() const
Exception that provides a stack of explanations.
RIMNode * readRIMs(const Aurora::GFF4Struct &node, const RIMNode *parent=0)
A simple scoped smart pointer template.
void deindexResources(Common::ChangeID &changeID)
Remove previously added resources from the ResourceManager.
const Aurora::LocString & getName() const
The context holding a Dragon Age: Origins area.
std::vector< const GFF4Struct * > GFF4List
void leave()
Leave the campaign, ending it.
Handling version V4.0/V4.1 of BioWare's GFFs (generic file format).
Basic exceptions to throw.
Aurora::LocString _description
const char * c_str() const
Return the (utf8 encoded) string data.
The context handling the gameplay in Dragon Age: Origins.
Utility templates and functions.
Common::ScopedPtr< Area > _currentArea
The current area.
Common::UString _newArea
The new area to enter.
Creature * getPC() const
Return the currently playing PC.
void load()
Load the campaign for playing.
void processEventQueue()
Process the current event queue.
bool isBioWare() const
Is this an original campaign by BioWare?
void read(const Common::UString &cifPath, const Common::UString &manifestPath)
XML parsing helpers, using libxml2.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
A scoped plain pointer, allowing pointer-y access and normal deletion.
UString getProperty(const UString &name, const UString &def="") const
Return a certain property on this node.
const Common::UString & getAreaRIM(const Common::UString &area) const
Return the RIM file containing this area.
Common::UString _entryArea
An area in Dragon Age: Origins, holding all objects and rooms within, as well as general area propert...
Common::ScopedPtr< RIMNode > _rimRoot
static const uint32 kCIFID
Implementing the stream reading interfaces for files.
void readVarTable(const Aurora::GFF3List &varTable)
const XMLNode * findChild(const UString &name) const
Find a child node by name.
static void unloadTalkTables(ChangeList &changes)
Unload this set of talk tables.
static void loadResources(const Common::UString &dir, uint32 priority, ChangeList &res)
Load all game resource archives found in this directory.
static UString getStem(const UString &p)
Return a file name's stem.
Common::UString _entryAreaList
Common::UString _entryScript
UString debugTag(uint32 tag, bool trim)
Create an elaborate string from an integer tag, for debugging purposes.
void movePC(const Common::UString &area)
Move the player character to this area.
RIMNode(const RIMNode *p=0)
void loadTalkTables(const Common::UString &dir, uint32 priority, ChangeList &res)
Load all talk tables in the current language found in this directory.
void status(const char *s,...)
const XMLNode & getRoot() const
Return the XML root node.
#define CameraMan
Shortcut for accessing the camera manager.
void readScript(const Aurora::GFF3Struct &gff)
void addEvent(const Events::Event &event)
Add a single event for consideration into the area event queue.
void readManifest(const Common::UString &path)
float _entryOrientation[3]
static const Common::UString kEmptyString
Campaign(Game &game, const Common::UString &cifPath="", const Common::UString &manifestPath="", const Common::UString &addinBase="")
bool needsAuth() const
Does this campaign need authorization from BioWare?
const Common::UString & getExtendsUID() const
Return the UID of the campaign this campaign/content extends, if any.
bool runScript(EventType event, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
void parseString(const UString &str, T &value, bool allowEmpty)
Parse a string into any POD integer, float/double or bool type.
void enableEvents(bool enabled)
Enable/Disable the handling of all events.
Utility class for manipulating file paths.
const Common::UString & getUID() const
Return the unique ID of this campaign.
Creature * _pc
The player character we use.