xoreos  0.0.5
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Engines::KotOR::Module Class Reference

#include <module.h>

Inheritance diagram for Engines::KotOR::Module:
Inheritance graph
[legend]
Collaboration diagram for Engines::KotOR::Module:
Collaboration graph
[legend]

Classes

struct  Action
 

Public Member Functions

 Module (::Engines::Console &console)
 
 ~Module ()
 
void clear ()
 Clear the whole context. More...
 
bool isLoaded () const
 Is a module currently loaded and ready to run? More...
 
bool isRunning () const
 Is a module currently running? More...
 
void load (const Common::UString &module, const Common::UString &entryLocation="", ObjectType entryLocationType=kObjectTypeAll)
 Load a module. More...
 
void loadTexturePack ()
 Load texture pack used by the module. More...
 
void usePC (Creature *pc)
 Use this character as the player character. More...
 
void exit ()
 Exit the currently running module. More...
 
const Aurora::IFOFilegetIFO () const
 Return the IFO of the currently loaded module. More...
 
const Common::UStringgetName () const
 Return the module's name. More...
 
AreagetCurrentArea ()
 Return the area the PC is currently in. More...
 
CreaturegetPC ()
 Return the currently playing PC. More...
 
Graphics::Aurora::FadeQuadgetFadeQuad ()
 Return the fade quad. More...
 
void showMenu ()
 Show the ingame main menu. More...
 
void delayScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, Aurora::NWScript::Object *owner, Aurora::NWScript::Object *triggerer, uint32 delay)
 
void movePC (float x, float y, float z)
 Move the player character to this position within the current area. More...
 
void movePC (const Common::UString &module, const Common::UString &object, ObjectType type=kObjectTypeAll)
 Move the player character to this object within this area. More...
 
void movedPC ()
 Notify the module that the PC was moved. More...
 
size_t getPartyMemberCount ()
 Get the count of party members. More...
 
void addToParty (Creature *creature)
 Add a creature to the party. More...
 
bool isObjectPartyMember (Creature *creature)
 Check if the specified creature is a party member. More...
 
CreaturegetPartyMember (int index)
 Get a party member by index. More...
 
void switchPlayerCharacter (int npc)
 Switch the player character. More...
 
void showPartySelectionGUI (int forceNPC1, int forceNPC2)
 Show the party selection GUI. More...
 
void addAvailablePartyMember (int slot, const Common::UString &templ)
 Add available party member by template. More...
 
bool isAvailableCreature (int slot)
 Check if there is a party member available for this id. More...
 
void setReturnStrref (uint32 id)
 Set the return string for the 'Return to Ebon Hawk' button. More...
 
void setReturnQueryStrref (uint32 id)
 Set the string for the return dialog. More...
 
void setReturnEnabled (bool enabled)
 Enable or disable the 'Return to Ebon Hawk' button. More...
 
void setGlobalBoolean (const Common::UString &id, bool value)
 Set a global boolean. More...
 
bool getGlobalBoolean (const Common::UString &id) const
 Get a global boolean. More...
 
void setGlobalNumber (const Common::UString &id, int value)
 Get a global number. More...
 
int getGlobalNumber (const Common::UString &id) const
 Set a global number. More...
 
void enter ()
 Enter the loaded module, starting it. More...
 
void leave ()
 Leave the running module, quitting it. More...
 
void clickObject (Object *object)
 Open the inventory of a container. More...
 
void addEvent (const Events::Event &event)
 Add a single event for consideration into the event queue. More...
 
void processEventQueue ()
 Process the current event queue. More...
 
void toggleFreeRoamCamera ()
 
void toggleWalkmesh ()
 
void toggleTriggers ()
 
void loadSavedGame (SavedGame *save)
 
void startConversation (const Common::UString &name, Aurora::NWScript::Object *owner=0)
 
void playAnimationOnActiveObject (const Common::UString &baseAnim, const Common::UString &headAnim)
 
void addItemToActiveObject (const Common::UString &item, int count)
 
- 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 show ()
 Show the object's model(s). More...
 
virtual void hide ()
 Hide the object's model(s). 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 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 Engines::KotOR::ObjectContainer
 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (KotOR::Object &object)
 Add an object to this container. More...
 
void removeObject (KotOR::Object &object)
 Remove an object from this container. More...
 
