Convert a few more things to use color_t
This commit is contained in:
parent
05479c4379
commit
44f8d2e539
6 changed files with 9 additions and 9 deletions
|
@ -1522,7 +1522,7 @@ void display::draw_text_in_hex(const map_location& loc,
|
|||
void display::render_image(int x, int y, const display::drawing_layer drawing_layer,
|
||||
const map_location& loc, surface image,
|
||||
bool hreverse, bool greyscale, fixed_t alpha,
|
||||
Uint32 blendto, double blend_ratio, double submerged, bool vreverse)
|
||||
color_t blendto, double blend_ratio, double submerged, bool vreverse)
|
||||
{
|
||||
if (image==nullptr)
|
||||
return;
|
||||
|
|
|
@ -873,7 +873,7 @@ public:
|
|||
void render_image(int x, int y, const display::drawing_layer drawing_layer,
|
||||
const map_location& loc, surface image,
|
||||
bool hreverse=false, bool greyscale=false,
|
||||
fixed_t alpha=ftofxp(1.0), Uint32 blendto=0,
|
||||
fixed_t alpha=ftofxp(1.0), color_t blendto = {0,0,0},
|
||||
double blend_ratio=0, double submerged=0.0,bool vreverse =false);
|
||||
|
||||
/**
|
||||
|
|
|
@ -506,7 +506,7 @@ int cs_modification::get_b() const
|
|||
|
||||
surface blend_modification::operator()(const surface& src) const
|
||||
{
|
||||
return blend_surface(src, a_, color_t(r_, g_, b_).to_argb_bytes());
|
||||
return blend_surface(src, a_, color_t(r_, g_, b_));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1861,7 +1861,7 @@ surface cut_surface(const surface &surf, SDL_Rect const &r)
|
|||
surface blend_surface(
|
||||
const surface &surf
|
||||
, const double amount
|
||||
, const Uint32 color
|
||||
, const color_t color
|
||||
, const bool optimize)
|
||||
{
|
||||
if(surf== nullptr) {
|
||||
|
@ -1881,9 +1881,9 @@ surface blend_surface(
|
|||
Uint32* end = beg + nsurf->w*surf->h;
|
||||
|
||||
Uint16 ratio = amount * 256;
|
||||
const Uint16 red = ratio * static_cast<Uint8>(color >> 16);
|
||||
const Uint16 green = ratio * static_cast<Uint8>(color >> 8);
|
||||
const Uint16 blue = ratio * static_cast<Uint8>(color);
|
||||
const Uint16 red = ratio * color.r;
|
||||
const Uint16 green = ratio * color.g;
|
||||
const Uint16 blue = ratio * color.b;
|
||||
ratio = 256 - ratio;
|
||||
|
||||
while(beg != end) {
|
||||
|
|
|
@ -340,7 +340,7 @@ surface cut_surface(const surface &surf, SDL_Rect const &r);
|
|||
surface blend_surface(
|
||||
const surface &surf
|
||||
, const double amount
|
||||
, const Uint32 color
|
||||
, const color_t color
|
||||
, const bool optimize = true);
|
||||
|
||||
/**
|
||||
|
|
|
@ -719,7 +719,7 @@ void unit_frame::redraw(const int frame_time,bool on_start_time,bool in_scope_of
|
|||
game_display::get_singleton()->render_image( my_x,my_y,
|
||||
static_cast<display::drawing_layer>(display::LAYER_UNIT_FIRST+current_data.drawing_layer),
|
||||
src, image, facing_west, false,
|
||||
ftofxp(current_data.highlight_ratio), current_data.blend_with,
|
||||
ftofxp(current_data.highlight_ratio), color_t::from_argb_bytes(current_data.blend_with),
|
||||
current_data.blend_ratio,current_data.submerge,!facing_north);
|
||||
}
|
||||
halo_id = halo::handle(); //halo::NO_HALO;
|
||||
|
|
Loading…
Add table
Reference in a new issue