void gr_urect(int left,int top,int right,int bot) { int i; for ( i=top; i<=bot; i++ ) gr_uscanline( left, right, i ); }
void GrURect(int left,int top,int right,int bot) { int i; if (TYPE == BM_OGL) { OglURect(left,top,right,bot); return; } for ( i=top; i<=bot; i++ ) gr_uscanline( left, right, i ); }
int gr_udisk(fix xc1,fix yc1,fix r1) { int p,x, y, xc, yc, r; r = X2I(r1); xc = X2I(xc1); yc = X2I(yc1); p=3-(r*2); x=0; y=r; while(x<y) { // Draw the first octant gr_uscanline( xc-y, xc+y, yc-x ); gr_uscanline( xc-y, xc+y, yc+x ); if (p<0) p=p+(x<<2)+6; else { // Draw the second octant gr_uscanline( xc-x, xc+x, yc-y ); gr_uscanline( xc-x, xc+x, yc+y ); p=p+((x-y)<<2)+10; y--; } x++; } if(x==y) { gr_uscanline( xc-x, xc+x, yc-y ); gr_uscanline( xc-x, xc+x, yc+y ); } return 0; }
void gr_urect(int left,int top,int right,int bot) { #ifdef OGL if (TYPE == BM_OGL) { ogl_urect(left,top,right,bot); return; } #else int i; for ( i=top; i<=bot; i++ ) gr_uscanline( left, right, i ); #endif }
void gr_urect(int left,int top,int right,int bot) { int i; #ifdef OGL if (TYPE == BM_OGL) { ogl_urect(left,top,right,bot); return; } #endif #ifdef D1XD3D if (TYPE == BM_DIRECTX) { if (left <= right && top <= bot) Win32_Rect (left, top, right, bot, grd_curcanv->cv_bitmap.bm_data, COLOR); return; } #endif for ( i=top; i<=bot; i++ ) gr_uscanline( left, right, i ); }
void gr_upoly(int nverts, int *vert ) { int temp; int startx, stopx; // X coordinates of both ends of current edge. int firstx, firsty; // Saved copy of the first vertex to connect later. int dx_dy; // Slope of current edge. int miny, maxy; int starty, stopy; // Y coordinates of both ends of current edge. int x1, x2, i; // Find the min and max rows to clear out the minimun y_edge_list. // (Is it worth it?) maxy = vert[1]; miny = vert[1]; for (i=3; i<(nverts*2); i+=2 ) { if (vert[i]>maxy) maxy=vert[i]; if (vert[i]<miny) miny=vert[i]; } miny >>= 16; miny--; // -1 to be safe maxy >>= 16; maxy++; // +1 to be safe // Clear only the part of the y_edge_list that w will be using if (miny < 0) miny = 0; if (maxy > MAX_SCAN_LINES) maxy = MAX_SCAN_LINES; for (i=miny; i<maxy; i++ ) y_edge_list[i] = -1; // Save the first vertex so that we can connect to it at the end. firstx = vert[0]; firsty = vert[1] >> 16; do { nverts--; // Get the beginning coordinates of the current edge. startx = vert[0]; starty = vert[1] >> 16; // Get the ending coordinates of the current edge. if (nverts > 0 ) { stopx = vert[2]; stopy = vert[3] >> 16; vert += 2; } else { stopx = firstx; // Last edge, uses first vertex as endpoint stopy = firsty; } if (stopy < starty ) { temp = stopy; stopy = starty; starty = temp; temp = stopx; stopx = startx; startx = temp; } if (stopy == starty ) { // Draw a edge going horizontally across screen x1 = startx>>16; x2 = stopx>>16; if (x2 > x1 ) //gr_uscanline( x1, x2-1, stopy ); gr_uscanline( x1, x2, stopy ); else //gr_uscanline( x2, x1-1, stopy ); gr_uscanline( x2, x1, stopy ); } else {
void Hline(short x1, short x2, short y ) { gr_uscanline( x1, x2, y ); }