$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"
#include "sound.h"
#include "map.h"
#include "missile.h"
#include "sound_server.h"
#include "ui.h"
#include "unit.h"
#include "widgets.h"
Classes | |
struct | SelectionHandling |
sound.cpp - The sound. | |
GameSound | GameSounds |
SelectionHandling | SelectionHandler |
FIXME: docu. | |
static int | ViewPointOffset |
int | DistanceSilent |
Distance to Volume Mapping. | |
static std::map< int, LuaActionListener * > | ChannelMap |
static CSample * | SimpleChooseSample (const CSound &sound) |
silent distance | |
static CSample * | ChooseSample (CSound *sound, bool selection, Origin &source) |
static CSound * | ChooseUnitVoiceSound (const CUnit &unit, UnitVoiceGroup voice) |
static unsigned char | VolumeForDistance (unsigned short d, unsigned char range) |
static unsigned char | CalculateVolume (bool isVolume, int power, unsigned char range) |
static char | CalculateStereo (const CUnit &unit) |
void | PlayUnitSound (const CUnit &unit, UnitVoiceGroup voice) |
Play a unit sound. | |
void | PlayUnitSound (const CUnit &unit, CSound *sound) |
Play a unit sound. | |
void | PlayMissileSound (const Missile &missile, CSound *sound) |
Play a missile sound. | |
void | PlayGameSound (CSound *sound, unsigned char volume) |
Play a game sound. | |
static void | PlaySoundFileCallback (int channel) |
int | PlayFile (const std::string &name, LuaActionListener *listener) |
Play a sound file. | |
void | SetSoundRange (CSound *sound, unsigned char range) |
Modify the range of a given sound. | |
CSound * | RegisterSound (const std::vector< std::string > &files) |
Register a sound (can be a simple sound or a group). | |
CSound * | RegisterTwoGroups (CSound *first, CSound *second) |
Create a special sound group with two sounds. | |
void | InitSoundClient () |
Initialize client side of the sound layer. |
static char CalculateStereo | ( | const CUnit & | unit | ) | [static] |
Calculate the stereo value for a unit
static unsigned char CalculateVolume | ( | bool | isVolume, | |
int | power, | |||
unsigned char | range | |||
) | [static] |
Calculate the volume associated with a request, either by clipping the range parameter of this request, or by mapping this range to a volume.
Choose the sample to play
static CSound* ChooseUnitVoiceSound | ( | const CUnit & | unit, | |
UnitVoiceGroup | voice | |||
) | [static] |
Maps a UnitVoiceGroup to a CSound*.
unit | Sound initiator | |
voice | Type of sound wanted |
void InitSoundClient | ( | ) |
Initialize client side of the sound layer.
Lookup the sound id's for the game sounds.
int PlayFile | ( | const std::string & | name, | |
LuaActionListener * | listener | |||
) |
Play a sound file.
Play a sound file
name | Filename of a sound to play | |
listener | Optional lua callback |
void PlayGameSound | ( | CSound * | sound, | |
unsigned char | volume | |||
) |
Play a game sound.
Play a game sound
sound | Sound to play | |
volume | Volume level to play the sound |
Play a missile sound.
Ask the sound server to play a sound for a missile.
missile | Sound initiator, missile exploding | |
sound | Sound to be generated |
static void PlaySoundFileCallback | ( | int | channel | ) | [static] |
Callback for PlaySoundFile
Play a unit sound.
Ask to the sound server to play a sound attached to a unit. The sound server may discard the sound if needed (e.g., when the same unit is already speaking).
unit | Sound initiator, unit speaking | |
sound | Sound to be generated |
void PlayUnitSound | ( | const CUnit & | unit, | |
UnitVoiceGroup | voice | |||
) |
Play a unit sound.
Ask to the sound server to play a sound attached to a unit. The sound server may discard the sound if needed (e.g., when the same unit is already speaking).
unit | Sound initiator, unit speaking | |
voice | Type of sound wanted (Ready,Die,Yes,...) |
CSound* RegisterSound | ( | const std::vector< std::string > & | files | ) |
Register a sound (can be a simple sound or a group).
Ask the sound server to register a sound (and currently to load it) and to return an unique identifier for it. The unique identifier is memory pointer of the server.
files | An array of wav files. | |
number | Number of files belonging together. |
Create a special sound group with two sounds.
Ask the sound server to put together two sounds to form a special sound.
first | first part of the group | |
second | second part of the group |
void SetSoundRange | ( | CSound * | sound, | |
unsigned char | range | |||
) |
Modify the range of a given sound.
Ask the sound server to change the range of a sound.
sound | the id of the sound to modify. | |
range | the new range for this sound. |
silent distance
"Randomly" choose a sample from a sound group.
static unsigned char VolumeForDistance | ( | unsigned short | d, | |
unsigned char | range | |||
) | [static] |
Compute a suitable volume for something taking place at a given distance from the current view point.
d | distance | |
range | range |
std::map<int, LuaActionListener *> ChannelMap [static] |
int DistanceSilent |
Distance to Volume Mapping.
flag true callback ccl if stops
Various sounds used in game.
FIXME: docu.
int ViewPointOffset [static] |