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

An area in Neverwinter Nights, holding all objects and room tiles within, as well as general area properties like the current background music and ambient sounds. More...

#include <area.h>

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

Classes

struct  Tile
 A tile. More...
 

Public Member Functions

 Area (Module &module, const Common::UString &resRef)
 
 ~Area ()
 
const Common::UStringgetResRef ()
 Return the area's resref (resource ID). More...
 
const Common::UStringgetName ()
 Return the area's localized name. More...
 
const Common::UStringgetDisplayName ()
 Return the area's localized display name. More...
 
const Common::UStringgetEnvironmentMap () const
 Return the area's environment map. More...
 
void show ()
 Show the area. More...
 
void hide ()
 Hide the area. More...
 
uint32 getMusicDayTrack () const
 Return the music track ID playing by day. More...
 
uint32 getMusicNightTrack () const
 Return the music track ID playing by night. More...
 
uint32 getMusicBattleTrack () const
 Return the music track ID playing in battle. More...
 
void setMusicDayTrack (uint32 track)
 Set the music track ID playing by day. More...
 
void setMusicNightTrack (uint32 track)
 Set the music track ID playing by night. More...
 
void setMusicBattleTrack (uint32 track)
 Set the music track ID playing in battle. More...
 
void stopSound ()
 Stop all sounds. More...
 
void stopAmbientMusic ()
 Stop the ambient music. More...
 
void stopAmbientSound ()
 Stop the ambient sound. More...
 