::Aurora::NWScript::ObjectgetFirstObjectByType (ObjectType type) const
 Return the first object of this type. More...
 
::Aurora::NWScript::ObjectSearchfindObjectsByType (ObjectType type) const
 Return a search context to iterate over all objects of this type. More...
 
- Public Member Functions inherited from Aurora::NWScript::ObjectContainer
 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (Object &object)
 Add an object to this container. More...
 
void removeObject (Object &object)
 Remove an object from this container. More...
 
ObjectgetObjectByID (uint32 id) const
 Find a specific object by ID. More...
 
ObjectgetFirstObject () const
 Return the first object. More...
 
ObjectgetFirstObjectByTag (const Common::UString &tag) const
 Return the first object with this tag. More...
 
ObjectSearchfindObjects () const
 Return a search context to iterate over all objects. More...
 
ObjectSearchfindObjectsByTag (const Common::UString &tag) const
 Return a search context to iterate over all objects with this tag. More...
 

Static Public Member Functions

static Common::UString getName (const Common::UString &module)
 
- 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())
 
- Static Public Member Functions inherited from Engines::KotOR::ObjectContainer
static KotOR::ObjecttoObject (::Aurora::NWScript::Object *object)
 
static ModuletoModule (Aurora::NWScript::Object *object)
 
static AreatoArea (Aurora::NWScript::Object *object)
 
static WaypointtoWaypoint (Aurora::NWScript::Object *object)
 
static SituatedtoSituated (Aurora::NWScript::Object *object)
 
static PlaceabletoPlaceable (Aurora::NWScript::Object *object)
 
static DoortoDoor (Aurora::NWScript::Object *object)
 
static CreaturetoCreature (Aurora::NWScript::Object *object)
 
static CreaturetoPC (Aurora::NWScript::Object *object)
 
static SoundObjecttoSoundObject (Aurora::NWScript::Object *object)
 
static CreaturetoPartyMember (Aurora::NWScript::Object *object)
 

Private Types

enum  ActionType { kActionNone = 0, kActionScript = 1 }
 
typedef std::list< Events::EventEventQueue
 
typedef std::multiset< ActionActionQueue
 

Private Member Functions

void unload (bool completeUnload=true)
 Unload the whole shebang. More...
 
void unloadResources ()
 
void unloadPC ()
 
void unloadIFO ()
 
void unloadArea ()
 
void unloadTexturePack ()
 
void load ()
 
void loadResources ()
 
void loadIFO ()
 
void loadArea ()
 
void loadModule (const Common::UString &module, const Common::UString &entryLocation, ObjectType entryLocationType)
 Load the actual module. More...
 
void changeModule (const Common::UString &module, const Common::UString &entryLocation, ObjectType entryLocationType)
 Schedule a change to a new module. More...
 
void replaceModule ()
 Actually replace the currently running module. More...
 
bool getObjectLocation (const Common::UString &object, ObjectType location, float &entryX, float &entryY, float &entryZ, float &entryAngle)
 
bool getEntryObjectLocation (float &entryX, float &entryY, float &entryZ, float &entryAngle)
 
void getEntryIFOLocation (float &entryX, float &entryY, float &entryZ, float &entryAngle)
 
void enterArea ()
 
void leaveArea ()
 
void handleEvents ()
 
void handleActions ()
 
void handlePCMovement ()
 
void stopCameraMovement ()
 
void stopPCMovement ()
 

Private Attributes

::Engines::Console_console
 
bool _hasModule
 Do we have a module? More...
 
bool _running
 Are we currently running a module? More...
 
std::list< Common::ChangeID_resources
 Resources added by the current module. More...
 
Aurora::IFOFile _ifo
 The current module's IFO. More...
 
Common::ScopedPtr< Creature_pc
 The player character we use. More...
 
int _currentTexturePack
 The current texture pack. More...
 
Common::ChangeID _textures
 Resources added by the current texture pack. More...
 
bool _exit
 Should we exit the module? More...
 
Common::UString _module
 The current module's name. More...
 
Common::UString _newModule
 The module we should change to. More...
 
Common::UString _entryLocation
 The tag of the object in the start location for this module. More...
 
ObjectType _entryLocationType
 The type(s) of the object in the start location for this module. More...
 
Common::ScopedPtr< Area_area
 The current module's area. More...
 
