From b2cb41580e7caf7e56a0bb60afce785605f76ae0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 5 Jan 2020 00:56:11 +0100 Subject: DIRECTOR: LINGO: Fix grammar for 'the entities' with id --- engines/director/lingo/lingo-gr.cpp | 654 ++++++++++++++++++------------------ engines/director/lingo/lingo-gr.y | 4 +- 2 files changed, 325 insertions(+), 333 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index d4448546ee..0eaeab1e62 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -552,7 +552,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 126 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1638 +#define YYLAST 1598 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 107 @@ -561,7 +561,7 @@ union yyalloc /* YYNRULES -- Number of rules. */ #define YYNRULES 160 /* YYNRULES -- Number of states. */ -#define YYNSTATES 343 +#define YYNSTATES 342 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -642,7 +642,7 @@ static const yytype_int16 yyrhs[] = 30, -1, 52, 128, 45, 129, -1, 52, 128, 74, 128, -1, 52, 128, 75, 128, -1, 54, 30, 68, 128, -1, 54, 15, 68, 128, -1, 54, 30, 56, - 128, -1, 54, 15, 56, 128, -1, 54, 16, 128, + 128, -1, 54, 15, 56, 128, -1, 54, 16, 127, 56, 128, -1, 54, 16, 127, 68, 128, -1, 54, 37, 56, 128, -1, 145, -1, 128, -1, 130, -1, 145, -1, 128, -1, 130, -1, 117, -1, 111, -1, @@ -661,7 +661,7 @@ static const yytype_int16 yyrhs[] = 113, -1, 57, 30, 55, -1, 86, -1, 12, -1, 17, -1, 33, -1, 31, -1, 30, -1, 127, -1, 129, -1, 25, -1, 26, 128, -1, 27, 146, -1, - 30, 102, 146, 103, -1, 15, -1, 16, 128, -1, + 30, 102, 146, 103, -1, 15, -1, 16, 127, -1, 37, -1, 110, -1, 128, 96, 128, -1, 128, 97, 128, -1, 128, 98, 128, -1, 128, 99, 128, -1, 128, 73, 128, -1, 128, 94, 128, -1, 128, 93, @@ -828,7 +828,7 @@ static const yytype_uint8 yydefact[] = 51, 0, 0, 101, 0, 0, 0, 156, 0, 3, 66, 26, 7, 27, 0, 0, 0, 0, 0, 57, 20, 58, 21, 104, 105, 6, 45, 19, 4, 56, - 0, 64, 113, 112, 157, 115, 156, 60, 61, 56, + 64, 56, 0, 113, 112, 157, 115, 156, 60, 61, 102, 156, 159, 155, 156, 45, 106, 119, 108, 125, 0, 126, 0, 127, 128, 130, 139, 103, 0, 41, 0, 0, 0, 0, 0, 141, 117, 133, 134, 136, @@ -838,33 +838,33 @@ static const yytype_uint8 yydefact[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, 156, 0, 0, 118, 157, 0, 0, 138, 147, 0, 132, 0, 129, 45, - 0, 0, 0, 42, 0, 0, 57, 0, 0, 0, - 0, 50, 0, 135, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 87, 88, 2, - 47, 46, 0, 31, 46, 0, 47, 76, 77, 74, - 75, 78, 79, 71, 82, 83, 84, 73, 72, 81, - 67, 68, 69, 70, 148, 0, 158, 62, 160, 0, - 120, 131, 147, 8, 9, 10, 11, 15, 13, 0, - 0, 14, 12, 18, 116, 124, 91, 0, 93, 0, - 95, 0, 97, 0, 89, 90, 122, 99, 156, 46, - 0, 47, 0, 33, 46, 154, 0, 154, 0, 17, - 16, 0, 0, 0, 0, 0, 48, 49, 0, 0, - 0, 46, 0, 0, 0, 47, 149, 47, 154, 92, - 94, 96, 98, 100, 28, 0, 46, 36, 46, 32, - 150, 145, 143, 47, 46, 47, 44, 46, 36, 0, - 0, 151, 140, 47, 46, 45, 0, 37, 46, 45, - 40, 152, 144, 46, 0, 47, 34, 0, 0, 0, - 0, 29, 46, 47, 46, 153, 30, 0, 46, 0, - 35, 38, 39 + 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, + 50, 0, 135, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 87, 88, 2, 47, + 46, 0, 31, 46, 0, 47, 76, 77, 74, 75, + 78, 79, 71, 82, 83, 84, 73, 72, 81, 67, + 68, 69, 70, 148, 0, 158, 62, 160, 0, 120, + 131, 147, 8, 9, 10, 11, 15, 13, 0, 0, + 14, 12, 18, 116, 124, 91, 0, 93, 0, 95, + 0, 97, 0, 89, 90, 122, 99, 156, 46, 0, + 47, 0, 33, 46, 154, 0, 154, 0, 16, 17, + 0, 0, 0, 0, 0, 48, 49, 0, 0, 0, + 46, 0, 0, 0, 47, 149, 47, 154, 92, 94, + 96, 98, 100, 28, 0, 46, 36, 46, 32, 150, + 145, 143, 47, 46, 47, 44, 46, 36, 0, 0, + 151, 140, 47, 46, 45, 0, 37, 46, 45, 40, + 152, 144, 46, 0, 47, 34, 0, 0, 0, 0, + 29, 46, 47, 46, 153, 30, 0, 46, 0, 35, + 38, 39 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 48, 49, 50, 51, 131, 277, 53, 307, 308, - 132, 54, 55, 56, 309, 155, 200, 259, 57, 58, + -1, 48, 49, 50, 51, 131, 276, 53, 306, 307, + 132, 54, 55, 56, 308, 155, 199, 258, 57, 58, 59, 60, 61, 62, 88, 119, 111, 63, 95, 64, - 84, 65, 169, 85, 66, 225, 322, 285, 67, 161, + 84, 65, 169, 85, 66, 224, 321, 284, 67, 161, 83 }; @@ -873,50 +873,50 @@ static const yytype_int16 yydefgoto[] = #define YYPACT_NINF -268 static const yytype_int16 yypact[] = { - 316, -42, -268, -268, 976, -268, -268, 976, 976, 976, - 21, -268, 976, 976, 57, 1009, -268, -268, -268, -268, - -268, 15, 40, 854, -268, 55, 976, -38, 41, 64, - 71, 976, 915, 80, 976, 976, 976, 976, 976, 976, - -268, 81, 82, 11, 976, 976, 976, 976, 2, -268, - -268, -268, -268, -268, 976, 46, 976, 680, 976, -268, - 1526, -268, -268, -268, -268, -268, -268, -268, -268, 13, - 976, 1526, 1526, 1526, 1526, 10, 976, 1526, 10, -268, - -268, 976, 1526, 12, 976, -268, -268, -268, 14, -268, - 976, -268, 69, -268, 1062, -268, -268, 1048, 89, -268, - -31, 976, 36, 65, 72, -268, 1420, -268, 1062, -268, - -268, 18, -268, 1098, 1132, 1166, 1200, 1492, -268, 20, - -268, 100, -268, -268, 1454, 3, -268, 407, 1526, 976, - 1526, -268, -268, 976, 1526, -268, -268, 1370, 976, 976, - 976, 976, 976, 976, 976, 976, 976, 976, 976, 976, - 976, 976, 976, 976, 976, 101, 976, 1048, 976, 10, - 1454, -27, 976, 10, 101, 102, 1526, 976, -268, -268, - 77, 976, 976, -268, 976, 976, 83, 1406, 976, 976, - 976, -268, 976, -268, 103, 976, 976, 976, 976, 976, - 976, 976, 976, 976, 976, 125, -10, -268, -268, -268, - -268, 1526, 104, -268, 1526, 976, -268, -50, -50, -50, - -50, 1539, 1539, -268, -34, -50, -50, -50, -50, -34, - -15, -15, -268, -268, -268, -77, 1526, -268, 1526, -46, - -268, 1526, 101, -268, -268, 1526, 1526, 1526, -50, 976, - 976, 1526, -50, 1526, 1526, -268, 1526, 1234, 1526, 1268, - 1526, 1302, 1526, 1336, 1526, 1526, -268, -268, 976, 589, - -20, -268, 105, 1526, 589, 50, 127, 50, -6, -50, - 1526, 976, 976, 976, 976, -1, -268, -268, 70, 106, - 976, 589, 771, 73, 134, -268, -268, -268, 50, 1526, - 1526, 1526, 1526, -268, -268, 976, 1526, 126, -268, -268, - -268, 498, 589, -268, 1526, -268, -268, 130, 126, 976, - -23, 142, 589, -268, 589, -268, 90, -268, 1526, -268, - -268, -268, 67, 589, 107, -268, -268, 136, 771, 162, - 108, -268, 589, -268, -268, -268, -268, 110, 589, 112, - -268, -268, -268 + 312, -79, -268, -268, 73, -268, -268, 972, 972, 972, + 5, -268, 972, 972, 73, 1005, -268, -268, -268, -268, + -268, -36, 46, 850, -268, 62, 972, -13, 65, 71, + 79, 972, 911, 81, 972, 972, 972, 972, 972, 972, + -268, 82, 83, -76, 972, 972, 972, 972, 9, -268, + -268, -268, -268, -268, 972, 47, 972, 676, 972, -268, + 1486, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, 12, 972, 1486, 1486, 1486, 10, 972, 1486, 10, + -268, 972, 1486, 11, 972, -268, -268, -268, 17, -268, + 972, -268, 76, -268, 1058, -268, -268, 1044, 88, -268, + -14, 73, 7, 69, 72, -268, 1380, -268, 1058, -268, + -268, 22, -268, 1094, 1128, 1162, 1196, 1452, -268, 23, + -268, 100, -268, -268, 1414, -44, -268, 403, 1486, 972, + 1486, -268, -268, 972, 1486, -268, -268, 1366, 972, 972, + 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + 972, 972, 972, 972, 972, 120, 972, 1044, 972, 10, + 1414, -88, 972, 10, 120, 122, 1486, 972, -268, -268, + 70, 972, 972, -268, 972, 972, 26, 972, 972, 972, + -268, 972, -268, 123, 972, 972, 972, 972, 972, 972, + 972, 972, 972, 972, 124, -10, -268, -268, -268, -268, + 1486, 101, -268, 1486, 972, -268, -40, -40, -40, -40, + 1499, 1499, -268, -30, -40, -40, -40, -40, -30, -1, + -1, -268, -268, -268, -53, 1486, -268, 1486, -17, -268, + 1486, 120, -268, -268, 1486, 1486, 1486, -40, 972, 972, + 1486, -40, 1486, 1486, -268, 1486, 1230, 1486, 1264, 1486, + 1298, 1486, 1332, 1486, 1486, -268, -268, 972, 585, -4, + -268, 102, 1486, 585, 52, 129, 52, -15, 1486, -40, + 972, 972, 972, 972, 2, -268, -268, 75, 105, 972, + 585, 767, 77, 132, -268, -268, -268, 52, 1486, 1486, + 1486, 1486, -268, -268, 972, 1486, 133, -268, -268, -268, + 494, 585, -268, 1486, -268, -268, 136, 133, 972, -26, + 157, 585, -268, 585, -268, 98, -268, 1486, -268, -268, + -268, 57, 585, 99, -268, -268, 138, 767, 161, 103, + -268, 585, -268, -268, -268, -268, 106, 585, 108, -268, + -268, -268 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -268, -268, 76, -268, -267, -268, 1, -268, -114, -268, - -268, -268, -268, 147, -268, -78, -8, -108, -268, -268, - -2, -4, 37, 149, -268, -268, -268, -268, -19, -268, - -268, -268, -268, -268, -268, -150, -268, -250, 151, -3, + -268, -268, 68, -268, -267, -268, 21, -268, -108, -268, + -268, -268, -268, 144, -268, -81, -11, -84, -268, -268, + 6, -7, 33, 147, -268, -268, -268, -268, -21, -268, + -268, -268, -268, -268, -268, -152, -268, -243, 148, -6, -268 }; @@ -927,132 +927,135 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -6 static const yytype_int16 yytable[] = { - 71, 52, 126, 72, 73, 74, 75, 164, 77, 74, - 78, 82, 80, 109, 229, 298, 319, 287, 279, 94, - 98, 99, 97, 144, 265, 174, 145, 106, 108, 266, - 112, 113, 114, 115, 116, 117, 280, 175, 303, 144, - 122, 123, 124, 74, 125, 150, 151, 152, 153, 154, - 128, 76, 130, 134, 137, 267, 100, 101, 144, 68, - 266, 334, 151, 152, 153, 154, 157, 320, 86, 2, - 87, 102, 74, 159, 5, 168, 227, 160, 103, 158, - 74, 163, 268, 153, 154, 96, 166, 79, 16, 183, - 17, 232, 178, 257, 104, 288, 258, 177, 264, 176, - 266, 105, 293, 127, 179, 158, 14, 233, 198, 158, - 110, 118, 120, 121, 129, 156, 158, 167, 162, 173, - 165, 180, 202, 203, 184, 201, 195, 181, 52, 204, - 196, 224, 230, 245, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 239, 74, 281, 226, 256, 284, 286, 228, 261, - 282, 294, 295, 231, 300, 299, 306, 235, 236, 315, - 237, 238, 321, 329, 241, 242, 243, 301, 244, 302, - 326, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 333, 335, 260, 317, 312, 262, 314, 331, 336, - 340, 263, 342, 199, 133, 323, 135, 234, 136, 0, - 0, 0, 0, 0, 0, 0, 0, 332, 0, 0, - 0, 0, 0, 0, 0, 338, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 269, 270, 325, 0, 0, - 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 278, 0, 0, 74, 275, 283, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 289, 290, 291, - 292, 0, 0, 297, 0, 0, 296, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 305, 0, - 310, 304, 0, 0, 0, 0, 313, 0, 0, 316, - 0, 0, 0, 0, 0, 318, 324, 0, 0, 0, - 327, 0, 0, 0, 0, 330, -5, 1, 0, 0, - 0, 0, 0, 0, 337, 0, 339, 0, 2, 0, - 341, 3, 4, 5, 0, 6, 7, 8, 9, 10, + 73, 74, 75, 76, 164, 78, 75, 79, 82, 126, + 70, 109, 228, 318, 297, 226, 94, 86, 158, 97, + 80, 52, 68, 286, 106, 108, 121, 112, 113, 114, + 115, 116, 117, 144, 278, 77, 145, 122, 123, 124, + 75, 125, 174, 144, 302, 98, 99, 128, 264, 130, + 134, 137, 279, 265, 175, 150, 151, 152, 153, 154, + 333, 197, 158, 177, 319, 157, 151, 152, 153, 154, + 75, 159, 144, 168, 160, 178, 87, 75, 163, 267, + 100, 101, 238, 166, 266, 2, 287, 182, 231, 265, + 5, 265, 96, 256, 239, 102, 257, 153, 154, 14, + 232, 104, 103, 69, 16, 292, 17, 176, 158, 105, + 127, 110, 118, 120, 156, 129, 158, 162, 173, 201, + 202, 263, 200, 165, 167, 179, 203, 180, 183, 194, + 195, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 52, 75, + 223, 225, 229, 244, 255, 227, 260, 281, 283, 285, + 230, 294, 299, 328, 234, 235, 293, 236, 237, 298, + 240, 241, 242, 305, 243, 314, 280, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 320, 325, 259, + 330, 334, 261, 332, 335, 198, 339, 262, 341, 316, + 300, 133, 301, 233, 135, 136, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 311, 0, + 313, 0, 0, 0, 0, 0, 0, 0, 322, 0, + 0, 268, 269, 324, 0, 0, 0, 327, 0, 0, + 331, 0, 0, 0, 0, 0, 0, 277, 337, 0, + 75, 274, 282, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 288, 289, 290, 291, 0, 0, 296, + 0, 0, 295, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 304, 0, 309, 303, 0, 0, + 0, 0, 312, 0, 0, 315, 0, 0, 0, 0, + 0, 317, 323, 0, 0, 0, 326, 0, 0, 0, + 0, 329, -5, 1, 0, 0, 0, 0, 0, 0, + 336, 0, 338, 0, 2, 0, 340, 3, 4, 5, + 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, + 0, 14, 15, 16, 0, 17, 0, 18, 19, 20, + 0, 0, 0, 21, 22, 23, 24, 0, 0, 25, + 0, 0, 0, 0, 26, 27, 28, 0, 0, 29, + 0, 0, 0, 30, 31, 32, 0, 33, 0, 0, + 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, + 0, 35, 36, 37, 38, 39, 0, 0, 40, 41, + 42, 43, 0, 0, 0, 0, 0, 0, 44, 45, + 0, 0, 0, -5, 46, 2, 47, 0, 3, 4, + 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, + 13, 0, 14, 15, 16, 0, 17, 0, 18, 19, + 20, 0, 0, 0, 21, 22, 23, 24, 0, 0, + 25, 0, 0, 0, 0, 26, 27, 28, 0, 0, + 29, 0, 0, 0, 30, 31, 32, 0, 33, 0, + 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, + 0, 0, 35, 36, 37, 38, 39, 0, 0, 40, + 41, 42, 43, 0, 0, 0, 0, 0, 0, 44, + 45, 0, 0, 0, 0, 46, 2, 47, 0, 3, + 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, + 12, 13, 0, 14, 15, 16, 0, 17, 310, 18, + 0, 20, 0, 0, 0, 21, 22, 23, 24, 0, + 0, 0, 0, 0, 0, 0, 26, 27, 28, 0, + 0, 29, 0, 0, 0, 0, 31, 32, 0, 33, + 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 35, 36, 37, 38, 39, 0, 0, + 40, 41, 0, 43, 0, 0, 0, 0, 0, 0, + 44, 45, 0, 0, 0, 275, 46, 2, 47, 0, + 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, + 11, 12, 13, 0, 14, 15, 16, 0, 17, 0, + 18, 0, 20, 0, 0, 0, 21, 22, 23, 24, + 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, + 0, 0, 29, 0, 0, 0, 0, 31, 32, 0, + 33, 0, 0, 0, 0, 0, 0, 34, 0, 0, + 0, 0, 0, 0, 35, 36, 37, 38, 39, 0, + 0, 40, 41, 0, 43, 0, 0, 0, 0, 0, + 0, 44, 45, 0, 0, 0, 275, 46, 2, 47, + 0, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, 0, 14, 15, 16, 0, 17, - 0, 18, 19, 20, 0, 0, 0, 21, 22, 23, - 24, 0, 0, 25, 0, 0, 0, 0, 26, 27, - 28, 0, 0, 29, 0, 0, 0, 30, 31, 32, + 0, 18, 0, 20, 0, 0, 0, 21, 22, 23, + 24, 0, 0, 0, 0, 0, 0, 0, 26, 0, + 28, 0, 0, 0, 0, 0, 0, 0, 31, 32, 0, 33, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 35, 36, 37, 38, 39, - 0, 0, 40, 41, 42, 43, 0, 0, 0, 0, - 0, 0, 44, 45, 0, 0, 0, -5, 46, 2, + 0, 0, 0, 41, 0, 43, 0, 0, 0, 0, + 0, 0, 44, 45, 0, 0, 0, 0, 46, 2, 47, 0, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, 0, 14, 15, 16, 0, - 17, 0, 18, 19, 20, 0, 0, 0, 21, 22, - 23, 24, 0, 0, 25, 0, 0, 0, 0, 26, - 27, 28, 0, 0, 29, 0, 0, 0, 30, 31, + 17, 0, 18, 0, 20, 0, 0, 0, 21, 22, + 23, 0, 0, 0, 0, 0, 0, 0, 0, 26, + 0, 28, 0, 0, 0, 0, 0, 0, 0, 31, 32, 0, 33, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 35, 36, 37, 38, - 39, 0, 0, 40, 41, 42, 43, 0, 0, 0, - 0, 0, 0, 44, 45, 0, 0, 0, 0, 46, - 2, 47, 0, 3, 4, 5, 0, 6, 7, 8, - 9, 10, 0, 11, 12, 13, 0, 14, 15, 16, - 0, 17, 311, 18, 0, 20, 0, 0, 0, 21, - 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, - 26, 27, 28, 0, 0, 29, 0, 0, 0, 0, - 31, 32, 0, 33, 0, 0, 0, 0, 0, 0, - 34, 0, 0, 0, 0, 0, 0, 35, 36, 37, - 38, 39, 0, 0, 40, 41, 0, 43, 0, 0, - 0, 0, 0, 0, 44, 45, 0, 0, 0, 276, - 46, 2, 47, 0, 3, 4, 5, 0, 6, 7, - 8, 9, 10, 0, 11, 12, 13, 0, 14, 15, - 16, 0, 17, 0, 18, 0, 20, 0, 0, 0, - 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, - 0, 26, 27, 28, 0, 0, 29, 0, 0, 0, - 0, 31, 32, 0, 33, 0, 0, 0, 0, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 35, 36, - 37, 38, 39, 0, 0, 40, 41, 0, 43, 0, - 0, 0, 0, 0, 0, 44, 45, 0, 0, 0, - 276, 46, 2, 47, 0, 3, 4, 5, 0, 6, - 7, 8, 9, 10, 0, 11, 12, 13, 0, 14, - 15, 16, 0, 17, 0, 18, 0, 20, 0, 0, - 0, 21, 22, 23, 24, 0, 0, 0, 0, 0, - 0, 0, 26, 0, 28, 0, 0, 0, 0, 0, - 0, 0, 31, 32, 0, 33, 0, 0, 0, 0, - 0, 0, 34, 0, 0, 0, 0, 0, 0, 35, - 36, 37, 38, 39, 0, 0, 0, 41, 0, 43, - 0, 0, 0, 0, 0, 0, 44, 45, 0, 0, - 0, 0, 46, 2, 47, 0, 3, 4, 5, 0, - 6, 7, 8, 9, 10, 0, 11, 12, 13, 0, - 14, 15, 16, 0, 17, 0, 18, 0, 20, 0, - 0, 0, 21, 22, 23, 0, 0, 0, 0, 0, - 0, 0, 0, 26, 0, 28, 0, 0, 0, 0, - 0, 0, 0, 31, 32, 0, 33, 0, 0, 0, - 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, - 35, 36, 37, 38, 39, 0, 0, 0, 41, 0, - 43, 0, 0, 0, 0, 0, 2, 44, 45, 3, - 4, 5, 0, 46, 0, 47, 0, 0, 0, 11, - 12, 13, 0, 14, 69, 16, 0, 17, 0, 0, - 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 0, 90, 91, 92, 93, 70, 0, 28, 0, + 39, 0, 0, 0, 41, 0, 43, 0, 0, 0, + 0, 0, 2, 44, 45, 3, 4, 5, 0, 46, + 0, 47, 0, 0, 0, 11, 12, 13, 0, 14, + 71, 16, 0, 17, 0, 0, 0, 20, 0, 0, + 0, 0, 0, 0, 0, 0, 89, 0, 90, 91, + 92, 93, 72, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 34, 2, 0, 0, - 3, 4, 5, 35, 36, 37, 38, 39, 0, 0, - 11, 12, 13, 43, 14, 69, 16, 0, 17, 0, - 44, 45, 20, 0, 0, 0, 46, 0, 47, 0, - 0, 0, 0, 90, 0, 92, 0, 70, 0, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, - 0, 0, 0, 0, 0, 0, 0, 34, 2, 0, - 0, 3, 4, 5, 35, 36, 37, 38, 39, 0, - 0, 11, 12, 13, 43, 14, 69, 16, 0, 17, - 0, 44, 45, 20, 0, 0, 0, 46, 0, 47, - 0, 2, 0, 0, 3, 4, 5, 0, 70, 0, - 28, 0, 0, 0, 11, 12, 13, 0, 14, 69, - 16, 0, 17, 0, 0, 0, 20, 0, 34, 0, - 0, 0, 0, 0, 0, 35, 36, 37, 38, 39, - 0, 70, 0, 28, 0, 43, 0, 0, 0, 0, - 0, 0, 44, 45, 0, 0, 0, 0, 46, 0, - 47, 34, 0, 0, 0, 0, 0, 0, 35, 36, - 37, 38, 39, 170, 0, 0, 0, 0, 43, 0, - 0, 0, 0, 0, 0, 44, 45, 0, 0, 0, - 90, 81, 92, 47, 138, 139, 140, 141, 142, 143, - 0, 144, 171, 172, 145, 146, 147, 0, 138, 139, - 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 185, 0, - 0, 0, 0, 0, 186, 148, 149, 150, 151, 152, - 153, 154, 0, 0, 138, 139, 140, 141, 142, 143, + 0, 0, 34, 2, 0, 0, 3, 4, 5, 35, + 36, 37, 38, 39, 0, 0, 11, 12, 13, 43, + 14, 71, 16, 0, 17, 0, 44, 45, 20, 0, + 0, 0, 46, 0, 47, 0, 0, 0, 0, 90, + 0, 92, 0, 72, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, + 0, 0, 0, 34, 2, 0, 0, 3, 4, 5, + 35, 36, 37, 38, 39, 0, 0, 11, 12, 13, + 43, 14, 71, 16, 0, 17, 0, 44, 45, 20, + 0, 0, 0, 46, 0, 47, 0, 2, 0, 0, + 3, 4, 5, 0, 72, 0, 28, 0, 0, 0, + 11, 12, 13, 0, 14, 71, 16, 0, 17, 0, + 0, 0, 20, 0, 34, 0, 0, 0, 0, 0, + 0, 35, 36, 37, 38, 39, 0, 72, 0, 28, + 0, 43, 0, 0, 0, 0, 0, 0, 44, 45, + 0, 0, 0, 0, 46, 0, 47, 34, 0, 0, + 0, 0, 0, 0, 35, 36, 37, 38, 39, 170, + 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, + 0, 44, 45, 0, 0, 0, 90, 81, 92, 47, + 138, 139, 140, 141, 142, 143, 0, 144, 171, 172, + 145, 146, 147, 0, 138, 139, 140, 141, 142, 143, + 0, 144, 0, 0, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 184, 0, 0, 0, 0, 0, + 185, 148, 149, 150, 151, 152, 153, 154, 0, 0, + 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, + 145, 146, 147, 0, 0, 0, 0, 0, 186, 0, + 0, 0, 0, 0, 187, 0, 0, 148, 149, 150, + 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, 147, 0, 0, 0, - 0, 0, 187, 0, 0, 0, 0, 0, 188, 0, + 0, 0, 188, 0, 0, 0, 0, 0, 189, 0, 0, 148, 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, - 147, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 0, 190, 0, 0, 148, 149, 150, 151, 152, + 147, 0, 0, 0, 0, 0, 190, 0, 0, 0, + 0, 0, 191, 0, 0, 148, 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, 147, 0, 0, 0, 0, 0, - 191, 0, 0, 0, 0, 0, 192, 0, 0, 148, + 270, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, 147, 0, 0, 0, 0, 0, 271, 0, 0, 0, 0, 0, @@ -1065,26 +1068,19 @@ static const yytype_int16 yytable[] = 0, 0, 273, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, - 147, 0, 0, 0, 0, 0, 274, 0, 0, 0, - 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, - 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, - 0, 0, 145, 146, 147, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 205, 0, 0, 148, - 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, - 142, 143, 0, 144, 0, 0, 145, 146, 147, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 240, 148, 149, 150, 151, 152, 153, 154, - 0, 206, 138, 139, 140, 141, 142, 143, 182, 144, + 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 204, 0, 0, 148, 149, 150, 151, 152, + 153, 154, 138, 139, 140, 141, 142, 143, 181, 144, 0, 0, 145, 146, 147, 0, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 0, 0, 0, 0, + 149, 150, 151, 152, 153, 154, 0, 205, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, - 151, 152, 153, 154, 0, 0, 0, 197, 138, 139, + 151, 152, 153, 154, 0, 0, 0, 196, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, - 147, 0, 0, 0, 0, 0, 193, 194, 0, 0, + 147, 0, 0, 0, 0, 0, 192, 193, 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, 154, 138, 139, 140, 141, 142, 143, 0, 144, 0, 0, 145, 146, 147, 138, 139, 140, 141, 0, @@ -1095,123 +1091,126 @@ static const yytype_int16 yytable[] = static const yytype_int16 yycheck[] = { - 4, 0, 0, 7, 8, 9, 9, 85, 12, 13, - 13, 15, 14, 32, 164, 282, 39, 267, 38, 23, - 58, 59, 26, 73, 101, 56, 76, 31, 32, 106, - 34, 35, 36, 37, 38, 39, 56, 68, 288, 73, - 44, 45, 46, 47, 47, 95, 96, 97, 98, 99, - 54, 30, 56, 57, 58, 101, 15, 16, 73, 101, - 106, 328, 96, 97, 98, 99, 70, 90, 53, 12, - 30, 30, 76, 76, 17, 94, 103, 81, 37, 106, - 84, 84, 232, 98, 99, 30, 90, 30, 31, 108, - 33, 169, 56, 103, 30, 101, 106, 101, 206, 101, - 106, 30, 103, 101, 68, 106, 29, 30, 105, 106, - 30, 30, 30, 102, 68, 102, 106, 48, 106, 30, - 106, 56, 130, 131, 106, 129, 106, 55, 127, 133, - 30, 30, 30, 30, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 68, 156, 261, 158, 30, 106, 30, 162, 55, - 55, 91, 56, 167, 30, 92, 40, 171, 172, 39, - 174, 175, 30, 106, 178, 179, 180, 285, 182, 287, - 90, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 55, 30, 201, 308, 303, 204, 305, 91, 91, - 90, 205, 90, 127, 57, 313, 57, 170, 57, -1, - -1, -1, -1, -1, -1, -1, -1, 325, -1, -1, - -1, -1, -1, -1, -1, 333, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 239, 240, 315, -1, -1, - -1, 319, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 259, -1, -1, 258, 258, 264, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 271, 272, 273, - 274, -1, -1, 281, -1, -1, 280, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 296, -1, - 298, 295, -1, -1, -1, -1, 304, -1, -1, 307, - -1, -1, -1, -1, -1, 309, 314, -1, -1, -1, - 318, -1, -1, -1, -1, 323, 0, 1, -1, -1, - -1, -1, -1, -1, 332, -1, 334, -1, 12, -1, - 338, 15, 16, 17, -1, 19, 20, 21, 22, 23, + 7, 8, 9, 9, 85, 12, 13, 13, 15, 0, + 4, 32, 164, 39, 281, 103, 23, 53, 106, 26, + 14, 0, 101, 266, 31, 32, 102, 34, 35, 36, + 37, 38, 39, 73, 38, 30, 76, 44, 45, 46, + 47, 47, 56, 73, 287, 58, 59, 54, 101, 56, + 57, 58, 56, 106, 68, 95, 96, 97, 98, 99, + 327, 105, 106, 56, 90, 72, 96, 97, 98, 99, + 77, 77, 73, 94, 81, 68, 30, 84, 84, 231, + 15, 16, 56, 90, 101, 12, 101, 108, 169, 106, + 17, 106, 30, 103, 68, 30, 106, 98, 99, 29, + 30, 30, 37, 30, 31, 103, 33, 101, 106, 30, + 101, 30, 30, 30, 102, 68, 106, 106, 30, 130, + 131, 205, 129, 106, 48, 56, 133, 55, 106, 106, + 30, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 127, 156, + 30, 158, 30, 30, 30, 162, 55, 55, 106, 30, + 167, 56, 30, 106, 171, 172, 91, 174, 175, 92, + 177, 178, 179, 40, 181, 39, 260, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 30, 90, 200, + 91, 30, 203, 55, 91, 127, 90, 204, 90, 307, + 284, 57, 286, 170, 57, 57, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 302, -1, + 304, -1, -1, -1, -1, -1, -1, -1, 312, -1, + -1, 238, 239, 314, -1, -1, -1, 318, -1, -1, + 324, -1, -1, -1, -1, -1, -1, 258, 332, -1, + 257, 257, 263, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 270, 271, 272, 273, -1, -1, 280, + -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 295, -1, 297, 294, -1, -1, + -1, -1, 303, -1, -1, 306, -1, -1, -1, -1, + -1, 308, 313, -1, -1, -1, 317, -1, -1, -1, + -1, 322, 0, 1, -1, -1, -1, -1, -1, -1, + 331, -1, 333, -1, 12, -1, 337, 15, 16, 17, + -1, 19, 20, 21, 22, 23, -1, 25, 26, 27, + -1, 29, 30, 31, -1, 33, -1, 35, 36, 37, + -1, -1, -1, 41, 42, 43, 44, -1, -1, 47, + -1, -1, -1, -1, 52, 53, 54, -1, -1, 57, + -1, -1, -1, 61, 62, 63, -1, 65, -1, -1, + -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, + -1, 79, 80, 81, 82, 83, -1, -1, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, 96, 97, + -1, -1, -1, 101, 102, 12, 104, -1, 15, 16, + 17, -1, 19, 20, 21, 22, 23, -1, 25, 26, + 27, -1, 29, 30, 31, -1, 33, -1, 35, 36, + 37, -1, -1, -1, 41, 42, 43, 44, -1, -1, + 47, -1, -1, -1, -1, 52, 53, 54, -1, -1, + 57, -1, -1, -1, 61, 62, 63, -1, 65, -1, + -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, -1, -1, 86, + 87, 88, 89, -1, -1, -1, -1, -1, -1, 96, + 97, -1, -1, -1, -1, 102, 12, 104, -1, 15, + 16, 17, -1, 19, 20, 21, 22, 23, -1, 25, + 26, 27, -1, 29, 30, 31, -1, 33, 34, 35, + -1, 37, -1, -1, -1, 41, 42, 43, 44, -1, + -1, -1, -1, -1, -1, -1, 52, 53, 54, -1, + -1, 57, -1, -1, -1, -1, 62, 63, -1, 65, + -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, + -1, -1, -1, 79, 80, 81, 82, 83, -1, -1, + 86, 87, -1, 89, -1, -1, -1, -1, -1, -1, + 96, 97, -1, -1, -1, 101, 102, 12, 104, -1, + 15, 16, 17, -1, 19, 20, 21, 22, 23, -1, + 25, 26, 27, -1, 29, 30, 31, -1, 33, -1, + 35, -1, 37, -1, -1, -1, 41, 42, 43, 44, + -1, -1, -1, -1, -1, -1, -1, 52, 53, 54, + -1, -1, 57, -1, -1, -1, -1, 62, 63, -1, + 65, -1, -1, -1, -1, -1, -1, 72, -1, -1, + -1, -1, -1, -1, 79, 80, 81, 82, 83, -1, + -1, 86, 87, -1, 89, -1, -1, -1, -1, -1, + -1, 96, 97, -1, -1, -1, 101, 102, 12, 104, + -1, 15, 16, 17, -1, 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, 29, 30, 31, -1, 33, - -1, 35, 36, 37, -1, -1, -1, 41, 42, 43, - 44, -1, -1, 47, -1, -1, -1, -1, 52, 53, - 54, -1, -1, 57, -1, -1, -1, 61, 62, 63, + -1, 35, -1, 37, -1, -1, -1, 41, 42, 43, + 44, -1, -1, -1, -1, -1, -1, -1, 52, -1, + 54, -1, -1, -1, -1, -1, -1, -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, - -1, -1, 86, 87, 88, 89, -1, -1, -1, -1, - -1, -1, 96, 97, -1, -1, -1, 101, 102, 12, + -1, -1, -1, 87, -1, 89, -1, -1, -1, -1, + -1, -1, 96, 97, -1, -1, -1, -1, 102, 12, 104, -1, 15, 16, 17, -1, 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, 29, 30, 31, -1, - 33, -1, 35, 36, 37, -1, -1, -1, 41, 42, - 43, 44, -1, -1, 47, -1, -1, -1, -1, 52, - 53, 54, -1, -1, 57, -1, -1, -1, 61, 62, + 33, -1, 35, -1, 37, -1, -1, -1, 41, 42, + 43, -1, -1, -1, -1, -1, -1, -1, -1, 52, + -1, 54, -1, -1, -1, -1, -1, -1, -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, 79, 80, 81, 82, - 83, -1, -1, 86, 87, 88, 89, -1, -1, -1, - -1, -1, -1, 96, 97, -1, -1, -1, -1, 102, - 12, 104, -1, 15, 16, 17, -1, 19, 20, 21, - 22, 23, -1, 25, 26, 27, -1, 29, 30, 31, - -1, 33, 34, 35, -1, 37, -1, -1, -1, 41, - 42, 43, 44, -1, -1, -1, -1, -1, -1, -1, - 52, 53, 54, -1, -1, 57, -1, -1, -1, -1, - 62, 63, -1, 65, -1, -1, -1, -1, -1, -1, - 72, -1, -1, -1, -1, -1, -1, 79, 80, 81, - 82, 83, -1, -1, 86, 87, -1, 89, -1, -1, - -1, -1, -1, -1, 96, 97, -1, -1, -1, 101, - 102, 12, 104, -1, 15, 16, 17, -1, 19, 20, - 21, 22, 23, -1, 25, 26, 27, -1, 29, 30, - 31, -1, 33, -1, 35, -1, 37, -1, -1, -1, - 41, 42, 43, 44, -1, -1, -1, -1, -1, -1, - -1, 52, 53, 54, -1, -1, 57, -1, -1, -1, - -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, - -1, 72, -1, -1, -1, -1, -1, -1, 79, 80, - 81, 82, 83, -1, -1, 86, 87, -1, 89, -1, - -1, -1, -1, -1, -1, 96, 97, -1, -1, -1, - 101, 102, 12, 104, -1, 15, 16, 17, -1, 19, - 20, 21, 22, 23, -1, 25, 26, 27, -1, 29, - 30, 31, -1, 33, -1, 35, -1, 37, -1, -1, - -1, 41, 42, 43, 44, -1, -1, -1, -1, -1, - -1, -1, 52, -1, 54, -1, -1, -1, -1, -1, - -1, -1, 62, 63, -1, 65, -1, -1, -1, -1, - -1, -1, 72, -1, -1, -1, -1, -1, -1, 79, - 80, 81, 82, 83, -1, -1, -1, 87, -1, 89, - -1, -1, -1, -1, -1, -1, 96, 97, -1, -1, - -1, -1, 102, 12, 104, -1, 15, 16, 17, -1, - 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, - 29, 30, 31, -1, 33, -1, 35, -1, 37, -1, - -1, -1, 41, 42, 43, -1, -1, -1, -1, -1, - -1, -1, -1, 52, -1, 54, -1, -1, -1, -1, - -1, -1, -1, 62, 63, -1, 65, -1, -1, -1, - -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, - 79, 80, 81, 82, 83, -1, -1, -1, 87, -1, - 89, -1, -1, -1, -1, -1, 12, 96, 97, 15, - 16, 17, -1, 102, -1, 104, -1, -1, -1, 25, - 26, 27, -1, 29, 30, 31, -1, 33, -1, -1, - -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, - 46, -1, 48, 49, 50, 51, 52, -1, 54, -1, + 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, + -1, -1, 12, 96, 97, 15, 16, 17, -1, 102, + -1, 104, -1, -1, -1, 25, 26, 27, -1, 29, + 30, 31, -1, 33, -1, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, -1, 46, -1, 48, 49, + 50, 51, 52, -1, 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 72, 12, -1, -1, - 15, 16, 17, 79, 80, 81, 82, 83, -1, -1, - 25, 26, 27, 89, 29, 30, 31, -1, 33, -1, - 96, 97, 37, -1, -1, -1, 102, -1, 104, -1, - -1, -1, -1, 48, -1, 50, -1, 52, -1, 54, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, - -1, -1, -1, -1, -1, -1, -1, 72, 12, -1, - -1, 15, 16, 17, 79, 80, 81, 82, 83, -1, - -1, 25, 26, 27, 89, 29, 30, 31, -1, 33, - -1, 96, 97, 37, -1, -1, -1, 102, -1, 104, - -1, 12, -1, -1, 15, 16, 17, -1, 52, -1, - 54, -1, -1, -1, 25, 26, 27, -1, 29, 30, - 31, -1, 33, -1, -1, -1, 37, -1, 72, -1, - -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, - -1, 52, -1, 54, -1, 89, -1, -1, -1, -1, - -1, -1, 96, 97, -1, -1, -1, -1, 102, -1, - 104, 72, -1, -1, -1, -1, -1, -1, 79, 80, - 81, 82, 83, 45, -1, -1, -1, -1, 89, -1, - -1, -1, -1, -1, -1, 96, 97, -1, -1, -1, - 48, 102, 50, 104, 66, 67, 68, 69, 70, 71, - -1, 73, 74, 75, 76, 77, 78, -1, 66, 67, - 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, - 78, 93, 94, 95, 96, 97, 98, 99, 50, -1, - -1, -1, -1, -1, 56, 93, 94, 95, 96, 97, - 98, 99, -1, -1, 66, 67, 68, 69, 70, 71, + -1, -1, 72, 12, -1, -1, 15, 16, 17, 79, + 80, 81, 82, 83, -1, -1, 25, 26, 27, 89, + 29, 30, 31, -1, 33, -1, 96, 97, 37, -1, + -1, -1, 102, -1, 104, -1, -1, -1, -1, 48, + -1, 50, -1, 52, -1, 54, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, + -1, -1, -1, 72, 12, -1, -1, 15, 16, 17, + 79, 80, 81, 82, 83, -1, -1, 25, 26, 27, + 89, 29, 30, 31, -1, 33, -1, 96, 97, 37, + -1, -1, -1, 102, -1, 104, -1, 12, -1, -1, + 15, 16, 17, -1, 52, -1, 54, -1, -1, -1, + 25, 26, 27, -1, 29, 30, 31, -1, 33, -1, + -1, -1, 37, -1, 72, -1, -1, -1, -1, -1, + -1, 79, 80, 81, 82, 83, -1, 52, -1, 54, + -1, 89, -1, -1, -1, -1, -1, -1, 96, 97, + -1, -1, -1, -1, 102, -1, 104, 72, -1, -1, + -1, -1, -1, -1, 79, 80, 81, 82, 83, 45, + -1, -1, -1, -1, 89, -1, -1, -1, -1, -1, + -1, 96, 97, -1, -1, -1, 48, 102, 50, 104, + 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, + 76, 77, 78, -1, 66, 67, 68, 69, 70, 71, + -1, 73, -1, -1, 76, 77, 78, 93, 94, 95, + 96, 97, 98, 99, 50, -1, -1, -1, -1, -1, + 56, 93, 94, 95, 96, 97, 98, 99, -1, -1, + 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, + 76, 77, 78, -1, -1, -1, -1, -1, 50, -1, + -1, -1, -1, -1, 56, -1, -1, 93, 94, 95, + 96, 97, 98, 99, 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, 78, -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, 56, -1, -1, 93, 94, 95, 96, 97, 98, 99, 66, 67, @@ -1220,7 +1219,7 @@ static const yytype_int16 yycheck[] = -1, -1, 56, -1, -1, 93, 94, 95, 96, 97, 98, 99, 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, 78, -1, -1, -1, -1, -1, - 50, -1, -1, -1, -1, -1, 56, -1, -1, 93, + 50, -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 99, 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, 78, -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, @@ -1233,19 +1232,12 @@ static const yytype_int16 yycheck[] = -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 99, 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, - 78, -1, -1, -1, -1, -1, 50, -1, -1, -1, - -1, -1, -1, -1, -1, 93, 94, 95, 96, 97, - 98, 99, 66, 67, 68, 69, 70, 71, -1, 73, - -1, -1, 76, 77, 78, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 56, -1, -1, 93, - 94, 95, 96, 97, 98, 99, 66, 67, 68, 69, - 70, 71, -1, 73, -1, -1, 76, 77, 78, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 56, 93, 94, 95, 96, 97, 98, 99, - -1, 101, 66, 67, 68, 69, 70, 71, 58, 73, + 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 56, -1, -1, 93, 94, 95, 96, 97, + 98, 99, 66, 67, 68, 69, 70, 71, 58, 73, -1, -1, 76, 77, 78, -1, 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, 78, 93, - 94, 95, 96, 97, 98, 99, -1, -1, -1, -1, + 94, 95, 96, 97, 98, 99, -1, 101, -1, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 99, 66, 67, 68, 69, 70, 71, -1, 73, -1, -1, 76, 77, 78, -1, -1, -1, -1, -1, -1, -1, @@ -1272,7 +1264,7 @@ static const yytype_uint8 yystos[] = 86, 87, 88, 89, 96, 97, 102, 104, 108, 109, 110, 111, 113, 114, 118, 119, 120, 125, 126, 127, 128, 129, 130, 134, 136, 138, 141, 145, 101, 30, - 52, 128, 128, 128, 128, 146, 30, 128, 146, 30, + 127, 30, 52, 128, 128, 128, 146, 30, 128, 146, 127, 102, 128, 147, 137, 140, 53, 30, 131, 46, 48, 49, 50, 51, 128, 135, 30, 128, 58, 59, 15, 16, 30, 37, 30, 30, 128, 64, 128, 135, @@ -1282,24 +1274,24 @@ static const yytype_uint8 yystos[] = 68, 69, 70, 71, 73, 76, 77, 78, 93, 94, 95, 96, 97, 98, 99, 122, 102, 128, 106, 146, 128, 146, 106, 146, 122, 106, 128, 48, 135, 139, - 45, 74, 75, 30, 56, 68, 127, 128, 56, 68, - 56, 55, 58, 135, 106, 50, 56, 50, 56, 50, - 56, 50, 56, 84, 85, 106, 30, 103, 105, 109, - 123, 128, 123, 123, 128, 56, 101, 128, 128, 128, + 45, 74, 75, 30, 56, 68, 127, 56, 68, 56, + 55, 58, 135, 106, 50, 56, 50, 56, 50, 56, + 50, 56, 84, 85, 106, 30, 103, 105, 109, 123, + 128, 123, 123, 128, 56, 101, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 30, 142, 128, 103, 128, 142, - 30, 128, 122, 30, 129, 128, 128, 128, 128, 68, - 56, 128, 128, 128, 128, 30, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 30, 103, 106, 124, - 123, 55, 123, 128, 124, 101, 106, 101, 142, 128, - 128, 50, 50, 50, 50, 146, 101, 113, 123, 38, - 56, 124, 55, 123, 106, 144, 30, 144, 101, 128, - 128, 128, 128, 103, 91, 56, 128, 123, 111, 92, - 30, 124, 124, 144, 128, 123, 40, 115, 116, 121, - 123, 34, 124, 123, 124, 39, 123, 115, 128, 39, - 90, 30, 143, 124, 123, 122, 90, 123, 122, 106, - 123, 91, 124, 55, 111, 30, 91, 123, 124, 123, - 90, 123, 90 + 128, 128, 128, 30, 142, 128, 103, 128, 142, 30, + 128, 122, 30, 129, 128, 128, 128, 128, 56, 68, + 128, 128, 128, 128, 30, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 30, 103, 106, 124, 123, + 55, 123, 128, 124, 101, 106, 101, 142, 128, 128, + 50, 50, 50, 50, 146, 101, 113, 123, 38, 56, + 124, 55, 123, 106, 144, 30, 144, 101, 128, 128, + 128, 128, 103, 91, 56, 128, 123, 111, 92, 30, + 124, 124, 144, 128, 123, 40, 115, 116, 121, 123, + 34, 124, 123, 124, 39, 123, 115, 128, 39, 90, + 30, 143, 124, 123, 122, 90, 123, 122, 106, 123, + 91, 124, 55, 111, 30, 91, 123, 124, 123, 90, + 123, 90 }; #define yyerrok (yyerrstatus = 0) @@ -2985,7 +2977,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 2989 "engines/director/lingo/lingo-gr.cpp" +#line 2981 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index a818cf41fe..668c52f178 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -176,7 +176,7 @@ asgn: tPUT expr tINTO ID { g_lingo->codeInt($2[0]); g_lingo->codeInt($2[1]); $$ = $4; } - | tSET THEENTITYWITHID expr tTO expr { + | tSET THEENTITYWITHID simpleexpr tTO expr { g_lingo->code1(LC::c_swap); g_lingo->code1(LC::c_theentityassign); g_lingo->codeInt($2[0]); @@ -405,7 +405,7 @@ expr: simpleexpr { $$ = $1; } WRITE_UINT32(&e, $1[0]); WRITE_UINT32(&f, $1[1]); g_lingo->code2(e, f); } - | THEENTITYWITHID expr { + | THEENTITYWITHID simpleexpr { $$ = g_lingo->code1(LC::c_theentitypush); inst e = 0, f = 0; WRITE_UINT32(&e, $1[0]); -- cgit v1.2.3 From 86db38520a5fd5e02a6e48b07da22c0072f495c6 Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sun, 5 Jan 2020 11:07:36 +0800 Subject: DIRECTOR: Fix solid fill shapes --- engines/director/frame.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 24a0be8f00..672e856b97 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -208,7 +208,7 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) { else sprite._trails = 0; - sprite._lineSize = (sprite._flags >> 8) & 0x03; + sprite._lineSize = ((sprite._flags >> 8) & 0x03) + 1; sprite._castId = stream->readUint16(); sprite._startPoint.y = stream->readUint16(); @@ -664,7 +664,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { byte spriteType = sp->_spriteType; byte foreColor = sp->_foreColor; byte backColor = sp->_backColor; - int lineSize = sp->_lineSize - 1; + int lineSize = sp->_lineSize; if (spriteType == kCastMemberSprite && sp->_cast != NULL) { switch (sp->_cast->_type) { case kCastShape: @@ -688,7 +688,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { } foreColor = sc->_fgCol; backColor = sc->_bgCol; - lineSize = sc->_lineThickness - 1; + lineSize = sc->_lineThickness; ink = sc->_ink; // shapes should be rendered with transparency by default if (ink == kInkTypeCopy) { @@ -702,6 +702,16 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { } } + // for outlined shapes, line thickness of 1 means invisible. + // filled shapes need at least a line thickness of 1 for MacPlot to render them + if (spriteType == kOutlinedRectangleSprite || + spriteType == kOutlinedRoundedRectangleSprite || + spriteType == kOutlinedOvalSprite || + spriteType == kLineBottomTopSprite || + spriteType == kLineTopBottomSprite) { + lineSize -= 1; + } + Common::Rect shapeRect = Common::Rect(sp->_startPoint.x, sp->_startPoint.y, sp->_startPoint.x + sp->_width, -- cgit v1.2.3 From 2910e20a9209d544acf1c6e26c368d501de53cab Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sun, 5 Jan 2020 11:35:28 +0800 Subject: DIRECTOR: Re-add strange colour mapping for v3 and below --- engines/director/cast.cpp | 4 ++-- engines/director/frame.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 8ec151cb1b..4042f453bf 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -276,8 +276,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { _shapeType = static_cast(stream.readByte()); _initialRect = Score::readRect(stream); _pattern = stream.readUint16BE(); - _fgCol = 0xff - (uint8)stream.readByte(); - _bgCol = 0xff - (uint8)stream.readByte(); + _fgCol = (127 - stream.readByte()) & 0xff; // -128 -> 0, 127 -> 256 + _bgCol = (127 - stream.readByte()) & 0xff; _fillType = stream.readByte(); _ink = static_cast(_fillType & 0x3f); _lineThickness = stream.readByte(); diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 672e856b97..66cb7fd21f 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -197,8 +197,13 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) { sprite._scriptId = stream->readByte(); sprite._spriteType = stream->readByte(); sprite._enabled = sprite._spriteType != 0; - sprite._foreColor = 0xff - (uint8)stream->readByte(); - sprite._backColor = 0xff - (uint8)stream->readByte(); + if (_vm->getVersion() >= 4) { + sprite._foreColor = 0xff - (uint8)stream->readByte(); + sprite._backColor = 0xff - (uint8)stream->readByte(); + } else { + sprite._foreColor = (127 - stream->readByte()) & 0xff; // -128 -> 0, 127 -> 256 + sprite._backColor = (127 - stream->readByte()) & 0xff; + } sprite._flags = stream->readUint16(); sprite._ink = static_cast(sprite._flags & 0x3f); -- cgit v1.2.3 From 4b3a5257f5f5e848bc46c479b0b98e78b0f5cc18 Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sun, 5 Jan 2020 11:52:46 +0800 Subject: DIRECTOR: Extend sprite line size to 3-bit --- engines/director/frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 66cb7fd21f..f50d31e1ba 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -213,7 +213,7 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) { else sprite._trails = 0; - sprite._lineSize = ((sprite._flags >> 8) & 0x03) + 1; + sprite._lineSize = ((sprite._flags >> 8) & 0x07); sprite._castId = stream->readUint16(); sprite._startPoint.y = stream->readUint16(); -- cgit v1.2.3 From 976c57a4b10db959968a6fb287f1073097e14cc4 Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sun, 5 Jan 2020 13:21:15 +0800 Subject: DIRECTOR: Fix rounded rect radius --- engines/director/frame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index f50d31e1ba..83a243f716 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -736,7 +736,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd); break; case kRoundedRectangleSprite: - Graphics::drawRoundRect(fillRect, 4, foreColor, true, Graphics::macDrawPixel, &pd); + Graphics::drawRoundRect(fillRect, 12, foreColor, true, Graphics::macDrawPixel, &pd); break; case kOvalSprite: Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, true, Graphics::macDrawPixel, &pd); @@ -752,7 +752,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff)); break; case kOutlinedRoundedRectangleSprite: - Graphics::drawRoundRect(fillRect, 4, foreColor, false, Graphics::macDrawPixel, &pd); + Graphics::drawRoundRect(fillRect, 12, foreColor, false, Graphics::macDrawPixel, &pd); break; case kOutlinedOvalSprite: Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, false, Graphics::macDrawPixel, &pd); -- cgit v1.2.3 From 07a17d3171fc1f74e2c4255d29aed1ab77d43638 Mon Sep 17 00:00:00 2001 From: sluicebox Date: Sat, 4 Jan 2020 22:24:26 -0800 Subject: SCI32: Fix GK2 Game-over plane priority Fixes bug #11298 --- engines/sci/engine/script_patches.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index fd01a0b541..f4e4abd09d 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -3673,6 +3673,35 @@ static const uint16 gk2WagnerPaintingMessagePatch[] = { PATCH_END }; +// The game-over rooms 665 and 666 draw a pic over everything by setting the +// default plane's priority to 202, but this is already inventoryBorderPlane's +// priority. In our interpreter this causes a border fragment to be drawn above +// the pics. This worked by luck in Sierra's interpreter because it sorts on +// memory ID when planes have the same priority. In ScummVM the renderer +// guarantees a sort order based on the creation order of the planes. The +// default plane is created first and drawn before inventoryBorderPlane. +// +// We fix this by increasing the plane priority in the game-over rooms. +// +// Applies to: All versions +// Responsible methods: gabeNews:init, uDie:init +// Fixes bug: #11298 +static const uint16 gk2GameOverPrioritySignature[] = { + 0x39, SIG_SELECTOR8(priority), // pushi priority + SIG_MAGICDWORD, + 0x78, // push1 + 0x38, SIG_UINT16(0x00ca), // pushi 00ca + 0x81, 0x03, // lag 03 + 0x4a, SIG_UINT16(0x0012), // send 12 [ Plane ... priority: 202 ] + SIG_END +}; + +static const uint16 gk2GameOverPriorityPatch[] = { + PATCH_ADDTOOFFSET(+3), + 0x38, PATCH_UINT16(0x00cb), // pushi 00cb [ priority: 203 ] + PATCH_END +}; + // script, description, signature patch static const SciScriptPatcherEntry gk2Signatures[] = { { true, 0, "disable volume reset on startup", 1, gk2VolumeResetSignature, gk2VolumeResetPatch }, @@ -3682,6 +3711,8 @@ static const SciScriptPatcherEntry gk2Signatures[] = { { true, 23, "fix inventory scroll direction (no line numbers)", 1, gk2InventoryScrollDirSignature2, gk2InventoryScrollDirPatch2 }, { true, 37, "fix sound manager lockup", 1, gk2SoundManagerLockupSignature1, gk2SoundManagerLockupPatch1 }, { true, 37, "fix sound manager lockup (no line numbers)", 1, gk2SoundManagerLockupSignature2, gk2SoundManagerLockupPatch2 }, + { true, 665, "fix game-over priority", 1, gk2GameOverPrioritySignature, gk2GameOverPriorityPatch }, + { true, 666, "fix game-over priority", 1, gk2GameOverPrioritySignature, gk2GameOverPriorityPatch }, { true, 800, "fix neuschwanstein hint (1/3)", 1, gk2NeuschwansteinHintSignature1, gk2NeuschwansteinHintPatch }, { true, 800, "fix neuschwanstein hint (2/3)", 1, gk2NeuschwansteinHintSignature2, gk2NeuschwansteinHintPatch }, { true, 800, "fix neuschwanstein hint (3/3)", 1, gk2NeuschwansteinHintSignature3, gk2NeuschwansteinHintPatch }, -- cgit v1.2.3 From 551d6a6bb09fd1f56da87add25c6eaf902412a8f Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sun, 5 Jan 2020 14:29:27 +0800 Subject: DIRECTOR: Fix bitmap sprite positioning --- engines/director/cast.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 4042f453bf..f0c074604b 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -63,8 +63,8 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 _initialRect = Score::readRect(stream); _boundingRect = Score::readRect(stream); - _regX = stream.readUint16(); _regY = stream.readUint16(); + _regX = stream.readUint16(); _bitsPerPixel = stream.readUint16(); if (_bitsPerPixel == 0) -- cgit v1.2.3 From c6dcb30f4fe11158566c7f51b4d631e5706dae03 Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sun, 5 Jan 2020 14:42:50 +0800 Subject: DIRECTOR: Fix bitmap pitch for 1bpp images in v4 --- engines/director/cast.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index f0c074604b..a38674441a 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -70,6 +70,9 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 if (_bitsPerPixel == 0) _bitsPerPixel = 1; + if (_bitsPerPixel == 1) + _pitch *= 8; + int tail = 0; while (!stream.eos()) { -- cgit v1.2.3 From 3c8e5d75c532c298408b3a24658118e18fa3ec00 Mon Sep 17 00:00:00 2001 From: sluicebox Date: Sun, 5 Jan 2020 00:44:08 -0800 Subject: SCI32: Fix VMDPlayer not leaving last frame Applies _leaveLastFrame logic from VMDPlayer::closeComposited() to VMDPlayer::closeOverlay() where it was missing. Fixes bug #11299 in GK2 --- engines/sci/graphics/video32.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 567660d97a..be62ba7882 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -936,7 +936,9 @@ void VMDPlayer::closeOverlay() { } #endif - g_sci->_gfxFrameout->frameOut(true, _drawRect); + if (!_leaveLastFrame && _leaveScreenBlack) { + g_sci->_gfxFrameout->frameOut(true, _drawRect); + } } void VMDPlayer::initComposited() { -- cgit v1.2.3 From 3c0ee870220d90014603f3a52695b1f83865caf5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 5 Jan 2020 11:33:46 +0100 Subject: DIRECTOR: Improved code for Frame::renderText() --- engines/director/frame.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 83a243f716..8d27eed5de 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -813,7 +813,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { } } -void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) { +void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textRect) { TextCast *textCast = (TextCast*)_sprites[spriteId]->_cast; int x = _sprites[spriteId]->_startPoint.x; // +rectLeft; @@ -822,10 +822,10 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo int width; if (_vm->getVersion() >= 4) { - if (textSize == NULL) + if (textRect == NULL) width = textCast->_initialRect.right; else { - width = textSize->width(); + width = textRect->width(); } } else { width = textCast->_initialRect.width(); //_sprites[spriteId]->_width; @@ -844,11 +844,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo Graphics::MacFont *macFont = new Graphics::MacFont(textCast->_fontId, textCast->_fontSize, textCast->_textSlant); - debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s' text: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), Common::toPrintable(textCast->_ftext).c_str()); + debugC(3, kDebugText, "renderText: sprite: %d x: %d y: %d w: %d h: %d font: '%s' text: '%s'", spriteId, x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), Common::toPrintable(textCast->_ftext).c_str()); uint16 boxShadow = (uint16)textCast->_boxShadow; uint16 borderSize = (uint16)textCast->_borderSize; - if (textSize != NULL) + if (textRect != NULL) borderSize = 0; uint16 padding = (uint16)textCast->_gutterSize; uint16 textShadow = (uint16)textCast->_textShadow; @@ -863,14 +863,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo return; height = textSurface->h; - if (textSize != NULL) { + if (textRect != NULL) { // TODO: this offset could be due to incorrect fonts loaded! - textSize->bottom = height + textCast->_cachedMacText->getLineCount(); + textRect->bottom = height + textCast->_cachedMacText->getLineCount(); } uint16 textX = 0, textY = 0; - if (textSize == NULL) { + if (textRect == NULL) { if (borderSize > 0) { if (_vm->getVersion() <= 3) height++; @@ -916,11 +916,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo Graphics::ManagedSurface textWithFeatures(width + (borderSize * 2) + boxShadow + textShadow, height + borderSize + boxShadow + textShadow); textWithFeatures.fillRect(Common::Rect(textWithFeatures.w, textWithFeatures.h), 0xff); - if (textSize == NULL && boxShadow > 0) { + if (textRect == NULL && boxShadow > 0) { textWithFeatures.fillRect(Common::Rect(boxShadow, boxShadow, textWithFeatures.w + boxShadow, textWithFeatures.h), 0); } - if (textSize == NULL && borderSize != kSizeNone) { + if (textRect == NULL && borderSize != kSizeNone) { for (int bb = 0; bb < borderSize; bb++) { Common::Rect borderRect(bb, bb, textWithFeatures.w - bb - boxShadow - textShadow, textWithFeatures.h - bb - boxShadow - textShadow); textWithFeatures.fillRect(borderRect, 0xff); -- cgit v1.2.3 From 1bfd8cc665ba672b70cb373769677e4357454817 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 5 Jan 2020 11:50:10 +0100 Subject: DIRECTOR: LINGO: Remove unnecessary warning --- engines/director/lingo/lingo-the.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index c46f360c64..4531109076 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -685,8 +685,6 @@ Datum Lingo::getTheCast(Datum &id1, int field) { } return d; - } else { - warning("Lingo::getTheCast(): The cast %d found", id); } castType = _vm->getCurrentScore()->_loadedCast->getVal(id)->_type; -- cgit v1.2.3 From 1a91dd9d90c1ca93f3bc0ea44a7d1274fb8f15c9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 00:32:15 +0100 Subject: DIRECTOR: LINGO: Clarified keywords present in D3.1 --- engines/director/lingo/lingo-builtins.cpp | 14 +++++++------- engines/director/lingo/lingo-the.cpp | 32 +++++++++++++++---------------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 861dc0a2d3..b7c32dd05e 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -146,7 +146,7 @@ static struct BuiltinProto { // Misc { "alert", LB::b_alert, 1, 1, false, 2, BLTIN }, // D2 c { "birth", LB::b_birth, -1,0, false, 4, FBLTIN }, // D4 f - { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 4, BLTIN }, // D4 c + { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 3, BLTIN }, // D3.1 c { "cursor", LB::b_cursor, 1, 1, false, 2, BLTIN }, // D2 c { "framesToHMS", LB::b_framesToHMS, 4, 4, false, 3, FBLTIN }, // D3 f { "HMStoFrames", LB::b_HMStoFrames, 4, 4, false, 3, FBLTIN }, // D3 f @@ -161,7 +161,7 @@ static struct BuiltinProto { { "constrainV", LB::b_constrainV, 2, 2, true, 2, FBLTIN }, // D2 f { "copyToClipBoard",LB::b_copyToClipBoard,1,1, false, 4, BLTIN }, // D4 c { "duplicate", LB::b_duplicate, 1, 2, false, 4, BLTIN }, // D4 c - { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2 + { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2, FIXME: the field in D4+ { "erase", LB::b_erase, 1, 1, false, 4, BLTIN }, // D4 c { "findEmpty", LB::b_findEmpty, 1, 1, true, 4, FBLTIN }, // D4 f // go // D2 @@ -170,18 +170,18 @@ static struct BuiltinProto { { "label", LB::b_label, 1, 1, true, 2, FBLTIN }, // D2 f { "marker", LB::b_marker, 1, 1, true, 2, FBLTIN }, // D2 f { "move", LB::b_move, 1, 2, false, 4, BLTIN }, // D4 c - { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2 + { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2, FIXME: the field in D4+ { "pasteClipBoardInto",LB::b_pasteClipBoardInto,1,1,false,4,BLTIN },// D4 c { "puppetPalette", LB::b_puppetPalette, -1,0, false, 2, BLTIN }, // D2 c { "puppetSound", LB::b_puppetSound, -1,0, false, 2, BLTIN }, // D2 c { "puppetSprite", LB::b_puppetSprite, -1,0, false, 2, BLTIN }, // D2 c { "puppetTempo", LB::b_puppetTempo, 1, 1, false, 2, BLTIN }, // D2 c { "puppetTransition",LB::b_puppetTransition,-1,0,false,2, BLTIN }, // D2 c - { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 4, FBLTIN }, // D4 f + { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 3, FBLTIN }, // D3.1 f { "rollOver", LB::b_rollOver, 1, 1, true, 2, FBLTIN }, // D2 f { "spriteBox", LB::b_spriteBox, -1,0, false, 2, BLTIN }, // D2 c - { "unLoad", LB::b_unLoad, 0, 2, false, 4, BLTIN }, // D4 c - { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 4, BLTIN }, // D4 c + { "unLoad", LB::b_unLoad, 0, 2, false, 3, BLTIN }, // D3.1 c + { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 3, BLTIN }, // D3.1 c { "updateStage", LB::b_updateStage, 0, 0, false, 2, BLTIN }, // D2 c { "zoomBox", LB::b_zoomBox, -1,0, false, 2, BLTIN }, // D2 c // Point @@ -193,7 +193,7 @@ static struct BuiltinProto { { "union", LB::b_union, 2, 2, true, 4, FBLTIN }, // D4 f // Sound { "beep", LB::b_beep, 0, 1, false, 2, BLTIN }, // D2 - { "mci", LB::b_mci, 1, 1, false, 4, BLTIN }, // D4 c + { "mci", LB::b_mci, 1, 1, false, 3, BLTIN }, // D3.1 c { "mciwait", LB::b_mciwait, 1, 1, false, 4, BLTIN }, // D4 c { "sound-close", LB::b_soundClose, 1, 1, false, 4, BLTIN }, // D4 c { "sound-fadeIn", LB::b_soundFadeIn, 1, 2, false, 3, BLTIN }, // D3 c diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 4531109076..97d8687626 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -78,7 +78,7 @@ TheEntity entities[] = { { kTheLastRoll, "lastRoll", false, 2 }, // D2 f { kTheLines, "lines", false, 3 }, // D3 { kTheMachineType, "machineType", false, 2 }, // D2 f - { kTheMaxInteger, "maxInteger", false, 4 }, // D4 f + { kTheMaxInteger, "maxInteger", false, 3 }, // D3.1 f { kTheMemorySize, "memorySize", false, 2 }, // D2 f { kTheMenu, "menu", true, 3 }, // D3 p { kTheMenus, "menus", false, 3 }, // D3 p @@ -100,7 +100,7 @@ TheEntity entities[] = { { kTheMovieFileSize, "movieFileSize", false, 4 }, // D4 f { kTheMovieName, "movieName", false, 4 }, // D4 f { kTheMoviePath, "moviePath", false, 4 }, // D4 f - { kTheMultiSound, "multiSound", false, 4 }, // D4 p + { kTheMultiSound, "multiSound", false, 3 }, // D3.1 f { kTheOptionDown, "optionDown", false, 2 }, // D2 f { kTheParamCount, "paramCount", false, 4 }, // D4 f { kThePathName, "pathName", false, 2 }, // D2 f @@ -108,12 +108,12 @@ TheEntity entities[] = { { kThePerFrameHook, "perFrameHook", false, 2 }, // D2 p { kThePreloadEventAbort,"preloadEventAbort",false, 4 }, // D4 p { kThePreLoadRAM, "preLoadRAM", false, 4 }, // D4 p - { kTheQuickTimePresent, "quickTimePresent", false, 4 }, // D4 f + { kTheQuickTimePresent, "quickTimePresent", false, 3 }, // D3.1 f { kTheRandomSeed, "randomSeed", false, 4 }, // D4 p { kTheResult, "result", false, 2 }, // D2 f { kTheRightMouseDown, "rightMouseDown", false, 5 }, // D5 f { kTheRightMouseUp, "rightMouseUp", false, 5 }, // D5 f - { kTheRomanLingo, "romanLingo", false, 4 }, // D4 p + { kTheRomanLingo, "romanLingo", false, 3 }, // D3.1 p { kTheSearchCurrentFolder,"searchCurrentFolder",false,4 },// D4 f { kTheSearchPath, "searchPath", false, 4 }, // D4 f { kTheSelection, "selection", false, 2 }, // D2 f @@ -168,21 +168,17 @@ TheEntityField fields[] = { { kTheSprite, "locH", kTheLocH, 2 },// D2 p { kTheSprite, "locV", kTheLocV, 2 },// D2 p { kTheSprite, "moveableSprite",kTheMoveableSprite,4 },// D4 p - { kTheSprite, "movieRate", kTheMovieRate, 4 },// D4 P - { kTheSprite, "movieTime", kTheMovieTime, 4 },// D4 P { kTheSprite, "pattern", kThePattern, 2 },// D2 p { kTheSprite, "puppet", kThePuppet, 2 },// D2 p { kTheSprite, "right", kTheRight, 2 },// D2 p { kTheSprite, "scoreColor", kTheScoreColor, 4 },// D4 p { kTheSprite, "scriptNum", kTheScriptNum, 4 },// D4 p - { kTheSprite, "startTime", kTheStartTime, 4 },// D4 p { kTheSprite, "stretch", kTheStrech, 2 },// D2 p - { kTheSprite, "stopTime", kTheStopTime, 4 },// D4 p { kTheSprite, "top", kTheTop, 2 },// D2 p - { kTheSprite, "trails", kTheTrails, 4 },// D4 p + { kTheSprite, "trails", kTheTrails, 3 },// D3.1 p { kTheSprite, "type", kTheType, 2 },// D2 p { kTheSprite, "visible", kTheVisible, 4 },// D4 p - { kTheSprite, "volume", kTheVolume, 4 },// D4 p + { kTheSprite, "volume", kTheVolume, 3 },// D3.1 p { kTheSprite, "width", kTheWidth, 2 },// D2 p // Common cast fields @@ -204,15 +200,19 @@ TheEntityField fields[] = { // Digital video fields { kTheCast, "center", kTheCenter, 4 },// D4 p - { kTheCast, "controller", kTheController, 4 },// D4 p + { kTheCast, "controller", kTheController, 3 },// D3.1 p { kTheCast, "crop", kTheCrop, 4 },// D4 p - { kTheCast, "directToStage",kTheDirectToStage,4 },// D4 p - { kTheCast, "duration", kTheDuration, 4 },// D4 p + { kTheCast, "directToStage",kTheDirectToStage,3 },// D3.1 p + { kTheCast, "duration", kTheDuration, 3 },// D3.1 p { kTheCast, "frameRate", kTheFrameRate, 4 },// D4 p - { kTheCast, "loop", kTheLoop, 4 },// D4 p + { kTheCast, "loop", kTheLoop, 3 },// D3.1 p + { kTheSprite, "movieRate", kTheMovieRate, 3 },// D3.1 P + { kTheSprite, "movieTime", kTheMovieTime, 3 },// D3.1 P { kTheCast, "pausedAtStart",kThePausedAtStart,4 },// D4 p - { kTheCast, "preLoad", kThePreLoad, 4 },// D4 p - { kTheCast, "sound", kTheSound, 4 },// D4 p // 0-1 off-on + { kTheCast, "preLoad", kThePreLoad, 3 },// D3.1 p + { kTheCast, "sound", kTheSound, 3 },// D3.1 p // 0-1 off-on + { kTheSprite, "startTime", kTheStartTime, 3 },// D3.1 p + { kTheSprite, "stopTime", kTheStopTime, 3 },// D3.1 p { kTheCast, "video", kTheVideo, 4 },// D4 p // Bitmap fields -- cgit v1.2.3 From 54709929c6594d7fa782550b8c0c00ade3d1fc08 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 09:25:29 +0100 Subject: DIRECTOR: Moved TransitionType to types.h --- engines/director/frame.h | 56 ------------------------------------------------ engines/director/types.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 56 deletions(-) (limited to 'engines') diff --git a/engines/director/frame.h b/engines/director/frame.h index 25192af05e..970e8a4cc2 100644 --- a/engines/director/frame.h +++ b/engines/director/frame.h @@ -46,62 +46,6 @@ enum { kChannelDataSize = (25 * 50) }; -enum TransitionType { - kTransNone, - kTransWipeRight, - kTransWipeLeft, - kTransWipeDown, - kTransWipeUp, - kTransCenterOutHorizontal, - kTransEdgesInHorizontal, - kTransCenterOutVertical, - kTransEdgesInVertical, - kTransCenterOutSquare, - kTransEdgesInSquare, - kTransPushLeft, - kTransPushRight, - kTransPushDown, - kTransPushUp, - kTransRevealUp, - kTransRevealUpRight, - kTransRevealRight, - kTransRevealDown, - kTransRevealDownRight, - kTransRevealDownLeft, - kTransRevealLeft, - kTransRevealUpLeft, - kTransDissolvePixelsFast, - kTransDissolveBoxyRects, - kTransDissolveBoxySquares, - kTransDissolvePatterns, - kTransRandomRows, - kTransRandomColumns, - kTransCoverDown, - kTransCoverDownLeft, - kTransCoverDownRight, - kTransCoverLeft, - kTransCoverRight, - kTransCoverUp, - kTransCoverUpLeft, - kTransCoverUpRight, - kTransTypeVenitianBlind, - kTransTypeCheckerboard, - kTransTypeStripsBottomBuildLeft, - kTransTypeStripsBottomBuildRight, - kTransTypeStripsLeftBuildDown, - kTransTypeStripsLeftBuildUp, - kTransTypeStripsRightBuildDown, - kTransTypeStripsRightBuildUp, - kTransTypeStripsTopBuildLeft, - kTransTypeStripsTopBuildRight, - kTransZoomOpen, - kTransZoomClose, - kTransVerticalBinds, - kTransDissolveBitsTrans, - kTransDissolvePixels, - kTransDissolveBits -}; - struct PaletteInfo { uint8 firstColor; uint8 lastColor; diff --git a/engines/director/types.h b/engines/director/types.h index d05cd3b72b..4a203f9f73 100644 --- a/engines/director/types.h +++ b/engines/director/types.h @@ -174,6 +174,62 @@ enum LEvent { kEventStart }; +enum TransitionType { + kTransNone, + kTransWipeRight, + kTransWipeLeft, + kTransWipeDown, + kTransWipeUp, + kTransCenterOutHorizontal, + kTransEdgesInHorizontal, + kTransCenterOutVertical, + kTransEdgesInVertical, + kTransCenterOutSquare, + kTransEdgesInSquare, + kTransPushLeft, + kTransPushRight, + kTransPushDown, + kTransPushUp, + kTransRevealUp, + kTransRevealUpRight, + kTransRevealRight, + kTransRevealDown, + kTransRevealDownRight, + kTransRevealDownLeft, + kTransRevealLeft, + kTransRevealUpLeft, + kTransDissolvePixelsFast, + kTransDissolveBoxyRects, + kTransDissolveBoxySquares, + kTransDissolvePatterns, + kTransRandomRows, + kTransRandomColumns, + kTransCoverDown, + kTransCoverDownLeft, + kTransCoverDownRight, + kTransCoverLeft, + kTransCoverRight, + kTransCoverUp, + kTransCoverUpLeft, + kTransCoverUpRight, + kTransTypeVenitianBlind, + kTransTypeCheckerboard, + kTransTypeStripsBottomBuildLeft, + kTransTypeStripsBottomBuildRight, + kTransTypeStripsLeftBuildDown, + kTransTypeStripsLeftBuildUp, + kTransTypeStripsRightBuildDown, + kTransTypeStripsRightBuildUp, + kTransTypeStripsTopBuildLeft, + kTransTypeStripsTopBuildRight, + kTransZoomOpen, + kTransZoomClose, + kTransVerticalBinds, + kTransDissolveBitsTrans, + kTransDissolvePixels, + kTransDissolveBits +}; + const char *scriptType2str(ScriptType scr); -- cgit v1.2.3 From 5bd28cc7e0b6c01643b00afe1efd4a301e8186ec Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 09:36:10 +0100 Subject: DIRECTOR: Improved text flags processing --- engines/director/cast.cpp | 22 ++++++++-------------- engines/director/cast.h | 4 ++-- engines/director/types.h | 6 +++--- 3 files changed, 13 insertions(+), 19 deletions(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index a38674441a..825c3b2093 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -117,7 +117,8 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { _gutterSize = kSizeNone; _boxShadow = kSizeNone; - _flags1 = 0; + _flags = 0; + _textFlags = 0; _fontId = 0; _fontSize = 12; _textType = kTextTypeFixed; @@ -127,7 +128,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { _palinfo1 = _palinfo2 = _palinfo3 = 0; if (version <= 3) { - _flags1 = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled + _flags = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled _borderSize = static_cast(stream.readByte()); _gutterSize = static_cast(stream.readByte()); _boxShadow = static_cast(stream.readByte()); @@ -141,7 +142,6 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { uint16 pad3; uint16 pad4 = 0; uint16 totalTextHeight; - byte flags = 0; if (version == 2) { pad2 = stream.readUint16(); @@ -153,15 +153,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { pad3 = stream.readUint16(); _textShadow = static_cast(stream.readByte()); - flags = stream.readByte(); - if (flags & 0x1) - _textFlags.push_back(kTextFlagEditable); - if (flags & 0x2) - _textFlags.push_back(kTextFlagAutoTab); - if (flags & 0x4) - _textFlags.push_back(kTextFlagDoNotWrap); - if (flags & 0xf8) - warning("Unprocessed text cast flags: %x", flags & 0xf8); + _textFlags = stream.readByte(); + if (_textFlags & 0xf8) + warning("Unprocessed text cast flags: %x", _textFlags & 0xf8); totalTextHeight = stream.readUint16(); } else { @@ -173,9 +167,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { } debugC(2, kDebugLoading, "TextCast(): flags1: %d, border: %d gutter: %d shadow: %d pad1: %x align: %04x", - _flags1, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign); + _flags, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign); debugC(2, kDebugLoading, "TextCast(): rgb: 0x%04x 0x%04x 0x%04x, pad2: %x pad3: %d pad4: %d shadow: %d flags: %d totHeight: %d", - _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, flags, totalTextHeight); + _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, _textFlags, totalTextHeight); if (debugChannelSet(2, kDebugLoading)) { _initialRect.debugPrint(2, "TextCast(): rect:"); } diff --git a/engines/director/cast.h b/engines/director/cast.h index 03767ecea2..3d8db523c7 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -92,14 +92,14 @@ public: SizeType _gutterSize; SizeType _boxShadow; - byte _flags1; + byte _flags; uint32 _fontId; uint16 _fontSize; TextType _textType; TextAlignType _textAlign; SizeType _textShadow; byte _textSlant; - Common::Array _textFlags; + byte _textFlags; uint16 _palinfo1, _palinfo2, _palinfo3; Common::String _ftext; diff --git a/engines/director/types.h b/engines/director/types.h index 4a203f9f73..0a170ffc23 100644 --- a/engines/director/types.h +++ b/engines/director/types.h @@ -71,9 +71,9 @@ enum TextAlignType { }; enum TextFlag { - kTextFlagEditable, - kTextFlagAutoTab, - kTextFlagDoNotWrap + kTextFlagEditable = (1 << 0), + kTextFlagAutoTab = (1 << 1), + kTextFlagDoNotWrap = (1 << 2) }; enum SizeType { -- cgit v1.2.3 From 1fea08e240499af5002e7907180857e6932d857f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 13:09:07 +0100 Subject: DIRECTOR: Fix switch statement --- engines/director/sprite.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines') diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp index d9f8291761..4a741c30c9 100644 --- a/engines/director/sprite.cpp +++ b/engines/director/sprite.cpp @@ -146,6 +146,7 @@ void Sprite::setPattern(uint16 pattern) { case kOutlinedRoundedRectangleSprite: case kOutlinedOvalSprite: _castId = pattern; + break; case kCastMemberSprite: // TODO -- cgit v1.2.3 From 046c1fc1c78f52245d8aca3c2ecf281ae7da104c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 13:24:02 +0100 Subject: DIRECTOR: Plug memory leak --- engines/director/images.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines') diff --git a/engines/director/images.cpp b/engines/director/images.cpp index 10d73accc1..bff1a6a7fc 100644 --- a/engines/director/images.cpp +++ b/engines/director/images.cpp @@ -149,6 +149,7 @@ BITDDecoder::~BITDDecoder() { } void BITDDecoder::destroy() { + delete _surface; _surface = 0; delete[] _palette; -- cgit v1.2.3 From 14719c46c718cf284bde7d54842ec338510aa273 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 13:26:18 +0100 Subject: DIRECTOR: LINGO: Clarify the control flow --- engines/director/lingo/lingo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines') diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 03533babe6..31f2046b08 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -323,6 +323,7 @@ double Datum::toFloat() { switch (type) { case REFERENCE: toString(); + // fallthrough case STRING: u.f = atof(u.s->c_str()); break; -- cgit v1.2.3 From 0d7d1ed2f8335a6423e287efb9c253908e53f3c5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Jan 2020 13:40:24 +0100 Subject: DIRECTOR: Plug memory leak in Cast --- engines/director/cast.cpp | 21 +++++++++++++++------ engines/director/cast.h | 5 ++++- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 825c3b2093..4537742e19 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -21,6 +21,7 @@ */ #include "common/substream.h" +#include "graphics/surface.h" #include "director/director.h" #include "director/cachedmactext.h" @@ -30,6 +31,17 @@ namespace Director { +Cast::Cast() { + _type = kCastTypeNull; + _surface = nullptr; + + _modified = true; +} + +Cast::~Cast() { + delete _surface; +} + BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version) { _type = kCastBitmap; @@ -106,7 +118,6 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 stream.readUint32(); } - _modified = 0; _tag = castTag; } @@ -223,10 +234,10 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { stream.readUint16(); } - _modified = 0; - _cachedMacText = new CachedMacText(this, version, -1, g_director->_wm); // TODO Destroy me + + _modified = false; } void TextCast::importStxt(const Stxt *stxt) { @@ -305,7 +316,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { _lineThickness = 1; _lineDirection = 0; } - _modified = 0; + _modified = false; debugC(3, kDebugLoading, "ShapeCast: fl: %x unk1: %x type: %d pat: %d fg: %d bg: %d fill: %d thick: %d dir: %d", flags, unk1, _shapeType, _pattern, _fgCol, _bgCol, _fillType, _lineThickness, _lineDirection); @@ -329,7 +340,6 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC _buttonType = static_cast(stream.readUint16BE()); } - _modified = 0; } ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) { @@ -363,7 +373,6 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) { // WIP need to complete this! } - _modified = 0; } RTECast::RTECast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) { diff --git a/engines/director/cast.h b/engines/director/cast.h index 3d8db523c7..3e1479d041 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -42,6 +42,9 @@ class CachedMacText; class Cast { public: + Cast(); + virtual ~Cast(); + CastType _type; Common::Rect _initialRect; Common::Rect _boundingRect; @@ -49,7 +52,7 @@ public: const Graphics::Surface *_surface; - byte _modified; + bool _modified; }; class BitmapCast : public Cast { -- cgit v1.2.3 From 2f16ddc982f7267a2361ee437a3b3330b5493b3e Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 6 Jan 2020 23:17:05 +0100 Subject: KYRA: (LOK) - fix shakeScreen This has become too fast for modern systems and needs an extra delay. Otherwise the screen shake won't be actually noticed. There seem to be other issues with shakeScreen outside the Kyra code that have to be addressed separately (improper scaling of the shake offsets). --- engines/kyra/graphics/screen.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp index 148f2d8f37..7d8c1b1535 100644 --- a/engines/kyra/graphics/screen.cpp +++ b/engines/kyra/graphics/screen.cpp @@ -3171,12 +3171,25 @@ void Screen::rectClip(int &x, int &y, int w, int h) { void Screen::shakeScreen(int times) { while (times--) { + // The original did not need an artificial delay, but we do. + // Or the shake will be too fast to be actually seen. + uint32 delayuntil = _system->getMillis() + 16; + // seems to be 1 line (320 pixels) offset in the original - // 4 looks more like dosbox though, maybe check this again - _system->setShakePos(0, 4); + // -4 looks more like dosbox though, maybe check this again + _system->setShakePos(0, -4); _system->updateScreen(); + + int diff = delayuntil - _system->getMillis(); + if (diff > 0) + _system->delayMillis(diff); + delayuntil = _system->getMillis() + 16; _system->setShakePos(0, 0); _system->updateScreen(); + + diff = delayuntil - _system->getMillis(); + if (diff > 0) + _system->delayMillis(diff); } } -- cgit v1.2.3 From 6304e59a2b2dd3b2a61af5cdf496f0cc3221b910 Mon Sep 17 00:00:00 2001 From: sluicebox Date: Mon, 6 Jan 2020 20:55:49 -0800 Subject: SCI32: Fix GK2 Gerde missing message --- engines/sci/engine/workarounds.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index ba11883cbc..71046a83cf 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -1247,6 +1247,9 @@ static const SciMessageWorkaroundEntry messageWorkarounds[] = { // audio36 for the the other has the wrong tuple, which we fix in the audio36 workarounds. { GID_GK1, SCI_MEDIA_ALL, K_LANG_NONE, -1, 420, 2, 32, 3, 1, { MSG_WORKAROUND_REMAP, 420, 2, 32, 0, 1, 0, 0, 0, NULL } }, { GID_GK1, SCI_MEDIA_ALL, K_LANG_NONE, -1, 420, 2, 32, 0, 1, { MSG_WORKAROUND_REMAP, 420, 2, 32, 2, 1, 0, 0, 0, NULL } }, + // Clicking one of Gabriel's letters on Gerde in room 120 after getting his address in some versions + { GID_GK2, SCI_MEDIA_ALL, K_LANG_NONE, -1, 120, 18, 63, 0, 1, { MSG_WORKAROUND_REMAP, 120, 18, 44, 0, 1, 0, 0, 0, NULL } }, + { GID_GK2, SCI_MEDIA_ALL, K_LANG_NONE, -1, 120, 18, 64, 0, 1, { MSG_WORKAROUND_REMAP, 120, 18, 44, 0, 1, 0, 0, 0, NULL } }, // Clicking any item other than the dagger on theater vent in room 11853 { GID_GK2, SCI_MEDIA_ALL, K_LANG_NONE, -1, 1185, 4, 0, 0, 1, { MSG_WORKAROUND_REMAP, 1185, 4, 62, 0, 1, 0, 0, 0, NULL } }, // Asking Yvette about Tut in act 2 party in floppy version - bug #10723 -- cgit v1.2.3 From 09161504210d3a659f99d804b9a326fb441568bd Mon Sep 17 00:00:00 2001 From: sluicebox Date: Tue, 7 Jan 2020 02:13:55 -0800 Subject: SCI32: Ignore invalid GK2 audio maps in all versions Fixes #11014, #11270 --- engines/sci/resource_audio.cpp | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) (limited to 'engines') diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index c825196d93..73e10eb1ee 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -513,36 +513,23 @@ int ResourceManager::readAudioMapSCI11(IntMapResourceSource *map) { continue; } + // GK2 has invalid audio36 map entries on CD 1 of the German + // version and CD 6 of all versions. All are safe to ignore + // because their content doesn't apply to the disc's chapter. if (g_sci->getGameId() == GID_GK2) { - // At least version 1.00 of the US release, and the German - // release, of GK2 have multiple invalid audio36 map entries on - // CD 6 - if (map->_volumeNumber == 6 && offset + syncSize >= srcSize) { - bool skip; - switch (g_sci->getLanguage()) { - case Common::EN_ANY: - skip = (map->_mapNumber == 22 || map->_mapNumber == 160); - break; - case Common::DE_DEU: - skip = (map->_mapNumber == 22); - break; - default: - skip = false; - } - - if (skip) { - continue; - } + // Map 2020 on CD 1 only exists in localized versions and + // contains inventory messages from later chapters. + if (map->_volumeNumber == 1 && + map->_mapNumber == 2020) { + continue; } - // Map 2020 on CD 1 of the German release of GK2 is invalid. - // This content does not appear to ever be used by the game (it - // does not even exist in the US release), and there is a - // correct copy of it on CD 6, so just ignore the bad copy on - // CD 1 - if (g_sci->getLanguage() == Common::DE_DEU && - map->_volumeNumber == 1 && - map->_mapNumber == 2020) { + // Maps 22 and 160 on CD 6 appear in various broken forms + // in English and apparently every localized version. + // These messages are for Grace's notebook and castle + // secret passage rooms which aren't in chapter 6. + if (map->_volumeNumber == 6 && + (map->_mapNumber == 22 || map->_mapNumber == 160)) { continue; } } -- cgit v1.2.3 From 3002f078753de2cd2e51f5f7ec35fb82953aa134 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 7 Jan 2020 21:59:45 +0100 Subject: DIRECTOR: LINGO: Fix warnings --- engines/director/lingo/lingo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 31f2046b08..36a0c6368d 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -301,6 +301,7 @@ int Datum::toInt() { switch (type) { case REFERENCE: toString(); + // fallthrough case STRING: u.i = atoi(u.s->c_str()); break; @@ -517,13 +518,13 @@ void Lingo::printAllVars() { for (SymbolHash::iterator i = _localvars->begin(); i != _localvars->end(); ++i) { debugN("%s, ", (*i)._key.c_str()); } - debug(""); + debugN("\n"); debugN(" Global vars: "); for (SymbolHash::iterator i = _globalvars.begin(); i != _globalvars.end(); ++i) { debugN("%s, ", (*i)._key.c_str()); } - debug(""); + debugN("\n"); } } // End of namespace Director -- cgit v1.2.3 From 3dd3b616858ed3aeda4cd0cb047f19efb588f7b2 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 6 Jan 2020 17:32:54 +0100 Subject: KYRA: (EOB/PC98) - fix music fadeout (irrelevant to the game, since this function isn't used, but I like to fix it nonetheless) --- engines/kyra/sound/drivers/mlalf98.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/kyra/sound/drivers/mlalf98.cpp b/engines/kyra/sound/drivers/mlalf98.cpp index b2cb6d909c..1474589032 100644 --- a/engines/kyra/sound/drivers/mlalf98.cpp +++ b/engines/kyra/sound/drivers/mlalf98.cpp @@ -436,7 +436,7 @@ bool SoundChannel::_globalBlock = false; SoundChannel::SoundChannel(PC98AudioCore *pc98a, int part, int regOffset, int type) : _pc98a(pc98a), _regOffset(regOffset), _part(part), _ticksLeft(0), _program(0), _volume(0), _algorithm(0), _envRR(0), _vbrDelay(0), _vbrRem(0), _vbrRate(0), _vbrTicker(0), _vbrStepSize(0), _vbrModifier(0), _vbrDepth(0), _vbrState(0), _duration(0), _frequency(0), _flags2(0), _note(0), _flags(0), -_transpose(0), _envCurLvl(0), _fadeVolModifier(0), _fadeProgress(0), _fadeTicker(0), _trmCarrier(1), +_transpose(0), _envCurLvl(0), _fadeVolModifier(0), _fadeProgress(0), _fadeTicker(16), _trmCarrier(1), _dataPtr(0), _dataEnd(0), _loopStartPtr(0), _instrBuffer(0), _backupData(0), _mute(false), _type(type) { _subOpcodes[0].reserve(8); _subOpcodes[1].reserve(8); @@ -510,6 +510,8 @@ void SoundChannel::updateFadeOut() { if (--_fadeTicker) return; + _fadeTicker = 16; + if (!_fadeProgress) return; -- cgit v1.2.3 From 70d7de0b98cb0bf181f18125defab1ffb2d1efb5 Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 7 Jan 2020 20:13:42 +0100 Subject: KYRA: (LOK) - implement FM-TOWNS specific screen shake (the FM-TOWNS version has a better shake animation) --- engines/kyra/graphics/screen.cpp | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'engines') diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp index 7d8c1b1535..dd264a1551 100644 --- a/engines/kyra/graphics/screen.cpp +++ b/engines/kyra/graphics/screen.cpp @@ -3170,26 +3170,31 @@ void Screen::rectClip(int &x, int &y, int w, int h) { } void Screen::shakeScreen(int times) { - while (times--) { - // The original did not need an artificial delay, but we do. - // Or the shake will be too fast to be actually seen. - uint32 delayuntil = _system->getMillis() + 16; + static const int8 _shakeParaPC[] = { 32, 0, -4, 32, 0, 0 }; + static const int8 _shakeParaFMTOWNS[] = { 32, 0, -4, 48, 0, 4, 32, -4, 0, 32, 4, 0, 32, 0, 0 }; - // seems to be 1 line (320 pixels) offset in the original - // -4 looks more like dosbox though, maybe check this again - _system->setShakePos(0, -4); - _system->updateScreen(); + const int8 *data = _shakeParaPC; + int steps = ARRAYSIZE(_shakeParaPC) / 3; - int diff = delayuntil - _system->getMillis(); - if (diff > 0) - _system->delayMillis(diff); - delayuntil = _system->getMillis() + 16; - _system->setShakePos(0, 0); - _system->updateScreen(); + // The FM-TOWNS version has a slightly better shake animation + // TODO: check PC-98 version + if (_vm->gameFlags().platform == Common::kPlatformFMTowns) { + data = _shakeParaFMTOWNS; + steps = ARRAYSIZE(_shakeParaFMTOWNS) / 3; + } - diff = delayuntil - _system->getMillis(); - if (diff > 0) - _system->delayMillis(diff); + while (times--) { + for (int i = 0; i < steps; ++i) { + // The original PC version did not need an artificial delay, but we do. + // Or the shake will be too fast to be actually seen. + uint32 delayuntil = _system->getMillis() + data[0]; + _system->setShakePos(data[1], data[2]); + _system->updateScreen(); + int diff = delayuntil - _system->getMillis(); + if (diff > 0) + _system->delayMillis(diff); + data += 3; + } } } -- cgit v1.2.3 From 068d8791e8ecd0c47abb18fab1836dbe99cb9374 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 01:09:55 +0100 Subject: DIRECTOR: Invert button on mouse down --- engines/director/frame.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 8d27eed5de..ad12406a6d 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -781,9 +781,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { int height = button->_initialRect.height(); int width = button->_initialRect.width() + 3; - Common::Rect textRect(0, 0, width, height); - // pass the rect of the button into the label. - renderText(surface, spriteId, &textRect); + bool invert = spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId; // TODO: review all cases to confirm if we should use text height. // height = textRect.height(); @@ -799,8 +797,9 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { break; case kTypeButton: { _rect = Common::Rect(x, y, x + width, y + height + 3); - Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1, Graphics::kColorWhite); - Graphics::drawRoundRect(_rect, 4, 0, false, Graphics::macDrawPixel, &pd); + Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1, invert ? Graphics::kColorBlack : Graphics::kColorWhite); + + Graphics::drawRoundRect(_rect, 4, 0, invert, Graphics::macDrawPixel, &pd); addDrawRect(spriteId, _rect); } break; @@ -811,6 +810,10 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { warning("renderButton: Unknown buttonType"); break; } + + Common::Rect textRect(0, 0, width, height); + // pass the rect of the button into the label. + renderText(surface, spriteId, &textRect); } void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textRect) { @@ -933,7 +936,12 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo textWithFeatures.transBlitFrom(textSurface->rawSurface(), Common::Point(textX, textY), 0xff); - inkBasedBlit(surface, textWithFeatures, _sprites[spriteId]->_ink, Common::Rect(x, y, x + width, y + height)); + InkType ink = _sprites[spriteId]->_ink; + + if (spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId) + ink = kInkTypeReverse; + + inkBasedBlit(surface, textWithFeatures, ink, Common::Rect(x, y, x + width, y + height)); } void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics::Surface &spriteSurface, InkType ink, Common::Rect drawRect) { -- cgit v1.2.3 From 7d4045f4a9c5df7017de4d6bb5cd0871109b0a61 Mon Sep 17 00:00:00 2001 From: sluicebox Date: Tue, 7 Jan 2020 17:08:35 -0800 Subject: SCI32: Add GK2 subtitle patch compatibility Fixes #9677, #11282 --- engines/sci/engine/script_patches.cpp | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index f4e4abd09d..1beee77766 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -147,6 +147,7 @@ static const char *const selectorNameTable[] = { #ifdef ENABLE_SCI32 "newWith", // SCI2 array script "posn", // SCI2 benchmarking script + "printLang", // GK2 "view", // RAMA benchmarking, GK1, QFG4 "fade", // Shivers "test", // Torin @@ -260,6 +261,7 @@ enum ScriptPatcherSelectors { , SELECTOR_newWith, SELECTOR_posn, + SELECTOR_printLang, SELECTOR_view, SELECTOR_fade, SELECTOR_test, @@ -3702,6 +3704,39 @@ static const uint16 gk2GameOverPriorityPatch[] = { PATCH_END }; +// GK2 fans have created patches that add subtitles to the entire game. There +// are at least English and Spanish patch sets. Sierra added the subtitle +// feature solely for the Portuguese version, which along with the Italian +// version are the final localized versions of the game. The Italian version +// also contains the subtitle scripts even though it doesn't make of use the +// feature. The fan patches work by including these Italian scripts, replacing +// the Portuguese resources and strings, and configuring Sierra's interpreter +// to use the Portuguese language through RESOURCE.CFG. This sets GK2:printLang +// which the scripts test for Portuguese in order to activate subtitles. +// +// The subtitle patches are compatible with ScummVM except for the requirement +// that GK2:printLang equals Portuguese (351) since we don't use RESOURCE.CFG. +// We fix this by patching the GK2:printLang tests to always activate subtitles +// when a sync resource is present for synchronizing text to video playback. +// +// Applies to: PC versions with a subtitle fan-patch applied +// Responsible methods: Any that test GK2:printLang for Portuguese +// Fixes bugs: #9677, #11282 +static const uint16 gk2SubtitleCompatibilitySignature[] = { + SIG_MAGICDWORD, + 0x39, SIG_SELECTOR8(printLang), // pushi printLang + 0x76, // push0 + 0x81, 0x01, // lag 01 + 0x4a, SIG_UINT16(0x0004), // send 04 [ GK2 printLang? ] + SIG_END +}; + +static const uint16 gk2SubtitleCompatibilityPatch[] = { + 0x34, PATCH_UINT16(0x015f), // ldi 015f [ K_LANG_PORTUGUESE ] + 0x33, 0x03, // jmp 03 + PATCH_END +}; + // script, description, signature patch static const SciScriptPatcherEntry gk2Signatures[] = { { true, 0, "disable volume reset on startup", 1, gk2VolumeResetSignature, gk2VolumeResetPatch }, @@ -3726,6 +3761,11 @@ static const SciScriptPatcherEntry gk2Signatures[] = { { true, 64990, "increase number of save games (1/2)", 1, sci2NumSavesSignature1, sci2NumSavesPatch1 }, { true, 64990, "increase number of save games (2/2)", 1, sci2NumSavesSignature2, sci2NumSavesPatch2 }, { true, 64990, "disable change directory button", 1, sci2ChangeDirSignature, sci2ChangeDirPatch }, + { false, 11, "subtitle patch compatibility", 7, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch }, + { false, 12, "subtitle patch compatibility", 6, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch }, + { false, 36, "subtitle patch compatibility", 2, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch }, + { false, 200, "subtitle patch compatibility", 1, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch }, + { false, 64924, "subtitle patch compatibility", 1, gk2SubtitleCompatibilitySignature, gk2SubtitleCompatibilityPatch }, SCI_SIGNATUREENTRY_TERMINATOR }; @@ -18562,6 +18602,12 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan scriptData) { enablePatch(signatureTable, "Mac: skip broken hop singh scene"); } break; + case GID_GK2: + // Enable subtitle compatibility if a sync resource is present + if (g_sci->getResMan()->testResource(ResourceId(kResourceTypeSync, 10))) { + enablePatch(signatureTable, "subtitle patch compatibility"); + } + break; case GID_KQ5: if (g_sci->_features->useAltWinGMSound()) { // See the explanation in the kq5SignatureWinGMSignals comment -- cgit v1.2.3 From 0bae2992577d52dd7c90f5aa5a48a0a39c52ef1e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 7 Jan 2020 22:09:25 -0800 Subject: XEEN: Fix crash in WOXCD Deep Mine Alpha --- engines/xeen/map.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 9fd967b89b..22a85365df 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -785,17 +785,22 @@ void Map::load(int mapId) { } } else if (File::exists(mobName)) { // For surrounding maps, set up flags for whether objects are present - // Load the monster/object data - File mobFile(mobName); - XeenSerializer sMob(&mobFile, nullptr); - MonsterObjectData mobData(_vm); - mobData.synchronize(sMob, _monsterData); - mobFile.close(); - mazeDataP->_objectsPresent.resize(mobData._objects.size()); - for (uint objIndex = 0; objIndex < mobData._objects.size(); ++objIndex) { - const Common::Point &pt = mobData._objects[objIndex]._position; - mazeDataP->_objectsPresent[objIndex] = ABS(pt.x) != 128 && ABS(pt.y) != 128; + // WORKAROUND: In WOX CD Map 120, one of the maps for Deep Mine Alpha, + // has invalid monster data. So to work around it, we just ignore it + if (!(mapId == 120 && g_vm->getIsCD() && g_vm->getGameID() == GType_WorldOfXeen)) { + // Load the monster/object data + File mobFile(mobName); + XeenSerializer sMob(&mobFile, nullptr); + MonsterObjectData mobData(_vm); + mobData.synchronize(sMob, _monsterData); + mobFile.close(); + + mazeDataP->_objectsPresent.resize(mobData._objects.size()); + for (uint objIndex = 0; objIndex < mobData._objects.size(); ++objIndex) { + const Common::Point &pt = mobData._objects[objIndex]._position; + mazeDataP->_objectsPresent[objIndex] = ABS(pt.x) != 128 && ABS(pt.y) != 128; + } } } } -- cgit v1.2.3 From ec872b8dc8fffc631b9b5e84c701800a20d02220 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 8 Jan 2020 17:45:56 +0100 Subject: KYRA: (LOK) - shakeScreen() improvement (maintain smooth mouse cursor movement during shakes) --- engines/kyra/graphics/screen.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp index dd264a1551..bbcada5991 100644 --- a/engines/kyra/graphics/screen.cpp +++ b/engines/kyra/graphics/screen.cpp @@ -3175,7 +3175,7 @@ void Screen::shakeScreen(int times) { const int8 *data = _shakeParaPC; int steps = ARRAYSIZE(_shakeParaPC) / 3; - + // The FM-TOWNS version has a slightly better shake animation // TODO: check PC-98 version if (_vm->gameFlags().platform == Common::kPlatformFMTowns) { @@ -3183,16 +3183,28 @@ void Screen::shakeScreen(int times) { steps = ARRAYSIZE(_shakeParaFMTOWNS) / 3; } + Common::Event event; + while (times--) { for (int i = 0; i < steps; ++i) { - // The original PC version did not need an artificial delay, but we do. - // Or the shake will be too fast to be actually seen. - uint32 delayuntil = _system->getMillis() + data[0]; + // The original PC version did not need an artificial delay, but we do or the shake will be + // too fast to be actually seen. + uint32 end = _system->getMillis() + data[0]; _system->setShakePos(data[1], data[2]); - _system->updateScreen(); - int diff = delayuntil - _system->getMillis(); - if (diff > 0) - _system->delayMillis(diff); + + for (uint32 now = _system->getMillis(); now < end; ) { + // Update the event manager to keep smooth mouse pointer movement. + while (_vm->getEventManager()->pollEvent(event)) { + if (event.type == Common::EVENT_KEYDOWN) { + // This is really the only thing that should be handled. + if (event.kbd.keycode == Common::KEYCODE_q && event.kbd.hasFlags(Common::KBD_CTRL)) + _vm->quitGame(); + } + } + _system->updateScreen(); + now = _system->getMillis(); + _system->delayMillis(MIN(end - now, 10)); + } data += 3; } } -- cgit v1.2.3 From 24d0159e799d82b6305fc4dd968faf8e9c3b3c9a Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 8 Jan 2020 19:36:31 +0100 Subject: KYRA: (LOK) - fix mouse cursor bug (see #11303) --- engines/kyra/engine/kyra_v1.cpp | 13 +++++++++++++ engines/kyra/script/script_v1.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/kyra/engine/kyra_v1.cpp b/engines/kyra/engine/kyra_v1.cpp index fc43919b57..c708756b19 100644 --- a/engines/kyra/engine/kyra_v1.cpp +++ b/engines/kyra/engine/kyra_v1.cpp @@ -235,6 +235,19 @@ void KyraEngine_v1::setMousePos(int x, int y) { y <<= 1; } _system->warpMouse(x, y); + + // Feed the event manager an artficial mouse move event, since warpMouse() won't generate one. + // From the warpMouse comments I gather that this behavior is intentional due to requirements of + // the SCUMM engine. In KYRA we need to get the same coordinates from _eventMan->getMousePos() + // that we send via warpMouse(). We have script situations in Kyra (like the Alchemists' crystals + // scene) where a new mouse cursor position is set and then immediately read. This function would + // then get wrong coordinates. + Common::Event event; + event.type = Common::EVENT_MOUSEMOVE; + event.mouse.x = x; + event.mouse.y = y; + _eventMan->pushEvent(event); + updateInput(); } int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) { diff --git a/engines/kyra/script/script_v1.cpp b/engines/kyra/script/script_v1.cpp index 2fbd2f22f4..356460dae0 100644 --- a/engines/kyra/script/script_v1.cpp +++ b/engines/kyra/script/script_v1.cpp @@ -65,7 +65,7 @@ int KyraEngine_v1::o1_showMouse(EMCState *script) { int KyraEngine_v1::o1_setMousePos(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); - _system->warpMouse(stackPos(0), stackPos(1)); + setMousePos(stackPos(0), stackPos(1)); return 0; } -- cgit v1.2.3 From b19c1f74494292e35bcc15d63d03add777060bbc Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 13:15:03 +0100 Subject: DIRECTOR: LINGO: Clarified built-ins for D3 --- engines/director/lingo/lingo-events.cpp | 12 ++++++------ engines/director/lingo/lingo-lex.l | 8 -------- engines/director/lingo/lingo-the.cpp | 17 +---------------- 3 files changed, 7 insertions(+), 30 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp index fe64b80e29..2a04a57e88 100644 --- a/engines/director/lingo/lingo-events.cpp +++ b/engines/director/lingo/lingo-events.cpp @@ -34,9 +34,9 @@ struct EventHandlerType { const char *name; } static const eventHandlerDescs[] = { { kEventPrepareMovie, "prepareMovie" }, - { kEventStartMovie, "startMovie" }, // D3? - { kEventStepMovie, "stepMovie" }, // D3? - { kEventStopMovie, "stopMovie" }, // D3? + { kEventStartMovie, "startMovie" }, // D3 + { kEventStepMovie, "stepMovie" }, // D3 + { kEventStopMovie, "stopMovie" }, // D3 { kEventNew, "newSprite" }, { kEventBeginSprite, "beginSprite" }, @@ -44,7 +44,7 @@ struct EventHandlerType { { kEventEnterFrame, "enterFrame" }, // D4 { kEventPrepareFrame, "prepareFrame" }, - { kEventIdle, "idle" }, + { kEventIdle, "idle" }, // D3 { kEventStepFrame, "stepFrame"}, { kEventExitFrame, "exitFrame" }, // D4 @@ -58,8 +58,8 @@ struct EventHandlerType { { kEventKeyUp, "keyUp" }, // D4 { kEventKeyDown, "keyDown" }, // D2 w D4 (as when from D2) - { kEventMouseUp, "mouseUp" }, // D2 w D3? - { kEventMouseDown, "mouseDown" }, // D2 w D3? + { kEventMouseUp, "mouseUp" }, // D2 w D3 + { kEventMouseDown, "mouseDown" }, // D2 w D3 { kEventRightMouseDown, "rightMouseDown" }, { kEventRightMouseUp, "rightMouseUp" }, { kEventMouseEnter, "mouseEnter" }, diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index fc554259a9..13a1db9c00 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -163,14 +163,6 @@ whitespace [\t ] (?i:set) { count(); return tSET; } (?i:starts) { count(); return tSTARTS; } (?i:tell) { count(); return tTELL; } -(?i:the[ \t]+last[\t ]+of[\t ]+) { - count(); - - yylval.e[0] = g_lingo->_theEntities["last"]->entity; - yylval.e[1] = 0; // No field - - return THEENTITYWITHID; - } (?i:the[ \t]+sqrt[\t ]+of[\t ]+) { count(); diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 97d8687626..091ea4c601 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -41,7 +41,6 @@ TheEntity entities[] = { { kTheCast, "cast", true, 2 }, // D2 { kTheCastMembers, "castmembers", false, 3 }, // D3 { kTheCenterStage, "centerStage", false, 2 }, // D2 p - { kTheChars, "chars", false, 3 }, // D3 { kTheCheckBoxAccess, "checkBoxAccess", false, 2 }, // D2 p { kTheCheckBoxType, "checkBoxType", false, 2 }, // D2 p { kTheClickLoc, "clickLoc", false, 4 }, // D4 function @@ -64,7 +63,6 @@ TheEntity entities[] = { { kTheFreeBytes, "freeBytes", false, 2 }, // D2 f { kTheFullColorPermit, "fullColorPermit", false, 2 }, // D2 p { kTheImageDirect, "imageDirect", false, 2 }, // D2 p - { kTheItems, "items", false, 3 }, // D3 { kTheItemDelimiter, "itemDelimiter", false, 4 }, // D4 p { kTheKey, "key", false, 2 }, // D2 f { kTheKeyCode, "keyCode", false, 2 }, // D2 f @@ -76,12 +74,10 @@ TheEntity entities[] = { { kTheLastFrame, "lastFrame", false, 4 }, // D4 p { kTheLastKey, "lastKey", false, 2 }, // D2 f { kTheLastRoll, "lastRoll", false, 2 }, // D2 f - { kTheLines, "lines", false, 3 }, // D3 { kTheMachineType, "machineType", false, 2 }, // D2 f { kTheMaxInteger, "maxInteger", false, 3 }, // D3.1 f { kTheMemorySize, "memorySize", false, 2 }, // D2 f { kTheMenu, "menu", true, 3 }, // D3 p - { kTheMenus, "menus", false, 3 }, // D3 p { kTheMenuItem, "menuitem", true, 3 }, // D3 p { kTheMenuItems, "menuitems", false, 3 }, // D3 f { kTheMouseCast, "mouseCast", false, 3 }, // D3 f @@ -147,7 +143,6 @@ TheEntity entities[] = { { kTheUpdateMovieEnabled,"updateMovieEnabled",false,4 },// D4 p { kTheWindow, "window", true, 4 }, // D4 { kTheWindowList, "windowList", false, 4 }, // D4 p - { kTheWords, "words", false, 3 }, // D3 { kTheNOEntity, NULL, false, 0 } }; @@ -178,7 +173,6 @@ TheEntityField fields[] = { { kTheSprite, "trails", kTheTrails, 3 },// D3.1 p { kTheSprite, "type", kTheType, 2 },// D2 p { kTheSprite, "visible", kTheVisible, 4 },// D4 p - { kTheSprite, "volume", kTheVolume, 3 },// D3.1 p { kTheSprite, "width", kTheWidth, 2 },// D2 p // Common cast fields @@ -214,6 +208,7 @@ TheEntityField fields[] = { { kTheSprite, "startTime", kTheStartTime, 3 },// D3.1 p { kTheSprite, "stopTime", kTheStopTime, 3 },// D3.1 p { kTheCast, "video", kTheVideo, 4 },// D4 p + { kTheSprite, "volume", kTheVolume, 3 },// D3.1 p // Bitmap fields { kTheCast, "depth", kTheDepth, 4 },// D4 p @@ -251,16 +246,6 @@ TheEntityField fields[] = { { kTheMenu, "name", kTheName, 3 },// D3 p { kTheCastMembers, "number", kTheNumber, 3 },// D3 p - { kTheChars, "number", kTheNumber, 3 },// D3 p - { kTheChars, "last", kTheLast, 4 },// D4 f - { kTheItems, "number", kTheNumber, 3 },// D3 p - { kTheItems, "last", kTheLast, 4 },// D4 f - { kTheLines, "number", kTheNumber, 3 },// D3 p - { kTheLines, "last", kTheLast, 4 },// D4 f - { kTheMenuItems,"number", kTheNumber, 3 },// D3 p - { kTheMenus, "number", kTheNumber, 3 },// D3 p - { kTheWords, "number", kTheNumber, 3 },// D3 p - { kTheWords, "last", kTheLast, 4 },// D4 f { kTheDate, "short", kTheShort, 3 },// D3 f { kTheDate, "long", kTheLong, 3 },// D3 f -- cgit v1.2.3 From f4a439a8e891efe4ca5eb151bec0c2761cbac39f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 20:12:17 +0100 Subject: DIRECTOR: LINGO: Implement 'the pi' --- engines/director/lingo/lingo-the.cpp | 5 +++++ engines/director/lingo/lingo-the.h | 1 + 2 files changed, 6 insertions(+) (limited to 'engines') diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 091ea4c601..79ea2f2866 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -101,6 +101,7 @@ TheEntity entities[] = { { kTheParamCount, "paramCount", false, 4 }, // D4 f { kThePathName, "pathName", false, 2 }, // D2 f { kThePauseState, "pauseState", false, 2 }, // D2 f + { kThePi, "pi", false, 4 }, // D4 f { kThePerFrameHook, "perFrameHook", false, 2 }, // D2 p { kThePreloadEventAbort,"preloadEventAbort",false, 4 }, // D4 p { kThePreLoadRAM, "preLoadRAM", false, 4 }, // D4 p @@ -523,6 +524,10 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) { d.type = INT; d.u.i = _vm->getCurrentScore()->_mouseIsDown; break; + case kThePi: + d.type = FLOAT; + d.u.f = M_PI; + break; default: warning("Lingo::getTheEntity(): Unprocessed getting field %d of entity %d", field, entity); d.type = VOID; diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h index c4306d4416..9857adb9d9 100644 --- a/engines/director/lingo/lingo-the.h +++ b/engines/director/lingo/lingo-the.h @@ -99,6 +99,7 @@ enum TheEntityType { kThePathName, kThePauseState, kThePerFrameHook, + kThePi, kThePreloadEventAbort, kThePreLoadRAM, kTheQuickTimePresent, -- cgit v1.2.3 From 30b9a43a4c60e4edcc8201735c3ad2433ff2dbfb Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 21:16:56 +0100 Subject: DIRECTOR: Generate start/stopMovie events --- engines/director/score.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines') diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 1eb1dcebe6..b81aae701c 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -1307,6 +1307,8 @@ void Score::startLoop() { _stopPlay = false; _nextFrameTime = 0; + _lingo->processEvent(kEventStartMovie); + _frames[_currentFrame]->prepareFrame(this); while (!_stopPlay) { @@ -1322,6 +1324,8 @@ void Score::startLoop() { if (_currentFrame < _frames.size()) _vm->processEvents(); } + + _lingo->processEvent(kEventStopMovie); } void Score::update() { -- cgit v1.2.3 From 8b8aebadcb45876027fdc8c80880bb51f7ff1055 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 22:11:52 +0100 Subject: DIRECTOR: Parse script cast types --- engines/director/cast.cpp | 17 ++++++++++++++--- engines/director/cast.h | 1 + engines/director/score.cpp | 5 +++-- engines/director/types.h | 5 +++-- 4 files changed, 21 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 4537742e19..8e547f0471 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -348,15 +348,26 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) { if (version < 4) { error("Unhandled Script cast"); } else if (version == 4) { - stream.readByte(); - stream.readByte(); + byte unk1 = stream.readByte(); + byte type = stream.readByte(); + + switch (type) { + case 1: + _scriptType = kScoreScript; + break; + case 3: + _scriptType = kMovieScript; + break; + default: + error("ScriptCast: Unprocessed script type: %d", type); + } _initialRect = Score::readRect(stream); _boundingRect = Score::readRect(stream); _id = stream.readUint32(); - debugC(4, kDebugLoading, "CASt: Script id: %d", _id); + debugC(4, kDebugLoading, "CASt: Script id: %d type: %s (%d) unk1: %d", _id, scriptType2str(_scriptType), type, unk1); stream.readByte(); // There should be no more data assert(stream.eos()); diff --git a/engines/director/cast.h b/engines/director/cast.h index 3e1479d041..5123ef8034 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -124,6 +124,7 @@ public: ScriptCast(Common::ReadStreamEndian &stream, uint16 version); uint32 _id; + ScriptType _scriptType; }; class RTECast : public TextCast { diff --git a/engines/director/score.cpp b/engines/director/score.cpp index b81aae701c..533c684677 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -50,7 +50,8 @@ const char *scriptTypes[] = { "SpriteScript", "FrameScript", "CastScript", - "GlobalScript" + "GlobalScript", + "ScoreScript" }; const char *scriptType2str(ScriptType scr) { @@ -615,7 +616,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, // TODO: Determine if there really is a minimum size. // This value was too small for Shape Casts. if (stream.size() < 10) { - warning("Score::loadCastData(): CAST data id %d is too small", id); + warning("Score::loadCastData(): CASt data id %d is too small", id); return; } diff --git a/engines/director/types.h b/engines/director/types.h index 0a170ffc23..4a9bcc8f4a 100644 --- a/engines/director/types.h +++ b/engines/director/types.h @@ -42,13 +42,14 @@ enum CastType { }; enum ScriptType { + kNoneScript = -1, kMovieScript = 0, kSpriteScript = 1, kFrameScript = 2, kCastScript = 3, kGlobalScript = 4, - kNoneScript = -1, - kMaxScriptType = 4 // Sync with score.cpp:45, array scriptTypes[] + kScoreScript = 5, + kMaxScriptType = 5 // Sync with score.cpp:45, array scriptTypes[] }; enum ShapeType { -- cgit v1.2.3 From 5fb8660a544f0b5f7d5b17ee1b57aedac388916a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 22:13:24 +0100 Subject: DIRECTOR: Set correct script cast type when parsing --- engines/director/score.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 533c684677..e92a68dfd1 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -768,9 +768,9 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, if (!ci->script.empty()) { // the script type here could be wrong! if (ConfMan.getBool("dump_scripts")) - dumpScript(ci->script.c_str(), kCastScript, id); + dumpScript(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id); - _lingo->addCode(ci->script.c_str(), kCastScript, id); + _lingo->addCode(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id); } } -- cgit v1.2.3 From 3780c42858bb5e3065e7c64b74e138d2312de400 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 22:13:54 +0100 Subject: DIRECTOR: LINGO: Fix MovieScript event processing --- engines/director/lingo/lingo-events.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp index 2a04a57e88..ab3b62aa50 100644 --- a/engines/director/lingo/lingo-events.cpp +++ b/engines/director/lingo/lingo-events.cpp @@ -200,8 +200,9 @@ void Lingo::runMovieScript(LEvent event) { if (_dontPassEvent) return; - for (uint i = 0; i < _scriptContexts[kMovieScript].size(); i++) { - processEvent(event, kMovieScript, i); + for (ScriptContextHash::iterator it = _scriptContexts[kMovieScript].begin(); + it != _scriptContexts[kMovieScript].end(); ++it) { + processEvent(event, kMovieScript, it->_key); // TODO: How do know which script handles the message? } debugC(9, kDebugEvents, "STUB: processEvent(event, kMovieScript, ?)"); @@ -243,12 +244,13 @@ void Lingo::processFrameEvent(LEvent event) { void Lingo::processGenericEvent(LEvent event) { // Movie Script int id = -1; - if (event == kEventStart || event == kEventPrepareMovie) + if (event == kEventStart || event == kEventPrepareMovie || + event == kEventStartMovie || event == kEventStopMovie) id = 0; else - warning("STUB: processGenericEvent called for something else than kEventStart or kEventPrepareMovie, additional logic probably needed"); + warning("STUB: processGenericEvent called for unprocessed event, additional logic probably needed"); - processEvent(event, kMovieScript, id); + runMovieScript(event); } void Lingo::processSpriteEvent(LEvent event) { -- cgit v1.2.3 From 50c0d8b3c21b89a26c9add47c0d5ea621087ce5e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 22:16:19 +0100 Subject: DIRECTOR: LINGO: Regenerate lexer --- engines/director/lingo/lingo-lex.cpp | 577 +++++++++++++++++------------------ 1 file changed, 277 insertions(+), 300 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index b6f9e63e06..fb8fbb125c 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -364,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 76 -#define YY_END_OF_BUFFER 77 +#define YY_NUM_RULES 75 +#define YY_END_OF_BUFFER 76 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -373,43 +373,42 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[314] = +static yyconst flex_int16_t yy_accept[305] = { 0, - 0, 0, 77, 75, 4, 73, 73, 75, 75, 75, - 72, 72, 72, 71, 72, 68, 72, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 75, 3, 3, 69, 4, 73, - 0, 0, 0, 74, 5, 67, 2, 70, 71, 66, - 64, 65, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 22, 13, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 35, 36, 69, 38, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 57, 69, 69, - 69, 1, 3, 3, 0, 69, 5, 2, 70, 69, - - 7, 69, 69, 69, 69, 69, 69, 16, 69, 69, - 0, 69, 69, 69, 69, 69, 69, 69, 31, 69, - 69, 34, 69, 69, 69, 69, 44, 69, 46, 69, - 69, 69, 69, 69, 69, 69, 69, 0, 69, 69, - 69, 9, 69, 11, 12, 15, 0, 18, 69, 0, - 69, 69, 25, 26, 27, 28, 69, 69, 69, 33, - 37, 40, 69, 69, 69, 69, 69, 48, 0, 56, - 61, 69, 59, 63, 0, 69, 6, 69, 69, 0, - 16, 69, 21, 69, 69, 29, 69, 32, 0, 69, - 69, 69, 69, 69, 69, 55, 55, 55, 55, 55, - - 62, 69, 0, 69, 8, 69, 0, 16, 19, 0, - 69, 69, 69, 0, 69, 69, 69, 45, 58, 47, - 0, 0, 55, 55, 55, 55, 60, 0, 69, 69, - 14, 0, 69, 69, 0, 30, 0, 69, 69, 69, - 0, 0, 0, 0, 55, 55, 55, 55, 0, 17, - 10, 0, 23, 69, 30, 30, 0, 69, 42, 43, - 0, 0, 0, 55, 55, 55, 55, 17, 0, 69, - 30, 0, 41, 0, 0, 0, 0, 55, 0, 55, - 0, 24, 39, 54, 53, 54, 0, 0, 55, 0, - 0, 0, 20, 53, 0, 0, 0, 0, 0, 49, - - 0, 0, 50, 51, 0, 51, 0, 53, 0, 53, - 0, 52, 0 + 0, 0, 76, 74, 4, 72, 72, 74, 74, 74, + 71, 71, 71, 70, 71, 67, 71, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 74, 3, 3, 68, 4, 72, + 0, 0, 0, 73, 5, 66, 2, 69, 70, 65, + 63, 64, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 22, 13, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 35, 36, 68, 38, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 56, 68, 68, + 68, 1, 3, 3, 0, 68, 5, 2, 69, 68, + + 7, 68, 68, 68, 68, 68, 68, 16, 68, 68, + 0, 68, 68, 68, 68, 68, 68, 68, 31, 68, + 68, 34, 68, 68, 68, 68, 44, 68, 46, 68, + 68, 68, 68, 68, 68, 68, 68, 0, 68, 68, + 68, 9, 68, 11, 12, 15, 0, 18, 68, 0, + 68, 68, 25, 26, 27, 28, 68, 68, 68, 33, + 37, 40, 68, 68, 68, 68, 68, 48, 0, 55, + 60, 68, 58, 62, 0, 68, 6, 68, 68, 0, + 16, 68, 21, 68, 68, 29, 68, 32, 0, 68, + 68, 68, 68, 68, 68, 54, 54, 54, 54, 61, + + 68, 0, 68, 8, 68, 0, 16, 19, 0, 68, + 68, 68, 0, 68, 68, 68, 45, 57, 47, 0, + 0, 54, 54, 54, 59, 0, 68, 68, 14, 0, + 68, 68, 0, 30, 0, 68, 68, 68, 0, 0, + 0, 0, 54, 54, 54, 0, 17, 10, 0, 23, + 68, 30, 30, 0, 68, 42, 43, 0, 0, 0, + 54, 54, 54, 17, 0, 68, 30, 0, 41, 0, + 0, 0, 54, 0, 54, 0, 24, 39, 53, 52, + 53, 54, 0, 0, 0, 20, 52, 0, 0, 0, + 0, 0, 0, 49, 50, 0, 50, 0, 52, 0, + + 52, 0, 51, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -455,18 +454,18 @@ static yyconst flex_int32_t yy_meta[66] = 5, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[330] = +static yyconst flex_int16_t yy_base[321] = { 0, - 0, 64, 436, 834, 68, 834, 834, 72, 428, 0, - 834, 406, 390, 55, 63, 834, 365, 59, 59, 59, + 0, 64, 485, 800, 68, 800, 800, 72, 474, 0, + 800, 427, 419, 55, 63, 800, 365, 59, 59, 59, 55, 63, 0, 64, 75, 70, 100, 77, 110, 102, - 98, 129, 128, 131, 83, 166, 187, 293, 191, 834, - 195, 144, 320, 834, 0, 834, 0, 305, 160, 834, - 834, 834, 0, 66, 131, 156, 162, 74, 173, 149, + 98, 129, 128, 131, 83, 166, 187, 293, 191, 800, + 195, 144, 320, 800, 0, 800, 0, 305, 160, 800, + 800, 800, 0, 66, 131, 156, 162, 74, 173, 149, 167, 180, 156, 91, 0, 174, 193, 172, 186, 198, 184, 200, 183, 188, 0, 0, 203, 0, 211, 208, 192, 210, 209, 215, 233, 228, 236, 0, 238, 231, - 234, 834, 290, 294, 271, 225, 0, 0, 223, 237, + 234, 800, 290, 294, 271, 225, 0, 0, 223, 237, 0, 246, 244, 243, 243, 251, 260, 213, 250, 268, 268, 270, 286, 282, 266, 283, 282, 284, 0, 292, @@ -474,68 +473,66 @@ static yyconst flex_int16_t yy_base[330] = 295, 303, 346, 307, 326, 307, 337, 177, 147, 328, 329, 0, 341, 0, 0, 269, 361, 0, 347, 337, 348, 335, 0, 0, 0, 0, 339, 340, 350, 0, - 0, 371, 347, 357, 362, 339, 346, 0, 412, 0, - 0, 363, 362, 0, 107, 91, 0, 374, 375, 405, - 0, 375, 406, 387, 384, 0, 386, 0, 422, 403, - 389, 388, 393, 402, 395, 449, 462, 456, 466, 472, - - 0, 403, 86, 79, 0, 404, 413, 0, 0, 473, - 418, 459, 481, 451, 462, 449, 452, 0, 0, 0, - 495, 468, 497, 491, 519, 531, 0, 42, 20, 476, - 834, 485, 491, 504, 530, 0, 509, 507, 504, 499, - 542, 528, 524, 525, 554, 555, 564, 575, 18, 0, - 0, 544, 0, 532, 0, 0, 540, 551, 0, 0, - 544, 579, 555, 585, 595, 599, 610, 834, 565, 560, - 0, 587, 0, 593, 617, 600, 622, 627, 623, 645, - 605, 0, 834, 834, 0, 834, 643, 612, 659, 660, - 616, 673, 834, 0, 669, 681, 683, 687, 632, 689, - - 693, 658, 694, 702, 704, 708, 710, 717, 675, 726, - 577, 834, 834, 767, 769, 772, 775, 781, 786, 791, - 793, 798, 803, 806, 809, 814, 817, 822, 827 + 0, 371, 347, 357, 362, 339, 346, 0, 382, 0, + 0, 374, 375, 0, 107, 91, 0, 380, 377, 404, + 0, 380, 410, 379, 376, 0, 394, 0, 416, 398, + 392, 390, 389, 407, 399, 439, 450, 456, 454, 0, + + 416, 86, 79, 0, 421, 415, 0, 0, 468, 432, + 446, 470, 432, 449, 441, 443, 0, 0, 0, 479, + 459, 493, 495, 515, 0, 42, 20, 448, 800, 454, + 470, 488, 517, 0, 506, 505, 479, 489, 525, 514, + 512, 510, 539, 559, 560, 18, 0, 0, 526, 0, + 504, 0, 0, 519, 523, 0, 0, 519, 570, 539, + 571, 575, 585, 800, 555, 550, 0, 565, 0, 567, + 595, 568, 599, 610, 600, 577, 0, 800, 800, 0, + 800, 614, 620, 581, 631, 800, 0, 632, 624, 633, + 599, 642, 621, 637, 652, 668, 673, 677, 679, 633, + + 692, 612, 800, 800, 733, 735, 738, 741, 747, 752, + 757, 759, 764, 769, 772, 775, 780, 783, 788, 793 } ; -static yyconst flex_int16_t yy_def[330] = +static yyconst flex_int16_t yy_def[321] = { 0, - 313, 1, 313, 313, 313, 313, 313, 313, 314, 315, - 313, 313, 313, 313, 313, 313, 313, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 313, 313, 313, 316, 313, 313, - 313, 313, 314, 313, 317, 313, 318, 313, 313, 313, - 313, 313, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 313, 313, 313, 313, 316, 317, 318, 313, 316, - - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 313, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 313, 316, 316, - 316, 316, 316, 316, 316, 316, 319, 316, 316, 313, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 320, 316, - 316, 316, 316, 316, 313, 316, 316, 316, 316, 313, - 321, 316, 313, 316, 316, 316, 316, 316, 313, 316, - 316, 316, 316, 316, 316, 320, 320, 320, 320, 320, - - 316, 316, 313, 316, 316, 316, 313, 321, 316, 313, - 316, 316, 322, 313, 316, 316, 316, 316, 316, 316, - 313, 313, 320, 320, 320, 320, 316, 313, 316, 316, - 313, 313, 316, 316, 323, 324, 313, 316, 316, 316, - 313, 313, 313, 313, 320, 320, 320, 320, 313, 316, - 316, 313, 316, 316, 325, 324, 313, 316, 316, 316, - 313, 313, 313, 320, 320, 320, 320, 313, 313, 316, - 325, 313, 316, 313, 326, 313, 313, 320, 313, 320, - 313, 316, 313, 313, 327, 313, 313, 313, 320, 313, - 313, 313, 313, 327, 313, 313, 313, 313, 313, 326, - - 313, 313, 326, 313, 313, 326, 328, 329, 313, 329, - 313, 313, 0, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313 + 304, 1, 304, 304, 304, 304, 304, 304, 305, 306, + 304, 304, 304, 304, 304, 304, 304, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 304, 304, 304, 307, 304, 304, + 304, 304, 305, 304, 308, 304, 309, 304, 304, 304, + 304, 304, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 304, 304, 304, 304, 307, 308, 309, 304, 307, + + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 304, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 304, 307, 307, + 307, 307, 307, 307, 307, 307, 310, 307, 307, 304, + 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, 311, 307, + 307, 307, 307, 307, 304, 307, 307, 307, 307, 304, + 312, 307, 304, 307, 307, 307, 307, 307, 304, 307, + 307, 307, 307, 307, 307, 311, 311, 311, 311, 307, + + 307, 304, 307, 307, 307, 304, 312, 307, 304, 307, + 307, 313, 304, 307, 307, 307, 307, 307, 307, 304, + 304, 311, 311, 311, 307, 304, 307, 307, 304, 304, + 307, 307, 314, 315, 304, 307, 307, 307, 304, 304, + 304, 304, 311, 311, 311, 304, 307, 307, 304, 307, + 307, 316, 315, 304, 307, 307, 307, 304, 304, 304, + 311, 311, 311, 304, 304, 307, 316, 304, 307, 304, + 317, 304, 311, 304, 311, 304, 307, 304, 304, 318, + 304, 311, 304, 304, 304, 304, 318, 304, 304, 304, + 304, 304, 304, 317, 304, 304, 317, 319, 320, 304, + + 320, 304, 304, 0, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304 } ; -static yyconst flex_int16_t yy_nxt[900] = +static yyconst flex_int16_t yy_nxt[866] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 13, 4, 14, 15, 16, 17, 18, 19, 20, 21, @@ -545,16 +542,16 @@ static yyconst flex_int16_t yy_nxt[900] = 26, 27, 28, 29, 30, 23, 31, 32, 33, 23, 23, 34, 23, 23, 35, 36, 48, 49, 37, 39, 40, 40, 41, 41, 40, 40, 41, 50, 51, 56, - 54, 268, 57, 250, 59, 92, 92, 55, 58, 60, - 63, 61, 111, 64, 68, 111, 65, 73, 249, 69, + 54, 264, 57, 247, 59, 92, 92, 55, 58, 60, + 63, 61, 111, 64, 68, 111, 65, 73, 246, 69, 100, 62, 104, 66, 56, 54, 74, 57, 59, 67, 38, 55, 58, 60, 63, 61, 70, 64, 82, 68, 71, 65, 73, 69, 100, 62, 104, 66, 79, 72, - 74, 75, 42, 67, 80, 229, 42, 81, 76, 228, - 77, 70, 78, 82, 204, 71, 92, 92, 86, 83, + 74, 75, 42, 67, 80, 227, 42, 81, 76, 226, + 77, 70, 78, 82, 203, 71, 92, 92, 86, 83, 101, 87, 79, 72, 89, 90, 75, 88, 80, 84, - 91, 81, 76, 85, 77, 203, 78, 93, 40, 40, + 91, 81, 76, 85, 77, 202, 78, 93, 40, 40, 94, 48, 49, 86, 83, 101, 87, 102, 103, 89, 90, 88, 107, 84, 91, 110, 108, 85, 94, 40, 40, 94, 39, 40, 40, 41, 41, 40, 40, 41, @@ -578,67 +575,63 @@ static yyconst flex_int16_t yy_nxt[900] = 169, 167, 172, 168, 42, 173, 174, 179, 42, 171, 177, 178, 147, 182, 184, 147, 183, 185, 186, 187, 188, 191, 189, 194, 170, 189, 172, 192, 193, 52, - 195, 174, 179, 201, 177, 178, 202, 190, 182, 184, - 183, 185, 186, 187, 205, 188, 191, 194, 170, 206, - - 47, 209, 192, 193, 195, 213, 180, 210, 201, 180, - 210, 202, 190, 169, 46, 211, 169, 212, 216, 205, - 217, 215, 219, 189, 206, 209, 189, 218, 220, 207, - 213, 227, 230, 44, 231, 313, 233, 313, 197, 211, - 198, 212, 216, 214, 217, 199, 215, 219, 200, 313, - 221, 218, 220, 221, 207, 227, 230, 221, 222, 231, - 221, 233, 197, 221, 198, 222, 221, 221, 214, 199, - 221, 222, 200, 221, 210, 222, 221, 210, 223, 234, - 238, 222, 235, 237, 239, 235, 240, 242, 226, 313, - 313, 224, 221, 53, 232, 221, 241, 225, 221, 241, - - 222, 221, 244, 223, 234, 238, 222, 237, 239, 251, - 240, 253, 242, 226, 242, 224, 313, 252, 246, 232, - 221, 225, 254, 221, 243, 257, 244, 258, 222, 244, - 245, 235, 221, 251, 235, 221, 253, 259, 260, 242, - 222, 252, 246, 241, 261, 262, 241, 254, 243, 263, - 257, 247, 258, 244, 245, 221, 221, 248, 221, 221, - 269, 259, 260, 222, 222, 221, 270, 272, 221, 261, - 262, 243, 265, 222, 263, 247, 221, 273, 274, 221, - 275, 248, 276, 275, 222, 269, 277, 313, 264, 277, - 270, 272, 281, 282, 222, 243, 221, 265, 266, 221, - - 279, 273, 274, 279, 222, 312, 276, 283, 222, 313, - 267, 221, 264, 284, 221, 278, 281, 282, 275, 222, - 286, 275, 266, 287, 290, 293, 287, 290, 221, 312, - 280, 221, 283, 295, 267, 313, 222, 297, 284, 313, - 278, 242, 242, 313, 287, 286, 292, 287, 313, 292, - 293, 288, 291, 304, 222, 280, 244, 244, 295, 289, - 296, 290, 297, 296, 290, 313, 242, 242, 222, 313, - 300, 313, 288, 300, 298, 288, 291, 298, 304, 305, - 244, 244, 301, 289, 303, 301, 313, 303, 298, 291, - 300, 298, 242, 300, 301, 303, 288, 301, 303, 311, - - 242, 313, 299, 306, 305, 307, 306, 244, 307, 306, - 302, 307, 306, 291, 307, 244, 299, 242, 309, 313, - 313, 309, 302, 313, 311, 242, 299, 309, 313, 294, - 309, 244, 313, 313, 302, 313, 313, 313, 294, 244, - 299, 313, 313, 313, 313, 313, 302, 313, 313, 313, - 285, 313, 313, 313, 313, 313, 313, 294, 313, 313, - 313, 313, 313, 313, 313, 313, 294, 43, 43, 313, - 43, 43, 43, 45, 45, 53, 53, 53, 97, 97, - 97, 98, 98, 313, 98, 98, 98, 181, 313, 313, - 181, 181, 196, 313, 313, 196, 208, 208, 208, 236, - - 313, 236, 236, 236, 255, 313, 313, 255, 255, 256, - 256, 256, 271, 271, 271, 285, 313, 313, 285, 285, - 294, 294, 294, 308, 313, 313, 308, 308, 310, 313, - 310, 310, 310, 3, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313 - + 195, 174, 179, 169, 177, 178, 169, 190, 182, 184, + 183, 185, 186, 187, 200, 188, 191, 194, 170, 201, + + 204, 205, 192, 193, 195, 180, 208, 210, 180, 211, + 197, 209, 190, 212, 209, 198, 214, 189, 199, 200, + 189, 215, 216, 217, 201, 204, 205, 218, 206, 47, + 208, 210, 219, 211, 197, 46, 229, 213, 212, 198, + 220, 214, 199, 220, 225, 215, 216, 217, 221, 228, + 231, 220, 218, 206, 220, 220, 219, 220, 220, 221, + 220, 229, 213, 221, 235, 221, 232, 236, 225, 209, + 224, 233, 209, 228, 233, 231, 237, 238, 240, 44, + 239, 248, 53, 239, 304, 222, 249, 223, 235, 230, + 250, 232, 236, 242, 220, 224, 220, 220, 240, 220, + + 237, 238, 221, 240, 221, 248, 251, 304, 241, 222, + 249, 223, 256, 242, 230, 250, 220, 242, 233, 220, + 243, 233, 254, 240, 221, 255, 239, 244, 257, 239, + 258, 251, 241, 259, 260, 304, 256, 242, 266, 304, + 220, 245, 265, 220, 243, 304, 268, 254, 221, 269, + 255, 244, 257, 270, 241, 258, 261, 304, 259, 260, + 220, 220, 266, 220, 220, 245, 272, 265, 221, 221, + 268, 271, 220, 269, 271, 220, 274, 270, 241, 274, + 221, 261, 276, 277, 221, 278, 220, 279, 281, 220, + 272, 273, 304, 262, 221, 263, 271, 286, 304, 271, + + 220, 285, 289, 220, 285, 275, 276, 277, 221, 221, + 278, 283, 279, 281, 283, 288, 273, 262, 288, 263, + 295, 283, 286, 221, 283, 294, 304, 289, 294, 240, + 275, 282, 290, 292, 290, 290, 292, 290, 294, 284, + 303, 294, 296, 292, 242, 295, 292, 304, 304, 284, + 240, 240, 304, 297, 240, 282, 297, 302, 304, 304, + 291, 293, 291, 284, 303, 242, 242, 296, 242, 298, + 304, 293, 298, 284, 297, 240, 240, 297, 298, 304, + 300, 298, 302, 300, 291, 293, 291, 304, 304, 242, + 242, 287, 304, 300, 304, 293, 300, 304, 304, 304, + + 304, 304, 304, 304, 287, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 280, 304, 287, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 287, 43, 43, 304, 43, 43, 43, 45, + 45, 53, 53, 53, 97, 97, 97, 98, 98, 304, + 98, 98, 98, 181, 304, 304, 181, 181, 196, 304, + 304, 196, 207, 207, 207, 234, 304, 234, 234, 234, + 252, 304, 304, 252, 252, 253, 253, 253, 267, 267, + 267, 280, 304, 304, 280, 280, 287, 287, 287, 299, + 304, 304, 299, 299, 301, 304, 301, 301, 301, 3, + + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304 } ; -static yyconst flex_int16_t yy_chk[900] = +static yyconst flex_int16_t yy_chk[866] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -648,13 +641,13 @@ static yyconst flex_int16_t yy_chk[900] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 14, 14, 2, 5, 5, 5, 5, 8, 8, 8, 8, 15, 15, 19, - 18, 249, 20, 229, 21, 35, 35, 18, 20, 22, - 24, 22, 64, 24, 26, 64, 25, 28, 228, 26, + 18, 246, 20, 227, 21, 35, 35, 18, 20, 22, + 24, 22, 64, 24, 26, 64, 25, 28, 226, 26, 54, 22, 58, 25, 19, 18, 28, 20, 21, 25, 2, 18, 20, 22, 24, 22, 27, 24, 31, 26, 27, 25, 28, 26, 54, 22, 58, 25, 30, 27, - 28, 29, 5, 25, 30, 204, 8, 30, 29, 203, + 28, 29, 5, 25, 30, 203, 8, 30, 29, 202, 29, 27, 29, 31, 176, 27, 42, 42, 33, 32, 55, 33, 30, 27, 34, 34, 29, 33, 30, 32, 34, 30, 29, 32, 29, 175, 29, 36, 36, 36, @@ -681,64 +674,60 @@ static yyconst flex_int16_t yy_chk[900] = 133, 131, 135, 132, 93, 136, 137, 143, 94, 134, 140, 141, 147, 149, 151, 147, 150, 152, 157, 158, 159, 163, 162, 166, 133, 162, 135, 164, 165, 17, - 167, 137, 143, 172, 140, 141, 173, 162, 149, 151, - 150, 152, 157, 158, 178, 159, 163, 166, 133, 179, - - 13, 182, 164, 165, 167, 187, 180, 183, 172, 180, - 183, 173, 162, 169, 12, 184, 169, 185, 191, 178, - 192, 190, 194, 189, 179, 182, 189, 193, 195, 180, - 187, 202, 206, 9, 207, 3, 211, 0, 169, 184, - 169, 185, 191, 189, 192, 169, 190, 194, 169, 0, - 196, 193, 195, 196, 180, 202, 206, 198, 196, 207, - 198, 211, 169, 197, 169, 198, 197, 199, 189, 169, - 199, 197, 169, 200, 210, 199, 200, 210, 197, 212, - 215, 200, 213, 214, 216, 213, 217, 222, 200, 0, - 0, 198, 224, 213, 210, 224, 221, 199, 223, 221, - - 224, 223, 222, 197, 212, 215, 223, 214, 216, 230, - 217, 233, 222, 200, 221, 198, 0, 232, 224, 210, - 225, 199, 234, 225, 221, 237, 222, 238, 225, 221, - 223, 235, 226, 230, 235, 226, 233, 239, 240, 221, - 226, 232, 224, 241, 242, 243, 241, 234, 221, 244, - 237, 225, 238, 221, 223, 245, 246, 226, 245, 246, - 252, 239, 240, 245, 246, 247, 254, 257, 247, 242, - 243, 241, 246, 247, 244, 225, 248, 258, 261, 248, - 262, 226, 263, 262, 248, 252, 264, 0, 245, 264, - 254, 257, 269, 270, 264, 241, 265, 246, 247, 265, - - 266, 258, 261, 266, 265, 311, 263, 272, 266, 0, - 248, 267, 245, 274, 267, 265, 269, 270, 275, 267, - 276, 275, 247, 277, 279, 281, 277, 279, 278, 311, - 267, 278, 272, 288, 248, 0, 278, 291, 274, 0, - 265, 277, 279, 0, 287, 276, 280, 287, 0, 280, - 281, 277, 279, 299, 280, 267, 277, 279, 288, 278, - 289, 290, 291, 289, 290, 0, 277, 279, 289, 0, - 295, 0, 287, 295, 292, 277, 279, 292, 299, 302, - 277, 279, 296, 278, 297, 296, 0, 297, 298, 290, - 300, 298, 292, 300, 301, 303, 287, 301, 303, 309, - - 296, 0, 292, 304, 302, 305, 304, 292, 305, 306, - 296, 307, 306, 290, 307, 296, 298, 292, 308, 0, - 0, 308, 301, 0, 309, 296, 292, 310, 0, 308, - 310, 292, 0, 0, 296, 0, 0, 0, 310, 296, - 298, 0, 0, 0, 0, 0, 301, 0, 0, 0, - 307, 0, 0, 0, 0, 0, 0, 308, 0, 0, - 0, 0, 0, 0, 0, 0, 310, 314, 314, 0, - 314, 314, 314, 315, 315, 316, 316, 316, 317, 317, - 317, 318, 318, 0, 318, 318, 318, 319, 0, 0, - 319, 319, 320, 0, 0, 320, 321, 321, 321, 322, - - 0, 322, 322, 322, 323, 0, 0, 323, 323, 324, - 324, 324, 325, 325, 325, 326, 0, 0, 326, 326, - 327, 327, 327, 328, 0, 0, 328, 328, 329, 0, - 329, 329, 329, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313 - + 167, 137, 143, 169, 140, 141, 169, 162, 149, 151, + 150, 152, 157, 158, 172, 159, 163, 166, 133, 173, + + 178, 179, 164, 165, 167, 180, 182, 184, 180, 185, + 169, 183, 162, 187, 183, 169, 190, 189, 169, 172, + 189, 191, 192, 193, 173, 178, 179, 194, 180, 13, + 182, 184, 195, 185, 169, 12, 206, 189, 187, 169, + 196, 190, 169, 196, 201, 191, 192, 193, 196, 205, + 210, 197, 194, 180, 197, 199, 195, 198, 199, 197, + 198, 206, 189, 199, 213, 198, 211, 214, 201, 209, + 199, 212, 209, 205, 212, 210, 215, 216, 221, 9, + 220, 228, 212, 220, 3, 197, 230, 198, 213, 209, + 231, 211, 214, 221, 222, 199, 223, 222, 220, 223, + + 215, 216, 222, 221, 223, 228, 232, 0, 220, 197, + 230, 198, 237, 220, 209, 231, 224, 221, 233, 224, + 222, 233, 235, 220, 224, 236, 239, 223, 238, 239, + 240, 232, 220, 241, 242, 0, 237, 220, 251, 0, + 243, 224, 249, 243, 222, 0, 254, 235, 243, 255, + 236, 223, 238, 258, 239, 240, 243, 0, 241, 242, + 244, 245, 251, 244, 245, 224, 260, 249, 244, 245, + 254, 259, 261, 255, 259, 261, 262, 258, 239, 262, + 261, 243, 265, 266, 262, 268, 263, 270, 272, 263, + 260, 261, 0, 244, 263, 245, 271, 276, 0, 271, + + 273, 275, 284, 273, 275, 263, 265, 266, 273, 275, + 268, 274, 270, 272, 274, 282, 261, 244, 282, 245, + 291, 283, 276, 282, 283, 289, 0, 284, 289, 274, + 263, 273, 285, 288, 290, 285, 288, 290, 294, 274, + 302, 294, 293, 292, 274, 291, 292, 0, 0, 283, + 285, 288, 0, 295, 274, 273, 295, 300, 0, 0, + 285, 288, 290, 274, 302, 285, 288, 293, 274, 296, + 0, 292, 296, 283, 297, 285, 288, 297, 298, 0, + 299, 298, 300, 299, 285, 288, 290, 0, 0, 285, + 288, 299, 0, 301, 0, 292, 301, 0, 0, 0, + + 0, 0, 0, 0, 301, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 298, 0, 299, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 301, 305, 305, 0, 305, 305, 305, 306, + 306, 307, 307, 307, 308, 308, 308, 309, 309, 0, + 309, 309, 309, 310, 0, 0, 310, 310, 311, 0, + 0, 311, 312, 312, 312, 313, 0, 313, 313, 313, + 314, 0, 0, 314, 314, 315, 315, 315, 316, 316, + 316, 317, 0, 0, 317, 317, 318, 318, 318, 319, + 0, 0, 319, 319, 320, 0, 320, 320, 320, 304, + + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304 } ; static yy_state_type yy_last_accepting_state; @@ -827,7 +816,7 @@ static int checkImmediate(int token) { return token; } -#line 831 "engines/director/lingo/lingo-lex.cpp" +#line 820 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -1013,7 +1002,7 @@ YY_DECL #line 87 "engines/director/lingo/lingo-lex.l" -#line 1017 "engines/director/lingo/lingo-lex.cpp" +#line 1006 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -1067,13 +1056,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 314 ) + if ( yy_current_state >= 305 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 313 ); + while ( yy_current_state != 304 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1367,7 +1356,7 @@ YY_RULE_SETUP { count(); - yylval.e[0] = g_lingo->_theEntities["last"]->entity; + yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity; yylval.e[1] = 0; // No field return THEENTITYWITHID; @@ -1379,26 +1368,14 @@ YY_RULE_SETUP { count(); - yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity; - yylval.e[1] = 0; // No field - - return THEENTITYWITHID; - } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 182 "engines/director/lingo/lingo-lex.l" -{ - count(); - yylval.s = new Common::String("value"); return FBLTINONEARG; } YY_BREAK -case 52: +case 51: YY_RULE_SETUP -#line 189 "engines/director/lingo/lingo-lex.l" +#line 181 "engines/director/lingo/lingo-lex.l" { count(); @@ -1423,9 +1400,9 @@ YY_RULE_SETUP error("LEXER: Unhandled chunk expression '%s'", yylval.s->c_str()); } YY_BREAK -case 53: +case 52: YY_RULE_SETUP -#line 212 "engines/director/lingo/lingo-lex.l" +#line 204 "engines/director/lingo/lingo-lex.l" { count(); @@ -1480,9 +1457,9 @@ YY_RULE_SETUP warning("LEXER: Unhandled the entity '%s', field '%s'", ptr, field.c_str()); } YY_BREAK -case 54: +case 53: YY_RULE_SETUP -#line 265 "engines/director/lingo/lingo-lex.l" +#line 257 "engines/director/lingo/lingo-lex.l" { count(); @@ -1515,9 +1492,9 @@ YY_RULE_SETUP return THEENTITY; } YY_BREAK -case 55: +case 54: YY_RULE_SETUP -#line 296 "engines/director/lingo/lingo-lex.l" +#line 288 "engines/director/lingo/lingo-lex.l" { count(); @@ -1538,74 +1515,74 @@ YY_RULE_SETUP warning("LEXER: Unhandled the entity '%s'", ptr); } YY_BREAK -case 56: +case 55: YY_RULE_SETUP -#line 315 "engines/director/lingo/lingo-lex.l" +#line 307 "engines/director/lingo/lingo-lex.l" { count(); return tTHEN; } YY_BREAK -case 57: +case 56: YY_RULE_SETUP -#line 316 "engines/director/lingo/lingo-lex.l" +#line 308 "engines/director/lingo/lingo-lex.l" { count(); return tTO; } YY_BREAK -case 58: +case 57: YY_RULE_SETUP -#line 317 "engines/director/lingo/lingo-lex.l" +#line 309 "engines/director/lingo/lingo-lex.l" { count(); return tSPRITE; } YY_BREAK -case 59: +case 58: YY_RULE_SETUP -#line 318 "engines/director/lingo/lingo-lex.l" +#line 310 "engines/director/lingo/lingo-lex.l" { count(); return tWITH; } YY_BREAK -case 60: +case 59: YY_RULE_SETUP -#line 319 "engines/director/lingo/lingo-lex.l" +#line 311 "engines/director/lingo/lingo-lex.l" { count(); return tWITHIN; } YY_BREAK -case 61: +case 60: YY_RULE_SETUP -#line 320 "engines/director/lingo/lingo-lex.l" +#line 312 "engines/director/lingo/lingo-lex.l" { count(); return tWHEN; } YY_BREAK -case 62: +case 61: YY_RULE_SETUP -#line 321 "engines/director/lingo/lingo-lex.l" +#line 313 "engines/director/lingo/lingo-lex.l" { count(); return tWHILE; } YY_BREAK -case 63: +case 62: YY_RULE_SETUP -#line 322 "engines/director/lingo/lingo-lex.l" +#line 314 "engines/director/lingo/lingo-lex.l" { count(); return tWORD; } YY_BREAK -case 64: +case 63: YY_RULE_SETUP -#line 324 "engines/director/lingo/lingo-lex.l" +#line 316 "engines/director/lingo/lingo-lex.l" { count(); return tNEQ; } YY_BREAK -case 65: +case 64: YY_RULE_SETUP -#line 325 "engines/director/lingo/lingo-lex.l" +#line 317 "engines/director/lingo/lingo-lex.l" { count(); return tGE; } YY_BREAK -case 66: +case 65: YY_RULE_SETUP -#line 326 "engines/director/lingo/lingo-lex.l" +#line 318 "engines/director/lingo/lingo-lex.l" { count(); return tLE; } YY_BREAK -case 67: +case 66: YY_RULE_SETUP -#line 327 "engines/director/lingo/lingo-lex.l" +#line 319 "engines/director/lingo/lingo-lex.l" { count(); return tCONCAT; } YY_BREAK -case 68: +case 67: YY_RULE_SETUP -#line 328 "engines/director/lingo/lingo-lex.l" +#line 320 "engines/director/lingo/lingo-lex.l" { count(); return tEQ; } YY_BREAK -case 69: +case 68: YY_RULE_SETUP -#line 330 "engines/director/lingo/lingo-lex.l" +#line 322 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); @@ -1661,43 +1638,43 @@ YY_RULE_SETUP return ID; } YY_BREAK -case 70: +case 69: YY_RULE_SETUP -#line 384 "engines/director/lingo/lingo-lex.l" +#line 376 "engines/director/lingo/lingo-lex.l" { count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK -case 71: +case 70: YY_RULE_SETUP -#line 385 "engines/director/lingo/lingo-lex.l" +#line 377 "engines/director/lingo/lingo-lex.l" { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK -case 72: +case 71: YY_RULE_SETUP -#line 386 "engines/director/lingo/lingo-lex.l" +#line 378 "engines/director/lingo/lingo-lex.l" { count(); return *yytext; } YY_BREAK -case 73: -/* rule 73 can match eol */ +case 72: +/* rule 72 can match eol */ YY_RULE_SETUP -#line 387 "engines/director/lingo/lingo-lex.l" +#line 379 "engines/director/lingo/lingo-lex.l" { count(); return '\n'; } YY_BREAK -case 74: +case 73: YY_RULE_SETUP -#line 388 "engines/director/lingo/lingo-lex.l" +#line 380 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK -case 75: +case 74: YY_RULE_SETUP -#line 389 "engines/director/lingo/lingo-lex.l" +#line 381 "engines/director/lingo/lingo-lex.l" { count(); } YY_BREAK -case 76: +case 75: YY_RULE_SETUP -#line 391 "engines/director/lingo/lingo-lex.l" +#line 383 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1701 "engines/director/lingo/lingo-lex.cpp" +#line 1678 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1991,7 +1968,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 314 ) + if ( yy_current_state >= 305 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2019,11 +1996,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 314 ) + if ( yy_current_state >= 305 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 313); + yy_is_jam = (yy_current_state == 304); return yy_is_jam ? 0 : yy_current_state; } @@ -2657,7 +2634,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 391 "engines/director/lingo/lingo-lex.l" +#line 383 "engines/director/lingo/lingo-lex.l" -- cgit v1.2.3 From 25dca26ff82caf5e944212bd39b128484211a830 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 8 Jan 2020 23:03:24 +0100 Subject: DIRECTOR: Fix loading CastInfo strings --- engines/director/score.cpp | 35 ++++++++++++++++++++++++++++------- engines/director/score.h | 2 +- 2 files changed, 29 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/director/score.cpp b/engines/director/score.cpp index e92a68dfd1..88927c1366 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -746,12 +746,33 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, CastInfo *ci = new CastInfo(); - if (castStrings.size() >= 5) { - ci->script = castStrings[0]; - ci->name = castStrings[1]; - ci->directory = castStrings[2]; - ci->fileName = castStrings[3]; + // We have here variable number of strings. Thus, instead of + // adding tons of ifs, we use this switch() + switch (castStrings.size()) { + default: + warning("Score::loadCastData(): extra %d strings", castStrings.size() - 5); + // fallthrough + case 5: ci->type = castStrings[4]; + // fallthrough + case 4: + ci->fileName = castStrings[3]; + // fallthrough + case 3: + ci->directory = castStrings[2]; + // fallthrough + case 2: + ci->name = castStrings[1]; + + if (!ci->name.empty()) { + _castsNames[ci->name] = id; + } + // fallthrough + case 1: + ci->script = castStrings[0]; + // fallthrough + case 0: + break; } // FIXME. Disabled by default, requires --debugflags=bytecode for now @@ -1231,12 +1252,12 @@ Common::Array Score::loadStrings(Common::SeekableSubReadStreamEn for (uint j = entries[i]; j < entries[i + 1]; j++) if (data[j] == '\r') entryString += '\n'; - else + else if (j > entries[i] || data[j] >= 0x20) // Skip first byte which is string length entryString += data[j]; strings.push_back(entryString); - debugC(6, kDebugLoading, "String %d:\n%s\n", i, entryString.c_str()); + debugC(6, kDebugLoading, "String %d:\n%s\n", i, Common::toPrintable(entryString).c_str()); } free(data); diff --git a/engines/director/score.h b/engines/director/score.h index ef7244bf97..d4d402bb3e 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -123,7 +123,7 @@ private: public: Common::Array _frames; Common::HashMap _castsInfo; - Common::HashMap _castsNames; + Common::HashMap _castsNames; Common::SortedArray