void draw_box(struct canvas_t* cvs, int x, int y, int w, int h, unsigned long outln, unsigned long fill) { if (PIXA(fill) != 0) { fillrect(cvs, x, y, w, h, UNPACK_RGBA(fill)); } if (PIXA(outln) != 0) { drawrect(cvs, x, y, w, h, UNPACK_RGBA(outln)); } }
TPT_INLINE void VideoBuffer::BlendPixel(int x, int y, int r, int g, int b, int a) { #ifdef PIX32OGL pixel t; if (x<0 || y<0 || x>=Width || y>=Height) return; if (a!=255) { t = Buffer[y*(Width)+x]; r = (a*r + (255-a)*PIXR(t)) >> 8; g = (a*g + (255-a)*PIXG(t)) >> 8; b = (a*b + (255-a)*PIXB(t)) >> 8; a = a > PIXA(t) ? a : PIXA(t); }