Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Sound patches please add to CVS
Home

[Freeciv-Dev] Re: Sound patches please add to CVS

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Weisgerber <tnt@xxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Sound patches please add to CVS
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Aug 2001 14:49:45 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Aug 15, 2001 at 01:00:18PM -0400, David Weisgerber wrote:
> 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...

You will probably play it when the move animation is shown:
client/*/mapview.c:move_unit_map_canvas.

> 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...

You have to think about this. One solution is the play sounds only if
the action takes place at the currently viewed section of the map and
omitt the sound at the start of the turn.

> 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...

You have to supply the sounds IMHO.

> 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...

Please change Makefile.am and send the changes as a diff.

> 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...

Please change 
 /* Sound Magics */
 #define SOUND_LOW_ON_FOUNDS 0
 #define SOUND_POLLUTION 1
to an enumeration.

        Raimar
-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Using only the operating-system that came with your computer is just
  like only playing the demo-disc that came with your CD-player."


[Prev in Thread] Current Thread [Next in Thread]