Common::ScopedPtr< Graphics::Aurora::FadeQuad_fade
 
Common::ScopedPtr< IngameGUI_ingame
 The ingame ui. More...
 
Common::ScopedPtr< DialogGUI_dialog
 Conversation/cutscene GUI. More...
 
Common::ScopedPtr< PartySelectionGUI_partySelection
 
std::map< Common::UString, bool > _globalBooleans
 
std::map< Common::UString, int > _globalNumbers
 
std::list< Creature * > _party
 
std::map< int, Common::UString_availableParty
 
EventQueue _eventQueue
 
ActionQueue _delayedActions
 
bool _freeCamEnabled
 
uint32 _prevTimestamp
 
float _frameTime
 
float _forwardBtnPressed
 
float _backwardsBtnPressed
 
bool _pcRunning
 
bool _pcPositionLoaded
 
bool _inDialog
 
float _cameraHeight
 

Additional Inherited Members

- Protected Member Functions inherited from Engines::KotOR::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff, bool clear=true)
 
void readScripts (const ScriptContainer &container)
 
- Protected Member Functions inherited from Aurora::NWScript::ObjectContainer
void lock ()
 
void unlock ()
 
- 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

Definition at line 60 of file module.h.

Member Typedef Documentation

◆ ActionQueue

typedef std::multiset<Action> Engines::KotOR::Module::ActionQueue
private

Definition at line 211 of file module.h.

◆ EventQueue

Definition at line 210 of file module.h.

Member Enumeration Documentation

◆ ActionType

Enumerator
kActionNone 
kActionScript 

Definition at line 191 of file module.h.

Constructor & Destructor Documentation

◆ Module()

Engines::KotOR::Module::Module ( ::Engines::Console console)

Definition at line 75 of file module.cpp.

◆ ~Module()

Engines::KotOR::Module::~Module ( )

Definition at line 99 of file module.cpp.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ addAvailablePartyMember()

void Engines::KotOR::Module::addAvailablePartyMember ( int  slot,
const Common::UString templ 
)

Add available party member by template.

Definition at line 851 of file module.cpp.

References _availableParty.

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

Here is the caller graph for this function:

◆ addEvent()

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

Add a single event for consideration into the event queue.

Definition at line 525 of file module.cpp.

References _eventQueue.

◆ addItemToActiveObject()

void Engines::KotOR::Module::addItemToActiveObject ( const Common::UString item,
int  count 
)

◆ addToParty()

void Engines::KotOR::Module::addToParty ( Creature creature)

Add a creature to the party.

Definition at line 740 of file module.cpp.

References _ingame, _party, _pc, Engines::KotOR::ObjectContainer::addObject(), Engines::KotOR::Creature::setPosition(), and Engines::KotOR::Creature::show().

Referenced by enter(), and showPartySelectionGUI().

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

◆ changeModule()

void Engines::KotOR::Module::changeModule ( const Common::UString module,
const Common::UString entryLocation,
ObjectType  entryLocationType 
)
private

Schedule a change to a new module.

Definition at line 338 of file module.cpp.

References _entryLocation, _entryLocationType, and _newModule.

Referenced by load().

Here is the caller graph for this function:

◆ clear()

void Engines::KotOR::Module::clear ( )

Clear the whole context.

Definition at line 106 of file module.cpp.

References unload().

Referenced by ~Module().

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

◆ clickObject()

void Engines::KotOR::Module::clickObject ( Object object)

◆ delayScript()

void Engines::KotOR::Module::delayScript ( const Common::UString script,
const Aurora::NWScript::ScriptState state,
Aurora::NWScript::Object owner,
Aurora::NWScript::Object triggerer,
uint32  delay 
)

◆ enter()

void Engines::KotOR::Module::enter ( )
virtual

◆ enterArea()

void Engines::KotOR::Module::enterArea ( )
private

Definition at line 474 of file module.cpp.

References _area, _pc, GfxMan, Engines::KotOR::kScriptEnter, Engines::KotOR::kScriptModuleLoad, Engines::KotOR::kScriptModuleStart, and Engines::KotOR::ScriptContainer::runScript().

Referenced by enter().

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

◆ exit()

void Engines::KotOR::Module::exit ( )

Exit the currently running module.

Definition at line 197 of file module.cpp.

References _exit.

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

Here is the caller graph for this function:

◆ getCurrentArea()

Area * Engines::KotOR::Module::getCurrentArea ( )

◆ getEntryIFOLocation()

void Engines::KotOR::Module::getEntryIFOLocation ( float &  entryX,
float &  entryY,
float &  entryZ,
float &  entryAngle 
)
private

Definition at line 456 of file module.cpp.

References _ifo, Aurora::IFOFile::getEntryDirection(), Aurora::IFOFile::getEntryPosition(), and Common::rad2deg().

Referenced by enter().

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

◆ getEntryObjectLocation()

bool Engines::KotOR::Module::getEntryObjectLocation ( float &  entryX,
float &  entryY,
float &  entryZ,
float &  entryAngle 
)
private

Definition at line 452 of file module.cpp.

References _entryLocation, _entryLocationType, and getObjectLocation().

Referenced by enter().

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

◆ getFadeQuad()

Graphics::Aurora::FadeQuad & Engines::KotOR::Module::getFadeQuad ( )

Return the fade quad.

Definition at line 185 of file module.cpp.

References _fade.

Referenced by Engines::KotOR::Functions::setGlobalFadeIn(), and Engines::KotOR::Functions::setGlobalFadeOut().

Here is the caller graph for this function:

◆ getGlobalBoolean()

bool Engines::KotOR::Module::getGlobalBoolean ( const Common::UString id) const

Get a global boolean.

Definition at line 879 of file module.cpp.

References _globalBooleans.

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

Here is the caller graph for this function:

◆ getGlobalNumber()

int Engines::KotOR::Module::getGlobalNumber ( const Common::UString id) const

Set a global number.

Definition at line 891 of file module.cpp.

References _globalNumbers.

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

Here is the caller graph for this function:

◆ getIFO()

const Aurora::IFOFile & Engines::KotOR::Module::getIFO ( ) const

Return the IFO of the currently loaded module.

Definition at line 899 of file module.cpp.

References _ifo.

◆ getName() [1/2]

const Common::UString & Engines::KotOR::Module::getName ( ) const

Return the module's name.

Definition at line 903 of file module.cpp.

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

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

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

◆ getName() [2/2]

Common::UString Engines::KotOR::Module::getName ( const Common::UString module)
static

◆ getObjectLocation()

bool Engines::KotOR::Module::getObjectLocation ( const Common::UString object,
ObjectType  location,
float &  entryX,
float &  entryY,
float &  entryZ,
float &  entryAngle 
)
private

◆ getPartyMember()

Creature * Engines::KotOR::Module::getPartyMember ( int  index)

Get a party member by index.

Definition at line 764 of file module.cpp.

References _party.

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

Here is the caller graph for this function:

◆ getPartyMemberCount()

size_t Engines::KotOR::Module::getPartyMemberCount ( )

Get the count of party members.

Definition at line 736 of file module.cpp.

References _party.

◆ getPC()

Creature * Engines::KotOR::Module::getPC ( )

◆ handleActions()

void Engines::KotOR::Module::handleActions ( )
private

Definition at line 678 of file module.cpp.

References _delayedActions, EventMan, kActionScript, and Engines::KotOR::ScriptContainer::runScript().

Referenced by processEventQueue().

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

◆ handleEvents()

void Engines::KotOR::Module::handleEvents ( )
private

◆ handlePCMovement()

void Engines::KotOR::Module::handlePCMovement ( )
private

Definition at line 627 of file module.cpp.

References _area, _backwardsBtnPressed, _forwardBtnPressed, _frameTime, _ingame, _pc, _pcRunning, CameraMan, FLT_MIN, movePC(), Common::rad2deg(), SatelliteCam, and SoundMan.

Referenced by processEventQueue().

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

◆ isAvailableCreature()

bool Engines::KotOR::Module::isAvailableCreature ( int  slot)

Check if there is a party member available for this id.

Definition at line 859 of file module.cpp.

References _availableParty.

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

Here is the caller graph for this function:

◆ isLoaded()

bool Engines::KotOR::Module::isLoaded ( ) const

Is a module currently loaded and ready to run?

Definition at line 189 of file module.cpp.

References _area, _hasModule, and _pc.

◆ isObjectPartyMember()

bool Engines::KotOR::Module::isObjectPartyMember ( Creature creature)

Check if the specified creature is a party member.

Definition at line 760 of file module.cpp.

References _party.

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

