aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2009-05-09 00:32:05 +0000
committerWalter van Niftrik2009-05-09 00:32:05 +0000
commita70531f814d4d514a080fbdc14fc9c706db7ed7b (patch)
treef96963c6716e762c89fb72a767637a03a3acc175
parentbe7acea2172457121d079c9c4c8ffa67aeecf2a7 (diff)
downloadscummvm-rg350-a70531f814d4d514a080fbdc14fc9c706db7ed7b.tar.gz
scummvm-rg350-a70531f814d4d514a080fbdc14fc9c706db7ed7b.tar.bz2
scummvm-rg350-a70531f814d4d514a080fbdc14fc9c706db7ed7b.zip
SCI: AvoidPath: another workaround for ECO.
svn-id: r40397
-rw-r--r--engines/sci/engine/kpathing.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index a93cc8d44d..13830fba3d 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -1239,7 +1239,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
}
}
- // WORKAROUND: self-intersecting polygons in ECO, rooms 280 and 300
+ // WORKAROUND: self-intersecting polygons in ECO, rooms 221, 280 and 300
if ((size == 11) && (s->_gameName == "eco")) {
if ((KP_UINT(s->script_000->locals_block->locals[13]) == 300)
&& (read_point(list, is_reg_t, 10) == Common::Point(221, 0))) {
@@ -1254,6 +1254,18 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
size = 10;
}
}
+ if ((size == 16) && (s->_gameName == "eco")) {
+ if ((KP_UINT(s->script_000->locals_block->locals[13]) == 221)
+ && (read_point(list, is_reg_t, 1) == Common::Point(419, 175))) {
+ debug(1, "Applying fix for self-intersecting polygon in ECO, room 221");
+ // Swap the first two points
+ poly->vertices.insertHead(new Vertex(read_point(list, is_reg_t, 1)));
+ poly->vertices.insertHead(new Vertex(read_point(list, is_reg_t, 0)));
+ size = 14;
+ assert(!is_reg_t);
+ list += 2 * POLY_POINT_SIZE;
+ }
+ }
for (i = 0; i < size; i++) {
Vertex *vertex = new Vertex(read_point(list, is_reg_t, i));