xoreos  0.0.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Engines::DragonAge2::Area Class Reference

An area in Dragon Age II, holding all objects and rooms within, as well as general area properties like the current background music and ambient sounds. More...

#include <area.h>

Inheritance diagram for Engines::DragonAge2::Area:
Inheritance graph
[legend]
Collaboration diagram for Engines::DragonAge2::Area:
Collaboration graph
[legend]

Public Member Functions

 Area (Campaign &campaign, const Common::UString &resRef, const Common::UString &env, const Common::UString &rim)
 
 ~Area ()
 
const Common::UStringgetResRef () const
 
const Aurora::LocStringgetName () const
 
void getEntryLocation (float &posX, float &posY, float &posZ, float &orientX, float &orientY, float &orientZ, float &orientAngle) const
 Return the position and orientation the PC should enter this area. More...
 
void show ()
 Show the object's model(s). More...
 
void hide ()
 Hide the object's model(s). More...
 
void addEvent (const Events::Event &event)
 Add a single event for consideration into the area event queue. More...
 
void processEventQueue ()
 Process the current event queue. More...
 
void removeFocus ()
 Forcibly remove the focus from the currently highlighted object. More...
 
- Public Member Functions inherited from Engines::DragonAge2::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetResRef () const
 Return the object's resource reference. More...
 
const Aurora::LocStringgetName () const
 Return the object's name. More...
 
const Aurora::LocStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetConversation () const
 Return the object's default conversation (DLG). More...
 
const Common::UStringgetNonLocalizedName () const
 Return the object's non-localized name. More...
 
void setNonLocalizedName (const Common::UString &name)
 Set the object's non-localized name. More...
 
bool isStatic () const
 Is the object static (not manipulable at all)? More...
 
bool isUsable () const
 Can the object be used by the PC? More...
 
bool isClickable () const
 Can the player click the object? More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Return the object's position within its area. More...
 
virtual void getOrientation (float &x, float &y, float &z, float &angle) const
 Return the object's orientation. More...
 
virtual void setPosition (float x, float y, float z)
 Set the object's position within its area. More...
 
virtual void setOrientation (float x, float y, float z, float angle)
 Set the object's orientation. More...
 
virtual void enter ()
 The cursor entered the object. More...
 
virtual void leave ()
 The cursor left the object. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the object. More...
 
virtual bool click (Object *triggerer=0)
 The object was clicked. More...
 
- Public Member Functions inherited from Aurora::NWScript::Object
 Object ()
 
uint32 getID () const
 
const Common::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (const Common::UString &var) const
 
void setVariable (const Common::UString &var, const Variable &value)
 
void removeVariable (const Common::UString &var)
 
void clearVariables ()
 
- Public Member Functions inherited from Engines::DragonAge2::ScriptContainer
 ScriptContainer ()
 
 ~ScriptContainer ()
 
const Common::UStringgetScript () const
 
bool hasScript () const
 
void enableEvent (EventType event, bool enabled)
 Enable/Disable the handling of a specific event. More...
 
void enableEvents (bool enabled)
 Enable/Disable the handling of all events. More...
 
