aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/rails.cpp8
-rw-r--r--engines/m4/rails.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/engines/m4/rails.cpp b/engines/m4/rails.cpp
index d706af8ef1..f51d81c8f4 100644
--- a/engines/m4/rails.cpp
+++ b/engines/m4/rails.cpp
@@ -61,9 +61,7 @@ void Rails::clearRails() {
delete tempNode;
}
- for (i = 0; i < _edges.size(); i++) {
- _edges.remove_at(i);
- }
+ _edges.clear();
for (j = _noWalkRects.begin(); j != _noWalkRects.end(); ++j)
delete (*j);
@@ -246,7 +244,7 @@ void Rails::createEdge(int32 node1, int32 node2) {
} else {
distance = SqrtF16(FixedMul(deltaX, deltaX) + FixedMul(deltaY, deltaY)) << 8;
}
- _edges.insert_at(index, (int16*)(distance >> 16));
+ _edges.insert_at(index, distance >> 16);
}
debugCN(kDebugCore, "node1 = %d, node2 = %d, valid = %d\n", node1, node2, valid);
@@ -312,7 +310,7 @@ int16 Rails::getEdgeLength(int32 node1, int32 node2) {
// Find the table entry i.e. tableWidth * node1 + node2 and then subtract
// n(n+1)/2, since only the upper triangle of the table is stored
index = (MAXRAILNODES-1)*node1 + node2 - 1 - (node1*(node1+1)>>1);
- return *_edges[index];
+ return _edges[index];
}
void Rails::disposePath(RailNode *pathStart) {
diff --git a/engines/m4/rails.h b/engines/m4/rails.h
index ccc9e00536..80bb55e9de 100644
--- a/engines/m4/rails.h
+++ b/engines/m4/rails.h
@@ -73,7 +73,7 @@ public:
private:
Common::Array<RailNode *> _nodes;
- Common::Array<int16 *> _edges;
+ Common::Array<int16> _edges;
Common::List<NoWalkRect *> _noWalkRects;
M4Surface *_walkCodes;