[Scummvm-git-logs] scummvm master -> cd12494ce751058e19d3b50f7ce6276801fa0d80

OMGPizzaGuy noreply at scummvm.org
Fri Nov 18 02:51:20 UTC 2022


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
20665ff65c ULTIMA8: Remove draggable items from minimap rendering
cd12494ce7 ULTIMA8: Update render surface blit methods to use rect and pass by reference


Commit: 20665ff65cbf0ea51d0668fd6a3ed97a90c04f3c
    https://github.com/scummvm/scummvm/commit/20665ff65cbf0ea51d0668fd6a3ed97a90c04f3c
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-11-17T20:43:58-06:00

Commit Message:
ULTIMA8: Remove draggable items from minimap rendering

Changed paths:
    engines/ultima/ultima8/gumps/minimap_gump.cpp


diff --git a/engines/ultima/ultima8/gumps/minimap_gump.cpp b/engines/ultima/ultima8/gumps/minimap_gump.cpp
index 11296968598..c3a99e829d9 100644
--- a/engines/ultima/ultima8/gumps/minimap_gump.cpp
+++ b/engines/ultima/ultima8/gumps/minimap_gump.cpp
@@ -181,26 +181,32 @@ uint32 MiniMapGump::sampleAtPoint(const Item *item, int x, int y)
 	if (!pal)
 		return 0;
 
+	if (item->canDrag())
+		return 0;
+
 	// Screenspace bounding box bottom x_ coord (RNB x_ coord)
 	int sx = (ix - iy) / 4;
 	// Screenspace bounding box bottom extent  (RNB y_ coord)
 	int sy = (ix + iy) / 8 + idz;
 
+	int w = 2;
+	int h = 2;
+
 	// Ensure sample is in bounds of frame
 	if (frame->_xoff - sx < 0)
 		sx = frame->_xoff;
-	else if (frame->_xoff - sx >= frame->_width - 2)
-		sx = frame->_xoff - frame->_width + 2;
+	else if (frame->_xoff - sx >= frame->_width - w)
+		sx = frame->_xoff - frame->_width + w;
 
 	if (frame->_yoff - sy < 0)
 		sy = frame->_yoff;
-	else if (frame->_yoff - sy >= frame->_height - 2)
-		sy = frame->_yoff - frame->_height + 2;
+	else if (frame->_yoff - sy >= frame->_height - h)
+		sy = frame->_yoff - frame->_height + h;
 
 	uint16 r = 0, g = 0, b = 0, c = 0;
 
