Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

Rt2dMessage
[Rt2dAnim (inc. Maestro)]


Data Structures

struct   Rt2dMessage
struct   Rt2dMessageList

Typedefs

typedef Rt2dMessage *(*  Rt2dMessageHandlerCallBack )(Rt2dMaestro *maestro, Rt2dMessage *message)

Enumerations

enum   Rt2dMessageType {
  rt2dMESSAGETYPENULL = 0, rt2dMESSAGETYPEPLAY, rt2dMESSAGETYPESTOP, rt2dMESSAGETYPENEXTFRAME,
  rt2dMESSAGETYPEPREVFRAME, rt2dMESSAGETYPEGOTOFRAME, rt2dMESSAGETYPEGOTOLABEL, rt2dMESSAGETYPEGETURL,
  rt2dMESSAGETYPEDOACTION, rt2dMESSAGETYPEFOREIGN, rt2dMESSAGETYPEMOUSEMOVETO, rt2dMESSAGETYPEMOUSEBUTTONSTATE,
  rt2dMESSAGETYPESPECIALTELLTARGET, rt2dMESSAGETYPEBUTTONBYLABEL, rt2dMESSAGETYPEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}

Functions

Rt2dMessageType  Rt2dMessageGetMessageType (Rt2dMessage *message)
void  Rt2dMessageSetMessageType (Rt2dMessage *message, Rt2dMessageType messageType)
RwInt32  Rt2dMessageGetIndex (Rt2dMessage *message)
void  Rt2dMessageSetIndex (Rt2dMessage *message, RwInt32 index)
void  Rt2dMessageGetParam (Rt2dMessage *message, RwInt32 *param1, RwInt32 *param2)
void  Rt2dMessageSetParam (Rt2dMessage *message, RwInt32 param1, RwInt32 param2)
Rt2dMaestro Rt2dMaestroAddMessageList (Rt2dMaestro *maestro, Rt2dMessage *message, RwInt32 num, RwInt32 *index)
Rt2dMaestro Rt2dMaestroPostMessages (Rt2dMaestro *maestro, Rt2dMessage *message, RwInt32 num)
Rt2dMaestro Rt2dMaestroProcessMessages (Rt2dMaestro *maestro)
Rt2dMessage Rt2dMessageHandlerDefaultCallBack (Rt2dMaestro *maestro, Rt2dMessage *message)
Rt2dMessageHandlerCallBack  Rt2dMaestroGetMessageHandler (Rt2dMaestro *maestro)
Rt2dMaestro Rt2dMaestroSetMessageHandler (Rt2dMaestro *maestro, Rt2dMessageHandlerCallBack handler)

Detailed Description

Messages

Rt2dMessage Overview

Rt2dMessage is a message structure that is used to coordinate animation sequences by Rt2dMaestro.

It may also be used by calling code to notify the Maestro of external events. This is carried out through the use of the Rt2dMaestroPostMessages and Rt2dMaestroProcessMessages functions.

Additionally, if a custom message handler is hooked to Rt2dMaestro, Rt2dMessage structures are passed to that handler. These may be examined to determine when particular animation events have occurred.

Rt2dMessage contains several pieces of information. Rt2dMessageType messageType

The messageType identifies how the message is interpreted by Rt2dMaestro. It may be one of the following:

rt2dMESSAGETYPEPLAY Play animation rt2dMESSAGETYPESTOP Stop animation rt2dMESSAGETYPENEXTFRAME Advance to next frame rt2dMESSAGETYPEPREVFRAME Rewind to previouse frame rt2dMESSAGETYPEGOTOFRAME Advance to frame by index rt2dMESSAGETYPEGOTOLABEL Advance to frame by label rt2dMESSAGETYPEGETURL Get URL rt2dMESSAGETYPEFOREIGN Application specific message rt2dMESSAGETYPEMOUSEMOVETO Move mouse rt2dMESSAGETYPEMOUSEBUTTONSTATE Mouse button up or down rt2dMESSAGETYPEBUTTONBYLABEL Mouse button transition by label

