void AlliesWhiteboard::DrawLine(int x1, int y1, int x2, int y2, char C, char *VidBuf, int Pitch) { switch(C) { case 0: C = (char)227; break; case 1: C = (char)212; break; case 2: C = (char)80; break; case 3: C = (char)235; break; case 4: C = (char)108; break; case 5: C = (char)219; break; case 6: C = (char)208; break; case 7: C = (char)93; break; case 8: C = (char)130; break; case 9: C = (char)67; break; } x1 = x1 - *MapX; y1 = y1 - *MapY; x2 = x2 - *MapX; y2 = y2 - *MapY; if(Clip_Line(x1, y1, x2, y2)) Draw_Line(x1, y1, x2, y2, C, (UCHAR*)VidBuf, Pitch); //Line(x1-*MapX, y1-*MapY, x2-*MapX, y2-*MapY, C, VidBuf, Pitch); }
int Draw_Clip_Line(int x0,int y0, int x1, int y1,UCHAR color, UCHAR *dest_buffer, int lpitch) { // this helper function draws a clipped line int cxs, cys, cxe, cye; // clip and draw each line cxs = x0; cys = y0; cxe = x1; cye = y1; // clip the line if (Clip_Line(cxs,cys,cxe,cye)) Draw_Line(cxs, cys, cxe,cye,color,dest_buffer,lpitch); // return success return(1); } // end Draw_Clip_Line
void AlliesWhiteboard::DrawFreeLine(int x1, int y1, int x2, int y2, char C, char *VidBuf, int Pitch) { if(Clip_Line(x1, y1, x2, y2)) Draw_Line(x1, y1, x2, y2, C, (UCHAR*)VidBuf, Pitch); }