Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Diff: Improvement proposal
Home

[Freeciv-Dev] Re: Diff: Improvement proposal

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Weisgerber <tnt@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, Bart Geverts <bart@xxxxxxxxxxxxxxxxxxxxxxxx>, bomek@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Diff: Improvement proposal
From: Francois Taiani <francois.taiani@xxxxxxxx>
Date: Sat, 18 Aug 2001 23:03:01 +0200

Compliments to David for the sound patch: That's great (Mal auf Deutsch:
Einfach klasse.) I've just applied it against the last standard release
(1.12.0) and it works fine, and adds a lot of fun to the client. For the
records, I'm playing under gnome, and I use 'esdplay' instead of 'play'
as sound output command. (Next Mission: Get sounds for the remaining
events: What about braying caravans ? :-)

I have a small improvement proposal: In your implementation, you play a
sound after a unit has moved. This is not observable when units move
fast, but if you raise the "Smooth unit move steps" in your client's
local options, it has the strange impact, that the sound comes after the
unit has moved :( By playing the sound before, you get the unit moving,
*while* the sound is playing, which with a reasonable move step (12
works good on my old 166Mz Pentium) looks much more realistic.

Though, fixing that seemed quite easy: Here is my proposal (in
packhand.c:handle_unit_info(..) ).

--CUT-HERE--------

--- packhand.c.old      Sat Aug 18 22:12:58 2001
+++ packhand.c  Sat Aug 18 22:17:21 2001
@@ -812,14 +812,18 @@
       struct city *pcity;
       pcity=map_get_city(punit->x, punit->y);
 
+      /* Wether the tile is known or not, we play a sound in any case.
+        Launching the sound before the move allows the sound to be
+        played *during* the move */
+
+      play_sound_unit(punit, SOUND_UNIT_MOVE);
+      
       if(tile_is_known(packet->x, packet->y) == TILE_KNOWN) {
        do_move_unit(punit, packet);
-        play_sound_unit(punit, SOUND_UNIT_MOVE);
        update_unit_focus();
       }
       else {
        do_move_unit(punit, packet); /* nice to see where a unit is going */
-        play_sound_unit(punit, SOUND_UNIT_MOVE);
        client_remove_unit(punit->id);
        refresh_tile_mapcanvas(packet->x, packet->y, 1);
         return;

--CUT-HERE--------

BTW, I observe some trembling of moving units when I raise the "Smooth
unit move steps" in the client local options. I guess that's because not
double buffering is made. This would be nice to have.

Francois

P.S.: David, it seems you add swapped the old and new versions in the
diff you sent. That's not big trouble, but apparently you have to put
the old file / directory first, and the new one afterward (vgl. diff -r
-u packhand.c.old packhand.c).


David Weisgerber wrote:
> 
> I hope this code works for you, I am not using diff this often. But I kept 
> on the rules from freeciv-hackers...
> 
> Note: you have to automake the whole thing once more due to makefile.am was
> changed.
> 
> When adding to CVS please copy the soundspec file and the soundfiles to 
> /data so the users have them when they want to fetch the CVS.
> 
> Thanks a lot,
> David
> 
> PS: Included in the file:
> sound.c && sound.h (wait... I don't need them right ?)
> a diff file
> a new soundspec - file, the old one had one little mistake
> --
> Um Ihren Pentium im Gameboy-Modus zu starten:
>   C:\> win<ENTER>
> 
>   ------------------------------------------------------------------------
>                                  Name: freeciv-sound-fix-1.tar.gz
>    freeciv-sound-fix-1.tar.gz    Type: Unix Tape Archive (application/x-tar)
>                              Encoding: base64


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