aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 16:29:11 +0200
committerJohannes Schickel2011-04-17 16:29:11 +0200
commit7b9b5681488f04a817d70812c18a8f1f88fbc931 (patch)
treeff5fab33dccfc7f2d92b2acbd2961a7234a19e86 /engines
parent6d1d31d0f95ab82872dd821131e0070473bd1aac (diff)
downloadscummvm-rg350-7b9b5681488f04a817d70812c18a8f1f88fbc931.tar.gz
scummvm-rg350-7b9b5681488f04a817d70812c18a8f1f88fbc931.tar.bz2
scummvm-rg350-7b9b5681488f04a817d70812c18a8f1f88fbc931.zip
M4: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
Diffstat (limited to 'engines')
-rw-r--r--engines/m4/dialogs.cpp2
-rw-r--r--engines/m4/graphics.cpp10
-rw-r--r--engines/m4/graphics.h6
3 files changed, 9 insertions, 9 deletions
diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp
index 7efbc523f8..0359be01ec 100644
--- a/engines/m4/dialogs.cpp
+++ b/engines/m4/dialogs.cpp
@@ -444,7 +444,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 a3eca13e1e..7b20d57bb8 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -96,7 +96,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);
}
@@ -110,7 +110,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);
@@ -760,7 +760,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);
@@ -813,7 +813,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);
@@ -854,7 +854,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..9f7180c387 100644
--- a/engines/m4/graphics.h
+++ b/engines/m4/graphics.h
@@ -105,13 +105,13 @@ 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;
@@ -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;
}