diff options
author | Filippos Karapetis | 2014-12-24 22:40:54 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-24 22:56:55 +0200 |
commit | e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5 (patch) | |
tree | 7e135df3450bd88d6a792acfc758f5ed3150822a /engines/zvision/scripting | |
parent | 84341a889cfafc4c7ecef6cf7d6841df8353fe4b (diff) | |
download | scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.tar.gz scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.tar.bz2 scummvm-rg350-e8e21fabe4dbe4effdfb3df05fd3fae75940f1c5.zip |
ZVISION: Set all the internal graphics operations to use RGB555 (1/2)
This is the first part of the changes to make the engine use RGB555
internally again. This is done to simplify the rendering pipeline -
the engine will use RGB555 internally, but will output to RGB565.
The overall changes have been broken into two commits, thus this
first commit will break all the game colors
Diffstat (limited to 'engines/zvision/scripting')
-rw-r--r-- | engines/zvision/scripting/actions.cpp | 25 | ||||
-rw-r--r-- | engines/zvision/scripting/controls/input_control.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/scripting/controls/titler_control.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/scripting/sidefx/ttytext_node.cpp | 4 |
4 files changed, 6 insertions, 27 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp index 5af847c61a..1b6e1e2fdc 100644 --- a/engines/zvision/scripting/actions.cpp +++ b/engines/zvision/scripting/actions.cpp @@ -580,12 +580,6 @@ ActionPreloadAnimation::ActionPreloadAnimation(ZVision *engine, int32 slotkey, c // The two %*u are usually 0 and dont seem to have a use sscanf(line.c_str(), "%24s %*u %*u %d %d", fileName, &_mask, &_framerate); - if (_mask > 0) { - byte r, g, b; - Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(_mask, r, g, b); - _mask = _engine->_pixelFormat.RGBToColor(r, g, b); - } - _fileName = Common::String(fileName); } @@ -648,12 +642,6 @@ ActionPlayAnimation::ActionPlayAnimation(ZVision *engine, int32 slotkey, const C "%24s %u %u %u %u %u %u %d %*u %*u %d %d", fileName, &_x, &_y, &_x2, &_y2, &_start, &_end, &_loopCount, &_mask, &_framerate); - if (_mask > 0) { - byte r, g, b; - Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(_mask, r, g, b); - _mask = _engine->_pixelFormat.RGBToColor(r, g, b); - } - _fileName = Common::String(fileName); } @@ -861,21 +849,12 @@ ActionSetPartialScreen::ActionSetPartialScreen(ZVision *engine, int32 slotkey, c _y = 0; char fileName[25]; - int color; - sscanf(line.c_str(), "%u %u %24s %*u %d", &_x, &_y, fileName, &color); + sscanf(line.c_str(), "%u %u %24s %*u %d", &_x, &_y, fileName, &_backgroundColor); _fileName = Common::String(fileName); - if (color >= 0) { - byte r, g, b; - Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(color, r, g, b); - _backgroundColor = _engine->_pixelFormat.RGBToColor(r, g, b); - } else { - _backgroundColor = color; - } - - if (color > 65535) { + if (_backgroundColor > 65535) { warning("Background color for ActionSetPartialScreen is bigger than a uint16"); } } diff --git a/engines/zvision/scripting/controls/input_control.cpp b/engines/zvision/scripting/controls/input_control.cpp index d7734f6d7a..e1e6e6ec9d 100644 --- a/engines/zvision/scripting/controls/input_control.cpp +++ b/engines/zvision/scripting/controls/input_control.cpp @@ -199,7 +199,7 @@ bool InputControl::process(uint32 deltaTimeInMillis) { // Blit the text using the RenderManager Graphics::Surface txt; - txt.create(_textRectangle.width(), _textRectangle.height(), _engine->_pixelFormat); + txt.create(_textRectangle.width(), _textRectangle.height(), _engine->_resourcePixelFormat); if (!_readOnly || !_focused) _txtWidth = _engine->getTextRenderer()->drawTxt(_currentInputText, _stringInit, txt); diff --git a/engines/zvision/scripting/controls/titler_control.cpp b/engines/zvision/scripting/controls/titler_control.cpp index 10ba0af655..d6b1d34bae 100644 --- a/engines/zvision/scripting/controls/titler_control.cpp +++ b/engines/zvision/scripting/controls/titler_control.cpp @@ -67,7 +67,7 @@ TitlerControl::TitlerControl(ZVision *engine, uint32 key, Common::SeekableReadSt if (!_rectangle.isEmpty()) { _surface = new Graphics::Surface; - _surface->create(_rectangle.width(), _rectangle.height(), _engine->_pixelFormat); + _surface->create(_rectangle.width(), _rectangle.height(), _engine->_resourcePixelFormat); _surface->fillRect(Common::Rect(_surface->w, _surface->h), 0); } } diff --git a/engines/zvision/scripting/sidefx/ttytext_node.cpp b/engines/zvision/scripting/sidefx/ttytext_node.cpp index 2930118524..66a27e96c5 100644 --- a/engines/zvision/scripting/sidefx/ttytext_node.cpp +++ b/engines/zvision/scripting/sidefx/ttytext_node.cpp @@ -56,7 +56,7 @@ ttyTextNode::ttyTextNode(ZVision *engine, uint32 key, const Common::String &file delete infile; } - _img.create(_r.width(), _r.height(), _engine->_pixelFormat); + _img.create(_r.width(), _r.height(), _engine->_resourcePixelFormat); _style._sharp = true; _style.readAllStyle(_txtbuf); _style.setFont(_fnt); @@ -158,7 +158,7 @@ void ttyTextNode::newline() { } void ttyTextNode::outchar(uint16 chr) { - uint32 clr = _engine->_pixelFormat.RGBToColor(_style._red, _style._green, _style._blue); + uint32 clr = _engine->_resourcePixelFormat.RGBToColor(_style._red, _style._green, _style._blue); if (_dx + _fnt.getCharWidth(chr) > _r.width()) newline(); |