diff options
author | Johannes Schickel | 2011-05-01 16:54:45 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-05-01 16:54:45 +0200 |
commit | 71bdb86e028db9556611f88b3686ce93312a8131 (patch) | |
tree | 3c24233044a8e72bd8ecd73b981f50c725d5d282 /video/codecs | |
parent | 89b63e3adb4692c9659f8b133727ccc1e2af75b4 (diff) | |
parent | 8ff527ac4ef4237e63c0802a22eb0f942089e6c4 (diff) | |
download | scummvm-rg350-71bdb86e028db9556611f88b3686ce93312a8131.tar.gz scummvm-rg350-71bdb86e028db9556611f88b3686ce93312a8131.tar.bz2 scummvm-rg350-71bdb86e028db9556611f88b3686ce93312a8131.zip |
Merge pull request #16 "Add a PixelFormat to Graphics::Surface.".
For further discussion check here:
https://github.com/scummvm/scummvm/pull/16
Conflicts:
graphics/png.cpp
Diffstat (limited to 'video/codecs')
-rw-r--r-- | video/codecs/cdtoons.cpp | 2 | ||||
-rw-r--r-- | video/codecs/cinepak.cpp | 2 | ||||
-rw-r--r-- | video/codecs/indeo3.cpp | 8 | ||||
-rw-r--r-- | video/codecs/mjpeg.cpp | 2 | ||||
-rw-r--r-- | video/codecs/msrle.cpp | 2 | ||||
-rw-r--r-- | video/codecs/msvideo1.cpp | 3 | ||||
-rw-r--r-- | video/codecs/qtrle.cpp | 2 | ||||
-rw-r--r-- | video/codecs/rpza.cpp | 2 | ||||
-rw-r--r-- | video/codecs/smc.cpp | 2 | ||||
-rw-r--r-- | video/codecs/truemotion1.cpp | 2 |
10 files changed, 14 insertions, 13 deletions
diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp index f26cc35a2b..51e3c23eaa 100644 --- a/video/codecs/cdtoons.cpp +++ b/video/codecs/cdtoons.cpp @@ -54,7 +54,7 @@ CDToonsDecoder::CDToonsDecoder(uint16 width, uint16 height) { debugN(5, "CDToons: width %d, height %d\n", width, height); _surface = new Graphics::Surface(); - _surface->create(width, height, 1); + _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); _currentPaletteId = 0; memset(_palette, 0, 256 * 3); diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp index bc73b831fe..2a782dbafe 100644 --- a/video/codecs/cinepak.cpp +++ b/video/codecs/cinepak.cpp @@ -95,7 +95,7 @@ const Graphics::Surface *CinepakDecoder::decodeImage(Common::SeekableReadStream if (!_curFrame.surface) { _curFrame.surface = new Graphics::Surface(); - _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat.bytesPerPixel); + _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat); } // Reset the y variable. diff --git a/video/codecs/indeo3.cpp b/video/codecs/indeo3.cpp index c8f62d2452..b4f6c6ffe3 100644 --- a/video/codecs/indeo3.cpp +++ b/video/codecs/indeo3.cpp @@ -51,7 +51,7 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _correc _pixelFormat = g_system->getScreenFormat(); _surface = new Graphics::Surface; - _surface->create(width, height, _pixelFormat.bytesPerPixel); + _surface->create(width, height, _pixelFormat); buildModPred(); allocFrames(); @@ -322,10 +322,10 @@ const Graphics::Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream * const uint32 color = _pixelFormat.RGBToColor(r, g, b); - for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->bytesPerPixel) { - if (_surface->bytesPerPixel == 1) + for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->format.bytesPerPixel) { + if (_surface->format.bytesPerPixel == 1) *((uint8 *)rowDest) = (uint8)color; - else if (_surface->bytesPerPixel == 2) + else if (_surface->format.bytesPerPixel == 2) *((uint16 *)rowDest) = (uint16)color; } } diff --git a/video/codecs/mjpeg.cpp b/video/codecs/mjpeg.cpp index 2cef2b582b..2ef854039b 100644 --- a/video/codecs/mjpeg.cpp +++ b/video/codecs/mjpeg.cpp @@ -59,7 +59,7 @@ const Graphics::Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream* st if (!_surface) { _surface = new Graphics::Surface(); - _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat.bytesPerPixel); + _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat); } Graphics::Surface *frame = _jpeg->getSurface(_pixelFormat); diff --git a/video/codecs/msrle.cpp b/video/codecs/msrle.cpp index 48a17d2ac3..19309bc7aa 100644 --- a/video/codecs/msrle.cpp +++ b/video/codecs/msrle.cpp @@ -33,7 +33,7 @@ namespace Video { MSRLEDecoder::MSRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) { _surface = new Graphics::Surface(); - _surface->create(width, height, 1); + _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); _bitsPerPixel = bitsPerPixel; } diff --git a/video/codecs/msvideo1.cpp b/video/codecs/msvideo1.cpp index e173f45239..93e9aaae64 100644 --- a/video/codecs/msvideo1.cpp +++ b/video/codecs/msvideo1.cpp @@ -39,7 +39,8 @@ namespace Video { MSVideo1Decoder::MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() { _surface = new Graphics::Surface(); - _surface->create(width, height, (bitsPerPixel == 8) ? 1 : 2); + // TODO: Specify the correct pixel format for 2Bpp mode. + _surface->create(width, height, (bitsPerPixel == 8) ? Graphics::PixelFormat::createFormatCLUT8() : Graphics::PixelFormat(2, 0, 0, 0, 0, 0, 0, 0, 0)); _bitsPerPixel = bitsPerPixel; } diff --git a/video/codecs/qtrle.cpp b/video/codecs/qtrle.cpp index 19835aed78..0ae27f6284 100644 --- a/video/codecs/qtrle.cpp +++ b/video/codecs/qtrle.cpp @@ -50,7 +50,7 @@ QTRLEDecoder::QTRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) : Cod debug(2, "QTRLE corrected width: %d", width); _surface = new Graphics::Surface(); - _surface->create(width, height, _bitsPerPixel <= 8 ? 1 : _pixelFormat.bytesPerPixel); + _surface->create(width, height, _bitsPerPixel <= 8 ? Graphics::PixelFormat::createFormatCLUT8() : _pixelFormat); } #define CHECK_STREAM_PTR(n) \ diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp index bfea88b26f..0c06661c50 100644 --- a/video/codecs/rpza.cpp +++ b/video/codecs/rpza.cpp @@ -46,7 +46,7 @@ RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() { debug(2, "RPZA corrected width: %d", width); _surface = new Graphics::Surface(); - _surface->create(width, height, _pixelFormat.bytesPerPixel); + _surface->create(width, height, _pixelFormat); } RPZADecoder::~RPZADecoder() { diff --git a/video/codecs/smc.cpp b/video/codecs/smc.cpp index 745fdc0260..bbd6073497 100644 --- a/video/codecs/smc.cpp +++ b/video/codecs/smc.cpp @@ -50,7 +50,7 @@ namespace Video { SMCDecoder::SMCDecoder(uint16 width, uint16 height) { _surface = new Graphics::Surface(); - _surface->create(width, height, 1); + _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); } SMCDecoder::~SMCDecoder() { diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp index 577c72c133..70c456d4a8 100644 --- a/video/codecs/truemotion1.cpp +++ b/video/codecs/truemotion1.cpp @@ -94,7 +94,7 @@ TrueMotion1Decoder::TrueMotion1Decoder(uint16 width, uint16 height) { _width = width; _height = height; - _surface->create(width, height, 2); + _surface->create(width, height, getPixelFormat()); // there is a vertical predictor for each pixel in a line; each vertical // predictor is 0 to start with |