[Scummvm-git-logs] scummvm master -> 7ca83625ee9c822eb08e945ac25f35d46a5962be

AndywinXp noreply at scummvm.org
Mon Sep 16 20:34:10 UTC 2024


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

Summary:
7ca83625ee SCUMM: BASKETBALL: Overall u32 code cleanup


Commit: 7ca83625ee9c822eb08e945ac25f35d46a5962be
    https://github.com/scummvm/scummvm/commit/7ca83625ee9c822eb08e945ac25f35d46a5962be
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-09-16T22:34:05+02:00

Commit Message:
SCUMM: BASKETBALL: Overall u32 code cleanup

* Remove unnecessary casts or class names (Class::function()) before calls
* Remove my leftover debug messages
* Fix naming of variables and functions

Changed paths:
    engines/scumm/he/basketball/ai.cpp
    engines/scumm/he/basketball/collision/bball_collision.cpp
    engines/scumm/he/basketball/collision/bball_collision_basketball.cpp
    engines/scumm/he/basketball/collision/bball_collision_cylinder.cpp
    engines/scumm/he/basketball/collision/bball_collision_node.cpp
    engines/scumm/he/basketball/collision/bball_collision_player.cpp
    engines/scumm/he/basketball/collision/bball_collision_sphere.cpp
    engines/scumm/he/basketball/collision/bball_collision_sphere.h
    engines/scumm/he/basketball/collision/bball_collision_support_obj.h
    engines/scumm/he/basketball/collision/bball_collision_tree.cpp
    engines/scumm/he/basketball/geo_translation.cpp
    engines/scumm/he/basketball/obstacle_avoidance.cpp
    engines/scumm/he/logic/basketball_logic.cpp


diff --git a/engines/scumm/he/basketball/ai.cpp b/engines/scumm/he/basketball/ai.cpp
index 9a72650baac..120ac5de60d 100644
--- a/engines/scumm/he/basketball/ai.cpp
+++ b/engines/scumm/he/basketball/ai.cpp
@@ -241,8 +241,8 @@ int LogicHEBasketball::u32_userIsPlayerInBounds(int playerID) {
 }
 
 int LogicHEBasketball::u32_userIsBallInBounds() {
-	int bIsBallInBounds = isPlayerInBounds((U32Sphere *)&_vm->_basketball->_court->_basketBall);
-	writeScummVar(_vm1->VAR_U32_USER_VAR_A, bIsBallInBounds);
+	int isBallInBounds = isPlayerInBounds(&_vm->_basketball->_court->_basketBall);
+	writeScummVar(_vm1->VAR_U32_USER_VAR_A, isBallInBounds);
 	return 1;
 }
 
