diff options
author | Eugene Sandulenko | 2013-09-29 10:02:34 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-29 10:02:34 +0300 |
commit | e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8 (patch) | |
tree | a176b936472120fac2bc2fb9fcb9f50b3b1592cb /engines/sword25/math | |
parent | 7a669b770f81cbb739f6d45884d898a83fff8a13 (diff) | |
download | scummvm-rg350-e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8.tar.gz scummvm-rg350-e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8.tar.bz2 scummvm-rg350-e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8.zip |
SWORD25: int -> int32 correctness
Diffstat (limited to 'engines/sword25/math')
-rw-r--r-- | engines/sword25/math/polygon.cpp | 8 | ||||
-rw-r--r-- | engines/sword25/math/polygon.h | 2 | ||||
-rw-r--r-- | engines/sword25/math/region.cpp | 18 | ||||
-rw-r--r-- | engines/sword25/math/regionregistry.cpp | 6 |
4 files changed, 17 insertions, 17 deletions
diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp index 2e7836ff77..99d947df87 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 ffdbf14f6b..f81e165621 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 7681ef6d9f..f391a577ab 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 68c360a5ee..e4925f7baf 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 |