Remove cv_color
It is only ever set to 0 or copied from other canvases. Set it to zero everywhere.
This commit is contained in:
parent
f4e1ebb576
commit
08de1bbff0
|
@ -52,7 +52,6 @@ grs_subcanvas_ptr gr_create_sub_canvas(grs_canvas &canv, uint16_t x, uint16_t y,
|
|||
|
||||
void gr_init_canvas(grs_canvas &canv, unsigned char * pixdata, uint8_t pixtype, uint16_t w, uint16_t h)
|
||||
{
|
||||
canv.cv_color = 0;
|
||||
canv.cv_fade_level = GR_FADE_OFF;
|
||||
canv.cv_font = NULL;
|
||||
canv.cv_font_fg_color = 0;
|
||||
|
@ -63,7 +62,6 @@ void gr_init_canvas(grs_canvas &canv, unsigned char * pixdata, uint8_t pixtype,
|
|||
|
||||
void gr_init_sub_canvas(grs_canvas &n, grs_canvas &src, uint16_t x, uint16_t y, uint16_t w, uint16_t h)
|
||||
{
|
||||
n.cv_color = src.cv_color;
|
||||
n.cv_fade_level = src.cv_fade_level;
|
||||
n.cv_font = src.cv_font;
|
||||
n.cv_font_fg_color = src.cv_font_fg_color;
|
||||
|
|
|
@ -101,7 +101,6 @@ struct grs_canvas : prohibit_void_ptr<grs_canvas>
|
|||
{
|
||||
grs_bitmap cv_bitmap; // the bitmap for this canvas
|
||||
const grs_font * cv_font; // the currently selected font
|
||||
uint8_t cv_color; // current color
|
||||
short cv_font_fg_color; // current font foreground color (-1==Invisible)
|
||||
short cv_font_bg_color; // current font background color (-1==Invisible)
|
||||
int cv_fade_level; // transparency level
|
||||
|
|
|
@ -63,7 +63,7 @@ void ui_draw_button(UI_DIALOG *dlg, UI_GADGET_BUTTON * button)
|
|||
{
|
||||
ui_button_any_drawn = 1;
|
||||
gr_set_current_canvas( button->canvas );
|
||||
color_t color = button->canvas->cv_color;
|
||||
color_t color = 0;
|
||||
|
||||
if (dlg->keyboard_focus_gadget == button)
|
||||
gr_set_fontcolor( CRED, -1 );
|
||||
|
@ -95,7 +95,6 @@ void ui_draw_button(UI_DIALOG *dlg, UI_GADGET_BUTTON * button)
|
|||
gr_rect( 2, 2, button->width, button->height, color);
|
||||
}
|
||||
}
|
||||
button->canvas->cv_color = color;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -780,7 +780,6 @@ int gr_init()
|
|||
grd_curscreen->sc_canvas.cv_bitmap.bm_data = NULL;
|
||||
|
||||
// Set the mode.
|
||||
grd_curscreen->sc_canvas.cv_color = 0;
|
||||
grd_curscreen->sc_canvas.cv_fade_level = GR_FADE_OFF;
|
||||
grd_curscreen->sc_canvas.cv_font = NULL;
|
||||
grd_curscreen->sc_canvas.cv_font_fg_color = 0;
|
||||
|
|
|
@ -189,7 +189,6 @@ int gr_init()
|
|||
sdl_video_flags|=SDL_ASYNCBLIT;
|
||||
|
||||
// Set the mode.
|
||||
grd_curscreen->sc_canvas.cv_color = 0;
|
||||
grd_curscreen->sc_canvas.cv_fade_level = GR_FADE_OFF;
|
||||
grd_curscreen->sc_canvas.cv_font = NULL;
|
||||
grd_curscreen->sc_canvas.cv_font_fg_color = 0;
|
||||
|
|
|
@ -238,7 +238,7 @@ void init_cockpit()
|
|||
const unsigned x = 0;
|
||||
const unsigned y = (gsm_height - h) / 2;
|
||||
|
||||
const auto color = grd_curcanv->cv_color;
|
||||
const uint8_t color = 0;
|
||||
gr_rect(x, 0, w, gsm_height - h, color);
|
||||
gr_rect(x, gsm_height - h, w, gsm_height, color);
|
||||
|
||||
|
|
|
@ -1981,7 +1981,7 @@ static void draw_player_ship(int cloak_state,int x, int y, const local_multires_
|
|||
auto &bm = GameBitmaps[GET_GAUGE_INDEX(GAUGE_SHIPS+color)];
|
||||
hud_bitblt( HUD_SCALE_X(x), HUD_SCALE_Y(y), bm, multires_gauge_graphic);
|
||||
gr_settransblend(cloak_fade_value, GR_BLEND_NORMAL);
|
||||
gr_rect(HUD_SCALE_X(x - 3), HUD_SCALE_Y(y - 3), HUD_SCALE_X(x + bm.bm_w + 3), HUD_SCALE_Y(y + bm.bm_h + 3), grd_curcanv->cv_color);
|
||||
gr_rect(HUD_SCALE_X(x - 3), HUD_SCALE_Y(y - 3), HUD_SCALE_X(x + bm.bm_w + 3), HUD_SCALE_Y(y + bm.bm_h + 3), 0);
|
||||
gr_settransblend(GR_FADE_OFF, GR_BLEND_NORMAL);
|
||||
gr_set_current_canvas( NULL );
|
||||
|
||||
|
@ -2251,7 +2251,7 @@ static void draw_weapon_box(int weapon_type,int weapon_num)
|
|||
int boxofs = (PlayerCfg.CockpitMode[1]==CM_STATUS_BAR)?SB_PRIMARY_BOX:COCKPIT_PRIMARY_BOX;
|
||||
|
||||
gr_settransblend(fade_value, GR_BLEND_NORMAL);
|
||||
gr_rect(HUD_SCALE_X(gauge_boxes[boxofs+weapon_type].left),HUD_SCALE_Y(gauge_boxes[boxofs+weapon_type].top),HUD_SCALE_X(gauge_boxes[boxofs+weapon_type].right),HUD_SCALE_Y(gauge_boxes[boxofs+weapon_type].bot), grd_curcanv->cv_color);
|
||||
gr_rect(HUD_SCALE_X(gauge_boxes[boxofs+weapon_type].left),HUD_SCALE_Y(gauge_boxes[boxofs+weapon_type].top),HUD_SCALE_X(gauge_boxes[boxofs+weapon_type].right),HUD_SCALE_Y(gauge_boxes[boxofs+weapon_type].bot), 0);
|
||||
|
||||
gr_settransblend(GR_FADE_OFF, GR_BLEND_NORMAL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue