sfxTypes.h

Engine/source/sfx/sfxTypes.h

Additional SFX console types.

More...

Datablock Network I/O

The following functions allow to transmit datablock references over the network even when the referenced datablocks are not networked ("client-only" datablocks).

The write functions write a reference to the bitstream.

The read functions read a reference from the bitstream and store it in a non-resolved form, i.e. the resulting pointer will not yet be valid. This is necessary as during datablock transmission, the referenced datablock may actually only be transmitted later in the stream and cannot thus be immediately looked up on the client.

The resolve functions take an unresolved datablock reference and resolve them to valid pointers.

sfxRead(BitStream * stream, SFXAmbience ** ambience)
sfxRead(BitStream * stream, SFXDescription ** description)
sfxRead(BitStream * stream, SFXEnvironment ** environment)
sfxRead(BitStream * stream, SFXState ** state)
sfxRead(BitStream * stream, SFXTrack ** track)
bool
sfxReadAndResolve(BitStream * stream, SFXAmbience ** ambience, String & errorString)
bool
sfxReadAndResolve(BitStream * stream, SFXDescription ** description, String & errorString)
bool
sfxReadAndResolve(BitStream * stream, SFXEnvironment ** environment, String & errorString)
bool
sfxReadAndResolve(BitStream * stream, SFXSource ** source, String & errorString)
bool
sfxReadAndResolve(BitStream * stream, SFXState ** state, String & errorString)
bool
sfxReadAndResolve(BitStream * stream, SFXTrack ** track, String & errorString)
bool
sfxResolve(SFXAmbience ** ambience, String & errorString)
bool
sfxResolve(SFXDescription ** description, String & errorString)
bool
sfxResolve(SFXEnvironment ** environment, String & errorString)
bool
sfxResolve(SFXState ** state, String & errorString)
bool
sfxResolve(SFXTrack ** track, String & errorString)
sfxWrite(BitStream * stream, SFXAmbience * ambience)
sfxWrite(BitStream * stream, SFXDescription * description)
sfxWrite(BitStream * stream, SFXEnvironment * environment)
sfxWrite(BitStream * stream, SFXSource * source)
sfxWrite(BitStream * stream, SFXState * state)
sfxWrite(BitStream * stream, SFXTrack * track)

Public Functions

DefineConsoleType(TypeSFXAmbienceName , SFXAmbience * )

SFXAmbience datablock reference. May be client-only.

DefineConsoleType(TypeSFXDescriptionName , SFXDescription * )

SFXDescription datablock reference. May be client-only.

DefineConsoleType(TypeSFXEnvironmentName , SFXEnvironment * )

SFXEnvironment datablock reference. May be client-only.

DefineConsoleType(TypeSFXParameterName , StringTableEntry )

Name of an SFXParameter.

DefineConsoleType(TypeSFXSourceName , SFXSource * )
DefineConsoleType(TypeSFXStateName , SFXState * )

SFXState datablock reference. May be client-only.

DefineConsoleType(TypeSFXTrackName , SFXTrack * )

SFXTrack datablock reference. May be client-only.

Detailed Description

Additional SFX console types.

Datablock Network I/O

The following functions allow to transmit datablock references over the network even when the referenced datablocks are not networked ("client-only" datablocks).

The write functions write a reference to the bitstream.

The read functions read a reference from the bitstream and store it in a non-resolved form, i.e. the resulting pointer will not yet be valid. This is necessary as during datablock transmission, the referenced datablock may actually only be transmitted later in the stream and cannot thus be immediately looked up on the client.

The resolve functions take an unresolved datablock reference and resolve them to valid pointers.

sfxRead(BitStream * stream, SFXAmbience ** ambience)

sfxRead(BitStream * stream, SFXDescription ** description)

sfxRead(BitStream * stream, SFXEnvironment ** environment)

sfxRead(BitStream * stream, SFXState ** state)

sfxRead(BitStream * stream, SFXTrack ** track)

sfxReadAndResolve(BitStream * stream, SFXAmbience ** ambience, String & errorString)

sfxReadAndResolve(BitStream * stream, SFXDescription ** description, String & errorString)

sfxReadAndResolve(BitStream * stream, SFXEnvironment ** environment, String & errorString)

sfxReadAndResolve(BitStream * stream, SFXSource ** source, String & errorString)

sfxReadAndResolve(BitStream * stream, SFXState ** state, String & errorString)

sfxReadAndResolve(BitStream * stream, SFXTrack ** track, String & errorString)

sfxResolve(SFXAmbience ** ambience, String & errorString)

sfxResolve(SFXDescription ** description, String & errorString)

sfxResolve(SFXEnvironment ** environment, String & errorString)

sfxResolve(SFXState ** state, String & errorString)

sfxResolve(SFXTrack ** track, String & errorString)

sfxWrite(BitStream * stream, SFXAmbience * ambience)

sfxWrite(BitStream * stream, SFXDescription * description)

sfxWrite(BitStream * stream, SFXEnvironment * environment)

sfxWrite(BitStream * stream, SFXSource * source)

sfxWrite(BitStream * stream, SFXState * state)

sfxWrite(BitStream * stream, SFXTrack * track)

Public Functions

DefineConsoleType(TypeSFXAmbienceName , SFXAmbience * )

SFXAmbience datablock reference. May be client-only.

DefineConsoleType(TypeSFXDescriptionName , SFXDescription * )

SFXDescription datablock reference. May be client-only.

DefineConsoleType(TypeSFXEnvironmentName , SFXEnvironment * )

SFXEnvironment datablock reference. May be client-only.

DefineConsoleType(TypeSFXParameterName , StringTableEntry )

Name of an SFXParameter.

Resolved to SFXParamter instances on the client when creating a source.

This is a separate type so that the inspector can provide meaningful popups.

DefineConsoleType(TypeSFXSourceName , SFXSource * )

DefineConsoleType(TypeSFXStateName , SFXState * )

SFXState datablock reference. May be client-only.

DefineConsoleType(TypeSFXTrackName , SFXTrack * )

SFXTrack datablock reference. May be client-only.

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#ifndef _SFXTYPES_H_
 25#define _SFXTYPES_H_
 26
 27#ifndef _CONSOLETYPES_H_
 28   #include "console/consoleTypes.h"
 29#endif
 30
 31
 32/// @file
 33/// Additional SFX console types.
 34
 35
 36class BitStream;
 37class SFXTrack;
 38class SFXEnvironment;
 39class SFXDescription;
 40class SFXState;
 41class SFXAmbience;
 42class SFXSource;
 43
 44
 45///
 46DefineConsoleType( TypeSFXSourceName, SFXSource* );
 47
 48/// Name of an SFXParameter.  Resolved to SFXParamter instances on the
 49/// client when creating a source.
 50///
 51/// This is a separate type so that the inspector can provide meaningful
 52/// popups.
 53DefineConsoleType( TypeSFXParameterName, StringTableEntry );
 54
 55/// SFXDescription datablock reference.  May be client-only.
 56DefineConsoleType( TypeSFXDescriptionName, SFXDescription* );
 57
 58/// SFXTrack datablock reference.  May be client-only.
 59DefineConsoleType( TypeSFXTrackName, SFXTrack* );
 60
 61/// SFXEnvironment datablock reference.  May be client-only.
 62DefineConsoleType( TypeSFXEnvironmentName, SFXEnvironment* );
 63
 64/// SFXState datablock reference.  May be client-only.
 65DefineConsoleType( TypeSFXStateName, SFXState* );
 66
 67/// SFXAmbience datablock reference.  May be client-only.
 68DefineConsoleType( TypeSFXAmbienceName, SFXAmbience* );
 69
 70
 71/// @name Datablock Network I/O
 72///
 73/// The following functions allow to transmit datablock references over the network
 74/// even when the referenced datablocks are not networked ("client-only" datablocks).
 75///
 76/// The write functions write a reference to the bitstream.
 77///
 78/// The read functions read a reference from the bitstream and store it in a non-resolved
 79/// form, i.e. the resulting pointer will not yet be valid.  This is necessary as during
 80/// datablock transmission, the referenced datablock may actually only be transmitted
 81/// later in the stream and cannot thus be immediately looked up on the client.
 82///
 83/// The resolve functions take an unresolved datablock reference and resolve them to
 84/// valid pointers.
 85///
 86/// @{
 87
 88void sfxWrite( BitStream* stream, SFXSource* source );
 89void sfxWrite( BitStream* stream, SFXDescription* description );
 90void sfxWrite( BitStream* stream, SFXTrack* track );
 91void sfxWrite( BitStream* stream, SFXEnvironment* environment );
 92void sfxWrite( BitStream* stream, SFXState* state );
 93void sfxWrite( BitStream* stream, SFXAmbience* ambience );
 94
 95void sfxRead( BitStream* stream, SFXDescription** description );
 96void sfxRead( BitStream* stream, SFXTrack** track );
 97void sfxRead( BitStream* stream, SFXEnvironment** environment );
 98void sfxRead( BitStream* stream, SFXState** state );
 99void sfxRead( BitStream* stream, SFXAmbience** ambience );
100
101bool sfxResolve( SFXDescription** description, String& errorString );
102bool sfxResolve( SFXTrack** track, String& errorString );
103bool sfxResolve( SFXEnvironment** environment, String& errorString );
104bool sfxResolve( SFXState** state, String& errorString );
105bool sfxResolve( SFXAmbience** ambience, String& errorString );
106
107bool sfxReadAndResolve( BitStream* stream, SFXSource** source, String& errorString );
108
109inline bool sfxReadAndResolve( BitStream* stream, SFXDescription** description, String& errorString )
110{
111   sfxRead( stream, description );
112   return sfxResolve( description, errorString );
113}
114
115inline bool sfxReadAndResolve( BitStream* stream, SFXTrack** track, String& errorString )
116{
117   sfxRead( stream, track );
118   return sfxResolve( track, errorString );
119}
120
121inline bool sfxReadAndResolve( BitStream* stream, SFXEnvironment** environment, String& errorString )
122{
123   sfxRead( stream, environment );
124   return sfxResolve( environment, errorString );
125}
126
127inline bool sfxReadAndResolve( BitStream* stream, SFXState** state, String& errorString )
128{
129   sfxRead( stream, state );
130   return sfxResolve( state, errorString );
131}
132
133inline bool sfxReadAndResolve( BitStream* stream, SFXAmbience** ambience, String& errorString )
134{
135   sfxRead( stream, ambience );
136   return sfxResolve( ambience, errorString );
137}
138
139/// @}
140
141#endif // !_SFXTYPES_H_
142