void ZB_clear(ZBuffer * zb, int clear_z, int z, int clear_color, int r, int g, int b) { #if TGL_FEATURE_RENDER_BITS != 24 int color; #endif int y; PIXEL *pp; if (clear_z) { memset_s(zb->zbuf, z, zb->xsize * zb->ysize); } if (clear_color) { pp = zb->pbuf; for (y = 0; y < zb->ysize; y++) { #if TGL_FEATURE_RENDER_BITS == 15 || TGL_FEATURE_RENDER_BITS == 16 color = RGB_TO_PIXEL(r, g, b); memset_s(pp, color, zb->xsize); #elif TGL_FEATURE_RENDER_BITS == 32 color = RGB_TO_PIXEL(r, g, b); memset_l(pp, color, zb->xsize); #elif TGL_FEATURE_RENDER_BITS == 24 memset_RGB24(pp,r>>8,g>>8,b>>8,zb->xsize); #else #error TODO #endif pp = (PIXEL *) ((char *) pp + zb->linesize); } } }
SL_API void sl_clear() { sl_context_t* c = sl_context(); int color = c->clear_color; memset_l(c->zbuffer.pbuf, color, c->zbuffer.w * c->zbuffer.h); }
void FrameBuffer::clear(int clearZ, int z, int clearColor, int r, int g, int b) { if (clearZ) { memset_l(this->_zbuf, z, this->xsize * this->ysize); } if (clearColor) { byte *pp = this->pbuf.getRawBuffer(); uint32 color = this->cmode.RGBToColor(r, g, b); for (int y = 0; y < this->ysize; y++) { memset_s(pp, color, this->xsize); pp = pp + this->linesize; } } }
void FrameBuffer::clearRegion(int x, int y, int w, int h, int clearZ, int z, int clearColor, int r, int g, int b) { if (clearZ) { for (int row = y; row < y + h; row++) { memset_l(this->_zbuf + x + (row * this->xsize), z, w); } } if (clearColor) { byte *pp = this->pbuf.getRawBuffer() + y * this->linesize; uint32 color = this->cmode.RGBToColor(r, g, b); for (int row = y; row < y + h; row++) { memset_s(pp + x * this->pixelbytes, color, w); pp = pp + this->linesize; } } }
void ZB_clear(ZBuffer *zb, int clear_z, int z, int clear_color, int r, int g, int b) { uint32 color; int y; byte *pp; if (clear_z) { memset_l(zb->zbuf, z, zb->xsize * zb->ysize); } if (clear_color) { pp = zb->pbuf.getRawBuffer(); for (y = 0; y < zb->ysize; y++) { color = zb->cmode.RGBToColor(r, g, b); memset_s(pp, color, zb->xsize); pp = pp + zb->linesize; } } }
void ZB_clear(ZBuffer *zb, int clear_z, int z, int clear_color, int r, int g, int b) { int color; int y; PIXEL *pp; if (clear_z) { memset_s(zb->zbuf, z, zb->xsize * zb->ysize); } if (clear_z) { memset_l(zb->zbuf2, z, zb->xsize * zb->ysize); } if (clear_color) { pp = zb->pbuf; for (y = 0; y < zb->ysize; y++) { color = RGB_TO_PIXEL(r, g, b); memset_s(pp, color, zb->xsize); pp = (PIXEL *)((char *)pp + zb->linesize); } } }