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 /engines/groovie | |
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 'engines/groovie')
-rw-r--r-- | engines/groovie/graphics.cpp | 4 | ||||
-rw-r--r-- | engines/groovie/roq.cpp | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 3eaadbe1c7..71ee231b80 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -36,8 +36,8 @@ namespace Groovie { GraphicsMan::GraphicsMan(GroovieEngine *vm) : _vm(vm), _changed(false), _fading(0) { // Create the game surfaces - _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel); - _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel); + _foreground.create(640, 320, _vm->_pixelFormat); + _background.create(640, 320, _vm->_pixelFormat); } GraphicsMan::~GraphicsMan() { diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 8b40fa8a1f..be9c4f6921 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -179,7 +179,7 @@ void ROQPlayer::buildShowBuf() { // Skip to the next pixel out += _vm->_pixelFormat.bytesPerPixel; if (!(x % _scaleX)) - in += _currBuf->bytesPerPixel; + in += _currBuf->format.bytesPerPixel; } #ifdef DITHER _dither->nextLine(); @@ -332,8 +332,13 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { _prevBuf->free(); // Allocate new buffers - _currBuf->create(width, height, 3); - _prevBuf->create(width, height, 3); + // These buffers use YUV data, since we can not describe it with a + // PixelFormat struct we just add some dummy PixelFormat with the + // correct bytes per pixel value. Since the surfaces are only used + // internally and no code assuming RGB data is present is used on + // them it should be just fine. + _currBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); + _prevBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); // Clear the buffers with black YUV values byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0); @@ -701,7 +706,7 @@ void ROQPlayer::copy(byte size, int destx, int desty, int offx, int offy) { for (int i = 0; i < size; i++) { // Copy the current line - memcpy(dst, src, size * _currBuf->bytesPerPixel); + memcpy(dst, src, size * _currBuf->format.bytesPerPixel); // Move to the beginning of the next line dst += _currBuf->pitch; |