Here is the caller graph for this function:

◆ isRunning()

bool Engines::KotOR::Module::isRunning ( ) const

Is a module currently running?

Definition at line 193 of file module.cpp.

References _exit, _running, and EventMan.

Referenced by load(), and processEventQueue().

Here is the caller graph for this function:

◆ leave()

void Engines::KotOR::Module::leave ( )
virtual

Leave the running module, quitting it.

Reimplemented from Engines::KotOR::Object.

Definition at line 465 of file module.cpp.

References _exit, _ingame, _running, and leaveArea().

Referenced by Engines::KotOR::Menu::callbackRun().

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

◆ leaveArea()

void Engines::KotOR::Module::leaveArea ( )
private

Definition at line 488 of file module.cpp.

References _area, _pc, Engines::KotOR::kScriptExit, and Engines::KotOR::ScriptContainer::runScript().

Referenced by leave(), and unload().

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

◆ load() [1/2]

void Engines::KotOR::Module::load ( const Common::UString module,
const Common::UString entryLocation = "",
ObjectType  entryLocationType = kObjectTypeAll 
)

Load a module.

Definition at line 110 of file module.cpp.

References changeModule(), isRunning(), and loadModule().

Referenced by Engines::KotOR::Console::cmdLoadModule(), and Engines::KotOR::CharacterGenerationMenu::start().

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

◆ load() [2/2]

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

Definition at line 205 of file module.cpp.

References loadArea(), loadIFO(), loadResources(), and loadTexturePack().

Referenced by loadModule(), loadSavedGame(), and movePC().

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

◆ loadArea()

void Engines::KotOR::Module::loadArea ( )
private

Definition at line 250 of file module.cpp.

References _area, _ifo, and Aurora::IFOFile::getEntryArea().

Referenced by load().

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

◆ loadIFO()

void Engines::KotOR::Module::loadIFO ( )
private

◆ loadModule()

void Engines::KotOR::Module::loadModule ( const Common::UString module,
const Common::UString entryLocation,
ObjectType  entryLocationType 
)
private

◆ loadResources()

void Engines::KotOR::Module::loadResources ( )
private

Definition at line 212 of file module.cpp.

References _module, _resources, Engines::indexMandatoryArchive(), and Engines::indexOptionalArchive().

Referenced by load().

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

◆ loadSavedGame()

void Engines::KotOR::Module::loadSavedGame ( SavedGame save)

Definition at line 977 of file module.cpp.

References _pcPositionLoaded, Common::exceptionDispatcherWarning(), Engines::KotOR::SavedGame::getModuleName(), Engines::KotOR::SavedGame::getPC(), Engines::KotOR::SavedGame::isPCLoaded(), load(), and usePC().

Referenced by Engines::KotOR::SaveLoadMenu::tryLoadGame().

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

◆ loadTexturePack()

void Engines::KotOR::Module::loadTexturePack ( )

Load texture pack used by the module.

Definition at line 260 of file module.cpp.

References _currentTexturePack, _textures, ConfigMan, Engines::indexOptionalArchive(), status(), TextureMan, Engines::KotOR::texturePacks, and unloadTexturePack().

Referenced by Engines::KotOR::MainMenu::createClassSelection(), load(), and Engines::KotOR::MainMenu::MainMenu().

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

◆ movedPC()

void Engines::KotOR::Module::movedPC ( )

Notify the module that the PC was moved.

Definition at line 716 of file module.cpp.

References _area, _cameraHeight, _freeCamEnabled, _pc, CameraMan, and SatelliteCam.

Referenced by movePC().

Here is the caller graph for this function:

◆ movePC() [1/2]

void Engines::KotOR::Module::movePC ( float  x,
float  y,
float  z 
)

Move the player character to this position within the current area.

Definition at line 695 of file module.cpp.

References _ingame, _pc, and movedPC().

Referenced by Engines::KotOR::Door::click(), handlePCMovement(), and movePC().

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

◆ movePC() [2/2]

void Engines::KotOR::Module::movePC ( const Common::UString module,
const Common::UString object,
ObjectType  type = kObjectTypeAll 
)

Move the player character to this object within this area.

Definition at line 704 of file module.cpp.

References _module, Common::UString::empty(), getObjectLocation(), load(), and movePC().

Here is the call graph for this function:

◆ playAnimationOnActiveObject()

