diff options
author | Bertrand Augereau | 2011-09-01 19:00:13 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-09-01 23:41:03 +0200 |
commit | e84ea10ad456ed1e90246c3c96c4fafcf44d4e3b (patch) | |
tree | 856d07978a07f78d5a0d48a1c4e044df1c740f58 /engines/dreamweb/vgagrafx.cpp | |
parent | f01479e8419d40dc2b9c410fd7228b9771dd2e3c (diff) | |
download | scummvm-rg350-e84ea10ad456ed1e90246c3c96c4fafcf44d4e3b.tar.gz scummvm-rg350-e84ea10ad456ed1e90246c3c96c4fafcf44d4e3b.tar.bz2 scummvm-rg350-e84ea10ad456ed1e90246c3c96c4fafcf44d4e3b.zip |
DREAMWEB: 'checkpixelset' ported to C++
Diffstat (limited to 'engines/dreamweb/vgagrafx.cpp')
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index ee05ebfc15..8d437c2c73 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -455,5 +455,21 @@ void DreamGenContext::transferinv() { data.word(kExframepos) += byteCount; } +void DreamGenContext::pixelcheckset() { + uint8 x = al; + uint8 y = ah; + ObjPos *pos = (ObjPos *)es.ptr(bx, sizeof(ObjPos)); + flags._z = !pixelcheckset(pos, x, y); +} + +bool DreamGenContext::pixelcheckset(ObjPos *pos, uint8 x, uint8 y) { + x -= pos->xMin; + y -= pos->yMin; + SetObject *setObject = getsetad(pos->index); + Frame *frame = (Frame *)segRef(data.word(kSetframes)).ptr(kFramedata, 0) + setObject->index; + const uint8 *ptr = segRef(data.word(kSetframes)).ptr(kFrames, 0) + frame->ptr() + y * frame->width + x; + return *ptr != 0; +} + } /*namespace dreamgen */ |