Stage Class Reference

#include <Stage.h>

Inheritance diagram for Stage:
Container

# Public Types

typedef const StageSpec StageROMSpec

# Public Member Functions

void constructor (StageSpec *stageSpec)
override void suspend ()
 Prepare to suspend this instance's logic.
override void resume ()
 Prepare to resume this instance's logic.
const StageSpecgetSpec ()
void configureTimer ()
 Configure the timer.
void configurePalettes ()
 Configure the color palettes.
PaletteConfig getPaletteConfig ()
void registerActors (VirtualList positionedActorsToIgnore)
 Register the stage's spec actors in the streaming list.
void addActorLoadingListener (ListenerObject listener)
Actor spawnChildActor (const PositionedActor *const positionedActor, bool permanent)
void destroyChildActor (Actor child)
void streamAll ()
 Stream in or/and out all pending actors.
VirtualList getSounds ()
void fadeSounds (uint32 playbackType)
void print (int32 x, int32 y)
virtual bool stream ()
 Stream in or out actors within or outside the camera's range.
virtual void configure (VirtualList positionedActorsToIgnore)

# Protected Attributes

StageSpecstageSpec
 Pointer to the spec that defines how to initialize the stage.
ActorFactory actorFactory
 Factory to create this actor's children.
VirtualList stageActorDescriptions
VirtualNode streamingHeadNode
 Pivot node for streaming.
VirtualList sounds
VirtualList actorLoadingListeners
 List of listeners for actor loading.
int32 streamingPhase
 Index for streaming method to execute in the current game cycle.
uint16 streamingAmplitude
 Amount of actor descriptions to check for streaming in entitis.
Actor focusActor
int16 nextActorId
 Next ID to use for new actors.
bool reverseStreaming
 Flag to determine the direction of the stream in.
Transformation cameraTransformation
 Cache of the camera's transformation for resuming the game.

# Private Member Functions

bool unloadOutOfRangeActors (int32 defer)
bool loadInRangeActors (int32 defer)
- Private Member Functions inherited from Container
void constructor (int16 internalId, const char *const name)
override void setDirection (const Vector3D *direction)
override void show ()
 Make this instance visible.
override void hide ()
 Make this instance invisible.
override void setTransparency (uint8 transparency)
override void setPosition (const Vector3D *position)
override void setRotation (const Rotation *rotation)
override void setScale (const Scale *scale)
void setNormalizedDirection (NormalizedDirection normalizedDirection)
NormalizedDirection getNormalizedDirection ()
void deleteMyself ()
int16 getInternalId ()
void setName (const char *const name)
const char * getName ()
void streamOut (bool streamOut)
Container getParent ()
void addChild (Container child)
void removeChild (Container child, bool deleteChild)
void purgeChildren ()
 Force the destruction of all children marked to be deleted.
bool getChildren (ClassPointer classPointer, VirtualList children)
Container getChildById (int16 id)
Container getChildByName (const char *childName, bool recursive)
Container getChildAtPosition (int16 position)
int32 getChildrenCount ()
Container getFirstAncestor ()
Container getRelativeByName (const char *relativeName)
void updateChildren ()
 Update the children of this container.
void invalidateTransformation ()
void transformChildren (uint8 invalidateTransformationFlag)
void propagateCommand (uint32 command,...)
bool propagateMessage (bool(*propagatedMessageHandler)(void *, va_list),...)
bool onPropagatedMessage (va_list args)
bool propagateString (bool(*propagatedMessageHandler)(void *, va_list),...)
bool onPropagatedString (va_list args)
void translate (const Vector3D *translation)
void rotate (const Rotation *rotation)
void scale (const Scale *scale)
const Vector3DgetLocalPosition ()
const RotationgetLocalRotation ()
const ScalegetLocalScale ()
virtual void setLocalPosition (const Vector3D *position)
virtual void setLocalRotation (const Rotation *rotation)
virtual void setLocalScale (const Scale *scale)
virtual void ready (bool recursive)
virtual void transform (const Transformation *environmentTransform, uint8 invalidateTransformationFlag)
virtual void update ()
 Update this instance's logic.
virtual void handleCommand (int32 command, va_list args)
virtual bool handlePropagatedMessage (int32 message)
virtual bool handlePropagatedString (const char *string)

# Additional Inherited Members

- Private Attributes inherited from Container
Container parent
 Container of which this one is a child.
VirtualList children
Transformation localTransformation
 3D local transformation
char * name
 Container's name.
int16 internalId
 Container's internal id, set by the engine.
bool deleteMe
 If true, the parent will delete this container when appropriate.
bool ready
bool dontStreamOut
bool hidden
 Flag to mark the container (and its children) as non visible.
int8 axisForSynchronizationWithBody
 Axises around which to rotate the container when syncronizing with body.

# Detailed Description

Class Stage

Inherits from Container

Implements a container that represents a game level.

Definition at line 217 of file Stage.h.

# Member Typedef Documentation

# StageROMSpec

typedef const StageSpec StageROMSpec

A Stage spec that is stored in ROM

Definition at line 184 of file Stage.h.

# Member Function Documentation

# addActorLoadingListener()

void Stage::addActorLoadingListener ( ListenerObject listener)

Register an event listener for the event when a new actor is instantiated.

Parameters
listenerObject that will be notified of event

Definition at line 357 of file Stage.c.

