diff --git a/common/3d/draw.cpp b/common/3d/draw.cpp index 8a02acf6e..900cc17a0 100644 --- a/common/3d/draw.cpp +++ b/common/3d/draw.cpp @@ -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 else { 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 @@ -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) { 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; @@ -73,7 +73,7 @@ void g3_draw_line(g3s_point &p0,g3s_point &p1, const uint8_t color,temporary_poi (static_cast((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); - 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 diff --git a/common/include/3d.h b/common/include/3d.h index 5ed3e50d9..bf8750a64 100644 --- a/common/include/3d.h +++ b/common/include/3d.h @@ -31,6 +31,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "dsx-ns.h" #include "maths.h" #include "vecmat.h" //the vector/matrix library +#include "fwd-gr.h" #include "compiler-array.h" @@ -263,7 +264,6 @@ static inline void g3_check_and_draw_tmap(const array &pointlis //draws a line. takes two points. 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,temporary_points_t &); //draw a bitmap object that is always facing you //returns 1 if off screen, 0 if drew @@ -302,6 +302,7 @@ public: } }; #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; typedef void (*tmap_drawer_type)(const grs_bitmap &bm,uint_fast32_t nv,const g3s_point *const *vertlist);