This message type identifies how the other parameters are to be interpreted.

index is generally used to identify which animation within Rt2dMaestro that the message applies to. Messages posted externally may be sent to specific animations.

A description of the individual message types follows:

rt2dMESSAGETYPEPLAY Starts an animation playing. index is the animation that will start playing. intParam1, intParam2 are unused

rt2dMESSAGETYPESTOP Stops an animation. index is the animation that will stop playing. intParam1, intParam2 are unused

rt2dMESSAGETYPENEXTFRAME Advances an animation to the next frame. index is the animation that will be advanced. intParam1, intParam2 are unused

rt2dMESSAGETYPEPREVFRAME Rewinds an animation to the previous frame. index is the animation that will be rewound. intParam1, intParam2 are unused

rt2dMESSAGETYPEGOTOFRAME Goto to frame by index. index is the animation that will go to the specified frame. intParam1 is the frame number to go to, starting at frame 0. intParam2 is unused

rt2dMESSAGETYPEGOTOLABEL Advance to frame by label. index is the animation that will go to the specified frame. intParam1 is the index of the string label that contains the frame label of the frame to go to. intParam2 is unused

rt2dMESSAGETYPEGETURL Can be used as an extension mechanism. During content generation, a GetURL action may be specified with a string, eg GetURL("StartGame"). By hooking a custom message handler, the GetURL message may be intercepted and user to trigger in-game events. Nothing is done with this message by the default handler. index is the animation that the message was issued within. intParam1 is the index of the string label that was specified in the GetURL action. intParam2 is unused

rt2dMESSAGETYPEDOACTION Queues an internal list of messages. Not intended for external use. index is the animation that the message was issued within. intParam1 is the index of the message list to be queued. intParam2 is unused

rt2dMESSAGETYPEFOREIGN An extension mechanism for the inclusion of binary data. Reserved for future use. index is the animation that the message was issued within. intParam1 is the index of the binary data within an internal binary data store. intParam2 is unused

rt2dMESSAGETYPEMOUSEMOVETO Notification that the mouse has changed position. Causes update of button states. index is unused. intParam1 is the new mouse X coordinate. intParam2 is the new mouse Y coordinate

rt2dMESSAGETYPEMOUSEBUTTONSTATE Notification that the mouse button state has changed. index is unused. intParam1 is the button state; 0=up; 1=down. intParam2 is unused

rt2dMESSAGETYPESPECIALTELLTARGET Used internally to control which animation stored messages are applied to. Not for external use.

rt2dMESSAGETYPEBUTTONBYLABEL Cause a button transition on a button identified by a string label. May be used to pipe in external button presses to specific buttons identified by a name registered in a string labels. Buttons may be named in third party tools through an 'Export' option in those tools. index is the animation to send the button push to. intParam1 is the index of the string label naming the button. intParam2 is the button transition to be triggered, allowable transitions are rt2dANIMBUTTONSTATEIDLETOOVERUP rt2dANIMBUTTONSTATEOVERUPTOIDLE rt2dANIMBUTTONSTATEOVERUPTOOVERDOWN rt2dANIMBUTTONSTATEOVERDOWNTOOVERUP rt2dANIMBUTTONSTATEOVERDOWNTOOUTDOWN rt2dANIMBUTTONSTATEOUTDOWNTOOVERDOWN rt2dANIMBUTTONSTATEOUTDOWNTOIDLE rt2dANIMBUTTONSTATEIDLETOOVERDOWN rt2dANIMBUTTONSTATEOVERDOWNTOIDLE

See also:
Rt2dMaestroPostMessages , Rt2dMaestroProcessMessages , Rt2dStringLabel

Typedef Documentation

typedef Rt2dMessage*(* Rt2dMessageHandlerCallBack)(Rt2dMaestro *maestro, Rt2dMessage *message)
 

