[Scummvm-cvs-logs] scummvm master -> e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8

sev- sev at scummvm.org
Sun Sep 29 09:03:17 CEST 2013


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:
e6ba26ff0d SWORD25: int -> int32 correctness


Commit: e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8
    https://github.com/scummvm/scummvm/commit/e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-09-29T00:02:34-07:00

Commit Message:
SWORD25: int -> int32 correctness

Changed paths:
    engines/sword25/math/polygon.cpp
    engines/sword25/math/polygon.h
    engines/sword25/math/region.cpp
    engines/sword25/math/regionregistry.cpp



diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp
index 2e7836f..99d947d 100644
--- a/engines/sword25/math/polygon.cpp
+++ b/engines/sword25/math/polygon.cpp
@@ -364,20 +364,20 @@ bool Polygon::isPointInPolygon(const Vertex &point, bool edgesBelongToPolygon) c
 bool Polygon::persist(OutputPersistenceBlock &writer) {
 	writer.write(vertexCount);
 	for (int i = 0; i < vertexCount; ++i) {
-		writer.write(vertices[i].x);
-		writer.write(vertices[i].y);
+		writer.write((int32)vertices[i].x);
+		writer.write((int32)vertices[i].y);
 	}
 
 	return true;
 }
 
 bool Polygon::unpersist(InputPersistenceBlock &reader) {
-	int storedvertexCount;
+	int32 storedvertexCount;
 	reader.read(storedvertexCount);
 
 	Common::Array<Vertex> storedvertices;
 	for (int i = 0; i < storedvertexCount; ++i) {
-		int x, y;
+		int32 x, y;
 		reader.read(x);
 		reader.read(y);
 		storedvertices.push_back(Vertex(x, y));
diff --git a/engines/sword25/math/polygon.h b/engines/sword25/math/polygon.h
index ffdbf14..f81e165 100644
--- a/engines/sword25/math/polygon.h
+++ b/engines/sword25/math/polygon.h
@@ -169,7 +169,7 @@ public:
 	//
 
 	/// Specifies the number of Vertecies in the Vertecies array.
-	int vertexCount;
+	int32 vertexCount;
 	/// COntains the Vertecies of the polygon
 	Vertex *vertices;
 
diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp
index 7681ef6..f391a57 100644
--- a/engines/sword25/math/region.cpp
+++ b/engines/sword25/math/region.cpp
@@ -299,22 +299,22 @@ bool Region::isLineOfSight(const Vertex &a, const Vertex &b) const {
 bool Region::persist(OutputPersistenceBlock &writer) {
 	bool Result = true;
 
-	writer.write(static_cast<uint>(_type));
+	writer.write(static_cast<uint32>(_type));
 	writer.write(_valid);
-	writer.write(_position.x);
-	writer.write(_position.y);
+	writer.write((int32)_position.x);
+	writer.write((int32)_position.y);
 
-	writer.write(_polygons.size());
+	writer.write((uint32)_polygons.size());
 	Common::Array<Polygon>::iterator It = _polygons.begin();
 	while (It != _polygons.end()) {
 		Result &= It->persist(writer);
 		++It;
 	}
 
-	writer.write(_boundingBox.left);
-	writer.write(_boundingBox.top);
-	writer.write(_boundingBox.right);
-	writer.write(_boundingBox.bottom);
+	writer.write((uint32)_boundingBox.left);
+	writer.write((uint32)_boundingBox.top);
+	writer.write((uint32)_boundingBox.right);
+	writer.write((uint32)_boundingBox.bottom);
 
 	return Result;
 }
@@ -325,7 +325,7 @@ bool Region::unpersist(InputPersistenceBlock &reader) {
 	reader.read(_position.y);
 
 	_polygons.clear();
-	uint PolygonCount;
+	uint32 PolygonCount;
 	reader.read(PolygonCount);
 	for (uint i = 0; i < PolygonCount; ++i) {
 		_polygons.push_back(Polygon(reader));
diff --git a/engines/sword25/math/regionregistry.cpp b/engines/sword25/math/regionregistry.cpp
index 68c360a..e4925f7 100644
--- a/engines/sword25/math/regionregistry.cpp
+++ b/engines/sword25/math/regionregistry.cpp
@@ -47,7 +47,7 @@ bool RegionRegistry::persist(OutputPersistenceBlock &writer) {
 	writer.write(_nextHandle);
 
 	// Number of regions to write
-	writer.write(_handle2PtrMap.size());
+	writer.write((uint32)_handle2PtrMap.size());
 
 	// Persist all the BS_Regions
 	HANDLE2PTR_MAP::const_iterator iter = _handle2PtrMap.begin();
@@ -76,13 +76,13 @@ bool RegionRegistry::unpersist(InputPersistenceBlock &reader) {
 		delete _handle2PtrMap.begin()->_value;
 
 	// read in the number of BS_Regions
-	uint regionCount;
+	uint32 regionCount;
 	reader.read(regionCount);
 
 	// Restore all the BS_Regions objects
 	for (uint i = 0; i < regionCount; ++i)  {
 		// Handle read
-		uint handle;
+		uint32 handle;
 		reader.read(handle);
 
 		// BS_Region restore






More information about the Scummvm-git-logs mailing list