From 23479d07f33e4f8548d32264fedd66d46dae43c1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 16:34:30 +0200 Subject: TSAGE: Prefer Surface::create taking a PixelFormat over the one taking a byte depth. --- engines/tsage/graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 77316d2d7d..53af06f456 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -257,7 +257,7 @@ void GfxSurface::create(int width, int height) { assert((width >= 0) && (height >= 0)); _screenSurface = false; _customSurface = new Graphics::Surface(); - _customSurface->create(width, height, 1); + _customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); _bounds = Rect(0, 0, width, height); } @@ -331,7 +331,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) { if (_customSurface) { // Surface owns the internal data, so replicate it so new surface owns it's own _customSurface = new Graphics::Surface(); - _customSurface->create(s._customSurface->w, s._customSurface->h, 1); + _customSurface->create(s._customSurface->w, s._customSurface->h, Graphics::PixelFormat::createFormatCLUT8()); const byte *srcP = (const byte *)s._customSurface->getBasePtr(0, 0); byte *destP = (byte *)_customSurface->getBasePtr(0, 0); -- cgit v1.2.3 From 9bc39fc761d58f3b932a682369bc68d7706ade02 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 17:29:59 +0200 Subject: TSAGE: Properly setup the pixel format in GfxSurface::lockSurface. --- engines/tsage/graphics.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/tsage') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 53af06f456..c4520704a4 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -283,6 +283,7 @@ Graphics::Surface GfxSurface::lockSurface() { result.h = _bounds.height(); result.pitch = src->pitch; result.bytesPerPixel = src->bytesPerPixel; + result.format = src->format; result.pixels = src->getBasePtr(_bounds.left, _bounds.top); return result; -- cgit v1.2.3 From da734a4af024a72ee155bc25d6e45f994de6b060 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 21:27:34 +0200 Subject: ALL/GRAPHICS: Remove Surface::bytesPerPixel. --- engines/tsage/graphics.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index c4520704a4..51db2febf9 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -282,7 +282,6 @@ Graphics::Surface GfxSurface::lockSurface() { result.w = _bounds.width(); result.h = _bounds.height(); result.pitch = src->pitch; - result.bytesPerPixel = src->bytesPerPixel; result.format = src->format; result.pixels = src->getBasePtr(_bounds.left, _bounds.top); -- cgit v1.2.3