Author: alink
Date: Sun Apr 27 03:36:39 2008
New Revision: 26153
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26153&view=rev
Log:
Cut again the head of our leader, to reminds ours to solve this nicely.
This revert the temporary hack used for the 1.5.0 release, except the part
about unit fake, because it fixed a real bug : moving a unit behind another
placed on a keep, and he walks on his head (of course the keep-cut-head bug
make it hard to see it, but the rendering order was wrong)
Modified:
trunk/src/display.cpp
trunk/src/game_display.cpp
trunk/src/unit.cpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=26153&r1=26152&r2=26153&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sun Apr 27 03:36:39 2008
@@ -1017,8 +1017,7 @@
SDL_Rect srcrect = {0,0,surf->w,submerge_height};
// NOTE: There is also a LAYER_UNIT_FAKE, but don't work well
- // with the hack "foreground terrain in LAYER_UNIT_FIRST"
- // (e.g. fake unit moving behind a keep)
+ // when the fake unit move behind an other
drawing_buffer_add(LAYER_UNIT_FIRST, drawing_order, tblit(x, y, surf,
srcrect));
if(submerge_height != surf->h) {
Modified: trunk/src/game_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=26153&r1=26152&r2=26153&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Sun Apr 27 03:36:39 2008
@@ -382,9 +382,11 @@
}
if(!is_shrouded) {
- // FIXME: This is a hack, we draw terrain in
the unit layer
+ // NOTE: A possible hack is to draw terrain in
the unit layer
// but with a higher drawing_order, so it's
rendered on top of the unit
- drawing_buffer_add(LAYER_UNIT_FIRST,
drawing_order+100, tblit(xpos, ypos,
+ // drawing_buffer_add(LAYER_UNIT_FIRST,
drawing_order+100, tblit(xpos, ypos,
+ //
get_terrain_images(*it,tod.id,image_type,ADJACENT_FOREGROUND)));
+ drawing_buffer_add(LAYER_TERRAIN_FG,
drawing_order, tblit(xpos, ypos,
get_terrain_images(*it,tod.id,image_type,ADJACENT_FOREGROUND)));
}
Modified: trunk/src/unit.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=26153&r1=26152&r2=26153&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Sun Apr 27 03:36:39 2008
@@ -1771,10 +1771,11 @@
ellipse_front.assign(image::get_image(image::locator(buf),
image::SCALED_TO_ZOOM));
}
- // FIXME: This is a hack, we draw ellipses in the unit layer
+ // NOTE: A possible a hack is to draw ellipses in the unit layer
// but with a different drawing_order, so it's rendered behind/above
unit
+ // disp.drawing_buffer_add(display::LAYER_UNIT_FIRST, drawing_order-10,
if (ellipse_back != NULL) {
- disp.drawing_buffer_add(display::LAYER_UNIT_FIRST,
drawing_order-10,
+ disp.drawing_buffer_add(display::LAYER_UNIT_BG, drawing_order,
display::tblit(xsrc, ysrc
+adjusted_params.y-ellipse_floating, ellipse_back));
}
@@ -1786,7 +1787,7 @@
}
if (ellipse_front != NULL) {
- disp.drawing_buffer_add(display::LAYER_UNIT_FIRST,
drawing_order+10,
+ disp.drawing_buffer_add(display::LAYER_UNIT_FG, drawing_order,
display::tblit(xsrc, ysrc
+adjusted_params.y-ellipse_floating, ellipse_front));
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits