Cache canvas in draw_keys_state
This commit is contained in:
parent
4b1c0f4198
commit
1ebfb6c6e5
|
@ -634,18 +634,18 @@ class draw_keys_state
|
|||
{
|
||||
const player_flags player_key_flags;
|
||||
const local_multires_gauge_graphic multires_gauge_graphic;
|
||||
grs_canvas &canvas;
|
||||
public:
|
||||
draw_keys_state(const player_flags f, const local_multires_gauge_graphic g) :
|
||||
player_key_flags(f), multires_gauge_graphic(g)
|
||||
player_key_flags(f), multires_gauge_graphic(g), canvas((gr_set_current_canvas(nullptr), *grd_curcanv))
|
||||
{
|
||||
gr_set_current_canvas(nullptr);
|
||||
}
|
||||
void draw_all_cockpit_keys();
|
||||
void draw_all_statusbar_keys();
|
||||
protected:
|
||||
void draw_one_key(const unsigned x, const unsigned y, const unsigned gauge, const PLAYER_FLAG flag) const
|
||||
{
|
||||
hud_gauge_bitblt(*grd_curcanv, x, y, (player_key_flags & flag) ? gauge : (gauge + 3), multires_gauge_graphic);
|
||||
hud_gauge_bitblt(canvas, x, y, (player_key_flags & flag) ? gauge : (gauge + 3), multires_gauge_graphic);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue