Pass canvas to Vline

This commit is contained in:
Kp 2017-02-11 21:42:35 +00:00
parent f9cb598b0f
commit cf1f5df3cc
4 changed files with 10 additions and 10 deletions

View file

@ -255,9 +255,9 @@ extern unsigned char CBLACK,CGREY,CWHITE,CBRIGHT,CRED;
extern UI_GADGET * selected_gadget;
#define Hline(C,x1,x2,y,c) Hline(C,x1,y,x2,c)
#define Vline(y1,y2,x,c) Vline(x,y1,y2,c)
#define Vline(C,y1,y2,x,c) Vline(C,x,y1,y2,c)
void Hline(grs_canvas &, fix x1, fix x2, fix y, uint8_t color);
void Vline(short y1, short y2, short x, uint8_t color);
void Vline(grs_canvas &, fix y1, fix y2, fix x, uint8_t color);
extern void ui_string_centered( short x, short y, const char * s );
extern void ui_draw_box_out( short x1, short y1, short x2, short y2 );
extern void ui_draw_box_in( short x1, short y1, short x2, short y2 );

View file

@ -64,8 +64,8 @@ void ui_draw_inputbox( UI_DIALOG *dlg, UI_GADGET_INPUTBOX * inputbox )
if (dlg->keyboard_focus_gadget == inputbox && !inputbox->first_time )
{
const uint8_t cred = CRED;
Vline(2,inputbox->height-3, 2+w+1, cred);
Vline(2,inputbox->height-3, 2+w+2, cred);
Vline(*grd_curcanv, 2, inputbox->height - 3, 3 + w, cred);
Vline(*grd_curcanv, 2, inputbox->height - 3, 4 + w, cred);
}
}
}

View file

@ -108,10 +108,10 @@ static void gr_draw_sunken_border( short x1, short y1, short x2, short y2 )
const uint8_t cgrey = CGREY;
const uint8_t cbright = CBRIGHT;
Hline(*grd_curcanv, x1 - 1, x2 + 1, y1 - 1, cgrey);
Vline( y1-1, y2+1, x1-1, cgrey);
Vline(*grd_curcanv, y1 - 1, y2 + 1, x1 - 1, cgrey);
Hline(*grd_curcanv, x1 - 1, x2 + 1, y2 + 1, cbright);
Vline( y1, y2+1, x2+1, cbright);
Vline(*grd_curcanv, y1, y2 + 1, x2 + 1, cbright);
}

View file

@ -30,9 +30,9 @@ void Hline(grs_canvas &canvas, const fix x1, const fix x2, const fix y, const ui
gr_uline(canvas, i2f(x1), i2f(y), i2f(x2), i2f(y), color);
}
void Vline(short y1, short y2, short x, const uint8_t color)
void Vline(grs_canvas &canvas, const fix y1, const fix y2, const fix x, const uint8_t color)
{
gr_uline(*grd_curcanv, i2f(x), i2f(y1), i2f(x), i2f(y2), color);
gr_uline(canvas, i2f(x), i2f(y1), i2f(x), i2f(y2), color);
}
void ui_string_centered( short x, short y, const char * s )
@ -50,10 +50,10 @@ void ui_string_centered( short x, short y, const char * s )
void ui_draw_shad( short x1, short y1, short x2, short y2, short c1, short c2 )
{
Hline(*grd_curcanv, x1 + 0, x2 - 1, y1 + 0, c1);
Vline(y1+1, y2+0, x1+0, c1);
Vline(*grd_curcanv, y1 + 1, y2 + 0, x1 + 0, c1);
Hline(*grd_curcanv, x1 + 1, x2, y2 - 0, c2);
Vline(y1+0, y2-1, x2-0, c2);
Vline(*grd_curcanv, y1 + 0, y2 - 1, x2 - 0, c2);
}
void ui_draw_frame( short x1, short y1, short x2, short y2 )