aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/picture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/picture.cpp')
-rw-r--r--engines/agi/picture.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index 27c19d2eaa..4a7f5f5900 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -189,8 +189,11 @@ void PictureMgr::drawLine(int x1, int y1, int x2, int y2) {
void PictureMgr::dynamicDrawLine() {
int x1, y1, disp, dx, dy;
- x1 = nextByte();
- y1 = nextByte();
+ if ((x1 = nextByte()) >= _minCommand ||
+ (y1 = nextByte()) >= _minCommand) {
+ _foffs--;
+ return;
+ }
putVirtPixel(x1, y1);
@@ -221,8 +224,12 @@ void PictureMgr::dynamicDrawLine() {
void PictureMgr::absoluteDrawLine() {
int x1, y1, x2, y2;
- x1 = nextByte();
- y1 = nextByte();
+ if ((x1 = nextByte()) >= _minCommand ||
+ (y1 = nextByte()) >= _minCommand) {
+ _foffs--;
+ return;
+ }
+
putVirtPixel(x1, y1);
for (;;) {
@@ -325,20 +332,24 @@ void PictureMgr::agiFill(unsigned int x, unsigned int y) {
void PictureMgr::xCorner(bool skipOtherCoords) {
int x1, x2, y1, y2;
- x1 = nextByte();
- y1 = nextByte();
+ if ((x1 = nextByte()) >= _minCommand ||
+ (y1 = nextByte()) >= _minCommand) {
+ _foffs--;
+ return;
+ }
+
putVirtPixel(x1, y1);
for (;;) {
x2 = nextByte();
+ if (x2 >= _minCommand)
+ break;
+
if (skipOtherCoords)
if (nextByte() >= _minCommand)
break;
- if (x2 >= _minCommand)
- break;
-
drawLine(x1, y1, x2, y1);
x1 = x2;
@@ -365,8 +376,12 @@ void PictureMgr::xCorner(bool skipOtherCoords) {
void PictureMgr::yCorner(bool skipOtherCoords) {
int x1, x2, y1, y2;
- x1 = nextByte();
- y1 = nextByte();
+ if ((x1 = nextByte()) >= _minCommand ||
+ (y1 = nextByte()) >= _minCommand) {
+ _foffs--;
+ return;
+ }
+
putVirtPixel(x1, y1);
for (;;) {