diff options
author | Sven Hesse | 2010-09-30 13:03:22 +0000 |
---|---|---|
committer | Sven Hesse | 2010-09-30 13:03:22 +0000 |
commit | 3ab8bf16a27f34ed865edd7c028d0dff90448622 (patch) | |
tree | a6d80a44b207246daac34a2fcc7c93e42ebe5372 /engines/gob | |
parent | 4f2b58b11740c8bdeb728a4798e572e8c9d1d990 (diff) | |
download | scummvm-rg350-3ab8bf16a27f34ed865edd7c028d0dff90448622.tar.gz scummvm-rg350-3ab8bf16a27f34ed865edd7c028d0dff90448622.tar.bz2 scummvm-rg350-3ab8bf16a27f34ed865edd7c028d0dff90448622.zip |
GOB: Create 16bit surfaces for true color games
Enabling basic Urban drawing again
svn-id: r52949
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/gob.cpp | 7 | ||||
-rw-r--r-- | engines/gob/inter_v4.cpp | 4 | ||||
-rw-r--r-- | engines/gob/inter_v5.cpp | 4 | ||||
-rw-r--r-- | engines/gob/video.cpp | 2 | ||||
-rw-r--r-- | engines/gob/video_v6.cpp | 31 |
5 files changed, 24 insertions, 24 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 63625acbd9..fe478064c0 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -230,11 +230,6 @@ bool GobEngine::is800x600() const { } bool GobEngine::isTrueColor() const { - if (_features & kFeaturesTrueColor) { - warning("TODO: _features & kFeaturesTrueColor"); - return false; - } - return (_features & kFeaturesTrueColor) != 0; } @@ -580,7 +575,7 @@ bool GobEngine::initGraphics() { _global->_mouseMaxX = _width; _global->_mouseMaxY = _height; - _global->_primarySurfDesc = SurfacePtr(new Surface(_width, _height, 1)); + _global->_primarySurfDesc = SurfacePtr(new Surface(_width, _height, _pixelFormat.bytesPerPixel)); return true; } diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp index b47691b40f..26eff4f675 100644 --- a/engines/gob/inter_v4.cpp +++ b/engines/gob/inter_v4.cpp @@ -134,8 +134,8 @@ void Inter_v4::o4_initScreen() { _vm->_util->setScrollOffset(); if (offY > 0) { - _vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, 1)); - _vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, 1)); + _vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel)); + _vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel)); _vm->_video->_splitSurf = _vm->_draw->_spritesArray[25]; } } diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index 4106aef612..a684a94a7d 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -194,8 +194,8 @@ void Inter_v5::o5_initScreen() { _vm->_util->setScrollOffset(); if (offY > 0) { - _vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, 1)); - _vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, 1)); + _vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel)); + _vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel)); _vm->_video->_splitSurf = _vm->_draw->_spritesArray[25]; } } diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index f4c12ad00e..a9afe24d33 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -209,7 +209,7 @@ SurfacePtr Video::initSurfDesc(int16 vidMode, int16 width, int16 height, int16 f if (!(flags & SCUMMVM_CURSOR)) width = (width + 7) & 0xFFF8; - descPtr = SurfacePtr(new Surface(width, height, 1)); + descPtr = SurfacePtr(new Surface(width, height, _vm->getPixelFormat().bytesPerPixel)); } return descPtr; } diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp index 355cf38468..7bf728034b 100644 --- a/engines/gob/video_v6.cpp +++ b/engines/gob/video_v6.cpp @@ -26,6 +26,8 @@ #include "common/endian.h" #include "common/savefile.h" +#include "graphics/conversion.h" + #include "gob/gob.h" #include "gob/video.h" #include "gob/util.h" @@ -192,39 +194,42 @@ void Video_v6::drawYUV(Surface &destDesc, int16 x, int16 y, int16 dataWidth, int16 dataHeight, int16 width, int16 height, const byte *dataY, const byte *dataU, const byte *dataV) { - warning("TODO: Video_v6::drawYUV"); - - /* - byte *vidMem = destDesc.getVidMem() + y * destDesc.getWidth() + x; + const Graphics::PixelFormat &pixelFormat = _vm->getPixelFormat(); if ((x + width - 1) >= destDesc.getWidth()) width = destDesc.getWidth() - x; if ((y + height - 1) >= destDesc.getHeight()) height = destDesc.getHeight() - y; - Graphics::SierraLight *dither = - new Graphics::SierraLight(width, _palLUT); + Pixel dst = destDesc.get(x, y); for (int i = 0; i < height; i++) { - byte *dest = vidMem; + Pixel dstRow = dst; + const byte *srcY = dataY + i * dataWidth; const byte *srcU = dataU + (i >> 2) * (dataWidth >> 2); const byte *srcV = dataV + (i >> 2) * (dataWidth >> 2); for (int j = 0; j < (width >> 2); j++, srcU++, srcV++) { - for (int n = 0; n < 4; n++, dest++, srcY++) { + for (int n = 0; n < 4; n++, dstRow++, srcY++) { byte dY = *srcY << 1, dU = *srcU << 1, dV = *srcV << 1; - *dest = (dY == 0) ? 0 : dither->dither(dY, dU, dV, j * 4 + n); + byte r, g, b; + Graphics::YUV2RGB(dY, dU, dV, r, g, b); + + if (dY != 0) { + uint32 c = pixelFormat.RGBToColor(r, g, b); + + dstRow.set((c == 0) ? 1 : c); + } else + dstRow.set(0); + } } - dither->nextLine(); - vidMem += destDesc.getWidth(); + dst += destDesc.getWidth(); } - delete dither; - */ } } // End of namespace Gob |