Complete.Org:
Mailing Lists:
Archives:
freeciv-dev:
August 2001: [Freeciv-Dev] Sound patches please add to CVS |
[Freeciv-Dev] Sound patches please add to CVS[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hi folks, how I recently announced, I have finished adding sound output to freeciv. I have only some little problems which I will describe later. I included two files, sound.c & sound.h, which must be moved to the client directory. Now you have two new functions: play_sound_unit ( struct unit *, int ) play_sound_event ( int ) With play_sound_unit you can play a sound for the unit and its action by bypassing the unit - struct and the action the unit does ( I defined some magics which made it easier to use: SOUND_UNIT_ACTIVATE, SOUND_UNIT_MOVE, SOUND_UNIT_ATTACK, SOUND_UNIT_SPECIAL, SOUND_UNIT_DESTROYED). So for example, the routine where a unit moves must be: /* ... */ play_sound_unit ( punit, SOUND_UNIT_MOVE); /* ... */ TODO: Implement this to the right place, I wasn't sure where I should put it because I did miss a clear move_unit() function in freeciv... The same is done with the special events, I defined 37 unique events (taken from the freeciv.org page). Please add it this way: /* ... */ play_sound_event ( SOUND_DIPLOMATED); /* ... */ TODO: Implement this to the right place. There is a huge problem with freeciv: It is too fast. In the original civilisation games from Sid Meier you had for every single event a popup window which was displayed one after the other. In freeciv you have only one popup window with all events. How you can imagine that's not good for sound... What sounds are played is declared in sound.h in a const struct, please search for the right sounds you want to have played. I weren't able to find some cool which would fit. Later I will change the code to add an option to parse it from a config file like the tile sets... Please edit the configure file to include sound.c. It must be compiled like control.c so it just some copy & paste to do. Have thanks... The whole thing only depends on "play", but maybe I will write a routine for output via ALSA or OSS. CU, David PS: Please comment what I did!!! And by the way, change the wave files which I included in sound.h... -- Wenn Microsoft Autos bauen würde ... könnten nicht mehrere Personen gleichzeitig in einem Auto befördert werden, es sei denn, man würde "Auto NT" kaufen. Aber dann müßten mehrere Sitze gegen Aufpreis erworben werden.
sound.h
sound.c
|