diff options
| author | Paul Gilbert | 2010-08-21 08:20:32 +0000 | 
|---|---|---|
| committer | Eugene Sandulenko | 2010-10-12 23:09:12 +0000 | 
| commit | 1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985 (patch) | |
| tree | aebed8218d896782eedf28f4d9f53d6e656812dc /engines/sword25/gfx/renderobject.cpp | |
| parent | 018698467143fb2d91c4688db032a883bac8db5c (diff) | |
| download | scummvm-rg350-1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985.tar.gz scummvm-rg350-1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985.tar.bz2 scummvm-rg350-1d16dfd281b30627ce0ade7c6c2de0cb7e4cc985.zip | |
SWORD25: Refactored engine to remove BS_Rect class
svn-id: r53265
Diffstat (limited to 'engines/sword25/gfx/renderobject.cpp')
| -rw-r--r-- | engines/sword25/gfx/renderobject.cpp | 16 | 
1 files changed, 10 insertions, 6 deletions
| diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index 3b9d3970d3..f0a7caea9e 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -182,15 +182,17 @@ void RenderObject::UpdateBoxes() {  	m_BBox = CalcBoundingBox();  } -BS_Rect RenderObject::CalcBoundingBox() const { +Common::Rect RenderObject::CalcBoundingBox() const {  	// Die Bounding-Box mit der Objektgröße initialisieren. -	BS_Rect BBox(0, 0, m_Width, m_Height); +	Common::Rect BBox(0, 0, m_Width, m_Height);  	// Die absolute Position der Bounding-Box berechnen. -	BBox.Move(m_AbsoluteX, m_AbsoluteY); +	BBox.translate(m_AbsoluteX, m_AbsoluteY);  	// Die Bounding-Box am Elternobjekt clippen. -	if (m_ParentPtr.IsValid()) BBox.Intersect(m_ParentPtr->GetBBox(), BBox); +	if (m_ParentPtr.IsValid()) { +		BBox.clip(m_ParentPtr->GetBBox()); +	}  	return BBox;  } @@ -269,8 +271,10 @@ void RenderObject::UpdateAbsolutePos() {  // Get-Methoden  // ------------ -bool RenderObject::GetObjectIntersection(RenderObjectPtr<RenderObject> pObject, BS_Rect &Result) { -	return m_BBox.Intersect(pObject->GetBBox(), Result); +bool RenderObject::GetObjectIntersection(RenderObjectPtr<RenderObject> pObject, Common::Rect &Result) { +	Result = pObject->GetBBox(); +	Result.clip(m_BBox); +	return Result.isValidRect();  }  // Set-Methoden | 