void playAmbientMusic (Common::UString music="")
 Play the specified music (or the area's default) as ambient music. More...
 
void playAmbientSound (Common::UString sound="")
 Play the specified sound (or the area's default) as ambient sound. 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::NWN::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void loadModel ()
 Load the object's model(s). More...
 
virtual void unloadModel ()
 Unload the object's model(s). More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetName () const
 Return the object's name. More...
 
const Common::UStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetPortrait () const
 Return the object's portrait. More...
 
const Common::UStringgetConversation () const
 Return the object's default conversation (DLG). More...
 
const Aurora::SSFFilegetSSF ()
 Return the object's sound set. 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...
 
Aurora::NWScript::ObjectgetPCSpeaker () const
 Return the PC currently speaking with this object. More...
 
void setPCSpeaker (Aurora::NWScript::Object *pc)
 Set the PC currently speaking with this object. More...
 
AreagetArea () const
 Return the area this object is currently in. More...
 
virtual void setArea (Area *)
 Set the area this object is currently in. 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...
 
Location getLocation () const
 Create a Location out of the object's area, position and 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...
 
virtual void speakString (const Common::UString &string, uint32 volume)
 Speak the specified string. More...
 
void speakOneLiner (Common::UString conv, Object *tokenTarget=0)
 Speak an one-liner from the specified conversation file. More...
 
void stopSound ()
 Stop the current object sound. More...
 
void playSound (const Common::UString &sound, bool pitchVariance=false)
 Play an object sound. More...
 
virtual void playAnimation (const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
 Play an object animation. More...
 
virtual void playAnimation (Animation animation, bool restart=true, float length=0.0f, float speed=1.0f)
 Play a default object animation. 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::NWN::ScriptContainer
 ScriptContainer ()
 
 ~ScriptContainer ()
 
const Common::UStringgetScript (Script script) const
 
bool hasScript (Script script) const
 
bool runScript (Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
- Public Member Functions inherited from Events::Notifyable
 Notifyable ()
 
virtual ~Notifyable ()
 

Static Public Member Functions

static Common::UString getName (const Common::UString &resRef)
 Return the localized name of an area. More...
 
- Static Public Member Functions inherited from Engines::NWN::ScriptContainer
static bool runScript (const Common::UString &script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 

Protected Member Functions

void notifyCameraMoved ()
 Notify the area that the camera has been moved. More...
 
- Protected Member Functions inherited from Engines::NWN::Object
void loadSSF ()
 Load the object's sound set. More...
 
bool beginConversation (Object *triggerer)
 Begin a conversation between the triggerer and this object. More...
 
virtual bool createTooltip (Tooltip::Type type)
 Create an empty tooltip. More...
 
bool createFeedbackTooltip ()
 Create a tooltip with the name and/or portrait of the object. More...
 
bool createSpeechTooltip (const Common::UString &line)
 Create a tooltip with a line the object should speak. More...
 
void destroyTooltip ()
 Destroy all tooltips on this object. More...
 
bool showFeedbackTooltip ()
 Create and show a tooltip with the name and/or portrait of the object. More...
 
bool showSpeechTooltip (const Common::UString &line)
 Create and show a tooltip with a line the object speaks. More...
 
void hideTooltip ()
 Hide the tooltip again. More...
 
- Protected Member Functions inherited from Engines::NWN::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 

Private Types

enum  Orientation { kOrientation0 = 0, kOrientation90 = 1, kOrientation180 = 2, kOrientation270 = 3 }
 Tile orientation. More...
 
typedef Common::PtrList< NWN::ObjectObjectList
 
typedef std::map< uint32, NWN::Object * > ObjectMap
 

Private Member Functions

void clear ()
 
void load ()
 
void loadARE (const Aurora::GFF3Struct &are)
 
void loadGIT (const Aurora::GFF3Struct &git)
 
void loadProperties (const Aurora::GFF3Struct &props)
 
void loadTiles (const Aurora::GFF3List &tiles)
 
void loadTile (const Aurora::GFF3Struct &t, Tile &tile)
 
void loadObject (NWN::Object &object)
 
void loadWaypoints (const Aurora::GFF3List &list)
 
void loadPlaceables (const Aurora::GFF3List &list)
 
void loadDoors (const Aurora::GFF3List &list)
 
void loadCreatures (const Aurora::GFF3List &list)
 
void loadModels ()
 
void unloadModels ()
 
void loadTileModels ()
 
void unloadTileModels ()
 
void loadTileset ()
 
void unloadTileset ()
 
void loadTiles ()
 
void unloadTiles ()
 
void checkActive (int x=-1, int y=-1)
 
void setActive (NWN::Object *object)
 
NWN::ObjectgetObjectAt (int x, int y)
 
void highlightAll (bool enabled)
 
void click (int x, int y)
 

Static Private Member Functions

static Common::UString createDisplayName (const Common::UString &name)
 

Private Attributes

Module_module
 The module this area is in. More...
 
Common::UString _resRef
 The area's resref (resource ID). More...
 
Common::UString _displayName
 The area's localized display name. More...
 
Common::UString _ambientDay
 Ambient sound that plays by day. More...
 
Common::UString _ambientNight
 Ambient sound that plays by night. More...
 
uint32 _musicDayTrack
 Music track ID that plays by day. More...
 
uint32 _musicNightTrack
 Music track ID that plays by night. More...
 
uint32 _musicBattleTrack
 Music track ID that plays in battle. More...
 
Common::UString _musicDay
 Music that plays by day. More...
 
Common::UString _musicNight
 Music that plays by night. More...
 
Common::UString _musicBattle
 Music that plays in battle. More...
 
std::vector< Common::UString_musicBattleStinger
 Battle music stingers. More...
 
float _ambientDayVol
 Day ambient sound volume. More...
 
float _ambientNightVol
 Night ambient sound volume. More...
 
bool _visible
 Is the area currently visible? More...
 
Sound::ChannelHandle _ambientSound
 Sound handle of the currently playing sound. More...
 
Sound::ChannelHandle _ambientMusic
 Sound handle of the currently playing music. More...
 
uint32 _width
 Width of the area in tiles, as seen from top-down. More...
 
uint32 _height
 Height of the area in tiles, as seen from top-down. More...
 
Common::UString _tilesetName
 Name of the tileset. More...
 
Common::ScopedPtr< Tileset_tileset
 The actual tileset. More...
 
std::vector< Tile_tiles
 The area's tiles. More...
 
ObjectList _objects
 List of all objects in the area. More...
 
ObjectMap _objectMap
 Map of all non-static objects in the area. More...
 
NWN::Object_activeObject
 The currently active (highlighted) object. More...
 
bool _highlightAll
 Are we currently highlighting all objects? More...
 
std::list< Events::Event_eventQueue
 The event queue. More...
 
Common::Mutex _mutex
 Mutex securing access to the area. More...
 

Friends

class Console
 

Additional Inherited Members

- Protected Attributes inherited from Engines::NWN::Object
ObjectType _type
 The object's type. More...
 
Common::UString _name
 The object's display name. More...
 
Common::UString _description
 The object's description. More...
 
Common::UString _portrait
 The object's portrait. More...
 
Common::UString _conversation
 The object's default conversation. More...
 
uint32 _soundSet
 The object's sound set, as an index into soundset.2da. More...
 
Common::ScopedPtr< Aurora::SSFFile_ssf
 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...
 
Aurora::NWScript::Object_pcSpeaker
 The current PC speaking with the object. More...
 
Area_area
 The area the object is currently in. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
Sound::ChannelHandle _sound
 The currently playing object sound. More...
 
Common::ScopedPtr< Tooltip_tooltip
 The tooltip displayed over the object. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Detailed Description

An area in Neverwinter Nights, holding all objects and room tiles 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 63 of file area.h.

Member Typedef Documentation

◆ ObjectList

Definition at line 150 of file area.h.

◆ ObjectMap

typedef std::map<uint32, NWN::Object *> Engines::NWN::Area::ObjectMap
private

Definition at line 151 of file area.h.

Member Enumeration Documentation

◆ Orientation

Tile orientation.

Enumerator
kOrientation0 

Rotated by 0°.

kOrientation90 

Rotated by 90°.

kOrientation180 

Rotated by 180°.

kOrientation270 

Rotated by 270°.

Definition at line 126 of file area.h.

Constructor & Destructor Documentation

◆ Area()

Engines::NWN::Area::Area ( Module module,
const Common::UString resRef 
)

Definition at line 55 of file area.cpp.

References _module, Engines::NWN::ObjectContainer::addObject(), clear(), and load().

Here is the call graph for this function:

◆ ~Area()

Engines::NWN::Area::~Area ( )

Definition at line 70 of file area.cpp.

References _module, clear(), hide(), removeFocus(), and Engines::NWN::ObjectContainer::removeObject().

Here is the call graph for this function:

Member Function Documentation

◆ addEvent()

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

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

Definition at line 525 of file area.cpp.

References _eventQueue.

Referenced by Engines::NWN::Module::handleEvents().

Here is the caller graph for this function:

◆ checkActive()

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

Definition at line 581 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:

◆ clear()

void Engines::NWN::Area::clear ( )
private

Definition at line 88 of file area.cpp.

References _module, _objects, _tiles, _tileset, Common::PtrList< T, Deallocator >::clear(), and Engines::NWN::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::NWN::Area::click ( int  x,
int  y 
)
private

Definition at line 593 of file area.cpp.

References _module, _mutex, Engines::NWN::Object::click(), getObjectAt(), and Engines::NWN::Module::getPC().

Referenced by processEventQueue().

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

◆ createDisplayName()

Common::UString Engines::NWN::Area::createDisplayName ( const Common::UString name)
staticprivate

Definition at line 626 of file area.cpp.

References Common::UString::begin(), and Common::UString::end().

Referenced by loadARE().

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

◆ getDisplayName()

const Common::UString & Engines::NWN::Area::getDisplayName ( )

Return the area's localized display name.

Definition at line 128 of file area.cpp.

References _displayName.

◆ getEnvironmentMap()

const Common::UString & Engines::NWN::Area::getEnvironmentMap ( ) const

Return the area's environment map.

Definition at line 132 of file area.cpp.

References _tileset, and Aurora::kEmptyString.

Referenced by Engines::NWN::Creature::loadModel(), and Engines::NWN::Creature::setArea().

Here is the caller graph for this function:

◆ getMusicBattleTrack()

uint32 Engines::NWN::Area::getMusicBattleTrack ( ) const

Return the music track ID playing in battle.

Definition at line 146 of file area.cpp.

References _musicBattleTrack.

◆ getMusicDayTrack()

uint32 Engines::NWN::Area::getMusicDayTrack ( ) const

Return the music track ID playing by day.

Definition at line 138 of file area.cpp.

References _musicDayTrack.

Referenced by Engines::NWN::Functions::musicBackgroundGetDayTrack().

Here is the caller graph for this function:

◆ getMusicNightTrack()

uint32 Engines::NWN::Area::getMusicNightTrack ( ) const

Return the music track ID playing by night.

Definition at line 142 of file area.cpp.

References _musicNightTrack.

Referenced by Engines::NWN::Functions::musicBackgroundGetNightTrack().

Here is the caller graph for this function:

◆ getName() [1/2]

const Common::UString & Engines::NWN::Area::getName ( )

Return the area's localized name.

Definition at line 124 of file area.cpp.

References Engines::NWN::Object::getName().

Referenced by Engines::NWN::Console::cmdListAreas(), and Engines::NWN::Module::enterArea().

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

◆ getName() [2/2]

Common::UString Engines::NWN::Area::getName ( const Common::UString resRef)
static

Return the localized name of an area.

Definition at line 104 of file area.cpp.

References Common::UString::empty(), Common::UString::end(), Common::UString::erase(), Aurora::GFF3Struct::getString(), Aurora::GFF3File::getTopLevel(), Aurora::kFileTypeARE, and MKTAG.

Here is the call graph for this function:

◆ getObjectAt()

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

Definition at line 556 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::NWN::Area::getResRef ( )

Return the area's resref (resource ID).

Definition at line 120 of file area.cpp.

References _resRef.

Referenced by Engines::NWN::Module::enterArea(), and Engines::NWN::Functions::jumpTo().

Here is the caller graph for this function:

◆ hide()

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

Hide the area.

Reimplemented from Engines::NWN::Object.

Definition at line 246 of file area.cpp.

References _objects, _tiles, _visible, GfxMan, removeFocus(), stopSound(), and unloadModels().

Referenced by Engines::NWN::Module::enterArea(), and ~Area().

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

◆ highlightAll()

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

Definition at line 603 of file area.cpp.

References _highlightAll, and _objectMap.

Referenced by processEventQueue().

Here is the caller graph for this function:

◆ load()

void Engines::NWN::Area::load ( )
private

Definition at line 80 of file area.cpp.

References _resRef, Aurora::GFF3File::getTopLevel(), Aurora::kFileTypeARE, Aurora::kFileTypeGIT, loadARE(), loadGIT(), and MKTAG.

Referenced by Area().

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

◆ loadARE()

void Engines::NWN::Area::loadARE ( const Aurora::GFF3Struct are)
private

◆ loadCreatures()

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

Definition at line 517 of file area.cpp.

References loadObject().

Referenced by loadGIT().

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

◆ loadDoors()

void Engines::NWN::Area::loadDoors ( const Aurora::GFF3List list)
private

Definition at line 509 of file area.cpp.

References _module, and loadObject().

Referenced by loadGIT().

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

◆ loadGIT()

void Engines::NWN::Area::loadGIT ( const Aurora::GFF3Struct git)
private

Definition at line 299 of file area.cpp.

References Aurora::GFF3Struct::getList(), Aurora::GFF3Struct::getStruct(), Aurora::GFF3Struct::hasField(), loadCreatures(), loadDoors(), loadPlaceables(), loadProperties(), and loadWaypoints().

Referenced by load().

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

◆ loadModels()

void Engines::NWN::Area::loadModels ( )
private

Definition at line 390 of file area.cpp.

References _objectMap, _objects, Engines::NWN::Object::isStatic(), Engines::NWN::Object::loadModel(), and loadTileModels().

Referenced by show().

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

◆ loadObject()

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

Definition at line 486 of file area.cpp.

References _module, _objects, and Engines::NWN::ObjectContainer::addObject().

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

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

◆ loadPlaceables()

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

Definition at line 501 of file area.cpp.

References loadObject().

Referenced by loadGIT().

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

◆ loadProperties()

void Engines::NWN::Area::loadProperties ( const Aurora::GFF3Struct props)
private

Definition at line 321 of file area.cpp.

References _ambientDay, _ambientDayVol, _ambientNight, _ambientNightVol, Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::GFF3Struct::getUint(), Aurora::kStrRefInvalid, setMusicBattleTrack(), setMusicDayTrack(), setMusicNightTrack(), and TwoDAReg.

Referenced by loadGIT().

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

◆ loadTile()

void Engines::NWN::Area::loadTile ( const Aurora::GFF3Struct t,
Tile tile 
)
private

◆ loadTileModels()

void Engines::NWN::Area::loadTileModels ( )
private

Definition at line 416 of file area.cpp.

References loadTiles(), and loadTileset().

Referenced by loadModels().

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

◆ loadTiles() [1/2]

void Engines::NWN::Area::loadTiles ( const Aurora::GFF3List tiles)
private

Definition at line 351 of file area.cpp.

References _height, _tiles, _width, and loadTile().

Here is the call graph for this function:

◆ loadTiles() [2/2]

void Engines::NWN::Area::loadTiles ( )
private

◆ loadTileset()

void Engines::NWN::Area::loadTileset ( )
private

Definition at line 426 of file area.cpp.

References _resRef, _tileset, _tilesetName, Common::StackException::add(), Common::UString::c_str(), Common::UString::empty(), and status().

Referenced by loadTileModels().

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

◆ loadWaypoints()

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

Definition at line 493 of file area.cpp.

References loadObject().

Referenced by loadGIT().

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

◆ notifyCameraMoved()

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

Notify the area that the camera has been moved.

Reimplemented from Events::Notifyable.

Definition at line 621 of file area.cpp.

References checkActive().

Here is the call graph for this function:

◆ playAmbientMusic()

void Engines::NWN::Area::playAmbientMusic ( Common::UString  music = "")

Play the specified music (or the area's default) as ambient music.

Definition at line 195 of file area.cpp.

References _ambientMusic, _musicDay, Common::UString::empty(), Sound::kSoundTypeMusic, Engines::playSound(), and stopAmbientMusic().

Referenced by Engines::NWN::Functions::musicBackgroundPlay(), Engines::NWN::Game::playMusic(), and show().

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

◆ playAmbientSound()

void Engines::NWN::Area::playAmbientSound ( Common::UString  sound = "")

Play the specified sound (or the area's default) as ambient sound.

Definition at line 208 of file area.cpp.

References _ambientDay, _ambientDayVol, _ambientSound, Common::UString::empty(), Sound::kSoundTypeSFX, Engines::playSound(), and stopAmbientSound().

Referenced by show().

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

◆ processEventQueue()

void Engines::NWN::Area::processEventQueue ( )

Process the current event queue.

Definition at line 529 of file area.cpp.

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

Referenced by Engines::NWN::Module::handleEvents().

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

◆ removeFocus()

void Engines::NWN::Area::removeFocus ( )

Forcibly remove the focus from the currently highlighted object.

Definition at line 614 of file area.cpp.

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

Referenced by hide(), Engines::NWN::Module::showMenu(), and ~Area().

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

◆ setActive()

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

Definition at line 568 of file area.cpp.

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

Referenced by checkActive().

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

◆ setMusicBattleTrack()

void Engines::NWN::Area::setMusicBattleTrack ( uint32  track)

Set the music track ID playing in battle.

Definition at line 160 of file area.cpp.

References _musicBattle, _musicBattleStinger, _musicBattleTrack, Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::kStrRefInvalid, and TwoDAReg.

Referenced by loadProperties().

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

◆ setMusicDayTrack()

void Engines::NWN::Area::setMusicDayTrack ( uint32  track)

Set the music track ID playing by day.

Definition at line 150 of file area.cpp.

References _musicDay, _musicDayTrack, and TwoDAReg.

Referenced by loadProperties(), and Engines::NWN::Functions::musicBackgroundChangeDay().

Here is the caller graph for this function:

◆ setMusicNightTrack()

void Engines::NWN::Area::setMusicNightTrack ( uint32  track)

Set the music track ID playing by night.

Definition at line 155 of file area.cpp.

References _musicNight, _musicNightTrack, and TwoDAReg.

Referenced by loadProperties(), and Engines::NWN::Functions::musicBackgroundChangeNight().

Here is the caller graph for this function:

◆ show()

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

Show the area.

Reimplemented from Engines::NWN::Object.

Definition at line 221 of file area.cpp.

References _objects, _tiles, _visible, GfxMan, loadModels(), playAmbientMusic(), and playAmbientSound().

Referenced by Engines::NWN::Module::enterArea().

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

◆ stopAmbientMusic()

void Engines::NWN::Area::stopAmbientMusic ( )

Stop the ambient music.

Definition at line 187 of file area.cpp.

References _ambientMusic, and SoundMan.

Referenced by Engines::NWN::Functions::musicBackgroundStop(), playAmbientMusic(), Engines::NWN::Game::stopMusic(), and stopSound().

Here is the caller graph for this function:

◆ stopAmbientSound()

void Engines::NWN::Area::stopAmbientSound ( )

Stop the ambient sound.

Definition at line 191 of file area.cpp.

References _ambientSound, and SoundMan.

Referenced by playAmbientSound(), and stopSound().

Here is the caller graph for this function:

◆ stopSound()

void Engines::NWN::Area::stopSound ( )

Stop all sounds.

Definition at line 182 of file area.cpp.

References stopAmbientMusic(), and stopAmbientSound().

Referenced by hide().

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

◆ unloadModels()

void Engines::NWN::Area::unloadModels ( )
private

Definition at line 407 of file area.cpp.

References _objectMap, _objects, and unloadTileModels().

Referenced by hide().

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

◆ unloadTileModels()

void Engines::NWN::Area::unloadTileModels ( )
private

Definition at line 421 of file area.cpp.

References unloadTiles(), and unloadTileset().

Referenced by unloadModels().

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

◆ unloadTiles()

void Engines::NWN::Area::unloadTiles ( )
private

Definition at line 471 of file area.cpp.

References _height, _tiles, _width, Engines::NWN::Area::Tile::model, and Engines::NWN::Area::Tile::tile.

Referenced by unloadTileModels().

Here is the caller graph for this function:

◆ unloadTileset()

void Engines::NWN::Area::unloadTileset ( )
private

Definition at line 440 of file area.cpp.

References _tileset.

Referenced by unloadTileModels().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Console

friend class Console
friend

Definition at line 249 of file area.h.

Member Data Documentation

◆ _activeObject

NWN::Object* Engines::NWN::Area::_activeObject
private

The currently active (highlighted) object.

Definition at line 194 of file area.h.

Referenced by removeFocus(), and setActive().

◆ _ambientDay

Common::UString Engines::NWN::Area::_ambientDay
private

Ambient sound that plays by day.

Definition at line 160 of file area.h.

Referenced by loadProperties(), and playAmbientSound().

◆ _ambientDayVol

float Engines::NWN::Area::_ambientDayVol
private

Day ambient sound volume.

Definition at line 174 of file area.h.

Referenced by loadProperties(), and playAmbientSound().

◆ _ambientMusic

Sound::ChannelHandle Engines::NWN::Area::_ambientMusic
private

Sound handle of the currently playing music.

Definition at line 180 of file area.h.

Referenced by playAmbientMusic(), and stopAmbientMusic().

◆ _ambientNight

Common::UString Engines::NWN::Area::_ambientNight
private

Ambient sound that plays by night.

Definition at line 161 of file area.h.

Referenced by loadProperties().

◆ _ambientNightVol

float Engines::NWN::Area::_ambientNightVol
private

Night ambient sound volume.

Definition at line 175 of file area.h.

Referenced by loadProperties().

◆ _ambientSound

Sound::ChannelHandle Engines::NWN::Area::_ambientSound
private

Sound handle of the currently playing sound.

Definition at line 179 of file area.h.

Referenced by playAmbientSound(), and stopAmbientSound().

◆ _displayName

Common::UString Engines::NWN::Area::_displayName
private

The area's localized display name.

Definition at line 158 of file area.h.

Referenced by getDisplayName(), and loadARE().

◆ _eventQueue

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

The event queue.

Definition at line 198 of file area.h.

Referenced by addEvent(), and processEventQueue().

◆ _height

uint32 Engines::NWN::Area::_height
private

Height of the area in tiles, as seen from top-down.

Definition at line 183 of file area.h.

Referenced by loadARE(), loadTiles(), and unloadTiles().

◆ _highlightAll

bool Engines::NWN::Area::_highlightAll
private

Are we currently highlighting all objects?

Definition at line 196 of file area.h.

Referenced by checkActive(), and highlightAll().

◆ _module

Module* Engines::NWN::Area::_module
private

The module this area is in.

Definition at line 154 of file area.h.

Referenced by Area(), clear(), click(), loadDoors(), loadObject(), and ~Area().

◆ _musicBattle

Common::UString Engines::NWN::Area::_musicBattle
private

Music that plays in battle.

Definition at line 169 of file area.h.

Referenced by setMusicBattleTrack().

◆ _musicBattleStinger

std::vector<Common::UString> Engines::NWN::Area::_musicBattleStinger
private

Battle music stingers.

Definition at line 172 of file area.h.

Referenced by setMusicBattleTrack().

◆ _musicBattleTrack

uint32 Engines::NWN::Area::_musicBattleTrack
private

Music track ID that plays in battle.

Definition at line 165 of file area.h.

Referenced by getMusicBattleTrack(), and setMusicBattleTrack().

◆ _musicDay

Common::UString Engines::NWN::Area::_musicDay
private

Music that plays by day.

Definition at line 167 of file area.h.

Referenced by playAmbientMusic(), and setMusicDayTrack().

◆ _musicDayTrack

uint32 Engines::NWN::Area::_musicDayTrack
private

Music track ID that plays by day.

Definition at line 163 of file area.h.

Referenced by getMusicDayTrack(), and setMusicDayTrack().

◆ _musicNight

Common::UString Engines::NWN::Area::_musicNight
private

Music that plays by night.

Definition at line 168 of file area.h.

Referenced by setMusicNightTrack().

◆ _musicNightTrack

uint32 Engines::NWN::Area::_musicNightTrack
private

Music track ID that plays by night.

Definition at line 164 of file area.h.

Referenced by getMusicNightTrack(), and setMusicNightTrack().

◆ _mutex

Common::Mutex Engines::NWN::Area::_mutex
private

Mutex securing access to the area.

Definition at line 200 of file area.h.

Referenced by checkActive(), and click().

◆ _objectMap

ObjectMap Engines::NWN::Area::_objectMap
private

Map of all non-static objects in the area.

Definition at line 191 of file area.h.

Referenced by getObjectAt(), highlightAll(), loadModels(), and unloadModels().

◆ _objects

ObjectList Engines::NWN::Area::_objects
private

List of all objects in the area.

Definition at line 190 of file area.h.

Referenced by clear(), hide(), loadModels(), loadObject(), show(), and unloadModels().

◆ _resRef

Common::UString Engines::NWN::Area::_resRef
private

The area's resref (resource ID).

Definition at line 156 of file area.h.

Referenced by getResRef(), load(), and loadTileset().

◆ _tiles

std::vector<Tile> Engines::NWN::Area::_tiles
private

The area's tiles.

Definition at line 188 of file area.h.

Referenced by clear(), hide(), loadARE(), loadTiles(), show(), and unloadTiles().

◆ _tileset

Common::ScopedPtr<Tileset> Engines::NWN::Area::_tileset
private

The actual tileset.

Definition at line 186 of file area.h.

Referenced by clear(), getEnvironmentMap(), loadTiles(), loadTileset(), and unloadTileset().

◆ _tilesetName

Common::UString Engines::NWN::Area::_tilesetName
private

Name of the tileset.

Definition at line 185 of file area.h.

Referenced by loadARE(), and loadTileset().

◆ _visible

bool Engines::NWN::Area::_visible
private

Is the area currently visible?

Definition at line 177 of file area.h.

Referenced by hide(), and show().

◆ _width

uint32 Engines::NWN::Area::_width
private

Width of the area in tiles, as seen from top-down.

Definition at line 182 of file area.h.

Referenced by loadARE(), loadTiles(), and unloadTiles().


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