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

OMGPizzaGuy noreply at scummvm.org
Wed Sep 17 02:54:13 UTC 2025


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

Summary:
f58e27f8fe ULTIMA8: Return rects by value instead of out parameter


Commit: f58e27f8fecef881c4fa2970f0ff5827f5278891
    https://github.com/scummvm/scummvm/commit/f58e27f8fecef881c4fa2970f0ff5827f5278891
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2025-09-16T21:53:34-05:00

Commit Message:
ULTIMA8: Return rects by value instead of out parameter

Changed paths:
    engines/ultima/ultima8/gfx/render_surface.cpp
    engines/ultima/ultima8/gfx/render_surface.h
    engines/ultima/ultima8/gumps/ask_gump.cpp
    engines/ultima/ultima8/gumps/bark_gump.cpp
    engines/ultima/ultima8/gumps/credits_gump.cpp
    engines/ultima/ultima8/gumps/desktop_gump.cpp
    engines/ultima/ultima8/gumps/game_map_gump.cpp
    engines/ultima/ultima8/gumps/gump.cpp
    engines/ultima/ultima8/gumps/gump.h
    engines/ultima/ultima8/gumps/item_relative_gump.cpp
    engines/ultima/ultima8/gumps/menu_gump.cpp
    engines/ultima/ultima8/gumps/movie_gump.cpp
    engines/ultima/ultima8/gumps/paperdoll_gump.cpp
    engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
    engines/ultima/ultima8/gumps/u8_save_gump.cpp
    engines/ultima/ultima8/gumps/weasel_gump.cpp
    engines/ultima/ultima8/gumps/widgets/button_widget.cpp
    engines/ultima/ultima8/kernel/mouse.cpp
    engines/ultima/ultima8/ultima8.cpp
    engines/ultima/ultima8/world/current_map.cpp
    engines/ultima/ultima8/world/item.cpp


diff --git a/engines/ultima/ultima8/gfx/render_surface.cpp b/engines/ultima/ultima8/gfx/render_surface.cpp
index e311166e260..baa70a19672 100644
--- a/engines/ultima/ultima8/gfx/render_surface.cpp
+++ b/engines/ultima/ultima8/gfx/render_surface.cpp
@@ -120,15 +120,17 @@ bool RenderSurface::EndPainting() {
 }
 
 //
-// void RenderSurface::GetSurfaceDims(Rect &r)
+// Common::Rect32 RenderSurface::GetSurfaceDims()
 //
 // Desc: Get the Surface Dimensions (and logical origin)
 // r: Rect object to fill
 //
