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

An area in Star Wars: Knights of the Old Republic, 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::KotOR::Area:
Inheritance graph
[legend]
Collaboration diagram for Engines::KotOR::Area:
Collaboration graph
[legend]

Classes

struct  CameraStyle
 

Public Member Functions

 Area (Module &module, const Common::UString &resRef)
 
 ~Area ()
 
const Common::UStringgetResRef ()
 Return the area's resref (resource ID). More...
 
int getNorthAxis ()
 Get the north axis id. More...
 
void getMapPoint1 (float &x, float &y)
 Get the first map point. More...
 
void getMapPoint2 (float &x, float &y)
 Get the second map point. More...
 
void getWorldPoint1 (float &x, float &y)
 Get the first world point. More...
 
void getWorldPoint2 (float &x, float &y)
 Get the second world point. More...
 
void show ()
 Show the object's model(s). More...
 
void hide ()
 Hide the object's model(s). 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...
 
float evaluateElevation (Object *object, float x, float y, bool doHighlight=true)
 
bool testCollision (const glm::vec3 &orig, const glm::vec3 &dest) const
 
void toggleWalkmesh ()
 
void toggleTriggers ()
 .— Triggers More...
 
void evaluateTriggers (float x, float y)
 
void showAllRooms ()
 '— More...
 
void notifyObjectMoved (Object &o)
 
void notifyPCMoved ()
 
void getCameraStyle (float &distance, float &pitch, float &height) const
 
const std::vector< Common::UString > & getRoomsVisibleFrom (const Common::UString &room) const
 
KotOR::ObjectgetActiveObject ()
 
KotOR::ObjectgetObjectByTag (const Common::UString &tag)
 
void processCreaturesActions (float dt)
 
void removeObject (KotOR::Object *object)
 
- Public Member Functions inherited from Engines::KotOR::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void hideSoft ()
 Hide the object's model(s) if applicable. More...
 
virtual bool isVisible () const
 Is the object's model(s) visible? 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...
 
void setMaxHitPoints (int maxHP)
 Set the maximum hit points for the objects. More...
 
int getMaxHitPoints ()
 Get the maximum hit points for the objects. More...
 
void setCurrentHitPoints (int hitpoints)
 Set the current hitpoints. More...
 
int getCurrentHitPoints ()
 Return the objects current hitpoints. More...
 
void setMinOneHitPoints (bool enabled)
 Set if the object has a minimum of one hp. More...
 
bool getMinOneHitPoints () const
 Get if the object has a minimum of one hp. 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...
 
void makeLookAt (float x, float y)
 
void makeLookAt (Object *target)
 
RoomgetRoom ()
 Get a room the object is in. More...
 
void setRoom (Room *room)
 Set a room the object is in. 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...
 
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 &anim, bool restart=true, float length=0.0f, float speed=1.0f)
 
- 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::KotOR::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 ()
 

Protected Member Functions

void notifyCameraMoved ()
 
- Protected Member Functions inherited from Engines::KotOR::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff, bool clear=true)
 
void readScripts (const ScriptContainer &container)
 

Private Types

typedef Common::PtrList< RoomRoomList
 
typedef Common::PtrList< KotOR::ObjectObjectList
 
typedef std::map< uint32, KotOR::Object * > ObjectMap
 

Private Member Functions

void clear ()
 
void load ()
 
void loadLYT ()
 
void loadVIS ()
 
void loadARE (const Aurora::GFF3Struct &are)
 
void loadGIT (const Aurora::GFF3Struct &git)
 
void loadCameraStyle (uint32 id)
 
void loadRooms ()
 
void loadProperties (const Aurora::GFF3Struct &props)
 
