[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth src/unit_display.cpp po/wesnoth/fr.po
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth src/unit_display.cpp po/wesnoth/fr.po |
Date: |
Sun, 31 Oct 2004 14:25:41 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 04/10/31 19:20:07
Modified files:
src : unit_display.cpp
Log message:
Can a multiplication by zero (i/nsteps) be anything else than a bug?
Also remove the casts than unnecessarily clutter the code.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_display.cpp.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
Modified files:
po/wesnoth : fr.po
Log message:
Fixed an unproperly-escaped quote in the French translation
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/po/wesnoth/fr.po.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
Patches:
Index: wesnoth/src/unit_display.cpp
diff -u wesnoth/src/unit_display.cpp:1.37 wesnoth/src/unit_display.cpp:1.38
--- wesnoth/src/unit_display.cpp:1.37 Sun Sep 19 16:22:21 2004
+++ wesnoth/src/unit_display.cpp Sun Sep 26 08:20:00 2004
@@ -71,14 +71,45 @@
int skips = 0;
+ const int acceleration = disp.turbo() ? 5:1;
+
+ gamemap::location src_adjacent[6];
+ get_adjacent_tiles(a, src_adjacent);
+
const std::string& halo = u.type().image_halo();
util::scoped_resource<int,halo::remover> halo_effect(0);
if(halo.empty() == false && !disp.fogged(b.x,b.y)) {
halo_effect.assign(halo::add(0,0,halo));
}
-
- gamemap::location src_adjacent[6];
- get_adjacent_tiles(a, src_adjacent);
+
+ const unit_animation *teleport_animation_p =
u.type().teleport_animation();
+ if (teleport_animation_p && !tiles_adjacent(a, b) && !disp.fogged(a.x,
a.y)) { // teleport
+ unit_animation teleport_animation = *teleport_animation_p;
+ int animation_time;
+ const int begin_at =
teleport_animation.get_first_frame_time(unit_animation::UNIT_FRAME);
+ teleport_animation.start_animation(begin_at,
unit_animation::UNIT_FRAME, acceleration);
+ animation_time = teleport_animation.get_animation_time();
+ adjust_map_position(disp, xsrc, ysrc, disp.hex_size(),
disp.hex_size());
+ while(animation_time < 0) {
+ const std::string* unit_image =
&teleport_animation.get_current_frame(unit_animation::UNIT_FRAME).image;
+ if (unit_image->empty()) {
+ unit_image = &u.type().image();
+ }
+ surface image(image::get_image(*unit_image));
+ if (!face_left) {
+ image.assign(image::reverse_image(image));
+ }
+ disp.draw_tile(a.x,a.y);
+ for(int tile = 0; tile != 6; ++tile) {
+ disp.draw_tile(src_adjacent[tile].x,
src_adjacent[tile].y);
+ }
+ disp.draw_unit(xsrc,ysrc,image,false, 1.0, 0, 0.0,
src_submerge);
+ disp.update_display();
+ events::pump();
+ teleport_animation.update_current_frames();
+ animation_time =
teleport_animation.get_animation_time();
+ }
+ }
for(int i = 0; i < nsteps; ++i) {
events::pump();
@@ -113,6 +144,10 @@
//invalidate the source tile and all adjacent tiles,
//since the unit can partially overlap adjacent tiles
+ /* FIXME: This code is wrong for short-range teleportation
since the teleported unit is not
+ * near its source location; consequently the unit leaves a
ghost trace behind it. It does
+ * not happen for long-range teleportation since the scrolling
has the nice side effect of
+ * cleaning up the display. -- silene */
disp.draw_tile(a.x,a.y);
for(int tile = 0; tile != 6; ++tile) {
disp.draw_tile(src_adjacent[tile].x,
src_adjacent[tile].y);
@@ -146,6 +181,37 @@
++skips;
}
}
+
+ gamemap::location dst_adjacent[6];
+ get_adjacent_tiles(b, dst_adjacent);
+
+ if (teleport_animation_p && !tiles_adjacent(a, b) && !disp.fogged(b.x,
b.y)) { // teleport
+ unit_animation teleport_animation = *teleport_animation_p;
+ int animation_time;
+ const int end_at = teleport_animation.get_last_frame_time();
+ teleport_animation.start_animation(0,
unit_animation::UNIT_FRAME, acceleration);
+ animation_time = teleport_animation.get_animation_time();
+ adjust_map_position(disp, xdst, ydst, disp.hex_size(),
disp.hex_size());
+ while(animation_time < end_at) {
+ const std::string* unit_image =
&teleport_animation.get_current_frame(unit_animation::UNIT_FRAME).image;
+ if (unit_image->empty()) {
+ unit_image = &u.type().image();
+ }
+ surface image(image::get_image(*unit_image));
+ if (!face_left) {
+ image.assign(image::reverse_image(image));
+ }
+ disp.draw_tile(b.x,b.y);
+ for(int tile = 0; tile != 6; ++tile) {
+
disp.draw_tile(dst_adjacent[tile].x,dst_adjacent[tile].y);
+ }
+ disp.draw_unit(xdst, ydst, image, false, 1.0, 0, 0.0,
dst_submerge);
+ disp.update_display();
+ events::pump();
+ teleport_animation.update_current_frames();
+ animation_time =
teleport_animation.get_animation_time();
+ }
+ }
}
}
Index: wesnoth/po/wesnoth/fr.po
diff -u wesnoth/po/wesnoth/fr.po:1.28 wesnoth/po/wesnoth/fr.po:1.29
--- wesnoth/po/wesnoth/fr.po:1.28 Sun Oct 31 14:57:20 2004
+++ wesnoth/po/wesnoth/fr.po Sun Oct 31 19:20:07 2004
@@ -11,7 +11,7 @@
"Project-Id-Version: Battle for Wesnoth\n"
"Report-Msgid-Bugs-To: http://bugs.wesnoth.org/\n"
"POT-Creation-Date: 2004-10-31 02:21+0200\n"
-"PO-Revision-Date: 2004-10-31 10:59+0100\n"
+"PO-Revision-Date: 2004-10-31 21:21+0100\n"
"Last-Translator: Wesnoth French Translation Team <address@hidden>\n"
"Language-Team: Language fr\n"
"MIME-Version: 1.0\n"
@@ -349,7 +349,7 @@
"trouve.\n"
"Il y a deux exceptions à cette règle : <ref>dst=magical_attacks text='les "
"attaques enchantées'</ref> et le <ref>dst=ability_marksman text='tireur "
-"d'élite'</ref>. Les attaques magiques ont toujours une probabilité de "
+"d\\'élite'</ref>. Les attaques magiques ont toujours une probabilité de "
"toucher de 70%, sans tenir compte du terrain, et les tireurs d'élite ont "
"toujours au moins 60% de probabilité de toucher lorsque ce son eux qui "
"attaquent, sans tenir compte du terrain.\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth src/unit_display.cpp po/wesnoth/fr.po,
Philippe Plantier <=