From 760d5ac733ce41a5d4a3f861234850dcc4e96c38 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sat, 26 Mar 2016 22:48:04 +0100 Subject: ADL: Move drawPic() into base class --- engines/adl/adl.cpp | 7 +++++++ engines/adl/adl.h | 1 + engines/adl/hires1.cpp | 4 ---- engines/adl/hires1.h | 1 - engines/adl/hires2.cpp | 7 ------- engines/adl/hires2.h | 1 - 6 files changed, 8 insertions(+), 13 deletions(-) (limited to 'engines/adl') diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index e77755986a..db2d9d69c5 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -356,6 +356,13 @@ void AdlEngine::clearScreen() const { _display->clear(0x00); } +void AdlEngine::drawPic(byte pic, Common::Point pos) const { + if (_roomData.pictures.contains(pic)) + _graphics->drawPic(*_roomData.pictures[pic]->createReadStream(), pos); + else + _graphics->drawPic(*_pictures[pic]->createReadStream(), pos); +} + void AdlEngine::drawItems() const { Common::Array::const_iterator item; diff --git a/engines/adl/adl.h b/engines/adl/adl.h index d8ee5d930c..4751ed6e91 100644 --- a/engines/adl/adl.h +++ b/engines/adl/adl.h @@ -234,6 +234,7 @@ protected: // Graphics void clearScreen() const; + void drawPic(byte pic, Common::Point pos = Common::Point()) const; void drawItems() const; // Sound diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp index c1a43b8c0d..9e24d4fc65 100644 --- a/engines/adl/hires1.cpp +++ b/engines/adl/hires1.cpp @@ -262,10 +262,6 @@ void HiRes1Engine::restartGame() { _display->printAsciiString("\r\r\r\r\r"); } -void HiRes1Engine::drawPic(byte pic, Common::Point pos) const { - _graphics->drawPic(*_pictures[pic]->createReadStream(), pos); -} - void HiRes1Engine::printString(const Common::String &str) { Common::String wrap = str; wordWrap(wrap); diff --git a/engines/adl/hires1.h b/engines/adl/hires1.h index 29cdd5a3c2..02eb75aa19 100644 --- a/engines/adl/hires1.h +++ b/engines/adl/hires1.h @@ -103,7 +103,6 @@ private: void init(); void initState(); void restartGame(); - void drawPic(byte pic, Common::Point pos = Common::Point()) const; void printString(const Common::String &str); void printMessage(uint idx); void drawItem(const Item &item, const Common::Point &pos) const; diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp index 30114d6ce4..8be868193a 100644 --- a/engines/adl/hires2.cpp +++ b/engines/adl/hires2.cpp @@ -196,13 +196,6 @@ void HiRes2Engine::restartGame() { initState(); } -void HiRes2Engine::drawPic(byte pic, Common::Point pos) const { - if (_roomData.pictures.contains(pic)) - _graphics->drawPic(*_roomData.pictures[pic]->createReadStream(), pos); - else - _graphics->drawPic(*_pictures[pic]->createReadStream(), pos); -} - void HiRes2Engine::drawItem(const Item &item, const Common::Point &pos) const { StreamPtr stream(_itemPics[item.picture - 1]->createReadStream()); stream->readByte(); // Skip clear opcode diff --git a/engines/adl/hires2.h b/engines/adl/hires2.h index 17687b5359..c99c0b0458 100644 --- a/engines/adl/hires2.h +++ b/engines/adl/hires2.h @@ -60,7 +60,6 @@ private: void init(); void initState(); void restartGame(); - void drawPic(byte pic, Common::Point pos) const; void drawItem(const Item &item, const Common::Point &pos) const; void loadRoom(byte roomNr); void showRoom(); -- cgit v1.2.3