diff options
author | Paul Gilbert | 2015-03-15 17:25:21 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-03-15 17:25:21 -0400 |
commit | eaab373a9687c6d6d3be3983bb77da5a69897a24 (patch) | |
tree | 6d59fa038e6798535e7c147ff61cb0b5d57c8ec6 | |
parent | 87a9ba5f2f5b9c3cde675c238ce718147417df03 (diff) | |
download | scummvm-rg350-eaab373a9687c6d6d3be3983bb77da5a69897a24.tar.gz scummvm-rg350-eaab373a9687c6d6d3be3983bb77da5a69897a24.tar.bz2 scummvm-rg350-eaab373a9687c6d6d3be3983bb77da5a69897a24.zip |
SHERLOCK: Added skeleton Screen class
-rw-r--r-- | engines/sherlock/graphics.cpp | 21 | ||||
-rw-r--r-- | engines/sherlock/graphics.h | 14 | ||||
-rw-r--r-- | engines/sherlock/sherlock.cpp | 3 | ||||
-rw-r--r-- | engines/sherlock/sherlock.h | 2 |
4 files changed, 40 insertions, 0 deletions
diff --git a/engines/sherlock/graphics.cpp b/engines/sherlock/graphics.cpp index f4a5bf1864..695635d2ca 100644 --- a/engines/sherlock/graphics.cpp +++ b/engines/sherlock/graphics.cpp @@ -21,6 +21,8 @@ */ #include "sherlock/graphics.h" +#include "sherlock/sherlock.h" +#include "common/system.h" namespace Sherlock { @@ -41,5 +43,24 @@ void Surface::drawSprite(int x, int y, SpriteFrame *spriteFrame, bool flipped, b } +/*----------------------------------------------------------------*/ + +Screen::Screen(SherlockEngine *vm) : Surface(SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT), _vm(vm) { + setFont(1); +} + +void Screen::setFont(int fontNumber) { + _fontNumber = fontNumber; + Common::String fname = Common::String::format("FONT%d.VGS", fontNumber); + Common::SeekableReadStream *stream = _vm->_res->load(fname); + + debug("TODO: Loading font %s, size - %d", fname.c_str(), stream->size()); + + delete stream; +} + +void Screen::update() { + g_system->updateScreen(); +} } // End of namespace Sherlock diff --git a/engines/sherlock/graphics.h b/engines/sherlock/graphics.h index 64518a78c6..fe03e7155d 100644 --- a/engines/sherlock/graphics.h +++ b/engines/sherlock/graphics.h @@ -30,6 +30,8 @@ namespace Sherlock { +class SherlockEngine; + class Surface : public Graphics::Surface { public: Surface(uint16 width, uint16 height); @@ -38,6 +40,18 @@ public: void drawSprite(int x, int y, SpriteFrame *spriteFrame, bool flipped = false, bool altFlag = false); }; +class Screen : public Surface { +private: + SherlockEngine *_vm; + int _fontNumber; +public: + Screen(SherlockEngine *vm); + + void setFont(int fontNumber); + + void update(); +}; + } // End of namespace Sherlock #endif diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp index a6ae6e215c..0d55e0ba8d 100644 --- a/engines/sherlock/sherlock.cpp +++ b/engines/sherlock/sherlock.cpp @@ -33,6 +33,7 @@ SherlockEngine::SherlockEngine(OSystem *syst, const SherlockGameDescription *gam _journal = nullptr; _res = nullptr; _rooms = nullptr; + _screen = nullptr; _talk = nullptr; } @@ -41,6 +42,7 @@ SherlockEngine::~SherlockEngine() { delete _journal; delete _res; delete _rooms; + delete _screen; delete _talk; } @@ -65,6 +67,7 @@ void SherlockEngine::initialize() { _journal = new Journal(); _res = new Resources(); _rooms = new Rooms(); + _screen = new Screen(this); _talk = new Talk(); initFlags(); diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h index a68650c0a9..4c5f86dd09 100644 --- a/engines/sherlock/sherlock.h +++ b/engines/sherlock/sherlock.h @@ -30,6 +30,7 @@ #include "common/savefile.h" #include "common/hash-str.h" #include "engines/engine.h" +#include "sherlock/graphics.h" #include "sherlock/journal.h" #include "sherlock/resources.h" #include "sherlock/room.h" @@ -67,6 +68,7 @@ public: Journal *_journal; Resources *_res; Rooms *_rooms; + Screen *_screen; Talk *_talk; Common::Array<bool> _flags; public: |