diff --git a/engines/scumm/he/basketball/collision/bball_collision.cpp b/engines/scumm/he/basketball/collision/bball_collision.cpp
index ead3381d1eb..389c8c19c08 100644
--- a/engines/scumm/he/basketball/collision/bball_collision.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision.cpp
@@ -156,7 +156,7 @@ int LogicHEBasketball::u32_userInitBall(U32FltPoint3D &ballLocation, U32FltVecto
 	_vm->_basketball->_court->_basketBall._velocity = bellVelocity;
 	_vm->_basketball->_court->_basketBall.radius = radius;
 	_vm->_basketball->_court->_basketBall._collisionEfficiency = 1.0F;
-	_vm->_basketball->_court->_basketBall._friction = 0;
+	_vm->_basketball->_court->_basketBall._friction = 0.0F;
 	_vm->_basketball->_court->_basketBall._ignore = false;
 
 	_vm->_basketball->_court->_basketBall.save();
@@ -172,7 +172,7 @@ int LogicHEBasketball::u32_userInitVirtualBall(U32FltPoint3D &ballLocation, U32F
 	_vm->_basketball->_court->_virtualBall._velocity = bellVelocity;
 	_vm->_basketball->_court->_virtualBall.radius = radius;
 	_vm->_basketball->_court->_virtualBall._collisionEfficiency = 1.0F;
-	_vm->_basketball->_court->_virtualBall._friction = 0;
+	_vm->_basketball->_court->_virtualBall._friction = 0.0F;
 	_vm->_basketball->_court->_virtualBall._ignore = false;
 
 	_vm->_basketball->_court->_virtualBall.save();
@@ -300,7 +300,7 @@ int LogicHEBasketball::u32_userDetectBallCollision(U32FltPoint3D &ballLocation,
 	sourceBall->_objectRollingHistory.clear();
 
 	// Find out who our potential collision candidates are...
-	_vm->_basketball->fillBallTargetList((CCollisionSphere *)sourceBall, &targetList);
+	_vm->_basketball->fillBallTargetList(sourceBall, &targetList);
 
 	// See if there was an error while traversing the object tree,
 	// if there was put the player in the last known safe position...
@@ -309,7 +309,7 @@ int LogicHEBasketball::u32_userDetectBallCollision(U32FltPoint3D &ballLocation,
 	}
 
 	for (int i = 0; (i < MAX_BALL_COLLISION_PASSES) && (!ballIsClear); i++) {
-		float totalTime = 0; // The time it takes to back out of all objects we have intersected while on the current vector
+		float totalTime = 0.0F; // The time it takes to back out of all objects we have intersected while on the current vector
 		ballIsClear = true;
 
 		// Go through all of the collision candidates....
@@ -318,20 +318,20 @@ int LogicHEBasketball::u32_userDetectBallCollision(U32FltPoint3D &ballLocation,
 			assert(targetObject);
 
 			// See if we intersect the current object...
-			bool intersectionResult = sourceBall->ICollisionObject::testObjectIntersection(*targetObject, &distance);
+			bool intersectionResult = sourceBall->testObjectIntersection(*targetObject, &distance);
 			if (intersectionResult) {
 				// If we are intersecting a moving object, make sure that we actually
 				// ran into them, and they didn't just run into us...
-				if (sourceBall->ICollisionObject::validateCollision(*targetObject, &distance)) {
+				if (sourceBall->validateCollision(*targetObject, &distance)) {
 					// If we are intersecting the object, back out of it...
-					if (sourceBall->ICollisionObject::backOutOfObject(*targetObject, &distance, &totalTime)) {
+					if (sourceBall->backOutOfObject(*targetObject, &distance, &totalTime)) {
 						// Move in to the exact point of collision...
-						if (sourceBall->ICollisionObject::nudgeObject(*targetObject, &distance, &totalTime)) {
+						if (sourceBall->nudgeObject(*targetObject, &distance, &totalTime)) {
 							// Keep track of this object so we can respond to the collision later...
-							trackCollisionObject(*(ICollisionObject *)sourceBall, *targetObject, &sourceBall->_objectCollisionHistory);
+							trackCollisionObject(*sourceBall, *targetObject, &sourceBall->_objectCollisionHistory);
 
 							if (sourceBall->isCollisionHandled(*targetObject)) {
-								trackCollisionObject(*(ICollisionObject *)sourceBall, *targetObject, &collisionVector);
+								trackCollisionObject(*sourceBall, *targetObject, &collisionVector);
 								ballIsClear = false;
 							}
 
@@ -352,13 +352,13 @@ int LogicHEBasketball::u32_userDetectBallCollision(U32FltPoint3D &ballLocation,
 			}
 
 			// See if we are rolling on the current object...
-			if (sourceBall->ICollisionObject::isOnObject(*targetObject, distance)) {
+			if (sourceBall->isOnObject(*targetObject, distance)) {
 				rollingHappened = 1;
 
 				if (!intersectionResult) {
 					// This is not really a collision, but the ball is rolling, so we want to slow it down...
-					trackCollisionObject(*(ICollisionObject *)sourceBall, *targetObject, &rollingVector);
-					trackCollisionObject(*(ICollisionObject *)sourceBall, *targetObject, &sourceBall->_objectRollingHistory);
+					trackCollisionObject(*sourceBall, *targetObject, &rollingVector);
+					trackCollisionObject(*sourceBall, *targetObject, &sourceBall->_objectRollingHistory);
 				}
 			}
 		}
@@ -370,9 +370,9 @@ int LogicHEBasketball::u32_userDetectBallCollision(U32FltPoint3D &ballLocation,
 
 	// Keep track of how long we've been rolling...
 	if (rollingHappened) {
-		++sourceBall->m_rollingCount;
+		++sourceBall->_rollingCount;
 	} else {
-		sourceBall->m_rollingCount = 0;
+		sourceBall->_rollingCount = 0;
 	}
 
 	// If there were no errors this frame, save the position...
@@ -445,19 +445,19 @@ int LogicHEBasketball::u32_userDetectPlayerCollision(int playerID, U32FltPoint3D
 			assert(targetObject);
 
 			// See if we intersect the current object...
-			bool intersectionResult = sourcePlayer->ICollisionObject::testObjectIntersection(*targetObject, &distance);
+			bool intersectionResult = sourcePlayer->testObjectIntersection(*targetObject, &distance);
 			if (intersectionResult) {
 				// If we are intersecting a moving object, make sure that we actually
 				// ran into them, and they didn't just run into us...
-				if (sourcePlayer->ICollisionObject::validateCollision(*targetObject, &distance)) {
+				if (sourcePlayer->validateCollision(*targetObject, &distance)) {
 					// If we are intersecting an object, back out to the exact point of collision...
-					if (sourcePlayer->ICollisionObject::backOutOfObject(*targetObject, &distance, &totalTime)) {
+					if (sourcePlayer->backOutOfObject(*targetObject, &distance, &totalTime)) {
 						// Move in to the exact point of collision...
-						if (sourcePlayer->ICollisionObject::nudgeObject(*targetObject, &distance, &totalTime)) {
+						if (sourcePlayer->nudgeObject(*targetObject, &distance, &totalTime)) {
 							trackCollisionObject(*sourcePlayer, *targetObject, &sourcePlayer->_objectCollisionHistory);
 							collisionOccurred = true;
 
-							if (sourcePlayer->ICollisionObject::isCollisionHandled(*targetObject)) {
+							if (sourcePlayer->isCollisionHandled(*targetObject)) {
 								trackCollisionObject(*sourcePlayer, *targetObject, &collisionVector);
 								playerIsClear = false;
 							}
@@ -479,7 +479,7 @@ int LogicHEBasketball::u32_userDetectPlayerCollision(int playerID, U32FltPoint3D
 			}
 
 			// See if we are standing on the current object...
-			if (sourcePlayer->ICollisionObject::isOnObject(*targetObject, distance)) {
+			if (sourcePlayer->isOnObject(*targetObject, distance)) {
 				playerIsOnObject = true;
 			}
 		}
@@ -550,8 +550,8 @@ int LogicHEBasketball::u32_userGetLastPlayerCollision(int playerID) {
 
 		// See if we are standing on the current object
 		U32Distance3D distance;
-		pPlayer->ICollisionObject::testObjectIntersection(*targetObject, &distance);
-		if (pPlayer->ICollisionObject::isOnObject(*targetObject, distance)) {
+		pPlayer->testObjectIntersection(*targetObject, &distance);
+		if (pPlayer->isOnObject(*targetObject, distance)) {
 			playerIsOnObject = true;
 		}
 
diff --git a/engines/scumm/he/basketball/collision/bball_collision_basketball.cpp b/engines/scumm/he/basketball/collision/bball_collision_basketball.cpp
index f1451968155..bdd55110526 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_basketball.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision_basketball.cpp
@@ -36,7 +36,7 @@ bool CCollisionBasketball::testCatch(const ICollisionObject &targetObject, U32Di
 	if (targetObject._objectType == kPlayer) {
 		ICollisionObject *object = const_cast<ICollisionObject *>(&targetObject);
 		CCollisionPlayer *player = static_cast<CCollisionPlayer *>(object);
-		return (player->testCatch(*(ICollisionObject *)this, distance, court));
+		return (player->testCatch(*this, distance, court));
 	} else {
 		return false;
 	}
diff --git a/engines/scumm/he/basketball/collision/bball_collision_cylinder.cpp b/engines/scumm/he/basketball/collision/bball_collision_cylinder.cpp
index 6f813c94fd4..3e9002540a8 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_cylinder.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision_cylinder.cpp
@@ -323,12 +323,12 @@ bool CCollisionCylinder::backStraightOutOfObject(const ICollisionObject &targetO
 
 	int loopCounter = 0;
 
-	while (ICollisionObject::testObjectIntersection(targetObject, distance)) {
+	while (testObjectIntersection(targetObject, distance)) {
 		float collisionTimes[3];
 
-		collisionTimes[X_INDEX] = ICollisionObject::getPenetrationTime(targetObject, *distance, X_INDEX);
-		collisionTimes[Y_INDEX] = ICollisionObject::getPenetrationTime(targetObject, *distance, Y_INDEX);
-		collisionTimes[Z_INDEX] = ICollisionObject::getPenetrationTime(targetObject, *distance, Z_INDEX);
+		collisionTimes[X_INDEX] = getPenetrationTime(targetObject, *distance, X_INDEX);
+		collisionTimes[Y_INDEX] = getPenetrationTime(targetObject, *distance, Y_INDEX);
+		collisionTimes[Z_INDEX] = getPenetrationTime(targetObject, *distance, Z_INDEX);
 
 		Std::sort(collisionTimes, collisionTimes + Z_INDEX + 1);
 
@@ -811,7 +811,7 @@ void CCollisionCylinder::forceOutOfObject(const ICollisionObject &targetObject,
 
 		center.x = intersectionPoint.x + targetVector.x;
 		center.y = intersectionPoint.y + targetVector.y;
-		ICollisionObject::testObjectIntersection(targetObject, distance);
+		testObjectIntersection(targetObject, distance);
 
 		break;
 
@@ -838,7 +838,7 @@ void CCollisionCylinder::forceOutOfObject(const ICollisionObject &targetObject,
 
 			center.x = targetCenter.x + targetVector.x;
 			center.y = targetCenter.y + targetVector.y;
-			ICollisionObject::testObjectIntersection(targetObject, distance);
+			testObjectIntersection(targetObject, distance);
 		}
 
 		break;
diff --git a/engines/scumm/he/basketball/collision/bball_collision_node.cpp b/engines/scumm/he/basketball/collision/bball_collision_node.cpp
index 62b91114a36..aa88594c055 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_node.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision_node.cpp
@@ -35,8 +35,8 @@ CCollisionNode::CCollisionNode() {
 		_child[i] = nullptr;
 	}
 
-	_quadrant.SetMinPoint(0, 0);
-	_quadrant.SetMaxPoint(0, 0);
+	_quadrant.setMinPoint(0, 0);
+	_quadrant.setMaxPoint(0, 0);
 
 	_isExternal = false;
 }
@@ -46,8 +46,8 @@ CCollisionNode::CCollisionNode(const CCollisionObjectVector &initObjects) : _obj
 		_child[i] = nullptr;
 	}
 
-	_quadrant.SetMinPoint(0, 0);
-	_quadrant.SetMaxPoint(0, 0);
+	_quadrant.setMinPoint(0, 0);
+	_quadrant.setMaxPoint(0, 0);
 
 	_isExternal = false;
 }
@@ -108,13 +108,13 @@ U32BoundingBox CCollisionNode::getChildQuadrant(const U32BoundingBox &parentQuad
 	}
 
 	U32BoundingBox childQuadrant;
-	childQuadrant.SetMinPoint(minX, minY);
-	childQuadrant.SetMaxPoint(maxX, maxY);
+	childQuadrant.setMinPoint(minX, minY);
+	childQuadrant.setMaxPoint(maxX, maxY);
 	return childQuadrant;
 }
 
 void CCollisionNode::searchTree(const U32BoundingBox &searchRange, CCollisionObjectVector *targetList) const {
-	if (searchRange.Intersect(_quadrant)) {
+	if (searchRange.intersect(_quadrant)) {
 		if (_isExternal) {
 			// Search through and add points that are within bounds...
 			for (CCollisionObjectVector::size_type objectIndex = 0; objectIndex < _objectList.size(); ++objectIndex) {
diff --git a/engines/scumm/he/basketball/collision/bball_collision_player.cpp b/engines/scumm/he/basketball/collision/bball_collision_player.cpp
index c840d0f0246..5fe424c50dc 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_player.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision_player.cpp
@@ -82,7 +82,7 @@ bool CCollisionPlayer::testCatch(const ICollisionObject &targetObject, U32Distan
 		int oldHeight = height;
 		height += _catchHeight;
 
-		bool retVal = ICollisionObject::testObjectIntersection(targetObject, distance);
+		bool retVal = testObjectIntersection(targetObject, distance);
 
 		height = oldHeight;
 
diff --git a/engines/scumm/he/basketball/collision/bball_collision_sphere.cpp b/engines/scumm/he/basketball/collision/bball_collision_sphere.cpp
index 5a889062183..79cac142a9d 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_sphere.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision_sphere.cpp
@@ -247,12 +247,12 @@ bool CCollisionSphere::backStraightOutOfObject(const ICollisionObject &targetObj
 
 	int loopCounter = 0;
 
-	while (ICollisionObject::testObjectIntersection(targetObject, distance)) {
+	while (testObjectIntersection(targetObject, distance)) {
 		float collisionTimes[3];
 
-		collisionTimes[X_INDEX] = ICollisionObject::getPenetrationTime(targetObject, *distance, X_INDEX);
-		collisionTimes[Y_INDEX] = ICollisionObject::getPenetrationTime(targetObject, *distance, Y_INDEX);
-		collisionTimes[Z_INDEX] = ICollisionObject::getPenetrationTime(targetObject, *distance, Z_INDEX);
+		collisionTimes[X_INDEX] = getPenetrationTime(targetObject, *distance, X_INDEX);
+		collisionTimes[Y_INDEX] = getPenetrationTime(targetObject, *distance, Y_INDEX);
+		collisionTimes[Z_INDEX] = getPenetrationTime(targetObject, *distance, Z_INDEX);
 
 		Std::sort(collisionTimes, collisionTimes + Z_INDEX + 1);
 
@@ -451,7 +451,7 @@ void CCollisionSphere::defineReflectionPlane(const CCollisionCylinder &targetObj
 	collisionPlane->collisionEfficiency = targetObject._collisionEfficiency;
 }
 
-void CCollisionSphere::ReboundOffPlane(const U32Plane &collisionPlane, bool isOnObject) {
+void CCollisionSphere::reboundOffPlane(const U32Plane &collisionPlane, bool isOnObject) {
 	U32FltVector3D normalVector;
 	U32FltVector3D reflectionVector;
 	U32FltVector3D parallelVector;
@@ -469,7 +469,7 @@ void CCollisionSphere::ReboundOffPlane(const U32Plane &collisionPlane, bool isOn
 
 	parallelVector = reflectionVector - normalVector;
 
-	if ((!isOnObject) || ((m_rollingCount % ROLL_SLOWDOWN_FREQUENCY) == 0)) {
+	if ((!isOnObject) || ((_rollingCount % ROLL_SLOWDOWN_FREQUENCY) == 0)) {
 		parallelVector -= ((parallelVector * collisionPlane.friction) + (parallelVector * _friction));
 	}
 
@@ -528,10 +528,10 @@ void CCollisionSphere::handleCollisions(CCollisionObjectVector *collisionVector,
 		 ++objectIt) {
 		const ICollisionObject *currentObject = *objectIt;
 
-		ICollisionObject::testObjectIntersection(*currentObject, &distance);
+		testObjectIntersection(*currentObject, &distance);
 
 		// See if we are rolling on this object...
-		isRollingOnObject = ICollisionObject::isOnObject(*currentObject, distance);
+		isRollingOnObject = isOnObject(*currentObject, distance);
 		if (isRollingOnObject) {
 			// See if rolling has slowed to the point that we are stopped.
 			// Never stop on the backboard or rim...
@@ -555,7 +555,7 @@ void CCollisionSphere::handleCollisions(CCollisionObjectVector *collisionVector,
 			}
 		}
 
-		ICollisionObject::defineReflectionPlane(*currentObject, distance, &collisionPlane);
+		defineReflectionPlane(*currentObject, distance, &collisionPlane);
 		planeVector.push_back(collisionPlane);
 		rollingRecord.push_back(isRollingOnObject);
 	}
@@ -573,11 +573,11 @@ void CCollisionSphere::handleCollisions(CCollisionObjectVector *collisionVector,
 			 planeIt != planeVector.end();
 			 ++planeIt, ++recordIt) {
 
-			collisionPlane.Average(*planeIt);
+			collisionPlane.average(*planeIt);
 			isRollingOnObject = isRollingOnObject || *recordIt;
 		}
 
-		ReboundOffPlane(collisionPlane, isRollingOnObject);
+		reboundOffPlane(collisionPlane, isRollingOnObject);
 	}
 
 	if (advanceObject) {
diff --git a/engines/scumm/he/basketball/collision/bball_collision_sphere.h b/engines/scumm/he/basketball/collision/bball_collision_sphere.h
index 8d8cccf4c9e..f06f1cd005f 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_sphere.h
+++ b/engines/scumm/he/basketball/collision/bball_collision_sphere.h
@@ -36,7 +36,7 @@ const int ROLL_SLOWDOWN_FREQUENCY = 10; // The ball slows down every x frames wh
 class CCollisionSphere : public ICollisionObject, public U32Sphere {
 public:
 	CCollisionSphere() : ICollisionObject(kSphere),
-						 m_rollingCount(0),
+						 _rollingCount(0),
 						 _positionSaved(false) {}
 
 	~CCollisionSphere() {}
@@ -73,7 +73,7 @@ public:
 	void save() override;
 	void restore() override;
 
-	int m_rollingCount;
+	int _rollingCount;
 
 
 protected:
@@ -91,7 +91,7 @@ private:
 	void defineReflectionPlane(const CCollisionBox &targetObject, const U32Distance3D &distance, U32Plane *collisionPlane) const override;
 	void defineReflectionPlane(const CCollisionCylinder &targetObject, const U32Distance3D &distance, U32Plane *collisionPlane) const override;
 
-	void ReboundOffPlane(const U32Plane &collisionPlane, bool isOnPlane);
+	void reboundOffPlane(const U32Plane &collisionPlane, bool isOnPlane);
 
 	using ICollisionObject::getPenetrationTime;
 	float getPenetrationTime(const CCollisionBox &targetObject, const U32Distance3D &distance, EDimension dimension) const override;
diff --git a/engines/scumm/he/basketball/collision/bball_collision_support_obj.h b/engines/scumm/he/basketball/collision/bball_collision_support_obj.h
index 4feada55d38..0853ce3d490 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_support_obj.h
+++ b/engines/scumm/he/basketball/collision/bball_collision_support_obj.h
@@ -543,12 +543,12 @@ struct U32BoundingBox {
 	U32IntPoint3D minPoint;
 	U32IntPoint3D maxPoint;
 
-	void SetMinPoint(int x, int y) {
+	void setMinPoint(int x, int y) {
 		minPoint.x = x;
 		minPoint.y = y;
 	}
 
-	void SetMaxPoint(int x, int y) {
+	void setMaxPoint(int x, int y) {
 		maxPoint.x = x;
 		maxPoint.y = y;
 	}
@@ -561,7 +561,7 @@ struct U32BoundingBox {
 		return maxPoint;
 	}
 
-	bool Intersect(const U32BoundingBox &targetBox) const {
+	bool intersect(const U32BoundingBox &targetBox) const {
 		return ((((minPoint.x <= targetBox.minPoint.x) &&
 				  (maxPoint.x >= targetBox.minPoint.x)) ||
 
@@ -612,7 +612,7 @@ struct U32Plane {
 	float friction;
 
 	// Average this plane with another plane
-	U32Plane &Average(const U32Plane &otherPlane) {
+	U32Plane &average(const U32Plane &otherPlane) {
 		point.x = (point.x + otherPlane.point.x) / 2;
 		point.y = (point.y + otherPlane.point.y) / 2;
 		point.z = (point.z + otherPlane.point.z) / 2;
diff --git a/engines/scumm/he/basketball/collision/bball_collision_tree.cpp b/engines/scumm/he/basketball/collision/bball_collision_tree.cpp
index 405e8a90060..d3a0b4e3a3f 100644
--- a/engines/scumm/he/basketball/collision/bball_collision_tree.cpp
+++ b/engines/scumm/he/basketball/collision/bball_collision_tree.cpp
@@ -51,8 +51,8 @@ void CCollisionObjectTree::initialize(const CCollisionObjectVector &inputObjects
 	}
 
 	U32BoundingBox buildRange;
-	buildRange.SetMinPoint(inputObjects.getMinPoint(X_INDEX), inputObjects.getMinPoint(Y_INDEX));
-	buildRange.SetMaxPoint(inputObjects.getMaxPoint(X_INDEX), inputObjects.getMaxPoint(Y_INDEX));
+	buildRange.setMinPoint(inputObjects.getMinPoint(X_INDEX), inputObjects.getMinPoint(Y_INDEX));
+	buildRange.setMaxPoint(inputObjects.getMaxPoint(X_INDEX), inputObjects.getMaxPoint(Y_INDEX));
 	_root = buildSelectionStructure(inputObjects, 0, buildRange);
 }
 
@@ -108,7 +108,7 @@ CCollisionNode *CCollisionObjectTree::buildSelectionStructure(const CCollisionOb
 
 			// Figure out which child each point belongs to...
 			for (childID = 0; childID < NUM_CHILDREN_NODES; ++childID) {
-				if (newRange[childID].Intersect(currentObject->getBoundingBox())) {
+				if (newRange[childID].intersect(currentObject->getBoundingBox())) {
 					newList[childID].push_back(currentObject);
 				}
 			}
diff --git a/engines/scumm/he/basketball/geo_translation.cpp b/engines/scumm/he/basketball/geo_translation.cpp
index 14b50434930..7b504da6914 100644
--- a/engines/scumm/he/basketball/geo_translation.cpp
+++ b/engines/scumm/he/basketball/geo_translation.cpp
@@ -78,7 +78,7 @@ int LogicHEBasketball::u32_userInitScreenTranslations() {
 	return 1;
 }
 
-static U32FltPoint2D World_To_Screen_Translation(const U32FltPoint3D &worldPoint, LogicHEBasketball *logic) {
+static U32FltPoint2D worldToScreenTranslation(const U32FltPoint3D &worldPoint, LogicHEBasketball *logic) {
 	U32FltPoint2D screenPoint; // The point on the screen that corresponds to worldPoint
 	float courtWidth;          // The width of the court in pixels at the at the current y location
 	float xOffset;             // The number of pixels from the left side of the screen to the court at the current y location
@@ -141,7 +141,7 @@ static U32FltPoint2D World_To_Screen_Translation(const U32FltPoint3D &worldPoint
 }
 
 int LogicHEBasketball::u32_userWorldToScreenTranslation(const U32FltPoint3D &worldPoint) {
-	U32FltPoint2D screenPoint = World_To_Screen_Translation(worldPoint, this);
+	U32FltPoint2D screenPoint = worldToScreenTranslation(worldPoint, this);
 
 	writeScummVar(_vm1->VAR_U32_USER_VAR_A, _vm->_basketball->u32FloatToInt(screenPoint.x));
 	writeScummVar(_vm1->VAR_U32_USER_VAR_B, _vm->_basketball->u32FloatToInt(screenPoint.y));
diff --git a/engines/scumm/he/basketball/obstacle_avoidance.cpp b/engines/scumm/he/basketball/obstacle_avoidance.cpp
index a0767e775a7..a45304488ea 100644
--- a/engines/scumm/he/basketball/obstacle_avoidance.cpp
+++ b/engines/scumm/he/basketball/obstacle_avoidance.cpp
@@ -56,19 +56,19 @@ CCollisionPlayer *Basketball::detectObstacle(const U32Circle &playerMarker,
 	poRay._direction = (targetLocation - poRay._origin);
 
 	// Cycle through all potential obstacles and see which obstacle is closest...
-	CCollisionPlayer *pFinalObstacle = nullptr;
+	CCollisionPlayer *finalObstacle = nullptr;
 	float minDistance = (float)0x7FFFFFFF;
 
 	for (int i = 0; i <= LAST_PLAYER; ++i) {
 		// Get a pointer to the current obstacle...
-		CCollisionPlayer *pCurrentObstacle = court->getPlayerPtr(i);
+		CCollisionPlayer *currentObstacle = court->getPlayerPtr(i);
 
 		// Make sure we are not checking ourselves or a bench player...
-		if ((pCurrentObstacle->_objectID != playerID) &&
-			(pCurrentObstacle->_playerIsInGame)) {
+		if ((currentObstacle->_objectID != playerID) &&
+			(currentObstacle->_playerIsInGame)) {
 			U32Circle obstacleMarker;
-			obstacleMarker.center = pCurrentObstacle->center;
-			obstacleMarker.radius = getAvoidanceDistance(playerMarker, *pCurrentObstacle);
+			obstacleMarker.center = currentObstacle->center;
+			obstacleMarker.radius = getAvoidanceDistance(playerMarker, *currentObstacle);
 
 			if (poRay.nearIntersection(obstacleMarker, intersection)) {
 				float obstacleDist = (*intersection - playerMarker.center).magnitude();
@@ -78,11 +78,11 @@ CCollisionPlayer *Basketball::detectObstacle(const U32Circle &playerMarker,
 				// See if this obstacle is in our way...
 				if (obstacleDist < alertDistance) {
 					// See if the target is within the obstacle...
-					float otDist = (targetLocation - pCurrentObstacle->center).magnitude();
+					float otDist = (targetLocation - currentObstacle->center).magnitude();
 					if ((otDist > obstacleMarker.radius) || targetIsObstacle) {
 						// See if this obstacle is the closest one yet...
 						if (obstacleDist < minDistance) {
-							pFinalObstacle = pCurrentObstacle;
+							finalObstacle = currentObstacle;
 							minDistance = obstacleDist;
 						}
 					}
@@ -91,7 +91,7 @@ CCollisionPlayer *Basketball::detectObstacle(const U32Circle &playerMarker,
 		}
 	}
 
-	return pFinalObstacle;
+	return finalObstacle;
 }
 
 bool Basketball::avoidObstacle(const U32Circle &playerMarker, const U32FltPoint2D &targetLocation, const CCollisionPlayer &obstacle, ERevDirection whichDirection, U32FltPoint2D *newTarget) {
diff --git a/engines/scumm/he/logic/basketball_logic.cpp b/engines/scumm/he/logic/basketball_logic.cpp
index 6cfa81fc87e..a4602a33885 100644
--- a/engines/scumm/he/logic/basketball_logic.cpp
+++ b/engines/scumm/he/logic/basketball_logic.cpp
@@ -346,7 +346,6 @@ int32 LogicHEBasketball::dispatch(int cmdID, int paramCount, int32 *params) {
 		flt3DVector1.z = (float)params[5];
 
 
-		debug("Basketball INIT (%.6f,%.6f,%.6f)", flt3DPoint1.x, flt3DPoint1.y, flt3DPoint1.z);
 		retValue = u32_userInitBall(flt3DPoint1, flt3DVector1, params[6], params[7]);
 		break;
 
@@ -408,8 +407,6 @@ int32 LogicHEBasketball::dispatch(int cmdID, int paramCount, int32 *params) {
 		flt3DPoint1.y = (float)params[1];
 		flt3DPoint1.z = (float)params[2];
 
-		debug(3, "Basketball SET_BALL_LOCATION (%.6f,%.6f,%.6f)",
-			  flt3DPoint1.x, flt3DPoint1.y, flt3DPoint1.z);
 
 		_vm->_basketball->_court->getBallPtr(params[3])->center = flt3DPoint1;
 
@@ -421,12 +418,6 @@ int32 LogicHEBasketball::dispatch(int cmdID, int paramCount, int32 *params) {
 
 		flt3DPoint1 = _vm->_basketball->_court->getBallPtr(params[0])->center;
 
-		debug(3, "Basketball GET_BALL_LOCATION (%.6f,%.6f,%.6f), (converted as %d,%d,%d)",
-			flt3DPoint1.x, flt3DPoint1.y, flt3DPoint1.z,
-			_vm->_basketball->u32FloatToInt(flt3DPoint1.x),
-			_vm->_basketball->u32FloatToInt(flt3DPoint1.y),
-			_vm->_basketball->u32FloatToInt(flt3DPoint1.z));
-
 		writeScummVar(_vm1->VAR_U32_USER_VAR_A, _vm->_basketball->u32FloatToInt(flt3DPoint1.x));
 		writeScummVar(_vm1->VAR_U32_USER_VAR_B, _vm->_basketball->u32FloatToInt(flt3DPoint1.y));
 		writeScummVar(_vm1->VAR_U32_USER_VAR_C, _vm->_basketball->u32FloatToInt(flt3DPoint1.z));
@@ -470,7 +461,6 @@ int32 LogicHEBasketball::dispatch(int cmdID, int paramCount, int32 *params) {
 		flt3DVector1.x = (float)params[3];
 		flt3DVector1.y = (float)params[4];
 		flt3DVector1.z = (float)params[5];
-		debug(3, "Basketball DETECT_BALL_COLLISION will be put at (%.6f,%.6f,%.6f)", flt3DPoint1.x, flt3DPoint1.y, flt3DPoint1.z);
 
 		retValue = u32_userDetectBallCollision(flt3DPoint1, flt3DVector1, params[6], params[7]);
 		break;
@@ -512,9 +502,6 @@ int32 LogicHEBasketball::dispatch(int cmdID, int paramCount, int32 *params) {
 		int3DVector1.x = params[3];
 		int3DVector1.y = params[4];
 		int3DVector1.z = params[5];
-		debug(3, "Basketball DETECT_SHOT_MADE sphere (%.6f,%.6f,%.6f), vector (%d,%d,%d)",
-			flt3DPoint1.x, flt3DPoint1.y, flt3DPoint1.z,
-			int3DVector1.x, int3DVector1.y, int3DVector1.z);
 
 		retValue = u32_userDetectShotMade(sphere1, int3DVector1, params[7], params[8]);
 		break;




More information about the Scummvm-git-logs mailing list