From 332763e8253f11e769f44bbaf17b4ddb3e80c097 Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Wed, 7 Jun 2017 18:34:11 +0200 Subject: SUPERNOVA: add renderBox() --- engines/supernova/graphics.cpp | 3 +-- engines/supernova/graphics.h | 10 ---------- engines/supernova/supernova.cpp | 11 ++++++++++- engines/supernova/supernova.h | 1 + 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index 5913553633..dfec15f174 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -72,8 +72,7 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) { _clickField[i].next = stream.readByte(); } - byte zwCodes[256]; - Common::fill(zwCodes, zwCodes + 256, 0); + byte zwCodes[256] = {0}; byte numRepeat = stream.readByte(); byte numZw = stream.readByte(); stream.read(zwCodes, numZw); diff --git a/engines/supernova/graphics.h b/engines/supernova/graphics.h index 7cd0e3c66e..585aabe260 100644 --- a/engines/supernova/graphics.h +++ b/engines/supernova/graphics.h @@ -14,16 +14,6 @@ struct Surface; namespace Supernova { -const byte initPalette[48] = { -// r g b - 0, 0, 0, 16, 16, 16, 22, 22, 22, - 28, 28, 28, 63, 63, 63, 0, 52, 0, - 0, 63, 0, 54, 0, 0, 63, 0, 0, - 0, 0, 30, 0, 0, 45, 40, 40, 40, - 20, 50, 63, 10, 63, 10, 60, 60, 0, - 63, 10, 10 -}; - class MSNImageDecoder : public Image::ImageDecoder { public: MSNImageDecoder(); diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index a2302230bd..f05aa1b72a 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -74,7 +74,6 @@ Common::Error SupernovaEngine::run() { _gameRunning = true; while (_gameRunning) { updateEvents(); - renderImage(31, 0); _system->updateScreen(); _system->delayMillis(10); @@ -217,4 +216,14 @@ void SupernovaEngine::renderImage(int filenumber, int section) { _system->copyRectToScreen(_image.getSurface()->getPixels(), 320, 0, 0, 320, 200); } + +void SupernovaEngine::renderBox(int x, int y, int width, int height, byte color) { + Graphics::Surface *screen = _system->lockScreen(); + screen->drawLine(x, y, x + width, y, color); + screen->drawLine(x + width, y, x + width, y + height, color); + screen->drawLine(x + width, y + height, x, y + height, color); + screen->drawLine(x, y + height, x, y, color); + _system->unlockScreen(); +} + } diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h index 8319e9a87a..823184ae4d 100644 --- a/engines/supernova/supernova.h +++ b/engines/supernova/supernova.h @@ -62,6 +62,7 @@ private: void playSoundMod(int filenumber); void stopSound(); void renderImage(int filenumber, int section); + void renderBox(int x, int y, int width, int height, byte color); }; } -- cgit v1.2.3