-	for (int j = 0; j < 2; j++) {
-		for (int i = 0; i < 2; i++) {
+	for (int j = 0; j < w; j++) {
+		for (int i = 0; i < h; i++) {
 			if (!frame->hasPoint(i - sx, j - sy)) continue;
 
 			byte r2, g2, b2;


Commit: cd12494ce751058e19d3b50f7ce6276801fa0d80
    https://github.com/scummvm/scummvm/commit/cd12494ce751058e19d3b50f7ce6276801fa0d80
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-11-17T20:43:58-06:00

Commit Message:
ULTIMA8: Update render surface blit methods to use rect and pass by reference

Changed paths:
    engines/ultima/ultima8/graphics/avi_player.cpp
    engines/ultima/ultima8/graphics/fonts/ttf_rendered_text.cpp
    engines/ultima/ultima8/graphics/render_surface.h
    engines/ultima/ultima8/graphics/skf_player.cpp
    engines/ultima/ultima8/graphics/soft_render_surface.cpp
    engines/ultima/ultima8/graphics/soft_render_surface.h
    engines/ultima/ultima8/gumps/credits_gump.cpp
    engines/ultima/ultima8/gumps/cru_credits_gump.cpp
    engines/ultima/ultima8/gumps/cru_demo_gump.cpp
    engines/ultima/ultima8/gumps/inverter_gump.cpp
    engines/ultima/ultima8/gumps/minimap_gump.cpp


diff --git a/engines/ultima/ultima8/graphics/avi_player.cpp b/engines/ultima/ultima8/graphics/avi_player.cpp
index ef25ac674c9..a1e7f0a9e4e 100644
--- a/engines/ultima/ultima8/graphics/avi_player.cpp
+++ b/engines/ultima/ultima8/graphics/avi_player.cpp
@@ -117,8 +117,8 @@ void AVIPlayer::paint(RenderSurface *surf, int /*lerp*/) {
 	}
 
 	surf->Fill32(0, _xoff, _yoff, _currentFrame.w, _currentFrame.h);
-	surf->Blit(&_currentFrame, 0, 0, _currentFrame.w, _currentFrame.h,
-			_xoff, _yoff);
+	Common::Rect srcRect(_currentFrame.w, _currentFrame.h);
+	surf->Blit(_currentFrame, srcRect, _xoff, _yoff);
 }
 
 void AVIPlayer::run() {
diff --git a/engines/ultima/ultima8/graphics/fonts/ttf_rendered_text.cpp b/engines/ultima/ultima8/graphics/fonts/ttf_rendered_text.cpp
index 9adce92477c..1fb02b4b156 100644
--- a/engines/ultima/ultima8/graphics/fonts/ttf_rendered_text.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/ttf_rendered_text.cpp
@@ -41,22 +41,20 @@ TTFRenderedText::~TTFRenderedText() {
 void TTFRenderedText::draw(RenderSurface *surface, int x, int y, bool destmasked) {
 	if (!_width)
 		return;
+	Common::Rect srcRect(_width, _height);
 	if (!destmasked)
-		surface->Blit(_texture, 0, 0, _width, _height, x, y - _baseline,
-			_antiAliased);
+		surface->Blit(*_texture, srcRect, x, y - _baseline, _antiAliased);
 	else
-		surface->MaskedBlit(_texture, 0, 0, _width, _height,
-			x, y - _baseline, 0, _antiAliased);
+		surface->MaskedBlit(*_texture, srcRect, x, y - _baseline, 0, _antiAliased);
 }
 
 void TTFRenderedText::drawBlended(RenderSurface *surface, int x, int y,
 		uint32 col, bool destmasked) {
+	Common::Rect srcRect(_width, _height);
 	if (!destmasked)
-		surface->FadedBlit(_texture, 0, 0, _width, _height,
-			x, y - _baseline, col, _antiAliased);
+		surface->FadedBlit(*_texture, srcRect, x, y - _baseline, col, _antiAliased);
 	else
-		surface->MaskedBlit(_texture, 0, 0, _width, _height,
-			x, y - _baseline, col, _antiAliased);
+		surface->MaskedBlit(*_texture, srcRect, x, y - _baseline, col, _antiAliased);
 }
 
 } // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/graphics/render_surface.h b/engines/ultima/ultima8/graphics/render_surface.h
index f1c15006f62..dfde77fe4a4 100644
--- a/engines/ultima/ultima8/graphics/render_surface.h
+++ b/engines/ultima/ultima8/graphics/render_surface.h
@@ -198,13 +198,13 @@ public:
 	//
 
 	//! Blit a region from a Texture (Alpha == 0 -> skipped)
-	virtual void Blit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend = false) = 0;
+	virtual void Blit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, bool alpha_blend = false) = 0;
 
 	//! Blit a region from a Texture with a Colour blend (AlphaTex == 0 -> skipped. AlphaCol32 -> Blend Factors)
-	virtual void FadedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) = 0;
+	virtual void FadedBlit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) = 0;
 
 	//! Blit a region from a Texture with a Colour blend masked based on DestAlpha (AlphaTex == 0 || AlphaDest == 0 -> skipped. AlphaCol32 -> Blend Factors)
-	virtual void MaskedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) = 0;
+	virtual void MaskedBlit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) = 0;
 
 };
 
