[Scummvm-git-logs] scummvm master -> 390fff70c227e734cc225ed135f00b388ce59bfd

grisenti noreply at scummvm.org
Sun Jan 29 21:47:21 UTC 2023


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:
390fff70c2 HPL1: fix warnings


Commit: 390fff70c227e734cc225ed135f00b388ce59bfd
    https://github.com/scummvm/scummvm/commit/390fff70c227e734cc225ed135f00b388ce59bfd
Author: grisenti (emanuele at grisenti.net)
Date: 2023-01-29T22:47:12+01:00

Commit Message:
HPL1: fix warnings

Changed paths:
    engines/hpl1/engine/libraries/newton/core/dgAABBPolygonSoup.cpp
    engines/hpl1/engine/libraries/newton/core/dgHeap.h
    engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.cpp
    engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.h


diff --git a/engines/hpl1/engine/libraries/newton/core/dgAABBPolygonSoup.cpp b/engines/hpl1/engine/libraries/newton/core/dgAABBPolygonSoup.cpp
index 3db1d34697a..6448230b74e 100644
--- a/engines/hpl1/engine/libraries/newton/core/dgAABBPolygonSoup.cpp
+++ b/engines/hpl1/engine/libraries/newton/core/dgAABBPolygonSoup.cpp
@@ -1507,7 +1507,7 @@ dgIntersectStatus dgAABBPolygonSoup::CalculateAllFaceEdgeNormals(void *context,
 
 	AdjacentdFaces adjacentFaces;
 	adjacentFaces.m_count = indexCount;
-	adjacentFaces.m_index = (dgInt32 *) indexArray;
+	adjacentFaces.m_index = const_cast<dgInt32 *>(indexArray);
 	{
 		dgVector n(&polygon[indexArray[indexCount] * stride]);
 		dgVector p(&polygon[indexArray[0] * stride]);
diff --git a/engines/hpl1/engine/libraries/newton/core/dgHeap.h b/engines/hpl1/engine/libraries/newton/core/dgHeap.h
index 75f2ffadf8a..378fdb213d3 100644
--- a/engines/hpl1/engine/libraries/newton/core/dgHeap.h
+++ b/engines/hpl1/engine/libraries/newton/core/dgHeap.h
@@ -60,6 +60,7 @@ public:
 	dgInt32 GetCount() const;
 	dgInt32 GetMaxCount() const;
 	const OBJECT &operator[](dgInt32 i) const;
+	OBJECT &operator[](dgInt32 i);
 	dgInt32 Find(OBJECT &obj);
 	dgInt32 Find(KEY key);
 
@@ -203,6 +204,12 @@ const OBJECT &dgHeapBase<OBJECT, KEY>::operator[](dgInt32 i) const {
 	return m_pool[i].m_obj;
 }
 
+template <class OBJECT, class KEY>
+OBJECT &dgHeapBase<OBJECT, KEY>::operator[](dgInt32 i) {
+	NEWTON_ASSERT(i <= m_curCount);
+	return m_pool[i].m_obj;
+}
+
 
 // **************************************************************************
 //
diff --git a/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.cpp b/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.cpp
index 4c66111826d..b2bf9aa9725 100644
--- a/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.cpp
+++ b/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.cpp
@@ -30,7 +30,6 @@
 //////////////////////////////////////////////////////////////////////
 
 dgInt32 dgCollisionChamferCylinder::m_shapeRefCount = 0;
-dgVector dgCollisionChamferCylinder::m_shapesDirs[DG_MAX_CHAMFERCYLINDER_DIR_COUNT];
 dgConvexSimplexEdge dgCollisionChamferCylinder::m_edgeArray[(4 * DG_CHAMFERCYLINDER_SLICES + 2) * DG_CHAMFERCYLINDER_BRAKES];
 
 dgCollisionChamferCylinder::dgCollisionChamferCylinder(
@@ -110,15 +109,6 @@ void dgCollisionChamferCylinder::Init(dgFloat32 radius, dgFloat32 height) {
 		dgPolyhedra polyhedra(m_allocator);
 		dgInt32 wireframe[DG_CHAMFERCYLINDER_SLICES + 10];
 
-		for (dgInt32 i = 0; i < DG_MAX_CHAMFERCYLINDER_DIR_COUNT; i++) {
-			dgMatrix matrix(
-			    dgPitchMatrix(
-			        dgFloat32(dgPI2 * i) / DG_MAX_CHAMFERCYLINDER_DIR_COUNT));
-			m_shapesDirs[i] = matrix.RotateVector(
-			                      dgVector(dgFloat32(0.0f), dgFloat32(1.0f), dgFloat32(0.0f),
-			                               dgFloat32(0.0f)));
-		}
-
 		dgInt32 index = 0;
 		for (dgInt32 j = 0; j < DG_CHAMFERCYLINDER_SLICES; j++) {
 			dgInt32 index0 = index + DG_CHAMFERCYLINDER_BRAKES - 1;
diff --git a/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.h b/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.h
index d36e8520c85..a4b8c3fe674 100644
--- a/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.h
+++ b/engines/hpl1/engine/libraries/newton/physics/dgCollisionChamferCylinder.h
@@ -26,7 +26,6 @@
 
 #define DG_CHAMFERCYLINDER_SLICES         4
 #define DG_CHAMFERCYLINDER_BRAKES         8
-#define DG_MAX_CHAMFERCYLINDER_DIR_COUNT  8
 
 
 class dgCollisionChamferCylinder: public dgCollisionConvex {
@@ -76,7 +75,6 @@ private:
 	dgVector m_vertex[DG_CHAMFERCYLINDER_BRAKES * (DG_CHAMFERCYLINDER_SLICES + 1)];
 	static dgInt32 m_shapeRefCount;
 	static dgConvexSimplexEdge m_edgeArray[];
-	static dgVector m_shapesDirs[];
 
 	friend class dgWorld;
 };




More information about the Scummvm-git-logs mailing list