make image_diagonal also work with normal frames

This commit is contained in:
Jérémy Rosen 2008-03-20 22:27:04 +00:00
parent 3312efd0d6
commit 0b784256f4
3 changed files with 9 additions and 3 deletions

View file

@ -96,6 +96,7 @@ Version 1.5.0-svn:
process as well.
* new progressive parameter for animations : submerge
* new progressive parameter for animations : x and y
* image_diagonal now also works with normal [frame]
Version 1.4:
* language and i18n:

View file

@ -1726,9 +1726,14 @@ void unit::redraw_unit(game_display& disp, const gamemap::location& loc, const b
}
image::locator image_loc;
image::locator image_loc = image::locator();
#ifndef LOW_MEM
image_loc = params.image;
if(facing_ != gamemap::location::NORTH && facing_ != gamemap::location::SOUTH) {
image_loc = params.image_diagonal;
}
if(image_loc.is_void()|| image_loc.get_filename() == "") { // invalid diag image, or not diagonal
image_loc = params.image;
}
if(image_loc.is_void()) {
image_loc = absolute_image();
}

View file

@ -343,7 +343,7 @@ void unit_frame::redraw(const int frame_time,bool first_time,const gamemap::loca
if(direction != gamemap::location::NORTH && direction != gamemap::location::SOUTH) {
image_loc = current_data.image_diagonal;
}
if(image_loc.is_void()) { // invalid diag image, or not diagonal
if(image_loc.is_void() || image_loc.get_filename() == "") { // invalid diag image, or not diagonal
image_loc = current_data.image;
}