Pass color to gr_line
This commit is contained in:
parent
3c73d44771
commit
36bd39babe
|
@ -287,7 +287,7 @@ void gr_uline(fix _a1, fix _b1, fix _a2, fix _b2, const uint8_t color)
|
|||
// Returns 0 if drawn with no clipping, 1 if drawn but clipped, and
|
||||
// 2 if not drawn at all.
|
||||
|
||||
void gr_line(fix a1, fix b1, fix a2, fix b2)
|
||||
void gr_line(fix a1, fix b1, fix a2, fix b2, const uint8_t color)
|
||||
{
|
||||
int x1, y1, x2, y2;
|
||||
x1 = i2f(MINX);
|
||||
|
@ -296,8 +296,6 @@ void gr_line(fix a1, fix b1, fix a2, fix b2)
|
|||
y2 = i2f(MAXY);
|
||||
|
||||
CLIPLINE(a1,b1,a2,b2,x1,y1,x2,y2,return,, FIXSCALE );
|
||||
|
||||
const auto color = COLOR;
|
||||
gr_uline(a1, b1, a2, b2, color);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ namespace dcx {
|
|||
tmap_drawer_type tmap_drawer_ptr = draw_tmap;
|
||||
#ifndef OGL
|
||||
static const flat_drawer_type flat_drawer_ptr = gr_upoly_tmap;
|
||||
static const line_drawer_type line_drawer_ptr = gr_line;
|
||||
#endif
|
||||
|
||||
//specifies 2d drawing routines to use instead of defaults. Passing
|
||||
|
@ -77,7 +76,8 @@ void g3_draw_line(g3s_point &p0,g3s_point &p1,temporary_points_t &tp)
|
|||
(static_cast<void>((p1.p3_flags & PF_PROJECTED) || (g3_project_point(p1), 0)), p1.p3_flags & PF_OVERFLOW)
|
||||
)
|
||||
return must_clip_line(&p0,&p1,codes_or,tp);
|
||||
(*line_drawer_ptr)(p0.p3_sx,p0.p3_sy,p1.p3_sx,p1.p3_sy);
|
||||
const auto color = grd_curcanv->cv_color;
|
||||
gr_line(p0.p3_sx, p0.p3_sy, p1.p3_sx, p1.p3_sy, color);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -311,7 +311,6 @@ constexpr std::size_t MAX_POINTS_IN_POLY = 100;
|
|||
|
||||
typedef void (*tmap_drawer_type)(const grs_bitmap &bm,uint_fast32_t nv,const g3s_point *const *vertlist);
|
||||
typedef void (*flat_drawer_type)(uint_fast32_t nv,const array<fix, MAX_POINTS_IN_POLY*2> &vertlist);
|
||||
typedef void (*line_drawer_type)(fix x0,fix y0,fix x1,fix y1);
|
||||
|
||||
// This is the gr_upoly-like interface to the texture mapper which uses texture-mapper compatible
|
||||
// (ie, avoids cracking) edge/delta computation.
|
||||
|
|
|
@ -200,7 +200,7 @@ unsigned char gr_gpixel(const grs_bitmap &bitmap, int x, int y);
|
|||
unsigned char gr_ugpixel(const grs_bitmap &bitmap, int x, int y);
|
||||
|
||||
// Draws a line into the current canvas in the current color and drawmode.
|
||||
void gr_line(fix x0,fix y0,fix x1,fix y1);
|
||||
void gr_line(fix x0,fix y0,fix x1,fix y1, uint8_t color);
|
||||
void gr_uline(fix x0,fix y0,fix x1,fix y1, uint8_t color);
|
||||
|
||||
// Draw the bitmap into the current canvas at the specified location.
|
||||
|
|
|
@ -122,15 +122,10 @@ void plot_parametric(vms_equation *coeffs, fix min_t, fix max_t, fix del_t) {
|
|||
coord = evaluate_curve(coeffs, 3, t);
|
||||
dcoord = evaluate_curve(coeffs, 3, dt);
|
||||
|
||||
gr_setcolor(9);
|
||||
gr_line ( 75*F1_0 + coord.x, 290*F1_0 - coord.z, 75*F1_0 + dcoord.x, 290*F1_0 - dcoord.z );
|
||||
gr_setcolor(10);
|
||||
gr_line ( 75*F1_0 + coord.x, 560*F1_0 - coord.y, 75*F1_0 + dcoord.x, 560*F1_0 - dcoord.y );
|
||||
gr_setcolor(12);
|
||||
gr_line ( 475*F1_0 + coord.z, 560*F1_0 - coord.y, 475*F1_0 + dcoord.z, 560*F1_0 - dcoord.y );
|
||||
|
||||
gr_line ( 75*F1_0 + coord.x, 290*F1_0 - coord.z, 75*F1_0 + dcoord.x, 290*F1_0 - dcoord.z, 9);
|
||||
gr_line ( 75*F1_0 + coord.x, 560*F1_0 - coord.y, 75*F1_0 + dcoord.x, 560*F1_0 - dcoord.y, 10);
|
||||
gr_line (475*F1_0 + coord.z, 560*F1_0 - coord.y, 475*F1_0 + dcoord.z, 560*F1_0 - dcoord.y, 12);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static vms_vector p1, p4, r1, r4;
|
||||
|
|
|
@ -2959,7 +2959,6 @@ void show_HUD_names()
|
|||
w = dx/4;
|
||||
h = dy/4;
|
||||
|
||||
{
|
||||
struct {
|
||||
int r, g, b;
|
||||
} c{};
|
||||
|
@ -2979,17 +2978,17 @@ void show_HUD_names()
|
|||
auto &color = player_rgb[get_player_color(pnum)];
|
||||
c = {color.r, color.g, color.b};
|
||||
}
|
||||
gr_setcolor(BM_XRGB(c.r, c.g, c.b));
|
||||
};
|
||||
const uint8_t color = BM_XRGB(c.r, c.g, c.b);
|
||||
gr_setcolor(color);
|
||||
|
||||
gr_line(x+dx-w,y-dy,x+dx,y-dy);
|
||||
gr_line(x+dx,y-dy,x+dx,y-dy+h);
|
||||
gr_line(x-dx,y-dy,x-dx+w,y-dy);
|
||||
gr_line(x-dx,y-dy,x-dx,y-dy+h);
|
||||
gr_line(x+dx-w,y+dy,x+dx,y+dy);
|
||||
gr_line(x+dx,y+dy,x+dx,y+dy-h);
|
||||
gr_line(x-dx,y+dy,x-dx+w,y+dy);
|
||||
gr_line(x-dx,y+dy,x-dx,y+dy-h);
|
||||
gr_line(x + dx - w, y - dy, x + dx, y - dy, color);
|
||||
gr_line(x + dx, y - dy, x + dx, y - dy + h, color);
|
||||
gr_line(x - dx, y - dy, x - dx + w, y - dy, color);
|
||||
gr_line(x - dx, y - dy, x - dx, y - dy + h, color);
|
||||
gr_line(x + dx - w, y + dy, x + dx, y + dy, color);
|
||||
gr_line(x + dx, y + dy, x + dx, y + dy - h, color);
|
||||
gr_line(x - dx, y + dy, x - dx + w, y + dy, color);
|
||||
gr_line(x - dx, y + dy, x - dx, y + dy - h, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -794,10 +794,11 @@ static void outline_seg_side(const vcsegptr_t seg,int _side,int edge,int vert)
|
|||
// gr_line(pnt->p3_sx-CROSS_WIDTH,pnt->p3_sy,pnt->p3_sx+CROSS_WIDTH,pnt->p3_sy);
|
||||
// gr_line(pnt->p3_sx,pnt->p3_sy-CROSS_HEIGHT,pnt->p3_sx,pnt->p3_sy+CROSS_HEIGHT);
|
||||
|
||||
gr_line(pnt->p3_sx-CROSS_WIDTH,pnt->p3_sy,pnt->p3_sx,pnt->p3_sy-CROSS_HEIGHT);
|
||||
gr_line(pnt->p3_sx,pnt->p3_sy-CROSS_HEIGHT,pnt->p3_sx+CROSS_WIDTH,pnt->p3_sy);
|
||||
gr_line(pnt->p3_sx+CROSS_WIDTH,pnt->p3_sy,pnt->p3_sx,pnt->p3_sy+CROSS_HEIGHT);
|
||||
gr_line(pnt->p3_sx,pnt->p3_sy+CROSS_HEIGHT,pnt->p3_sx-CROSS_WIDTH,pnt->p3_sy);
|
||||
const auto color = grd_curcanv->cv_color;
|
||||
gr_line(pnt->p3_sx - CROSS_WIDTH, pnt->p3_sy, pnt->p3_sx, pnt->p3_sy - CROSS_HEIGHT, color);
|
||||
gr_line(pnt->p3_sx, pnt->p3_sy - CROSS_HEIGHT, pnt->p3_sx + CROSS_WIDTH, pnt->p3_sy, color);
|
||||
gr_line(pnt->p3_sx + CROSS_WIDTH, pnt->p3_sy, pnt->p3_sx, pnt->p3_sy + CROSS_HEIGHT, color);
|
||||
gr_line(pnt->p3_sx, pnt->p3_sy + CROSS_HEIGHT, pnt->p3_sx - CROSS_WIDTH, pnt->p3_sy, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue