mail[Wesnoth-commits] r20545 - /trunk/src/unit_display.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on September 18, 2007 - 17:34:
Author: esr
Date: Tue Sep 18 17:33:58 2007
New Revision: 20545

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20545&view=rev
Log:
Attempt to demysify the offset calculation in animations.

Modified:
    trunk/src/unit_display.cpp

Modified: trunk/src/unit_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_display.cpp?rev=20545&r1=20544&r2=20545&view=diff
==============================================================================
--- trunk/src/unit_display.cpp (original)
+++ trunk/src/unit_display.cpp Tue Sep 18 17:33:58 2007
@@ -477,11 +477,17 @@
             ){
 
                double pos = 0.0;
+
                if(animation_time < 
attacker.get_animation()->get_begin_time()) {
+                       // attack animation has not yet started:
+                       // can happen if defenders's or leader's
+                       // animation has started but attacker's has not.
                        pos = 0.0;
                } else if( animation_time > 0 && end_time > 0) {
+                       // after impact, attacker slides backward
                        pos = 1.0-double(animation_time)/double(end_time);
                } else {
+                       // before impact, attacker slides forward
                        pos = 1.0 - 
double(animation_time)/double(minimum<int>(attacker.get_animation()->get_begin_time(),-150));
                }
                if(pos > 0.0) {




Related Messages


Powered by MHonArc, Updated Tue Sep 18 18:00:39 2007