aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorWalter van Niftrik2009-03-24 21:03:50 +0000
committerWalter van Niftrik2009-03-24 21:03:50 +0000
commite8b38af014a2a3da6251e0e7b11637795a05f4d8 (patch)
tree544c0cfc8fd7c5774f1f80a0338a7892ac2c691e /engines/sci/engine
parentfc9e5b6beb919ca248075536b80cce5c7972f237 (diff)
downloadscummvm-rg350-e8b38af014a2a3da6251e0e7b11637795a05f4d8.tar.gz
scummvm-rg350-e8b38af014a2a3da6251e0e7b11637795a05f4d8.tar.bz2
scummvm-rg350-e8b38af014a2a3da6251e0e7b11637795a05f4d8.zip
SCI: Added workaround for broken polygon in LSL1 room 350.
svn-id: r39674
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kpathing.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index decf0213e7..613252bc4d 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -1192,6 +1192,17 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
Polygon *poly = new Polygon(KP_UINT(GET_SEL32(polygon, type)));
int is_reg_t = polygon_is_reg_t(list, size);
+ // WORKAROUND: broken polygon in LSL1VGA, room 350, after opening elevator
+ // Polygon has 17 points but size is set to 19
+ if ((strcmp(s->game_name, "LSL1") == 0)) {
+ // FIXME: implement function to get current room number
+ if ((KP_UINT(s->script_000->locals_block->locals[13]) == 350)
+ && (size == 19) && (read_point(list, is_reg_t, 18) == Common::Point(108, 137))) {
+ debug(1, "Applying fix for broken polygon in LSL1, room 350");
+ size = 17;
+ }
+ }
+
for (i = 0; i < size; i++) {
Vertex *vertex = new Vertex(read_point(list, is_reg_t, i));
poly->vertices.insertHead(vertex);