-void RenderSurface::GetSurfaceDims(Common::Rect32 &r) const {
+Common::Rect32 RenderSurface::getSurfaceDims() const {
+	Common::Rect32 r;
 	r.moveTo(_ox, _oy);
 	r.setWidth(_surface->w);
 	r.setHeight(_surface->h);
+	return r;
 }
 
 //
@@ -160,22 +162,22 @@ void RenderSurface::GetOrigin(int32 &x, int32 &y) const {
 }
 
 //
-// void RenderSurface::GetClippingRect(Rect &r)
+// Common::Rect32 RenderSurface::getClippingRect()
 //
 // Desc: Get the Clipping Rectangle
 // r: Rect object to fill
 //
-void RenderSurface::GetClippingRect(Common::Rect32 &r) const {
-	r = Common::Rect32(_clipWindow.left, _clipWindow.top, _clipWindow.right, _clipWindow.bottom);
+Common::Rect32 RenderSurface::getClippingRect() const {
+	return Common::Rect32(_clipWindow.left, _clipWindow.top, _clipWindow.right, _clipWindow.bottom);
 }
 
 //
-// void RenderSurface::GetClippingRect(Rect &r)
+// void RenderSurface::setClippingRect(const Common::Rect32 &r)
 //
 // Desc: Set the Clipping Rectangle
 // r: Rect object that contains new Clipping Rectangle
 //
-void RenderSurface::SetClippingRect(const Common::Rect32 &r) {
+void RenderSurface::setClippingRect(const Common::Rect32 &r) {
 	// What we need to do is to clip the clipping rect to the phyiscal screen
 	_clipWindow = Common::Rect(r.left, r.top, r.right, r.bottom);
 	_clipWindow.clip(Common::Rect(-_ox, -_oy, -_ox + _surface->w, -_oy + _surface->h));
diff --git a/engines/ultima/ultima8/gfx/render_surface.h b/engines/ultima/ultima8/gfx/render_surface.h
index 8624c0e816c..5599092840a 100644
--- a/engines/ultima/ultima8/gfx/render_surface.h
+++ b/engines/ultima/ultima8/gfx/render_surface.h
@@ -90,13 +90,13 @@ public:
 	void GetOrigin(int32 &x, int32 &y) const;
 
 	//! Get the Surface Dimensions
-	void GetSurfaceDims(Common::Rect32 &) const;
+	Common::Rect32 getSurfaceDims() const;
 
 	//! Get Clipping Rectangle
-	void GetClippingRect(Common::Rect32 &) const;
+	Common::Rect32 getClippingRect() const;
 
 	//! Set Clipping Rectangle
-	void SetClippingRect(const Common::Rect32 &);
+	void setClippingRect(const Common::Rect32 &);
 
 	//! Flip the surface
 	void SetFlipped(bool flipped);
diff --git a/engines/ultima/ultima8/gumps/ask_gump.cpp b/engines/ultima/ultima8/gumps/ask_gump.cpp
index 78518afee5f..6e0cbe19ff3 100644
--- a/engines/ultima/ultima8/gumps/ask_gump.cpp
+++ b/engines/ultima/ultima8/gumps/ask_gump.cpp
@@ -65,8 +65,7 @@ void AskGump::InitGump(Gump *newparent, bool take_focus) {
 		child->InitGump(this);
 		child->SetIndex(i);
 
-		Common::Rect32 cd;
-		child->GetDims(cd);
+		Common::Rect32 cd = child->getDims();
 		if (i + 1 < _answers->getSize())
 			cd.setHeight(cd.height() + child->getVlead());
 
@@ -134,8 +133,7 @@ bool AskGump::loadData(Common::ReadStream *rs, uint32 version) {
 
 		if (!child) return false;
 
-		Common::Rect32 cd;
-		child->GetDims(cd);
+		Common::Rect32 cd = child->getDims();
 
 		if (px + cd.width() > 160 && px != 0) {
 			py = _dims.height();
diff --git a/engines/ultima/ultima8/gumps/bark_gump.cpp b/engines/ultima/ultima8/gumps/bark_gump.cpp
index 2e6b3b009fa..1aecc8a92a1 100644
--- a/engines/ultima/ultima8/gumps/bark_gump.cpp
+++ b/engines/ultima/ultima8/gumps/bark_gump.cpp
@@ -107,8 +107,7 @@ void BarkGump::InitGump(Gump *newparent, bool take_focus) {
 		}
 	}
 
-	Common::Rect32 d;
-	widget->GetDims(d);
+	Common::Rect32 d = widget->getDims();
 	_dims.setHeight(d.height());
 	_dims.setWidth(d.width());
 	_counter = calculateTicks();
@@ -130,8 +129,7 @@ bool BarkGump::NextText() {
 	TextWidget *widget = dynamic_cast<TextWidget *>(getGump(_textWidget));
 	assert(widget);
 	if (widget->setupNextText()) {
-		Common::Rect32 d;
-		widget->GetDims(d);
+		Common::Rect32 d = widget->getDims();
 		_dims.setHeight(d.height());
 		_dims.setWidth(d.width());
 		_counter = calculateTicks();
@@ -239,8 +237,7 @@ bool BarkGump::loadData(Common::ReadStream *rs, uint32 version) {
 	if (!widget)
 		return false;
 
-	Common::Rect32 d;
-	widget->GetDims(d);
+	Common::Rect32 d = widget->getDims();
 	_dims.setHeight(d.height());
 	_dims.setWidth(d.width());
 
diff --git a/engines/ultima/ultima8/gumps/credits_gump.cpp b/engines/ultima/ultima8/gumps/credits_gump.cpp
index b1df55d40bf..33f9d051cc6 100644
--- a/engines/ultima/ultima8/gumps/credits_gump.cpp
+++ b/engines/ultima/ultima8/gumps/credits_gump.cpp
@@ -180,8 +180,7 @@ void CreditsGump::run() {
 		if (nextblock == -1)
 			nextblock = 0;
 		// time to render next block
-		Common::Rect32 bounds;
-		_scroll[nextblock]->GetSurfaceDims(bounds);
+		Common::Rect32 bounds = _scroll[nextblock]->getSurfaceDims();
 
 		uint32 color = TEX32_PACK_RGB(0, 0, 0);
 		_scroll[nextblock]->fill32(color, 0, 0, bounds.width(), bounds.height());
diff --git a/engines/ultima/ultima8/gumps/desktop_gump.cpp b/engines/ultima/ultima8/gumps/desktop_gump.cpp
index b60a13e02ca..1868d45f86f 100644
--- a/engines/ultima/ultima8/gumps/desktop_gump.cpp
+++ b/engines/ultima/ultima8/gumps/desktop_gump.cpp
@@ -65,8 +65,7 @@ void DesktopGump::PaintChildren(RenderSurface *surf, int32 lerp_factor, bool sca
 void DesktopGump::RenderSurfaceChanged() {
 	// Resize the desktop gump to match the parent
 	if (_parent) {
-		Common::Rect32 new_dims;
-		_parent->GetDims(new_dims);
+		Common::Rect32 new_dims = _parent->getDims();
 		_dims.setWidth(new_dims.width());
 		_dims.setHeight(new_dims.height());
 	}
diff --git a/engines/ultima/ultima8/gumps/game_map_gump.cpp b/engines/ultima/ultima8/gumps/game_map_gump.cpp
index c89af23b448..3ab58472e95 100644
--- a/engines/ultima/ultima8/gumps/game_map_gump.cpp
+++ b/engines/ultima/ultima8/gumps/game_map_gump.cpp
@@ -105,8 +105,7 @@ void GameMapGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled)
 		zlimit = roof->getZ();
 	}
 
-	Common::Rect32 clipWindow;
-	surf->GetClippingRect(clipWindow);
+	Common::Rect32 clipWindow = surf->getClippingRect();
 	_displayList->BeginDisplayList(clipWindow, loc);
 
 	uint32 gametick = Kernel::get_instance()->getFrameNum();
@@ -601,8 +600,7 @@ void GameMapGump::DropItem(Item *item, int mx, int my) {
 
 void GameMapGump::RenderSurfaceChanged() {
 	// Resize the desktop gump to match the parent
-	Common::Rect32 new_dims;
-	_parent->GetDims(new_dims);
+	Common::Rect32 new_dims = _parent->getDims();
 	_dims.setWidth(new_dims.width());
 	_dims.setHeight(new_dims.height());
 
diff --git a/engines/ultima/ultima8/gumps/gump.cpp b/engines/ultima/ultima8/gumps/gump.cpp
index fc84be368f1..730a40c2248 100644
--- a/engines/ultima/ultima8/gumps/gump.cpp
+++ b/engines/ultima/ultima8/gumps/gump.cpp
@@ -228,13 +228,12 @@ void Gump::Paint(RenderSurface *surf, int32 lerp_factor, bool scaled) {
 	surf->SetOrigin(ox + nx, oy + ny);
 
 	// Get Old Clipping Rect
-	Common::Rect32 old_rect;
-	surf->GetClippingRect(old_rect);
+	Common::Rect32 old_rect = surf->getClippingRect();
 
 	// Set new clipping rect
-	Common::Rect32 new_rect = _dims;
+	Common::Rect32 new_rect(_dims);
 	new_rect.clip(old_rect);
-	surf->SetClippingRect(new_rect);
+	surf->setClippingRect(new_rect);
 
 	// Paint This
 	PaintThis(surf, lerp_factor, scaled);
@@ -243,7 +242,7 @@ void Gump::Paint(RenderSurface *surf, int32 lerp_factor, bool scaled) {
 	PaintChildren(surf, lerp_factor, scaled);
 
 	// Reset The Clipping Rect
-	surf->SetClippingRect(old_rect);
+	surf->setClippingRect(old_rect);
 
 	// Reset The Origin
 	surf->SetOrigin(ox, oy);
@@ -277,14 +276,13 @@ void Gump::PaintCompositing(RenderSurface *surf, int32 lerp_factor,
 	surf->SetOrigin(0, 0);
 
 	// Get Old Clipping Rect
-	Common::Rect32 old_rect;
-	surf->GetClippingRect(old_rect);
+	Common::Rect32 old_rect = surf->getClippingRect();
 
 	// Set new clipping rect
 	Common::Rect32 new_rect(_dims);
 	GumpRectToScreenSpace(new_rect, ROUND_OUTSIDE);
 	new_rect.clip(old_rect);
-	surf->SetClippingRect(new_rect);
+	surf->setClippingRect(new_rect);
 
 	// Iterate all children
 	Std::list<Gump *>::reverse_iterator it = _children.rbegin();
@@ -303,7 +301,7 @@ void Gump::PaintCompositing(RenderSurface *surf, int32 lerp_factor,
 	PaintComposited(surf, lerp_factor, sx, sy);
 
 	// Reset The Clipping Rect
-	surf->SetClippingRect(old_rect);
+	surf->setClippingRect(old_rect);
 
 	// Reset The Origin
 	surf->SetOrigin(ox, oy);
@@ -340,8 +338,7 @@ Gump *Gump::FindGump(int mx, int my) {
 
 void Gump::setRelativePosition(Gump::Position pos, int xoffset, int yoffset) {
 	if (_parent) {
-		Common::Rect32 rect;
-		_parent->GetDims(rect);
+		Common::Rect32 rect = _parent->getDims();
 
 		switch (pos) {
 		case CENTER:
diff --git a/engines/ultima/ultima8/gumps/gump.h b/engines/ultima/ultima8/gumps/gump.h
index 3fa05e91693..be17a408249 100644
--- a/engines/ultima/ultima8/gumps/gump.h
+++ b/engines/ultima/ultima8/gumps/gump.h
@@ -241,12 +241,12 @@ public:
 	//
 
 	//! Get the _dims
-	virtual void GetDims(Common::Rect32 &d) const {
-		d = _dims;
+	const Common::Rect32 &getDims() const {
+		return _dims;
 	}
 
 	//! Set the _dims
-	virtual void SetDims(const Common::Rect32 &d) {
+	void setDims(const Common::Rect32 &d) {
 		_dims = d;
 	}
 
diff --git a/engines/ultima/ultima8/gumps/item_relative_gump.cpp b/engines/ultima/ultima8/gumps/item_relative_gump.cpp
index f1fb66a36a5..424de9f00c9 100644
--- a/engines/ultima/ultima8/gumps/item_relative_gump.cpp
+++ b/engines/ultima/ultima8/gumps/item_relative_gump.cpp
@@ -51,8 +51,7 @@ void ItemRelativeGump::InitGump(Gump *newparent, bool take_focus) {
 
 void ItemRelativeGump::MoveOnScreen() {
 	assert(_parent);
-	Common::Rect32 sd;
-	_parent->GetDims(sd);
+	Common::Rect32 sd = _parent->getDims();
 
 	// first move back to our desired location
 	_x = 0;
@@ -148,8 +147,7 @@ void ItemRelativeGump::GetItemLocation(int32 lerp_factor) {
 		gy = gy - it->getShapeInfo()->_z * 8 - 16;
 	} else {
 		// If location not found show near bottom center
-		Common::Rect32 r;
-		gump->GetDims(r);
+		Common::Rect32 r = gump->getDims();
 		gx = (r.left + r.right) / 2;
 		gy = r.bottom - 8;
 	}
diff --git a/engines/ultima/ultima8/gumps/menu_gump.cpp b/engines/ultima/ultima8/gumps/menu_gump.cpp
index 9788325a404..462589d107e 100644
--- a/engines/ultima/ultima8/gumps/menu_gump.cpp
+++ b/engines/ultima/ultima8/gumps/menu_gump.cpp
@@ -151,10 +151,9 @@ void MenuGump::InitGump(Gump *newparent, bool take_focus) {
 			name = av->getName();
 
 		if (!name.empty()) {
-			Common::Rect32 rect;
 			Gump *widget = new TextWidget(0, 0, name, true, 6);
 			widget->InitGump(this, false);
-			widget->GetDims(rect);
+			Common::Rect32 rect = widget->getDims();
 			widget->Move(90 - rect.width() / 2, _dims.height() - 40);
 		}
 	} else {
@@ -163,8 +162,7 @@ void MenuGump::InitGump(Gump *newparent, bool take_focus) {
 		widget->InitGump(this, false);
 		widget->Move(_dims.width() / 2 + 6, 10);
 
-		Common::Rect32 textdims;
-		widget->GetDims(textdims);
+		Common::Rect32 textdims = widget->getDims();
 
 		widget = new EditWidget(0, 0, "", true, 6, 110, 40, 15); // CONSTANTS!
 		widget->InitGump(this, true);
diff --git a/engines/ultima/ultima8/gumps/movie_gump.cpp b/engines/ultima/ultima8/gumps/movie_gump.cpp
index d2c960dbfa6..515a2696b9f 100644
--- a/engines/ultima/ultima8/gumps/movie_gump.cpp
+++ b/engines/ultima/ultima8/gumps/movie_gump.cpp
@@ -200,11 +200,10 @@ void MovieGump::PaintThis(RenderSurface *surf, int32 lerp_factor, bool scaled) {
 		TextWidget *subtitle = dynamic_cast<TextWidget *>(getGump(_subtitleWidget));
 		if (subtitle) {
 			int32 x, y;
-			Common::Rect32 textdims;
-			Common::Rect32 screendims;
+			
 			subtitle->getLocation(x, y);
-			subtitle->GetDims(textdims);
-			surf->GetSurfaceDims(screendims);
+			Common::Rect32 textdims = subtitle->getDims();
+			Common::Rect32 screendims = surf->getSurfaceDims();
 			surf->fill32(TEX32_PACK_RGB(0, 0, 0),
 						 screendims.width() / 2 - 300 - screendims.left,
 						 y - 3,
diff --git a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
index 8807a40a1e1..45a30297489 100644
--- a/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
+++ b/engines/ultima/ultima8/gumps/paperdoll_gump.cpp
@@ -421,10 +421,8 @@ void PaperdollGump::ChildNotify(Gump *child, uint32 message) {
 			gump->setRelativePosition(BOTTOM_RIGHT, -5, -5);
 		} else {
 			// check if it is off-screen. If so, move it back
-			Common::Rect32 rect;
-			desktop->GetDims(rect);
-			Common::Rect32 sr;
-			statsgump->GetDims(sr);
+			Common::Rect32 rect = desktop->getDims();
+			Common::Rect32 sr = statsgump->getDims();
 			sr.grow(-2);
 			statsgump->GumpRectToScreenSpace(sr);
 			if (!sr.intersects(rect))
diff --git a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
index e52e5147bc2..cf603506053 100644
--- a/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
+++ b/engines/ultima/ultima8/gumps/shape_viewer_gump.cpp
@@ -378,8 +378,7 @@ void ShapeViewerGump::U8ShapeViewer() {
 	}
 
 	Gump *desktopGump = Ultima8Engine::get_instance()->getDesktopGump();
-	Common::Rect32 res;
-	desktopGump->GetDims(res);
+	Common::Rect32 res = desktopGump->getDims();
 
 	int xoff, yoff, width, height;
 
diff --git a/engines/ultima/ultima8/gumps/u8_save_gump.cpp b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
index 5a07328b307..08664fb11d0 100644
--- a/engines/ultima/ultima8/gumps/u8_save_gump.cpp
+++ b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
@@ -111,10 +111,9 @@ void U8SaveGump::InitGump(Gump *newparent, bool take_focus) {
 		if (index % 10 == 9) {
 			// HACK: There is no frame for '0', so we re-use part of the
 			// frame for '10', cutting off the first 6 pixels.
-			Common::Rect32 rect;
-			gump->GetDims(rect);
+			Common::Rect32 rect = gump->getDims();
 			rect.translate(6, 0);
-			gump->SetDims(rect);
+			gump->setDims(rect);
 		}
 		gump->InitGump(this, false);
 
diff --git a/engines/ultima/ultima8/gumps/weasel_gump.cpp b/engines/ultima/ultima8/gumps/weasel_gump.cpp
index 6268e396a0f..29162eb8041 100644
--- a/engines/ultima/ultima8/gumps/weasel_gump.cpp
+++ b/engines/ultima/ultima8/gumps/weasel_gump.cpp
@@ -142,7 +142,7 @@ void WeaselGump::InitGump(Gump *newparent, bool take_focus) {
 	}
 
 	_ui = new WeaselUIContainerGump();
-	_ui->SetDims(Common::Rect32(0, 0, mhFrame->_width,
+	_ui->setDims(Common::Rect32(0, 0, mhFrame->_width,
 					  tFrame->_height + mhFrame->_height + mlFrame->_height + bFrame->_height));
 	_ui->InitGump(this, false);
 	_ui->setRelativePosition(CENTER);
diff --git a/engines/ultima/ultima8/gumps/widgets/button_widget.cpp b/engines/ultima/ultima8/gumps/widgets/button_widget.cpp
index 568f498e756..fdfd56a357d 100644
--- a/engines/ultima/ultima8/gumps/widgets/button_widget.cpp
+++ b/engines/ultima/ultima8/gumps/widgets/button_widget.cpp
@@ -71,7 +71,7 @@ void ButtonWidget::InitGump(Gump *newparent, bool take_focus) {
 		Gump *widget = getGump(_textWidget);
 		assert(widget);
 		widget->InitGump(this);
-		widget->GetDims(_dims); // transfer child dimension to self
+		_dims = widget->getDims(); // transfer child dimension to self
 		widget->Move(0, _dims.top); // move it to the correct height
 	} else {
 		assert(_shapeUp != nullptr);
@@ -245,7 +245,7 @@ bool ButtonWidget::loadData(Common::ReadStream *rs, uint32 version) {
 	// HACK ALERT
 	if (_textWidget != 0) {
 		Gump *widget = getGump(_textWidget);
-		widget->GetDims(_dims); // transfer child dimension to self
+		_dims = widget->getDims(); // transfer child dimension to self
 		widget->Move(0, _dims.top); // move it to the correct height
 	}
 
diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp
index 987fea9f9a6..183158bb605 100644
--- a/engines/ultima/ultima8/kernel/mouse.cpp
+++ b/engines/ultima/ultima8/kernel/mouse.cpp
@@ -157,9 +157,8 @@ int Mouse::getMouseLength(int mx, int my) const {
 			return 2;
 	}
 
-	Common::Rect32 dims;
 	RenderSurface *screen = engine->getRenderScreen();
-	screen->GetSurfaceDims(dims);
+	Common::Rect32 dims = screen->getSurfaceDims();
 
 	// Reference point is the center of the screen
 	int dx = abs(mx - dims.width() / 2);
@@ -182,9 +181,8 @@ int Mouse::getMouseLength(int mx, int my) const {
 }
 
 Direction Mouse::getMouseDirectionWorld(int mx, int my) const {
-	Common::Rect32 dims;
 	RenderSurface *screen = Ultima8Engine::get_instance()->getRenderScreen();
-	screen->GetSurfaceDims(dims);
+	Common::Rect32 dims = screen->getSurfaceDims();
 
 	// For now, reference point is (near) the center of the screen
 	int dx = mx - dims.width() / 2;
@@ -289,9 +287,8 @@ int Mouse::mouseFrameForDir(Direction mousedir) const {
 }
 
 void Mouse::setMouseCoords(int mx, int my) {
-	Common::Rect32 dims;
 	RenderSurface *screen = Ultima8Engine::get_instance()->getRenderScreen();
-	screen->GetSurfaceDims(dims);
+	Common::Rect32 dims = screen->getSurfaceDims();
 
 	if (mx < dims.left)
 		mx = dims.left;
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index dfd34408290..e2b64ea4b0d 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -720,8 +720,7 @@ void Ultima8Engine::paint() {
 	tpaint -= g_system->getMillis();
 #endif
 
-	Common::Rect32 r;
-	_screen->GetSurfaceDims(r);
+	Common::Rect32 r = _screen->getSurfaceDims();
 	if (_highRes)
 		_screen->fill32(TEX32_PACK_RGB(0, 0, 0), r);
 
@@ -749,8 +748,7 @@ void Ultima8Engine::paint() {
 
 void Ultima8Engine::changeVideoMode(int width, int height) {
 	if (_screen) {
-		Common::Rect32 old_dims;
-		_screen->GetSurfaceDims(old_dims);
+		Common::Rect32 old_dims = _screen->getSurfaceDims();
 		if (width == old_dims.width() && height == old_dims.height())
 			return;
 
@@ -789,7 +787,7 @@ void Ultima8Engine::changeVideoMode(int width, int height) {
 		_desktopGump->InitGump(0);
 		_desktopGump->MakeFocus();
 	} else {
-		_desktopGump->SetDims(Common::Rect32(0, 0, width, height));
+		_desktopGump->setDims(Common::Rect32(0, 0, width, height));
 		_desktopGump->RenderSurfaceChanged();
 	}
 
@@ -1347,8 +1345,7 @@ void Ultima8Engine::resetEngine() {
 void Ultima8Engine::setupCoreGumps() {
 	debug(1, "Setting up core game gumps...");
 
-	Common::Rect32 dims;
-	_screen->GetSurfaceDims(dims);
+	Common::Rect32 dims = _screen->getSurfaceDims();
 
 	debug(1, "Creating Desktop...");
 	_desktopGump = new DesktopGump(0, 0, dims.width(), dims.height());
diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index b0113887314..a6d2b9a709a 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -449,8 +449,7 @@ void CurrentMap::updateFastArea(const Point3 &from, const Point3 &to) {
 	int z_max = MAX(from.z, to.z);
 
 	// Work out Fine (screenspace) Limits of chunks with half chunk border
-	Common::Rect32 dims;
-	Ultima8Engine::get_instance()->getGameMapGump()->GetDims(dims);
+	Common::Rect32 dims = Ultima8Engine::get_instance()->getGameMapGump()->getDims();
 
 	int32 sleft  = ((x_min - y_min) / 4)         - (dims.width() / 2 + _mapChunkSize / 4);
 	int32 stop   = ((x_min + y_min) / 8 - z_max) - (dims.height() / 2 + _mapChunkSize / 8);
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index 610b76c2d2e..e7c5694c1fd 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -628,11 +628,10 @@ bool Item::isOnScreen() const {
 	if (!game_map)
 		return false;
 
-	Common::Rect32 game_map_dims;
 	int32 screenx = -1;
 	int32 screeny = -1;
 	game_map->GetLocationOfItem(_objId, screenx, screeny);
-	game_map->GetDims(game_map_dims);
+	Common::Rect32 game_map_dims = game_map->getDims();
 	const Shape *shape = getShapeObject();
 	if (!shape)
 		return false;
@@ -654,11 +653,10 @@ bool Item::isPartlyOnScreen() const {
 	if (!game_map)
 		return false;
 
-	Common::Rect32 game_map_dims;
 	int32 screenx = -1;
 	int32 screeny = -1;
 	game_map->GetLocationOfItem(_objId, screenx, screeny);
-	game_map->GetDims(game_map_dims);
+	Common::Rect32 game_map_dims = game_map->getDims();
 	const Shape *shape = getShapeObject();
 	if (!shape)
 		return false;




More information about the Scummvm-git-logs mailing list