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 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.
Common::Array< ItemVisual * > listCharacters () const
 Get the list of characters 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
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 174 of file location.h.


Constructor & Destructor Documentation

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

Definition at line 51 of file location.cpp.

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

Definition at line 48 of file location.cpp.


Member Function Documentation

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

Setup fading for this location.

Definition at line 479 of file location.cpp.

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

Definition at line 485 of file location.cpp.

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

Definition at line 459 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 443 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 503 of file location.cpp.

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

Get an item from its character index.

Definition at line 412 of file location.cpp.

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

Definition at line 240 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 539 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 548 of file location.cpp.

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

Definition at line 370 of file location.cpp.

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

Obtain the current scroll position.

Definition at line 220 of file location.cpp.

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

Definition at line 307 of file location.cpp.

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

Definition at line 291 of file location.cpp.

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

Replace the currently active layer.

Definition at line 403 of file location.cpp.

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

Does the location have a 3D layer ?

Definition at line 153 of file location.cpp.

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

Initialize scrolling from Camera data.

Definition at line 215 of file location.cpp.

Common::Array< ItemVisual * > Stark::Resources::Location::listCharacters (  )  const

Get the list of characters present in the location.

Definition at line 422 of file location.cpp.

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

List all the exit positions.

Definition at line 558 of file location.cpp.

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

Obtain the list of all the inner layers.

Definition at line 146 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 185 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 157 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 72 of file location.cpp.

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

Called once per game loop.

Reimplemented from Stark::Resources::Object.

Definition at line 78 of file location.cpp.

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

Reimplemented from Stark::Resources::Object.

Definition at line 433 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 416 of file location.cpp.

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

Reset animation blending for all the items in the location.

Definition at line 436 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 513 of file location.cpp.

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

Definition at line 261 of file location.cpp.

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

Immediatly scroll the character location.

Definition at line 282 of file location.cpp.

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

Definition at line 365 of file location.cpp.

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

Smoothly scroll to a position in 2D world coordinates.

Definition at line 360 of file location.cpp.

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

Definition at line 326 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 390 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 224 of file location.cpp.

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

Tell the location to scroll to follow the character.

Definition at line 386 of file location.cpp.

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

Set remaining frames to rumble on this lcation.

Definition at line 475 of file location.cpp.

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

Stop all script driven scrolls.

Definition at line 394 of file location.cpp.

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

Tell the location not to scroll to follow the character.

Definition at line 382 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 491 of file location.cpp.


Member Data Documentation

Definition at line 166 of file location.h.

Definition at line 164 of file location.h.

Definition at line 180 of file location.h.

Definition at line 179 of file location.h.

Definition at line 181 of file location.h.

Definition at line 192 of file location.h.

Definition at line 191 of file location.h.

Definition at line 193 of file location.h.

Definition at line 167 of file location.h.

Definition at line 189 of file location.h.

Definition at line 163 of file location.h.

Definition at line 170 of file location.h.

Definition at line 169 of file location.h.

Definition at line 168 of file location.h.

Definition at line 185 of file location.h.

Definition at line 184 of file location.h.

Definition at line 186 of file location.h.

Definition at line 183 of file location.h.

Definition at line 187 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 Mar 16 2019 05:07:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge