ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A location is a scene of the game. More...

#include <location.h>

Inheritance diagram for Stark::Resources::Location:
Collaboration diagram for Stark::Resources::Location:

List of all members.

Public Member Functions

 Location (Object *parent, byte subType, uint16 index, const Common::String &name)
virtual ~Location ()
void onAllLoaded () override
 Called when the resource sub-tree is entirely loaded.
void onEnterLocation () override
 Called when entering a location.
void onGameLoop () override
 Called once per game loop.
void saveLoadCurrent (ResourceSerializer *serializer) override
 Persist / restore the resource state.
bool has3DLayer ()
 Does the location have a 3D layer ?
Gfx::RenderEntryArray listRenderEntries ()
 Obtain a list of render entries for all the items in the location.
Gfx::LightEntryArray listLightEntries ()
 Obtain a list of render entries for all the lights in the location.
void initScroll (const Common::Point &maxScroll)
 Initialize scrolling from Camera data.
Common::Point getScrollPosition () const
 Obtain the current scroll position.
void setScrollPosition (const Common::Point &position)
 Scroll the location to the specified position if possible.
bool scrollToCoordinateSmooth (uint32 coordinate)
 Smoothly scroll to a position in 2D world coordinates.
void scrollToCharacterImmediate ()
 Immediatly scroll the character location.
void goToLayer (Layer *layer)
 Replace the currently active layer.
void setHasActiveScroll ()
 Indicate on script driven scroll is active.
void stopAllScrolls ()
 Stop all script driven scrolls.
void startFollowingCharacter ()
 Tell the location to scroll to follow the character.
void stopFollowingCharacter ()
 Tell the location not to scroll to follow the character.
void scrollToCoordinateImmediate (uint32 coordinate)
ItemVisualgetCharacterItem (int32 character) const
 Get an item from its character index.
void registerCharacterItem (int32 character, ItemVisual *item)
 Register an item as a character to the location.
const Common::Array< ModelItem * > & listModelItems () const
 Get the list of items with a 3d model present in the location.
void resetAnimationBlending ()
 Reset animation blending for all the items in the location.
SoundfindStockSound (uint32 stockSoundType) const
 Find a stock sound by its type in the location, the level, or the global level.
void startRumble (int32 rumbleDurationRemaining)
 Set remaining frames to rumble on this lcation.
void fadeInInit (int32 fadeDuration)
 Setup fading for this location.
void fadeOutInit (int32 fadeDuration)
void swayScene (int32 periodMs, const Math::Angle &angle, float amplitude, float offset)
 Setup a swaying movement for the 3d items in this location.
void floatScene (int32 periodMs, float amplitude, float offset)
 Setup a up / down floating movement for the 3d items in this location.
LayergetLayerByName (const Common::String &name)
 Get the layer with a given name, return null when not found.
Gfx::RenderEntrygetRenderEntryByName (const Common::String &name)
 Get a render entry with a given name, return null when not found.
Common::Array< Layer * > listLayers ()
 Obtain the list of all the inner layers.
Common::Array< Common::PointlistExitPositions ()
 List all the exit positions.

Static Public Attributes

static const Type::ResourceType TYPE = Type::kLocation

Protected Member Functions

void printData () override

Private Types

typedef Common::HashMap< int32,
ItemVisual * > 
CharacterMap

Private Member Functions

bool scrollToSmooth (const Common::Point &position, bool followCharacter)
bool scrollToCharacter (ModelItem *item)
Common::Point getCharacterScrollPosition (ModelItem *item)
uint getScrollStepFollow ()
Common::Point getScrollPointFromCoordinate (uint32 coordinate) const
SoundfindStockSound (const Object *parent, uint32 stockSoundType) const
uint getScrollStep ()

Private Attributes

Common::Array< Layer * > _layers
Layer_currentLayer
bool _canScroll
bool _hasActiveScroll
bool _scrollFollowCharacter
Common::Point _scroll
Common::Point _maxScroll
CharacterMap _characterItemMap
Common::Array< ModelItem * > _modelItems
int32 _rumbleDurationRemaining
bool _fadeOut
int32 _fadeDuration
float _fadePosition
int32 _swayPeriodMs
Math::Angle _swayAngle
float _swayAmplitude
float _swayOffset
float _swayPosition
int32 _idleActionWaitMs
int32 _floatPeriodMs
float _floatAmplitude
float _floatPosition

Detailed Description

A location is a scene of the game.

Locations contain layers. The game engine retrieves the list of renderable items from the current location.

Definition at line 52 of file location.h.


Member Typedef Documentation

Definition at line 175 of file location.h.


Constructor & Destructor Documentation

Stark::Resources::Location::Location ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
)

Definition at line 52 of file location.cpp.

Stark::Resources::Location::~Location (  )  [virtual]

Definition at line 49 of file location.cpp.


Member Function Documentation

void Stark::Resources::Location::fadeInInit ( int32  fadeDuration  ) 

Setup fading for this location.

Definition at line 487 of file location.cpp.

void Stark::Resources::Location::fadeOutInit ( int32  fadeDuration  ) 

Definition at line 493 of file location.cpp.

Sound * Stark::Resources::Location::findStockSound ( const Object parent,
uint32  stockSoundType 
) const [private]

Definition at line 467 of file location.cpp.

Sound * Stark::Resources::Location::findStockSound ( uint32  stockSoundType  )  const

Find a stock sound by its type in the location, the level, or the global level.

Definition at line 451 of file location.cpp.

void Stark::Resources::Location::floatScene ( int32  periodMs,
float  amplitude,
float  offset 
)

Setup a up / down floating movement for the 3d items in this location.

Definition at line 511 of file location.cpp.

ItemVisual * Stark::Resources::Location::getCharacterItem ( int32  character  )  const

Get an item from its character index.

Definition at line 427 of file location.cpp.

Common::Point Stark::Resources::Location::getCharacterScrollPosition ( ModelItem item  )  [private]

Definition at line 255 of file location.cpp.

Layer * Stark::Resources::Location::getLayerByName ( const Common::String name  ) 

Get the layer with a given name, return null when not found.

Definition at line 547 of file location.cpp.

Gfx::RenderEntry * Stark::Resources::Location::getRenderEntryByName ( const Common::String name  ) 

Get a render entry with a given name, return null when not found.

Definition at line 556 of file location.cpp.

Common::Point Stark::Resources::Location::getScrollPointFromCoordinate ( uint32  coordinate  )  const [private]

Definition at line 385 of file location.cpp.

Common::Point Stark::Resources::Location::getScrollPosition (  )  const

Obtain the current scroll position.

Definition at line 235 of file location.cpp.

uint Stark::Resources::Location::getScrollStep (  )  [private]

Definition at line 322 of file location.cpp.

uint Stark::Resources::Location::getScrollStepFollow (  )  [private]

Definition at line 306 of file location.cpp.

void Stark::Resources::Location::goToLayer ( Layer layer  ) 

Replace the currently active layer.

Definition at line 418 of file location.cpp.

bool Stark::Resources::Location::has3DLayer (  ) 

Does the location have a 3D layer ?

Definition at line 168 of file location.cpp.

void Stark::Resources::Location::initScroll ( const Common::Point maxScroll  ) 

Initialize scrolling from Camera data.

Definition at line 230 of file location.cpp.

Common::Array< Common::Point > Stark::Resources::Location::listExitPositions (  ) 

List all the exit positions.

Definition at line 566 of file location.cpp.

Common::Array<Layer *> Stark::Resources::Location::listLayers (  )  [inline]

Obtain the list of all the inner layers.

Definition at line 147 of file location.h.

Gfx::LightEntryArray Stark::Resources::Location::listLightEntries (  ) 

Obtain a list of render entries for all the lights in the location.

Definition at line 200 of file location.cpp.

const Common::Array< ModelItem * > & Stark::Resources::Location::listModelItems (  )  const

Get the list of items with a 3d model present in the location.

Definition at line 437 of file location.cpp.

Gfx::RenderEntryArray Stark::Resources::Location::listRenderEntries (  ) 

Obtain a list of render entries for all the items in the location.

Definition at line 172 of file location.cpp.

void Stark::Resources::Location::onAllLoaded (  )  [override, virtual]

Called when the resource sub-tree is entirely loaded.

Allows to load data from other nodes.