# configure()

void Stage::configure ( VirtualList positionedActorsToIgnore)
virtual

Configure the stage with the actors defined in its spec.

Parameters
positionedActorsToIgnoreList of positioned actor structs to register for streaming

Definition at line 571 of file Stage.c.

# configurePalettes()

void Stage::configurePalettes ( )

Configure the color palettes.

Definition at line 241 of file Stage.c.

# configureTimer()

void Stage::configureTimer ( )

Configure the timer.

# constructor()

void Stage::constructor ( StageSpec * stageSpec)

Class' constructor

Parameters
stageSpecSpecification that determines how to configure the stage

Definition at line 111 of file Stage.c.

# destroyChildActor()

void Stage::destroyChildActor ( Actor child)

Destroy a stage's child.

Parameters
childActor to destroy

Definition at line 394 of file Stage.c.

# fadeSounds()

void Stage::fadeSounds ( uint32 playbackType)

Fade in or out the registered sounds

Parameters
playbackTypeSpecifies how the playback should start

Definition at line 474 of file Stage.c.

# getPaletteConfig()

PaletteConfig Stage::getPaletteConfig ( )

Retrieve the palette configuration for the stage.

Returns
Palette configuration struct

Definition at line 248 of file Stage.c.

# getSounds()

VirtualList Stage::getSounds ( )

Retrieve the sounds that are playing in the stage.

Returns
List of playing sounds

Definition at line 467 of file Stage.c.

# getSpec()

const StageSpec * Stage::getSpec ( )

Retrieve the stage's spec.

Returns
Specification that determines how the stage was configured

Definition at line 234 of file Stage.c.

# loadInRangeActors()

bool Stage::loadInRangeActors ( int32 defer)
private

Definition at line 672 of file Stage.c.

# print()

void Stage::print ( int32 x,
int32 y )

Print the stage's state.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 497 of file Stage.c.

# registerActors()

void Stage::registerActors ( VirtualList positionedActorsToIgnore)

Register the stage's spec actors in the streaming list.

Definition at line 255 of file Stage.c.

# resume()

void Stage::resume ( )
virtual

Prepare to resume this instance's logic.

Reimplemented from Container.

Definition at line 213 of file Stage.c.

# spawnChildActor()

Actor Stage::spawnChildActor ( const PositionedActor *const positionedActor,
bool permanent )

Spawn a new child and configure it with the provided positioned actor struct.

Parameters
positionedActorStruct that defines which actor spec to use to configure the new child
permanentIf true, the actor is not subject to the streaming

Definition at line 387 of file Stage.c.

# stream()

bool Stage::stream ( )
virtual

Stream in or out actors within or outside the camera's range.

Definition at line 547 of file Stage.c.

# streamAll()

void Stage::streamAll ( )

Stream in or/and out all pending actors.

Definition at line 434 of file Stage.c.

# suspend()

void Stage::suspend ( )
virtual

Prepare to suspend this instance's logic.

Reimplemented from Container.

Definition at line 186 of file Stage.c.

# unloadOutOfRangeActors()

bool Stage::unloadOutOfRangeActors ( int32 defer)
private

These are not meant to be called externally. They are declared here because of the preprocessor's limitations for forward declarations in source files. Don't call these.

Definition at line 597 of file Stage.c.

# Member Data Documentation

# actorFactory

ActorFactory Stage::actorFactory
protected

Factory to create this actor's children.

Definition at line 225 of file Stage.h.

# actorLoadingListeners

VirtualList Stage::actorLoadingListeners
protected

List of listeners for actor loading.

Definition at line 238 of file Stage.h.

# cameraTransformation

Transformation Stage::cameraTransformation
protected

Cache of the camera's transformation for resuming the game.

Definition at line 257 of file Stage.h.

# focusActor

Actor Stage::focusActor
protected

Must keep track of the camera's focus actor in order to restore it when resuming the stage's owner state

Definition at line 248 of file Stage.h.

# nextActorId

int16 Stage::nextActorId
protected

Next ID to use for new actors.

Definition at line 251 of file Stage.h.

# reverseStreaming

bool Stage::reverseStreaming
protected

Flag to determine the direction of the stream in.

Definition at line 254 of file Stage.h.

# sounds

VirtualList Stage::sounds
protected

Definition at line 235 of file Stage.h.

# stageActorDescriptions

VirtualList Stage::stageActorDescriptions
protected

List of structs that holds precomputed information about the configuration of then entites that will populate the stage

Definition at line 229 of file Stage.h.

# stageSpec

StageSpec* Stage::stageSpec
protected

Pointer to the spec that defines how to initialize the stage.

Definition at line 222 of file Stage.h.

# streamingAmplitude

uint16 Stage::streamingAmplitude
protected

Amount of actor descriptions to check for streaming in entitis.

Definition at line 244 of file Stage.h.

# streamingHeadNode

VirtualNode Stage::streamingHeadNode
protected

Pivot node for streaming.

Definition at line 232 of file Stage.h.

# streamingPhase

int32 Stage::streamingPhase
protected

Index for streaming method to execute in the current game cycle.

Definition at line 241 of file Stage.h.


The documentation for this class was generated from the following files:
  • VUEngine-Core/source/Entity/Container/Stage/Stage.h
  • VUEngine-Core/source/Entity/Container/Stage/Stage.c