aboutsummaryrefslogtreecommitdiff
path: root/engines/adl
diff options
context:
space:
mode:
authorWalter van Niftrik2017-02-27 22:45:48 +0100
committerWalter van Niftrik2017-03-05 21:16:58 +0100
commit494682de90e7fb0d01cdd32c473e58b564f25eaf (patch)
tree436c385a06d178bfbb0518a94e22e5961cb00224 /engines/adl
parent33c8073bc278f2fe7323bd0bfecc3f7209f2dd1d (diff)
downloadscummvm-rg350-494682de90e7fb0d01cdd32c473e58b564f25eaf.tar.gz
scummvm-rg350-494682de90e7fb0d01cdd32c473e58b564f25eaf.tar.bz2
scummvm-rg350-494682de90e7fb0d01cdd32c473e58b564f25eaf.zip
ADL: Add byte-access functions to Display class
Diffstat (limited to 'engines/adl')
-rw-r--r--engines/adl/display.cpp12
-rw-r--r--engines/adl/display.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/adl/display.cpp b/engines/adl/display.cpp
index fc20082b44..52fb1b44d7 100644
--- a/engines/adl/display.cpp
+++ b/engines/adl/display.cpp
@@ -241,6 +241,12 @@ void Display::putPixel(const Common::Point &p, byte color) {
writeFrameBuffer(p, color, mask);
}
+void Display::setPixelByte(const Common::Point &p, byte color) {
+ assert(p.x >= 0 && p.x < DISPLAY_WIDTH && p.y >= 0 && p.y < DISPLAY_HEIGHT);
+
+ _frameBuf[p.y * DISPLAY_PITCH + p.x / 7] = color;
+}
+
void Display::setPixelBit(const Common::Point &p, byte color) {
writeFrameBuffer(p, color, 1 << (p.x % 7));
}
@@ -249,6 +255,12 @@ void Display::setPixelPalette(const Common::Point &p, byte color) {
writeFrameBuffer(p, color, 0x80);
}
+byte Display::getPixelByte(const Common::Point &p) const {
+ assert(p.x >= 0 && p.x < DISPLAY_WIDTH && p.y >= 0 && p.y < DISPLAY_HEIGHT);
+
+ return _frameBuf[p.y * DISPLAY_PITCH + p.x / 7];
+}
+
bool Display::getPixelBit(const Common::Point &p) const {
assert(p.x >= 0 && p.x < DISPLAY_WIDTH && p.y >= 0 && p.y < DISPLAY_HEIGHT);
diff --git a/engines/adl/display.h b/engines/adl/display.h
index da083e85b7..c1c0f410fe 100644
--- a/engines/adl/display.h
+++ b/engines/adl/display.h
@@ -67,8 +67,10 @@ public:
static void loadFrameBuffer(Common::ReadStream &stream, byte *dst);
void loadFrameBuffer(Common::ReadStream &stream);
void putPixel(const Common::Point &p, byte color);
+ void setPixelByte(const Common::Point &p, byte color);
void setPixelBit(const Common::Point &p, byte color);
void setPixelPalette(const Common::Point &p, byte color);
+ byte getPixelByte(const Common::Point &p) const;
bool getPixelBit(const Common::Point &p) const;
void clear(byte color);