enable TC on all unit related images
This commit is contained in:
parent
dd1715749c
commit
21c78aaba8
4 changed files with 23 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
|||
1.7.12+svn:
|
||||
* Engine:
|
||||
* Fix bug #15146: made kill event with animate="yes" recheck the presence of unit before animating, fixing the assertion failure (in case the unit is removed by other wml events like last breath)
|
||||
* All unit-related images are team colored, this includes missiles and haloes
|
||||
* Language and i18n:
|
||||
* Updated translations: Finnish, German, Russian, Serbian
|
||||
* The manual now does support translations of alternative texts for images
|
||||
|
|
13
src/unit.cpp
13
src/unit.cpp
|
@ -1741,7 +1741,11 @@ void unit::redraw_unit()
|
|||
params.blend_with = disp.rgb(0,255,0);
|
||||
params.blend_ratio = 0.25;
|
||||
}
|
||||
//hackish : see unit_frame::merge_parameters
|
||||
// we use image_mod on the primary image
|
||||
// and halo_mod on secondary images and all haloes
|
||||
params.image_mod = image_mods();
|
||||
params.halo_mod = TC_image_mods();
|
||||
params.image= absolute_image();
|
||||
|
||||
|
||||
|
@ -1766,7 +1770,7 @@ void unit::redraw_unit()
|
|||
|
||||
|
||||
if(unit_halo_ == halo::NO_HALO && !image_halo().empty()) {
|
||||
unit_halo_ = halo::add(0, 0, image_halo(), map_location(-1, -1));
|
||||
unit_halo_ = halo::add(0, 0, image_halo()+TC_image_mods(), map_location(-1, -1));
|
||||
}
|
||||
if(unit_halo_ != halo::NO_HALO && image_halo().empty()) {
|
||||
halo::remove(unit_halo_);
|
||||
|
@ -2812,11 +2816,16 @@ temporary_unit_mover::~temporary_unit_mover()
|
|||
}
|
||||
}
|
||||
|
||||
std::string unit::image_mods() const{
|
||||
std::string unit::TC_image_mods() const{
|
||||
std::stringstream modifier;
|
||||
if(flag_rgb_.size()){
|
||||
modifier << "~RC("<< flag_rgb_ << ">" << team::get_side_colour_index(side()) << ")";
|
||||
}
|
||||
return modifier.str();
|
||||
}
|
||||
std::string unit::image_mods() const{
|
||||
std::stringstream modifier;
|
||||
modifier << TC_image_mods();
|
||||
if(image_mods_.size()){
|
||||
modifier << "~" << image_mods_;
|
||||
}
|
||||
|
|
|
@ -319,6 +319,7 @@ public:
|
|||
**/
|
||||
unit& clone(bool is_temporary=true);
|
||||
|
||||
std::string TC_image_mods() const;
|
||||
std::string image_mods() const;
|
||||
|
||||
/**
|
||||
|
|
|
@ -625,9 +625,15 @@ const frame_parameters unit_frame::merge_parameters(int current_time,const frame
|
|||
result.image_diagonal = engine_val.image_diagonal;
|
||||
}
|
||||
|
||||
/** engine provides a string for "petrified" and "team color" modifications */
|
||||
/** engine provides a string for "petrified" and "team color" modifications
|
||||
note that image_mod is the complete modification and halo_mod is only the TC part
|
||||
see unit.cpp, we know that and use it*/
|
||||
result.image_mod = current_val.image_mod +animation_val.image_mod;
|
||||
if(primary) result.image_mod += engine_val.image_mod;
|
||||
if(primary) {
|
||||
result.image_mod += engine_val.image_mod;
|
||||
} else {
|
||||
result.image_mod += engine_val.halo_mod;
|
||||
}
|
||||
|
||||
assert(engine_val.halo.empty());
|
||||
result.halo = current_val.halo.empty()?animation_val.halo:current_val.halo;
|
||||
|
@ -639,9 +645,8 @@ const frame_parameters unit_frame::merge_parameters(int current_time,const frame
|
|||
result.halo_y = current_val.halo_y?current_val.halo_y:animation_val.halo_y;
|
||||
result.halo_y += engine_val.halo_y;
|
||||
|
||||
/** engine provides hflip modifications */
|
||||
result.halo_mod = current_val.halo_mod +animation_val.halo_mod;
|
||||
if(primary) result.halo_mod += engine_val.halo_mod;
|
||||
result.halo_mod = current_val.halo_mod +animation_val.halo_mod;
|
||||
result.halo_mod += engine_val.halo_mod;
|
||||
|
||||
assert(engine_val.duration == 0);
|
||||
result.duration = current_val.duration;
|
||||
|
|
Loading…
Add table
Reference in a new issue