void Engines::KotOR::Module::playAnimationOnActiveObject ( const Common::UString baseAnim,
const Common::UString headAnim 
)

◆ processEventQueue()

void Engines::KotOR::Module::processEventQueue ( )

Process the current event queue.

Definition at line 529 of file module.cpp.

References _area, _frameTime, _freeCamEnabled, _prevTimestamp, GfxMan, handleActions(), handleEvents(), handlePCMovement(), isRunning(), replaceModule(), and SatelliteCam.

Here is the call graph for this function:

◆ replaceModule()

void Engines::KotOR::Module::replaceModule ( )
private

Actually replace the currently running module.

Definition at line 347 of file module.cpp.

References _console, _entryLocation, _entryLocationType, _exit, _newModule, Common::UString::empty(), enter(), Engines::Console::hide(), loadModule(), and unload().

Referenced by processEventQueue().

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

◆ setGlobalBoolean()

void Engines::KotOR::Module::setGlobalBoolean ( const Common::UString id,
bool  value 
)

Set a global boolean.

Definition at line 875 of file module.cpp.

References _globalBooleans.

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

Here is the caller graph for this function:

◆ setGlobalNumber()

void Engines::KotOR::Module::setGlobalNumber ( const Common::UString id,
int  value 
)

Get a global number.

Definition at line 887 of file module.cpp.

References _globalNumbers.

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

Here is the caller graph for this function:

◆ setReturnEnabled()

void Engines::KotOR::Module::setReturnEnabled ( bool  enabled)

Enable or disable the 'Return to Ebon Hawk' button.

Definition at line 871 of file module.cpp.

References _ingame.

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

Here is the caller graph for this function:

◆ setReturnQueryStrref()

void Engines::KotOR::Module::setReturnQueryStrref ( uint32  id)

Set the string for the return dialog.

Definition at line 867 of file module.cpp.

References _ingame.

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

Here is the caller graph for this function:

◆ setReturnStrref()

void Engines::KotOR::Module::setReturnStrref ( uint32  id)

Set the return string for the 'Return to Ebon Hawk' button.

Definition at line 863 of file module.cpp.

References _ingame.

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

Here is the caller graph for this function:

◆ showMenu()

void Engines::KotOR::Module::showMenu ( )

Show the ingame main menu.

Definition at line 201 of file module.cpp.

Referenced by handleEvents().

Here is the caller graph for this function:

◆ showPartySelectionGUI()

void Engines::KotOR::Module::showPartySelectionGUI ( int  forceNPC1,
int  forceNPC2 
)

◆ startConversation()

void Engines::KotOR::Module::startConversation ( const Common::UString name,
Aurora::NWScript::Object owner = 0 
)

Definition at line 987 of file module.cpp.

References _dialog, _inDialog, _ingame, Common::UString::empty(), Engines::KotOR::Creature::getConversation(), stopCameraMovement(), stopPCMovement(), and Engines::KotOR::ObjectContainer::toCreature().

Referenced by Engines::KotOR::Functions::actionStartConversation(), and clickObject().

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

◆ stopCameraMovement()

void Engines::KotOR::Module::stopCameraMovement ( )
private

Definition at line 1059 of file module.cpp.

References SatelliteCam.

Referenced by clickObject(), and startConversation().

Here is the caller graph for this function:

◆ stopPCMovement()

void Engines::KotOR::Module::stopPCMovement ( )
private

Definition at line 1063 of file module.cpp.

References _backwardsBtnPressed, _forwardBtnPressed, _pc, and _pcRunning.

Referenced by clickObject(), and startConversation().

Here is the caller graph for this function:

◆ switchPlayerCharacter()

void Engines::KotOR::Module::switchPlayerCharacter ( int  npc)

Switch the player character.

Definition at line 773 of file module.cpp.

References _cameraHeight, _freeCamEnabled, _ingame, _party, _pc, CameraMan, and SatelliteCam.

◆ toggleFreeRoamCamera()

void Engines::KotOR::Module::toggleFreeRoamCamera ( )

Definition at line 963 of file module.cpp.

References _area, _freeCamEnabled, and ConfigMan.

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

Here is the caller graph for this function:

◆ toggleTriggers()

void Engines::KotOR::Module::toggleTriggers ( )

Definition at line 973 of file module.cpp.

References _area.

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