void loadObject (KotOR::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 loadSounds (const Aurora::GFF3List &list)
 
void loadTriggers (const Aurora::GFF3List &list)
 
void unload ()
 
void checkActive (int x=-1, int y=-1)
 
void setActive (KotOR::Object *object)
 
KotOR::ObjectgetObjectAt (int x, int y)
 
void highlightAll (bool enabled)
 
void click (int x, int y)
 
RoomgetRoomAt (float x, float y) const
 

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...
 
float _worldPt1X
 
float _worldPt1Y
 
float _worldPt2X
 
float _worldPt2Y
 
float _mapPt1X
 
float _mapPt1Y
 
float _mapPt2X
 
float _mapPt2Y
 
int _northAxis
 
Sound::ChannelHandle _ambientSound
 Sound handle of the currently playing sound. More...
 
Sound::ChannelHandle _ambientMusic
 Sound handle of the currently playing music. More...
 
Aurora::LYTFile _lyt
 The area's layout description. More...
 
Aurora::VISFile _vis
 The area's inter-room visibility description. More...
 
RoomList _rooms
 All rooms in the area. More...
 
ObjectList _objects
 List of all objects in the area. More...
 
ObjectMap _objectMap
 Map of all non-static objects in the area. More...
 
std::vector< Creature * > _creatures
 
KotOR::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...
 
std::vector< Trigger * > _triggers
 .— Triggers More...
 
bool _triggersVisible
 
Trigger_activeTrigger
 
CameraStyle _cameraStyle
 '— More...
 
bool _walkmeshInvisible
 
std::list< Situated * > _situatedObjects
 

Friends

class Console
 
class ActionExecutor
 

Additional Inherited Members

- Static Public Member Functions inherited from Engines::KotOR::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 Attributes inherited from Engines::KotOR::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...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
int _currentHitPoints
 The current hitpoints of the object. More...
 
int _maxHitPoints
 The maximum hitpoints of the object. More...
 
bool _minOneHitPoint
 If the object should have at least one hitpoint. 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...
 
Sound::ChannelHandle _sound
 The currently playing object sound. More...
 
Room_room
 Room the object is in. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Detailed Description

An area in Star Wars: Knights of the Old Republic, 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 65 of file area.h.

Member Typedef Documentation

◆ ObjectList

Definition at line 162 of file area.h.

◆ ObjectMap

Definition at line 163 of file area.h.

◆ RoomList

Definition at line 160 of file area.h.

Constructor & Destructor Documentation

◆ Area()

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

Definition at line 66 of file area.cpp.

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

Here is the call graph for this function:

◆ ~Area()

Engines::KotOR::Area::~Area ( )

Definition at line 88 of file area.cpp.

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

Here is the call graph for this function:

Member Function Documentation

◆ addEvent()

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

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

Definition at line 464 of file area.cpp.

References _eventQueue.

◆ checkActive()

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

Definition at line 520 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::KotOR::Area::clear ( )
private

Definition at line 111 of file area.cpp.

References _activeTrigger, _creatures, _module, _objects, _rooms, _situatedObjects, _triggers, Common::PtrList< T, Deallocator >::clear(), and Engines::KotOR::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::KotOR::Area::click ( int  x,
int  y 
)
private

Definition at line 532 of file area.cpp.

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

Referenced by processEventQueue().

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

◆ evaluateElevation()

float Engines::KotOR::Area::evaluateElevation ( Object object,
float  x,
float  y,
bool  doHighlight = true 
)

Definition at line 565 of file area.cpp.

References _rooms, Engines::KotOR::Room::disableWalkmeshHighlight(), Engines::KotOR::Room::evaluateElevation(), and FLT_MIN.

Referenced by Engines::KotOR::ActionExecutor::moveTo().

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

◆ evaluateTriggers()

void Engines::KotOR::Area::evaluateTriggers ( float  x,
float  y 
)

◆ getActiveObject()

KotOR::Object * Engines::KotOR::Area::getActiveObject ( )

Definition at line 724 of file area.cpp.

References _activeObject.

◆ getCameraStyle()

void Engines::KotOR::Area::getCameraStyle ( float &  distance,
float &  pitch,
float &  height 
) const

◆ getMapPoint1()

void Engines::KotOR::Area::getMapPoint1 ( float &  x,
float &  y 
)

Get the first map point.

Definition at line 210 of file area.cpp.

References _mapPt1X, and _mapPt1Y.

◆ getMapPoint2()

void Engines::KotOR::Area::getMapPoint2 ( float &  x,
float &  y 
)

Get the second map point.

Definition at line 215 of file area.cpp.

References _mapPt2X, and _mapPt2Y.

◆ getMusicBattleTrack()

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

Return the music track ID playing in battle.

Definition at line 131 of file area.cpp.

References _musicBattleTrack.

◆ getMusicDayTrack()

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

Return the music track ID playing by day.

Definition at line 123 of file area.cpp.

References _musicDayTrack.

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

Here is the caller graph for this function:

◆ getMusicNightTrack()

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

Return the music track ID playing by night.

Definition at line 127 of file area.cpp.

References _musicNightTrack.

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

Here is the caller graph for this function:

◆ getNorthAxis()

int Engines::KotOR::Area::getNorthAxis ( )

Get the north axis id.

Definition at line 206 of file area.cpp.

References _northAxis.

◆ getObjectAt()

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

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

◆ getObjectByTag()

KotOR::Object * Engines::KotOR::Area::getObjectByTag ( const Common::UString tag)

Definition at line 728 of file area.cpp.

References _objects.

Referenced by Engines::KotOR::DialogGUI::makeLookAtPC(), Engines::KotOR::DialogGUI::playDefaultAnimations(), and Engines::KotOR::DialogGUI::playTalkAnimations().

Here is the caller graph for this function:

◆ getResRef()

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

Return the area's resref (resource ID).

◆ getRoomAt()

Room * Engines::KotOR::Area::getRoomAt ( float  x,
float  y 
) const
private

Definition at line 771 of file area.cpp.

References _rooms, and FLT_MIN.

Referenced by notifyObjectMoved().

Here is the caller graph for this function:

◆ getRoomsVisibleFrom()

const std::vector< Common::UString > & Engines::KotOR::Area::getRoomsVisibleFrom ( const Common::UString room) const

Definition at line 720 of file area.cpp.

References _vis, and Aurora::VISFile::getVisibilityArray().

Referenced by Engines::KotOR::Console::cmdListRoomsVisibleFrom().

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

◆ getWorldPoint1()

void Engines::KotOR::Area::getWorldPoint1 ( float &  x,
float &  y 
)

Get the first world point.

Definition at line 220 of file area.cpp.

References _worldPt1X, and _worldPt1Y.

◆ getWorldPoint2()

void Engines::KotOR::Area::getWorldPoint2 ( float &  x,
float &  y 
)

Get the second world point.

Definition at line 225 of file area.cpp.

References _worldPt2X, and _worldPt2Y.

◆ hide()

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

Hide the object's model(s).

Reimplemented from Engines::KotOR::Object.

Definition at line 253 of file area.cpp.

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

Referenced by ~Area().

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

◆ highlightAll()

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

Definition at line 543 of file area.cpp.

References _highlightAll, and _objectMap.

Referenced by processEventQueue().

Here is the caller graph for this function:

◆ load()

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

Definition at line 98 of file area.cpp.

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

Referenced by Area().

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

◆ loadARE()

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

◆ loadCameraStyle()

void Engines::KotOR::Area::loadCameraStyle ( uint32  id)
private

Definition at line 330 of file area.cpp.

References _cameraStyle, Engines::KotOR::Area::CameraStyle::distance, Aurora::TwoDARow::getFloat(), Aurora::TwoDAFile::getRow(), Engines::KotOR::Area::CameraStyle::height, Engines::KotOR::Area::CameraStyle::pitch, and TwoDAReg.

Referenced by loadARE().

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

◆ loadCreatures()

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

Definition at line 438 of file area.cpp.

References _creatures, and loadObject().

Referenced by loadGIT().

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

◆ loadDoors()

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

Definition at line 429 of file area.cpp.

References _module, _situatedObjects, and loadObject().

Referenced by loadGIT().

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

◆ loadGIT()

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

Definition at line 338 of file area.cpp.

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

Referenced by load().

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

◆ loadLYT()

void Engines::KotOR::Area::loadLYT ( )
private

Definition at line 276 of file area.cpp.

References _lyt, _resRef, Common::StackException::add(), Common::UString::c_str(), Aurora::kFileTypeLYT, Aurora::LYTFile::load(), and ResMan.

Referenced by load().

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

◆ loadObject()

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

Definition at line 398 of file area.cpp.

References _module, _objectMap, _objects, Engines::KotOR::ObjectContainer::addObject(), Engines::KotOR::Object::isStatic(), and notifyObjectMoved().

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

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

◆ loadPlaceables()

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

Definition at line 420 of file area.cpp.

References _situatedObjects, and loadObject().

Referenced by loadGIT().

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

◆ loadProperties()

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

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

◆ loadRooms()

void Engines::KotOR::Area::loadRooms ( )
private

Definition at line 391 of file area.cpp.

References _lyt, _rooms, and Aurora::LYTFile::getRooms().

Referenced by load().

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

◆ loadSounds()

void Engines::KotOR::Area::loadSounds ( const Aurora::GFF3List list)
private

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

◆ loadTriggers()

void Engines::KotOR::Area::loadTriggers ( const Aurora::GFF3List list)
private

Definition at line 447 of file area.cpp.

References _triggers, and loadObject().

Referenced by loadGIT().

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

◆ loadVIS()

void Engines::KotOR::Area::loadVIS ( )
private

Definition at line 290 of file area.cpp.

References _resRef, _vis, Common::StackException::add(), Common::UString::c_str(), Aurora::kFileTypeVIS, Aurora::VISFile::load(), and ResMan.

Referenced by load().

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

◆ loadWaypoints()

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

Definition at line 412 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::KotOR::Area::notifyCameraMoved ( )
protectedvirtual

Reimplemented from Events::Notifyable.

Definition at line 561 of file area.cpp.

References checkActive().

Here is the call graph for this function:

◆ notifyObjectMoved()

void Engines::KotOR::Area::notifyObjectMoved ( Object o)

Definition at line 659 of file area.cpp.

References Engines::KotOR::Object::getPosition(), getRoomAt(), and Engines::KotOR::Object::setRoom().

Referenced by loadObject(), and notifyPCMoved().

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

◆ notifyPCMoved()

void Engines::KotOR::Area::notifyPCMoved ( )

◆ playAmbientMusic()

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

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

Definition at line 180 of file area.cpp.

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

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

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

◆ playAmbientSound()

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

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

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

◆ processCreaturesActions()

void Engines::KotOR::Area::processCreaturesActions ( float  dt)

Definition at line 737 of file area.cpp.

References _creatures, and Engines::KotOR::ActionExecutor::executeActions().

Here is the call graph for this function:

◆ processEventQueue()

void Engines::KotOR::Area::processEventQueue ( )

Process the current event queue.

Definition at line 468 of file area.cpp.

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

Here is the call graph for this function:

◆ removeFocus()

void Engines::KotOR::Area::removeFocus ( )

Forcibly remove the focus from the currently highlighted object.

Definition at line 554 of file area.cpp.

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

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

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

◆ removeObject()

void Engines::KotOR::Area::removeObject ( KotOR::Object object)

◆ setActive()

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

Definition at line 507 of file area.cpp.

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

Referenced by checkActive().

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

◆ setMusicBattleTrack()

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

Set the music track ID playing in battle.

Definition at line 145 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::KotOR::Area::setMusicDayTrack ( uint32  track)

Set the music track ID playing by day.

Definition at line 135 of file area.cpp.

References _musicDay, _musicDayTrack, and TwoDAReg.

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

Here is the caller graph for this function:

◆ setMusicNightTrack()

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

Set the music track ID playing by night.

Definition at line 140 of file area.cpp.

References _musicNight, _musicNightTrack, and TwoDAReg.

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

Here is the caller graph for this function:

◆ show()

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

Show the object's model(s).

Reimplemented from Engines::KotOR::Object.

Definition at line 230 of file area.cpp.

References _objects, _rooms, _visible, GfxMan, playAmbientMusic(), and playAmbientSound().

Here is the call graph for this function:

◆ showAllRooms()

void Engines::KotOR::Area::showAllRooms ( )

'—

Definition at line 641 of file area.cpp.

References _objects, _rooms, and GfxMan.

◆ stopAmbientMusic()

void Engines::KotOR::Area::stopAmbientMusic ( )

Stop the ambient music.

Definition at line 172 of file area.cpp.

References _ambientMusic, and SoundMan.

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

Here is the caller graph for this function:

◆ stopAmbientSound()

void Engines::KotOR::Area::stopAmbientSound ( )

Stop the ambient sound.

Definition at line 176 of file area.cpp.

References _ambientSound, and SoundMan.

Referenced by playAmbientSound(), and stopSound().

Here is the caller graph for this function:

◆ stopSound()

void Engines::KotOR::Area::stopSound ( )

Stop all sounds.

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

◆ testCollision()

bool Engines::KotOR::Area::testCollision ( const glm::vec3 &  orig,
const glm::vec3 &  dest 
) const

Definition at line 587 of file area.cpp.

References _situatedObjects.

Referenced by Engines::KotOR::ActionExecutor::moveTo().

Here is the caller graph for this function:

◆ toggleTriggers()

void Engines::KotOR::Area::toggleTriggers ( )

.— Triggers

Definition at line 610 of file area.cpp.

References _triggers, and _triggersVisible.

◆ toggleWalkmesh()

void Engines::KotOR::Area::toggleWalkmesh ( )

Definition at line 596 of file area.cpp.

References _rooms, _situatedObjects, and _walkmeshInvisible.

◆ unload()

void Engines::KotOR::Area::unload ( )
private

Friends And Related Function Documentation

◆ ActionExecutor

friend class ActionExecutor
friend

Definition at line 269 of file area.h.

◆ Console

friend class Console
friend

Definition at line 268 of file area.h.

Member Data Documentation

◆ _activeObject

KotOR::Object* Engines::KotOR::Area::_activeObject
private

The currently active (highlighted) object.

Definition at line 208 of file area.h.

Referenced by getActiveObject(), removeFocus(), and setActive().

◆ _activeTrigger

Trigger* Engines::KotOR::Area::_activeTrigger
private

Definition at line 219 of file area.h.

Referenced by clear(), evaluateTriggers(), and removeObject().

◆ _ambientDay

Common::UString Engines::KotOR::Area::_ambientDay
private

Ambient sound that plays by day.

Definition at line 171 of file area.h.

Referenced by loadProperties(), and playAmbientSound().

◆ _ambientDayVol

float Engines::KotOR::Area::_ambientDayVol
private

Day ambient sound volume.

Definition at line 185 of file area.h.

Referenced by loadProperties(), and playAmbientSound().

◆ _ambientMusic

Sound::ChannelHandle Engines::KotOR::Area::_ambientMusic
private

Sound handle of the currently playing music.

Definition at line 195 of file area.h.

Referenced by playAmbientMusic(), and stopAmbientMusic().

◆ _ambientNight

Common::UString Engines::KotOR::Area::_ambientNight
private

Ambient sound that plays by night.

Definition at line 172 of file area.h.

Referenced by loadProperties().

◆ _ambientNightVol

float Engines::KotOR::Area::_ambientNightVol
private

Night ambient sound volume.

Definition at line 186 of file area.h.

Referenced by loadProperties().

◆ _ambientSound

Sound::ChannelHandle Engines::KotOR::Area::_ambientSound
private

Sound handle of the currently playing sound.

Definition at line 194 of file area.h.

Referenced by playAmbientSound(), and stopAmbientSound().

◆ _cameraStyle

CameraStyle Engines::KotOR::Area::_cameraStyle
private

'—

Definition at line 222 of file area.h.

Referenced by getCameraStyle(), and loadCameraStyle().

◆ _creatures

std::vector<Creature *> Engines::KotOR::Area::_creatures
private

Definition at line 205 of file area.h.

Referenced by clear(), loadCreatures(), processCreaturesActions(), and removeObject().

◆ _displayName

Common::UString Engines::KotOR::Area::_displayName
private

The area's localized display name.

Definition at line 169 of file area.h.

◆ _eventQueue

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

The event queue.

Definition at line 212 of file area.h.

Referenced by addEvent(), and processEventQueue().

◆ _highlightAll

bool Engines::KotOR::Area::_highlightAll
private

Are we currently highlighting all objects?

Definition at line 210 of file area.h.

Referenced by checkActive(), and highlightAll().

◆ _lyt

Aurora::LYTFile Engines::KotOR::Area::_lyt
private

The area's layout description.

Definition at line 197 of file area.h.

Referenced by loadLYT(), and loadRooms().

◆ _mapPt1X

float Engines::KotOR::Area::_mapPt1X
private

Definition at line 191 of file area.h.

Referenced by getMapPoint1(), and loadARE().

◆ _mapPt1Y

float Engines::KotOR::Area::_mapPt1Y
private

Definition at line 191 of file area.h.

Referenced by getMapPoint1(), and loadARE().

◆ _mapPt2X

float Engines::KotOR::Area::_mapPt2X
private

Definition at line 191 of file area.h.

Referenced by getMapPoint2(), and loadARE().

◆ _mapPt2Y

float Engines::KotOR::Area::_mapPt2Y
private

Definition at line 191 of file area.h.

Referenced by getMapPoint2(), and loadARE().

◆ _module

Module* Engines::KotOR::Area::_module
private

◆ _musicBattle

Common::UString Engines::KotOR::Area::_musicBattle
private

Music that plays in battle.

Definition at line 180 of file area.h.

Referenced by setMusicBattleTrack().

◆ _musicBattleStinger

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

Battle music stingers.

Definition at line 183 of file area.h.

Referenced by setMusicBattleTrack().

◆ _musicBattleTrack

uint32 Engines::KotOR::Area::_musicBattleTrack
private

Music track ID that plays in battle.

Definition at line 176 of file area.h.

Referenced by getMusicBattleTrack(), and setMusicBattleTrack().

◆ _musicDay

Common::UString Engines::KotOR::Area::_musicDay
private

Music that plays by day.

Definition at line 178 of file area.h.

Referenced by playAmbientMusic(), and setMusicDayTrack().

◆ _musicDayTrack

uint32 Engines::KotOR::Area::_musicDayTrack
private

Music track ID that plays by day.

Definition at line 174 of file area.h.

Referenced by getMusicDayTrack(), and setMusicDayTrack().

◆ _musicNight

Common::UString Engines::KotOR::Area::_musicNight
private

Music that plays by night.

Definition at line 179 of file area.h.

Referenced by setMusicNightTrack().

◆ _musicNightTrack

uint32 Engines::KotOR::Area::_musicNightTrack
private

Music track ID that plays by night.

Definition at line 175 of file area.h.

Referenced by getMusicNightTrack(), and setMusicNightTrack().

◆ _mutex

Common::Mutex Engines::KotOR::Area::_mutex
private

Mutex securing access to the area.

Definition at line 214 of file area.h.

Referenced by checkActive(), and click().

◆ _northAxis

int Engines::KotOR::Area::_northAxis
private

Definition at line 192 of file area.h.

Referenced by getNorthAxis(), and loadARE().

◆ _objectMap

ObjectMap Engines::KotOR::Area::_objectMap
private

Map of all non-static objects in the area.

Definition at line 203 of file area.h.

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

◆ _objects

ObjectList Engines::KotOR::Area::_objects
private

List of all objects in the area.

Definition at line 202 of file area.h.

Referenced by clear(), getObjectByTag(), hide(), loadObject(), notifyPCMoved(), removeObject(), show(), and showAllRooms().

◆ _resRef

Common::UString Engines::KotOR::Area::_resRef
private

The area's resref (resource ID).

Definition at line 168 of file area.h.

Referenced by load(), loadLYT(), and loadVIS().

◆ _rooms

RoomList Engines::KotOR::Area::_rooms
private

All rooms in the area.

Definition at line 200 of file area.h.

Referenced by clear(), evaluateElevation(), getRoomAt(), hide(), loadRooms(), notifyPCMoved(), show(), showAllRooms(), and toggleWalkmesh().

◆ _situatedObjects

std::list<Situated *> Engines::KotOR::Area::_situatedObjects
private

Definition at line 224 of file area.h.

Referenced by clear(), loadDoors(), loadPlaceables(), removeObject(), testCollision(), and toggleWalkmesh().

◆ _triggers

std::vector<Trigger *> Engines::KotOR::Area::_triggers
private

.— Triggers

Definition at line 217 of file area.h.

Referenced by clear(), evaluateTriggers(), loadTriggers(), removeObject(), and toggleTriggers().

◆ _triggersVisible

bool Engines::KotOR::Area::_triggersVisible
private

Definition at line 218 of file area.h.

Referenced by toggleTriggers().

◆ _vis

Aurora::VISFile Engines::KotOR::Area::_vis
private

The area's inter-room visibility description.

Definition at line 198 of file area.h.

Referenced by getRoomsVisibleFrom(), loadVIS(), and notifyPCMoved().

◆ _visible

bool Engines::KotOR::Area::_visible
private

Is the area currently visible?

Definition at line 188 of file area.h.

Referenced by hide(), and show().

◆ _walkmeshInvisible

bool Engines::KotOR::Area::_walkmeshInvisible
private

Definition at line 223 of file area.h.

Referenced by toggleWalkmesh().

◆ _worldPt1X

float Engines::KotOR::Area::_worldPt1X
private

Definition at line 190 of file area.h.

Referenced by getWorldPoint1(), and loadARE().

◆ _worldPt1Y

float Engines::KotOR::Area::_worldPt1Y
private

Definition at line 190 of file area.h.

Referenced by getWorldPoint1(), and loadARE().

◆ _worldPt2X

float Engines::KotOR::Area::_worldPt2X
private

Definition at line 190 of file area.h.

Referenced by getWorldPoint2(), and loadARE().

◆ _worldPt2Y

float Engines::KotOR::Area::_worldPt2Y
private

Definition at line 190 of file area.h.

Referenced by getWorldPoint2(), and loadARE().


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