diff --git a/engines/ultima/ultima8/graphics/skf_player.cpp b/engines/ultima/ultima8/graphics/skf_player.cpp
index f7a85356dee..5413dde35dd 100644
--- a/engines/ultima/ultima8/graphics/skf_player.cpp
+++ b/engines/ultima/ultima8/graphics/skf_player.cpp
@@ -125,13 +125,15 @@ void SKFPlayer::paint(RenderSurface *surf, int /*lerp*/) {
 	if (!_buffer) return;
 
 	if (!_fadeLevel) {
-		surf->Blit(_buffer->getRawSurface(), 0, 0, _width, _height, 0, 0);
+		Common::Rect srcRect(_width, _height);
+		surf->Blit(*_buffer->getRawSurface(), srcRect, 0, 0);
 		if (_subs)
 			_subs->draw(surf, 60, _subtitleY);
 	} else {
 		uint32 fade = TEX32_PACK_RGBA(_fadeColour, _fadeColour, _fadeColour,
 		                              (_fadeLevel * 255) / FADESTEPS);
-		surf->FadedBlit(_buffer->getRawSurface(), 0, 0, _width, _height, 0, 0, fade);
+		Common::Rect srcRect(_width, _height);
+		surf->FadedBlit(*_buffer->getRawSurface(), srcRect, 0, 0, fade);
 		if (_subs)
 			_subs->drawBlended(surf, 60, _subtitleY, fade);
 	}
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.cpp b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
index cfc1de83036..78f48136166 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
@@ -230,35 +230,36 @@ template<class uintX> void SoftRenderSurface<uintX>::DrawLine32(uint32 rgb, int3
 
 
 //
-// SoftRenderSurface::Blit(Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend)
+// SoftRenderSurface::Blit(Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, bool alpha_blend)
 //
 // Desc: Blit a region from a Texture (Alpha == 0 -> skipped)
 //
-template<class uintX> void SoftRenderSurface<uintX>::Blit(const Graphics::ManagedSurface *tex, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend) {
-	Common::Rect srect = Common::Rect(sx, sy, sx + w, sy + h);
+template<class uintX> void SoftRenderSurface<uintX>::Blit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, bool alpha_blend) {
 	Common::Point dpoint = Common::Point(_ox + dx, _oy + dy);
 	if (alpha_blend) {
-		_surface->transBlitFrom(*tex, srect, dpoint);
+		_surface->transBlitFrom(src, srcRect, dpoint);
 	}
 	else {
-		_surface->blitFrom(*tex, srect, dpoint);
+		_surface->blitFrom(src, srcRect, dpoint);
 	}
 }
 
 
 //
-// void SoftRenderSurface::FadedBlit(Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32)
+// void SoftRenderSurface::FadedBlit(Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32)
 //
 // Desc: Blit a region from a Texture (Alpha == 0 -> skipped)
 //
-template<class uintX> void SoftRenderSurface<uintX>::FadedBlit(const Graphics::ManagedSurface *tex, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend) {
+template<class uintX> void SoftRenderSurface<uintX>::FadedBlit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend) {
+	int32 w = srcRect.width();
+	int32 h = srcRect.height();
 
 	// Clamp or wrap or return?
-	if (w > static_cast<int32>(tex->w))
+	if (w > static_cast<int32>(src.w))
 		return;
 
 	// Clamp or wrap or return?
-	if (h > static_cast<int32>(tex->h))
+	if (h > static_cast<int32>(src.h))
 		return;
 
 	// Clip to window
@@ -273,6 +274,9 @@ template<class uintX> void SoftRenderSurface<uintX>::FadedBlit(const Graphics::M
 
 	if (!w || !h) return;
 
+	int32 sx = srcRect.left;
+	int32 sy = srcRect.top;
+
 	// Adjust source x and y
 	if (px != dx) sx += dx - px;
 	if (py != dy) sy += dy - py;
@@ -288,11 +292,11 @@ template<class uintX> void SoftRenderSurface<uintX>::FadedBlit(const Graphics::M
 	uint32 g = (TEX32_G(col32) * a);
 	uint32 b = (TEX32_B(col32) * a);
 
-	const Graphics::PixelFormat &texformat = tex->rawSurface().format;
+	const Graphics::PixelFormat &texformat = src.rawSurface().format;
 
 	if (texformat.bpp() == 32) {
-		const uint32 *texel = static_cast<const uint32 *>(tex->getBasePtr(sx, sy));
-		int tex_diff = tex->w - w;
+		const uint32 *texel = static_cast<const uint32 *>(src.getBasePtr(sx, sy));
+		int tex_diff = src.w - w;
 
 		while (pixel != end) {
 			if (!alpha_blend) while (pixel != line_end) {
@@ -343,8 +347,8 @@ template<class uintX> void SoftRenderSurface<uintX>::FadedBlit(const Graphics::M
 			texel += tex_diff;
 		}
 	} else if (texformat == *_format) {
-		const uintX *texel = reinterpret_cast<const uintX *>(tex->getBasePtr(sx, sy));
-		int tex_diff = tex->w - w;
+		const uintX *texel = reinterpret_cast<const uintX *>(src.getBasePtr(sx, sy));
+		int tex_diff = src.w - w;
 
 		while (pixel != end) {
 			while (pixel != line_end) {
@@ -368,18 +372,21 @@ template<class uintX> void SoftRenderSurface<uintX>::FadedBlit(const Graphics::M
 
 
 //
-// void SoftRenderSurface::MaskedBlit(Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend=false)
+// void SoftRenderSurface::MaskedBlit(Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend=false)
 //
 // Desc Blit a region from a Texture with a Colour blend masked based on DestAlpha (AlphaTex == 0 || AlphaDest == 0 -> skipped. AlphaCol32 -> Blend Factors)
 //
 //
-template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(const Graphics::ManagedSurface *tex, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend) {
+template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend) {
+	int32 w = srcRect.width();
+	int32 h = srcRect.height();
+
 	// Clamp or wrap or return?
-	if (w > static_cast<int32>(tex->w))
+	if (w > static_cast<int32>(src.w))
 		return;
 
 	// Clamp or wrap or return?
-	if (h > static_cast<int32>(tex->h))
+	if (h > static_cast<int32>(src.h))
 		return;
 
 	// Clip to window
@@ -395,6 +402,9 @@ template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(const Graphics::
 	if (!w || !h)
 		return;
 
+	int32 sx = srcRect.left;
+	int32 sy = srcRect.top;
+
 	// Adjust source x and y
 	if (px != dx) sx += dx - px;
 	if (py != dy) sy += dy - py;
@@ -410,11 +420,11 @@ template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(const Graphics::
 	uint32 g = (TEX32_G(col32) * a);
 	uint32 b = (TEX32_B(col32) * a);
 
-	int texbpp = tex->rawSurface().format.bpp();
+	int texbpp = src.rawSurface().format.bpp();
 
 	if (texbpp == 32) {
-		const uint32 *texel = static_cast<const uint32 *>(tex->getBasePtr(sx, sy));
-		int tex_diff = tex->w - w;
+		const uint32 *texel = static_cast<const uint32 *>(src.getBasePtr(sx, sy));
+		int tex_diff = src.w - w;
 
 		while (pixel != end) {
 			if (!alpha_blend) {
@@ -474,8 +484,8 @@ template<class uintX> void SoftRenderSurface<uintX>::MaskedBlit(const Graphics::
 			texel += tex_diff;
 		}
 	} else if (texbpp == _format->bpp()) {
-		const uintX *texel = reinterpret_cast<const uintX *>(tex->getBasePtr(sx, sy));
-		int tex_diff = tex->w - w;
+		const uintX *texel = reinterpret_cast<const uintX *>(src.getBasePtr(sx, sy));
+		int tex_diff = src.w - w;
 
 		while (pixel != end) {
 			while (pixel != line_end) {
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.h b/engines/ultima/ultima8/graphics/soft_render_surface.h
index 32d436d06d0..79e3981fe1f 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.h
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.h
@@ -98,13 +98,13 @@ public:
 	//
 
 	// Blit a region from a Texture (Alpha == 0 -> skipped)
-	void Blit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend = false) override;
+	void Blit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, bool alpha_blend = false) override;
 
 	// Blit a region from a Texture with a Colour blend (AlphaTex == 0 -> skipped. AlphaCol32 -> Blend Factors)
-	void FadedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) override;
+	void FadedBlit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) override;
 
 	// Blit a region from a Texture with a Colour blend masked based on DestAlpha (AlphaTex == 0 || AlphaDest == 0 -> skipped. AlphaCol32 -> Blend Factors)
-	void MaskedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) override;
+	void MaskedBlit(const Graphics::ManagedSurface &src, const Common::Rect &srcRect, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) override;
 };
 
 } // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/gumps/credits_gump.cpp b/engines/ultima/ultima8/gumps/credits_gump.cpp
index f1f1d62d717..7511a1807d7 100644
--- a/engines/ultima/ultima8/gumps/credits_gump.cpp
+++ b/engines/ultima/ultima8/gumps/credits_gump.cpp
@@ -356,7 +356,8 @@ void CreditsGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
 	if (h > 156) h = 156;
 	if (h > 0) {
 		Graphics::ManagedSurface* ms = _scroll[_currentSurface]->getRawSurface();
-		surf->Blit(ms, 0, _currentY, ms->getBounds().width(), h, 32, 44);
+		Common::Rect srcRect(0, _currentY, ms->w, _currentY + h);
+		surf->Blit(*ms, srcRect, 32, 44);
 	}
 
 	int y = h;
@@ -368,7 +369,8 @@ void CreditsGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
 		if (h > 156 - y) h = 156 - y;
 		if (h > 0) {
 			Graphics::ManagedSurface* ms = _scroll[s]->getRawSurface();
-			surf->Blit(ms, 0, 0, ms->getBounds().width(), h, 32, 44 + y);
+			Common::Rect srcRect(0, 0, ms->w, h);
+			surf->Blit(*ms, srcRect, 32, 44 + y);
 		}
 		y += h;
 	}
diff --git a/engines/ultima/ultima8/gumps/cru_credits_gump.cpp b/engines/ultima/ultima8/gumps/cru_credits_gump.cpp
index ea1ee58292c..eea0874fddc 100644
--- a/engines/ultima/ultima8/gumps/cru_credits_gump.cpp
+++ b/engines/ultima/ultima8/gumps/cru_credits_gump.cpp
@@ -57,9 +57,10 @@ CruCreditsGump::CruCreditsGump(Common::SeekableReadStream *txtrs,
 	if (decoder.loadStream(*bmprs)) {
 		// This does an extra copy via the ManagedSurface, but it's a once-off.
 		const Graphics::Surface *bmpsurf = decoder.getSurface();
-		Graphics::ManagedSurface *ms = new Graphics::ManagedSurface(bmpsurf);
-		ms->setPalette(decoder.getPalette(), decoder.getPaletteStartIndex(), decoder.getPaletteColorCount());
-		_background->Blit(ms, 0, 0, 640, 480, 0, 0);
+		Graphics::ManagedSurface ms(bmpsurf);
+		ms.setPalette(decoder.getPalette(), decoder.getPaletteStartIndex(), decoder.getPaletteColorCount());
+		Common::Rect srcRect(640, 480);
+		_background->Blit(ms, srcRect, 0, 0);
 	} else {
 		warning("couldn't load bitmap background for credits.");
 	}
@@ -184,7 +185,8 @@ void CruCreditsGump::run() {
 }
 
 void CruCreditsGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled) {
-	surf->Blit(_background->getRawSurface(), 0, 0, 640, 480, 0, 0);
+	Common::Rect srcRect(640, 480);
+	surf->Blit(*_background->getRawSurface(), srcRect, 0, 0);
 
 	unsigned int nlines = _currentLines.size();
 	if (!nlines)
diff --git a/engines/ultima/ultima8/gumps/cru_demo_gump.cpp b/engines/ultima/ultima8/gumps/cru_demo_gump.cpp
index 730d84cb554..f8e9cdc475a 100644
--- a/engines/ultima/ultima8/gumps/cru_demo_gump.cpp
+++ b/engines/ultima/ultima8/gumps/cru_demo_gump.cpp
@@ -48,9 +48,10 @@ CruDemoGump::CruDemoGump(Common::SeekableReadStream *bmprs, uint32 flags, int32
 	if (decoder.loadStream(*bmprs)) {
 		// This does an extra copy via the ManagedSurface, but it's a once-off.
 		const Graphics::Surface *bmpsurf = decoder.getSurface();
-		Graphics::ManagedSurface *ms = new Graphics::ManagedSurface(bmpsurf);
-		ms->setPalette(decoder.getPalette(), decoder.getPaletteStartIndex(), decoder.getPaletteColorCount());
-		_background->Blit(ms, 0, 0, 640, 480, 0, 0);
+		Graphics::ManagedSurface ms(bmpsurf);
+		ms.setPalette(decoder.getPalette(), decoder.getPaletteStartIndex(), decoder.getPaletteColorCount());
+		Common::Rect srcRect(640, 480);
+		_background->Blit(ms, srcRect, 0, 0);
 	} else {
 		warning("couldn't load bitmap background for demo screen.");
 	}
@@ -88,7 +89,8 @@ void CruDemoGump::Close(bool no_del) {
 }
 
 void CruDemoGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled) {
-	surf->Blit(_background->getRawSurface(), 0, 0, 640, 480, 0, 0);
+	Common::Rect srcRect(640, 480);
+	surf->Blit(*_background->getRawSurface(), srcRect, 0, 0);
 }
 
 bool CruDemoGump::OnKeyDown(int key, int mod) {
diff --git a/engines/ultima/ultima8/gumps/inverter_gump.cpp b/engines/ultima/ultima8/gumps/inverter_gump.cpp
index 3b85d34d2a8..e49e8b726cf 100644
--- a/engines/ultima/ultima8/gumps/inverter_gump.cpp
+++ b/engines/ultima/ultima8/gumps/inverter_gump.cpp
@@ -104,8 +104,8 @@ void InverterGump::PaintChildren(RenderSurface *surf, int32 lerp_factor, bool sc
 
 	for (int i = 0; i < height; ++i) {
 		int src = getLine(getIndex(i, height / 2) + t, height / 2);
-//		pout << src << " -> " << i << Std::endl;
-		surf->Blit(_buffer->getRawSurface(), 0, src, width, 1, 0, i);
+		Common::Rect srcRect(0, src, width, src + 1);
+		surf->Blit(*_buffer->getRawSurface(), srcRect, 0, i);
 	}
 }
 
diff --git a/engines/ultima/ultima8/gumps/minimap_gump.cpp b/engines/ultima/ultima8/gumps/minimap_gump.cpp
index c3a99e829d9..cb8fee61fa6 100644
--- a/engines/ultima/ultima8/gumps/minimap_gump.cpp
+++ b/engines/ultima/ultima8/gumps/minimap_gump.cpp
@@ -131,7 +131,8 @@ void MiniMapGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
 		ly = (sy + dims.height()) - _minimap.h;
 	}
 
-	surf->Blit(&_minimap, sx + ox, sy + oy, dims.width() - (ox + lx), dims.height() - (oy + ly), 1 + ox, 1 + oy);
+	Common::Rect srcRect(sx + ox, sy + oy, sx - lx + dims.width(), sy - ly + dims.height());
+	surf->Blit(_minimap, srcRect, 1 + ox, 1 + oy);
 
 	// Paint the avatar position marker
 	surf->Fill32(0xFFFFFF00, 1 + ax - 2, 1 + ay + 0, 2, 1);




More information about the Scummvm-git-logs mailing list