Rt2dMessageHandlerCallBack represents the function called from Rt2dMaestroProcessMessages for all messages in the maestro's process message queue. The maestro does not filter any messages. The handler may process or ignore any messages it is given.

This function should return the current message to indicate success. The callback may return NULL to terminate further callbacks on the maestro.

Parameters:
maestro  Pointer to parent maestro.
message  Pointer to the message.
Returns:
Pointer to the message.

Enumeration Type Documentation

enum Rt2dMessageType
 

Rt2dMessageType, this type represents the different types of messages that are available.

Enumeration values:
rt2dMESSAGETYPENULL  Empty message.
rt2dMESSAGETYPEPLAY  Play animation.
rt2dMESSAGETYPESTOP  Stop animation.
rt2dMESSAGETYPENEXTFRAME  Advance to next frame.
rt2dMESSAGETYPEPREVFRAME  Rewind to previouse frame.
rt2dMESSAGETYPEGOTOFRAME  Advance to frame by index.
rt2dMESSAGETYPEGOTOLABEL  Advance to frame by label.
rt2dMESSAGETYPEGETURL  Get URL
rt2dMESSAGETYPEFOREIGN  Application specific message.
rt2dMESSAGETYPEMOUSEMOVETO  Move mouse.
rt2dMESSAGETYPEMOUSEBUTTONSTATE  Mouse button up or down.
rt2dMESSAGETYPEBUTTONBYLABEL  Mouse button transition by label

Function Documentation

Rt2dMaestro* Rt2dMaestroAddMessageList Rt2dMaestro   maestro,
Rt2dMessage   message,
RwInt32    num,
RwInt32   index
 

Rt2dMaestroAddMessageList is used to add a list of messages to the maestro. The maestro maintains a central storage repository for all the internal messages used in an animation. The messages are copied into the repository and an index for retrieving the messages is returned.

Parameters:
maestro  Pointer to the parent maestro.
message  Pointer to the list of messages.
num  Number of messages in the list.
index  Pointer to a RwInt32 to return the index.
Returns:
Returns a pointer to the maestro if successful, NULL otherwise.
See also:
Rt2dMaestroProcessMessages , Rt2dMaestroPostMessages
Rt2dMessageHandlerCallBack Rt2dMaestroGetMessageHandler Rt2dMaestro   maestro
 

Rt2dMaestroGetMessageHandler is used to retrieve the current message handler in the maestro. There is one handler for all messages.

Parameters:
maestro  Pointer to parent maestro.
Returns:
Returns a pointer to the message handler if successful, NULL otherwise.
See also:
Rt2dMaestroPostMessages , Rt2dMaestroProcessMessages , Rt2dMaestroSetMessageHandler , Rt2dMessageHandlerDefaultCallBack
Rt2dMaestro* Rt2dMaestroPostMessages Rt2dMaestro   maestro,
Rt2dMessage   message,
RwInt32    num
 

Rt2dMaestroPostMessages is used to add a list of messages to the maestro's message queue. The maestro maintains a list of messages that are to be processed in the next Rt2dMaestroProcessMessages. This message queue can be filled internally, by other messages, or externally by the user.

Messages in the queue are processed in sequence they are added. It is possible for the list to grow during message processing. Messages can add new messages for further processing. These new messages will be added to the end of the queue and processed in turn rather than immediately.

Parameters:
maestro  Pointer to parent maestro.
message  Pointer to the list of messages.
num  Number of the messages in the list.
Returns:
Returns a pointer to the maestro if successful, NULL otherwise.
See also:
Rt2dMaestroProcessMessages , Rt2dMaestroAddMessageList , Rt2dMessageHandlerDefaultCallBack
Rt2dMaestro* Rt2dMaestroProcessMessages Rt2dMaestro   maestro
 

Rt2dMaestroProcessMessages is used to begin processing of the messages in the maestro's message queue. Once started, message processing will continue until all messages in the queue are processed. The message queue can grow during processing because messages can add additional messages to the queue.