bool runScript (EventType event, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
bool runScript (Event &event)
 
- Public Member Functions inherited from Events::Notifyable
 Notifyable ()
 
virtual ~Notifyable ()
 

Static Public Member Functions

static Common::UString getName (const Common::UString &resRef, const Common::UString &rimFile="")
 
- Static Public Member Functions inherited from Engines::DragonAge2::ScriptContainer
static bool runScript (const Common::UString &script, EventType event, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, EventType event, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, Event &event)
 
static bool runScript (const Common::UString &script, Event &event, const Aurora::NWScript::ScriptState &state)
 

Protected Member Functions

void notifyCameraMoved ()
 
- Protected Member Functions inherited from Engines::DragonAge2::Object
void syncPosition ()
 
void syncOrientation ()
 
void readVarTable (const Aurora::GFF3List &varTable)
 
void readVarTable (const Aurora::GFF3Struct &gff)
 
void readVarTable (const Aurora::GFF4List &varTable)
 
void readVarTable (const Aurora::GFF4Struct &gff)
 
- Protected Member Functions inherited from Engines::DragonAge2::ScriptContainer
void clearScript ()
 
void readScript (const Aurora::GFF3Struct &gff)
 
void readScript (const Aurora::GFF4Struct &gff)
 

Private Types

typedef Common::PtrVector< RoomRooms
 
typedef Common::PtrList< DragonAge2::ObjectObjects
 
typedef std::map< uint32, DragonAge2::Object * > ObjectMap
 

Private Member Functions

void load (const Common::UString &resRef, const Common::UString &env, const Common::UString &rim)
 
void loadEnvironment (const Common::UString &resRef)
 
void loadARE (const Common::UString &resRef)
 
void loadObject (DragonAge2::Object &object)
 
void loadWaypoints (const Aurora::GFF3List &list)
 
void loadPlaceables (const Aurora::GFF3List &list)
 
void loadCreatures (const Aurora::GFF3List &list)
 
void checkActive (int x=-1, int y=-1)
 
void setActive (DragonAge2::Object *object)
 
DragonAge2::ObjectgetObjectAt (int x, int y)
 
void highlightAll (bool enabled)
 
void click (int x, int y)
 
void clean ()
 

Private Attributes

Campaign_campaign
 
Common::UString _resRef
 
uint32 _environmentID
 
Common::UString _environmentName
 
Common::UString _skyDome
 
Common::UString _startPoint
 
Common::UString _script
 
Aurora::LocString _name
 
Rooms _rooms
 
ChangeList _resources
 
std::list< Events::Event_eventQueue
 
Objects _objects
 List of all objects in the area. More...
 
ObjectMap _objectMap
 Map of objects by their model IDs. More...
 
DragonAge2::Object_activeObject
 The currently active (highlighted) object. More...
 
bool _highlightAll
 Are we currently highlighting all objects? More...
 
Common::Mutex _mutex
 

Additional Inherited Members

- Protected Attributes inherited from Engines::DragonAge2::Object
ObjectType _type
 The object's type. More...
 
Common::UString _resRef
 The object's resource reference. More...
 
Aurora::LocString _name
 The object's display name. More...
 
Aurora::LocString _description
 The object's description. More...
 
Common::UString _nonLocalizedName
 The object's non-localized name. More...
 
Common::UString _conversation
 The object's default conversation. More...
 
Common::UString _soundSet
 The object's sound set. More...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
std::list< uint32_ids
 The object's model IDs. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Detailed Description

An area in Dragon Age II, holding all objects and rooms within, as well as general area properties like the current background music and ambient sounds.

Note: the coordinate system of the in-world graphics is oriented as viewed from the top down. The negative Z axis goes down into the ground, while the positive Y axis points due north and the positive X axis points due east.

Definition at line 64 of file area.h.

Member Typedef Documentation

◆ ObjectMap

Definition at line 99 of file area.h.

◆ Objects

Definition at line 98 of file area.h.

◆ Rooms

Definition at line 96 of file area.h.

Constructor & Destructor Documentation

◆ Area()

Engines::DragonAge2::Area::Area ( Campaign campaign,
const Common::UString resRef,
const Common::UString env,
const Common::UString rim 
)

Definition at line 69 of file area.cpp.

References Common::StackException::add(), Common::UString::c_str(), clean(), and load().

Here is the call graph for this function:

◆ ~Area()

Engines::DragonAge2::Area::~Area ( )

Definition at line 85 of file area.cpp.

References clean(), and hide().

Here is the call graph for this function:

Member Function Documentation

◆ addEvent()

void Engines::DragonAge2::Area::addEvent ( const Events::Event event)

Add a single event for consideration into the area event queue.

Definition at line 290 of file area.cpp.

References _eventQueue.

◆ checkActive()

void Engines::DragonAge2::Area::checkActive ( int  x = -1,
int  y = -1 
)
private

Definition at line 346 of file area.cpp.

References _highlightAll, _mutex, CursorMan, getObjectAt(), and setActive().

Referenced by notifyCameraMoved(), and processEventQueue().

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

◆ clean()

void Engines::DragonAge2::Area::clean ( )
private

Definition at line 98 of file area.cpp.

References _campaign, _objects, _resources, Engines::deindexResources(), and Engines::DragonAge2::ObjectContainer::removeObject().

Referenced by Area(), and ~Area().

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

◆ click()

void Engines::DragonAge2::Area::click ( int  x,
int  y 
)
private

Definition at line 358 of file area.cpp.

References _campaign, _mutex, Engines::DragonAge2::Object::click(), getObjectAt(), and Engines::DragonAge2::Campaign::getPC().

Referenced by processEventQueue().

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

◆ getEntryLocation()

void Engines::DragonAge2::Area::getEntryLocation ( float &  posX,
float &  posY,
float &  posZ,
float &  orientX,
float &  orientY,
float &  orientZ,
float &  orientAngle 
) const

◆ getName() [1/2]

const Aurora::LocString & Engines::DragonAge2::Area::getName ( ) const

Definition at line 94 of file area.cpp.

References _name.

Referenced by Engines::DragonAge2::Console::cmdListAreas().

Here is the caller graph for this function:

◆ getName() [2/2]

Common::UString Engines::DragonAge2::Area::getName ( const Common::UString resRef,
const Common::UString rimFile = "" 
)
static

◆ getObjectAt()

DragonAge2::Object * Engines::DragonAge2::Area::getObjectAt ( int  x,
int  y 
)
private

Definition at line 321 of file area.cpp.

References _objectMap, Graphics::Renderable::getID(), and GfxMan.

Referenced by checkActive(), and click().

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

◆ getResRef()

const Common::UString & Engines::DragonAge2::Area::getResRef ( ) const

Definition at line 90 of file area.cpp.

References _resRef.

◆ hide()

void Engines::DragonAge2::Area::hide ( )
virtual

Hide the object's model(s).

Reimplemented from Engines::DragonAge2::Object.

Definition at line 220 of file area.cpp.

References _objects, _rooms, GfxMan, and removeFocus().

Referenced by ~Area().

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

◆ highlightAll()

void Engines::DragonAge2::Area::highlightAll ( bool  enabled)
private

Definition at line 368 of file area.cpp.

References _highlightAll, and _objectMap.

Referenced by processEventQueue().

Here is the caller graph for this function:

◆ load()

void Engines::DragonAge2::Area::load ( const Common::UString resRef,
const Common::UString env,
const Common::UString rim 
)
private

Definition at line 108 of file area.cpp.

References _resources, Engines::indexOptionalArchive(), loadARE(), and loadEnvironment().

Referenced by Area().

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

◆ loadARE()

void Engines::DragonAge2::Area::loadARE ( const Common::UString resRef)
private

◆ loadCreatures()

void Engines::DragonAge2::Area::loadCreatures ( const Aurora::GFF3List list)
private

Definition at line 199 of file area.cpp.

References loadObject().

Referenced by loadARE().

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

◆ loadEnvironment()

void Engines::DragonAge2::Area::loadEnvironment ( const Common::UString resRef)
private

◆ loadObject()

void Engines::DragonAge2::Area::loadObject ( DragonAge2::Object object)
private

Definition at line 170 of file area.cpp.

References _campaign, _objectMap, _objects, Engines::DragonAge2::ObjectContainer::addObject(), and Engines::DragonAge2::Object::isStatic().

Referenced by loadCreatures(), loadPlaceables(), and loadWaypoints().

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

◆ loadPlaceables()

void Engines::DragonAge2::Area::loadPlaceables ( const Aurora::GFF3List list)
private

Definition at line 191 of file area.cpp.

References loadObject().

Referenced by loadARE().

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

◆ loadWaypoints()

void Engines::DragonAge2::Area::loadWaypoints ( const Aurora::GFF3List list)
private

Definition at line 183 of file area.cpp.

References loadObject().

Referenced by loadARE().

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

◆ notifyCameraMoved()

void Engines::DragonAge2::Area::notifyCameraMoved ( )
protectedvirtual

Reimplemented from Events::Notifyable.

Definition at line 386 of file area.cpp.

References checkActive().

Here is the call graph for this function:

◆ processEventQueue()

void Engines::DragonAge2::Area::processEventQueue ( )

Process the current event queue.

Definition at line 294 of file area.cpp.

References _eventQueue, checkActive(), click(), highlightAll(), Events::kEventKeyDown, Events::kEventKeyUp, Events::kEventMouseDown, and Events::kEventMouseMove.

Here is the call graph for this function:

◆ removeFocus()

void Engines::DragonAge2::Area::removeFocus ( )

Forcibly remove the focus from the currently highlighted object.

Definition at line 379 of file area.cpp.

References _activeObject, and Engines::DragonAge2::Object::leave().

Referenced by hide().

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

◆ setActive()

void Engines::DragonAge2::Area::setActive ( DragonAge2::Object object)
private

Definition at line 333 of file area.cpp.

References _activeObject, Engines::DragonAge2::Object::enter(), and Engines::DragonAge2::Object::leave().

Referenced by checkActive().

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

◆ show()

void Engines::DragonAge2::Area::show ( )
virtual

Show the object's model(s).

Reimplemented from Engines::DragonAge2::Object.

Definition at line 207 of file area.cpp.

References _eventQueue, _objects, _rooms, and GfxMan.

Member Data Documentation

◆ _activeObject

DragonAge2::Object* Engines::DragonAge2::Area::_activeObject
private

The currently active (highlighted) object.

Definition at line 124 of file area.h.

Referenced by removeFocus(), and setActive().

◆ _campaign

Campaign* Engines::DragonAge2::Area::_campaign
private

Definition at line 102 of file area.h.

Referenced by clean(), click(), getEntryLocation(), and loadObject().

◆ _environmentID

uint32 Engines::DragonAge2::Area::_environmentID
private

Definition at line 106 of file area.h.

Referenced by loadEnvironment().

◆ _environmentName

Common::UString Engines::DragonAge2::Area::_environmentName
private

Definition at line 107 of file area.h.

Referenced by loadEnvironment().

◆ _eventQueue

std::list<Events::Event> Engines::DragonAge2::Area::_eventQueue
private

Definition at line 118 of file area.h.

Referenced by addEvent(), processEventQueue(), and show().

◆ _highlightAll

bool Engines::DragonAge2::Area::_highlightAll
private

Are we currently highlighting all objects?

Definition at line 126 of file area.h.

Referenced by checkActive(), and highlightAll().

◆ _mutex

Common::Mutex Engines::DragonAge2::Area::_mutex
private

Definition at line 128 of file area.h.

Referenced by checkActive(), and click().

◆ _name

Aurora::LocString Engines::DragonAge2::Area::_name
private

Definition at line 113 of file area.h.

Referenced by getName(), and loadARE().

◆ _objectMap

ObjectMap Engines::DragonAge2::Area::_objectMap
private

Map of objects by their model IDs.

Definition at line 121 of file area.h.

Referenced by getObjectAt(), highlightAll(), and loadObject().

◆ _objects

Objects Engines::DragonAge2::Area::_objects
private

List of all objects in the area.

Definition at line 120 of file area.h.

Referenced by clean(), hide(), loadObject(), and show().

◆ _resources

ChangeList Engines::DragonAge2::Area::_resources
private

Definition at line 117 of file area.h.

Referenced by clean(), load(), and loadEnvironment().

◆ _resRef

Common::UString Engines::DragonAge2::Area::_resRef
private

Definition at line 104 of file area.h.

Referenced by getResRef().

◆ _rooms

Rooms Engines::DragonAge2::Area::_rooms
private

Definition at line 115 of file area.h.

Referenced by hide(), loadEnvironment(), and show().

◆ _script

Common::UString Engines::DragonAge2::Area::_script
private

Definition at line 111 of file area.h.

◆ _skyDome

Common::UString Engines::DragonAge2::Area::_skyDome
private

Definition at line 108 of file area.h.

Referenced by loadEnvironment().

◆ _startPoint

Common::UString Engines::DragonAge2::Area::_startPoint
private

Definition at line 110 of file area.h.

Referenced by getEntryLocation(), and loadEnvironment().


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