ScummVM API documentation
Stark::Resources::Location Class Reference

#include <location.h>

Inheritance diagram for Stark::Resources::Location:
Stark::Resources::Object

Public Member Functions

 Location (Object *parent, byte subType, uint16 index, const Common::String &name)
 
void onAllLoaded () override
 
void onEnterLocation () override
 
void onGameLoop () override
 
void saveLoadCurrent (ResourceSerializer *serializer) override
 
bool has3DLayer ()
 
Gfx::RenderEntryArray listRenderEntries ()
 
Gfx::LightEntryArray listLightEntries ()
 
void initScroll (const Common::Point &maxScroll)
 
Common::Point getScrollPosition () const
 
void setScrollPosition (const Common::Point &position)
 
bool scrollToCoordinateSmooth (uint32 coordinate)
 
void scrollToCharacterImmediate ()
 
void goToLayer (Layer *layer)
 
void setHasActiveScroll ()
 
void stopAllScrolls ()
 
void startFollowingCharacter ()
 
void stopFollowingCharacter ()
 
void scrollToCoordinateImmediate (uint32 coordinate)
 
ItemVisualgetCharacterItem (int32 character) const
 
void registerCharacterItem (int32 character, ItemVisual *item)
 
const Common::Array< ModelItem * > & listModelItems () const
 
void resetAnimationBlending ()
 
SoundfindStockSound (uint32 stockSoundType) const
 
void startRumble (int32 rumbleDurationRemaining)
 
void fadeInInit (int32 fadeDuration)
 
void fadeOutInit (int32 fadeDuration)
 
void swayScene (int32 periodMs, const Math::Angle &angle, float amplitude, float offset)
 
void floatScene (int32 periodMs, float amplitude, float offset)
 
LayergetLayerByName (const Common::String &name)
 
Gfx::RenderEntrygetRenderEntryByName (const Common::String &name)
 
Common::Array< Layer * > listLayers ()
 
Common::Array< Common::PointlistExitPositions ()
 
- Public Member Functions inherited from Stark::Resources::Object
Type getType () const
 
byte getSubType () const
 
uint16 getIndex () const
 
Common::String getIndexAsString () const
 
Common::String getName () const
 
virtual void readData (Formats::XRCReadStream *stream)
 
virtual void saveLoad (ResourceSerializer *serializer)
 
virtual void onPostRead ()
 
virtual void onEnginePause (bool pause)
 
virtual void onExitLocation ()
 
virtual void onPreDestroy ()
 
template<class T >
T * findParent ()
 
ObjectfindChildWithIndex (Type type, uint16 index, int subType=-1) const
 
ObjectfindChildWithOrder (Type type, uint16 order, int subType=-1) const
 
ObjectfindChildWithName (Type type, const Common::String &name, int subType=-1) const
 
template<class T >
T * findChild (bool mustBeUnique=true) const
 
template<class T >
T * findChildWithSubtype (int subType, bool mustBeUnique=true) const
 
template<class T >
T * findChildWithIndex (uint16 index, int subType=-1) const
 
template<class T >
T * findChildWithOrder (uint16 order, int subType=-1) const
 
template<class T >
T * findChildWithName (const Common::String &name, int subType=-1) const
 
template<class T >
Common::Array< T * > listChildren (int subType=-1) const
 
template<class T >
Common::Array< T * > listChildrenRecursive (int subType=-1)
 
void addChild (Object *child)
 
virtual void print (uint depth=0)
 
template<>
Objectcast (Object *resource)
 
template<>
ObjectfindParent ()
 
template<>
Common::Array< Object * > listChildren (int subType) const
 

Static Public Attributes

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

Protected Member Functions

void printData () override
 
- Protected Member Functions inherited from Stark::Resources::Object
 Object (Object *parent, byte subType, uint16 index, const Common::String &name)
 
void printWithDepth (uint depth, const Common::String &string) const
 
void printDescription (uint depth) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Stark::Resources::Object
template<class T >
static T * cast (Object *resource)
 
- Protected Attributes inherited from Stark::Resources::Object
Type _type
 
byte _subType
 
uint16 _index
 
Common::String _name
 
Object_parent
 
Common::Array< Object * > _children
 

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.

Member Function Documentation

◆ onAllLoaded()

void Stark::Resources::Location::onAllLoaded ( )
overridevirtual

Called when the resource sub-tree is entirely loaded.

Allows to load data from other nodes.

Reimplemented from Stark::Resources::Object.

◆ onEnterLocation()

void Stark::Resources::Location::onEnterLocation ( )
overridevirtual

Called when entering a location

Reimplemented from Stark::Resources::Object.

◆ onGameLoop()

void Stark::Resources::Location::onGameLoop ( )
overridevirtual

Called once per game loop

Reimplemented from Stark::Resources::Object.

◆ saveLoadCurrent()

void Stark::Resources::Location::saveLoadCurrent ( ResourceSerializer serializer)
overridevirtual

Persist / restore the resource state

Called only for active locations

Reimplemented from Stark::Resources::Object.

◆ has3DLayer()

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

Does the location have a 3D layer ?

◆ listRenderEntries()

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

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

◆ listLightEntries()

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

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

◆ initScroll()

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

Initialize scrolling from Camera data

◆ getScrollPosition()

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

Obtain the current scroll position

◆ setScrollPosition()

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

Scroll the location to the specified position if possible

◆ scrollToCoordinateSmooth()

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

Smoothly scroll to a position in 2D world coordinates

◆ scrollToCharacterImmediate()

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

Immediatly scroll the character location

◆ goToLayer()

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

Replace the currently active layer

◆ setHasActiveScroll()

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

Indicate on script driven scroll is active.

This means that the location should not follow the character

◆ stopAllScrolls()

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

Stop all script driven scrolls

◆ startFollowingCharacter()

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

Tell the location to scroll to follow the character

◆ stopFollowingCharacter()

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

Tell the location not to scroll to follow the character

◆ getCharacterItem()

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

Get an item from its character index

◆ registerCharacterItem()

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

Register an item as a character to the location

◆ listModelItems()

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

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

◆ resetAnimationBlending()

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

Reset animation blending for all the items in the location

◆ findStockSound()

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

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

◆ startRumble()

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

Set remaining frames to rumble on this lcation

◆ fadeInInit()

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

Setup fading for this location

◆ swayScene()

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

◆ floatScene()

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

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

◆ getLayerByName()

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

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

◆ getRenderEntryByName()

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

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

◆ listLayers()

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

Obtain the list of all the inner layers

◆ listExitPositions()

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

List all the exit positions


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