Parameters:
maestro  Pointer to the parent maestro.
Returns:
Returns a pointer to the maestro if successful, NULL otherwise.
See also:
Rt2dMaestroAddMessageList , Rt2dMaestroPostMessages , Rt2dMessageHandlerDefaultCallBack
Rt2dMaestro* Rt2dMaestroSetMessageHandler Rt2dMaestro   maestro,
Rt2dMessageHandlerCallBack    handler
 

Rt2dMaestroSetMessageHandler is used change the current message handler to the given one. There is only one message handler for all messages.

Parameters:
maestro  Pointer to parent maestro.
handler  Pointer to message handler callback.
Returns:
Returns a pointer to the message handler if successful, NULL otherwise.
See also:
Rt2dMaestroPostMessages , Rt2dMaestroProcessMessages , Rt2dMaestroGetMessageHandler , Rt2dMessageHandlerDefaultCallBack
RwInt32 Rt2dMessageGetIndex Rt2dMessage   message
 

Rt2dMessageGetIndex is used retrieve the animation index which the message is to be applied to.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
message  Pointer to the message.
Returns:
Returns the animation's index if successful, -1 otherwise.
See also:
Rt2dMessageSetIndex , Rt2dMaestroAddAnimations
Rt2dMessageType Rt2dMessageGetMessageType Rt2dMessage   message
 

Rt2dMessageGetMessageType is used to get the message's type, (Rt2dMessageType).

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
message  Pointer to the message.
Returns:
Returns the message type.
See also:
Rt2dMessageType , Rt2dMessageSetMessageType
void Rt2dMessageGetParam Rt2dMessage   message,
RwInt32   param1,
RwInt32   param2
 

Rt2dMessageGetParam is used to retrieve the message specific parameters. Each message may have none, one or two additional parameters.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
message  Pointer to the message.
param1  Pointer to a RwInt32 to return the first parameter.
param2  Pointer to a RwInt32 to return the second parameter.
See also:
Rt2dMessageSetParam
Rt2dMessage* Rt2dMessageHandlerDefaultCallBack Rt2dMaestro   maestro,
Rt2dMessage   message
 

Rt2dMessageHandlerDefaultCallBack is the default message handler. It supports most message types. Messages that are foreign or require external data are ignored.

All messages in the message queue are passed to a single message handler. It is the handlers responsibility to either process or ignore messages. The maestro does not filter any messages. The handler may post new messages to maestro but it must not call Rt2dMaestroProcessMessages.

Parameters:
maestro  Pointer to parent maestro.
message  Pointer to the message.
Returns:
Returns a pointer to the message if successful, NULL otherwise.
See also:
Rt2dMaestroPostMessages , Rt2dMaestroProcessMessages , Rt2dMaestroSetMessageHandler , Rt2dMaestroGetMessageHandler
void Rt2dMessageSetIndex Rt2dMessage   message,
RwInt32    index
 

Rt2dMessageSetIndex is used to set the animation the message is applied to. A -1 indicates it is to be applied to the current animation.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
message  Pointer to the message.
index  Animation index.
See also:
Rt2dMessageGetIndex , Rt2dMaestroAddAnimations
void Rt2dMessageSetMessageType Rt2dMessage   message,
Rt2dMessageType    messageType
 

Rt2dMessageSetMessageType is used to set the type of the message, (Rt2dMessageType).

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
message  Pointer to the message.
messageType  Message type.
See also:
Rt2dMessageType , Rt2dMessageGetMessageType
void Rt2dMessageSetParam Rt2dMessage   message,
RwInt32    param1,
RwInt32    param2
 

Rt2dMessageSetParam is used to set the message specific parameters. Each message may have none, one or two additional parameters.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
message  Pointer to the message.
param1  The first addtional parameter.
param2  The second additional parameter.
See also:
Rt2dMessageGetParam

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:51 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)