Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: small GUI unification: decrease_unit_hp_smooth (PR#109
Home

[Freeciv-Dev] Re: small GUI unification: decrease_unit_hp_smooth (PR#109

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: small GUI unification: decrease_unit_hp_smooth (PR#1099)
From: Jason Short <vze2zq63@xxxxxxxxxxx>
Date: Thu, 13 Dec 2001 11:22:55 -0500
Reply-to: jdorje@xxxxxxxxxxxx

Raimar Falke wrote:

On Fri, Dec 07, 2001 at 11:36:31AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:

This small unification cuts off part of decrease_unit_hp_smooth (a gui-specific function). It creates a new function, decrease_unit_hp, that takes care of the common case where do_combat_animation is turned off, and only calls decrease_unit_hp_smooth if combat animation is enable.

It also adds comments for all these functions - including the GUI stub function. I think having comments for the GUI stub functions is important, since most of the GUI's just seem to have cut-and-pasted these functions (thus having to write comments themselves or go without - usually the latter).

It's small, but not really related to anything else so here it is all alone.


Applied. I think that even more can be factored out. At least the
first do{}while loop looks very similar. And the second part can be
wrapped in a show_explosion_animation().

Hmmm. It looks like it could be (although it'd be a bit hairy), but do you think that would limit the functionality of different GUI's too much? A different GUI _might_ want to use a different system for combat animation altogether (although I can't imagine what it would be).

jason



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