mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
SWORD25: int -> int32 correctness
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user