Here is the caller graph for this function:

◆ toggleWalkmesh()

void Engines::KotOR::Module::toggleWalkmesh ( )

Definition at line 969 of file module.cpp.

References _area.

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

Here is the caller graph for this function:

◆ unload()

void Engines::KotOR::Module::unload ( bool  completeUnload = true)
private

Unload the whole shebang.

Parameters
completeUnloadAlso unload the PC and texture packs. true: completely quit the module false: the PC can be transferred to a new module.

Definition at line 280 of file module.cpp.

References _availableParty, _delayedActions, _entryLocation, _entryLocationType, _eventQueue, _globalBooleans, _globalNumbers, _hasModule, _module, _newModule, _party, Common::UString::clear(), GfxMan, Engines::KotOR::kObjectTypeAll, leaveArea(), unloadArea(), unloadIFO(), unloadPC(), unloadResources(), and unloadTexturePack().

Referenced by clear(), loadModule(), and replaceModule().

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

◆ unloadArea()

void Engines::KotOR::Module::unloadArea ( )
private

Definition at line 325 of file module.cpp.

References _area.

Referenced by unload().

Here is the caller graph for this function:

◆ unloadIFO()

void Engines::KotOR::Module::unloadIFO ( )
private

Definition at line 321 of file module.cpp.

References _ifo, and Aurora::IFOFile::unload().

Referenced by unload().

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

◆ unloadPC()

void Engines::KotOR::Module::unloadPC ( )
private

Definition at line 329 of file module.cpp.

References _pc.

Referenced by unload().

Here is the caller graph for this function:

◆ unloadResources()

void Engines::KotOR::Module::unloadResources ( )
private

Definition at line 313 of file module.cpp.

References _resources, and Engines::deindexResources().

Referenced by unload().

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

◆ unloadTexturePack()

void Engines::KotOR::Module::unloadTexturePack ( )
private

Definition at line 333 of file module.cpp.

References _currentTexturePack, _textures, and Engines::deindexResources().

Referenced by loadTexturePack(), and unload().

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

◆ usePC()

void Engines::KotOR::Module::usePC ( Creature pc)

Use this character as the player character.

Definition at line 177 of file module.cpp.

References _pc.

Referenced by enter(), loadSavedGame(), and Engines::KotOR::CharacterGenerationMenu::start().

Here is the caller graph for this function:

Member Data Documentation

◆ _area

Common::ScopedPtr<Area> Engines::KotOR::Module::_area
private

◆ _availableParty

std::map<int, Common::UString> Engines::KotOR::Module::_availableParty
private

◆ _backwardsBtnPressed

float Engines::KotOR::Module::_backwardsBtnPressed
private

Definition at line 269 of file module.h.

Referenced by handleEvents(), handlePCMovement(), and stopPCMovement().

◆ _cameraHeight

float Engines::KotOR::Module::_cameraHeight
private

Definition at line 273 of file module.h.

Referenced by enter(), movedPC(), and switchPlayerCharacter().

◆ _console

::Engines::Console* Engines::KotOR::Module::_console
private

Definition at line 214 of file module.h.

Referenced by enter(), handleEvents(), loadModule(), and replaceModule().

◆ _currentTexturePack

int Engines::KotOR::Module::_currentTexturePack
private

The current texture pack.

Definition at line 228 of file module.h.

Referenced by loadTexturePack(), and unloadTexturePack().

◆ _delayedActions

ActionQueue Engines::KotOR::Module::_delayedActions
private

Definition at line 263 of file module.h.

Referenced by delayScript(), handleActions(), and unload().

◆ _dialog

Common::ScopedPtr<DialogGUI> Engines::KotOR::Module::_dialog
private

Conversation/cutscene GUI.

Definition at line 248 of file module.h.

Referenced by handleEvents(), showPartySelectionGUI(), and startConversation().

◆ _entryLocation

Common::UString Engines::KotOR::Module::_entryLocation
private

The tag of the object in the start location for this module.

Definition at line 238 of file module.h.

Referenced by changeModule(), getEntryObjectLocation(), loadModule(), replaceModule(), and unload().

◆ _entryLocationType

ObjectType Engines::KotOR::Module::_entryLocationType
private

The type(s) of the object in the start location for this module.

Definition at line 240 of file module.h.

Referenced by changeModule(), getEntryObjectLocation(), loadModule(), replaceModule(), and unload().

