SCI: AvoidPath: another workaround for ECO.

svn-id: r40397
This commit is contained in:
Walter van Niftrik 2009-05-09 00:32:05 +00:00
parent be7acea217
commit a70531f814

View File

@ -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));