/** ** Draw character with current color clipped into 8 bit framebuffer. ** ** @param graphic Pointer to object ** @param gx X offset into object ** @param gy Y offset into object ** @param w width to display ** @param h height to display ** @param x X screen position ** @param y Y screen position */ local void VideoDrawCharClip(const Graphic* graphic,int gx,int gy,int w,int h, int x,int y) { int ox,oy,ex; CLIP_RECTANGLE_OFS(x,y,w,h,ox,oy,ex); VideoDrawChar(graphic,gx+ox,gy+oy,w,h,x,y); }
/** ** Draw character with current color clipped into 8 bit framebuffer. ** ** @param g Pointer to object ** @param gx X offset into object ** @param gy Y offset into object ** @param w width to display ** @param h height to display ** @param x X screen position ** @param y Y screen position */ static void VideoDrawCharClip(const CGraphic &g, int gx, int gy, int w, int h, int x, int y, const CFontColor &fc) { int ox; int oy; int ex; CLIP_RECTANGLE_OFS(x, y, w, h, ox, oy, ex); UNUSED(ex); VideoDrawChar(g, gx + ox, gy + oy, w, h, x, y, fc); }
/** ** Draw character with current color clipped into 8 bit framebuffer. ** ** @param g Pointer to object ** @param gx X offset into object ** @param gy Y offset into object ** @param w width to display ** @param h height to display ** @param x X screen position ** @param y Y screen position */ static void VideoDrawCharClip(const CGraphic *g, int gx, int gy, int w, int h, int x, int y) { int ox; int oy; int ex; CLIP_RECTANGLE_OFS(x, y, w, h, ox, oy, ex); VideoDrawChar(g, gx + ox, gy + oy, w, h, x, y); ex = ex; // make the compiler to shut up. }
unsigned int CFont::DrawChar(CGraphic &g, int utf8, int x, int y, const CFontColor &fc) const { int c = utf8 - 32; Assert(c >= 0); const int ipr = this->G->GraphicWidth / this->G->Width; if (c < 0 || ipr * this->G->GraphicHeight / this->G->Height <= c) { c = 0; } const int w = this->CharWidth[c]; const int gx = (c % ipr) * this->G->Width; const int gy = (c / ipr) * this->G->Height; if (CLIP) { VideoDrawCharClip(g, gx, gy, w, this->G->Height, x , y, fc); } else { VideoDrawChar(g, gx, gy, w, this->G->Height, x, y, fc); } return w + 1; }