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/m4 | |
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/m4')
-rw-r--r-- | engines/m4/dialogs.cpp | 2 | ||||
-rw-r--r-- | engines/m4/graphics.cpp | 10 | ||||
-rw-r--r-- | engines/m4/graphics.h | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index 0583d5f749..bc6228658d 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -445,7 +445,7 @@ void Dialog::draw() { int dialogY = (_vm->_screen->height() - dlgHeight) / 2; // Create the surface for the dialog - create(dlgWidth, dlgHeight, 1); + create(dlgWidth, dlgHeight, Graphics::PixelFormat::createFormatCLUT8()); _coords.left = dialogX; _coords.top = dialogY; _coords.right = dialogX + dlgWidth + 1; diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index a685b36a18..689a6ab8b4 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -97,7 +97,7 @@ void M4Surface::loadCodesM4(Common::SeekableReadStream *source) { uint16 widthVal = source->readUint16LE(); uint16 heightVal = source->readUint16LE(); - create(widthVal, heightVal, 1); + create(widthVal, heightVal, Graphics::PixelFormat::createFormatCLUT8()); source->read(pixels, widthVal * heightVal); } @@ -111,7 +111,7 @@ void M4Surface::loadCodesMads(Common::SeekableReadStream *source) { uint16 heightVal = 156; byte *walkMap = new byte[source->size()]; - create(widthVal, heightVal, 1); + create(widthVal, heightVal, Graphics::PixelFormat::createFormatCLUT8()); source->read(walkMap, source->size()); byte *ptr = (byte *)getBasePtr(0, 0); @@ -761,7 +761,7 @@ void M4Surface::rexLoadBackground(Common::SeekableReadStream *source, RGBList ** sourceUnc = packData.getItemStream(1); assert((int)sourceUnc->size() >= sceneSize); - create(sceneWidth, sceneHeight, 1); + create(sceneWidth, sceneHeight, Graphics::PixelFormat::createFormatCLUT8()); byte *pData = (byte *)pixels; sourceUnc->read(pData, sceneSize); @@ -814,7 +814,7 @@ void M4Surface::m4LoadBackground(Common::SeekableReadStream *source) { assert(width() == (int)widthVal); //debugCN(kDebugGraphics, "width(): %d, widthVal: %d, height(): %d, heightVal: %d\n", width(), widthVal, height(), heightVal); - tileBuffer->create(tileWidth, tileHeight, 1); + tileBuffer->create(tileWidth, tileHeight, Graphics::PixelFormat::createFormatCLUT8()); for (curTileY = 0; curTileY < tilesY; curTileY++) { clipY = MIN(heightVal, (1 + curTileY) * tileHeight) - (curTileY * tileHeight); @@ -855,7 +855,7 @@ void M4Surface::madsLoadInterface(const Common::String &filename) { // Chunk 1, data intStream = intFile.getItemStream(1); - create(320, 44, 1); + create(320, 44, Graphics::PixelFormat::createFormatCLUT8()); intStream->read(pixels, 320 * 44); delete intStream; diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h index dbf6fac8c8..96e81f746e 100644 --- a/engines/m4/graphics.h +++ b/engines/m4/graphics.h @@ -105,19 +105,19 @@ private: void m4LoadBackground(Common::SeekableReadStream *source); public: M4Surface(bool isScreen = false) { - create(g_system->getWidth(), isScreen ? g_system->getHeight() : MADS_SURFACE_HEIGHT, 1); + create(g_system->getWidth(), isScreen ? g_system->getHeight() : MADS_SURFACE_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); _isScreen = isScreen; _rgbList = NULL; _ownsData = true; } M4Surface(int width_, int height_) { - create(width_, height_, 1); + create(width_, height_, Graphics::PixelFormat::createFormatCLUT8()); _isScreen = false; _rgbList = NULL; _ownsData = true; } M4Surface(int width_, int height_, byte *srcPixels, int pitch_) { - bytesPerPixel = 1; + format = Graphics::PixelFormat::createFormatCLUT8(); w = width_; h = height_; pitch = pitch_; @@ -157,7 +157,7 @@ public: inline int width() const { return w; } inline int height() const { return h; } inline int getPitch() const { return pitch; } - void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, 1); } + void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, Graphics::PixelFormat::createFormatCLUT8()); } inline byte *getBasePtr() { return (byte *)pixels; } |