diff options
Diffstat (limited to 'engines/supernova/screen.cpp')
-rw-r--r-- | engines/supernova/screen.cpp | 86 |
1 files changed, 64 insertions, 22 deletions
diff --git a/engines/supernova/screen.cpp b/engines/supernova/screen.cpp index f28af28134..0240a7619e 100644 --- a/engines/supernova/screen.cpp +++ b/engines/supernova/screen.cpp @@ -26,6 +26,7 @@ #include "graphics/cursorman.h" #include "graphics/palette.h" #include "graphics/surface.h" +#include "common/config-manager.h" #include "supernova/imageid.h" #include "supernova/resman.h" @@ -105,14 +106,24 @@ Marquee::Marquee(Screen *screen, MarqueeId id, const char *text) : _text(text) , _textBegin(text) , _delay(0) - , _color(kColorLightBlue) , _loop(false) , _screen(screen) { - if (id == kMarqueeIntro) { - _y = 191; - _loop = true; - } else if (id == kMarqueeOutro) { - _y = 1; + if (_screen->_vm->_MSPart == 1) { + _color = kColorLightBlue; + if (id == kMarqueeIntro) { + _y = 191; + _loop = true; + } else if (id == kMarqueeOutro) { + _y = 1; + } + } else if (_screen->_vm->_MSPart == 2) { + _color = kColorPurple; + if (id == kMarqueeIntro) { + _y = 191; + _loop = true; + } else if (id == kMarqueeOutro) { + _y = 191; + } } _textWidth = Screen::textWidth(_text); @@ -126,10 +137,18 @@ void Marquee::clearText() { _screen->renderBox(_x, _y - 1, _textWidth + 1, 9, kColorBlack); } -void Marquee::renderCharacter() { +void Marquee::reset() { + _text = _textBegin; + clearText(); + _textWidth = Screen::textWidth(_text); + _x = kScreenWidth / 2 - _textWidth / 2; + _screen->_textCursorX = _x; +} + +bool Marquee::renderCharacter() { if (_delay != 0) { _delay--; - return; + return true; } switch (*_text) { @@ -141,7 +160,8 @@ void Marquee::renderCharacter() { _textWidth = Screen::textWidth(_text); _x = kScreenWidth / 2 - _textWidth / 2; _screen->_textCursorX = _x; - } + } else + return false; break; case '\0': clearText(); @@ -149,8 +169,13 @@ void Marquee::renderCharacter() { _textWidth = Screen::textWidth(_text); _x = kScreenWidth / 2 - _textWidth / 2; _screen->_textCursorX = _x; - _color = kColorLightBlue; - _screen->_textColor = _color; + if (_screen->_vm->_MSPart == 1) { + _color = kColorLightBlue; + _screen->_textColor = _color; + } else if (_screen->_vm->_MSPart == 2) { + _color = kColorPurple; + _screen->_textColor = _color; + } break; case '^': _color = kColorLightYellow; @@ -166,6 +191,7 @@ void Marquee::renderCharacter() { _delay = 1; break; } + return true; } Screen::Screen(SupernovaEngine *vm, ResourceManager *resMan) @@ -181,10 +207,7 @@ Screen::Screen(SupernovaEngine *vm, ResourceManager *resMan) , _textCursorY(0) , _messageShown(false) { - CursorMan.replaceCursor(_resMan->getImage(ResourceManager::kCursorNormal), - 16, 16, 0, 0, kColorCursorTransparent); - CursorMan.replaceCursorPalette(initVGAPalette, 0, 16); - CursorMan.showMouse(true); + changeCursor(ResourceManager::kCursorNormal); } int Screen::getScreenWidth() const { @@ -211,7 +234,7 @@ void Screen::setGuiBrightness(int brightness) { _guiBrightness = brightness; } -const MSNImage *Screen::getCurrentImage() const { +MSNImage *Screen::getCurrentImage() { return _currentImage; } @@ -348,7 +371,13 @@ void Screen::renderImageSection(const MSNImage *image, int section, bool invert) image->_section[section].y1, image->_section[section].x2 + 1, image->_section[section].y2 + 1); - if (image->_filenumber == 1 || image->_filenumber == 2) { + bool bigImage = false; + if (_vm->_MSPart == 1) + bigImage = image->_filenumber == 1 || image->_filenumber == 2; + else if (_vm->_MSPart == 2) + bigImage = image->_filenumber == 38 || + (image->_filenumber == 28 && ConfMan.get("language") == "en"); + if (bigImage) { sectionRect.setWidth(640); sectionRect.setHeight(480); if (_screenWidth != 640) { @@ -478,7 +507,7 @@ int Screen::textWidth(const Common::String &text) { return Screen::textWidth(text.c_str()); } -void Screen::renderMessage(const char *text, MessagePosition position) { +void Screen::renderMessage(const char *text, MessagePosition position, int positionX, int positionY) { Common::String t(text); char *row[20]; Common::String::iterator p = t.begin(); @@ -536,6 +565,11 @@ void Screen::renderMessage(const char *text, MessagePosition position) { y = 142; } + if (positionX != -1 && positionY != -1) { + x = positionX; + y = positionY; + } + int message_columns = x - 3; int message_rows = y - 3; int message_width = rowWidthMax + 6; @@ -591,8 +625,8 @@ void Screen::paletteBrightness() { _vm->_system->getPaletteManager()->setPalette(palette, 0, 255); } -void Screen::paletteFadeOut() { - while (_guiBrightness > 10) { +void Screen::paletteFadeOut(int minBrightness) { + while (_guiBrightness > minBrightness + 10) { _guiBrightness -= 10; if (_viewportBrightness > _guiBrightness) _viewportBrightness = _guiBrightness; @@ -600,8 +634,8 @@ void Screen::paletteFadeOut() { _vm->_system->updateScreen(); _vm->_system->delayMillis(_vm->_delay); } - _guiBrightness = 0; - _viewportBrightness = 0; + _guiBrightness = minBrightness; + _viewportBrightness = minBrightness; paletteBrightness(); _vm->_system->updateScreen(); } @@ -626,4 +660,12 @@ void Screen::setColor63(byte value) { _vm->_system->getPaletteManager()->setPalette(color, 63, 1); } +void Screen::changeCursor(ResourceManager::CursorId id) { + CursorMan.replaceCursor(_resMan->getCursor(id), + 16, 16, 0, 0, kColorCursorTransparent); + CursorMan.replaceCursorPalette(initVGAPalette, 0, 16); + CursorMan.showMouse(true); +} + + } |