added in 'flags' to show which side each unit is on
This commit is contained in:
parent
7b17a6ddf3
commit
3be36fd874
7 changed files with 14 additions and 0 deletions
BIN
images/side1.png
Normal file
BIN
images/side1.png
Normal file
Binary file not shown.
BIN
images/side2.png
Normal file
BIN
images/side2.png
Normal file
Binary file not shown.
BIN
images/side3.png
Normal file
BIN
images/side3.png
Normal file
Binary file not shown.
BIN
images/side4.png
Normal file
BIN
images/side4.png
Normal file
Binary file not shown.
BIN
images/side5.png
Normal file
BIN
images/side5.png
Normal file
Binary file not shown.
BIN
images/side6.png
Normal file
BIN
images/side6.png
Normal file
Binary file not shown.
|
@ -846,6 +846,15 @@ gamemap::TERRAIN display::get_terrain_on(int palx, int paly, int x, int y)
|
||||||
return terrains[index];
|
return terrains[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
SDL_Surface* get_side_image(display& disp, int side)
|
||||||
|
{
|
||||||
|
std::stringstream str;
|
||||||
|
str << "side" << side << ".png";
|
||||||
|
return disp.getImage(str.str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void display::draw_tile(int x, int y, SDL_Surface* unit_image,
|
void display::draw_tile(int x, int y, SDL_Surface* unit_image,
|
||||||
double highlight_ratio, Pixel blend_with)
|
double highlight_ratio, Pixel blend_with)
|
||||||
|
|
||||||
|
@ -1187,6 +1196,11 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image,
|
||||||
highlight_ratio,blend_with);
|
highlight_ratio,blend_with);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_Surface* const flag = get_side_image(*this,it->second.side());
|
||||||
|
if(flag != NULL) {
|
||||||
|
draw_unit(xpos-xsrc,ypos-ysrc,flag,true,false);
|
||||||
|
}
|
||||||
|
|
||||||
const bool energy_uses_alpha = highlight_ratio < 1.0 && blend_with == 0;
|
const bool energy_uses_alpha = highlight_ratio < 1.0 && blend_with == 0;
|
||||||
|
|
||||||
surface_lock dstlock(dst);
|
surface_lock dstlock(dst);
|
||||||
|
|
Loading…
Add table
Reference in a new issue