Pass canvas to g3_draw_line
This commit is contained in:
parent
d779a26307
commit
47a319bba5
|
@ -39,7 +39,7 @@ static void must_clip_line(g3s_point *p0,g3s_point *p1,ubyte codes_or,const uint
|
||||||
; //line has already been clipped, so give up
|
; //line has already been clipped, so give up
|
||||||
else {
|
else {
|
||||||
clip_line(p0,p1,codes_or,tp);
|
clip_line(p0,p1,codes_or,tp);
|
||||||
g3_draw_line(*p0, *p1, color, tp);
|
g3_draw_line(*grd_curcanv, *p0, *p1, color, tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//free temp points
|
//free temp points
|
||||||
|
@ -55,10 +55,10 @@ static void must_clip_line(g3s_point *p0,g3s_point *p1,ubyte codes_or,const uint
|
||||||
void g3_draw_line(g3s_point &p0, g3s_point &p1, const uint8_t color)
|
void g3_draw_line(g3s_point &p0, g3s_point &p1, const uint8_t color)
|
||||||
{
|
{
|
||||||
temporary_points_t tp;
|
temporary_points_t tp;
|
||||||
g3_draw_line(p0, p1, color, tp);
|
g3_draw_line(*grd_curcanv, p0, p1, color, tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void g3_draw_line(g3s_point &p0,g3s_point &p1, const uint8_t color,temporary_points_t &tp)
|
void g3_draw_line(grs_canvas &canvas, g3s_point &p0, g3s_point &p1, const uint8_t color, temporary_points_t &tp)
|
||||||
{
|
{
|
||||||
ubyte codes_or;
|
ubyte codes_or;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void g3_draw_line(g3s_point &p0,g3s_point &p1, const uint8_t color,temporary_poi
|
||||||
(static_cast<void>((p1.p3_flags & PF_PROJECTED) || (g3_project_point(p1), 0)), p1.p3_flags & PF_OVERFLOW)
|
(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,color,tp);
|
return must_clip_line(&p0,&p1,codes_or,color,tp);
|
||||||
gr_line(*grd_curcanv, p0.p3_sx, p0.p3_sy, p1.p3_sx, p1.p3_sy, color);
|
gr_line(canvas, p0.p3_sx, p0.p3_sy, p1.p3_sx, p1.p3_sy, color);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include "dsx-ns.h"
|
#include "dsx-ns.h"
|
||||||
#include "maths.h"
|
#include "maths.h"
|
||||||
#include "vecmat.h" //the vector/matrix library
|
#include "vecmat.h" //the vector/matrix library
|
||||||
|
#include "fwd-gr.h"
|
||||||
|
|
||||||
#include "compiler-array.h"
|
#include "compiler-array.h"
|
||||||
|
|
||||||
|
@ -263,7 +264,6 @@ static inline void g3_check_and_draw_tmap(const array<cg3s_point *, N> &pointlis
|
||||||
//draws a line. takes two points.
|
//draws a line. takes two points.
|
||||||
struct temporary_points_t;
|
struct temporary_points_t;
|
||||||
void g3_draw_line(cg3s_point &p0,cg3s_point &p1, uint8_t color);
|
void g3_draw_line(cg3s_point &p0,cg3s_point &p1, uint8_t color);
|
||||||
void g3_draw_line(cg3s_point &p0,cg3s_point &p1, uint8_t color,temporary_points_t &);
|
|
||||||
|
|
||||||
//draw a bitmap object that is always facing you
|
//draw a bitmap object that is always facing you
|
||||||
//returns 1 if off screen, 0 if drew
|
//returns 1 if off screen, 0 if drew
|
||||||
|
@ -302,6 +302,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
void g3_draw_line(grs_canvas &, cg3s_point &p0, cg3s_point &p1, uint8_t color, temporary_points_t &);
|
||||||
constexpr std::size_t MAX_POINTS_IN_POLY = 100;
|
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 (*tmap_drawer_type)(const grs_bitmap &bm,uint_fast32_t nv,const g3s_point *const *vertlist);
|
||||||
|
|
Loading…
Reference in a new issue