mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
TINYGL: Implemented scissor rectangle in frame buffer.
This commit is contained in:
parent
5049413d24
commit
79ea06e41d
@ -67,6 +67,8 @@ FrameBuffer::FrameBuffer(int width, int height, const Graphics::PixelBuffer &fra
|
||||
this->pixelbits = this->cmode.bytesPerPixel * 8;
|
||||
this->linesize = (xsize * this->pixelbytes + 3) & ~3;
|
||||
|
||||
this->setScissorRectangle(0, xsize, 0, ysize);
|
||||
|
||||
size = this->xsize * this->ysize * sizeof(unsigned int);
|
||||
|
||||
this->zbuf = (unsigned int *)gl_malloc(size);
|
||||
|
@ -166,6 +166,13 @@ struct FrameBuffer {
|
||||
if (!checkAlphaTest(aSrc))
|
||||
return;
|
||||
|
||||
int x = pixel % xsize;
|
||||
int y = pixel / xsize;
|
||||
|
||||
if (x < _clipLeft || x > _clipRight || y < _clipTop || y > _clipBottom) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_blendingEnabled == false) {
|
||||
this->pbuf.setPixelAt(pixel, aSrc, rSrc, gSrc, bSrc);
|
||||
} else {
|
||||
@ -338,6 +345,14 @@ struct FrameBuffer {
|
||||
void fillLineFlat(ZBufferPoint *p1, ZBufferPoint *p2, int color);
|
||||
void fillLineInterp(ZBufferPoint *p1, ZBufferPoint *p2);
|
||||
|
||||
void setScissorRectangle(int left, int right, int top, int bottom) {
|
||||
_clipLeft = left;
|
||||
_clipRight = right;
|
||||
_clipTop = top;
|
||||
_clipBottom = bottom;
|
||||
}
|
||||
|
||||
int _clipLeft, _clipTop, _clipRight, _clipBottom;
|
||||
int xsize, ysize;
|
||||
int linesize; // line size, in bytes
|
||||
Graphics::PixelFormat cmode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user