◆ _eventQueue

EventQueue Engines::KotOR::Module::_eventQueue
private

Definition at line 262 of file module.h.

Referenced by addEvent(), handleEvents(), and unload().

◆ _exit

bool Engines::KotOR::Module::_exit
private

Should we exit the module?

Definition at line 232 of file module.h.

Referenced by enter(), exit(), isRunning(), leave(), and replaceModule().

◆ _fade

Common::ScopedPtr<Graphics::Aurora::FadeQuad> Engines::KotOR::Module::_fade
private

Definition at line 244 of file module.h.

Referenced by getFadeQuad().

◆ _forwardBtnPressed

float Engines::KotOR::Module::_forwardBtnPressed
private

Definition at line 268 of file module.h.

Referenced by handleEvents(), handlePCMovement(), and stopPCMovement().

◆ _frameTime

float Engines::KotOR::Module::_frameTime
private

Definition at line 267 of file module.h.

Referenced by handlePCMovement(), and processEventQueue().

◆ _freeCamEnabled

bool Engines::KotOR::Module::_freeCamEnabled
private

◆ _globalBooleans

std::map<Common::UString, bool> Engines::KotOR::Module::_globalBooleans
private

Definition at line 253 of file module.h.

Referenced by getGlobalBoolean(), setGlobalBoolean(), and unload().

◆ _globalNumbers

std::map<Common::UString, int> Engines::KotOR::Module::_globalNumbers
private

Definition at line 254 of file module.h.

Referenced by getGlobalNumber(), setGlobalNumber(), and unload().

◆ _hasModule

bool Engines::KotOR::Module::_hasModule
private

Do we have a module?

Definition at line 216 of file module.h.

Referenced by enter(), isLoaded(), loadModule(), and unload().

◆ _ifo

Aurora::IFOFile Engines::KotOR::Module::_ifo
private

The current module's IFO.

Definition at line 223 of file module.h.

Referenced by enter(), getEntryIFOLocation(), getIFO(), loadArea(), loadIFO(), and unloadIFO().

◆ _inDialog

bool Engines::KotOR::Module::_inDialog
private

Definition at line 272 of file module.h.

Referenced by handleEvents(), showPartySelectionGUI(), and startConversation().

◆ _ingame

Common::ScopedPtr<IngameGUI> Engines::KotOR::Module::_ingame
private

◆ _module

Common::UString Engines::KotOR::Module::_module
private

The current module's name.

Definition at line 234 of file module.h.

Referenced by loadModule(), loadResources(), movePC(), and unload().

◆ _newModule

Common::UString Engines::KotOR::Module::_newModule
private

The module we should change to.

Definition at line 235 of file module.h.

Referenced by changeModule(), loadModule(), replaceModule(), and unload().

◆ _party

std::list<Creature *> Engines::KotOR::Module::_party
private

◆ _partySelection

Common::ScopedPtr<PartySelectionGUI> Engines::KotOR::Module::_partySelection
private

Definition at line 250 of file module.h.

Referenced by showPartySelectionGUI().

◆ _pc

Common::ScopedPtr<Creature> Engines::KotOR::Module::_pc
private

◆ _pcPositionLoaded

bool Engines::KotOR::Module::_pcPositionLoaded
private

Definition at line 271 of file module.h.

Referenced by enter(), and loadSavedGame().

◆ _pcRunning

bool Engines::KotOR::Module::_pcRunning
private

Definition at line 270 of file module.h.

Referenced by handlePCMovement(), and stopPCMovement().

◆ _prevTimestamp

uint32 Engines::KotOR::Module::_prevTimestamp
private

Definition at line 266 of file module.h.

Referenced by clickObject(), and processEventQueue().

◆ _resources

std::list<Common::ChangeID> Engines::KotOR::Module::_resources
private

Resources added by the current module.

Definition at line 220 of file module.h.

Referenced by loadResources(), and unloadResources().

◆ _running

bool Engines::KotOR::Module::_running
private

Are we currently running a module?

Definition at line 217 of file module.h.

Referenced by enter(), isRunning(), and leave().

◆ _textures

Common::ChangeID Engines::KotOR::Module::_textures
private

Resources added by the current texture pack.

Definition at line 230 of file module.h.

Referenced by loadTexturePack(), and unloadTexturePack().


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