ACCESS: Fixes for clipping
This commit is contained in:
parent
9107cc103f
commit
b579dbb71b
2 changed files with 15 additions and 5 deletions
|
@ -115,13 +115,14 @@ bool ASurface::clip(Common::Rect &r) {
|
||||||
_topSkip = _bottomSkip = 0;
|
_topSkip = _bottomSkip = 0;
|
||||||
|
|
||||||
if (r.left > _clipWidth) {
|
if (r.left > _clipWidth) {
|
||||||
|
if (r.left >= 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
skip = -r.left;
|
skip = -r.left;
|
||||||
r.setWidth(r.width() - skip);
|
r.setWidth(r.width() - skip);
|
||||||
_leftSkip = skip;
|
_leftSkip = skip;
|
||||||
r.moveTo(0, r.top);
|
r.moveTo(0, r.top);
|
||||||
}
|
}
|
||||||
else if (r.left >= 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
int right = r.right - 1;
|
int right = r.right - 1;
|
||||||
if (right < 0)
|
if (right < 0)
|
||||||
|
@ -133,13 +134,14 @@ bool ASurface::clip(Common::Rect &r) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r.top > _clipHeight) {
|
if (r.top > _clipHeight) {
|
||||||
|
if (r.top >= 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
skip = -r.top;
|
skip = -r.top;
|
||||||
r.setHeight(r.height() - skip);
|
r.setHeight(r.height() - skip);
|
||||||
_topSkip = skip;
|
_topSkip = skip;
|
||||||
r.moveTo(r.left, 0);
|
r.moveTo(r.left, 0);
|
||||||
}
|
}
|
||||||
else if (r.top >= 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
int bottom = r.bottom - 1;
|
int bottom = r.bottom - 1;
|
||||||
if (bottom < 0)
|
if (bottom < 0)
|
||||||
|
|
|
@ -51,10 +51,18 @@ Screen::Screen(AccessEngine *vm) : _vm(vm) {
|
||||||
_scrollCol = _scrollRow = 0;
|
_scrollCol = _scrollRow = 0;
|
||||||
_windowXAdd = _windowYAdd = 0;
|
_windowXAdd = _windowYAdd = 0;
|
||||||
_screenYOff = 0;
|
_screenYOff = 0;
|
||||||
|
|
||||||
|
setDisplayScan();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screen::setDisplayScan() {
|
void Screen::setDisplayScan() {
|
||||||
warning("TODO: setDisplayScan");
|
_clipWidth = this->w - 1;
|
||||||
|
_clipHeight = this->h - 1;
|
||||||
|
_windowXAdd = _windowYAdd = 0;
|
||||||
|
_scrollX = _scrollY = 0;
|
||||||
|
_scrollCol = _scrollRow = 0;
|
||||||
|
_bufferStart.x = _bufferStart.y = 0;
|
||||||
|
_screenYOff = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screen::setPanel(int num) {
|
void Screen::setPanel(int num) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue