$treeview $search $mathjax
Stratagus
2.2.6
$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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include <string>
#include <map>
#include "sound.h"
#include "sound_server.h"
#include "util.h"
sound_id.cpp - The sound id. | |
static std::map< std::string, CSound * > | SoundMap |
static CSound * | FindSound (const std::string &name) |
void | MapSound (const std::string &name, CSound *id) |
Map sound to identifier. | |
CSound * | SoundForName (const std::string &name) |
Get the sound id bound to an identifier. | |
CSound * | MakeSound (const std::string &name, const char *file[], int nb) |
Make a sound bound to identifier. | |
CSound * | MakeSoundGroup (const std::string &name, CSound *first, CSound *second) |
Make a sound group bound to identifier. |
static CSound* FindSound | ( | const std::string & | name | ) | [static] |
CSound* MakeSound | ( | const std::string & | name, | |
const char * | file[], | |||
int | nb | |||
) |
Make a sound bound to identifier.
Ask the sound server to register a sound and store the mapping between its name and its id. Register a sound group (or an unique sound if nb==1) and get the corresponding sound id.
name | name of this sound group (Freed by caller). | |
file | list of sound file names | |
nb | number of sounds |
Make a sound group bound to identifier.
Ask the sound server to build a special sound group.
Register two sound groups together to make a special sound (for selection). Return the corresponding id after registering it under a given name.
name | the name of the group (handled by caller). | |
first | id of the first group | |
second | id of the second group |
void MapSound | ( | const std::string & | name, | |
CSound * | id | |||
) |
Map sound to identifier.
Add a new mapping (sound name to sound id) in the hash table Create a new mapping between a name and an already valid sound id.
name | Name of the sound (now freed by caller!). | |
id | Sound identifier. |
CSound* SoundForName | ( | const std::string & | name | ) |
Get the sound id bound to an identifier.
Maps a sound name to its id
name | Sound name. |