Reimplemented from Stark::Resources::Object.

Definition at line 73 of file location.cpp.

void Stark::Resources::Location::onEnterLocation (  )  [override, virtual]

Called when entering a location.

Reimplemented from Stark::Resources::Object.

Definition at line 84 of file location.cpp.

void Stark::Resources::Location::onGameLoop (  )  [override, virtual]

Called once per game loop.

Reimplemented from Stark::Resources::Object.

Definition at line 90 of file location.cpp.

void Stark::Resources::Location::printData (  )  [override, protected, virtual]

Reimplemented from Stark::Resources::Object.

Definition at line 441 of file location.cpp.

void Stark::Resources::Location::registerCharacterItem ( int32  character,
ItemVisual item 
)

Register an item as a character to the location.

Definition at line 431 of file location.cpp.

void Stark::Resources::Location::resetAnimationBlending (  ) 

Reset animation blending for all the items in the location.

Definition at line 444 of file location.cpp.

void Stark::Resources::Location::saveLoadCurrent ( ResourceSerializer serializer  )  [override, virtual]

Persist / restore the resource state.

Called only for active locations

Reimplemented from Stark::Resources::Object.

Definition at line 521 of file location.cpp.

bool Stark::Resources::Location::scrollToCharacter ( ModelItem item  )  [private]

Definition at line 276 of file location.cpp.

void Stark::Resources::Location::scrollToCharacterImmediate (  ) 

Immediatly scroll the character location.

Definition at line 297 of file location.cpp.

void Stark::Resources::Location::scrollToCoordinateImmediate ( uint32  coordinate  ) 

Definition at line 380 of file location.cpp.

bool Stark::Resources::Location::scrollToCoordinateSmooth ( uint32  coordinate  ) 

Smoothly scroll to a position in 2D world coordinates.

Definition at line 375 of file location.cpp.

bool Stark::Resources::Location::scrollToSmooth ( const Common::Point position,
bool  followCharacter 
) [private]

Definition at line 341 of file location.cpp.

void Stark::Resources::Location::setHasActiveScroll (  ) 

Indicate on script driven scroll is active.

This means that the location should not follow the character

Definition at line 405 of file location.cpp.

void Stark::Resources::Location::setScrollPosition ( const Common::Point position  ) 

Scroll the location to the specified position if possible.

Definition at line 239 of file location.cpp.

void Stark::Resources::Location::startFollowingCharacter (  ) 

Tell the location to scroll to follow the character.

Definition at line 401 of file location.cpp.

void Stark::Resources::Location::startRumble ( int32  rumbleDurationRemaining  ) 

Set remaining frames to rumble on this lcation.

Definition at line 483 of file location.cpp.

void Stark::Resources::Location::stopAllScrolls (  ) 

Stop all script driven scrolls.

Definition at line 409 of file location.cpp.

void Stark::Resources::Location::stopFollowingCharacter (  ) 

Tell the location not to scroll to follow the character.

Definition at line 397 of file location.cpp.

void Stark::Resources::Location::swayScene ( int32  periodMs,
const Math::Angle angle,
float  amplitude,
float  offset 
)

Setup a swaying movement for the 3d items in this location.

Definition at line 499 of file location.cpp.


Member Data Documentation

Definition at line 167 of file location.h.

Definition at line 165 of file location.h.

Definition at line 183 of file location.h.

Definition at line 182 of file location.h.

Definition at line 184 of file location.h.

Definition at line 195 of file location.h.

Definition at line 194 of file location.h.

Definition at line 196 of file location.h.

Definition at line 168 of file location.h.

Definition at line 192 of file location.h.

Definition at line 164 of file location.h.

Definition at line 171 of file location.h.

Definition at line 170 of file location.h.

Definition at line 169 of file location.h.

Definition at line 188 of file location.h.

Definition at line 187 of file location.h.

Definition at line 189 of file location.h.

Definition at line 186 of file location.h.

Definition at line 190 of file location.h.

const Type::ResourceType Stark::Resources::Location::TYPE = Type::kLocation [static]

Definition at line 54 of file location.h.


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


Generated on Sat Nov 16 2019 05:03:53 for ResidualVM by doxygen 1.7.1
curved edge   curved edge