diff --git a/direct/src/interval/Interval.py b/direct/src/interval/Interval.py index cde4f773b1..580eb3ab2f 100644 --- a/direct/src/interval/Interval.py +++ b/direct/src/interval/Interval.py @@ -399,7 +399,6 @@ class Interval(DirectObject): return (space + self.name + ' dur: %.2f' % self.duration) open_ended = property(getOpenEnded) - loop = property(getLoop, setLoop) stopped = property(isStopped) t = property(getT, setT) play_rate = property(getPlayRate, setPlayRate) diff --git a/dtool/src/cppparser/cppArrayType.cxx b/dtool/src/cppparser/cppArrayType.cxx index fa23f26e0f..bda2f72d7d 100644 --- a/dtool/src/cppparser/cppArrayType.cxx +++ b/dtool/src/cppparser/cppArrayType.cxx @@ -87,6 +87,26 @@ is_trivial() const { return _element_type->is_trivial(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPArrayType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPArrayType:: +is_default_constructible() const { + return _element_type->is_default_constructible(); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPArrayType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPArrayType:: +is_copy_constructible() const { + return false; +} + //////////////////////////////////////////////////////////////////// // Function: CPPArrayType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppArrayType.h b/dtool/src/cppparser/cppArrayType.h index 82a369a90e..e8badc5b89 100644 --- a/dtool/src/cppparser/cppArrayType.h +++ b/dtool/src/cppparser/cppArrayType.h @@ -41,6 +41,8 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index cd2465951c..d20ad47a8c 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -799,16 +799,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 79 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 4680 +#define YYLAST 4690 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 142 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 95 /* YYNRULES -- Number of rules. */ -#define YYNRULES 591 +#define YYNRULES 593 /* YYNRULES -- Number of states. */ -#define YYNSTATES 1097 +#define YYNSTATES 1101 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -882,49 +882,49 @@ static const yytype_uint16 yyprhs[] = 461, 465, 470, 472, 474, 476, 478, 481, 485, 488, 491, 494, 497, 500, 504, 509, 513, 517, 518, 525, 527, 529, 531, 535, 538, 540, 544, 546, 549, 551, - 554, 556, 560, 566, 570, 575, 577, 579, 582, 584, - 588, 592, 598, 602, 607, 613, 616, 618, 620, 622, - 624, 627, 630, 633, 636, 639, 643, 648, 650, 652, - 654, 657, 660, 663, 666, 669, 673, 678, 686, 690, - 692, 695, 698, 701, 704, 707, 711, 716, 724, 726, - 728, 731, 733, 735, 737, 740, 745, 750, 752, 754, - 756, 759, 761, 763, 765, 768, 773, 776, 781, 783, - 785, 787, 790, 793, 796, 798, 800, 803, 807, 808, - 814, 815, 823, 825, 827, 830, 834, 837, 840, 843, - 847, 851, 855, 859, 863, 867, 872, 877, 880, 884, - 886, 888, 890, 892, 896, 902, 904, 907, 912, 914, - 916, 918, 920, 921, 928, 929, 937, 942, 948, 951, - 955, 957, 959, 961, 963, 965, 967, 969, 971, 973, - 975, 977, 979, 981, 983, 986, 989, 992, 995, 997, - 1000, 1002, 1006, 1009, 1011, 1012, 1015, 1017, 1020, 1022, - 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1038, 1040, 1042, - 1044, 1046, 1048, 1050, 1052, 1054, 1056, 1058, 1060, 1062, - 1064, 1066, 1068, 1070, 1072, 1074, 1076, 1078, 1080, 1082, - 1084, 1086, 1088, 1090, 1092, 1094, 1096, 1098, 1100, 1102, - 1104, 1106, 1108, 1110, 1112, 1114, 1116, 1118, 1120, 1122, - 1124, 1126, 1128, 1130, 1132, 1134, 1136, 1138, 1140, 1142, - 1144, 1146, 1148, 1150, 1152, 1154, 1156, 1158, 1160, 1162, - 1164, 1166, 1168, 1170, 1172, 1174, 1176, 1178, 1180, 1182, - 1184, 1186, 1188, 1190, 1192, 1194, 1196, 1198, 1200, 1202, - 1204, 1206, 1208, 1210, 1212, 1214, 1216, 1218, 1220, 1222, - 1224, 1226, 1228, 1230, 1232, 1234, 1236, 1238, 1240, 1242, - 1244, 1246, 1248, 1250, 1252, 1254, 1258, 1260, 1262, 1264, - 1266, 1268, 1272, 1274, 1279, 1287, 1295, 1300, 1305, 1308, - 1311, 1314, 1317, 1320, 1324, 1328, 1332, 1336, 1340, 1344, + 554, 556, 560, 566, 570, 574, 578, 583, 585, 587, + 590, 592, 596, 600, 606, 610, 615, 621, 624, 626, + 628, 630, 632, 635, 638, 641, 644, 647, 651, 656, + 658, 660, 662, 665, 668, 671, 674, 677, 681, 686, + 694, 698, 700, 703, 706, 709, 712, 715, 719, 724, + 732, 734, 736, 739, 741, 743, 745, 748, 753, 758, + 760, 762, 764, 767, 769, 771, 773, 776, 781, 784, + 789, 791, 793, 795, 798, 801, 804, 806, 808, 811, + 815, 816, 822, 823, 831, 833, 835, 838, 842, 845, + 848, 851, 855, 859, 863, 867, 871, 875, 880, 885, + 888, 892, 894, 896, 898, 900, 904, 910, 912, 915, + 920, 922, 924, 926, 928, 929, 936, 937, 945, 950, + 956, 959, 963, 965, 967, 969, 971, 973, 975, 977, + 979, 981, 983, 985, 987, 989, 991, 994, 997, 1000, + 1003, 1005, 1008, 1010, 1014, 1017, 1019, 1020, 1023, 1025, + 1028, 1030, 1032, 1034, 1036, 1038, 1040, 1042, 1044, 1046, + 1048, 1050, 1052, 1054, 1056, 1058, 1060, 1062, 1064, 1066, + 1068, 1070, 1072, 1074, 1076, 1078, 1080, 1082, 1084, 1086, + 1088, 1090, 1092, 1094, 1096, 1098, 1100, 1102, 1104, 1106, + 1108, 1110, 1112, 1114, 1116, 1118, 1120, 1122, 1124, 1126, + 1128, 1130, 1132, 1134, 1136, 1138, 1140, 1142, 1144, 1146, + 1148, 1150, 1152, 1154, 1156, 1158, 1160, 1162, 1164, 1166, + 1168, 1170, 1172, 1174, 1176, 1178, 1180, 1182, 1184, 1186, + 1188, 1190, 1192, 1194, 1196, 1198, 1200, 1202, 1204, 1206, + 1208, 1210, 1212, 1214, 1216, 1218, 1220, 1222, 1224, 1226, + 1228, 1230, 1232, 1234, 1236, 1238, 1240, 1242, 1244, 1246, + 1248, 1250, 1252, 1254, 1256, 1258, 1260, 1262, 1266, 1268, + 1270, 1272, 1274, 1276, 1280, 1282, 1287, 1295, 1303, 1308, + 1313, 1316, 1319, 1322, 1325, 1328, 1332, 1336, 1340, 1344, 1348, 1352, 1356, 1360, 1364, 1368, 1372, 1376, 1380, 1384, - 1390, 1395, 1400, 1404, 1408, 1412, 1416, 1418, 1423, 1431, - 1439, 1444, 1449, 1454, 1459, 1464, 1469, 1474, 1479, 1484, - 1489, 1494, 1499, 1504, 1509, 1514, 1517, 1523, 1526, 1529, - 1532, 1535, 1538, 1542, 1546, 1550, 1554, 1558, 1562, 1566, + 1388, 1392, 1398, 1403, 1408, 1412, 1416, 1420, 1424, 1426, + 1431, 1439, 1447, 1452, 1457, 1462, 1467, 1472, 1477, 1482, + 1487, 1492, 1497, 1502, 1507, 1512, 1517, 1522, 1525, 1531, + 1534, 1537, 1540, 1543, 1546, 1550, 1554, 1558, 1562, 1566, 1570, 1574, 1578, 1582, 1586, 1590, 1594, 1598, 1602, 1606, - 1610, 1616, 1621, 1626, 1630, 1634, 1638, 1642, 1644, 1646, - 1648, 1650, 1652, 1654, 1656, 1658, 1660, 1662, 1667, 1675, - 1683, 1688, 1693, 1696, 1702, 1705, 1708, 1711, 1714, 1718, + 1610, 1614, 1618, 1624, 1629, 1634, 1638, 1642, 1646, 1650, + 1652, 1654, 1656, 1658, 1660, 1662, 1664, 1666, 1668, 1670, + 1675, 1683, 1691, 1696, 1701, 1704, 1710, 1713, 1716, 1719, 1722, 1726, 1730, 1734, 1738, 1742, 1746, 1750, 1754, 1758, - 1762, 1766, 1770, 1774, 1778, 1782, 1786, 1792, 1797, 1802, - 1806, 1810, 1814, 1818, 1820, 1822, 1824, 1826, 1828, 1830, - 1832, 1834, 1836, 1838, 1841, 1844, 1846, 1848, 1850, 1852, - 1855, 1858 + 1762, 1766, 1770, 1774, 1778, 1782, 1786, 1790, 1794, 1800, + 1805, 1810, 1814, 1818, 1822, 1826, 1828, 1830, 1832, 1834, + 1836, 1838, 1840, 1842, 1844, 1846, 1849, 1852, 1854, 1856, + 1858, 1860, 1863, 1866 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -987,135 +987,136 @@ static const yytype_int16 yyrhs[] = 184, 119, 190, -1, 236, -1, 122, 228, -1, 236, -1, 122, 229, -1, 120, -1, 118, 221, 139, -1, 121, 145, 118, 221, 139, -1, 122, 229, 120, -1, - 122, 118, 188, 139, -1, 236, -1, 189, -1, 189, - 119, -1, 229, -1, 118, 188, 139, -1, 189, 119, - 229, -1, 189, 119, 118, 188, 139, -1, 194, 192, - 186, -1, 56, 194, 192, 186, -1, 56, 92, 194, - 192, 186, -1, 92, 190, -1, 231, -1, 236, -1, - 10, -1, 11, -1, 56, 191, -1, 112, 191, -1, - 131, 191, -1, 126, 191, -1, 16, 191, -1, 12, - 131, 191, -1, 191, 137, 225, 141, -1, 236, -1, - 10, -1, 11, -1, 56, 192, -1, 112, 192, -1, - 131, 192, -1, 126, 192, -1, 16, 192, -1, 12, - 131, 192, -1, 192, 137, 225, 141, -1, 136, 192, - 138, 136, 183, 138, 172, -1, 136, 192, 138, -1, - 236, -1, 56, 193, -1, 112, 193, -1, 131, 193, - -1, 126, 193, -1, 16, 193, -1, 12, 131, 193, - -1, 193, 137, 225, 141, -1, 136, 193, 138, 136, - 183, 138, 172, -1, 217, -1, 11, -1, 106, 234, - -1, 199, -1, 201, -1, 206, -1, 212, 234, -1, - 211, 234, 121, 208, -1, 58, 136, 229, 138, -1, - 47, -1, 217, -1, 11, -1, 106, 234, -1, 199, + 122, 59, 120, -1, 122, 60, 120, -1, 122, 118, + 188, 139, -1, 236, -1, 189, -1, 189, 119, -1, + 229, -1, 118, 188, 139, -1, 189, 119, 229, -1, + 189, 119, 118, 188, 139, -1, 194, 192, 186, -1, + 56, 194, 192, 186, -1, 56, 92, 194, 192, 186, + -1, 92, 190, -1, 231, -1, 236, -1, 10, -1, + 11, -1, 56, 191, -1, 112, 191, -1, 131, 191, + -1, 126, 191, -1, 16, 191, -1, 12, 131, 191, + -1, 191, 137, 225, 141, -1, 236, -1, 10, -1, + 11, -1, 56, 192, -1, 112, 192, -1, 131, 192, + -1, 126, 192, -1, 16, 192, -1, 12, 131, 192, + -1, 192, 137, 225, 141, -1, 136, 192, 138, 136, + 183, 138, 172, -1, 136, 192, 138, -1, 236, -1, + 56, 193, -1, 112, 193, -1, 131, 193, -1, 126, + 193, -1, 16, 193, -1, 12, 131, 193, -1, 193, + 137, 225, 141, -1, 136, 193, 138, 136, 183, 138, + 172, -1, 217, -1, 11, -1, 106, 234, -1, 199, -1, 201, -1, 206, -1, 212, 234, -1, 211, 234, - 121, 208, -1, 211, 234, -1, 58, 136, 229, 138, - -1, 47, -1, 217, -1, 11, -1, 106, 234, -1, - 212, 234, -1, 211, 234, -1, 195, -1, 10, -1, - 194, 193, -1, 56, 194, 193, -1, -1, 212, 118, - 200, 144, 139, -1, -1, 212, 234, 202, 203, 118, - 144, 139, -1, 236, -1, 204, -1, 121, 205, -1, - 204, 119, 205, -1, 91, 233, -1, 90, 233, -1, - 89, 233, -1, 110, 91, 233, -1, 110, 90, 233, - -1, 110, 89, 233, -1, 91, 110, 233, -1, 90, - 110, 233, -1, 89, 110, 233, -1, 207, 118, 210, - 139, -1, 211, 234, 121, 208, -1, 211, 234, -1, - 211, 121, 208, -1, 211, -1, 218, -1, 11, -1, - 236, -1, 209, 234, 119, -1, 209, 234, 122, 229, - 119, -1, 209, -1, 209, 234, -1, 209, 234, 122, - 229, -1, 65, -1, 55, -1, 100, -1, 107, -1, - -1, 84, 234, 118, 214, 144, 139, -1, -1, 76, - 84, 234, 118, 215, 144, 139, -1, 84, 118, 144, - 139, -1, 76, 84, 118, 144, 139, -1, 109, 234, - -1, 109, 84, 234, -1, 218, -1, 219, -1, 220, - -1, 50, -1, 52, -1, 113, -1, 53, -1, 54, - -1, 94, -1, 78, -1, 79, -1, 108, -1, 95, - -1, 77, -1, 94, 218, -1, 78, 218, -1, 108, - 218, -1, 95, 218, -1, 71, -1, 78, 71, -1, - 61, -1, 78, 78, 71, -1, 78, 61, -1, 111, - -1, -1, 222, 223, -1, 236, -1, 223, 224, -1, - 3, -1, 4, -1, 6, -1, 8, -1, 9, -1, - 5, -1, 10, -1, 11, -1, 12, -1, 7, -1, - 14, -1, 15, -1, 16, -1, 17, -1, 18, -1, - 19, -1, 20, -1, 21, -1, 22, -1, 23, -1, - 24, -1, 31, -1, 32, -1, 33, -1, 34, -1, - 35, -1, 36, -1, 37, -1, 38, -1, 39, -1, - 40, -1, 41, -1, 42, -1, 43, -1, 44, -1, - 45, -1, 46, -1, 47, -1, 50, -1, 51, -1, - 52, -1, 53, -1, 54, -1, 55, -1, 56, -1, - 57, -1, 58, -1, 59, -1, 60, -1, 61, -1, - 62, -1, 63, -1, 65, -1, 67, -1, 68, -1, - 70, -1, 71, -1, 72, -1, 73, -1, 74, -1, - 75, -1, 76, -1, 77, -1, 78, -1, 83, -1, - 84, -1, 85, -1, 87, -1, 88, -1, 89, -1, - 90, -1, 91, -1, 69, -1, 92, -1, 93, -1, - 94, -1, 95, -1, 96, -1, 97, -1, 98, -1, - 99, -1, 100, -1, 102, -1, 103, -1, 104, -1, - 105, -1, 106, -1, 107, -1, 108, -1, 109, -1, - 110, -1, 111, -1, 112, -1, 113, -1, 114, -1, - 129, -1, 130, -1, 131, -1, 132, -1, 126, -1, - 124, -1, 125, -1, 140, -1, 134, -1, 122, -1, - 133, -1, 127, -1, 128, -1, 136, -1, 138, -1, - 135, -1, 119, -1, 120, -1, 121, -1, 137, -1, - 141, -1, 123, -1, 118, 223, 139, -1, 236, -1, - 229, -1, 236, -1, 227, -1, 229, -1, 227, 119, - 229, -1, 230, -1, 136, 198, 138, 228, -1, 99, - 127, 198, 128, 136, 227, 138, -1, 62, 127, 198, - 128, 136, 227, 138, -1, 96, 136, 198, 138, -1, - 46, 136, 198, 138, -1, 140, 228, -1, 134, 228, - -1, 130, 228, -1, 131, 228, -1, 126, 228, -1, - 228, 131, 228, -1, 228, 132, 228, -1, 228, 133, - 228, -1, 228, 129, 228, -1, 228, 130, 228, -1, - 228, 124, 228, -1, 228, 125, 228, -1, 228, 126, - 228, -1, 228, 15, 228, -1, 228, 16, 228, -1, - 228, 17, 228, -1, 228, 18, 228, -1, 228, 19, - 228, -1, 228, 20, 228, -1, 228, 21, 228, -1, - 228, 22, 228, -1, 228, 123, 228, 121, 228, -1, - 228, 137, 229, 141, -1, 228, 136, 227, 138, -1, - 228, 136, 138, -1, 228, 135, 228, -1, 228, 31, - 228, -1, 136, 227, 138, -1, 230, -1, 136, 198, - 138, 229, -1, 99, 127, 198, 128, 136, 227, 138, - -1, 62, 127, 198, 128, 136, 227, 138, -1, 11, - 136, 226, 138, -1, 77, 136, 226, 138, -1, 52, - 136, 226, 138, -1, 113, 136, 226, 138, -1, 53, - 136, 226, 138, -1, 54, 136, 226, 138, -1, 50, - 136, 226, 138, -1, 94, 136, 226, 138, -1, 78, - 136, 226, 138, -1, 108, 136, 226, 138, -1, 95, - 136, 226, 138, -1, 71, 136, 226, 138, -1, 61, - 136, 226, 138, -1, 96, 136, 198, 138, -1, 46, - 136, 198, 138, -1, 85, 196, -1, 85, 196, 136, - 226, 138, -1, 140, 229, -1, 134, 229, -1, 130, - 229, -1, 131, 229, -1, 126, 229, -1, 229, 131, - 229, -1, 229, 132, 229, -1, 229, 133, 229, -1, - 229, 129, 229, -1, 229, 130, 229, -1, 229, 124, - 229, -1, 229, 125, 229, -1, 229, 126, 229, -1, - 229, 15, 229, -1, 229, 16, 229, -1, 229, 17, - 229, -1, 229, 18, 229, -1, 229, 19, 229, -1, - 229, 20, 229, -1, 229, 127, 229, -1, 229, 128, - 229, -1, 229, 21, 229, -1, 229, 22, 229, -1, - 229, 123, 229, 121, 229, -1, 229, 137, 229, 141, - -1, 229, 136, 227, 138, -1, 229, 136, 138, -1, - 229, 135, 229, -1, 229, 31, 229, -1, 136, 227, - 138, -1, 4, -1, 103, -1, 70, -1, 5, -1, - 3, -1, 235, -1, 9, -1, 10, -1, 87, -1, - 232, -1, 136, 198, 138, 229, -1, 99, 127, 198, + 121, 208, -1, 58, 136, 229, 138, -1, 47, -1, + 217, -1, 11, -1, 106, 234, -1, 199, -1, 201, + -1, 206, -1, 212, 234, -1, 211, 234, 121, 208, + -1, 211, 234, -1, 58, 136, 229, 138, -1, 47, + -1, 217, -1, 11, -1, 106, 234, -1, 212, 234, + -1, 211, 234, -1, 195, -1, 10, -1, 194, 193, + -1, 56, 194, 193, -1, -1, 212, 118, 200, 144, + 139, -1, -1, 212, 234, 202, 203, 118, 144, 139, + -1, 236, -1, 204, -1, 121, 205, -1, 204, 119, + 205, -1, 91, 233, -1, 90, 233, -1, 89, 233, + -1, 110, 91, 233, -1, 110, 90, 233, -1, 110, + 89, 233, -1, 91, 110, 233, -1, 90, 110, 233, + -1, 89, 110, 233, -1, 207, 118, 210, 139, -1, + 211, 234, 121, 208, -1, 211, 234, -1, 211, 121, + 208, -1, 211, -1, 218, -1, 11, -1, 236, -1, + 209, 234, 119, -1, 209, 234, 122, 229, 119, -1, + 209, -1, 209, 234, -1, 209, 234, 122, 229, -1, + 65, -1, 55, -1, 100, -1, 107, -1, -1, 84, + 234, 118, 214, 144, 139, -1, -1, 76, 84, 234, + 118, 215, 144, 139, -1, 84, 118, 144, 139, -1, + 76, 84, 118, 144, 139, -1, 109, 234, -1, 109, + 84, 234, -1, 218, -1, 219, -1, 220, -1, 50, + -1, 52, -1, 113, -1, 53, -1, 54, -1, 94, + -1, 78, -1, 79, -1, 108, -1, 95, -1, 77, + -1, 94, 218, -1, 78, 218, -1, 108, 218, -1, + 95, 218, -1, 71, -1, 78, 71, -1, 61, -1, + 78, 78, 71, -1, 78, 61, -1, 111, -1, -1, + 222, 223, -1, 236, -1, 223, 224, -1, 3, -1, + 4, -1, 6, -1, 8, -1, 9, -1, 5, -1, + 10, -1, 11, -1, 12, -1, 7, -1, 14, -1, + 15, -1, 16, -1, 17, -1, 18, -1, 19, -1, + 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, + 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, + 36, -1, 37, -1, 38, -1, 39, -1, 40, -1, + 41, -1, 42, -1, 43, -1, 44, -1, 45, -1, + 46, -1, 47, -1, 50, -1, 51, -1, 52, -1, + 53, -1, 54, -1, 55, -1, 56, -1, 57, -1, + 58, -1, 59, -1, 60, -1, 61, -1, 62, -1, + 63, -1, 65, -1, 67, -1, 68, -1, 70, -1, + 71, -1, 72, -1, 73, -1, 74, -1, 75, -1, + 76, -1, 77, -1, 78, -1, 83, -1, 84, -1, + 85, -1, 87, -1, 88, -1, 89, -1, 90, -1, + 91, -1, 69, -1, 92, -1, 93, -1, 94, -1, + 95, -1, 96, -1, 97, -1, 98, -1, 99, -1, + 100, -1, 102, -1, 103, -1, 104, -1, 105, -1, + 106, -1, 107, -1, 108, -1, 109, -1, 110, -1, + 111, -1, 112, -1, 113, -1, 114, -1, 129, -1, + 130, -1, 131, -1, 132, -1, 126, -1, 124, -1, + 125, -1, 140, -1, 134, -1, 122, -1, 133, -1, + 127, -1, 128, -1, 136, -1, 138, -1, 135, -1, + 119, -1, 120, -1, 121, -1, 137, -1, 141, -1, + 123, -1, 118, 223, 139, -1, 236, -1, 229, -1, + 236, -1, 227, -1, 229, -1, 227, 119, 229, -1, + 230, -1, 136, 198, 138, 228, -1, 99, 127, 198, 128, 136, 227, 138, -1, 62, 127, 198, 128, 136, 227, 138, -1, 96, 136, 198, 138, -1, 46, 136, - 198, 138, -1, 85, 196, -1, 85, 196, 136, 226, - 138, -1, 140, 229, -1, 134, 229, -1, 130, 229, - -1, 126, 229, -1, 231, 131, 229, -1, 231, 132, - 229, -1, 231, 133, 229, -1, 231, 129, 229, -1, - 231, 130, 229, -1, 231, 124, 229, -1, 231, 125, - 229, -1, 231, 126, 229, -1, 231, 15, 229, -1, - 231, 16, 229, -1, 231, 17, 229, -1, 231, 18, - 229, -1, 231, 19, 229, -1, 231, 20, 229, -1, - 231, 127, 229, -1, 231, 128, 229, -1, 231, 21, - 229, -1, 231, 22, 229, -1, 231, 123, 229, 121, - 229, -1, 231, 137, 229, 141, -1, 231, 136, 227, - 138, -1, 231, 136, 138, -1, 231, 135, 229, -1, - 231, 31, 229, -1, 136, 227, 138, -1, 4, -1, - 103, -1, 70, -1, 5, -1, 3, -1, 235, -1, - 9, -1, 10, -1, 87, -1, 234, -1, 212, 234, - -1, 106, 234, -1, 10, -1, 11, -1, 6, -1, - 8, -1, 235, 6, -1, 235, 8, -1, -1 + 198, 138, -1, 140, 228, -1, 134, 228, -1, 130, + 228, -1, 131, 228, -1, 126, 228, -1, 228, 131, + 228, -1, 228, 132, 228, -1, 228, 133, 228, -1, + 228, 129, 228, -1, 228, 130, 228, -1, 228, 124, + 228, -1, 228, 125, 228, -1, 228, 126, 228, -1, + 228, 15, 228, -1, 228, 16, 228, -1, 228, 17, + 228, -1, 228, 18, 228, -1, 228, 19, 228, -1, + 228, 20, 228, -1, 228, 21, 228, -1, 228, 22, + 228, -1, 228, 123, 228, 121, 228, -1, 228, 137, + 229, 141, -1, 228, 136, 227, 138, -1, 228, 136, + 138, -1, 228, 135, 228, -1, 228, 31, 228, -1, + 136, 227, 138, -1, 230, -1, 136, 198, 138, 229, + -1, 99, 127, 198, 128, 136, 227, 138, -1, 62, + 127, 198, 128, 136, 227, 138, -1, 11, 136, 226, + 138, -1, 77, 136, 226, 138, -1, 52, 136, 226, + 138, -1, 113, 136, 226, 138, -1, 53, 136, 226, + 138, -1, 54, 136, 226, 138, -1, 50, 136, 226, + 138, -1, 94, 136, 226, 138, -1, 78, 136, 226, + 138, -1, 108, 136, 226, 138, -1, 95, 136, 226, + 138, -1, 71, 136, 226, 138, -1, 61, 136, 226, + 138, -1, 96, 136, 198, 138, -1, 46, 136, 198, + 138, -1, 85, 196, -1, 85, 196, 136, 226, 138, + -1, 140, 229, -1, 134, 229, -1, 130, 229, -1, + 131, 229, -1, 126, 229, -1, 229, 131, 229, -1, + 229, 132, 229, -1, 229, 133, 229, -1, 229, 129, + 229, -1, 229, 130, 229, -1, 229, 124, 229, -1, + 229, 125, 229, -1, 229, 126, 229, -1, 229, 15, + 229, -1, 229, 16, 229, -1, 229, 17, 229, -1, + 229, 18, 229, -1, 229, 19, 229, -1, 229, 20, + 229, -1, 229, 127, 229, -1, 229, 128, 229, -1, + 229, 21, 229, -1, 229, 22, 229, -1, 229, 123, + 229, 121, 229, -1, 229, 137, 229, 141, -1, 229, + 136, 227, 138, -1, 229, 136, 138, -1, 229, 135, + 229, -1, 229, 31, 229, -1, 136, 227, 138, -1, + 4, -1, 103, -1, 70, -1, 5, -1, 3, -1, + 235, -1, 9, -1, 10, -1, 87, -1, 232, -1, + 136, 198, 138, 229, -1, 99, 127, 198, 128, 136, + 227, 138, -1, 62, 127, 198, 128, 136, 227, 138, + -1, 96, 136, 198, 138, -1, 46, 136, 198, 138, + -1, 85, 196, -1, 85, 196, 136, 226, 138, -1, + 140, 229, -1, 134, 229, -1, 130, 229, -1, 126, + 229, -1, 231, 131, 229, -1, 231, 132, 229, -1, + 231, 133, 229, -1, 231, 129, 229, -1, 231, 130, + 229, -1, 231, 124, 229, -1, 231, 125, 229, -1, + 231, 126, 229, -1, 231, 15, 229, -1, 231, 16, + 229, -1, 231, 17, 229, -1, 231, 18, 229, -1, + 231, 19, 229, -1, 231, 20, 229, -1, 231, 127, + 229, -1, 231, 128, 229, -1, 231, 21, 229, -1, + 231, 22, 229, -1, 231, 123, 229, 121, 229, -1, + 231, 137, 229, 141, -1, 231, 136, 227, 138, -1, + 231, 136, 138, -1, 231, 135, 229, -1, 231, 31, + 229, -1, 136, 227, 138, -1, 4, -1, 103, -1, + 70, -1, 5, -1, 3, -1, 235, -1, 9, -1, + 10, -1, 87, -1, 234, -1, 212, 234, -1, 106, + 234, -1, 10, -1, 11, -1, 6, -1, 8, -1, + 235, 6, -1, 235, 8, -1, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -1138,49 +1139,49 @@ static const yytype_uint16 yyrline[] = 1314, 1320, 1330, 1334, 1339, 1351, 1355, 1369, 1384, 1389, 1394, 1399, 1404, 1409, 1414, 1419, 1424, 1430, 1429, 1451, 1455, 1460, 1464, 1469, 1477, 1482, 1490, 1494, 1501, 1505, - 1512, 1516, 1520, 1524, 1528, 1535, 1536, 1537, 1541, 1544, - 1545, 1546, 1550, 1555, 1561, 1567, 1571, 1581, 1585, 1589, - 1593, 1598, 1603, 1608, 1613, 1618, 1623, 1631, 1635, 1639, - 1643, 1648, 1653, 1658, 1663, 1668, 1673, 1678, 1684, 1692, - 1696, 1701, 1706, 1711, 1716, 1721, 1726, 1731, 1740, 1744, - 1752, 1756, 1760, 1764, 1768, 1784, 1800, 1809, 1816, 1820, - 1828, 1832, 1836, 1840, 1844, 1860, 1876, 1894, 1903, 1910, - 1914, 1922, 1926, 1942, 1961, 1965, 1973, 1979, 1990, 1989, - 2014, 2013, 2043, 2044, 2048, 2049, 2053, 2057, 2061, 2065, - 2069, 2073, 2077, 2081, 2085, 2092, 2100, 2104, 2108, 2112, - 2119, 2123, 2130, 2131, 2137, 2145, 2146, 2152, 2161, 2168, - 2172, 2176, 2184, 2183, 2206, 2205, 2228, 2229, 2233, 2239, - 2248, 2249, 2250, 2254, 2258, 2262, 2266, 2270, 2274, 2279, - 2284, 2289, 2294, 2299, 2303, 2308, 2317, 2322, 2330, 2334, - 2339, 2343, 2348, 2356, 2366, 2366, 2376, 2377, 2381, 2382, - 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2391, - 2391, 2392, 2392, 2392, 2392, 2393, 2393, 2393, 2393, 2393, - 2394, 2394, 2394, 2395, 2395, 2395, 2395, 2395, 2396, 2396, - 2396, 2396, 2396, 2397, 2397, 2397, 2397, 2397, 2398, 2398, - 2398, 2399, 2399, 2399, 2399, 2399, 2400, 2400, 2400, 2400, - 2400, 2401, 2401, 2401, 2402, 2402, 2402, 2402, 2402, 2402, - 2403, 2403, 2403, 2403, 2404, 2404, 2404, 2404, 2404, 2405, - 2405, 2405, 2405, 2406, 2406, 2406, 2406, 2406, 2407, 2407, - 2407, 2407, 2407, 2408, 2408, 2408, 2408, 2408, 2409, 2409, - 2409, 2409, 2409, 2412, 2412, 2412, 2412, 2412, 2412, 2412, - 2412, 2412, 2412, 2412, 2413, 2413, 2413, 2413, 2413, 2413, - 2413, 2413, 2413, 2413, 2414, 2414, 2418, 2422, 2429, 2433, - 2440, 2444, 2451, 2455, 2459, 2463, 2467, 2471, 2475, 2479, + 1512, 1516, 1520, 1524, 1528, 1532, 1536, 1543, 1544, 1545, + 1549, 1552, 1553, 1554, 1558, 1563, 1569, 1575, 1579, 1589, + 1593, 1597, 1601, 1606, 1611, 1616, 1621, 1626, 1631, 1639, + 1643, 1647, 1651, 1656, 1661, 1666, 1671, 1676, 1681, 1686, + 1692, 1700, 1704, 1709, 1714, 1719, 1724, 1729, 1734, 1739, + 1748, 1752, 1760, 1764, 1768, 1772, 1776, 1792, 1808, 1817, + 1824, 1828, 1836, 1840, 1844, 1848, 1852, 1868, 1884, 1902, + 1911, 1918, 1922, 1930, 1934, 1950, 1969, 1973, 1981, 1987, + 1998, 1997, 2022, 2021, 2051, 2052, 2056, 2057, 2061, 2065, + 2069, 2073, 2077, 2081, 2085, 2089, 2093, 2100, 2108, 2112, + 2116, 2120, 2127, 2131, 2138, 2139, 2145, 2153, 2154, 2160, + 2169, 2176, 2180, 2184, 2192, 2191, 2214, 2213, 2236, 2237, + 2241, 2247, 2256, 2257, 2258, 2262, 2266, 2270, 2274, 2278, + 2282, 2287, 2292, 2297, 2302, 2307, 2311, 2316, 2325, 2330, + 2338, 2342, 2347, 2351, 2356, 2364, 2374, 2374, 2384, 2385, + 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, + 2399, 2399, 2399, 2400, 2400, 2400, 2400, 2401, 2401, 2401, + 2401, 2401, 2402, 2402, 2402, 2403, 2403, 2403, 2403, 2403, + 2404, 2404, 2404, 2404, 2404, 2405, 2405, 2405, 2405, 2405, + 2406, 2406, 2406, 2407, 2407, 2407, 2407, 2407, 2408, 2408, + 2408, 2408, 2408, 2409, 2409, 2409, 2410, 2410, 2410, 2410, + 2410, 2410, 2411, 2411, 2411, 2411, 2412, 2412, 2412, 2412, + 2412, 2413, 2413, 2413, 2413, 2414, 2414, 2414, 2414, 2414, + 2415, 2415, 2415, 2415, 2415, 2416, 2416, 2416, 2416, 2416, + 2417, 2417, 2417, 2417, 2417, 2420, 2420, 2420, 2420, 2420, + 2420, 2420, 2420, 2420, 2420, 2420, 2421, 2421, 2421, 2421, + 2421, 2421, 2421, 2421, 2421, 2421, 2422, 2422, 2426, 2430, + 2437, 2441, 2448, 2452, 2459, 2463, 2467, 2471, 2475, 2479, 2483, 2487, 2491, 2495, 2499, 2503, 2507, 2511, 2515, 2519, 2523, 2527, 2531, 2535, 2539, 2543, 2547, 2551, 2555, 2559, - 2563, 2567, 2571, 2575, 2579, 2583, 2591, 2595, 2599, 2603, - 2607, 2617, 2623, 2629, 2635, 2641, 2647, 2653, 2660, 2667, - 2674, 2681, 2687, 2693, 2697, 2701, 2705, 2709, 2713, 2717, + 2563, 2567, 2571, 2575, 2579, 2583, 2587, 2591, 2599, 2603, + 2607, 2611, 2615, 2625, 2631, 2637, 2643, 2649, 2655, 2661, + 2668, 2675, 2682, 2689, 2695, 2701, 2705, 2709, 2713, 2717, 2721, 2725, 2729, 2733, 2737, 2741, 2745, 2749, 2753, 2757, 2761, 2765, 2769, 2773, 2777, 2781, 2785, 2789, 2793, 2797, - 2801, 2805, 2809, 2813, 2817, 2821, 2825, 2832, 2836, 2840, - 2844, 2848, 2852, 2856, 2860, 2864, 2878, 2882, 2886, 2890, + 2801, 2805, 2809, 2813, 2817, 2821, 2825, 2829, 2833, 2840, + 2844, 2848, 2852, 2856, 2860, 2864, 2868, 2872, 2886, 2890, 2894, 2898, 2902, 2906, 2910, 2914, 2918, 2922, 2926, 2930, 2934, 2938, 2942, 2946, 2950, 2954, 2958, 2962, 2966, 2970, 2974, 2978, 2982, 2986, 2990, 2994, 2998, 3002, 3006, 3010, - 3014, 3018, 3022, 3029, 3033, 3037, 3041, 3045, 3049, 3053, - 3057, 3061, 3068, 3076, 3084, 3110, 3114, 3121, 3125, 3129, - 3135, 3146 + 3014, 3018, 3022, 3026, 3030, 3037, 3041, 3045, 3049, 3053, + 3057, 3061, 3065, 3069, 3076, 3084, 3092, 3118, 3122, 3129, + 3133, 3137, 3143, 3154 }; #endif @@ -1290,21 +1291,21 @@ static const yytype_uint8 yyr1[] = 179, 179, 180, 180, 180, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, 181, 183, 183, 183, 183, 183, 184, 184, 185, 185, 186, 186, - 187, 187, 187, 187, 187, 188, 188, 188, 189, 189, - 189, 189, 190, 190, 190, 190, 190, 191, 191, 191, - 191, 191, 191, 191, 191, 191, 191, 192, 192, 192, - 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, 195, 195, - 195, 195, 195, 195, 195, 195, 195, 195, 195, 196, - 196, 196, 196, 196, 197, 197, 198, 198, 200, 199, - 202, 201, 203, 203, 204, 204, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 206, 207, 207, 207, 207, - 208, 208, 209, 209, 209, 210, 210, 210, 211, 212, - 212, 212, 214, 213, 215, 213, 213, 213, 216, 216, - 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 219, 219, - 219, 219, 219, 220, 222, 221, 223, 223, 224, 224, + 187, 187, 187, 187, 187, 187, 187, 188, 188, 188, + 189, 189, 189, 189, 190, 190, 190, 190, 190, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 196, 196, 196, 196, 196, 197, 197, 198, 198, + 200, 199, 202, 201, 203, 203, 204, 204, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 206, 207, 207, + 207, 207, 208, 208, 209, 209, 209, 210, 210, 210, + 211, 212, 212, 212, 214, 213, 215, 213, 213, 213, + 216, 216, 217, 217, 217, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 219, 219, 219, 219, 219, 220, 222, 221, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, @@ -1316,23 +1317,23 @@ static const yytype_uint8 yyr1[] = 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 225, 225, 226, 226, - 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, + 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, + 226, 226, 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, - 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, + 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, - 229, 229, 229, 229, 229, 229, 229, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, + 229, 229, 229, 229, 229, 229, 229, 229, 229, 230, + 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 233, 233, 233, 234, 234, 235, 235, 235, - 235, 236 + 231, 231, 231, 231, 231, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 233, 233, 233, 234, 234, 235, + 235, 235, 235, 236 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1355,21 +1356,21 @@ static const yytype_uint8 yyr2[] = 3, 4, 1, 1, 1, 1, 2, 3, 2, 2, 2, 2, 2, 3, 4, 3, 3, 0, 6, 1, 1, 1, 3, 2, 1, 3, 1, 2, 1, 2, - 1, 3, 5, 3, 4, 1, 1, 2, 1, 3, - 3, 5, 3, 4, 5, 2, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 3, 4, 1, 1, 1, - 2, 2, 2, 2, 2, 3, 4, 7, 3, 1, - 2, 2, 2, 2, 2, 3, 4, 7, 1, 1, - 2, 1, 1, 1, 2, 4, 4, 1, 1, 1, - 2, 1, 1, 1, 2, 4, 2, 4, 1, 1, - 1, 2, 2, 2, 1, 1, 2, 3, 0, 5, - 0, 7, 1, 1, 2, 3, 2, 2, 2, 3, - 3, 3, 3, 3, 3, 4, 4, 2, 3, 1, - 1, 1, 1, 3, 5, 1, 2, 4, 1, 1, - 1, 1, 0, 6, 0, 7, 4, 5, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, - 1, 3, 2, 1, 0, 2, 1, 2, 1, 1, + 1, 3, 5, 3, 3, 3, 4, 1, 1, 2, + 1, 3, 3, 5, 3, 4, 5, 2, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 3, 4, 1, + 1, 1, 2, 2, 2, 2, 2, 3, 4, 7, + 3, 1, 2, 2, 2, 2, 2, 3, 4, 7, + 1, 1, 2, 1, 1, 1, 2, 4, 4, 1, + 1, 1, 2, 1, 1, 1, 2, 4, 2, 4, + 1, 1, 1, 2, 2, 2, 1, 1, 2, 3, + 0, 5, 0, 7, 1, 1, 2, 3, 2, 2, + 2, 3, 3, 3, 3, 3, 3, 4, 4, 2, + 3, 1, 1, 1, 1, 3, 5, 1, 2, 4, + 1, 1, 1, 1, 0, 6, 0, 7, 4, 5, + 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 1, 2, 1, 3, 2, 1, 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1381,23 +1382,23 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, - 1, 3, 1, 4, 7, 7, 4, 4, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, - 4, 4, 3, 3, 3, 3, 1, 4, 7, 7, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 2, 5, 2, 2, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 1, 1, 3, 1, 4, 7, 7, 4, 4, + 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 4, 4, 3, 3, 3, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 7, 7, - 4, 4, 2, 5, 2, 2, 2, 2, 3, 3, + 3, 5, 4, 4, 3, 3, 3, 3, 1, 4, + 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 2, 5, 2, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, - 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, - 2, 0 + 3, 3, 5, 4, 4, 3, 3, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 7, 7, 4, 4, 2, 5, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, + 4, 3, 3, 3, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, + 1, 2, 2, 0 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -1405,446 +1406,444 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 591, 0, 0, 0, 591, 5, 531, 527, 530, - 587, 588, 533, 534, 0, 0, 0, 0, 0, 0, - 0, 0, 529, 0, 0, 0, 0, 535, 0, 0, - 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 476, 532, 219, 227, 293, 294, 296, 297, - 279, 0, 0, 310, 278, 308, 303, 299, 300, 298, - 302, 280, 0, 281, 301, 313, 295, 591, 4, 221, - 222, 223, 0, 269, 0, 218, 290, 291, 292, 1, - 20, 591, 591, 21, 591, 591, 591, 0, 33, 591, - 0, 0, 0, 591, 0, 0, 0, 0, 591, 591, - 0, 591, 591, 0, 591, 591, 6, 15, 7, 18, - 0, 13, 48, 14, 16, 17, 35, 591, 0, 591, - 591, 591, 591, 591, 0, 591, 591, 591, 240, 0, - 495, 0, 0, 239, 591, 591, 0, 0, 591, 591, - 501, 499, 500, 498, 219, 293, 294, 296, 297, 310, - 308, 303, 299, 298, 302, 301, 295, 0, 0, 440, - 497, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 593, 0, 0, 0, 593, 5, 533, 529, 532, + 589, 590, 535, 536, 0, 0, 0, 0, 0, 0, + 0, 0, 531, 0, 0, 0, 0, 537, 0, 0, + 0, 0, 530, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 478, 534, 221, 229, 295, 296, 298, 299, + 281, 0, 0, 312, 280, 310, 305, 301, 302, 300, + 304, 282, 0, 283, 303, 315, 297, 593, 4, 223, + 224, 225, 0, 271, 0, 220, 292, 293, 294, 1, + 20, 593, 593, 21, 593, 593, 593, 0, 33, 593, + 0, 0, 0, 593, 0, 0, 0, 0, 593, 593, + 0, 593, 593, 0, 593, 593, 6, 15, 7, 18, + 0, 13, 48, 14, 16, 17, 35, 593, 0, 593, + 593, 593, 593, 593, 0, 593, 593, 593, 242, 0, + 497, 0, 0, 241, 593, 593, 0, 0, 593, 593, + 503, 501, 502, 500, 221, 295, 296, 298, 299, 312, + 310, 305, 301, 300, 304, 303, 297, 0, 0, 442, + 499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 589, 590, 591, 0, 312, 309, - 299, 305, 299, 304, 307, 585, 586, 220, 306, 0, - 591, 591, 591, 591, 591, 591, 246, 209, 591, 0, - 267, 248, 224, 591, 46, 45, 47, 591, 36, 41, - 22, 591, 0, 39, 0, 0, 0, 44, 591, 0, + 0, 0, 0, 0, 591, 592, 593, 0, 314, 311, + 301, 307, 301, 306, 309, 587, 588, 222, 308, 0, + 593, 593, 593, 593, 593, 593, 248, 211, 593, 0, + 269, 250, 226, 593, 46, 45, 47, 593, 36, 41, + 22, 593, 0, 39, 0, 0, 0, 44, 593, 0, 25, 24, 23, 42, 38, 0, 0, 131, 0, 0, - 19, 0, 288, 40, 43, 245, 229, 238, 0, 0, - 0, 0, 11, 0, 0, 244, 51, 231, 232, 233, - 269, 0, 228, 0, 439, 438, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 241, 591, 243, 242, - 0, 0, 0, 0, 0, 0, 0, 0, 526, 510, - 511, 512, 513, 514, 515, 518, 519, 525, 0, 507, - 508, 509, 516, 517, 505, 506, 502, 503, 504, 524, - 523, 0, 0, 247, 0, 311, 591, 214, 210, 211, - 213, 212, 0, 591, 275, 0, 272, 271, 268, 270, - 0, 591, 591, 37, 34, 591, 0, 0, 0, 0, - 591, 282, 0, 591, 0, 0, 244, 59, 289, 68, - 70, 245, 229, 53, 0, 0, 591, 230, 591, 0, - 314, 170, 0, 0, 50, 49, 0, 236, 234, 480, - 494, 486, 482, 484, 485, 492, 0, 491, 481, 488, - 0, 487, 490, 493, 0, 489, 483, 477, 441, 0, - 522, 521, 226, 215, 0, 0, 437, 436, 276, 265, - 225, 591, 0, 0, 253, 252, 591, 284, 0, 0, - 0, 286, 591, 0, 32, 143, 144, 0, 0, 0, - 0, 133, 134, 591, 142, 132, 61, 63, 0, 591, - 0, 0, 591, 0, 0, 591, 188, 189, 0, 591, - 591, 591, 591, 591, 0, 187, 591, 72, 0, 591, - 0, 8, 0, 591, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 52, 591, 145, 0, 0, 496, 0, - 520, 591, 216, 273, 0, 249, 0, 0, 0, 0, - 254, 591, 0, 287, 591, 0, 0, 0, 591, 0, - 136, 591, 138, 591, 0, 198, 199, 0, 591, 591, - 591, 591, 591, 591, 591, 197, 0, 60, 591, 577, - 573, 576, 579, 580, 160, 0, 0, 0, 575, 0, - 581, 0, 0, 0, 574, 0, 0, 0, 0, 0, - 0, 161, 164, 591, 186, 536, 578, 159, 0, 0, - 0, 54, 591, 237, 0, 591, 194, 190, 191, 193, - 192, 78, 591, 12, 591, 171, 315, 316, 314, 0, - 591, 591, 0, 176, 178, 175, 173, 0, 152, 148, - 0, 98, 99, 100, 101, 102, 103, 106, 107, 122, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 126, 125, 109, 108, 95, 97, 96, 104, - 105, 93, 94, 90, 91, 92, 89, 0, 0, 88, - 146, 149, 151, 150, 0, 0, 0, 157, 591, 0, - 55, 168, 235, 0, 0, 0, 277, 0, 0, 0, - 258, 582, 0, 257, 0, 256, 0, 0, 0, 591, - 255, 591, 0, 0, 0, 0, 283, 31, 0, 591, - 0, 127, 130, 128, 135, 591, 204, 200, 201, 203, - 202, 0, 0, 591, 140, 166, 62, 591, 0, 64, - 0, 0, 591, 0, 542, 185, 0, 0, 547, 546, - 545, 0, 0, 544, 591, 163, 0, 591, 0, 0, + 19, 0, 290, 40, 43, 247, 231, 240, 0, 0, + 0, 0, 11, 0, 0, 246, 51, 233, 234, 235, + 271, 0, 230, 0, 441, 440, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 243, 593, 245, 244, + 0, 0, 0, 0, 0, 0, 0, 0, 528, 512, + 513, 514, 515, 516, 517, 520, 521, 527, 0, 509, + 510, 511, 518, 519, 507, 508, 504, 505, 506, 526, + 525, 0, 0, 249, 0, 313, 593, 216, 212, 213, + 215, 214, 0, 593, 277, 0, 274, 273, 270, 272, + 0, 593, 593, 37, 34, 593, 0, 0, 0, 0, + 593, 284, 0, 593, 0, 0, 246, 59, 291, 68, + 70, 247, 231, 53, 0, 0, 593, 232, 593, 0, + 316, 170, 0, 0, 50, 49, 0, 238, 236, 482, + 496, 488, 484, 486, 487, 494, 0, 493, 483, 490, + 0, 489, 492, 495, 0, 491, 485, 479, 443, 0, + 524, 523, 228, 217, 0, 0, 439, 438, 278, 267, + 227, 593, 0, 0, 255, 254, 593, 286, 0, 0, + 0, 288, 593, 0, 32, 143, 144, 0, 0, 0, + 0, 133, 134, 593, 142, 132, 61, 63, 0, 593, + 0, 0, 593, 0, 0, 593, 190, 191, 0, 593, + 593, 593, 593, 593, 0, 189, 593, 72, 0, 593, + 0, 8, 0, 0, 0, 593, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 52, 593, 145, 0, 0, + 498, 0, 522, 593, 218, 275, 0, 251, 0, 0, + 0, 0, 256, 593, 0, 289, 593, 0, 0, 0, + 593, 0, 136, 593, 138, 593, 0, 200, 201, 0, + 593, 593, 593, 593, 593, 593, 593, 199, 0, 60, + 593, 579, 575, 578, 581, 582, 160, 0, 0, 0, + 577, 0, 583, 0, 0, 0, 576, 0, 0, 0, + 0, 0, 0, 161, 164, 593, 188, 538, 580, 159, + 0, 0, 0, 54, 593, 239, 0, 593, 196, 192, + 193, 195, 194, 78, 593, 12, 593, 171, 317, 318, + 316, 0, 593, 174, 175, 593, 0, 178, 180, 177, + 173, 0, 152, 148, 0, 98, 99, 100, 101, 102, + 103, 106, 107, 122, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 126, 125, 109, 108, + 95, 97, 96, 104, 105, 93, 94, 90, 91, 92, + 89, 0, 0, 88, 146, 149, 151, 150, 0, 0, + 0, 157, 593, 0, 55, 168, 237, 0, 0, 0, + 279, 0, 0, 0, 260, 584, 0, 259, 0, 258, + 0, 0, 0, 593, 257, 593, 0, 0, 0, 0, + 285, 31, 0, 593, 0, 127, 130, 128, 135, 593, + 206, 202, 203, 205, 204, 0, 0, 593, 140, 166, + 62, 593, 0, 64, 0, 0, 593, 0, 544, 187, + 0, 0, 549, 548, 547, 0, 0, 546, 593, 163, + 0, 593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 593, 0, + 57, 80, 197, 593, 0, 0, 320, 321, 325, 322, + 329, 323, 324, 326, 327, 328, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 392, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 593, 431, 432, 433, 424, 436, 420, 421, 419, + 426, 427, 415, 416, 417, 418, 425, 423, 430, 428, + 434, 429, 422, 435, 319, 0, 9, 0, 0, 176, + 179, 153, 147, 124, 123, 156, 155, 169, 593, 0, + 0, 481, 480, 593, 276, 586, 266, 585, 265, 264, + 263, 262, 261, 253, 287, 0, 26, 0, 0, 137, + 141, 139, 207, 210, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 444, 0, 0, 66, 0, + 0, 593, 593, 0, 593, 0, 0, 0, 574, 84, + 69, 83, 162, 165, 0, 184, 558, 559, 560, 561, + 562, 563, 566, 567, 573, 0, 555, 556, 557, 564, + 565, 553, 554, 550, 551, 552, 572, 571, 0, 0, + 0, 74, 71, 0, 593, 0, 198, 593, 0, 172, + 10, 181, 593, 182, 0, 154, 56, 219, 0, 0, + 0, 0, 593, 0, 0, 0, 0, 454, 452, 453, + 451, 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 591, 0, 57, 80, 195, 591, - 0, 0, 318, 319, 323, 320, 327, 321, 322, 324, - 325, 326, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 390, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 591, 429, 430, - 431, 422, 434, 418, 419, 417, 424, 425, 413, 414, - 415, 416, 423, 421, 428, 426, 432, 427, 420, 433, - 317, 0, 9, 0, 0, 174, 177, 153, 147, 124, - 123, 156, 155, 169, 591, 0, 0, 479, 478, 591, - 274, 584, 264, 583, 263, 262, 261, 260, 259, 251, - 285, 0, 26, 0, 0, 137, 141, 139, 205, 208, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 167, 442, 0, 0, 66, 0, 0, 591, 591, 0, - 591, 0, 0, 0, 572, 84, 69, 83, 162, 165, - 0, 182, 556, 557, 558, 559, 560, 561, 564, 565, - 571, 0, 553, 554, 555, 562, 563, 551, 552, 548, - 549, 550, 570, 569, 0, 0, 0, 74, 71, 0, - 591, 0, 196, 591, 0, 172, 10, 179, 591, 180, - 0, 154, 56, 217, 0, 0, 0, 0, 591, 0, - 0, 0, 0, 452, 450, 451, 449, 0, 0, 448, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 206, 0, 65, 541, 591, 183, 0, 0, 540, - 0, 537, 85, 0, 169, 0, 568, 567, 76, 591, - 58, 0, 591, 73, 435, 0, 591, 27, 0, 28, - 30, 0, 0, 0, 0, 0, 0, 475, 461, 462, - 463, 464, 465, 466, 467, 468, 474, 0, 458, 459, - 460, 456, 457, 453, 454, 455, 473, 472, 0, 0, - 67, 184, 0, 543, 0, 0, 566, 591, 0, 591, - 79, 181, 158, 0, 591, 447, 0, 446, 0, 443, - 0, 471, 470, 0, 0, 86, 0, 0, 591, 81, - 0, 207, 0, 0, 469, 539, 538, 87, 591, 75, - 0, 0, 0, 77, 29, 445, 444 + 0, 0, 0, 0, 0, 208, 0, 65, 543, 593, + 185, 0, 0, 542, 0, 539, 85, 0, 169, 0, + 570, 569, 76, 593, 58, 0, 593, 73, 437, 0, + 593, 27, 0, 28, 30, 0, 0, 0, 0, 0, + 0, 477, 463, 464, 465, 466, 467, 468, 469, 470, + 476, 0, 460, 461, 462, 458, 459, 455, 456, 457, + 475, 474, 0, 0, 67, 186, 0, 545, 0, 0, + 568, 593, 0, 593, 79, 183, 158, 0, 593, 449, + 0, 448, 0, 445, 0, 473, 472, 0, 0, 86, + 0, 0, 593, 81, 0, 209, 0, 0, 471, 541, + 540, 87, 593, 75, 0, 0, 0, 77, 29, 447, + 446 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 4, 5, 450, 451, 107, 358, 108, 109, 221, - 110, 111, 112, 366, 433, 463, 541, 240, 428, 506, - 507, 666, 254, 429, 432, 554, 1009, 1057, 719, 940, - 906, 610, 652, 113, 238, 420, 421, 422, 423, 464, - 854, 530, 531, 664, 619, 364, 562, 563, 532, 444, - 504, 206, 67, 346, 130, 256, 68, 69, 331, 70, - 332, 403, 404, 480, 71, 72, 328, 324, 325, 73, - 74, 114, 412, 484, 115, 75, 76, 77, 78, 448, - 449, 556, 840, 395, 263, 264, 890, 159, 42, 534, - 535, 630, 465, 43, 116 + 110, 111, 112, 366, 433, 465, 543, 240, 428, 508, + 509, 670, 254, 429, 432, 556, 1013, 1061, 723, 944, + 910, 614, 656, 113, 238, 420, 421, 422, 423, 466, + 858, 532, 533, 668, 623, 364, 566, 567, 534, 444, + 506, 206, 67, 346, 130, 256, 68, 69, 331, 70, + 332, 403, 404, 482, 71, 72, 328, 324, 325, 73, + 74, 114, 412, 486, 115, 75, 76, 77, 78, 448, + 449, 558, 844, 395, 263, 264, 894, 159, 42, 536, + 537, 634, 467, 43, 116 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -666 +#define YYPACT_NINF -656 static const yytype_int16 yypact[] = { - 258, -666, 2548, 3820, 65, 2628, -666, -666, -666, -666, - -666, -666, -666, -666, -62, -30, 60, 110, 114, 130, - 149, 18, -666, 153, 173, 181, 4026, -666, 190, 207, - 210, 221, -666, 214, 226, 2548, 2548, 2548, 2548, 1720, - 2548, 3185, -666, 107, -666, -666, -666, -666, -666, -666, - -666, 4006, 228, -666, -666, -666, -666, 4537, -666, 3871, - 3871, -666, 75, -666, 3871, -666, -666, 276, -666, -666, - -666, -666, 161, 67, 14, -666, -666, -666, -666, -666, - -666, 4568, 4568, -666, 4568, 892, 4568, 15, -666, 2540, - 235, 243, 247, 4568, 41, 269, 271, 285, 4568, 4568, - 278, 2563, 4568, 33, 4568, 4568, -666, -666, -666, -666, - 2741, -666, -666, -666, -666, -666, -666, 2548, 3820, 2548, - 2548, 2548, 2548, 2548, 3820, 2548, 2548, 2548, -666, 75, - 283, 75, 75, -666, 2548, 2548, 3820, 3820, 2548, 2548, - 167, 167, 167, 167, -62, 60, 110, 114, 130, 149, - 153, 173, 4449, 1931, 3341, 3699, 226, 286, -107, 3185, - 167, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, - 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, - 2548, 2548, 1942, 2548, -666, -666, 276, 2548, -666, -666, - 3809, -666, 3871, -666, -666, -666, -666, -666, -666, 290, - 276, 276, 276, 276, 276, 276, 292, -666, -666, 736, - 311, -666, 206, 4568, -666, -666, -666, 4568, -666, -666, - -666, 4483, 72, -666, 417, 426, 436, -666, -666, 329, - -666, -666, -666, -666, -666, 2548, 2811, -666, 323, 2873, - -666, 75, -666, -666, -666, 260, 315, -666, 3689, 328, - 3882, 75, -666, 75, 198, 339, -666, -666, -666, -666, - 67, 14, -666, 330, 346, -666, 334, 335, 337, 340, - 347, 350, 338, 351, 354, 355, -666, 2548, -666, -666, - 367, 370, 375, 349, 376, 377, 2548, 2548, -666, 3274, - 3357, 3574, 3574, 460, 460, 325, 325, -666, 3011, 3395, - 3410, 3440, 460, 460, 524, 524, 167, 167, 167, -666, - -666, -58, 1516, 292, 2972, -666, 276, 292, 292, 292, - 292, 292, 160, 2548, 75, 345, -666, -666, -666, -666, - 736, -666, 396, -666, -666, -666, 400, 401, 402, 404, - 3575, -666, 2938, 3709, 3689, 198, -666, -666, -666, -666, - -2, -666, -666, -666, 2548, 4006, 553, -666, -666, 383, - -666, -666, 75, 2043, -666, -666, 289, 217, 206, -666, - -666, -666, -666, -666, -666, -666, 388, -666, -666, -666, - 390, -666, -666, -666, 394, -666, -666, 167, 3185, 2548, - -666, -666, -666, 292, 397, 399, 3185, -666, 158, -666, - 419, 4074, -71, 420, 423, -666, 4139, -666, 537, 538, - 539, -666, -666, 333, -666, -666, -666, 75, 3771, 75, - 422, 435, -666, 714, -666, -666, -666, -666, 289, 1498, - 425, 289, 1498, 289, 2993, 553, -666, -666, 427, 553, - 553, 553, 553, 553, 216, -666, 4204, -666, 428, -666, - 267, -666, 430, 2144, 3029, 437, 289, 289, 1064, 289, - 289, 289, 289, -666, 147, -666, 736, 2548, -666, 2548, - 3185, 1498, -666, -666, 2548, -666, 476, 891, 940, 327, - -666, -666, -71, -666, -666, -50, 451, 452, 4269, 8, - 453, 714, 458, 4545, 3709, -666, -666, 450, 714, 714, - 714, 714, 714, 714, -69, -666, 289, -666, 147, -666, - -666, -666, -666, -666, -666, 448, 3944, 461, -666, 4026, - -666, 1831, 462, 472, -666, 2548, 2548, 2548, 1720, 2548, - 464, 9, -666, 714, 3202, -666, 107, -666, 289, 170, - 477, -666, 147, -666, 261, 553, 463, 463, 463, 463, - 463, -666, 2548, -666, 1498, -666, 1359, -666, -666, 75, - 2548, 2144, 474, 495, 3185, -666, -666, 289, 273, 273, - 609, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, 483, 481, -666, - -666, 273, 273, 273, 223, 86, 2043, -666, 2548, 504, - -666, -666, 419, -49, -44, 486, 3062, 75, 659, 75, - -666, -666, 659, -666, 659, -666, 659, 659, 659, 4334, - -666, 4399, 615, 507, 618, 620, -666, -666, 3820, -69, - 3820, -666, -666, -666, -666, 714, 497, 497, 497, 497, - 497, 306, 883, 2548, -666, -666, -666, 147, 516, -666, - 3820, 4006, 714, 3820, 501, -666, 3820, 3820, 167, 167, - 167, 498, -27, 167, 582, -666, 1609, 174, 2548, 2548, - 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, - 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2548, 2245, - 2548, 374, 635, 506, 582, 534, -666, -666, 463, 1498, - 523, 530, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, 533, -666, 535, 541, -666, 2346, 273, -666, -666, - -666, -666, -666, 3029, 1498, 536, 289, -666, -666, 582, - -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, - -666, 540, -666, 104, 543, -666, -666, -666, 497, 546, - 549, 560, 573, 584, 883, 883, 883, 883, 1720, 883, - 3236, -666, 571, 596, -666, 289, 578, 714, 174, 589, - 2548, 581, 592, 2548, -666, -666, -38, -666, -666, -666, - 2548, -666, 3274, 3357, 3574, 3574, 460, 460, 325, 325, - -666, 3152, 3395, 3410, 3440, 460, 460, 524, 524, 167, - 167, 167, -666, -666, 115, 1738, 595, -666, -38, 289, - 1498, 590, -666, 582, 1220, -666, -666, -666, 2144, 3185, - 594, -666, -666, -38, 614, 726, 622, 624, 1498, 3820, - 3820, 3820, 3820, 177, 177, 177, 177, 602, 118, 177, - 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, - 883, 883, 883, 883, 883, 883, 883, 883, 883, 2447, - 2548, -666, 289, -666, -666, 174, -666, 612, 607, -666, - 616, 167, -666, 619, 3185, 2548, -666, -666, -666, 1498, - -666, 625, 582, -38, -666, 617, 582, -666, 638, -666, - -666, 639, 640, 626, 645, 630, 883, -666, 801, 3425, - 3597, 3597, 514, 514, 475, 475, -666, 3219, 3478, 1955, - 3561, 636, 636, 177, 177, 177, -666, -666, 135, 2649, - -666, -666, 2548, -666, 2548, 11, 3185, 1498, 647, 582, - -38, -666, -38, 752, 582, -666, 651, -666, 655, 177, - 883, -666, -666, 143, 152, -666, 654, 656, 582, -38, - 657, -38, 2548, 2548, 3236, -666, -666, -666, 582, -38, - 673, 155, 156, -38, -666, -666, -666 + 351, -656, 2508, 3720, 19, 2632, -656, -656, -656, -656, + -656, -656, -656, -656, -135, -103, -99, -85, -60, -28, + -13, -27, -656, 11, 45, 74, 3926, -656, 83, 88, + 98, 16, -656, 105, 111, 2508, 2508, 2508, 2508, 1680, + 2508, 3135, -656, 109, -656, -656, -656, -656, -656, -656, + -656, 3906, 121, -656, -656, -656, -656, 4521, -656, 3527, + 3527, -656, 306, -656, 3527, -656, -656, 293, -656, -656, + -656, -656, 42, 20, 24, -656, -656, -656, -656, -656, + -656, 4578, 4578, -656, 4578, 2516, 4578, 43, -656, 4528, + 123, 135, 137, 4578, 64, 140, 154, 156, 4578, 4578, + 143, 4421, 4578, 47, 4578, 4578, -656, -656, -656, -656, + 2725, -656, -656, -656, -656, -656, -656, 2508, 3720, 2508, + 2508, 2508, 2508, 2508, 3720, 2508, 2508, 2508, -656, 306, + 150, 306, 306, -656, 2508, 2508, 3720, 3720, 2508, 2508, + 184, 184, 184, 184, -135, -99, -85, -60, -28, -13, + 11, 45, 4414, 1891, 3324, 3709, 111, 164, -76, 3135, + 184, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, + 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, + 2508, 2508, 2003, 2508, -656, -656, 293, 2508, -656, -656, + 3771, -656, 3527, -656, -656, -656, -656, -656, -656, 175, + 293, 293, 293, 293, 293, 293, 173, -656, -656, 3833, + 222, -656, 34, 4578, -656, -656, -656, 4578, -656, -656, + -656, 4471, 78, -656, 379, 381, 389, -656, -656, 296, + -656, -656, -656, -656, -656, 2508, 2795, -656, 269, 2857, + -656, 306, -656, -656, -656, 261, 279, -656, 3589, 289, + 3782, 306, -656, 306, 329, 310, -656, -656, -656, -656, + 20, 24, -656, 294, 307, -656, 315, 317, 324, 325, + 331, 340, 352, 345, 349, 355, -656, 2508, -656, -656, + 359, 360, 368, 361, 369, 370, 2508, 2508, -656, 3219, + 864, 3481, 3481, 738, 738, 532, 532, -656, 2977, 3340, + 3378, 3393, 738, 738, 215, 215, 184, 184, 184, -656, + -656, -73, 1037, 173, 2922, -656, 293, 173, 173, 173, + 173, 173, 186, 2508, 306, 371, -656, -656, -656, -656, + 3833, -656, 391, -656, -656, -656, 395, 401, 402, 404, + 3974, -656, 947, 3609, 3589, 329, -656, -656, -656, -656, + 9, -656, -656, -656, 2508, 3906, 182, -656, -656, 388, + -656, -656, 306, 1902, -656, -656, 244, 100, 34, -656, + -656, -656, -656, -656, -656, -656, 392, -656, -656, -656, + 387, -656, -656, -656, 393, -656, -656, 184, 3135, 2508, + -656, -656, -656, 173, 394, 390, 3135, -656, 192, -656, + 409, 4039, 277, 414, 416, -656, 4104, -656, 526, 527, + 528, -656, -656, 124, -656, -656, -656, 306, 3671, 306, + 413, 423, -656, 348, -656, -656, -656, -656, 244, 1133, + 417, 244, 1133, 244, 2956, 182, -656, -656, 418, 182, + 182, 182, 182, 182, 217, -656, 4169, -656, 405, -656, + 288, -656, 411, 425, 430, 2104, 2995, 420, 244, 244, + 2634, 244, 244, 244, 244, -656, 512, -656, 3833, 2508, + -656, 2508, 3135, 1133, -656, -656, 2508, -656, 595, 743, + 792, 386, -656, -656, 277, -656, -656, -71, 435, 439, + 4234, 53, 437, 348, 438, 4556, 3609, -656, -656, 434, + 348, 348, 348, 348, 348, 348, -114, -656, 244, -656, + 512, -656, -656, -656, -656, -656, -656, 436, 3844, 442, + -656, 3926, -656, 1791, 440, 443, -656, 2508, 2508, 2508, + 1680, 2508, 441, 26, -656, 348, 3169, -656, 109, -656, + 244, 191, 465, -656, 512, -656, 226, 182, 415, 415, + 415, 415, 415, -656, 2508, -656, 1133, -656, 1541, -656, + -656, 306, 2508, -656, -656, 2104, 432, 454, 3135, -656, + -656, 244, 284, 284, 567, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, 469, 468, -656, -656, 284, 284, 284, 248, 103, + 1902, -656, 2508, 459, -656, -656, 409, 76, 90, 472, + 3046, 306, 433, 306, -656, -656, 433, -656, 433, -656, + 433, 433, 433, 4299, -656, 4364, 570, 461, 601, 602, + -656, -656, 3720, -114, 3720, -656, -656, -656, -656, 348, + 476, 476, 476, 476, 476, 308, 675, 2508, -656, -656, + -656, 512, 497, -656, 3720, 3906, 348, 3720, 481, -656, + 3720, 3720, 184, 184, 184, 485, 93, 184, 563, -656, + 1244, -58, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, + 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, 2508, + 2508, 2508, 2508, 2205, 2508, 280, 620, 495, 563, 516, + -656, -656, 415, 1133, 496, 498, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, 500, -656, 503, 505, -656, + 2306, 284, -656, -656, -656, -656, -656, 2995, 1133, 501, + 244, -656, -656, 563, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, 507, -656, 107, 513, -656, + -656, -656, 476, 518, 519, 530, 523, 533, 675, 675, + 675, 675, 1680, 675, 3203, -656, 531, 552, -656, 244, + 538, 348, -58, 554, 2508, 550, 561, 2508, -656, -656, + 7, -656, -656, -656, 2508, -656, 3219, 864, 3481, 3481, + 738, 738, 532, 532, -656, 3012, 3340, 3378, 3393, 738, + 738, 215, 215, 184, 184, 184, -656, -656, 113, 1262, + 555, -656, 7, 244, 1133, 556, -656, 563, 1402, -656, + -656, -656, 2104, 3135, 558, -656, -656, 7, 572, 683, + 577, 578, 1133, 3720, 3720, 3720, 3720, 204, 204, 204, + 204, 562, 125, 204, 675, 675, 675, 675, 675, 675, + 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, + 675, 675, 675, 2407, 2508, -656, 244, -656, -656, -58, + -656, 568, 565, -656, 573, 184, -656, 575, 3135, 2508, + -656, -656, -656, 1133, -656, 585, 563, 7, -656, 560, + 563, -656, 587, -656, -656, 586, 588, 597, 589, 600, + 675, -656, 3257, 1915, 3542, 3542, 1995, 1995, 583, 583, + -656, 3186, 3408, 3423, 3461, 241, 241, 204, 204, 204, + -656, -656, 131, 1698, -656, -656, 2508, -656, 2508, 28, + 3135, 1133, 591, 563, 7, -656, 7, 720, 563, -656, + 596, -656, 598, 204, 675, -656, -656, 146, 155, -656, + 593, 604, 563, 7, 608, 7, 2508, 2508, 3203, -656, + -656, -656, 563, 7, 613, 163, 169, 7, -656, -656, + -656 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -666, -666, -76, -666, 215, -666, -666, 555, -666, -666, - 159, -100, -666, -666, -666, -60, -142, -666, -666, -666, - -96, -194, 561, -666, -666, -666, -666, -666, -666, -666, - -665, -666, -666, 308, -666, -666, -666, 309, 384, -352, - -666, -424, -666, 157, -449, -272, -557, -666, -504, -385, - -133, -102, -45, -101, 291, -125, 73, -97, -666, -95, - -666, -666, -666, 322, -19, -666, -323, -666, -666, -23, - 101, -666, -666, -666, -666, -15, 3, -666, -666, 250, - -666, -12, -666, -412, -93, -34, 180, 0, -105, -666, - -666, -406, 500, -282, -1 + -656, -656, -196, -656, 174, -656, -656, 515, -656, -656, + 72, -97, -656, -656, -656, -113, -195, -656, -656, -656, + -149, -247, 522, -656, -656, -656, -656, -656, -656, -656, + -655, -656, -656, 256, -656, -656, -656, 259, 334, -381, + -656, -388, -656, 110, -508, -338, -559, -656, -501, -144, + -406, -132, -37, -92, 243, -147, -34, -61, -656, -19, + -656, -656, -656, 281, 0, -656, -289, -656, -656, 1, + 278, -656, -656, -656, -656, -6, -4, -656, -656, 206, + -656, -54, -656, -442, -110, -36, 118, 421, -150, -656, + -656, -374, 149, -387, -1 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -268 +#define YYTABLE_NINF -270 static const yytype_int16 yytable[] = { - 6, 237, 41, 131, 844, 158, 186, 400, 540, 255, - 430, 133, 287, 257, 184, 258, 185, 675, 476, 477, - 478, 195, 196, 685, 195, 196, 267, 268, 269, 270, - 271, 288, 273, 274, 275, 140, 141, 142, 143, 479, - 160, 280, 281, 195, 196, 284, 285, 625, 1002, 938, - 544, 195, 196, 662, 546, 547, 548, 549, 550, 668, - 191, 287, 193, 194, 1003, 79, 207, 198, 663, 642, - 287, 633, 635, 427, 117, 287, 508, 195, 196, 539, - 390, 542, 195, 196, 313, 195, 196, 260, 643, 857, - 852, 259, 287, 715, 858, 262, 195, 196, 317, 318, - 319, 320, 321, 322, 568, 569, 118, 611, 612, 613, - 614, 904, 157, 184, 347, 185, 265, 241, 265, 265, - 265, 265, 265, 353, 265, 265, 265, 132, 686, 431, - 721, 489, 211, 265, 265, 255, 220, 265, 265, 257, - 720, 258, 257, 622, 258, 124, 647, 536, 311, 1075, - 536, 257, 340, 258, 667, 191, 193, 194, 198, 228, - 718, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 909, 312, 380, 207, 711, 314, 209, 536, - 335, 266, 620, 191, 953, 191, 119, 272, 169, 207, - 207, 207, 207, 207, 207, 356, 855, 326, 978, 282, - 283, 261, 329, 260, 393, 847, 260, 259, 893, 426, - 259, 262, 862, 955, 262, 260, 864, 6, 865, 259, - 866, 867, 868, 262, 287, 342, 669, 287, 911, 536, - 214, 215, 956, 216, 218, 219, 120, 257, 223, 258, - 121, 892, 227, 1006, 287, 401, 1027, 233, 234, 406, - 236, 239, 287, 243, 244, 360, 122, 361, 615, 616, - 716, 287, 536, 1071, 287, 287, 265, 473, 1013, 208, - 474, 1085, 446, 617, 618, 123, 387, 388, 199, 125, - 1086, 712, 200, 1095, 1096, 941, 910, 323, 394, 195, - 196, 455, 181, 182, 183, 456, 617, 618, 713, 126, - 435, 663, 988, 989, 990, 207, 360, 127, 361, 362, - 363, 260, 397, 396, -250, 259, 134, -250, 424, 262, - 6, 405, 201, 329, 6, -267, 488, 261, 466, 10, - 261, 11, 425, 135, 712, 457, 136, 1060, 137, 261, - 138, 1062, 551, 552, 434, 445, 169, 6, 649, 617, - 618, 851, 139, 454, 187, 656, 657, 658, 659, 660, - 661, 224, 223, 1, 2, 3, 333, 458, -82, 225, - -82, -82, -82, 226, 533, 558, 559, 533, 202, 470, - 230, 1015, 231, 651, 1079, 894, 349, 717, 552, 1081, - 687, 459, 203, 424, 536, 639, 232, 204, 641, 617, - 618, 6, 205, 1089, 235, 460, 636, 637, 638, 277, - 461, 316, 505, 1093, 286, 462, 533, 337, 537, 323, - 950, 537, 330, 623, 445, 624, 338, 536, 445, 445, - 445, 445, 445, 663, 879, 261, 339, 341, 557, 996, - 343, 350, 565, 564, 176, 177, 178, 179, 180, 365, - 181, 182, 183, 621, 354, 287, 376, 843, 369, 329, - 537, 672, 370, 371, 626, 372, 533, 384, 373, 424, - 6, 167, 168, 6, 399, 374, 195, 196, 375, 377, - 505, 169, 378, 379, 682, 712, 131, 505, 505, 505, - 505, 505, 505, 665, 133, 381, 978, 621, 382, 533, - 617, 618, 936, 383, 385, 386, 1011, 402, 407, 447, - 408, 409, 878, 410, 467, 678, 679, 680, 468, 683, - 469, 50, 505, 471, 1021, 976, 977, -266, 481, 898, - 472, 621, 482, 508, 445, 978, 1051, 485, 486, 487, - 493, 397, 396, 537, 494, 169, 538, 891, 545, 265, - 565, 564, 197, 436, 437, 438, 560, 555, 567, 439, - 644, 645, 536, 210, 212, 648, 61, 629, 629, 629, - 650, 655, 627, 63, 670, 1058, 628, 542, 673, 176, - 177, 178, 179, 180, 229, 181, 182, 183, 676, 677, - 552, 681, 684, 242, 983, 984, 985, 986, 987, 440, - 988, 989, 990, 845, 846, 714, 853, 397, 396, 848, - 132, 849, 850, 856, 859, 871, 897, 872, 873, 276, - 874, 278, 279, 1077, 663, 895, 903, 900, 905, 852, - 667, 533, 937, 983, 984, 985, 986, 987, 665, 988, - 989, 990, 236, 939, 505, 178, 179, 180, 536, 181, - 182, 183, 397, 396, 942, 441, 621, 978, 943, 195, - 196, 505, 945, 946, 533, 934, 536, 951, 954, 442, - 947, 957, 958, 907, 443, 959, 621, 960, 912, 913, - 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, - 924, 925, 926, 927, 928, 929, 930, 931, 932, 961, - 935, 962, 991, 907, 50, 992, 994, 997, 537, 999, - 1000, 875, 336, 877, 495, 496, 497, 536, 1012, 629, - 498, 1008, 1016, 629, 1017, 629, 1018, 629, 629, 629, - 1026, 348, 1019, 896, 1020, 1053, 899, 327, 1052, 901, - 902, 357, 1054, 359, 1066, 1055, 1061, 1063, 1068, 61, - 367, 368, 1080, 1059, 995, 627, 63, 985, 986, 987, - 499, 988, 989, 990, 842, 536, 334, 1064, 1065, 891, - 891, 891, 891, 1067, 891, 1078, 46, 1082, 47, 48, - 49, 1083, 1087, 1094, 1088, 1090, 952, 1010, 1050, 993, - 345, 653, 491, 654, 640, 944, 876, 998, 841, 533, - 674, 0, 0, 56, 192, 58, 557, 971, 972, 973, - 974, 975, 976, 977, 398, 0, 500, 0, 0, 0, - 59, 60, 978, 0, 0, 0, 0, 0, 0, 0, - 501, 0, 0, 0, 64, 502, 949, 0, 0, 66, - 503, 0, 0, 537, 968, 0, 0, 0, 907, 0, - 0, 0, 452, 0, 0, 891, 891, 891, 891, 891, - 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, - 891, 891, 891, 891, 0, 0, 7, 8, 9, 10, - 0, 11, 12, 13, 0, 533, 505, 621, 217, 265, - 0, 195, 196, 1001, 0, 0, 0, 0, 0, 0, - 1004, 0, 0, 533, 0, 0, 0, 490, 0, 492, - 0, 891, 0, 0, 0, 980, 981, 982, 0, 880, - 983, 984, 985, 986, 987, 0, 988, 989, 990, 537, - 0, 81, 907, 0, 0, 881, 50, 565, 564, 82, - 195, 196, 0, 22, 0, 1048, 0, 537, 84, 85, - 86, 967, 0, 0, 533, 891, 0, 0, 213, 0, - 27, 0, 0, 0, 0, 93, 631, 631, 631, 882, - 0, 0, 883, 0, 98, 0, 32, 0, 0, 99, - 1049, 61, 0, 0, 621, 50, 0, 627, 63, 0, - 0, 632, 104, 0, 105, 1056, 0, 0, 537, 884, - 0, 907, 533, 885, 886, 907, 0, 887, 1073, 888, - 1074, 0, 0, 889, 0, 0, 0, 0, 0, 0, - 0, 0, 1022, 1023, 1024, 1025, 0, 0, 0, 0, - 61, 0, 0, 0, 0, 0, 627, 63, 1091, 1092, - 634, 0, 0, 0, 0, 0, 537, 0, 907, 452, - 0, 0, 0, 907, 963, 964, 965, 966, 0, 969, - 570, 0, 0, 0, 0, 0, 0, 907, 0, 571, - 572, 573, 574, 575, 576, 577, 578, 907, 0, 0, - 0, 0, 0, 0, 0, 579, 0, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 0, - 0, 0, 0, 0, 0, 452, 0, 0, 0, 0, - 0, 0, 0, 0, 592, 0, 0, 861, 631, 863, - 0, 0, 631, 0, 631, 0, 631, 631, 631, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 593, - 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, - 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 0, + 6, 117, 672, 158, 237, 157, 848, 427, 666, 267, + 268, 269, 270, 271, 186, 273, 274, 275, 255, 79, + 133, 430, 679, 667, 280, 281, 491, 131, 284, 285, + 195, 196, 340, 118, 195, 196, 719, 119, 195, 196, + 689, 400, 538, 287, 542, 538, 287, 510, 646, 257, + 541, 120, 544, 191, 313, 193, 194, 195, 196, 184, + 198, 185, 288, 942, 914, 390, 207, 647, 317, 318, + 319, 320, 321, 322, 195, 196, 121, 572, 573, 667, + 615, 616, 617, 618, 266, 629, 538, 653, 195, 196, + 272, 258, 347, 1006, 660, 661, 662, 663, 664, 665, + 124, 353, 282, 283, 262, 637, 639, 856, 122, 1007, + 259, 260, 724, 195, 196, 184, 265, 185, 265, 265, + 265, 265, 265, 123, 265, 265, 265, 671, 624, 691, + 10, 241, 11, 265, 265, 401, 538, 265, 265, 406, + 431, 209, 211, 137, 255, 690, 311, 125, 191, 193, + 194, 198, -252, 214, 215, -252, 216, 218, 219, 715, + 208, 223, 446, 897, 220, 227, 1079, 380, 725, 538, + 233, 234, 673, 236, 239, 257, 243, 244, 257, 626, + 859, 126, 228, 915, 393, 207, 191, 257, 191, 913, + 851, 651, 436, 437, 438, 287, 335, 426, 439, 207, + 207, 207, 207, 207, 207, 329, 720, 326, 957, 287, + 127, 197, 287, 356, 861, 169, 490, 258, -269, 134, + 258, 468, 210, 212, 135, 896, 959, 6, 862, 258, + 262, 908, 287, 262, 136, 982, 259, 260, 440, 259, + 260, 138, 262, 229, 287, 960, 169, 139, 259, 260, + 287, 1010, 242, 882, 195, 196, 457, 187, 866, 224, + 458, 230, 868, 1031, 869, 287, 870, 871, 872, 1075, + 902, 225, 982, 226, 287, 231, 265, 232, 276, 235, + 278, 279, 287, 257, 1089, 223, 277, 643, 287, 333, + 645, 546, 1017, 1090, 441, 548, 549, 550, 551, 552, + 459, 1099, 286, 538, 132, 199, 316, 1100, 442, 200, + 323, 475, 716, 443, 476, 207, 195, 196, 435, 181, + 182, 183, 397, 323, 394, 258, 329, 621, 622, 717, + 6, 405, 460, 898, 6, 945, 538, 424, 262, 992, + 993, 994, 425, 330, 259, 260, 178, 179, 180, 201, + 181, 182, 183, 553, 554, 445, 461, 6, 497, 498, + 499, 1064, 721, 554, 500, 1066, 478, 479, 480, 716, + 462, 336, 989, 990, 991, 463, 992, 993, 994, -82, + 464, -82, -82, -82, 621, 622, 855, 481, 261, 337, + 348, 338, 535, 1019, 1000, 535, 343, 349, 655, 339, + 357, 716, 359, 722, 501, 202, 560, 561, 1083, 367, + 368, 6, 424, 1085, 341, 350, 621, 622, 940, 203, + 621, 622, 507, 41, 204, 354, 287, 1093, 539, 205, + 365, 539, 369, 627, 445, 628, 535, 1097, 445, 445, + 445, 445, 445, 195, 196, 667, 883, 360, 559, 361, + 362, 363, 847, 370, 569, 371, 140, 141, 142, 143, + 502, 160, 372, 373, 329, 625, 1, 2, 3, 374, + 954, 538, 539, 398, 503, 640, 641, 642, 375, 504, + 376, 676, 6, 377, 505, 6, 535, 378, 50, 384, + 424, 1055, 507, 379, 686, 999, 685, 381, 382, 507, + 507, 507, 507, 507, 507, 669, 383, 385, 386, 625, + 399, 452, 402, 407, 261, 133, 895, 261, 510, 535, + 408, 409, 131, 410, 447, 470, 261, -268, 469, 471, + 473, 474, 483, 61, 507, 484, 487, 488, 489, 631, + 63, 495, 496, 625, 557, 563, 445, 562, 540, 547, + 564, 571, 554, 397, 648, 539, 1015, 538, 649, 652, + 654, 265, 544, 169, 569, 659, 492, 236, 494, 677, + 681, 849, 674, 850, 1025, 538, 680, 852, 860, 688, + 875, 876, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 718, 312, 195, 196, 853, 314, 854, + 863, 877, 878, 667, 982, 671, 899, 904, 879, 909, + 881, 397, 261, 907, 856, 1062, 538, 635, 635, 635, + 360, 941, 361, 619, 620, 943, 947, 946, 901, 949, + 900, 950, 955, 903, 951, 958, 905, 906, 621, 622, + 50, 961, 669, 535, 962, 963, 342, 964, 507, 965, + 966, 176, 177, 178, 179, 180, 397, 181, 182, 183, + 625, 996, 995, 1081, 538, 507, 998, 938, 7, 8, + 9, 10, 1001, 11, 12, 13, 535, 911, 1003, 1004, + 625, 1012, 1021, 1022, 1016, 61, 1020, 1023, 1024, 1065, + 1030, 631, 63, 1057, 1056, 632, 1067, 387, 388, 1058, + 452, 1059, 987, 988, 989, 990, 991, 911, 992, 993, + 994, 884, 539, 1063, 1068, 1070, 1069, 1071, 1072, 1082, + 1084, 1091, 1086, 1098, 1087, 846, 334, 885, 895, 895, + 895, 895, 1092, 895, 396, 22, 1094, 956, 1014, 1054, + 997, 657, 493, 195, 196, 658, 633, 633, 633, 167, + 168, 345, 27, 880, 678, 644, 845, 948, 452, 169, + 0, 886, 0, 0, 887, 434, 0, 0, 32, 0, + 865, 635, 867, 0, 456, 635, 0, 635, 0, 635, + 635, 635, 0, 0, 1002, 0, 0, 0, 50, 132, + 0, 888, 195, 196, 0, 889, 890, 0, 0, 891, + 472, 892, 0, 0, 0, 893, 0, 0, 0, 0, + 559, 535, 0, 0, 895, 895, 895, 895, 895, 895, + 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, + 895, 895, 895, 61, 0, 0, 0, 50, 0, 631, + 63, 0, 0, 636, 0, 0, 972, 539, 971, 0, + 0, 0, 911, 0, 0, 0, 0, 176, 177, 178, + 179, 180, 0, 181, 182, 183, 568, 0, 0, 0, + 895, 163, 164, 165, 166, 167, 168, 0, 0, 0, + 0, 0, 61, 0, 0, 169, 0, 630, 631, 63, + 507, 625, 638, 265, 0, 0, 0, 535, 0, 0, + 633, 0, 0, 0, 633, 0, 633, 0, 633, 633, + 633, 0, 0, 0, 895, 535, 0, 0, 0, 1026, + 1027, 1028, 1029, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 539, 0, 0, 911, 0, 682, 683, + 684, 569, 687, 0, 0, 0, 0, 1052, 0, 0, + 0, 539, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 396, 535, 0, 169, 0, + 0, 0, 0, 0, 0, 0, 568, 0, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 625, 181, + 182, 183, 0, 0, 0, 0, 967, 968, 969, 970, + 0, 973, 539, 0, 0, 911, 0, 0, 0, 911, + 1077, 0, 1078, 0, 535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 594, 0, 0, 595, 0, 596, 597, - 598, 599, 600, 601, 602, 603, 604, 605, 606, 0, - 607, 608, 0, 0, 609, 0, 1069, 0, 0, 0, + 0, 857, 0, 396, 0, 0, 0, 0, 0, 0, + 1095, 1096, 161, 162, 163, 164, 165, 166, 167, 168, + 539, 0, 911, 0, 0, 0, 413, 911, 169, 0, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 911, 181, 182, 183, 414, 0, 0, 396, 0, + 0, 911, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 0, 0, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, + 933, 934, 935, 936, 0, 939, 511, 512, 513, 10, + 0, 11, 514, 515, 44, 0, 0, 516, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 0, 732, 733, 734, 735, 736, 737, - 738, 739, 740, 741, 742, 0, 0, 0, 0, 0, - 1084, 743, 744, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 759, 0, 0, - 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 0, 774, 0, 775, 776, 777, - 778, 779, 780, 781, 782, 783, 784, 785, 786, 0, - 0, 0, 0, 787, 788, 789, 0, 790, 791, 792, - 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, - 803, 0, 804, 805, 806, 807, 808, 809, 810, 811, - 812, 813, 814, 815, 816, 0, 0, 0, 817, 818, - 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, - 829, 830, 831, 832, 833, 834, 835, 836, 837, 1014, - 838, 839, 722, 723, 724, 725, 726, 727, 728, 729, - 730, 731, 0, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 0, 0, 0, 0, 0, 0, - 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 0, 0, 760, - 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 0, 774, 0, 775, 776, 777, 778, - 779, 780, 781, 782, 783, 784, 785, 786, 0, 0, - 0, 0, 787, 788, 789, 0, 790, 791, 792, 793, - 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, - 0, 804, 805, 806, 807, 808, 809, 810, 811, 812, - 813, 814, 815, 816, 0, 0, 0, 817, 818, 819, - 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, - 830, 831, 832, 833, 834, 835, 836, 837, 0, 838, - 839, 509, 510, 511, 10, 0, 11, 512, 513, 44, - 0, 0, 514, 0, 0, 0, 0, 0, 0, 0, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 0, 181, 182, 183, 0, 0, 0, 391, 517, + 45, 0, 0, 46, 0, 47, 48, 49, 50, 518, + 0, 52, 1088, 0, 53, 519, 0, 0, 54, 0, + 0, 0, 0, 520, 55, 0, 0, 0, 1080, 0, + 56, 57, 58, 0, 0, 0, 0, 0, 521, 0, + 522, 0, 0, 0, 0, 523, 0, 59, 60, 524, + 0, 0, 525, 61, 0, 0, 526, 0, 0, 62, + 63, 64, 0, 0, 65, 0, 66, 511, 512, 513, + 10, 0, 11, 514, 515, 44, 0, 0, 912, 527, + 0, 0, 0, 528, 0, 0, 0, 529, 0, 530, + 0, 953, 0, 531, 0, 0, 0, 161, 162, 163, + 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, + 517, 45, 0, 169, 46, 0, 47, 48, 49, 50, + 518, 0, 52, 0, 0, 53, 519, 0, 0, 54, + 0, 0, 0, 0, 520, 55, 0, 0, 0, 0, + 0, 56, 57, 58, 0, 0, 0, 0, 1005, 521, + 0, 522, 0, 0, 0, 1008, 523, 0, 59, 60, + 524, 0, 0, 525, 61, 0, 0, 526, 0, 0, + 62, 63, 64, 0, 0, 65, 0, 66, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 527, 0, 0, 568, 528, 0, 0, 0, 529, 0, + 530, 0, 0, 0, 531, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 0, 181, 182, 183, + 0, 0, 0, 1011, 0, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 1053, 736, 737, 738, 739, + 740, 741, 742, 743, 744, 745, 746, 0, 0, 0, + 1060, 0, 0, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, + 0, 0, 764, 765, 766, 767, 768, 769, 770, 771, + 772, 773, 774, 775, 776, 777, 0, 778, 0, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, + 790, 0, 0, 0, 0, 791, 792, 793, 0, 794, + 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, + 805, 806, 807, 0, 808, 809, 810, 811, 812, 813, + 814, 815, 816, 817, 818, 819, 820, 0, 0, 0, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, + 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, + 841, 1018, 842, 843, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 0, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 0, 0, 0, 0, + 0, 0, 747, 748, 749, 750, 751, 752, 753, 754, + 755, 756, 757, 758, 759, 760, 761, 762, 763, 0, + 0, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 0, 778, 0, 779, 780, + 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, + 0, 0, 0, 0, 791, 792, 793, 0, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 0, 808, 809, 810, 811, 812, 813, 814, + 815, 816, 817, 818, 819, 820, 0, 0, 0, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, + 0, 842, 843, 7, 8, 9, 10, 0, 11, 12, + 13, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 161, 162, 163, 164, 165, 166, 167, 168, 0, - 0, 0, 0, 0, 515, 45, 0, 169, 46, 0, - 47, 48, 49, 50, 516, 1076, 52, 0, 0, 53, - 517, 0, 0, 54, 0, 0, 0, 0, 518, 55, - 0, 0, 0, 0, 0, 56, 57, 58, 0, 0, - 0, 0, 0, 519, 0, 520, 0, 0, 0, 0, - 521, 0, 59, 60, 522, 0, 0, 523, 61, 0, - 0, 524, 0, 0, 62, 63, 64, 0, 0, 65, - 0, 66, 509, 510, 511, 10, 0, 11, 512, 513, - 44, 0, 0, 908, 525, 0, 0, 0, 526, 0, - 0, 0, 527, 0, 528, 0, 0, 0, 529, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 0, 181, 182, 183, 0, 515, 45, 391, 0, 46, - 0, 47, 48, 49, 50, 516, 0, 52, 0, 0, - 53, 517, 0, 0, 54, 0, 0, 0, 0, 518, - 55, 0, 0, 0, 0, 0, 56, 57, 58, 0, - 0, 0, 0, 0, 519, 0, 520, 0, 0, 0, - 0, 521, 0, 59, 60, 522, 0, 0, 523, 61, - 0, 0, 524, 0, 0, 62, 63, 64, 0, 0, - 65, 0, 66, 7, 8, 9, 10, 0, 11, 12, - 13, 144, 0, 0, 0, 525, 0, 0, 0, 526, - 0, 0, 0, 527, 0, 528, 0, 0, 0, 529, 0, 0, 0, 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, 15, 45, 0, 169, 145, 0, 146, 147, 148, 50, 51, 0, 52, 0, @@ -1853,42 +1852,42 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 26, 0, 27, 0, 0, 0, 0, 0, 0, 153, 154, 30, 0, 0, 31, 61, 0, 0, 32, 0, 0, 62, 63, 155, 0, - 0, 65, 0, 156, 509, 510, 511, 10, 0, 11, - 512, 513, 44, 0, 0, 0, 35, 0, 0, 0, + 0, 65, 0, 156, 511, 512, 513, 10, 0, 11, + 514, 515, 44, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 0, 38, 0, 39, 0, 0, 0, 40, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 0, 181, 182, 183, 0, 515, 45, 1007, - 0, 46, 0, 47, 48, 49, 50, 516, 0, 52, - 0, 0, 53, 517, 0, 0, 54, 0, 0, 0, - 0, 518, 55, 0, 0, 0, 0, 0, 56, 57, - 58, 0, 0, 0, 0, 0, 519, 0, 520, 0, - 0, 0, 0, 521, 0, 59, 60, 522, 0, 0, - 523, 61, 0, 0, 524, 0, 0, 62, 63, 64, + 179, 180, 0, 181, 182, 183, 0, 517, 45, 1076, + 0, 46, 0, 47, 48, 49, 50, 518, 0, 52, + 0, 0, 53, 519, 0, 0, 54, 0, 0, 0, + 0, 520, 55, 0, 0, 0, 0, 0, 56, 57, + 58, 0, 0, 0, 0, 0, 521, 0, 522, 0, + 0, 0, 0, 523, 0, 59, 60, 524, 0, 0, + 525, 61, 0, 0, 526, 0, 0, 62, 63, 64, 0, 0, 65, 0, 66, 7, 8, 9, 10, 0, - 11, 12, 13, 14, 0, 0, 0, 525, 0, 0, - 0, 526, 0, 0, 0, 527, 0, 528, 0, 0, - 0, 529, 972, 973, 974, 975, 976, 977, 0, 0, - 0, 46, 0, 47, 48, 49, 978, 0, 15, 0, + 11, 12, 13, 14, 0, 0, 0, 527, 0, 0, + 0, 528, 0, 0, 0, 529, 0, 530, 0, 0, + 0, 531, 976, 977, 978, 979, 980, 981, 0, 0, + 0, 46, 0, 47, 48, 49, 982, 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, 0, 0, 0, - 0, 0, 0, 20, 21, 0, 0, 0, 56, 192, + 0, 453, 454, 20, 21, 0, 0, 0, 56, 192, 58, 0, 22, 23, 0, 0, 0, 0, 0, 24, 25, 0, 0, 0, 0, 59, 60, 26, 0, 27, 0, 0, 0, 0, 0, 0, 28, 29, 30, 64, 0, 31, 0, 0, 66, 32, 7, 8, 9, 10, - 33, 11, 12, 13, 14, 34, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 134, 35, 0, - 0, 0, 36, 37, 0, 0, 38, 0, 39, 0, - 310, 982, 40, 0, 983, 984, 985, 986, 987, 15, - 988, 989, 990, 16, 0, 17, 18, 19, 0, 0, + 33, 11, 12, 13, 14, 34, 980, 981, 0, 0, + 455, 0, 0, 0, 0, 0, 982, 134, 35, 0, + 0, 0, 36, 37, 0, 0, 38, 0, 39, 984, + 985, 986, 40, 0, 987, 988, 989, 990, 991, 15, + 992, 993, 994, 16, 0, 17, 18, 19, 0, 0, 0, 0, 0, 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 22, 23, 0, 0, 0, 0, 0, 24, 25, 0, 0, 0, 0, 0, 0, 26, 0, 27, 0, 0, 0, 0, 0, 0, 28, 29, 30, 0, 0, 31, 0, 0, 0, 32, 7, 8, 9, 10, 33, 11, 12, 13, 14, 34, 0, 0, 0, - 0, 453, 0, 0, 0, 0, 0, 0, 0, 35, - 0, 0, 0, 36, 37, 0, 0, 38, 0, 39, - 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 987, 988, 989, 990, 991, 35, + 992, 993, 994, 36, 37, 0, 0, 38, 0, 39, + 0, 310, 0, 40, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, 0, 0, 0, 0, 0, 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 22, 23, 0, 0, 0, 0, @@ -1896,7 +1895,7 @@ static const yytype_int16 yytable[] = 0, 27, 0, 0, 0, 0, 0, 0, 28, 29, 30, 0, 0, 31, 0, 0, 0, 32, 7, 8, 9, 10, 33, 11, 12, 13, 14, 34, 0, 0, - 0, 0, 561, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 565, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 0, 38, 0, 39, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, @@ -1908,7 +1907,7 @@ static const yytype_int16 yytable[] = 8, 9, 10, 33, 11, 12, 13, 14, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 0, 38, - 0, 39, 0, 933, 0, 40, 0, 0, 0, 0, + 0, 39, 0, 937, 0, 40, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, 18, 19, 0, 0, 0, 0, 0, 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, 22, 23, 0, 0, @@ -1916,7 +1915,7 @@ static const yytype_int16 yytable[] = 0, 26, 0, 27, 0, 0, 0, 0, 0, 0, 28, 29, 30, 0, 0, 31, 0, 0, 0, 32, 7, 8, 9, 10, 33, 11, 12, 13, 14, 34, - 0, 0, 0, 0, 948, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 952, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 0, 38, 0, 39, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 17, @@ -1926,155 +1925,149 @@ static const yytype_int16 yytable[] = 0, 0, 26, 0, 27, 0, 0, 0, 0, 0, 0, 28, 29, 30, 0, 0, 31, 0, 0, 0, 32, 7, 8, 9, 10, 33, 11, 12, 13, 14, - 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 34, 0, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, - 0, 38, 0, 39, 0, 1047, 0, 40, 0, 81, - 0, 0, 0, 0, 15, 0, 0, 82, 16, 0, - 17, 18, 19, 0, 0, 0, 84, 85, 86, 20, - 21, 0, 81, 0, 0, 0, 213, 0, 22, 23, - 82, 0, 0, 93, 222, 24, 25, 0, -2, 84, - 85, 86, 98, 26, 0, 27, 0, 99, 0, 213, - 0, 0, 28, 29, 30, 0, 93, 31, 0, 0, - 104, 32, 105, 0, 0, 98, 33, 0, 0, 0, - 99, 34, 0, 0, 161, 162, 163, 164, 165, 166, - 167, 168, 0, 104, 35, 105, 80, 81, 36, 37, - 169, 0, 38, 0, 39, 82, 0, 0, 40, 0, - -129, 0, 83, 0, 84, 85, 86, 87, 0, 0, - 88, 0, 0, 0, 89, 0, 0, 0, 90, 91, - 92, 93, 94, 0, 0, 0, 0, 95, 96, 97, - 98, 0, 0, 0, 0, 99, 100, 0, 0, 101, - 0, 0, 0, 102, 0, 0, 0, 103, 104, 0, - 105, 0, 0, 0, 0, 0, 0, 0, 106, 0, - 0, 245, 246, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 0, 181, 182, 183, 0, 247, 0, - 1072, 46, 0, 47, 48, 49, 50, 248, 0, 249, - 0, 0, 53, 0, 0, 0, 54, 0, 0, 0, - 0, 0, 55, 0, 0, 0, 0, 0, 56, 57, - 58, 245, 246, 0, 0, 0, 0, 0, 0, 250, - 0, 0, 0, 0, 0, 59, 60, 0, 0, 0, - 0, 61, 0, 0, 0, 0, 0, 251, 63, 64, - 0, 0, 65, 0, 66, 0, 0, 0, 247, 252, - 0, 46, 0, 47, 48, 49, 50, 248, 0, 249, - 0, 0, 53, 0, 0, 253, 54, 0, 0, 0, - 0, 0, 55, 245, 246, 0, 0, 0, 56, 57, - 58, 0, 0, 0, 0, 0, 0, 0, 0, 250, - 0, 0, 0, 0, 0, 59, 60, 0, 0, 0, - 0, 61, 0, 0, 0, 0, 0, 251, 63, 64, - 247, 0, 65, 46, 66, 47, 48, 49, 50, 344, - 0, 249, 0, 0, 53, 0, 0, 0, 54, 0, - 0, 0, 0, 0, 55, 253, 0, 0, 0, 0, - 56, 57, 58, 161, 162, 163, 164, 165, 166, 167, - 168, 250, 0, 0, 0, 0, 0, 59, 60, 169, - 0, 0, 0, 61, 0, 0, 0, 0, 0, 251, - 63, 64, 0, 0, 65, 0, 66, 161, 162, 163, - 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, - 0, 0, 0, 169, 0, 0, 0, 253, 161, 162, - 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, - 0, 0, 0, 0, 169, 0, 161, 162, 163, 164, - 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, - 0, 0, 169, 0, 161, 162, 163, 164, 165, 166, - 167, 168, 0, 0, 0, 0, 0, 413, 0, 0, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 0, 181, 182, 183, 414, 161, 162, 163, + 0, 38, 0, 39, 0, 1051, 0, 40, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, + 17, 18, 19, 0, 0, 81, 0, 0, 0, 20, + 21, 0, 0, 82, 0, 0, 0, 0, 22, 23, + 0, 0, 84, 85, 86, 24, 25, 0, 0, 0, + 0, 0, 213, 26, 0, 27, 0, 0, 0, 93, + 0, 0, 28, 29, 30, 0, 0, 31, 98, 0, + 0, 32, 0, 99, 0, 0, 33, 0, 0, 0, + 0, 34, 0, 0, 0, 0, 104, 0, 105, 0, + 0, 0, -2, 0, 35, 0, 0, 0, 36, 37, + 574, 0, 38, 0, 39, 0, 0, 0, 40, 575, + 576, 577, 578, 579, 580, 581, 582, 0, 0, 0, + 0, 0, 0, 0, 0, 583, 0, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 0, + 80, 81, 0, 0, 0, 0, 0, 0, 0, 82, + 0, 0, 0, 0, 596, 0, 83, 0, 84, 85, + 86, 87, 0, 0, 88, 0, 0, 0, 89, 0, + 0, 0, 90, 91, 92, 93, 94, 0, 0, 597, + 0, 95, 96, 97, 98, 0, 0, 0, 0, 99, + 100, 0, 0, 101, 0, 245, 246, 102, 0, 0, + 0, 103, 104, 0, 105, 0, 0, 0, 0, 0, + 0, 0, 106, 598, 0, 0, 599, 0, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 0, + 611, 612, 247, 0, 613, 46, 0, 47, 48, 49, + 50, 248, 0, 249, 0, 0, 53, 0, 0, 0, + 54, 0, 0, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 56, 57, 58, 245, 246, 0, 0, 0, + 0, 0, 0, 250, 0, 0, 0, 0, 0, 59, + 60, 0, 0, 0, 0, 61, 0, 0, 0, 0, + 0, 251, 63, 64, 0, 0, 65, 0, 66, 0, + 0, 0, 247, 252, 0, 46, 0, 47, 48, 49, + 50, 248, 0, 249, 0, 0, 53, 0, 0, 253, + 54, 0, 0, 0, 0, 0, 55, 245, 246, 0, + 0, 0, 56, 57, 58, 0, 0, 0, 0, 0, + 0, 0, 0, 250, 0, 0, 0, 0, 0, 59, + 60, 0, 0, 0, 0, 61, 0, 0, 0, 0, + 0, 251, 63, 64, 247, 0, 65, 46, 66, 47, + 48, 49, 50, 344, 0, 249, 0, 0, 53, 0, + 0, 0, 54, 0, 0, 0, 0, 0, 55, 253, + 0, 0, 0, 0, 56, 57, 58, 161, 162, 163, + 164, 165, 166, 167, 168, 250, 0, 0, 0, 0, + 0, 59, 60, 169, 0, 0, 0, 61, 0, 0, + 0, 0, 0, 251, 63, 64, 0, 0, 65, 0, + 66, 161, 162, 163, 164, 165, 166, 167, 168, 0, + 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, + 0, 253, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 169, 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, 181, 182, 183, - 392, 0, 0, 0, 0, 0, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 0, 181, 182, - 183, 543, 389, 0, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 0, 181, 182, 183, 566, - 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 0, 181, 182, 183, 161, 162, 163, - 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, - 0, 860, 0, 169, 0, 170, 171, 172, 173, 174, + 392, 161, 162, 163, 164, 165, 166, 167, 168, 0, + 0, 0, 0, 0, 0, 0, 0, 169, 0, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 0, 181, 182, 183, 545, 0, 0, 0, 389, 0, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 0, 181, 182, 183, 570, 0, 0, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, + 181, 182, 183, 1009, 0, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, 181, 182, 183, 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, - 0, 0, 0, 0, 0, 0, 169, 688, 689, 690, - 691, 692, 693, 694, 695, 0, 0, 0, 0, 0, - 0, 0, 0, 696, 970, 971, 972, 973, 974, 975, - 976, 977, 0, 0, 0, 0, 0, 0, 0, 0, - 978, 970, 971, 972, 973, 974, 975, 976, 977, 0, - 0, 0, 0, 0, 0, 0, 0, 978, 0, 0, - 0, 0, 0, 1005, 0, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 0, 181, 182, 183, - 162, 163, 164, 165, 166, 167, 168, 0, 0, 0, - 0, 0, 0, 0, 0, 169, 0, 0, 170, 171, + 0, 0, 0, 0, 0, 864, 169, 0, 0, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 0, 181, 182, 183, 692, 693, 694, 695, 696, 697, + 698, 699, 0, 0, 0, 0, 0, 0, 0, 0, + 700, 974, 975, 976, 977, 978, 979, 980, 981, 0, + 0, 0, 0, 0, 0, 0, 0, 982, 974, 975, + 976, 977, 978, 979, 980, 981, 0, 0, 0, 0, + 0, 0, 0, 0, 982, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 169, 0, 0, 0, 0, 0, 0, 0, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, - 181, 182, 183, 0, 0, 697, 698, 699, 700, 701, - 702, 703, 704, 705, 706, 707, 0, 708, 709, 710, - 1070, 0, 979, 980, 981, 982, 0, 0, 983, 984, - 985, 986, 987, 0, 988, 989, 990, 0, 0, 979, - 980, 981, 982, 0, 0, 983, 984, 985, 986, 987, - 0, 988, 989, 990, 163, 164, 165, 166, 167, 168, - 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, - 0, 46, 0, 47, 48, 49, 0, 0, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 0, 181, - 182, 183, 163, 164, 165, 166, 167, 168, 56, 192, - 58, 0, 0, 0, 0, 0, 169, 163, 164, 165, - 166, 167, 168, 0, 0, 59, 60, 0, 0, 0, - 0, 169, 972, 973, 974, 975, 976, 977, 0, 64, - 0, 0, 0, 0, 66, 0, 978, 163, 164, 165, + 181, 182, 183, 975, 976, 977, 978, 979, 980, 981, + 0, 0, 0, 0, 0, 0, 0, 0, 982, 0, + 0, 0, 701, 702, 703, 704, 705, 706, 707, 708, + 709, 710, 711, 0, 712, 713, 714, 1074, 0, 983, + 984, 985, 986, 0, 0, 987, 988, 989, 990, 991, + 0, 992, 993, 994, 0, 0, 983, 984, 985, 986, + 0, 0, 987, 988, 989, 990, 991, 0, 992, 993, + 994, 0, 0, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 0, 181, 182, 183, 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 0, 0, 0, 0, 0, 135, 0, 0, - 0, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 0, 181, 182, 183, 972, 973, 974, 975, 976, - 977, 0, 0, 0, 0, 0, 0, 0, 0, 978, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, - 181, 182, 183, 0, 0, 0, 173, 174, 175, 176, - 177, 178, 179, 180, 0, 181, 182, 183, 0, 980, - 981, 982, 0, 0, 983, 984, 985, 986, 987, 0, - 988, 989, 990, 0, 0, 0, 0, 174, 175, 176, - 177, 178, 179, 180, 0, 181, 182, 183, 972, 973, - 974, 975, 976, 977, 0, 0, 0, 0, 0, 0, - 0, 0, 978, 165, 166, 167, 168, 0, 0, 0, - 0, 0, 0, 981, 982, 169, 0, 983, 984, 985, - 986, 987, 0, 988, 989, 990, 974, 975, 976, 977, - 0, 0, 0, 80, 81, 0, 0, 0, 978, 0, - 0, 0, 82, 0, 0, 0, 0, 0, 0, 83, - 0, 84, 85, 86, 87, 0, 0, 88, 0, 0, - 0, 89, 0, 0, 0, 90, 91, 92, 93, 94, - 0, 0, 0, 0, 95, 96, 97, 98, 0, 0, - 0, 0, 99, 100, 0, 0, 101, 0, 0, 0, - 102, 0, 0, 0, 103, 104, 0, 105, 0, 0, - 983, 984, 985, 986, 987, 106, 988, 989, 990, 351, - 352, 174, 175, 176, 177, 178, 179, 180, 0, 181, - 182, 183, 0, 0, 411, 0, 0, 0, 0, 415, - 416, 0, 0, 0, 0, 0, 983, 984, 985, 986, - 987, 0, 988, 989, 990, 0, 247, 0, 0, 46, - 0, 47, 48, 49, 50, 0, 0, 249, 0, 46, - 53, 47, 48, 49, 54, 0, 0, 0, 0, 46, + 0, 169, 0, 0, 46, 0, 47, 48, 49, 0, + 0, 984, 985, 986, 0, 0, 987, 988, 989, 990, + 991, 0, 992, 993, 994, 163, 164, 165, 166, 167, + 168, 56, 192, 58, 0, 0, 0, 0, 0, 169, + 163, 164, 165, 166, 167, 168, 0, 0, 59, 60, + 0, 0, 0, 0, 169, 976, 977, 978, 979, 980, + 981, 0, 64, 0, 0, 0, 0, 66, 0, 982, + 976, 977, 978, 979, 980, 981, 0, 0, 0, 0, + 0, 0, 0, 0, 982, 0, 0, 0, 0, 0, + 135, 0, 0, 0, 0, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 0, 181, 182, 183, 976, 977, + 978, 979, 980, 981, 0, 0, 0, 0, 0, 0, + 0, 0, 982, 0, 0, 0, 0, 0, 0, 0, + 165, 166, 167, 168, 173, 174, 175, 176, 177, 178, + 179, 180, 169, 181, 182, 183, 0, 0, 0, 0, + 174, 175, 176, 177, 178, 179, 180, 0, 181, 182, + 183, 0, 0, 985, 986, 0, 0, 987, 988, 989, + 990, 991, 0, 992, 993, 994, 0, 0, 0, 986, + 0, 0, 987, 988, 989, 990, 991, 0, 992, 993, + 994, 978, 979, 980, 981, 0, 0, 0, 0, 0, + 0, 0, 0, 982, 0, 0, 0, 46, 0, 47, + 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 987, 988, 989, 990, 991, 0, 992, 993, 994, 351, + 352, 0, 0, 0, 56, 192, 58, 0, 174, 175, + 176, 177, 178, 179, 180, 0, 181, 182, 183, 415, + 416, 59, 60, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 64, 247, 0, 0, 46, + 66, 47, 48, 49, 50, 0, 0, 249, 0, 0, + 53, 0, 0, 0, 54, 0, 0, 0, 0, 46, 55, 47, 48, 49, 417, 418, 56, 57, 58, 0, - 53, 0, 0, 0, 0, 0, 56, 192, 58, 0, + 53, 987, 988, 989, 990, 991, 0, 992, 993, 994, 55, 415, 416, 59, 60, 0, 56, 57, 58, 61, - 0, 0, 0, 59, 60, 251, 63, 64, 0, 0, - 65, 0, 66, 59, 60, 0, 0, 64, 0, 0, - 0, 0, 66, 0, 0, 419, 0, 64, 0, 0, + 0, 0, 0, 0, 0, 251, 63, 64, 0, 0, + 65, 0, 66, 59, 60, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 419, 0, 64, 0, 0, 65, 46, 66, 47, 48, 49, 0, 0, 0, 0, - 0, 44, 53, 0, 0, 138, 0, 0, 0, 0, + 0, 44, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 56, 57, 58, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 47, 48, 49, 0, 59, 60, 45, 0, 0, 46, 0, 47, 48, 49, 50, 51, 0, 52, 64, - 315, 53, 65, 0, 66, 54, 56, 192, 58, 0, + 0, 53, 65, 0, 66, 54, 56, 192, 58, 0, 0, 55, 0, 44, 0, 0, 0, 56, 57, 58, 0, 0, 0, 59, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 60, 0, 64, 0, 0, 61, 46, 66, 47, 48, 49, 62, 63, 64, 45, 0, 65, 46, 66, 47, 48, 49, 50, 355, 0, - 52, 0, 0, 53, 0, 0, 0, 54, 56, 192, + 52, 0, 315, 53, 327, 138, 0, 54, 56, 192, 58, 0, 0, 55, 0, 44, 0, 0, 0, 56, 57, 58, 0, 0, 0, 59, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 60, 0, 64, - 0, 0, 61, 0, 66, 0, 0, 0, 62, 63, + 0, 0, 61, 46, 66, 47, 48, 49, 62, 63, 64, 45, 0, 65, 46, 66, 47, 48, 49, 50, 0, 0, 52, 0, 0, 53, 0, 0, 0, 54, - 0, 0, 0, 0, 0, 55, 0, 44, 0, 0, - 0, 56, 57, 58, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 671, 128, 59, 60, - 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, + 56, 192, 58, 0, 0, 55, 0, 44, 0, 0, + 0, 56, 57, 58, 0, 0, 0, 59, 60, 0, + 0, 0, 0, 0, 0, 0, 675, 128, 59, 60, + 0, 64, 0, 0, 61, 0, 66, 0, 0, 0, 62, 63, 64, 45, 0, 65, 46, 66, 47, 48, 49, 50, 0, 0, 52, 0, 0, 53, 0, 0, 0, 54, 0, 0, 0, 0, 46, 55, 47, 48, @@ -2091,239 +2084,246 @@ static const yytype_int16 yytable[] = 0, 0, 0, 103, 104, 0, 105, 80, 81, 0, 0, 0, 0, 0, 106, 0, 82, 0, 0, 0, 0, 0, 0, 83, 0, 84, 85, 86, 87, 0, - 0, 88, 0, 475, 0, 89, 0, 0, 0, 90, + 0, 88, 0, 411, 0, 89, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 95, 96, 97, 98, 0, 0, 0, 0, 99, 100, 0, 0, 101, 0, 0, 0, 102, 0, 0, 0, 103, 104, 0, 105, 80, 81, 0, 0, 0, 0, 0, 106, 0, 82, 0, 0, 0, 0, 0, 0, 83, 0, - 84, 85, 86, 87, 0, 0, 88, 0, 483, 0, + 84, 85, 86, 87, 0, 0, 88, 0, 477, 0, 89, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 95, 96, 97, 98, 0, 0, 0, 0, 99, 100, 0, 0, 101, 0, 0, 0, 102, 0, 0, 0, 103, 104, 0, 105, 80, 81, 0, 0, 0, 0, 0, 106, 0, 82, 0, 0, 0, 0, 0, 0, 83, 0, 84, 85, 86, 87, 0, - 0, 88, 0, 553, 0, 89, 0, 0, 0, 90, + 0, 88, 0, 485, 0, 89, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 95, 96, 97, 98, 0, 0, 0, 0, 99, 100, 0, 0, 101, 0, 0, 0, 102, 0, 0, 0, 103, 104, 0, 105, 80, 81, 0, 0, 0, 0, 0, 106, 0, 82, 0, 0, 0, 0, 0, 0, 83, 0, - 84, 85, 86, 87, 0, 0, 88, 0, 646, 0, + 84, 85, 86, 87, 0, 0, 88, 0, 555, 0, 89, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 95, 96, 97, 98, 0, 0, 0, 0, 99, 100, 0, 0, 101, 0, 0, 0, 102, 0, 0, 0, 103, 104, 0, 105, 80, 81, 0, 0, 0, 0, 0, 106, 0, 82, 0, 0, 0, 0, 0, 0, 83, 0, 84, 85, 86, 87, 0, - 0, 88, 0, 869, 0, 89, 0, 0, 0, 90, + 0, 88, 0, 650, 0, 89, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 95, 96, - 97, 98, 0, 0, 0, 0, 99, 100, 0, 46, - 101, 47, 48, 49, 102, 0, 0, 0, 103, 104, - 188, 105, 0, 0, 0, 0, 0, 0, 0, 106, - 189, 0, 0, 0, 0, 0, 56, 190, 58, 0, - 0, 80, 81, 0, 0, 0, 0, 0, 870, 0, - 82, 0, 0, 59, 60, 0, 0, 83, 0, 84, - 85, 86, 87, 0, 0, 88, 0, 64, 0, 89, - 0, 0, 66, 90, 91, 92, 93, 94, 0, 0, - 0, 0, 95, 96, 97, 98, 0, 0, 0, 0, - 99, 100, 0, 0, 101, 127, 0, 46, 102, 47, - 48, 49, 103, 104, 81, 105, 0, 0, 188, 0, - 0, 0, 82, 0, 0, 0, 0, 0, 189, 0, - 0, 84, 85, 86, 56, 190, 58, 81, 0, 0, - 0, 213, 0, 0, 0, 82, 0, 0, 93, 0, - 0, 59, 60, 0, 84, 85, 86, 98, 0, 0, - 0, 0, 99, 0, 213, 64, 101, 0, 0, 0, - 66, 93, 0, 0, 0, 104, 0, 105, 0, 0, + 97, 98, 0, 0, 0, 0, 99, 100, 0, 0, + 101, 0, 0, 0, 102, 0, 0, 0, 103, 104, + 0, 105, 80, 81, 0, 0, 0, 0, 0, 106, + 0, 82, 0, 0, 0, 0, 0, 0, 83, 0, + 84, 85, 86, 87, 0, 0, 88, 0, 873, 0, + 89, 0, 0, 0, 90, 91, 92, 93, 94, 0, + 0, 0, 0, 95, 96, 97, 98, 0, 0, 0, + 0, 99, 100, 0, 46, 101, 47, 48, 49, 102, + 81, 0, 0, 103, 104, 188, 105, 0, 82, 0, + 0, 0, 0, 0, 106, 189, 0, 84, 85, 86, + 0, 56, 190, 58, 0, 0, 0, 213, 0, 0, + 0, 0, 0, 874, 93, 0, 0, 0, 59, 60, + 0, 0, 0, 98, 0, 0, 0, 0, 99, 80, + 81, 0, 64, 0, 0, 0, 0, 66, 82, 0, + 0, 104, 0, 105, 0, 83, 0, 84, 85, 86, + 87, 0, 0, 88, 0, 0, 0, 89, -129, 0, + 127, 90, 91, 92, 93, 94, 0, 0, 0, 0, + 95, 96, 97, 98, 0, 0, 0, 0, 99, 100, + 0, 46, 101, 47, 48, 49, 102, 81, 0, 0, + 103, 104, 188, 105, 0, 82, 0, 0, 0, 0, + 0, 0, 189, 0, 84, 85, 86, 0, 56, 190, + 58, 0, 0, 0, 213, 81, 0, 0, 0, 0, + 0, 93, 222, 82, 0, 59, 60, 0, 0, 0, + 98, 0, 84, 85, 86, 99, 0, 81, 0, 64, + 0, 0, 213, 0, 66, 82, 0, 0, 104, 93, + 105, 0, 0, 0, 84, 85, 86, 0, 98, 0, + 0, 0, 0, 99, 213, 0, 0, 101, 0, 0, + 0, 93, 0, 0, 0, 0, 104, 0, 105, 0, 98, 0, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 0, 105 }; #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-666))) + (!!((Yystate) == (-656))) #define yytable_value_is_error(Yytable_value) \ YYID (0) static const yytype_int16 yycheck[] = { - 1, 101, 2, 26, 561, 39, 51, 330, 432, 110, - 12, 26, 119, 110, 6, 110, 8, 521, 89, 90, - 91, 10, 11, 14, 10, 11, 119, 120, 121, 122, - 123, 138, 125, 126, 127, 35, 36, 37, 38, 110, - 40, 134, 135, 10, 11, 138, 139, 471, 86, 714, - 435, 10, 11, 122, 439, 440, 441, 442, 443, 508, - 57, 119, 59, 60, 102, 0, 67, 64, 137, 119, - 119, 477, 478, 345, 136, 119, 428, 10, 11, 431, - 138, 433, 10, 11, 186, 10, 11, 110, 138, 138, - 4, 110, 119, 542, 138, 110, 10, 11, 200, 201, - 202, 203, 204, 205, 456, 457, 136, 459, 460, 461, - 462, 138, 39, 6, 239, 8, 117, 84, 119, 120, - 121, 122, 123, 248, 125, 126, 127, 26, 119, 131, - 554, 413, 118, 134, 135, 236, 121, 138, 139, 236, - 552, 236, 239, 466, 239, 127, 138, 429, 182, 138, - 432, 248, 228, 248, 506, 152, 153, 154, 155, 118, - 545, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 686, 183, 277, 186, 538, 187, 121, 471, - 118, 118, 464, 190, 859, 192, 136, 124, 31, 200, - 201, 202, 203, 204, 205, 250, 618, 208, 31, 136, - 137, 110, 209, 236, 316, 567, 239, 236, 667, 344, - 239, 236, 628, 119, 239, 248, 632, 228, 634, 248, - 636, 637, 638, 248, 119, 235, 508, 119, 687, 521, - 81, 82, 138, 84, 85, 86, 136, 344, 89, 344, - 136, 663, 93, 138, 119, 331, 138, 98, 99, 335, - 101, 102, 119, 104, 105, 118, 136, 120, 121, 122, - 542, 119, 554, 138, 119, 119, 277, 119, 943, 118, - 122, 138, 358, 136, 137, 136, 286, 287, 12, 136, - 138, 121, 16, 138, 138, 719, 122, 137, 138, 10, - 11, 12, 135, 136, 137, 16, 136, 137, 138, 136, - 355, 137, 135, 136, 137, 316, 118, 136, 120, 121, - 122, 344, 323, 323, 118, 344, 136, 121, 343, 344, - 331, 332, 56, 330, 335, 118, 412, 236, 121, 6, - 239, 8, 343, 136, 121, 56, 136, 1012, 127, 248, - 136, 1016, 136, 137, 354, 356, 31, 358, 491, 136, - 137, 138, 136, 363, 136, 498, 499, 500, 501, 502, - 503, 136, 213, 115, 116, 117, 217, 88, 118, 136, - 120, 121, 122, 136, 429, 118, 119, 432, 112, 389, - 121, 948, 121, 493, 1059, 667, 136, 136, 137, 1064, - 533, 112, 126, 418, 686, 481, 121, 131, 484, 136, - 137, 412, 136, 1078, 136, 126, 89, 90, 91, 136, - 131, 131, 423, 1088, 138, 136, 471, 10, 429, 137, - 854, 432, 121, 467, 435, 469, 10, 719, 439, 440, - 441, 442, 443, 137, 138, 344, 10, 118, 449, 898, - 127, 136, 453, 453, 129, 130, 131, 132, 133, 120, - 135, 136, 137, 464, 136, 119, 128, 560, 138, 466, - 471, 516, 138, 138, 474, 138, 521, 128, 138, 494, - 481, 21, 22, 484, 139, 138, 10, 11, 138, 138, - 491, 31, 138, 138, 528, 121, 519, 498, 499, 500, - 501, 502, 503, 504, 519, 138, 31, 508, 138, 554, - 136, 137, 138, 138, 138, 138, 940, 121, 118, 136, - 119, 119, 655, 119, 136, 525, 526, 527, 138, 529, - 136, 55, 533, 136, 958, 21, 22, 118, 118, 672, - 141, 542, 119, 895, 545, 31, 995, 10, 10, 10, - 128, 552, 552, 554, 119, 31, 131, 662, 131, 560, - 561, 561, 62, 10, 11, 12, 136, 139, 131, 16, - 119, 119, 854, 73, 74, 122, 100, 476, 477, 478, - 122, 131, 106, 107, 136, 1009, 110, 939, 127, 129, - 130, 131, 132, 133, 94, 135, 136, 137, 136, 127, - 137, 528, 138, 103, 129, 130, 131, 132, 133, 56, - 135, 136, 137, 139, 119, 138, 616, 618, 618, 10, - 519, 138, 141, 119, 138, 10, 671, 120, 10, 129, - 10, 131, 132, 1057, 137, 119, 138, 136, 56, 4, - 992, 686, 136, 129, 130, 131, 132, 133, 649, 135, - 136, 137, 493, 119, 655, 131, 132, 133, 940, 135, - 136, 137, 663, 663, 141, 112, 667, 31, 138, 10, - 11, 672, 139, 138, 719, 709, 958, 141, 138, 126, - 139, 138, 136, 684, 131, 136, 687, 127, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706, 707, 708, 136, - 710, 127, 141, 714, 55, 119, 138, 128, 719, 138, - 128, 648, 222, 650, 10, 11, 12, 1009, 138, 628, - 16, 136, 138, 632, 120, 634, 10, 636, 637, 638, - 138, 241, 120, 670, 120, 138, 673, 11, 136, 676, - 677, 251, 136, 253, 128, 136, 139, 119, 128, 100, - 260, 261, 10, 138, 897, 106, 107, 131, 132, 133, - 56, 135, 136, 137, 559, 1057, 221, 138, 138, 884, - 885, 886, 887, 138, 889, 138, 50, 136, 52, 53, - 54, 136, 138, 120, 138, 138, 856, 939, 992, 895, - 239, 493, 418, 494, 482, 817, 649, 900, 558, 854, - 519, -1, -1, 77, 78, 79, 817, 16, 17, 18, - 19, 20, 21, 22, 324, -1, 112, -1, -1, -1, - 94, 95, 31, -1, -1, -1, -1, -1, -1, -1, - 126, -1, -1, -1, 108, 131, 846, -1, -1, 113, - 136, -1, -1, 854, 888, -1, -1, -1, 859, -1, - -1, -1, 362, -1, -1, 970, 971, 972, 973, 974, - 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, - 985, 986, 987, 988, -1, -1, 3, 4, 5, 6, - -1, 8, 9, 10, -1, 940, 897, 898, 6, 900, - -1, 10, 11, 903, -1, -1, -1, -1, -1, -1, - 910, -1, -1, 958, -1, -1, -1, 417, -1, 419, - -1, 1026, -1, -1, -1, 124, 125, 126, -1, 46, - 129, 130, 131, 132, 133, -1, 135, 136, 137, 940, - -1, 49, 943, -1, -1, 62, 55, 948, 948, 57, - 10, 11, -1, 70, -1, 989, -1, 958, 66, 67, - 68, 888, -1, -1, 1009, 1070, -1, -1, 76, -1, - 87, -1, -1, -1, -1, 83, 476, 477, 478, 96, - -1, -1, 99, -1, 92, -1, 103, -1, -1, 97, - 990, 100, -1, -1, 995, 55, -1, 106, 107, -1, - -1, 110, 110, -1, 112, 1005, -1, -1, 1009, 126, - -1, 1012, 1057, 130, 131, 1016, -1, 134, 1052, 136, - 1054, -1, -1, 140, -1, -1, -1, -1, -1, -1, - -1, -1, 959, 960, 961, 962, -1, -1, -1, -1, - 100, -1, -1, -1, -1, -1, 106, 107, 1082, 1083, - 110, -1, -1, -1, -1, -1, 1057, -1, 1059, 559, - -1, -1, -1, 1064, 884, 885, 886, 887, -1, 889, - 6, -1, -1, -1, -1, -1, -1, 1078, -1, 15, - 16, 17, 18, 19, 20, 21, 22, 1088, -1, -1, - -1, -1, -1, -1, -1, 31, -1, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, -1, - -1, -1, -1, -1, -1, 615, -1, -1, -1, -1, - -1, -1, -1, -1, 60, -1, -1, 627, 628, 629, - -1, -1, 632, -1, 634, -1, 636, 637, 638, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, - 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, - 980, 981, 982, 983, 984, 985, 986, 987, 988, -1, + 1, 136, 510, 39, 101, 39, 565, 345, 122, 119, + 120, 121, 122, 123, 51, 125, 126, 127, 110, 0, + 26, 12, 523, 137, 134, 135, 413, 26, 138, 139, + 10, 11, 228, 136, 10, 11, 544, 136, 10, 11, + 14, 330, 429, 119, 432, 432, 119, 428, 119, 110, + 431, 136, 433, 57, 186, 59, 60, 10, 11, 6, + 64, 8, 138, 718, 122, 138, 67, 138, 200, 201, + 202, 203, 204, 205, 10, 11, 136, 458, 459, 137, + 461, 462, 463, 464, 118, 473, 473, 493, 10, 11, + 124, 110, 239, 86, 500, 501, 502, 503, 504, 505, + 127, 248, 136, 137, 110, 479, 480, 4, 136, 102, + 110, 110, 554, 10, 11, 6, 117, 8, 119, 120, + 121, 122, 123, 136, 125, 126, 127, 508, 466, 535, + 6, 84, 8, 134, 135, 331, 523, 138, 139, 335, + 131, 121, 118, 127, 236, 119, 182, 136, 152, 153, + 154, 155, 118, 81, 82, 121, 84, 85, 86, 540, + 118, 89, 358, 671, 121, 93, 138, 277, 556, 556, + 98, 99, 510, 101, 102, 236, 104, 105, 239, 468, + 622, 136, 118, 691, 316, 186, 190, 248, 192, 690, + 571, 138, 10, 11, 12, 119, 118, 344, 16, 200, + 201, 202, 203, 204, 205, 209, 544, 208, 863, 119, + 136, 62, 119, 250, 138, 31, 412, 236, 118, 136, + 239, 121, 73, 74, 136, 667, 119, 228, 138, 248, + 236, 138, 119, 239, 136, 31, 236, 236, 56, 239, + 239, 136, 248, 94, 119, 138, 31, 136, 248, 248, + 119, 138, 103, 659, 10, 11, 12, 136, 632, 136, + 16, 121, 636, 138, 638, 119, 640, 641, 642, 138, + 676, 136, 31, 136, 119, 121, 277, 121, 129, 136, + 131, 132, 119, 344, 138, 213, 136, 483, 119, 217, + 486, 435, 947, 138, 112, 439, 440, 441, 442, 443, + 56, 138, 138, 690, 26, 12, 131, 138, 126, 16, + 137, 119, 121, 131, 122, 316, 10, 11, 355, 135, + 136, 137, 323, 137, 138, 344, 330, 136, 137, 138, + 331, 332, 88, 671, 335, 723, 723, 343, 344, 135, + 136, 137, 343, 121, 344, 344, 131, 132, 133, 56, + 135, 136, 137, 136, 137, 356, 112, 358, 10, 11, + 12, 1016, 136, 137, 16, 1020, 89, 90, 91, 121, + 126, 222, 131, 132, 133, 131, 135, 136, 137, 118, + 136, 120, 121, 122, 136, 137, 138, 110, 110, 10, + 241, 10, 429, 952, 902, 432, 127, 136, 495, 10, + 251, 121, 253, 547, 56, 112, 118, 119, 1063, 260, + 261, 412, 418, 1068, 118, 136, 136, 137, 138, 126, + 136, 137, 423, 2, 131, 136, 119, 1082, 429, 136, + 120, 432, 138, 469, 435, 471, 473, 1092, 439, 440, + 441, 442, 443, 10, 11, 137, 138, 118, 449, 120, + 121, 122, 562, 138, 455, 138, 35, 36, 37, 38, + 112, 40, 138, 138, 468, 466, 115, 116, 117, 138, + 858, 858, 473, 324, 126, 89, 90, 91, 138, 131, + 128, 518, 483, 138, 136, 486, 523, 138, 55, 128, + 496, 999, 493, 138, 530, 901, 530, 138, 138, 500, + 501, 502, 503, 504, 505, 506, 138, 138, 138, 510, + 139, 362, 121, 118, 236, 521, 666, 239, 899, 556, + 119, 119, 521, 119, 136, 138, 248, 118, 136, 136, + 136, 141, 118, 100, 535, 119, 10, 10, 10, 106, + 107, 128, 119, 544, 139, 120, 547, 136, 131, 131, + 120, 131, 137, 554, 119, 556, 944, 944, 119, 122, + 122, 562, 943, 31, 565, 131, 417, 495, 419, 127, + 127, 139, 136, 119, 962, 962, 136, 10, 119, 138, + 10, 120, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 138, 183, 10, 11, 138, 187, 141, + 138, 10, 10, 137, 31, 996, 119, 136, 652, 56, + 654, 622, 344, 138, 4, 1013, 1013, 478, 479, 480, + 118, 136, 120, 121, 122, 119, 138, 141, 675, 139, + 674, 138, 141, 677, 139, 138, 680, 681, 136, 137, + 55, 138, 653, 690, 136, 136, 235, 127, 659, 136, + 127, 129, 130, 131, 132, 133, 667, 135, 136, 137, + 671, 119, 141, 1061, 1061, 676, 138, 713, 3, 4, + 5, 6, 128, 8, 9, 10, 723, 688, 138, 128, + 691, 136, 120, 10, 138, 100, 138, 120, 120, 139, + 138, 106, 107, 138, 136, 110, 119, 286, 287, 136, + 561, 136, 129, 130, 131, 132, 133, 718, 135, 136, + 137, 46, 723, 138, 138, 128, 138, 138, 128, 138, + 10, 138, 136, 120, 136, 561, 221, 62, 888, 889, + 890, 891, 138, 893, 323, 70, 138, 860, 943, 996, + 899, 495, 418, 10, 11, 496, 478, 479, 480, 21, + 22, 239, 87, 653, 521, 484, 560, 821, 619, 31, + -1, 96, -1, -1, 99, 354, -1, -1, 103, -1, + 631, 632, 633, -1, 363, 636, -1, 638, -1, 640, + 641, 642, -1, -1, 904, -1, -1, -1, 55, 521, + -1, 126, 10, 11, -1, 130, 131, -1, -1, 134, + 389, 136, -1, -1, -1, 140, -1, -1, -1, -1, + 821, 858, -1, -1, 974, 975, 976, 977, 978, 979, + 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, + 990, 991, 992, 100, -1, -1, -1, 55, -1, 106, + 107, -1, -1, 110, -1, -1, 892, 858, 892, -1, + -1, -1, 863, -1, -1, -1, -1, 129, 130, 131, + 132, 133, -1, 135, 136, 137, 455, -1, -1, -1, + 1030, 17, 18, 19, 20, 21, 22, -1, -1, -1, + -1, -1, 100, -1, -1, 31, -1, 476, 106, 107, + 901, 902, 110, 904, -1, -1, -1, 944, -1, -1, + 632, -1, -1, -1, 636, -1, 638, -1, 640, 641, + 642, -1, -1, -1, 1074, 962, -1, -1, -1, 963, + 964, 965, 966, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 944, -1, -1, 947, -1, 527, 528, + 529, 952, 531, -1, -1, -1, -1, 993, -1, -1, + -1, 962, 15, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, 554, 1013, -1, 31, -1, + -1, -1, -1, -1, -1, -1, 565, -1, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 999, 135, + 136, 137, -1, -1, -1, -1, 888, 889, 890, 891, + -1, 893, 1013, -1, -1, 1016, -1, -1, -1, 1020, + 1056, -1, 1058, -1, 1061, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 119, -1, -1, 122, -1, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, -1, - 136, 137, -1, -1, 140, -1, 1026, -1, -1, -1, + -1, 620, -1, 622, -1, -1, -1, -1, -1, -1, + 1086, 1087, 15, 16, 17, 18, 19, 20, 21, 22, + 1061, -1, 1063, -1, -1, -1, 119, 1068, 31, -1, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 1082, 135, 136, 137, 138, -1, -1, 667, -1, + -1, 1092, 974, 975, 976, 977, 978, 979, 980, 981, + 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, + 992, -1, -1, 692, 693, 694, 695, 696, 697, 698, + 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, + 709, 710, 711, 712, -1, 714, 3, 4, 5, 6, + -1, 8, 9, 10, 11, -1, -1, 14, 1030, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, -1, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, -1, -1, -1, -1, -1, - 1070, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, -1, 65, -1, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, - -1, -1, -1, 83, 84, 85, -1, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, -1, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, -1, -1, -1, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, -1, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, -1, -1, -1, -1, -1, -1, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, -1, -1, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, -1, 65, -1, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, - -1, -1, 83, 84, 85, -1, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, -1, -1, -1, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, -1, 140, - 141, 3, 4, 5, 6, -1, 8, 9, 10, 11, - -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, -1, 135, 136, 137, -1, -1, -1, 141, 46, + 47, -1, -1, 50, -1, 52, 53, 54, 55, 56, + -1, 58, 1074, -1, 61, 62, -1, -1, 65, -1, + -1, -1, -1, 70, 71, -1, -1, -1, 1059, -1, + 77, 78, 79, -1, -1, -1, -1, -1, 85, -1, + 87, -1, -1, -1, -1, 92, -1, 94, 95, 96, + -1, -1, 99, 100, -1, -1, 103, -1, -1, 106, + 107, 108, -1, -1, 111, -1, 113, 3, 4, 5, + 6, -1, 8, 9, 10, 11, -1, -1, 14, 126, + -1, -1, -1, 130, -1, -1, -1, 134, -1, 136, + -1, 850, -1, 140, -1, -1, -1, 15, 16, 17, + 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, + 46, 47, -1, 31, 50, -1, 52, 53, 54, 55, + 56, -1, 58, -1, -1, 61, 62, -1, -1, 65, + -1, -1, -1, -1, 70, 71, -1, -1, -1, -1, + -1, 77, 78, 79, -1, -1, -1, -1, 907, 85, + -1, 87, -1, -1, -1, 914, 92, -1, 94, 95, + 96, -1, -1, 99, 100, -1, -1, 103, -1, -1, + 106, 107, 108, -1, -1, 111, -1, 113, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 126, -1, -1, 952, 130, -1, -1, -1, 134, -1, + 136, -1, -1, -1, 140, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, + -1, -1, -1, 141, -1, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 994, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, -1, -1, -1, + 1009, -1, -1, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + -1, -1, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, -1, 65, -1, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, -1, -1, -1, -1, 83, 84, 85, -1, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, -1, -1, -1, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, -1, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, -1, -1, -1, -1, + -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, -1, 65, -1, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + -1, -1, -1, -1, 83, 84, 85, -1, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, -1, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, -1, -1, -1, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + -1, 140, 141, 3, 4, 5, 6, -1, 8, 9, + 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 15, 16, 17, 18, 19, 20, 21, 22, -1, - -1, -1, -1, -1, 46, 47, -1, 31, 50, -1, - 52, 53, 54, 55, 56, 1055, 58, -1, -1, 61, - 62, -1, -1, 65, -1, -1, -1, -1, 70, 71, - -1, -1, -1, -1, -1, 77, 78, 79, -1, -1, - -1, -1, -1, 85, -1, 87, -1, -1, -1, -1, - 92, -1, 94, 95, 96, -1, -1, 99, 100, -1, - -1, 103, -1, -1, 106, 107, 108, -1, -1, 111, - -1, 113, 3, 4, 5, 6, -1, 8, 9, 10, - 11, -1, -1, 14, 126, -1, -1, -1, 130, -1, - -1, -1, 134, -1, 136, -1, -1, -1, 140, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - -1, 135, 136, 137, -1, 46, 47, 141, -1, 50, - -1, 52, 53, 54, 55, 56, -1, 58, -1, -1, - 61, 62, -1, -1, 65, -1, -1, -1, -1, 70, - 71, -1, -1, -1, -1, -1, 77, 78, 79, -1, - -1, -1, -1, -1, 85, -1, 87, -1, -1, -1, - -1, 92, -1, 94, 95, 96, -1, -1, 99, 100, - -1, -1, 103, -1, -1, 106, 107, 108, -1, -1, - 111, -1, 113, 3, 4, 5, 6, -1, 8, 9, - 10, 11, -1, -1, -1, 126, -1, -1, -1, 130, - -1, -1, -1, 134, -1, 136, -1, -1, -1, 140, -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, 46, 47, -1, 31, 50, -1, 52, 53, 54, 55, 56, -1, 58, -1, @@ -2349,15 +2349,15 @@ static const yytype_int16 yycheck[] = -1, 140, 17, 18, 19, 20, 21, 22, -1, -1, -1, 50, -1, 52, 53, 54, 31, -1, 46, -1, -1, -1, 50, -1, 52, 53, 54, -1, -1, -1, - -1, -1, -1, 61, 62, -1, -1, -1, 77, 78, + -1, 59, 60, 61, 62, -1, -1, -1, 77, 78, 79, -1, 70, 71, -1, -1, -1, -1, -1, 77, 78, -1, -1, -1, -1, 94, 95, 85, -1, 87, -1, -1, -1, -1, -1, -1, 94, 95, 96, 108, -1, 99, -1, -1, 113, 103, 3, 4, 5, 6, - 108, 8, 9, 10, 11, 113, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 136, 126, -1, - -1, -1, 130, 131, -1, -1, 134, -1, 136, -1, - 138, 126, 140, -1, 129, 130, 131, 132, 133, 46, + 108, 8, 9, 10, 11, 113, 21, 22, -1, -1, + 118, -1, -1, -1, -1, -1, 31, 136, 126, -1, + -1, -1, 130, 131, -1, -1, 134, -1, 136, 124, + 125, 126, 140, -1, 129, 130, 131, 132, 133, 46, 135, 136, 137, 50, -1, 52, 53, 54, -1, -1, -1, -1, -1, -1, 61, 62, -1, -1, -1, -1, -1, -1, -1, 70, 71, -1, -1, -1, -1, -1, @@ -2365,9 +2365,9 @@ static const yytype_int16 yycheck[] = 87, -1, -1, -1, -1, -1, -1, 94, 95, 96, -1, -1, 99, -1, -1, -1, 103, 3, 4, 5, 6, 108, 8, 9, 10, 11, 113, -1, -1, -1, - -1, 118, -1, -1, -1, -1, -1, -1, -1, 126, - -1, -1, -1, 130, 131, -1, -1, 134, -1, 136, - -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 129, 130, 131, 132, 133, 126, + 135, 136, 137, 130, 131, -1, -1, 134, -1, 136, + -1, 138, -1, 140, -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, 50, -1, 52, 53, 54, -1, -1, -1, -1, -1, -1, 61, 62, -1, -1, -1, -1, -1, -1, -1, 70, 71, -1, -1, -1, -1, @@ -2405,155 +2405,149 @@ static const yytype_int16 yycheck[] = -1, -1, 85, -1, 87, -1, -1, -1, -1, -1, -1, 94, 95, 96, -1, -1, 99, -1, -1, -1, 103, 3, 4, 5, 6, 108, 8, 9, 10, 11, - 113, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 113, -1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, -1, -1, -1, 130, 131, -1, - -1, 134, -1, 136, -1, 138, -1, 140, -1, 49, - -1, -1, -1, -1, 46, -1, -1, 57, 50, -1, - 52, 53, 54, -1, -1, -1, 66, 67, 68, 61, - 62, -1, 49, -1, -1, -1, 76, -1, 70, 71, - 57, -1, -1, 83, 84, 77, 78, -1, 0, 66, - 67, 68, 92, 85, -1, 87, -1, 97, -1, 76, - -1, -1, 94, 95, 96, -1, 83, 99, -1, -1, - 110, 103, 112, -1, -1, 92, 108, -1, -1, -1, - 97, 113, -1, -1, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 110, 126, 112, 48, 49, 130, 131, - 31, -1, 134, -1, 136, 57, -1, -1, 140, -1, - 127, -1, 64, -1, 66, 67, 68, 69, -1, -1, - 72, -1, -1, -1, 76, -1, -1, -1, 80, 81, - 82, 83, 84, -1, -1, -1, -1, 89, 90, 91, - 92, -1, -1, -1, -1, 97, 98, -1, -1, 101, - -1, -1, -1, 105, -1, -1, -1, 109, 110, -1, - 112, -1, -1, -1, -1, -1, -1, -1, 120, -1, - -1, 10, 11, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, -1, 135, 136, 137, -1, 47, -1, - 141, 50, -1, 52, 53, 54, 55, 56, -1, 58, - -1, -1, 61, -1, -1, -1, 65, -1, -1, -1, - -1, -1, 71, -1, -1, -1, -1, -1, 77, 78, - 79, 10, 11, -1, -1, -1, -1, -1, -1, 88, - -1, -1, -1, -1, -1, 94, 95, -1, -1, -1, - -1, 100, -1, -1, -1, -1, -1, 106, 107, 108, - -1, -1, 111, -1, 113, -1, -1, -1, 47, 118, - -1, 50, -1, 52, 53, 54, 55, 56, -1, 58, - -1, -1, 61, -1, -1, 134, 65, -1, -1, -1, - -1, -1, 71, 10, 11, -1, -1, -1, 77, 78, - 79, -1, -1, -1, -1, -1, -1, -1, -1, 88, - -1, -1, -1, -1, -1, 94, 95, -1, -1, -1, - -1, 100, -1, -1, -1, -1, -1, 106, 107, 108, - 47, -1, 111, 50, 113, 52, 53, 54, 55, 56, - -1, 58, -1, -1, 61, -1, -1, -1, 65, -1, - -1, -1, -1, -1, 71, 134, -1, -1, -1, -1, - 77, 78, 79, 15, 16, 17, 18, 19, 20, 21, - 22, 88, -1, -1, -1, -1, -1, 94, 95, 31, - -1, -1, -1, 100, -1, -1, -1, -1, -1, 106, - 107, 108, -1, -1, 111, -1, 113, 15, 16, 17, - 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, 31, -1, -1, -1, 134, 15, 16, - 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, -1, 31, -1, 15, 16, 17, 18, - 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, 31, -1, 15, 16, 17, 18, 19, 20, - 21, 22, -1, -1, -1, -1, -1, 119, -1, -1, - 31, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, -1, 135, 136, 137, 138, 15, 16, 17, - 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, 31, -1, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, - 138, -1, -1, -1, -1, -1, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, -1, 135, 136, - 137, 138, 121, -1, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, -1, 135, 136, 137, 120, - -1, -1, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, -1, 135, 136, 137, 15, 16, 17, - 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, 119, -1, 31, -1, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, + -1, 134, -1, 136, -1, 138, -1, 140, -1, -1, + -1, -1, -1, -1, 46, -1, -1, -1, 50, -1, + 52, 53, 54, -1, -1, 49, -1, -1, -1, 61, + 62, -1, -1, 57, -1, -1, -1, -1, 70, 71, + -1, -1, 66, 67, 68, 77, 78, -1, -1, -1, + -1, -1, 76, 85, -1, 87, -1, -1, -1, 83, + -1, -1, 94, 95, 96, -1, -1, 99, 92, -1, + -1, 103, -1, 97, -1, -1, 108, -1, -1, -1, + -1, 113, -1, -1, -1, -1, 110, -1, 112, -1, + -1, -1, 0, -1, 126, -1, -1, -1, 130, 131, + 6, -1, 134, -1, 136, -1, -1, -1, 140, 15, + 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, + -1, -1, -1, -1, -1, 31, -1, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, -1, + 48, 49, -1, -1, -1, -1, -1, -1, -1, 57, + -1, -1, -1, -1, 60, -1, 64, -1, 66, 67, + 68, 69, -1, -1, 72, -1, -1, -1, 76, -1, + -1, -1, 80, 81, 82, 83, 84, -1, -1, 85, + -1, 89, 90, 91, 92, -1, -1, -1, -1, 97, + 98, -1, -1, 101, -1, 10, 11, 105, -1, -1, + -1, 109, 110, -1, 112, -1, -1, -1, -1, -1, + -1, -1, 120, 119, -1, -1, 122, -1, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, -1, + 136, 137, 47, -1, 140, 50, -1, 52, 53, 54, + 55, 56, -1, 58, -1, -1, 61, -1, -1, -1, + 65, -1, -1, -1, -1, -1, 71, -1, -1, -1, + -1, -1, 77, 78, 79, 10, 11, -1, -1, -1, + -1, -1, -1, 88, -1, -1, -1, -1, -1, 94, + 95, -1, -1, -1, -1, 100, -1, -1, -1, -1, + -1, 106, 107, 108, -1, -1, 111, -1, 113, -1, + -1, -1, 47, 118, -1, 50, -1, 52, 53, 54, + 55, 56, -1, 58, -1, -1, 61, -1, -1, 134, + 65, -1, -1, -1, -1, -1, 71, 10, 11, -1, + -1, -1, 77, 78, 79, -1, -1, -1, -1, -1, + -1, -1, -1, 88, -1, -1, -1, -1, -1, 94, + 95, -1, -1, -1, -1, 100, -1, -1, -1, -1, + -1, 106, 107, 108, 47, -1, 111, 50, 113, 52, + 53, 54, 55, 56, -1, 58, -1, -1, 61, -1, + -1, -1, 65, -1, -1, -1, -1, -1, 71, 134, + -1, -1, -1, -1, 77, 78, 79, 15, 16, 17, + 18, 19, 20, 21, 22, 88, -1, -1, -1, -1, + -1, 94, 95, 31, -1, -1, -1, 100, -1, -1, + -1, -1, -1, 106, 107, 108, -1, -1, 111, -1, + 113, 15, 16, 17, 18, 19, 20, 21, 22, -1, + -1, -1, -1, -1, -1, -1, -1, 31, -1, -1, + -1, 134, 15, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, 31, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, 31, 15, 16, 17, 18, 19, 20, + -1, -1, -1, 31, -1, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, + 138, 15, 16, 17, 18, 19, 20, 21, 22, -1, + -1, -1, -1, -1, -1, -1, -1, 31, -1, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + -1, 135, 136, 137, 138, -1, -1, -1, 121, -1, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, -1, 135, 136, 137, 120, -1, -1, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, -1, + 135, 136, 137, 121, -1, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, + 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, + -1, -1, -1, -1, -1, 119, 31, -1, -1, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + -1, 135, 136, 137, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, 31, 15, 16, 17, 18, 19, 20, 21, 22, -1, - -1, -1, -1, -1, -1, -1, -1, 31, -1, -1, - -1, -1, -1, 121, -1, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, -1, -1, 31, -1, -1, 123, 124, + -1, -1, -1, -1, -1, -1, -1, 31, 15, 16, + 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, + -1, -1, -1, -1, 31, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, + 31, -1, -1, -1, -1, -1, -1, -1, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, -1, - 135, 136, 137, -1, -1, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, - 121, -1, 123, 124, 125, 126, -1, -1, 129, 130, - 131, 132, 133, -1, 135, 136, 137, -1, -1, 123, - 124, 125, 126, -1, -1, 129, 130, 131, 132, 133, - -1, 135, 136, 137, 17, 18, 19, 20, 21, 22, + 135, 136, 137, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, - -1, 50, -1, 52, 53, 54, -1, -1, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, -1, 135, - 136, 137, 17, 18, 19, 20, 21, 22, 77, 78, - 79, -1, -1, -1, -1, -1, 31, 17, 18, 19, - 20, 21, 22, -1, -1, 94, 95, -1, -1, -1, - -1, 31, 17, 18, 19, 20, 21, 22, -1, 108, - -1, -1, -1, -1, 113, -1, 31, 17, 18, 19, + -1, -1, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, -1, 135, 136, 137, 121, -1, 123, + 124, 125, 126, -1, -1, 129, 130, 131, 132, 133, + -1, 135, 136, 137, -1, -1, 123, 124, 125, 126, + -1, -1, 129, 130, 131, 132, 133, -1, 135, 136, + 137, -1, -1, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, -1, 135, 136, 137, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, - -1, 31, -1, -1, -1, -1, -1, 136, -1, -1, - -1, 124, 125, 126, 127, 128, 129, 130, 131, 132, + -1, 31, -1, -1, 50, -1, 52, 53, 54, -1, + -1, 124, 125, 126, -1, -1, 129, 130, 131, 132, 133, -1, 135, 136, 137, 17, 18, 19, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, -1, 31, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 125, 126, 127, 128, 129, 130, 131, 132, 133, -1, - 135, 136, 137, -1, -1, -1, 126, 127, 128, 129, - 130, 131, 132, 133, -1, 135, 136, 137, -1, 124, - 125, 126, -1, -1, 129, 130, 131, 132, 133, -1, - 135, 136, 137, -1, -1, -1, -1, 127, 128, 129, + 22, 77, 78, 79, -1, -1, -1, -1, -1, 31, + 17, 18, 19, 20, 21, 22, -1, -1, 94, 95, + -1, -1, -1, -1, 31, 17, 18, 19, 20, 21, + 22, -1, 108, -1, -1, -1, -1, 113, -1, 31, + 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, + -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, + 136, -1, -1, -1, -1, 125, 126, 127, 128, 129, 130, 131, 132, 133, -1, 135, 136, 137, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, 31, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 125, 126, 31, -1, 129, 130, 131, - 132, 133, -1, 135, 136, 137, 19, 20, 21, 22, - -1, -1, -1, 48, 49, -1, -1, -1, 31, -1, - -1, -1, 57, -1, -1, -1, -1, -1, -1, 64, - -1, 66, 67, 68, 69, -1, -1, 72, -1, -1, - -1, 76, -1, -1, -1, 80, 81, 82, 83, 84, - -1, -1, -1, -1, 89, 90, 91, 92, -1, -1, - -1, -1, 97, 98, -1, -1, 101, -1, -1, -1, - 105, -1, -1, -1, 109, 110, -1, 112, -1, -1, - 129, 130, 131, 132, 133, 120, 135, 136, 137, 10, - 11, 127, 128, 129, 130, 131, 132, 133, -1, 135, - 136, 137, -1, -1, 139, -1, -1, -1, -1, 10, - 11, -1, -1, -1, -1, -1, 129, 130, 131, 132, - 133, -1, 135, 136, 137, -1, 47, -1, -1, 50, - -1, 52, 53, 54, 55, -1, -1, 58, -1, 50, - 61, 52, 53, 54, 65, -1, -1, -1, -1, 50, + -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, + 19, 20, 21, 22, 126, 127, 128, 129, 130, 131, + 132, 133, 31, 135, 136, 137, -1, -1, -1, -1, + 127, 128, 129, 130, 131, 132, 133, -1, 135, 136, + 137, -1, -1, 125, 126, -1, -1, 129, 130, 131, + 132, 133, -1, 135, 136, 137, -1, -1, -1, 126, + -1, -1, 129, 130, 131, 132, 133, -1, 135, 136, + 137, 19, 20, 21, 22, -1, -1, -1, -1, -1, + -1, -1, -1, 31, -1, -1, -1, 50, -1, 52, + 53, 54, -1, -1, -1, -1, -1, -1, -1, -1, + 129, 130, 131, 132, 133, -1, 135, 136, 137, 10, + 11, -1, -1, -1, 77, 78, 79, -1, 127, 128, + 129, 130, 131, 132, 133, -1, 135, 136, 137, 10, + 11, 94, 95, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 108, 47, -1, -1, 50, + 113, 52, 53, 54, 55, -1, -1, 58, -1, -1, + 61, -1, -1, -1, 65, -1, -1, -1, -1, 50, 71, 52, 53, 54, 55, 56, 77, 78, 79, -1, - 61, -1, -1, -1, -1, -1, 77, 78, 79, -1, + 61, 129, 130, 131, 132, 133, -1, 135, 136, 137, 71, 10, 11, 94, 95, -1, 77, 78, 79, 100, - -1, -1, -1, 94, 95, 106, 107, 108, -1, -1, - 111, -1, 113, 94, 95, -1, -1, 108, -1, -1, - -1, -1, 113, -1, -1, 106, -1, 108, -1, -1, + -1, -1, -1, -1, -1, 106, 107, 108, -1, -1, + 111, -1, 113, 94, 95, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 106, -1, 108, -1, -1, 111, 50, 113, 52, 53, 54, -1, -1, -1, -1, - -1, 11, 61, -1, -1, 136, -1, -1, -1, -1, + -1, 11, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, -1, -1, -1, -1, -1, 77, 78, 79, -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, 52, 53, 54, -1, 94, 95, 47, -1, -1, 50, -1, 52, 53, 54, 55, 56, -1, 58, 108, - 71, 61, 111, -1, 113, 65, 77, 78, 79, -1, + -1, 61, 111, -1, 113, 65, 77, 78, 79, -1, -1, 71, -1, 11, -1, -1, -1, 77, 78, 79, -1, -1, -1, 94, 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, 95, -1, 108, -1, -1, 100, 50, 113, 52, 53, 54, 106, 107, 108, 47, -1, 111, 50, 113, 52, 53, 54, 55, 56, -1, - 58, -1, -1, 61, -1, -1, -1, 65, 77, 78, + 58, -1, 71, 61, 11, 136, -1, 65, 77, 78, 79, -1, -1, 71, -1, 11, -1, -1, -1, 77, 78, 79, -1, -1, -1, 94, 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, 94, 95, -1, 108, - -1, -1, 100, -1, 113, -1, -1, -1, 106, 107, + -1, -1, 100, 50, 113, 52, 53, 54, 106, 107, 108, 47, -1, 111, 50, 113, 52, 53, 54, 55, -1, -1, 58, -1, -1, 61, -1, -1, -1, 65, - -1, -1, -1, -1, -1, 71, -1, 11, -1, -1, - -1, 77, 78, 79, -1, -1, -1, -1, -1, -1, + 77, 78, 79, -1, -1, 71, -1, 11, -1, -1, + -1, 77, 78, 79, -1, -1, -1, 94, 95, -1, -1, -1, -1, -1, -1, -1, 92, 11, 94, 95, - -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, + -1, 108, -1, -1, 100, -1, 113, -1, -1, -1, 106, 107, 108, 47, -1, 111, 50, 113, 52, 53, 54, 55, -1, -1, 58, -1, -1, 61, -1, -1, -1, 65, -1, -1, -1, -1, 50, 71, 52, 53, @@ -2598,23 +2592,34 @@ static const yytype_int16 yycheck[] = -1, -1, -1, 64, -1, 66, 67, 68, 69, -1, -1, 72, -1, 139, -1, 76, -1, -1, -1, 80, 81, 82, 83, 84, -1, -1, -1, -1, 89, 90, - 91, 92, -1, -1, -1, -1, 97, 98, -1, 50, - 101, 52, 53, 54, 105, -1, -1, -1, 109, 110, - 61, 112, -1, -1, -1, -1, -1, -1, -1, 120, - 71, -1, -1, -1, -1, -1, 77, 78, 79, -1, - -1, 48, 49, -1, -1, -1, -1, -1, 139, -1, - 57, -1, -1, 94, 95, -1, -1, 64, -1, 66, - 67, 68, 69, -1, -1, 72, -1, 108, -1, 76, - -1, -1, 113, 80, 81, 82, 83, 84, -1, -1, - -1, -1, 89, 90, 91, 92, -1, -1, -1, -1, - 97, 98, -1, -1, 101, 136, -1, 50, 105, 52, - 53, 54, 109, 110, 49, 112, -1, -1, 61, -1, - -1, -1, 57, -1, -1, -1, -1, -1, 71, -1, - -1, 66, 67, 68, 77, 78, 79, 49, -1, -1, - -1, 76, -1, -1, -1, 57, -1, -1, 83, -1, - -1, 94, 95, -1, 66, 67, 68, 92, -1, -1, - -1, -1, 97, -1, 76, 108, 101, -1, -1, -1, - 113, 83, -1, -1, -1, 110, -1, 112, -1, -1, + 91, 92, -1, -1, -1, -1, 97, 98, -1, -1, + 101, -1, -1, -1, 105, -1, -1, -1, 109, 110, + -1, 112, 48, 49, -1, -1, -1, -1, -1, 120, + -1, 57, -1, -1, -1, -1, -1, -1, 64, -1, + 66, 67, 68, 69, -1, -1, 72, -1, 139, -1, + 76, -1, -1, -1, 80, 81, 82, 83, 84, -1, + -1, -1, -1, 89, 90, 91, 92, -1, -1, -1, + -1, 97, 98, -1, 50, 101, 52, 53, 54, 105, + 49, -1, -1, 109, 110, 61, 112, -1, 57, -1, + -1, -1, -1, -1, 120, 71, -1, 66, 67, 68, + -1, 77, 78, 79, -1, -1, -1, 76, -1, -1, + -1, -1, -1, 139, 83, -1, -1, -1, 94, 95, + -1, -1, -1, 92, -1, -1, -1, -1, 97, 48, + 49, -1, 108, -1, -1, -1, -1, 113, 57, -1, + -1, 110, -1, 112, -1, 64, -1, 66, 67, 68, + 69, -1, -1, 72, -1, -1, -1, 76, 127, -1, + 136, 80, 81, 82, 83, 84, -1, -1, -1, -1, + 89, 90, 91, 92, -1, -1, -1, -1, 97, 98, + -1, 50, 101, 52, 53, 54, 105, 49, -1, -1, + 109, 110, 61, 112, -1, 57, -1, -1, -1, -1, + -1, -1, 71, -1, 66, 67, 68, -1, 77, 78, + 79, -1, -1, -1, 76, 49, -1, -1, -1, -1, + -1, 83, 84, 57, -1, 94, 95, -1, -1, -1, + 92, -1, 66, 67, 68, 97, -1, 49, -1, 108, + -1, -1, 76, -1, 113, 57, -1, -1, 110, 83, + 112, -1, -1, -1, 66, 67, 68, -1, 92, -1, + -1, -1, -1, 97, 76, -1, -1, 101, -1, -1, + -1, 83, -1, -1, -1, -1, 110, -1, 112, -1, 92, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 110, -1, 112 @@ -2669,71 +2674,72 @@ static const yytype_uint8 yystos[] = 177, 178, 179, 180, 217, 236, 197, 187, 160, 165, 12, 131, 166, 156, 229, 194, 10, 11, 12, 16, 56, 112, 126, 131, 191, 236, 144, 136, 221, 222, - 145, 146, 234, 118, 229, 12, 16, 56, 88, 112, - 126, 131, 136, 157, 181, 234, 121, 136, 138, 136, - 229, 136, 141, 119, 122, 139, 89, 90, 91, 110, - 205, 118, 119, 139, 215, 10, 10, 10, 144, 235, - 234, 180, 234, 128, 119, 10, 11, 12, 16, 56, - 112, 126, 131, 136, 192, 236, 161, 162, 181, 3, - 4, 5, 9, 10, 14, 46, 56, 62, 70, 85, - 87, 92, 96, 99, 103, 126, 130, 134, 136, 140, - 183, 184, 190, 194, 231, 232, 235, 236, 131, 181, - 183, 158, 181, 138, 191, 131, 191, 191, 191, 191, - 191, 136, 137, 139, 167, 139, 223, 236, 118, 119, - 136, 118, 188, 189, 229, 236, 120, 131, 181, 181, - 6, 15, 16, 17, 18, 19, 20, 21, 22, 31, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 60, 85, 119, 122, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 136, 137, 140, - 173, 181, 181, 181, 181, 121, 122, 136, 137, 186, - 187, 236, 208, 227, 227, 183, 229, 106, 110, 212, - 233, 234, 110, 233, 110, 233, 89, 90, 91, 144, - 205, 144, 119, 138, 119, 119, 139, 138, 122, 192, - 122, 153, 174, 175, 179, 131, 192, 192, 192, 192, - 192, 192, 122, 137, 185, 236, 163, 181, 186, 187, - 136, 92, 194, 127, 196, 190, 136, 127, 229, 229, - 229, 198, 227, 229, 138, 14, 119, 192, 15, 16, - 17, 18, 19, 20, 21, 22, 31, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, - 137, 181, 121, 138, 138, 186, 187, 136, 191, 170, - 225, 183, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 83, 84, 85, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 140, 141, - 224, 221, 146, 226, 188, 139, 119, 181, 10, 138, - 141, 138, 4, 229, 182, 225, 119, 138, 138, 138, - 119, 234, 233, 234, 233, 233, 233, 233, 233, 139, - 139, 10, 120, 10, 10, 198, 185, 198, 192, 138, - 46, 62, 96, 99, 126, 130, 131, 134, 136, 140, - 228, 230, 225, 186, 187, 119, 198, 194, 192, 198, - 136, 198, 198, 138, 138, 56, 172, 236, 14, 190, - 122, 186, 229, 229, 229, 229, 229, 229, 229, 229, + 145, 146, 234, 59, 60, 118, 229, 12, 16, 56, + 88, 112, 126, 131, 136, 157, 181, 234, 121, 136, + 138, 136, 229, 136, 141, 119, 122, 139, 89, 90, + 91, 110, 205, 118, 119, 139, 215, 10, 10, 10, + 144, 235, 234, 180, 234, 128, 119, 10, 11, 12, + 16, 56, 112, 126, 131, 136, 192, 236, 161, 162, + 181, 3, 4, 5, 9, 10, 14, 46, 56, 62, + 70, 85, 87, 92, 96, 99, 103, 126, 130, 134, + 136, 140, 183, 184, 190, 194, 231, 232, 235, 236, + 131, 181, 183, 158, 181, 138, 191, 131, 191, 191, + 191, 191, 191, 136, 137, 139, 167, 139, 223, 236, + 118, 119, 136, 120, 120, 118, 188, 189, 229, 236, + 120, 131, 181, 181, 6, 15, 16, 17, 18, 19, + 20, 21, 22, 31, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 60, 85, 119, 122, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 136, 137, 140, 173, 181, 181, 181, 181, 121, + 122, 136, 137, 186, 187, 236, 208, 227, 227, 183, + 229, 106, 110, 212, 233, 234, 110, 233, 110, 233, + 89, 90, 91, 144, 205, 144, 119, 138, 119, 119, + 139, 138, 122, 192, 122, 153, 174, 175, 179, 131, + 192, 192, 192, 192, 192, 192, 122, 137, 185, 236, + 163, 181, 186, 187, 136, 92, 194, 127, 196, 190, + 136, 127, 229, 229, 229, 198, 227, 229, 138, 14, + 119, 192, 15, 16, 17, 18, 19, 20, 21, 22, + 31, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 135, 136, 137, 181, 121, 138, 138, 186, + 187, 136, 191, 170, 225, 183, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 65, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 83, 84, 85, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 140, 141, 224, 221, 146, 226, 188, 139, + 119, 181, 10, 138, 141, 138, 4, 229, 182, 225, + 119, 138, 138, 138, 119, 234, 233, 234, 233, 233, + 233, 233, 233, 139, 139, 10, 120, 10, 10, 198, + 185, 198, 192, 138, 46, 62, 96, 99, 126, 130, + 131, 134, 136, 140, 228, 230, 225, 186, 187, 119, + 198, 194, 192, 198, 136, 198, 198, 138, 138, 56, + 172, 236, 14, 190, 122, 186, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, - 229, 229, 229, 138, 227, 229, 138, 136, 172, 119, - 171, 183, 141, 138, 223, 139, 138, 139, 118, 229, - 183, 141, 157, 172, 138, 119, 138, 138, 136, 136, - 127, 136, 127, 228, 228, 228, 228, 198, 227, 228, - 15, 16, 17, 18, 19, 20, 21, 22, 31, 123, - 124, 125, 126, 129, 130, 131, 132, 133, 135, 136, - 137, 141, 119, 162, 138, 192, 186, 128, 226, 138, - 128, 229, 86, 102, 229, 121, 138, 141, 136, 168, - 158, 183, 138, 172, 139, 188, 138, 120, 10, 120, - 120, 183, 198, 198, 198, 198, 138, 138, 228, 228, + 229, 229, 229, 229, 229, 229, 229, 138, 227, 229, + 138, 136, 172, 119, 171, 183, 141, 138, 223, 139, + 138, 139, 118, 229, 183, 141, 157, 172, 138, 119, + 138, 138, 136, 136, 127, 136, 127, 228, 228, 228, + 228, 198, 227, 228, 15, 16, 17, 18, 19, 20, + 21, 22, 31, 123, 124, 125, 126, 129, 130, 131, + 132, 133, 135, 136, 137, 141, 119, 162, 138, 192, + 186, 128, 226, 138, 128, 229, 86, 102, 229, 121, + 138, 141, 136, 168, 158, 183, 138, 172, 139, 188, + 138, 120, 10, 120, 120, 183, 198, 198, 198, 198, + 138, 138, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, - 228, 228, 228, 228, 228, 228, 228, 138, 227, 229, - 163, 186, 136, 138, 136, 136, 229, 169, 183, 138, - 172, 139, 172, 119, 138, 138, 128, 138, 128, 228, - 121, 138, 141, 227, 227, 138, 234, 183, 138, 172, - 10, 172, 136, 136, 228, 138, 138, 138, 138, 172, - 138, 227, 227, 172, 120, 138, 138 + 228, 138, 227, 229, 163, 186, 136, 138, 136, 136, + 229, 169, 183, 138, 172, 139, 172, 119, 138, 138, + 128, 138, 128, 228, 121, 138, 141, 227, 227, 138, + 234, 183, 138, 172, 10, 172, 136, 136, 228, 138, + 138, 138, 138, 172, 138, 227, 227, 172, 120, 138, + 138 }; #define yyerrok (yyerrstatus = 0) @@ -5261,29 +5267,45 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1529 "dtool/src/cppparser/cppBison.yxx" { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_default()); +} + break; + + case 175: +/* Line 1792 of yacc.c */ +#line 1533 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_delete()); +} + break; + + case 176: +/* Line 1792 of yacc.c */ +#line 1537 "dtool/src/cppparser/cppBison.yxx" + { (yyval.u.expr) = (CPPExpression *)NULL; } break; - case 178: + case 180: /* Line 1792 of yacc.c */ -#line 1542 "dtool/src/cppparser/cppBison.yxx" +#line 1550 "dtool/src/cppparser/cppBison.yxx" { } break; - case 182: + case 184: /* Line 1792 of yacc.c */ -#line 1551 "dtool/src/cppparser/cppBison.yxx" +#line 1559 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.instance) = new CPPInstance((yyvsp[(1) - (3)].u.type), (yyvsp[(2) - (3)].u.inst_ident), 0, (yylsp[(2) - (3)]).file); (yyval.u.instance)->set_initializer((yyvsp[(3) - (3)].u.expr)); } break; - case 183: + case 185: /* Line 1792 of yacc.c */ -#line 1556 "dtool/src/cppparser/cppBison.yxx" +#line 1564 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(3) - (4)].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[(2) - (4)].u.type), (yyvsp[(3) - (4)].u.inst_ident), 0, (yylsp[(3) - (4)]).file); @@ -5291,9 +5313,9 @@ yyreduce: } break; - case 184: + case 186: /* Line 1792 of yacc.c */ -#line 1562 "dtool/src/cppparser/cppBison.yxx" +#line 1570 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(4) - (5)].u.inst_ident)->add_modifier(IIT_const); (yyval.u.instance) = new CPPInstance((yyvsp[(3) - (5)].u.type), (yyvsp[(4) - (5)].u.inst_ident), 0, (yylsp[(3) - (5)]).file); @@ -5301,17 +5323,17 @@ yyreduce: } break; - case 185: + case 187: /* Line 1792 of yacc.c */ -#line 1568 "dtool/src/cppparser/cppBison.yxx" +#line 1576 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.instance) = (yyvsp[(2) - (2)].u.instance); } break; - case 186: + case 188: /* Line 1792 of yacc.c */ -#line 1572 "dtool/src/cppparser/cppBison.yxx" +#line 1580 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_parameter)); @@ -5320,27 +5342,11 @@ yyreduce: } break; - case 187: -/* Line 1792 of yacc.c */ -#line 1582 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} - break; - - case 188: -/* Line 1792 of yacc.c */ -#line 1586 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); -} - break; - case 189: /* Line 1792 of yacc.c */ #line 1590 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } break; @@ -5348,78 +5354,78 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1594 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); } break; case 191: /* Line 1792 of yacc.c */ -#line 1599 "dtool/src/cppparser/cppBison.yxx" +#line 1598 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); +} + break; + + case 192: +/* Line 1792 of yacc.c */ +#line 1602 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} + break; + + case 193: +/* Line 1792 of yacc.c */ +#line 1607 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } break; - case 192: + case 194: /* Line 1792 of yacc.c */ -#line 1604 "dtool/src/cppparser/cppBison.yxx" +#line 1612 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } break; - case 193: + case 195: /* Line 1792 of yacc.c */ -#line 1609 "dtool/src/cppparser/cppBison.yxx" +#line 1617 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } break; - case 194: + case 196: /* Line 1792 of yacc.c */ -#line 1614 "dtool/src/cppparser/cppBison.yxx" +#line 1622 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } break; - case 195: + case 197: /* Line 1792 of yacc.c */ -#line 1619 "dtool/src/cppparser/cppBison.yxx" +#line 1627 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); } break; - case 196: -/* Line 1792 of yacc.c */ -#line 1624 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); -} - break; - - case 197: + case 198: /* Line 1792 of yacc.c */ #line 1632 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} - break; - - case 198: -/* Line 1792 of yacc.c */ -#line 1636 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); + (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); } break; @@ -5427,7 +5433,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1640 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } break; @@ -5435,68 +5441,84 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1644 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); } break; case 201: /* Line 1792 of yacc.c */ -#line 1649 "dtool/src/cppparser/cppBison.yxx" +#line 1648 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[(1) - (1)].u.identifier)); +} + break; + + case 202: +/* Line 1792 of yacc.c */ +#line 1652 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); + (yyval.u.inst_ident)->add_modifier(IIT_const); +} + break; + + case 203: +/* Line 1792 of yacc.c */ +#line 1657 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } break; - case 202: + case 204: /* Line 1792 of yacc.c */ -#line 1654 "dtool/src/cppparser/cppBison.yxx" +#line 1662 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } break; - case 203: + case 205: /* Line 1792 of yacc.c */ -#line 1659 "dtool/src/cppparser/cppBison.yxx" +#line 1667 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } break; - case 204: + case 206: /* Line 1792 of yacc.c */ -#line 1664 "dtool/src/cppparser/cppBison.yxx" +#line 1672 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } break; - case 205: + case 207: /* Line 1792 of yacc.c */ -#line 1669 "dtool/src/cppparser/cppBison.yxx" +#line 1677 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); } break; - case 206: + case 208: /* Line 1792 of yacc.c */ -#line 1674 "dtool/src/cppparser/cppBison.yxx" +#line 1682 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); } break; - case 207: + case 209: /* Line 1792 of yacc.c */ -#line 1679 "dtool/src/cppparser/cppBison.yxx" +#line 1687 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (7)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); @@ -5504,89 +5526,89 @@ yyreduce: } break; - case 208: + case 210: /* Line 1792 of yacc.c */ -#line 1685 "dtool/src/cppparser/cppBison.yxx" +#line 1693 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); } break; - case 209: + case 211: /* Line 1792 of yacc.c */ -#line 1693 "dtool/src/cppparser/cppBison.yxx" +#line 1701 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); } break; - case 210: + case 212: /* Line 1792 of yacc.c */ -#line 1697 "dtool/src/cppparser/cppBison.yxx" +#line 1705 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_const); } break; - case 211: + case 213: /* Line 1792 of yacc.c */ -#line 1702 "dtool/src/cppparser/cppBison.yxx" +#line 1710 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_volatile); } break; - case 212: + case 214: /* Line 1792 of yacc.c */ -#line 1707 "dtool/src/cppparser/cppBison.yxx" +#line 1715 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_pointer); } break; - case 213: + case 215: /* Line 1792 of yacc.c */ -#line 1712 "dtool/src/cppparser/cppBison.yxx" +#line 1720 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_reference); } break; - case 214: + case 216: /* Line 1792 of yacc.c */ -#line 1717 "dtool/src/cppparser/cppBison.yxx" +#line 1725 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (2)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_rvalue_reference); } break; - case 215: + case 217: /* Line 1792 of yacc.c */ -#line 1722 "dtool/src/cppparser/cppBison.yxx" +#line 1730 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(3) - (3)].u.inst_ident); (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[(1) - (3)].u.identifier)); } break; - case 216: + case 218: /* Line 1792 of yacc.c */ -#line 1727 "dtool/src/cppparser/cppBison.yxx" +#line 1735 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(1) - (4)].u.inst_ident); (yyval.u.inst_ident)->add_array_modifier((yyvsp[(3) - (4)].u.expr)); } break; - case 217: + case 219: /* Line 1792 of yacc.c */ -#line 1732 "dtool/src/cppparser/cppBison.yxx" +#line 1740 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.inst_ident) = (yyvsp[(2) - (7)].u.inst_ident); (yyval.u.inst_ident)->add_modifier(IIT_paren); @@ -5594,17 +5616,17 @@ yyreduce: } break; - case 218: + case 220: /* Line 1792 of yacc.c */ -#line 1741 "dtool/src/cppparser/cppBison.yxx" +#line 1749 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 219: + case 221: /* Line 1792 of yacc.c */ -#line 1745 "dtool/src/cppparser/cppBison.yxx" +#line 1753 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -5614,27 +5636,11 @@ yyreduce: } break; - case 220: -/* Line 1792 of yacc.c */ -#line 1753 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); -} - break; - - case 221: -/* Line 1792 of yacc.c */ -#line 1757 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); -} - break; - case 222: /* Line 1792 of yacc.c */ #line 1761 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); + (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; @@ -5642,7 +5648,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1765 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); } break; @@ -5650,6 +5656,22 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1769 "dtool/src/cppparser/cppBison.yxx" { + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); +} + break; + + case 225: +/* Line 1792 of yacc.c */ +#line 1773 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.enum_type)); +} + break; + + case 226: +/* Line 1792 of yacc.c */ +#line 1777 "dtool/src/cppparser/cppBison.yxx" + { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { (yyval.u.type) = type; @@ -5666,9 +5688,9 @@ yyreduce: } break; - case 225: + case 227: /* Line 1792 of yacc.c */ -#line 1785 "dtool/src/cppparser/cppBison.yxx" +#line 1793 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5686,9 +5708,9 @@ yyreduce: } break; - case 226: + case 228: /* Line 1792 of yacc.c */ -#line 1801 "dtool/src/cppparser/cppBison.yxx" +#line 1809 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = (yyvsp[(3) - (4)].u.expr)->determine_type(); if ((yyval.u.type) == (CPPType *)NULL) { @@ -5699,25 +5721,25 @@ yyreduce: } break; - case 227: + case 229: /* Line 1792 of yacc.c */ -#line 1810 "dtool/src/cppparser/cppBison.yxx" +#line 1818 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = new CPPSimpleType(CPPSimpleType::T_auto); } break; - case 228: + case 230: /* Line 1792 of yacc.c */ -#line 1817 "dtool/src/cppparser/cppBison.yxx" +#line 1825 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 229: + case 231: /* Line 1792 of yacc.c */ -#line 1821 "dtool/src/cppparser/cppBison.yxx" +#line 1829 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.decl) == NULL) { @@ -5727,27 +5749,11 @@ yyreduce: } break; - case 230: -/* Line 1792 of yacc.c */ -#line 1829 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); -} - break; - - case 231: -/* Line 1792 of yacc.c */ -#line 1833 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); -} - break; - case 232: /* Line 1792 of yacc.c */ #line 1837 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.struct_type))); + (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; @@ -5755,7 +5761,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1841 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.enum_type))); + (yyval.u.decl) = CPPType::new_type((yyvsp[(1) - (1)].u.struct_type)); } break; @@ -5763,6 +5769,22 @@ yyreduce: /* Line 1792 of yacc.c */ #line 1845 "dtool/src/cppparser/cppBison.yxx" { + (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.struct_type))); +} + break; + + case 235: +/* Line 1792 of yacc.c */ +#line 1849 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[(1) - (1)].u.enum_type))); +} + break; + + case 236: +/* Line 1792 of yacc.c */ +#line 1853 "dtool/src/cppparser/cppBison.yxx" + { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { (yyval.u.decl) = type; @@ -5779,9 +5801,9 @@ yyreduce: } break; - case 235: + case 237: /* Line 1792 of yacc.c */ -#line 1861 "dtool/src/cppparser/cppBison.yxx" +#line 1869 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { @@ -5799,9 +5821,9 @@ yyreduce: } break; - case 236: + case 238: /* Line 1792 of yacc.c */ -#line 1877 "dtool/src/cppparser/cppBison.yxx" +#line 1885 "dtool/src/cppparser/cppBison.yxx" { yywarning(string("C++ does not permit forward declaration of untyped enum ") + (yyvsp[(2) - (2)].u.identifier)->get_fully_scoped_name(), (yylsp[(1) - (2)])); @@ -5821,9 +5843,9 @@ yyreduce: } break; - case 237: + case 239: /* Line 1792 of yacc.c */ -#line 1895 "dtool/src/cppparser/cppBison.yxx" +#line 1903 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = (yyvsp[(3) - (4)].u.expr)->determine_type(); if ((yyval.u.decl) == (CPPType *)NULL) { @@ -5834,25 +5856,25 @@ yyreduce: } break; - case 238: + case 240: /* Line 1792 of yacc.c */ -#line 1904 "dtool/src/cppparser/cppBison.yxx" +#line 1912 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.decl) = new CPPSimpleType(CPPSimpleType::T_auto); } break; - case 239: + case 241: /* Line 1792 of yacc.c */ -#line 1911 "dtool/src/cppparser/cppBison.yxx" +#line 1919 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; - case 240: + case 242: /* Line 1792 of yacc.c */ -#line 1915 "dtool/src/cppparser/cppBison.yxx" +#line 1923 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if ((yyval.u.type) == NULL) { @@ -5862,65 +5884,65 @@ yyreduce: } break; - case 241: + case 243: /* Line 1792 of yacc.c */ -#line 1923 "dtool/src/cppparser/cppBison.yxx" +#line 1931 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; - case 242: -/* Line 1792 of yacc.c */ -#line 1927 "dtool/src/cppparser/cppBison.yxx" - { - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - if (type != NULL) { - (yyval.u.type) = type; - } else { - CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file)) - ->as_extension_type(); - CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); - if (scope != NULL) { - scope->define_extension_type(et); - } - (yyval.u.type) = et; - } -} - break; - - case 243: -/* Line 1792 of yacc.c */ -#line 1943 "dtool/src/cppparser/cppBison.yxx" - { - CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - if (type != NULL) { - (yyval.u.type) = type; - } else { - CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file)) - ->as_extension_type(); - CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); - if (scope != NULL) { - scope->define_extension_type(et); - } - (yyval.u.type) = et; - } -} - break; - case 244: /* Line 1792 of yacc.c */ -#line 1962 "dtool/src/cppparser/cppBison.yxx" +#line 1935 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.decl) = (yyvsp[(1) - (1)].u.decl); + CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + if (type != NULL) { + (yyval.u.type) = type; + } else { + CPPExtensionType *et = + CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } } break; case 245: /* Line 1792 of yacc.c */ -#line 1966 "dtool/src/cppparser/cppBison.yxx" +#line 1951 "dtool/src/cppparser/cppBison.yxx" + { + CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + if (type != NULL) { + (yyval.u.type) = type; + } else { + CPPExtensionType *et = + CPPType::new_type(new CPPExtensionType((yyvsp[(1) - (2)].u.extension_enum), (yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file)) + ->as_extension_type(); + CPPScope *scope = (yyvsp[(2) - (2)].u.identifier)->get_scope(current_scope, global_scope); + if (scope != NULL) { + scope->define_extension_type(et); + } + (yyval.u.type) = et; + } +} + break; + + case 246: +/* Line 1792 of yacc.c */ +#line 1970 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.decl) = (yyvsp[(1) - (1)].u.decl); +} + break; + + case 247: +/* Line 1792 of yacc.c */ +#line 1974 "dtool/src/cppparser/cppBison.yxx" { yyerror(string("unknown type '") + (yyvsp[(1) - (1)].u.identifier)->get_fully_scoped_name() + "'", (yylsp[(1) - (1)])); @@ -5928,9 +5950,9 @@ yyreduce: } break; - case 246: + case 248: /* Line 1792 of yacc.c */ -#line 1974 "dtool/src/cppparser/cppBison.yxx" +#line 1982 "dtool/src/cppparser/cppBison.yxx" { CPPInstance *inst = new CPPInstance((yyvsp[(1) - (2)].u.type), (yyvsp[(2) - (2)].u.inst_ident), 0, (yylsp[(1) - (2)]).file); (yyval.u.type) = inst->_type; @@ -5938,9 +5960,9 @@ yyreduce: } break; - case 247: + case 249: /* Line 1792 of yacc.c */ -#line 1980 "dtool/src/cppparser/cppBison.yxx" +#line 1988 "dtool/src/cppparser/cppBison.yxx" { (yyvsp[(3) - (3)].u.inst_ident)->add_modifier(IIT_const); CPPInstance *inst = new CPPInstance((yyvsp[(2) - (3)].u.type), (yyvsp[(3) - (3)].u.inst_ident), 0, (yylsp[(1) - (3)]).file); @@ -5949,9 +5971,9 @@ yyreduce: } break; - case 248: + case 250: /* Line 1792 of yacc.c */ -#line 1990 "dtool/src/cppparser/cppBison.yxx" +#line 1998 "dtool/src/cppparser/cppBison.yxx" { CPPVisibility starting_vis = ((yyvsp[(1) - (2)].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -5967,9 +5989,9 @@ yyreduce: } break; - case 249: + case 251: /* Line 1792 of yacc.c */ -#line 2004 "dtool/src/cppparser/cppBison.yxx" +#line 2012 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; @@ -5978,9 +6000,9 @@ yyreduce: } break; - case 250: + case 252: /* Line 1792 of yacc.c */ -#line 2014 "dtool/src/cppparser/cppBison.yxx" +#line 2022 "dtool/src/cppparser/cppBison.yxx" { CPPVisibility starting_vis = ((yyvsp[(1) - (2)].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; @@ -6002,9 +6024,9 @@ yyreduce: } break; - case 251: + case 253: /* Line 1792 of yacc.c */ -#line 2034 "dtool/src/cppparser/cppBison.yxx" +#line 2042 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.struct_type) = current_struct; current_struct->_incomplete = false; @@ -6013,27 +6035,11 @@ yyreduce: } break; - case 256: -/* Line 1792 of yacc.c */ -#line 2054 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_public, false); -} - break; - - case 257: -/* Line 1792 of yacc.c */ -#line 2058 "dtool/src/cppparser/cppBison.yxx" - { - current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_protected, false); -} - break; - case 258: /* Line 1792 of yacc.c */ #line 2062 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_private, false); + current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_public, false); } break; @@ -6041,7 +6047,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2066 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); + current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_protected, false); } break; @@ -6049,7 +6055,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2070 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); + current_struct->append_derivation((yyvsp[(2) - (2)].u.type), V_private, false); } break; @@ -6057,7 +6063,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2074 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); } break; @@ -6065,7 +6071,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2078 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); } break; @@ -6073,7 +6079,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2082 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); } break; @@ -6081,32 +6087,32 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2086 "dtool/src/cppparser/cppBison.yxx" { - current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_public, true); } break; case 265: /* Line 1792 of yacc.c */ -#line 2093 "dtool/src/cppparser/cppBison.yxx" +#line 2090 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.enum_type) = current_enum; - current_enum = NULL; + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_protected, true); } break; case 266: /* Line 1792 of yacc.c */ -#line 2101 "dtool/src/cppparser/cppBison.yxx" +#line 2094 "dtool/src/cppparser/cppBison.yxx" { - current_enum = new CPPEnumType((yyvsp[(2) - (4)].u.identifier), (yyvsp[(4) - (4)].u.type), current_scope, (yylsp[(1) - (4)]).file); + current_struct->append_derivation((yyvsp[(3) - (3)].u.type), V_private, true); } break; case 267: /* Line 1792 of yacc.c */ -#line 2105 "dtool/src/cppparser/cppBison.yxx" +#line 2101 "dtool/src/cppparser/cppBison.yxx" { - current_enum = new CPPEnumType((yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file); + (yyval.u.enum_type) = current_enum; + current_enum = NULL; } break; @@ -6114,7 +6120,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2109 "dtool/src/cppparser/cppBison.yxx" { - current_enum = new CPPEnumType(NULL, (yyvsp[(3) - (3)].u.type), current_scope, (yylsp[(1) - (3)]).file); + current_enum = new CPPEnumType((yyvsp[(2) - (4)].u.identifier), (yyvsp[(4) - (4)].u.type), current_scope, (yylsp[(1) - (4)]).file); } break; @@ -6122,23 +6128,31 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2113 "dtool/src/cppparser/cppBison.yxx" { - current_enum = new CPPEnumType(NULL, current_scope, (yylsp[(1) - (1)]).file); + current_enum = new CPPEnumType((yyvsp[(2) - (2)].u.identifier), current_scope, (yylsp[(1) - (2)]).file); } break; case 270: /* Line 1792 of yacc.c */ -#line 2120 "dtool/src/cppparser/cppBison.yxx" +#line 2117 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); + current_enum = new CPPEnumType(NULL, (yyvsp[(3) - (3)].u.type), current_scope, (yylsp[(1) - (3)]).file); } break; case 271: /* Line 1792 of yacc.c */ -#line 2124 "dtool/src/cppparser/cppBison.yxx" +#line 2121 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + current_enum = new CPPEnumType(NULL, current_scope, (yylsp[(1) - (1)]).file); +} + break; + + case 272: +/* Line 1792 of yacc.c */ +#line 2128 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.type) = CPPType::new_type((yyvsp[(1) - (1)].u.simple_type)); } break; @@ -6146,15 +6160,23 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2132 "dtool/src/cppparser/cppBison.yxx" { + (yyval.u.type) = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +} + break; + + case 275: +/* Line 1792 of yacc.c */ +#line 2140 "dtool/src/cppparser/cppBison.yxx" + { assert(current_enum != NULL); CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (3)].u.identifier)->get_simple_name()); current_scope->add_enum_value(inst, current_lexer, (yylsp[(2) - (3)])); } break; - case 274: + case 276: /* Line 1792 of yacc.c */ -#line 2138 "dtool/src/cppparser/cppBison.yxx" +#line 2146 "dtool/src/cppparser/cppBison.yxx" { assert(current_enum != NULL); CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (5)].u.identifier)->get_simple_name(), (yyvsp[(4) - (5)].u.expr)); @@ -6162,9 +6184,9 @@ yyreduce: } break; - case 276: + case 278: /* Line 1792 of yacc.c */ -#line 2147 "dtool/src/cppparser/cppBison.yxx" +#line 2155 "dtool/src/cppparser/cppBison.yxx" { assert(current_enum != NULL); CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (2)].u.identifier)->get_simple_name()); @@ -6172,9 +6194,9 @@ yyreduce: } break; - case 277: + case 279: /* Line 1792 of yacc.c */ -#line 2153 "dtool/src/cppparser/cppBison.yxx" +#line 2161 "dtool/src/cppparser/cppBison.yxx" { assert(current_enum != NULL); CPPInstance *inst = current_enum->add_element((yyvsp[(2) - (4)].u.identifier)->get_simple_name(), (yyvsp[(4) - (4)].u.expr)); @@ -6182,27 +6204,11 @@ yyreduce: } break; - case 278: -/* Line 1792 of yacc.c */ -#line 2162 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.extension_enum) = CPPExtensionType::T_enum; -} - break; - - case 279: -/* Line 1792 of yacc.c */ -#line 2169 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.extension_enum) = CPPExtensionType::T_class; -} - break; - case 280: /* Line 1792 of yacc.c */ -#line 2173 "dtool/src/cppparser/cppBison.yxx" +#line 2170 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.extension_enum) = CPPExtensionType::T_struct; + (yyval.u.extension_enum) = CPPExtensionType::T_enum; } break; @@ -6210,13 +6216,29 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2177 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.extension_enum) = CPPExtensionType::T_union; + (yyval.u.extension_enum) = CPPExtensionType::T_class; } break; case 282: /* Line 1792 of yacc.c */ -#line 2184 "dtool/src/cppparser/cppBison.yxx" +#line 2181 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.extension_enum) = CPPExtensionType::T_struct; +} + break; + + case 283: +/* Line 1792 of yacc.c */ +#line 2185 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.extension_enum) = CPPExtensionType::T_union; +} + break; + + case 284: +/* Line 1792 of yacc.c */ +#line 2192 "dtool/src/cppparser/cppBison.yxx" { CPPScope *scope = (yyvsp[(2) - (3)].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -6236,17 +6258,17 @@ yyreduce: } break; - case 283: + case 285: /* Line 1792 of yacc.c */ -#line 2202 "dtool/src/cppparser/cppBison.yxx" +#line 2210 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); } break; - case 284: + case 286: /* Line 1792 of yacc.c */ -#line 2206 "dtool/src/cppparser/cppBison.yxx" +#line 2214 "dtool/src/cppparser/cppBison.yxx" { CPPScope *scope = (yyvsp[(3) - (4)].u.identifier)->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { @@ -6267,17 +6289,17 @@ yyreduce: } break; - case 285: + case 287: /* Line 1792 of yacc.c */ -#line 2225 "dtool/src/cppparser/cppBison.yxx" +#line 2233 "dtool/src/cppparser/cppBison.yxx" { pop_scope(); } break; - case 288: + case 290: /* Line 1792 of yacc.c */ -#line 2234 "dtool/src/cppparser/cppBison.yxx" +#line 2242 "dtool/src/cppparser/cppBison.yxx" { CPPUsing *using_decl = new CPPUsing((yyvsp[(2) - (2)].u.identifier), false, (yylsp[(1) - (2)]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[(1) - (2)])); @@ -6285,9 +6307,9 @@ yyreduce: } break; - case 289: + case 291: /* Line 1792 of yacc.c */ -#line 2240 "dtool/src/cppparser/cppBison.yxx" +#line 2248 "dtool/src/cppparser/cppBison.yxx" { CPPUsing *using_decl = new CPPUsing((yyvsp[(3) - (3)].u.identifier), true, (yylsp[(1) - (3)]).file); current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[(1) - (3)])); @@ -6295,27 +6317,11 @@ yyreduce: } break; - case 293: -/* Line 1792 of yacc.c */ -#line 2255 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); -} - break; - - case 294: -/* Line 1792 of yacc.c */ -#line 2259 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); -} - break; - case 295: /* Line 1792 of yacc.c */ #line 2263 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); + (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); } break; @@ -6323,7 +6329,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2267 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char16_t); + (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); } break; @@ -6331,7 +6337,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2271 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char32_t); + (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); } break; @@ -6339,67 +6345,83 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2275 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, - CPPSimpleType::F_short); + (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char16_t); } break; case 299: /* Line 1792 of yacc.c */ -#line 2280 "dtool/src/cppparser/cppBison.yxx" +#line 2279 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char32_t); +} + break; + + case 300: +/* Line 1792 of yacc.c */ +#line 2283 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, + CPPSimpleType::F_short); +} + break; + + case 301: +/* Line 1792 of yacc.c */ +#line 2288 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long); } break; - case 300: + case 302: /* Line 1792 of yacc.c */ -#line 2285 "dtool/src/cppparser/cppBison.yxx" +#line 2293 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_longlong); } break; - case 301: + case 303: /* Line 1792 of yacc.c */ -#line 2290 "dtool/src/cppparser/cppBison.yxx" +#line 2298 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned); } break; - case 302: + case 304: /* Line 1792 of yacc.c */ -#line 2295 "dtool/src/cppparser/cppBison.yxx" +#line 2303 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed); } break; - case 303: + case 305: /* Line 1792 of yacc.c */ -#line 2300 "dtool/src/cppparser/cppBison.yxx" +#line 2308 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int); } break; - case 304: + case 306: /* Line 1792 of yacc.c */ -#line 2304 "dtool/src/cppparser/cppBison.yxx" +#line 2312 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_short; } break; - case 305: + case 307: /* Line 1792 of yacc.c */ -#line 2309 "dtool/src/cppparser/cppBison.yxx" +#line 2317 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); if ((yyval.u.simple_type)->_flags & CPPSimpleType::F_long) { @@ -6410,117 +6432,101 @@ yyreduce: } break; - case 306: + case 308: /* Line 1792 of yacc.c */ -#line 2318 "dtool/src/cppparser/cppBison.yxx" +#line 2326 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_unsigned; } break; - case 307: + case 309: /* Line 1792 of yacc.c */ -#line 2323 "dtool/src/cppparser/cppBison.yxx" +#line 2331 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = (yyvsp[(2) - (2)].u.simple_type); (yyval.u.simple_type)->_flags |= CPPSimpleType::F_signed; } break; - case 308: + case 310: /* Line 1792 of yacc.c */ -#line 2331 "dtool/src/cppparser/cppBison.yxx" +#line 2339 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float); } break; - case 309: + case 311: /* Line 1792 of yacc.c */ -#line 2335 "dtool/src/cppparser/cppBison.yxx" +#line 2343 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_long); } break; - case 310: + case 312: /* Line 1792 of yacc.c */ -#line 2340 "dtool/src/cppparser/cppBison.yxx" +#line 2348 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double); } break; - case 311: + case 313: /* Line 1792 of yacc.c */ -#line 2344 "dtool/src/cppparser/cppBison.yxx" +#line 2352 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_longlong); } break; - case 312: + case 314: /* Line 1792 of yacc.c */ -#line 2349 "dtool/src/cppparser/cppBison.yxx" +#line 2357 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double, CPPSimpleType::F_long); } break; - case 313: + case 315: /* Line 1792 of yacc.c */ -#line 2357 "dtool/src/cppparser/cppBison.yxx" +#line 2365 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_void); } break; - case 314: + case 316: /* Line 1792 of yacc.c */ -#line 2366 "dtool/src/cppparser/cppBison.yxx" +#line 2374 "dtool/src/cppparser/cppBison.yxx" { current_lexer->_resolve_identifiers = false; } break; - case 315: + case 317: /* Line 1792 of yacc.c */ -#line 2370 "dtool/src/cppparser/cppBison.yxx" +#line 2378 "dtool/src/cppparser/cppBison.yxx" { current_lexer->_resolve_identifiers = true; } break; - case 412: + case 414: /* Line 1792 of yacc.c */ -#line 2410 "dtool/src/cppparser/cppBison.yxx" +#line 2418 "dtool/src/cppparser/cppBison.yxx" { } break; - case 436: -/* Line 1792 of yacc.c */ -#line 2419 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 437: -/* Line 1792 of yacc.c */ -#line 2423 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); -} - break; - case 438: /* Line 1792 of yacc.c */ -#line 2430 "dtool/src/cppparser/cppBison.yxx" +#line 2427 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (CPPExpression *)NULL; } @@ -6528,7 +6534,7 @@ yyreduce: case 439: /* Line 1792 of yacc.c */ -#line 2434 "dtool/src/cppparser/cppBison.yxx" +#line 2431 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } @@ -6536,23 +6542,23 @@ yyreduce: case 440: /* Line 1792 of yacc.c */ -#line 2441 "dtool/src/cppparser/cppBison.yxx" +#line 2438 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = (CPPExpression *)NULL; } break; case 441: /* Line 1792 of yacc.c */ -#line 2445 "dtool/src/cppparser/cppBison.yxx" +#line 2442 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(',', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; case 442: /* Line 1792 of yacc.c */ -#line 2452 "dtool/src/cppparser/cppBison.yxx" +#line 2449 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } @@ -6560,9 +6566,9 @@ yyreduce: case 443: /* Line 1792 of yacc.c */ -#line 2456 "dtool/src/cppparser/cppBison.yxx" +#line 2453 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(',', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6570,7 +6576,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2460 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; @@ -6578,7 +6584,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2464 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); } break; @@ -6586,7 +6592,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2468 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; @@ -6594,7 +6600,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2472 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; @@ -6602,7 +6608,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2476 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); } break; @@ -6610,7 +6616,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2480 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[(3) - (4)].u.type))); } break; @@ -6618,7 +6624,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2484 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); } break; @@ -6626,7 +6632,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2488 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); } break; @@ -6634,7 +6640,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2492 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); } break; @@ -6642,7 +6648,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2496 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); } break; @@ -6650,7 +6656,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2500 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); } break; @@ -6658,7 +6664,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2504 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6666,7 +6672,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2508 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6674,7 +6680,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2512 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6682,7 +6688,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2516 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6690,7 +6696,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2520 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6698,7 +6704,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2524 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6706,7 +6712,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2528 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6714,7 +6720,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2532 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6722,7 +6728,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2536 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6730,7 +6736,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2540 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6738,7 +6744,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2544 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6746,7 +6752,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2548 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6754,7 +6760,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2552 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6762,7 +6768,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2556 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6770,7 +6776,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2560 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6778,7 +6784,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2564 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -6786,7 +6792,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2568 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); } break; @@ -6794,7 +6800,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2572 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; @@ -6802,7 +6808,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2576 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; @@ -6810,7 +6816,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2580 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); } break; @@ -6818,23 +6824,23 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2584 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; case 476: /* Line 1792 of yacc.c */ -#line 2592 "dtool/src/cppparser/cppBison.yxx" +#line 2588 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; case 477: /* Line 1792 of yacc.c */ -#line 2596 "dtool/src/cppparser/cppBison.yxx" +#line 2592 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); + (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; @@ -6842,7 +6848,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2600 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; @@ -6850,7 +6856,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2604 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); } break; @@ -6858,6 +6864,22 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2608 "dtool/src/cppparser/cppBison.yxx" { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); +} + break; + + case 481: +/* Line 1792 of yacc.c */ +#line 2612 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); +} + break; + + case 482: +/* Line 1792 of yacc.c */ +#line 2616 "dtool/src/cppparser/cppBison.yxx" + { // A constructor call. CPPType *type = (yyvsp[(1) - (4)].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); if (type == NULL) { @@ -6868,9 +6890,9 @@ yyreduce: } break; - case 481: + case 483: /* Line 1792 of yacc.c */ -#line 2618 "dtool/src/cppparser/cppBison.yxx" +#line 2626 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int)); @@ -6878,9 +6900,9 @@ yyreduce: } break; - case 482: + case 484: /* Line 1792 of yacc.c */ -#line 2624 "dtool/src/cppparser/cppBison.yxx" +#line 2632 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char)); @@ -6888,9 +6910,9 @@ yyreduce: } break; - case 483: + case 485: /* Line 1792 of yacc.c */ -#line 2630 "dtool/src/cppparser/cppBison.yxx" +#line 2638 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_wchar_t)); @@ -6898,9 +6920,9 @@ yyreduce: } break; - case 484: + case 486: /* Line 1792 of yacc.c */ -#line 2636 "dtool/src/cppparser/cppBison.yxx" +#line 2644 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char16_t)); @@ -6908,9 +6930,9 @@ yyreduce: } break; - case 485: + case 487: /* Line 1792 of yacc.c */ -#line 2642 "dtool/src/cppparser/cppBison.yxx" +#line 2650 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char32_t)); @@ -6918,9 +6940,9 @@ yyreduce: } break; - case 486: + case 488: /* Line 1792 of yacc.c */ -#line 2648 "dtool/src/cppparser/cppBison.yxx" +#line 2656 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool)); @@ -6928,9 +6950,9 @@ yyreduce: } break; - case 487: + case 489: /* Line 1792 of yacc.c */ -#line 2654 "dtool/src/cppparser/cppBison.yxx" +#line 2662 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6939,9 +6961,9 @@ yyreduce: } break; - case 488: + case 490: /* Line 1792 of yacc.c */ -#line 2661 "dtool/src/cppparser/cppBison.yxx" +#line 2669 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6950,9 +6972,9 @@ yyreduce: } break; - case 489: + case 491: /* Line 1792 of yacc.c */ -#line 2668 "dtool/src/cppparser/cppBison.yxx" +#line 2676 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6961,9 +6983,9 @@ yyreduce: } break; - case 490: + case 492: /* Line 1792 of yacc.c */ -#line 2675 "dtool/src/cppparser/cppBison.yxx" +#line 2683 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, @@ -6972,9 +6994,9 @@ yyreduce: } break; - case 491: + case 493: /* Line 1792 of yacc.c */ -#line 2682 "dtool/src/cppparser/cppBison.yxx" +#line 2690 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_float)); @@ -6982,9 +7004,9 @@ yyreduce: } break; - case 492: + case 494: /* Line 1792 of yacc.c */ -#line 2688 "dtool/src/cppparser/cppBison.yxx" +#line 2696 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double)); @@ -6992,27 +7014,11 @@ yyreduce: } break; - case 493: -/* Line 1792 of yacc.c */ -#line 2694 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); -} - break; - - case 494: -/* Line 1792 of yacc.c */ -#line 2698 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[(3) - (4)].u.type))); -} - break; - case 495: /* Line 1792 of yacc.c */ #line 2702 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); } break; @@ -7020,7 +7026,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2706 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[(3) - (4)].u.type))); } break; @@ -7028,7 +7034,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2710 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); } break; @@ -7036,7 +7042,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2714 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); } break; @@ -7044,7 +7050,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2718 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7052,7 +7058,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2722 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7060,7 +7066,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2726 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7068,7 +7074,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2730 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7076,7 +7082,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2734 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7084,7 +7090,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2738 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7092,7 +7098,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2742 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7100,7 +7106,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2746 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7108,7 +7114,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2750 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7116,7 +7122,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2754 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7124,7 +7130,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2758 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7132,7 +7138,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2762 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7140,7 +7146,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2766 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7148,7 +7154,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2770 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7156,7 +7162,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2774 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7164,7 +7170,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2778 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7172,7 +7178,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2782 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7180,7 +7186,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2786 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7188,7 +7194,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2790 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7196,7 +7202,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2794 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7204,7 +7210,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2798 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7212,7 +7218,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2802 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7220,7 +7226,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2806 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7228,7 +7234,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2810 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); } break; @@ -7236,7 +7242,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2814 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; @@ -7244,7 +7250,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2818 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; @@ -7252,7 +7258,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2822 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); } break; @@ -7260,23 +7266,23 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2826 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; case 527: /* Line 1792 of yacc.c */ -#line 2833 "dtool/src/cppparser/cppBison.yxx" +#line 2830 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; case 528: /* Line 1792 of yacc.c */ -#line 2837 "dtool/src/cppparser/cppBison.yxx" +#line 2834 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(true); + (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; @@ -7284,7 +7290,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2841 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(false); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; @@ -7292,7 +7298,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2845 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.u.expr) = new CPPExpression(true); } break; @@ -7300,7 +7306,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2849 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); + (yyval.u.expr) = new CPPExpression(false); } break; @@ -7308,7 +7314,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2853 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; @@ -7316,7 +7322,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2857 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); } break; @@ -7324,7 +7330,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2861 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.identifier), current_scope, global_scope, current_lexer); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; @@ -7332,23 +7338,23 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2865 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; case 536: /* Line 1792 of yacc.c */ -#line 2879 "dtool/src/cppparser/cppBison.yxx" +#line 2869 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.identifier), current_scope, global_scope, current_lexer); } break; case 537: /* Line 1792 of yacc.c */ -#line 2883 "dtool/src/cppparser/cppBison.yxx" +#line 2873 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); } break; @@ -7356,7 +7362,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2887 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; @@ -7364,7 +7370,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2891 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(2) - (4)].u.type), (yyvsp[(4) - (4)].u.expr))); } break; @@ -7372,7 +7378,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2895 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; @@ -7380,7 +7386,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2899 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[(3) - (4)].u.type))); + (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[(3) - (7)].u.type), (yyvsp[(6) - (7)].u.expr))); } break; @@ -7388,7 +7394,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2903 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); + (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[(3) - (4)].u.type))); } break; @@ -7396,7 +7402,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2907 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); + (yyval.u.expr) = new CPPExpression(CPPExpression::alignof_func((yyvsp[(3) - (4)].u.type))); } break; @@ -7404,7 +7410,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2911 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (2)].u.type))); } break; @@ -7412,7 +7418,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2915 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[(2) - (5)].u.type), (yyvsp[(4) - (5)].u.expr))); } break; @@ -7420,7 +7426,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2919 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7428,7 +7434,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2923 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7436,7 +7442,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2927 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7444,7 +7450,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2931 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[(2) - (2)].u.expr)); } break; @@ -7452,7 +7458,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2935 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('*', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7460,7 +7466,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2939 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('/', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7468,7 +7474,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2943 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('%', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7476,7 +7482,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2947 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('+', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7484,7 +7490,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2951 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('-', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7492,7 +7498,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2955 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('|', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7500,7 +7506,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2959 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('^', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7508,7 +7514,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2963 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('&', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7516,7 +7522,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2967 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7524,7 +7530,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2971 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7532,7 +7538,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2975 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7540,7 +7546,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2979 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7548,7 +7554,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2983 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7556,7 +7562,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2987 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7564,7 +7570,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2991 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('<', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7572,7 +7578,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2995 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('>', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7580,7 +7586,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 2999 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); + (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7588,7 +7594,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3003 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; @@ -7596,7 +7602,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3007 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); + (yyval.u.expr) = new CPPExpression('?', (yyvsp[(1) - (5)].u.expr), (yyvsp[(3) - (5)].u.expr), (yyvsp[(5) - (5)].u.expr)); } break; @@ -7604,7 +7610,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3011 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('[', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; @@ -7612,7 +7618,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3015 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (4)].u.expr), (yyvsp[(3) - (4)].u.expr)); } break; @@ -7620,7 +7626,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3019 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); + (yyval.u.expr) = new CPPExpression('f', (yyvsp[(1) - (3)].u.expr)); } break; @@ -7628,23 +7634,23 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3023 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); + (yyval.u.expr) = new CPPExpression('.', (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; case 573: /* Line 1792 of yacc.c */ -#line 3030 "dtool/src/cppparser/cppBison.yxx" +#line 3027 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[(1) - (3)].u.expr), (yyvsp[(3) - (3)].u.expr)); } break; case 574: /* Line 1792 of yacc.c */ -#line 3034 "dtool/src/cppparser/cppBison.yxx" +#line 3031 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(true); + (yyval.u.expr) = (yyvsp[(2) - (3)].u.expr); } break; @@ -7652,7 +7658,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3038 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(false); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; @@ -7660,7 +7666,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3042 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); + (yyval.u.expr) = new CPPExpression(true); } break; @@ -7668,7 +7674,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3046 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); + (yyval.u.expr) = new CPPExpression(false); } break; @@ -7676,7 +7682,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3050 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.integer)); } break; @@ -7684,7 +7690,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3054 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.real)); } break; @@ -7692,7 +7698,7 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3058 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.identifier), current_scope, global_scope, current_lexer); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; @@ -7700,13 +7706,29 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3062 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); } break; case 582: /* Line 1792 of yacc.c */ -#line 3069 "dtool/src/cppparser/cppBison.yxx" +#line 3066 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].u.identifier), current_scope, global_scope, current_lexer); +} + break; + + case 583: +/* Line 1792 of yacc.c */ +#line 3070 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = new CPPExpression(CPPExpression::get_nullptr()); +} + break; + + case 584: +/* Line 1792 of yacc.c */ +#line 3077 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(1) - (1)].u.identifier)->find_type(current_scope, global_scope, true); if (type == NULL) { @@ -7716,9 +7738,9 @@ yyreduce: } break; - case 583: + case 585: /* Line 1792 of yacc.c */ -#line 3077 "dtool/src/cppparser/cppBison.yxx" +#line 3085 "dtool/src/cppparser/cppBison.yxx" { CPPType *type = (yyvsp[(2) - (2)].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); if (type == NULL) { @@ -7728,43 +7750,27 @@ yyreduce: } break; - case 584: + case 586: /* Line 1792 of yacc.c */ -#line 3085 "dtool/src/cppparser/cppBison.yxx" +#line 3093 "dtool/src/cppparser/cppBison.yxx" { (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[(2) - (2)].u.identifier))); } break; - case 585: -/* Line 1792 of yacc.c */ -#line 3111 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); -} - break; - - case 586: -/* Line 1792 of yacc.c */ -#line 3115 "dtool/src/cppparser/cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); -} - break; - case 587: /* Line 1792 of yacc.c */ -#line 3122 "dtool/src/cppparser/cppBison.yxx" +#line 3119 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].str)); + (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); } break; case 588: /* Line 1792 of yacc.c */ -#line 3126 "dtool/src/cppparser/cppBison.yxx" +#line 3123 "dtool/src/cppparser/cppBison.yxx" { - (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); + (yyval.u.identifier) = (yyvsp[(1) - (1)].u.identifier); } break; @@ -7772,15 +7778,31 @@ yyreduce: /* Line 1792 of yacc.c */ #line 3130 "dtool/src/cppparser/cppBison.yxx" { + (yyval.u.expr) = new CPPExpression((yyvsp[(1) - (1)].str)); +} + break; + + case 590: +/* Line 1792 of yacc.c */ +#line 3134 "dtool/src/cppparser/cppBison.yxx" + { + (yyval.u.expr) = (yyvsp[(1) - (1)].u.expr); +} + break; + + case 591: +/* Line 1792 of yacc.c */ +#line 3138 "dtool/src/cppparser/cppBison.yxx" + { // The right string takes on the literal type of the left. (yyval.u.expr) = (yyvsp[(1) - (2)].u.expr); (yyval.u.expr)->_str += (yyvsp[(2) - (2)].str); } break; - case 590: + case 592: /* Line 1792 of yacc.c */ -#line 3136 "dtool/src/cppparser/cppBison.yxx" +#line 3144 "dtool/src/cppparser/cppBison.yxx" { // We have to check that the two literal types match up. (yyval.u.expr) = (yyvsp[(1) - (2)].u.expr); @@ -7793,7 +7815,7 @@ yyreduce: /* Line 1792 of yacc.c */ -#line 7797 "built/tmp/cppBison.yxx.c" +#line 7819 "built/tmp/cppBison.yxx.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 4978edb0f2..d4597eb40e 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -1524,6 +1524,14 @@ maybe_initialize_or_function_body: | '=' const_expr ';' { $$ = $2; +} + | '=' KW_DEFAULT ';' +{ + $$ = new CPPExpression(CPPExpression::get_default()); +} + | '=' KW_DELETE ';' +{ + $$ = new CPPExpression(CPPExpression::get_delete()); } | '=' '{' structure_init '}' { diff --git a/dtool/src/cppparser/cppConstType.cxx b/dtool/src/cppparser/cppConstType.cxx index 503f1c0871..40bfd9548b 100644 --- a/dtool/src/cppparser/cppConstType.cxx +++ b/dtool/src/cppparser/cppConstType.cxx @@ -112,6 +112,26 @@ is_trivial() const { return _wrapped_around->is_trivial(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPConstType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPConstType:: +is_default_constructible() const { + return false; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPConstType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPConstType:: +is_copy_constructible() const { + return _wrapped_around->is_copy_constructible(); +} + //////////////////////////////////////////////////////////////////// // Function: CPPConstType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppConstType.h b/dtool/src/cppparser/cppConstType.h index 499b403a6e..c3d79e8663 100644 --- a/dtool/src/cppparser/cppConstType.h +++ b/dtool/src/cppparser/cppConstType.h @@ -39,6 +39,8 @@ public: virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppExpression.cxx b/dtool/src/cppparser/cppExpression.cxx index e4b4617e32..9e2bc15ee1 100644 --- a/dtool/src/cppparser/cppExpression.cxx +++ b/dtool/src/cppparser/cppExpression.cxx @@ -494,6 +494,30 @@ get_nullptr() { return expr; } +//////////////////////////////////////////////////////////////////// +// Function: CPPExpression::get_default +// Access: Public, Static +// Description: +//////////////////////////////////////////////////////////////////// +const CPPExpression &CPPExpression:: +get_default() { + static CPPExpression expr(0); + expr._type = T_default; + return expr; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPExpression::get_delete +// Access: Public, Static +// Description: +//////////////////////////////////////////////////////////////////// +const CPPExpression &CPPExpression:: +get_delete() { + static CPPExpression expr(0); + expr._type = T_delete; + return expr; +} + //////////////////////////////////////////////////////////////////// // Function: CPPExpression::Destructor // Access: Public @@ -1619,6 +1643,14 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const { } break; + case T_default: + out << "default"; + break; + + case T_delete: + out << "delete"; + break; + default: out << "(** invalid operand type " << (int)_type << " **)"; } diff --git a/dtool/src/cppparser/cppExpression.h b/dtool/src/cppparser/cppExpression.h index 44e72baf5c..8b0aa7d469 100644 --- a/dtool/src/cppparser/cppExpression.h +++ b/dtool/src/cppparser/cppExpression.h @@ -52,6 +52,8 @@ public: static CPPExpression raw_literal(const string &raw, CPPInstance *lit_op); static const CPPExpression &get_nullptr(); + static const CPPExpression &get_default(); + static const CPPExpression &get_delete(); ~CPPExpression(); @@ -124,6 +126,10 @@ public: T_trinary_operation, T_literal, T_raw_literal, + + // These are used when parsing =default and =delete methods. + T_default, + T_delete, }; Type _type; diff --git a/dtool/src/cppparser/cppExtensionType.cxx b/dtool/src/cppparser/cppExtensionType.cxx index 6060bb4b0d..793e75986f 100644 --- a/dtool/src/cppparser/cppExtensionType.cxx +++ b/dtool/src/cppparser/cppExtensionType.cxx @@ -114,6 +114,26 @@ is_trivial() const { return (_type == T_enum); } +//////////////////////////////////////////////////////////////////// +// Function: CPPExtensionType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPExtensionType:: +is_default_constructible() const { + return (_type == T_enum); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPExtensionType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPExtensionType:: +is_copy_constructible() const { + return (_type == T_enum); +} + //////////////////////////////////////////////////////////////////// // Function: CPPExtensionType::substitute_decl // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppExtensionType.h b/dtool/src/cppparser/cppExtensionType.h index f70a4e99a5..eeff66ec85 100644 --- a/dtool/src/cppparser/cppExtensionType.h +++ b/dtool/src/cppparser/cppExtensionType.h @@ -48,6 +48,8 @@ public: virtual bool is_incomplete() const; virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual CPPDeclaration *substitute_decl(SubstDecl &subst, CPPScope *current_scope, diff --git a/dtool/src/cppparser/cppInstance.cxx b/dtool/src/cppparser/cppInstance.cxx index 5cbe0696af..e41cbc36b3 100644 --- a/dtool/src/cppparser/cppInstance.cxx +++ b/dtool/src/cppparser/cppInstance.cxx @@ -251,12 +251,20 @@ void CPPInstance:: set_initializer(CPPExpression *initializer) { if (_type->as_function_type() != (CPPFunctionType *)NULL) { // This is a function declaration. - if (initializer == (CPPExpression *)NULL) { - _storage_class &= ~SC_pure_virtual; - } else { - _storage_class |= SC_pure_virtual; - } + _storage_class &= ~(SC_pure_virtual | SC_defaulted | SC_deleted); _initializer = (CPPExpression *)NULL; + + if (initializer != (CPPExpression *)NULL) { + if (initializer->_type == CPPExpression::T_integer) { // = 0 + _storage_class |= SC_pure_virtual; + + } else if (initializer->_type == CPPExpression::T_default) { + _storage_class |= SC_defaulted; + + } else if (initializer->_type == CPPExpression::T_delete) { + _storage_class |= SC_deleted; + } + } } else { _initializer = initializer; } @@ -622,6 +630,12 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete, if (_storage_class & SC_pure_virtual) { out << " = 0"; } + if (_storage_class & SC_defaulted) { + out << " = default"; + } + if (_storage_class & SC_deleted) { + out << " = delete"; + } if (_initializer != NULL) { out << " = " << *_initializer; } diff --git a/dtool/src/cppparser/cppInstance.h b/dtool/src/cppparser/cppInstance.h index d22342730f..3ea50ebee6 100644 --- a/dtool/src/cppparser/cppInstance.h +++ b/dtool/src/cppparser/cppInstance.h @@ -60,6 +60,10 @@ public: // And this is for methods tagged with __extension, which declares // extension methods defined separately from the source code. SC_extension = 0x2000, + + // These are for =default and =delete functions. + SC_defaulted = 0x4000, + SC_deleted = 0x8000, }; CPPInstance(CPPType *type, const string &name, int storage_class = 0); diff --git a/dtool/src/cppparser/cppPointerType.cxx b/dtool/src/cppparser/cppPointerType.cxx index baa8a62ff8..044bb68893 100644 --- a/dtool/src/cppparser/cppPointerType.cxx +++ b/dtool/src/cppparser/cppPointerType.cxx @@ -114,6 +114,26 @@ is_trivial() const { return true; } +//////////////////////////////////////////////////////////////////// +// Function: CPPPointerType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPPointerType:: +is_default_constructible() const { + return true; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPPointerType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPPointerType:: +is_copy_constructible() const { + return true; +} + //////////////////////////////////////////////////////////////////// // Function: CPPPointerType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppPointerType.h b/dtool/src/cppparser/cppPointerType.h index 6f9c2b1b75..770fd1449f 100644 --- a/dtool/src/cppparser/cppPointerType.h +++ b/dtool/src/cppparser/cppPointerType.h @@ -39,6 +39,8 @@ public: virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppReferenceType.cxx b/dtool/src/cppparser/cppReferenceType.cxx index 5b5d85fd3b..21e4b352bc 100644 --- a/dtool/src/cppparser/cppReferenceType.cxx +++ b/dtool/src/cppparser/cppReferenceType.cxx @@ -113,6 +113,26 @@ is_trivial() const { return false; } +//////////////////////////////////////////////////////////////////// +// Function: CPPReferenceType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPReferenceType:: +is_default_constructible() const { + return false; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPReferenceType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPReferenceType:: +is_copy_constructible() const { + return (_value_category == VC_lvalue); +} + //////////////////////////////////////////////////////////////////// // Function: CPPReferenceType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppReferenceType.h b/dtool/src/cppparser/cppReferenceType.h index 713a6abd6c..f1470ae936 100644 --- a/dtool/src/cppparser/cppReferenceType.h +++ b/dtool/src/cppparser/cppReferenceType.h @@ -45,6 +45,8 @@ public: virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppSimpleType.cxx b/dtool/src/cppparser/cppSimpleType.cxx index a6e4db1a59..ee8d2a1627 100644 --- a/dtool/src/cppparser/cppSimpleType.cxx +++ b/dtool/src/cppparser/cppSimpleType.cxx @@ -51,6 +51,26 @@ is_trivial() const { return true; } +//////////////////////////////////////////////////////////////////// +// Function: CPPSimpleType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPSimpleType:: +is_default_constructible() const { + return (_type != T_void); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPSimpleType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPSimpleType:: +is_copy_constructible() const { + return (_type != T_void); +} + //////////////////////////////////////////////////////////////////// // Function: CPPSimpleType::is_parameter_expr // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppSimpleType.h b/dtool/src/cppparser/cppSimpleType.h index 9acfdafbd9..73012ef1d0 100644 --- a/dtool/src/cppparser/cppSimpleType.h +++ b/dtool/src/cppparser/cppSimpleType.h @@ -79,6 +79,8 @@ public: virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_parameter_expr() const; virtual string get_preferred_name() const; diff --git a/dtool/src/cppparser/cppStructType.cxx b/dtool/src/cppparser/cppStructType.cxx index c6188ada30..9445963f1a 100644 --- a/dtool/src/cppparser/cppStructType.cxx +++ b/dtool/src/cppparser/cppStructType.cxx @@ -190,6 +190,11 @@ is_trivial() const { return false; } + // The following checks don't apply for defaulted functions. + if (inst->_storage_class & CPPInstance::SC_defaulted) { + continue; + } + assert(inst->_type != (CPPType *)NULL); CPPFunctionType *ftype = inst->_type->as_function_type(); assert(ftype != (CPPFunctionType *)NULL); @@ -197,7 +202,8 @@ is_trivial() const { if (ftype->_flags & (CPPFunctionType::F_destructor | CPPFunctionType::F_move_constructor | CPPFunctionType::F_copy_constructor)) { - // User-provided destructors and copy/move constructors are not trivial. + // User-provided destructors and copy/move constructors are not + // trivial unless they are defaulted (and not virtual). return false; } @@ -223,6 +229,193 @@ is_trivial() const { return is_default_constructible; } +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPStructType:: +is_default_constructible() const { + return is_default_constructible(V_public); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPStructType:: +is_copy_constructible() const { + return is_copy_constructible(V_public); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::is_default_constructible +// Access: Public +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPStructType:: +is_default_constructible(CPPVisibility min_vis) const { + CPPInstance *constructor = get_default_constructor(); + if (constructor != (CPPInstance *)NULL) { + // It has a default constructor. + if (constructor->_vis > min_vis) { + // Inaccessible default constructor. + return false; + } + + if (constructor->_storage_class & CPPInstance::SC_deleted) { + // Deleted default constructor. + return false; + } + + return true; + } + + // Does it have constructors at all? If so, no implicit one is generated. + if (get_constructor() != (CPPFunctionGroup *)NULL) { + return false; + } + + // Implicit default constructor. Check if the implicit default + // constructor is deleted. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL) { + if (!base->is_default_constructible(V_protected)) { + return false; + } + } + } + + // Make sure all members are default-constructible or have default values. + CPPScope::Variables::const_iterator vi; + for (vi = _scope->_variables.begin(); vi != _scope->_variables.end(); ++vi) { + CPPInstance *instance = (*vi).second; + assert(instance != NULL); + + if (instance->_storage_class & CPPInstance::SC_static) { + // Static members don't count. + continue; + } + + if (instance->_initializer != (CPPExpression *)NULL) { + // It has a default value. + continue; + } + + if (!instance->_type->is_default_constructible()) { + return false; + } + } + + // Check that we don't have pure virtual methods. + CPPScope::Functions::const_iterator fi; + for (fi = _scope->_functions.begin(); + fi != _scope->_functions.end(); + ++fi) { + CPPFunctionGroup *fgroup = (*fi).second; + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); + ii != fgroup->_instances.end(); + ++ii) { + CPPInstance *inst = (*ii); + if (inst->_storage_class & CPPInstance::SC_pure_virtual) { + // Here's a pure virtual function. + return false; + } + } + } + + return true; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::is_copy_constructible +// Access: Public +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPStructType:: +is_copy_constructible(CPPVisibility min_vis) const { + CPPInstance *constructor = get_copy_constructor(); + if (constructor != (CPPInstance *)NULL) { + // It has a copy constructor. + if (constructor->_vis > min_vis) { + // Inaccessible copy constructor. + return false; + } + + if (constructor->_storage_class & CPPInstance::SC_deleted) { + // Deleted copy constructor. + return false; + } + + return true; + } + + CPPInstance *destructor = get_destructor(); + if (destructor != (CPPInstance *)NULL) { + if (destructor->_vis > min_vis) { + // Inaccessible destructor. + return false; + } + + if (destructor->_storage_class & CPPInstance::SC_deleted) { + // Deleted destructor. + return false; + } + } + + // Implicit copy constructor. Check if the implicit copy + // constructor is deleted. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL) { + if (!base->is_copy_constructible(V_protected)) { + return false; + } + } + } + + // Make sure all members are copy-constructible. + CPPScope::Variables::const_iterator vi; + for (vi = _scope->_variables.begin(); vi != _scope->_variables.end(); ++vi) { + CPPInstance *instance = (*vi).second; + assert(instance != NULL); + + if (instance->_storage_class & CPPInstance::SC_static) { + // Static members don't count. + continue; + } + + if (!instance->_type->is_copy_constructible()) { + return false; + } + } + + // Check that we don't have pure virtual methods. + CPPScope::Functions::const_iterator fi; + for (fi = _scope->_functions.begin(); + fi != _scope->_functions.end(); + ++fi) { + CPPFunctionGroup *fgroup = (*fi).second; + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); + ii != fgroup->_instances.end(); + ++ii) { + CPPInstance *inst = (*ii); + if (inst->_storage_class & CPPInstance::SC_pure_virtual) { + // Here's a pure virtual function. + return false; + } + } + } + + return true; +} + //////////////////////////////////////////////////////////////////// // Function: CPPStructType::check_virtual // Access: Public @@ -244,7 +437,7 @@ is_trivial() const { // virtual function pointer), or false otherwise. //////////////////////////////////////////////////////////////////// bool CPPStructType:: -check_virtual() { +check_virtual() const { VFunctions funcs; get_virtual_funcs(funcs); return !funcs.empty(); @@ -285,9 +478,7 @@ is_incomplete() const { //////////////////////////////////////////////////////////////////// CPPFunctionGroup *CPPStructType:: get_constructor() const { - // Iterate through all the functions that begin with '~' until we - // find one that claims to be a destructor. In theory, there should - // only be one such function. + // Just look for the function with the same name as the class. CPPScope::Functions::const_iterator fi; fi = _scope->_functions.find(get_simple_name()); if (fi != _scope->_functions.end()) { @@ -297,6 +488,101 @@ get_constructor() const { } } +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::get_default_constructor +// Access: Public +// Description: Returns the default constructor defined for the +// struct type, or NULL if there is none. +//////////////////////////////////////////////////////////////////// +CPPInstance *CPPStructType:: +get_default_constructor() const { + CPPFunctionGroup *fgroup = get_constructor(); + if (fgroup == (CPPFunctionGroup *)NULL) { + return (CPPInstance *)NULL; + } + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); + ii != fgroup->_instances.end(); + ++ii) { + CPPInstance *inst = (*ii); + assert(inst->_type != (CPPType *)NULL); + + CPPFunctionType *ftype = inst->_type->as_function_type(); + assert(ftype != (CPPFunctionType *)NULL); + + if (ftype->_parameters->_parameters.size() == 0 || + ftype->_parameters->_parameters.front()->_initializer != NULL) { + // It takes 0 parameters (or all parameters have default values). + return inst; + } + } + + return (CPPInstance *)NULL; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::get_copy_constructor +// Access: Public +// Description: Returns the copy constructor defined for the struct +// type, or NULL if no copy constructor exists. +//////////////////////////////////////////////////////////////////// +CPPInstance *CPPStructType:: +get_copy_constructor() const { + CPPFunctionGroup *fgroup = get_constructor(); + if (fgroup == (CPPFunctionGroup *)NULL) { + return (CPPInstance *)NULL; + } + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); + ii != fgroup->_instances.end(); + ++ii) { + CPPInstance *inst = (*ii); + assert(inst->_type != (CPPType *)NULL); + + CPPFunctionType *ftype = inst->_type->as_function_type(); + assert(ftype != (CPPFunctionType *)NULL); + + if ((ftype->_flags & CPPFunctionType::F_copy_constructor) != 0) { + return inst; + } + } + + return (CPPInstance *)NULL; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::get_move_constructor +// Access: Public +// Description: Returns the move constructor defined for the struct +// type, or NULL if no move constructor exists. +//////////////////////////////////////////////////////////////////// +CPPInstance *CPPStructType:: +get_move_constructor() const { + CPPFunctionGroup *fgroup = get_constructor(); + if (fgroup == (CPPFunctionGroup *)NULL) { + return (CPPInstance *)NULL; + } + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); + ii != fgroup->_instances.end(); + ++ii) { + CPPInstance *inst = (*ii); + assert(inst->_type != (CPPType *)NULL); + + CPPFunctionType *ftype = inst->_type->as_function_type(); + assert(ftype != (CPPFunctionType *)NULL); + + if ((ftype->_flags & CPPFunctionType::F_move_constructor) != 0) { + return inst; + } + } + + return (CPPInstance *)NULL; +} + //////////////////////////////////////////////////////////////////// // Function: CPPStructType::get_destructor // Access: Public @@ -584,7 +870,10 @@ get_virtual_funcs(VFunctions &funcs) const { CPPFunctionType *base_ftype = inst->_type->as_function_type(); assert(base_ftype != (CPPFunctionType *)NULL); - if ((base_ftype->_flags & CPPFunctionType::F_destructor) != 0) { + if (inst->_storage_class & CPPInstance::SC_deleted) { + // Ignore deleted functions. + + } else if ((base_ftype->_flags & CPPFunctionType::F_destructor) != 0) { // Match destructor-for-destructor; don't try to match // destructors up by name. CPPInstance *destructor = get_destructor(); @@ -646,7 +935,8 @@ get_virtual_funcs(VFunctions &funcs) const { ii != fgroup->_instances.end(); ++ii) { CPPInstance *inst = (*ii); - if ((inst->_storage_class & CPPInstance::SC_virtual) != 0) { + if ((inst->_storage_class & CPPInstance::SC_virtual) != 0 && + (inst->_storage_class & CPPInstance::SC_deleted) == 0) { // Here's a virtual function. funcs.push_back(inst); } diff --git a/dtool/src/cppparser/cppStructType.h b/dtool/src/cppparser/cppStructType.h index 66f9381964..a08ecb6c56 100644 --- a/dtool/src/cppparser/cppStructType.h +++ b/dtool/src/cppparser/cppStructType.h @@ -46,12 +46,19 @@ public: CPPScope *get_scope() const; bool is_abstract() const; - bool check_virtual(); + bool check_virtual() const; virtual bool is_fully_specified() const; virtual bool is_incomplete() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; + bool is_default_constructible(CPPVisibility min_vis) const; + bool is_copy_constructible(CPPVisibility min_vis) const; CPPFunctionGroup *get_constructor() const; + CPPInstance *get_default_constructor() const; + CPPInstance *get_copy_constructor() const; + CPPInstance *get_move_constructor() const; CPPInstance *get_destructor() const; virtual CPPDeclaration * diff --git a/dtool/src/cppparser/cppType.cxx b/dtool/src/cppparser/cppType.cxx index c94cfbd759..d3818ca8e9 100644 --- a/dtool/src/cppparser/cppType.cxx +++ b/dtool/src/cppparser/cppType.cxx @@ -79,6 +79,26 @@ is_trivial() const { return false; } +//////////////////////////////////////////////////////////////////// +// Function: CPPType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPType:: +is_default_constructible() const { + return false; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPType:: +is_copy_constructible() const { + return false; +} + //////////////////////////////////////////////////////////////////// // Function: CPPType::is_parameter_expr // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppType.h b/dtool/src/cppparser/cppType.h index 824a71e3c4..6992ac0890 100644 --- a/dtool/src/cppparser/cppType.h +++ b/dtool/src/cppparser/cppType.h @@ -49,6 +49,8 @@ public: virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_parameter_expr() const; bool has_typedef_name() const; diff --git a/dtool/src/cppparser/cppTypedefType.cxx b/dtool/src/cppparser/cppTypedefType.cxx index 1cc31e4b4e..b8eeb4ee8e 100644 --- a/dtool/src/cppparser/cppTypedefType.cxx +++ b/dtool/src/cppparser/cppTypedefType.cxx @@ -189,6 +189,26 @@ is_trivial() const { return _type->is_trivial(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPTypedefType::is_default_constructible +// Access: Public, Virtual +// Description: Returns true if the type is default-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPTypedefType:: +is_default_constructible() const { + return _type->is_default_constructible(); +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPTypedefType::is_copy_constructible +// Access: Public, Virtual +// Description: Returns true if the type is copy-constructible. +//////////////////////////////////////////////////////////////////// +bool CPPTypedefType:: +is_copy_constructible() const { + return _type->is_copy_constructible(); +} + //////////////////////////////////////////////////////////////////// // Function: CPPTypedefType::is_fully_specified // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppTypedefType.h b/dtool/src/cppparser/cppTypedefType.h index 030da91c18..97c4baab82 100644 --- a/dtool/src/cppparser/cppTypedefType.h +++ b/dtool/src/cppparser/cppTypedefType.h @@ -43,6 +43,8 @@ public: virtual bool is_incomplete() const; virtual bool is_tbd() const; virtual bool is_trivial() const; + virtual bool is_default_constructible() const; + virtual bool is_copy_constructible() const; virtual bool is_fully_specified() const; diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index 2f722b7d22..836a51f027 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -39,6 +39,7 @@ using namespace std; #define FINAL #define OVERRIDE #define MOVE(x) x +#define DEFAULT_CTOR = default #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname) @@ -136,59 +137,83 @@ typedef ios::seekdir ios_seekdir; #if defined(__has_extension) // Clang magic. # if __has_extension(cxx_constexpr) # define CONSTEXPR constexpr -# else -# define CONSTEXPR INLINE # endif # if __has_extension(cxx_noexcept) # define NOEXCEPT noexcept -# else -# define NOEXCEPT # endif # if __has_extension(cxx_rvalue_references) && (__cplusplus >= 201103L) # define USE_MOVE_SEMANTICS # define MOVE(x) move(x) -# else -# define MOVE(x) x # endif # if __has_extension(cxx_override_control) && (__cplusplus >= 201103L) # define FINAL final # define OVERRIDE override -# else -# define FINAL -# define OVERRIDE # endif -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && (__cplusplus >= 201103L) -// noexcept was introduced in GCC 4.6, constexpr in GCC 4.7, rvalue refs in -// GCC 4.3. However, GCC only started defining __cplusplus properly in 4.7. +# if __has_extension(cxx_defaulted_functions) +# define DEFAULT_CTOR = default +# endif +#elif defined(__GNUC__) && (__cplusplus >= 201103L) // GCC + +// GCC defines several macros which we can query. +// List of all supported builtin macros: https://gcc.gnu.org/projects/cxx0x.html +# if __cpp_constexpr >= 200704 +# define CONSTEXPR constexpr +# endif + +// Starting at GCC 4.4 +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define DEFAULT_CTOR = default +# endif + +// Starting at GCC 4.6 +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# define NOEXCEPT noexcept +# define USE_MOVE_SEMANTICS +# define FINAL final +# define MOVE(x) move(x) +# endif + +// Starting at GCC 4.7 +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) +# define OVERRIDE override +# endif + +#elif defined(_MSC_VER) && _MSC_VER >= 1900 // Visual Studio 2015 # define CONSTEXPR constexpr # define NOEXCEPT noexcept # define USE_MOVE_SEMANTICS # define FINAL final # define OVERRIDE override # define MOVE(x) move(x) -#elif defined(_MSC_VER) && _MSC_VER >= 1900 -// MSVC 2015 supports all of this goodness. -# define CONSTEXPR constexpr -# define NOEXCEPT noexcept -# define USE_MOVE_SEMANTICS -# define FINAL final -# define OVERRIDE override -# define MOVE(x) move(x) -#elif defined(_MSC_VER) && _MSC_VER >= 1600 -// MSVC 2010 has move semantics. Not much else. -# define CONSTEXPR INLINE +# define DEFAULT_CTOR = default +#elif defined(_MSC_VER) && _MSC_VER >= 1600 // Visual Studio 2010 # define NOEXCEPT throw() +# define OVERRIDE override # define USE_MOVE_SEMANTICS -# define FINAL -# define OVERRIDE +# define FINAL sealed # define MOVE(x) move(x) -#else +#endif + +// Fallbacks if features are not supported +#ifndef CONSTEXPR # define CONSTEXPR INLINE +#endif +#ifndef NOEXCEPT # define NOEXCEPT -# define FINAL -# define OVERRIDE +#endif +#ifndef MOVE # define MOVE(x) x #endif +#ifndef FINAL +# define FINAL +#endif +#ifndef OVERRIDE +# define OVERRIDE +#endif +#ifndef DEFAULT_CTOR +# define DEFAULT_CTOR {} +#endif + #if !defined(LINK_ALL_STATIC) && defined(EXPORT_TEMPLATES) // This macro must be used to export an instantiated template class diff --git a/dtool/src/dtoolutil/unicodeLatinMap.cxx b/dtool/src/dtoolutil/unicodeLatinMap.cxx index f68fd13f3c..081f6f9693 100644 --- a/dtool/src/dtoolutil/unicodeLatinMap.cxx +++ b/dtool/src/dtoolutil/unicodeLatinMap.cxx @@ -1306,6 +1306,74 @@ static const UnicodeLatinMap::Entry latin_map[] = { static const size_t latin_map_length = sizeof(latin_map) / sizeof(UnicodeLatinMap::Entry); #endif +static const wchar_t combining_accent_map[] = { + 0x0000, // none + 0x0301, // acute + 0x0000, // acute_and_dot_above + 0x0306, // breve + 0x0000, // breve_and_acute + 0x0000, // breve_and_dot_below + 0x0000, // breve_and_grave + 0x0000, // breve_and_hook_above + 0x0000, // breve_and_tilde + 0x032e, // breve_below + 0x030c, // caron + 0x0000, // caron_and_dot_above + 0x0327, // cedilla + 0x0000, // cedilla_and_acute + 0x0000, // cedilla_and_breve + 0x0302, // circumflex + 0x0000, // circumflex_and_acute + 0x0000, // circumflex_and_dot_below + 0x0000, // circumflex_and_grave + 0x0000, // circumflex_and_hook_above + 0x0000, // circumflex_and_tilde + 0x032d, // circumflex_below + 0x0326, // comma_below + 0x0000, // curl + 0x0308, // diaeresis + 0x0000, // diaeresis_and_acute + 0x0000, // diaeresis_and_caron + 0x0000, // diaeresis_and_grave + 0x0000, // diaeresis_and_macron + 0x0324, // diaeresis_below + 0x0307, // dot_above + 0x0000, // dot_above_and_macron + 0x0323, // dot_below + 0x0000, // dot_below_and_dot_above + 0x0000, // dot_below_and_macron + 0x030b, // double_acute + 0x030f, // double_grave + 0x0300, // grave + 0x0328, // hook + 0x0309, // hook_above + 0x031b, // horn + 0x0000, // horn_and_acute + 0x0000, // horn_and_dot_below + 0x0000, // horn_and_grave + 0x0000, // horn_and_hook_above + 0x0000, // horn_and_tilde + 0x0311, // inverted_breve + 0x0000, // line_below + 0x0304, // macron + 0x0000, // macron_and_acute + 0x0000, // macron_and_diaeresis + 0x0000, // macron_and_grave + 0x0328, // ogonek + 0x0000, // ogonek_and_macron + 0x030a, // ring_above + 0x0000, // ring_above_and_acute + 0x0325, // ring_below + 0x0000, // stroke + 0x0000, // stroke_and_acute + 0x0000, // stroke_and_hook + 0x0303, // tilde + 0x0000, // tilde_and_acute + 0x0000, // tilde_and_diaeresis + 0x0000, // tilde_and_macron + 0x0330, // tilde_below + 0x0000, // topbar +}; //////////////////////////////////////////////////////////////////// // Function: UnicodeLatinMap::look_up @@ -1332,6 +1400,18 @@ look_up(wchar_t character) { } } +//////////////////////////////////////////////////////////////////// +// Function: UnicodeLatinMap::get_combining_accent +// Access: Public, Static +// Description: Returns the unicode code point for the combining +// character corresponding with the given accent type, +// or 0 if none is recorded. +//////////////////////////////////////////////////////////////////// +wchar_t UnicodeLatinMap:: +get_combining_accent(AccentType accent) { + return combining_accent_map[(size_t)accent]; +} + //////////////////////////////////////////////////////////////////// // Function: UnicodeLatinMap::init // Access: Private, Static diff --git a/dtool/src/dtoolutil/unicodeLatinMap.h b/dtool/src/dtoolutil/unicodeLatinMap.h index a221cea15d..90883221d5 100644 --- a/dtool/src/dtoolutil/unicodeLatinMap.h +++ b/dtool/src/dtoolutil/unicodeLatinMap.h @@ -129,6 +129,8 @@ public: static const Entry *look_up(wchar_t character); + static wchar_t get_combining_accent(AccentType accent); + private: static void init(); static bool _initialized; diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 3f28d17ae3..7b91c8dd25 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -5925,6 +5925,10 @@ write_function_instance(ostream &out, FunctionRemap *remap, indent(out, indent_level) << "return DTool_PyInit_Finalize(self, (void *)" << return_expr << ", &" << CLASS_PREFIX << make_safe_name(itype.get_scoped_name()) << ", true, false);\n"; + } else if (TypeManager::is_bool(orig_type)) { + // It's an error return boolean, I guess. Return 0 on success. + indent(out, indent_level) << "return (" << return_expr << ") ? 0 : -1;\n"; + } else if (TypeManager::is_integer(orig_type)) { if ((return_flags & RF_compare) == RF_compare) { // Make sure it returns -1, 0, or 1, or Python complains with: diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index efac2a7902..f70f4ff90a 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1134,8 +1134,8 @@ scan_function(CPPInstance *function) { return; } - if ((function->_storage_class & CPPInstance::SC_static) != 0) { - // The function is static, so can't be exported. + if ((function->_storage_class & (CPPInstance::SC_static | CPPInstance::SC_deleted)) != 0) { + // The function is static or deleted, so can't be exported. return; } @@ -2684,6 +2684,52 @@ define_struct_type(InterrogateType &itype, CPPStructType *cpptype, } } + // See if we need to generate an implicit default constructor. + CPPFunctionGroup *constructor = cpptype->get_constructor(); + if (constructor == (CPPFunctionGroup *)NULL && cpptype->is_default_constructible()) { + // Make a default constructor. + CPPType *void_type = TypeManager::get_void_type(); + CPPParameterList *params = new CPPParameterList; + CPPFunctionType *ftype = new CPPFunctionType(void_type, params, CPPFunctionType::F_constructor); + + // Now make up an instance for the default constructor. + CPPInstance *function = new CPPInstance(ftype, cpptype->get_simple_name()); + function->_storage_class |= CPPInstance::SC_inline | CPPInstance::SC_defaulted; + function->_vis = V_published; + + FunctionIndex index = get_function(function, "", cpptype, cpptype->get_scope(), 0); + if (find(itype._constructors.begin(), itype._constructors.end(), + index) == itype._constructors.end()) { + itype._constructors.push_back(index); + } + } + + // See if we need to generate an implicit copy constructor. + CPPInstance *copy_constructor = cpptype->get_copy_constructor(); + if (copy_constructor == (CPPInstance *)NULL && + cpptype->is_copy_constructible()) { + // Make an implicit copy constructor. + CPPType *const_ref_type = TypeManager::wrap_const_reference(cpptype); + CPPInstance *param = new CPPInstance(const_ref_type, NULL); + + CPPType *void_type = TypeManager::get_void_type(); + CPPParameterList *params = new CPPParameterList; + params->_parameters.push_back(param); + const int flags = CPPFunctionType::F_constructor | CPPFunctionType::F_copy_constructor; + CPPFunctionType *ftype = new CPPFunctionType(void_type, params, flags); + + // Now make up an instance for the copy constructor. + CPPInstance *function = new CPPInstance(ftype, cpptype->get_simple_name()); + function->_storage_class |= CPPInstance::SC_inline | CPPInstance::SC_defaulted; + function->_vis = V_published; + + FunctionIndex index = get_function(function, "", cpptype, cpptype->get_scope(), 0); + if (find(itype._constructors.begin(), itype._constructors.end(), + index) == itype._constructors.end()) { + itype._constructors.push_back(index); + } + } + if ((itype._flags & InterrogateType::F_inherited_destructor) != 0) { // If we have inherited our virtual destructor from our base // class, go ahead and assign the same function index. @@ -2821,6 +2867,11 @@ define_method(CPPInstance *function, InterrogateType &itype, return; } + if (function->_storage_class & CPPInstance::SC_deleted) { + // It was explicitly marked as deleted. + return; + } + // As a special kludgey extension, we consider a public static // method called "get_class_type()" to be marked published, even if // it is not. This allows us to export all of the TypeHandle system diff --git a/dtool/src/parser-inc/Eigen/Dense b/dtool/src/parser-inc/Eigen/Dense index ab3fac8475..4219dc4652 100644 --- a/dtool/src/parser-inc/Eigen/Dense +++ b/dtool/src/parser-inc/Eigen/Dense @@ -1,4 +1,5 @@ namespace Eigen { - template - class Matrix; + template + class Matrix { + }; }; diff --git a/dtool/src/parser-inc/iostream b/dtool/src/parser-inc/iostream index 82357c0b96..6ba0763c44 100644 --- a/dtool/src/parser-inc/iostream +++ b/dtool/src/parser-inc/iostream @@ -59,6 +59,8 @@ __published: protected: // Force this to be a non-trivial type. ios_base() {}; +private: + ios_base(const ios_base &); }; class ios : public ios_base { __published: @@ -69,6 +71,9 @@ __published: bool fail() const; bool bad() const; void clear(); + +protected: + ios(); }; // We actually want to wrap streampos as streamoff. @@ -76,6 +81,8 @@ __published: class ostream : virtual public ios { __published: + ostream(const ostream&) = delete; + void put(char c); void flush(); streampos tellp(); @@ -84,6 +91,8 @@ __published: }; class istream : virtual public ios { __published: + istream(const istream&) = delete; + int get(); streampos tellg(); void seekg(streampos pos); @@ -91,6 +100,8 @@ __published: }; class iostream : public istream, public ostream { __published: + iostream(const iostream&) = delete; + void flush(); }; diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index 03c24ffaa1..e159e81e90 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/panda/src/bullet/bulletBodyNode.cxx @@ -644,7 +644,7 @@ add_shapes_from_collision_solids(CollisionNode *cnode) { // CollisionBox else if (CollisionBox::get_class_type() == type) { CPT(CollisionBox) box = DCAST(CollisionBox, solid); - CPT(TransformState) ts = TransformState::make_pos(box->get_approx_center()); + CPT(TransformState) ts = TransformState::make_pos(box->get_center()); add_shape(BulletBoxShape::make_from_solid(box), ts); } diff --git a/panda/src/collide/collisionBox.I b/panda/src/collide/collisionBox.I index c99850f1c8..20776bf880 100644 --- a/panda/src/collide/collisionBox.I +++ b/panda/src/collide/collisionBox.I @@ -130,6 +130,26 @@ get_center() const { return _center; } +//////////////////////////////////////////////////////////////////// +// Function: CollisionBox::get_min +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE const LPoint3 &CollisionBox:: +get_min() const { + return _min; +} + +//////////////////////////////////////////////////////////////////// +// Function: CollisionBox::get_max +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE const LPoint3 &CollisionBox:: +get_max() const { + return _max; +} + //////////////////////////////////////////////////////////////////// // Function: CollisionBox::get_dimensions // Access: Published @@ -140,22 +160,12 @@ get_dimensions() const { return _max - _min; } -//////////////////////////////////////////////////////////////////// -// Function: CollisionBox::get_radius -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE PN_stdfloat CollisionBox:: -get_radius() const { - return _radius; -} - //////////////////////////////////////////////////////////////////// // Function: CollisionBox::get_num_points // Access: Published // Description: Returns 8: the number of vertices of a rectangular solid. //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL int CollisionBox:: +INLINE int CollisionBox:: get_num_points() const { return 8; } @@ -165,7 +175,7 @@ get_num_points() const { // Access: Published // Description: Returns the nth vertex of the OBB. //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL LPoint3 CollisionBox:: +INLINE LPoint3 CollisionBox:: get_point(int n) const { nassertr(n >= 0 && n < 8, LPoint3::zero()); return _vertex[n]; @@ -177,7 +187,7 @@ get_point(int n) const { // Access: Published // Description: Returns the nth vertex of the Axis Aligned Bounding Box. //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL LPoint3 CollisionBox:: +INLINE LPoint3 CollisionBox:: get_point_aabb(int n) const { nassertr(n >= 0 && n < 8, LPoint3::zero()); @@ -192,7 +202,7 @@ get_point_aabb(int n) const { // Access: Published // Description: Returns 6: the number of faces of a rectangular solid. //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL int CollisionBox:: +INLINE int CollisionBox:: get_num_planes() const { return 6; } @@ -202,7 +212,7 @@ get_num_planes() const { // Access: Published // Description: Returns the nth face of the rectangular solid. //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL LPlane CollisionBox:: +INLINE LPlane CollisionBox:: get_plane(int n) const { nassertr(n >= 0 && n < 6, LPlane()); return _planes[n]; @@ -213,7 +223,7 @@ get_plane(int n) const { // Access: Published // Description: Creates the nth face of the rectangular solid. //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL LPlane CollisionBox:: +INLINE LPlane CollisionBox:: set_plane(int n) const { nassertr(n >= 0 && n < 6, LPlane()); return LPlane(get_point(plane_def[n][0]), diff --git a/panda/src/collide/collisionBox.cxx b/panda/src/collide/collisionBox.cxx index 98e80bb1bc..c508061f30 100644 --- a/panda/src/collide/collisionBox.cxx +++ b/panda/src/collide/collisionBox.cxx @@ -175,36 +175,6 @@ get_collision_origin() const { return _center; } -//////////////////////////////////////////////////////////////////// -// Function: CollisionBox::get_min -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -LPoint3 CollisionBox:: -get_min() const { - return _min; -} - -//////////////////////////////////////////////////////////////////// -// Function: CollisionBox::get_max -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -LPoint3 CollisionBox:: -get_max() const { - return _max; -} - -//////////////////////////////////////////////////////////////////// -// Function: CollisionBox::get_approx_center -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -LPoint3 CollisionBox:: -get_approx_center() const { - return (_min + _max) * 0.5f; -} - //////////////////////////////////////////////////////////////////// // Function: CollisionBox::get_volume_pcollector // Access: Public, Virtual @@ -442,9 +412,14 @@ test_intersection_from_sphere(const CollisionEntry &entry) const { into_depth = max_dist - orig_dist; } + // Clamp the surface point to the box bounds. + LPoint3 surface = from_center - normal * dist; + surface = surface.fmax(_min); + surface = surface.fmin(_max); + new_entry->set_surface_normal(normal); - new_entry->set_surface_point(from_center - normal * dist); - new_entry->set_interior_point(from_center - normal * (dist + into_depth)); + new_entry->set_surface_point(surface); + new_entry->set_interior_point(surface - normal * into_depth); new_entry->set_contact_pos(contact_point); new_entry->set_contact_normal(plane.get_normal()); new_entry->set_t(actual_t); @@ -655,56 +630,83 @@ test_intersection_from_box(const CollisionEntry &entry) const { box_z /= l; PN_stdfloat r1, r2; + PN_stdfloat min_pen = 0; + PN_stdfloat pen; + int axis = 0; // SAT test for the three axes of the into cube. r1 = into_extents[0]; r2 = cabs(box_x[0] * from_extents[0]) + cabs(box_y[0] * from_extents[1]) + cabs(box_z[0] * from_extents[2]); - if (cabs(diff[0]) > r1 + r2) { + pen = r1 + r2 - cabs(diff[0]); + if (pen < 0) { return NULL; } + min_pen = pen; r1 = into_extents[1]; r2 = cabs(box_x[1] * from_extents[0]) + cabs(box_y[1] * from_extents[1]) + cabs(box_z[1] * from_extents[2]); - if (cabs(diff[1]) > r1 + r2) { + pen = r1 + r2 - cabs(diff[1]); + if (pen < 0) { return NULL; } + if (pen < min_pen) { + min_pen = pen; + axis = 1; + } r1 = into_extents[2]; r2 = cabs(box_x[2] * from_extents[0]) + cabs(box_y[2] * from_extents[1]) + cabs(box_z[2] * from_extents[2]); - if (cabs(diff[2]) > r1 + r2) { + pen = r1 + r2 - cabs(diff[2]); + if (pen < 0) { return NULL; } + if (pen < min_pen) { + min_pen = pen; + axis = 2; + } // SAT test for the three axes of the from cube. r1 = cabs(box_x[0] * into_extents[0]) + cabs(box_x[1] * into_extents[1]) + cabs(box_x[2] * into_extents[2]); r2 = from_extents[0]; - if (cabs(diff.dot(box_x)) > r1 + r2) { + pen = r1 + r2 - cabs(diff.dot(box_x)); + if (pen < 0) { return NULL; } + if (pen < min_pen) { + min_pen = pen; + } r1 = cabs(box_y[0] * into_extents[0]) + cabs(box_y[1] * into_extents[1]) + cabs(box_y[2] * into_extents[2]); r2 = from_extents[1]; - if (cabs(diff.dot(box_y)) > r1 + r2) { + pen = r1 + r2 - cabs(diff.dot(box_y)); + if (pen < 0) { return NULL; } + if (pen < min_pen) { + min_pen = pen; + } r1 = cabs(box_z[0] * into_extents[0]) + cabs(box_z[1] * into_extents[1]) + cabs(box_z[2] * into_extents[2]); r2 = from_extents[2]; - if (cabs(diff.dot(box_z)) > r1 + r2) { + pen = r1 + r2 - cabs(diff.dot(box_z)); + if (pen < 0) { return NULL; } + if (pen < min_pen) { + min_pen = pen; + } // SAT test of the nine cross products. r1 = into_extents[1] * cabs(box_x[2]) + into_extents[2] * cabs(box_x[1]); @@ -768,8 +770,29 @@ test_intersection_from_box(const CollisionEntry &entry) const { } PT(CollisionEntry) new_entry = new CollisionEntry(entry); + // This isn't always the correct surface point. However, it seems to + // be enough to let the pusher do the right thing. + LPoint3 surface( + min(max(diff[0], -into_extents[0]), into_extents[0]), + min(max(diff[1], -into_extents[1]), into_extents[1]), + min(max(diff[2], -into_extents[2]), into_extents[2])); + + // Create the normal along the axis of least penetration. + LVector3 normal(0); + PN_stdfloat diff_axis = diff[axis]; + int sign = (diff_axis >= 0) ? 1 : -1; + normal[axis] = sign; + surface[axis] = into_extents[axis] * sign; + + new_entry->set_surface_point(surface + _center); + + // Does not generate the correct depth. Needs fixing. + new_entry->set_interior_point(surface + _center + normal * -min_pen); + if (has_effective_normal() && box->get_respect_effective_normal()) { new_entry->set_surface_normal(get_effective_normal()); + } else { + new_entry->set_surface_normal(normal); } return new_entry; diff --git a/panda/src/collide/collisionBox.h b/panda/src/collide/collisionBox.h index 1d875b9876..12db41697c 100644 --- a/panda/src/collide/collisionBox.h +++ b/panda/src/collide/collisionBox.h @@ -50,26 +50,29 @@ public: virtual PStatCollector &get_test_pcollector(); virtual void output(ostream &out) const; - - virtual LPoint3 get_approx_center() const; - virtual LPoint3 get_min() const; - virtual LPoint3 get_max() const; INLINE static void flush_level(); void setup_box(); PUBLISHED: - INLINE_MATHUTIL int get_num_points() const; - INLINE_MATHUTIL LPoint3 get_point_aabb(int n) const; - INLINE_MATHUTIL LPoint3 get_point(int n) const; - INLINE_MATHUTIL int get_num_planes() const; - INLINE_MATHUTIL LPlane set_plane(int n) const; - INLINE_MATHUTIL LPlane get_plane(int n) const; + INLINE int get_num_points() const; + INLINE LPoint3 get_point_aabb(int n) const; + INLINE LPoint3 get_point(int n) const; + INLINE int get_num_planes() const; + INLINE LPlane set_plane(int n) const; + INLINE LPlane get_plane(int n) const; INLINE void set_center(const LPoint3 ¢er); INLINE void set_center(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z); INLINE const LPoint3 &get_center() const; + INLINE const LPoint3 &get_min() const; + INLINE const LPoint3 &get_max() const; INLINE LVector3 get_dimensions() const; - INLINE PN_stdfloat get_radius() const; + +PUBLISHED: + MAKE_PROPERTY(center, get_center); + MAKE_PROPERTY(min, get_min); + MAKE_PROPERTY(max, get_max); + MAKE_PROPERTY(dimensions, get_dimensions); protected: virtual PT(BoundingVolume) compute_internal_bounds() const; diff --git a/panda/src/collide/collisionEntry.h b/panda/src/collide/collisionEntry.h index 5225ff1117..8826e6a382 100644 --- a/panda/src/collide/collisionEntry.h +++ b/panda/src/collide/collisionEntry.h @@ -97,6 +97,17 @@ PUBLISHED: void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; +PUBLISHED: + MAKE_PROPERTY(from, get_from); + MAKE_PROPERTY(into, get_into); + MAKE_PROPERTY(from_node, get_from_node); + MAKE_PROPERTY(into_node, get_into_node); + MAKE_PROPERTY(from_node_path, get_from_node_path); + MAKE_PROPERTY(into_node_path, get_into_node_path); + + MAKE_PROPERTY(t, get_t, set_t); + MAKE_PROPERTY(respect_prev_transform, get_respect_prev_transform); + public: INLINE CPT(TransformState) get_wrt_space() const; INLINE CPT(TransformState) get_inv_wrt_space() const; diff --git a/panda/src/collide/collisionHandlerFloor.h b/panda/src/collide/collisionHandlerFloor.h index 931cec023d..3f4eece73a 100644 --- a/panda/src/collide/collisionHandlerFloor.h +++ b/panda/src/collide/collisionHandlerFloor.h @@ -42,6 +42,11 @@ PUBLISHED: INLINE void set_max_velocity(PN_stdfloat max_vel); INLINE PN_stdfloat get_max_velocity() const; +PUBLISHED: + MAKE_PROPERTY(offset, get_offset, set_offset); + MAKE_PROPERTY(reach, get_reach, set_reach); + MAKE_PROPERTY(max_velocity, get_max_velocity, set_max_velocity); + protected: PN_stdfloat set_highest_collision(const NodePath &target_node_path, const NodePath &from_node_path, const Entries &entries); virtual bool handle_entries(); diff --git a/panda/src/collide/collisionHandlerGravity.h b/panda/src/collide/collisionHandlerGravity.h index fccf527c8c..6f57899c1c 100644 --- a/panda/src/collide/collisionHandlerGravity.h +++ b/panda/src/collide/collisionHandlerGravity.h @@ -57,6 +57,17 @@ PUBLISHED: INLINE void set_legacy_mode(bool legacy_mode); INLINE bool get_legacy_mode() const; +PUBLISHED: + MAKE_PROPERTY(offset, get_offset, set_offset); + MAKE_PROPERTY(reach, get_reach, set_reach); + MAKE_PROPERTY(airborne_height, get_airborne_height); + MAKE_PROPERTY(on_ground, is_on_ground); + MAKE_PROPERTY(impact_velocity, get_impact_velocity); + MAKE_PROPERTY(contact_normal, get_contact_normal); + MAKE_PROPERTY(velocity, get_velocity, set_velocity); + MAKE_PROPERTY(gravity, get_gravity, set_gravity); + MAKE_PROPERTY(max_velocity, get_max_velocity, set_max_velocity); + protected: PN_stdfloat set_highest_collision(const NodePath &target_node_path, const NodePath &from_node_path, const Entries &entries); virtual bool handle_entries(); diff --git a/panda/src/collide/collisionHandlerPhysical.h b/panda/src/collide/collisionHandlerPhysical.h index 3dbb4131b4..3feddfbcb1 100644 --- a/panda/src/collide/collisionHandlerPhysical.h +++ b/panda/src/collide/collisionHandlerPhysical.h @@ -54,6 +54,9 @@ PUBLISHED: INLINE bool has_center() const; INLINE bool has_contact() const; +PUBLISHED: + MAKE_PROPERTY2(center, has_center, get_center, set_center, clear_center); + protected: bool _has_contact; // Are we in contact with anything? diff --git a/panda/src/collide/collisionHandlerPusher.h b/panda/src/collide/collisionHandlerPusher.h index 2a690e297d..17630a5954 100644 --- a/panda/src/collide/collisionHandlerPusher.h +++ b/panda/src/collide/collisionHandlerPusher.h @@ -34,6 +34,9 @@ PUBLISHED: INLINE void set_horizontal(bool flag); INLINE bool get_horizontal() const; +PUBLISHED: + MAKE_PROPERTY(horizontal, get_horizontal, set_horizontal); + protected: virtual bool handle_entries(); virtual void apply_net_shove( diff --git a/panda/src/collide/collisionParabola.h b/panda/src/collide/collisionParabola.h index a9f48f7ccf..f2958ad67d 100644 --- a/panda/src/collide/collisionParabola.h +++ b/panda/src/collide/collisionParabola.h @@ -63,6 +63,11 @@ PUBLISHED: INLINE void set_t2(PN_stdfloat t2); INLINE PN_stdfloat get_t2() const; +PUBLISHED: + MAKE_PROPERTY(parabola, get_parabola, set_parabola); + MAKE_PROPERTY(t1, get_t1, set_t1); + MAKE_PROPERTY(t2, get_t2, set_t2); + protected: virtual PT(BoundingVolume) compute_internal_bounds() const; diff --git a/panda/src/collide/collisionPlane.h b/panda/src/collide/collisionPlane.h index ccdc6de91f..db54441b1b 100644 --- a/panda/src/collide/collisionPlane.h +++ b/panda/src/collide/collisionPlane.h @@ -57,6 +57,10 @@ PUBLISHED: INLINE void flip(); +PUBLISHED: + MAKE_PROPERTY(normal, get_normal); + MAKE_PROPERTY(plane, get_plane, set_plane); + protected: virtual PT(BoundingVolume) compute_internal_bounds() const; diff --git a/panda/src/collide/collisionPolygon.h b/panda/src/collide/collisionPolygon.h index 583cf2f080..e200be8407 100644 --- a/panda/src/collide/collisionPolygon.h +++ b/panda/src/collide/collisionPolygon.h @@ -61,6 +61,10 @@ PUBLISHED: bool is_valid() const; bool is_concave() const; +PUBLISHED: + MAKE_PROPERTY(valid, is_valid); + MAKE_PROPERTY(concave, is_concave); + public: virtual void xform(const LMatrix4 &mat); diff --git a/panda/src/collide/collisionSegment.h b/panda/src/collide/collisionSegment.h index a45ac4ff6b..031446cfb6 100644 --- a/panda/src/collide/collisionSegment.h +++ b/panda/src/collide/collisionSegment.h @@ -64,6 +64,10 @@ PUBLISHED: bool set_from_lens(LensNode *camera, const LPoint2 &point); INLINE bool set_from_lens(LensNode *camera, PN_stdfloat px, PN_stdfloat py); +PUBLISHED: + MAKE_PROPERTY(point_a, get_point_a, set_point_a); + MAKE_PROPERTY(point_b, get_point_b, set_point_b); + protected: virtual PT(BoundingVolume) compute_internal_bounds() const; diff --git a/panda/src/collide/collisionSphere.cxx b/panda/src/collide/collisionSphere.cxx index 23e781ddeb..e69cfbdef0 100644 --- a/panda/src/collide/collisionSphere.cxx +++ b/panda/src/collide/collisionSphere.cxx @@ -298,100 +298,50 @@ test_intersection_from_box(const CollisionEntry &entry) const { const CollisionBox *box; DCAST_INTO_R(box, entry.get_from(), 0); - CPT(TransformState) wrt_space = entry.get_wrt_space(); - CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space(); + // Instead of transforming the box into the sphere's coordinate space, + // we do it the other way around. It's easier that way. + const LMatrix4 &wrt_mat = entry.get_inv_wrt_mat(); - const LMatrix4 &wrt_mat = wrt_space->get_mat(); + LPoint3 center = wrt_mat.xform_point(_center); + PN_stdfloat radius_sq = wrt_mat.xform_vec(LVector3(0, 0, _radius)).length_squared(); - CollisionBox local_b( *box ); - local_b.xform( wrt_mat ); + LPoint3 box_min = box->get_min(); + LPoint3 box_max = box->get_max(); - LPoint3 from_center = local_b.get_center(); + // Arvo's algorithm. + PN_stdfloat d = 0; + PN_stdfloat s; - LPoint3 orig_center = get_center(); - LPoint3 to_center = orig_center; - LPoint3 contact_point(from_center); - PN_stdfloat actual_t = 1.0f; + if (center[0] < box_min[0]) { + s = center[0] - box_min[0]; + d += s * s; - PN_stdfloat to_radius = get_radius(); - PN_stdfloat to_radius_2 = to_radius * to_radius; - - int ip; - PN_stdfloat max_dist = 0.0f; - PN_stdfloat dist = 0.0f; // initial assignment to squelch silly compiler warning - bool intersect; - LPlane plane; - LVector3 normal; - - for (ip = 0, intersect=false; ip < 6 && !intersect; ip++) { - plane = local_b.get_plane( ip ); - if (local_b.get_plane_points(ip).size() < 3) { - continue; - } - normal = (has_effective_normal() && box->get_respect_effective_normal()) ? get_effective_normal() : plane.get_normal(); - - #ifndef NDEBUG - /* - if (!IS_THRESHOLD_EQUAL(normal.length_squared(), 1.0f, 0.001), NULL) { - collide_cat.info() - << "polygon being collided with " << entry.get_into_node_path() - << " has normal " << normal << " of length " << normal.length() - << "\n"; - normal.normalize(); - } - */ - #endif - - // The nearest point within the plane to our center is the - // intersection of the line (center, center - normal) with the plane. - - if (!plane.intersects_line(dist, to_center, -(plane.get_normal()))) { - // No intersection with plane? This means the plane's effective - // normal was within the plane itself. A useless polygon. - continue; - } - - if (dist > to_radius || dist < -to_radius) { - // No intersection with the plane. - continue; - } - - LPoint2 p = local_b.to_2d(to_center - dist * plane.get_normal(), ip); - PN_stdfloat edge_dist = 0.0f; - - edge_dist = local_b.dist_to_polygon(p, local_b.get_plane_points(ip)); - - if(edge_dist < 0) { - intersect = true; - continue; - } - - if((edge_dist > 0) && - ((edge_dist * edge_dist + dist * dist) > to_radius_2)) { - // No intersection; the circle is outside the polygon. - continue; - } - - // The sphere appears to intersect the polygon. If the edge is less - // than to_radius away, the sphere may be resting on an edge of - // the polygon. Determine how far the center of the sphere must - // remain from the plane, based on its distance from the nearest - // edge. - - max_dist = to_radius; - if (edge_dist >= 0.0f) { - PN_stdfloat max_dist_2 = max(to_radius_2 - edge_dist * edge_dist, (PN_stdfloat)0.0); - max_dist = csqrt(max_dist_2); - } - - if (dist > max_dist) { - // There's no intersection: the sphere is hanging off the edge. - continue; - } - intersect = true; + } else if (center[0] > box_max[0]) { + s = center[0] - box_max[0]; + d += s * s; } - if( !intersect ) + + if (center[1] < box_min[1]) { + s = center[1] - box_min[1]; + d += s * s; + + } else if (center[1] > box_max[1]) { + s = center[1] - box_max[1]; + d += s * s; + } + + if (center[2] < box_min[2]) { + s = center[2] - box_min[2]; + d += s * s; + + } else if (center[2] > box_max[2]) { + s = center[2] - box_max[2]; + d += s * s; + } + + if (d > radius_sq) { return NULL; + } if (collide_cat.is_debug()) { collide_cat.debug() @@ -401,14 +351,17 @@ test_intersection_from_box(const CollisionEntry &entry) const { PT(CollisionEntry) new_entry = new CollisionEntry(entry); - PN_stdfloat into_depth = max_dist - dist; + // To get the interior point, clamp the sphere center to the AABB. + LPoint3 interior = entry.get_wrt_mat().xform_point(center.fmax(box_min).fmin(box_max)); + new_entry->set_interior_point(interior); - new_entry->set_surface_normal(normal); - new_entry->set_surface_point(to_center - normal * dist); - new_entry->set_interior_point(to_center - normal * (dist + into_depth)); - new_entry->set_contact_pos(contact_point); - new_entry->set_contact_normal(plane.get_normal()); - new_entry->set_t(actual_t); + // Now extrapolate the surface point and normal from that. + LVector3 normal = interior - _center; + normal.normalize(); + new_entry->set_surface_point(_center + normal * _radius); + new_entry->set_surface_normal( + (has_effective_normal() && box->get_respect_effective_normal()) + ? get_effective_normal() : normal); return new_entry; } diff --git a/panda/src/collide/collisionSphere.h b/panda/src/collide/collisionSphere.h index d6ebef3c21..8bf9b10381 100644 --- a/panda/src/collide/collisionSphere.h +++ b/panda/src/collide/collisionSphere.h @@ -58,6 +58,10 @@ PUBLISHED: INLINE void set_radius(PN_stdfloat radius); INLINE PN_stdfloat get_radius() const; +PUBLISHED: + MAKE_PROPERTY(center, get_center, set_center); + MAKE_PROPERTY(radius, get_radius, set_radius); + protected: virtual PT(BoundingVolume) compute_internal_bounds() const; diff --git a/panda/src/collide/collisionTraverser.h b/panda/src/collide/collisionTraverser.h index cc98ad43cd..bd87a0879a 100644 --- a/panda/src/collide/collisionTraverser.h +++ b/panda/src/collide/collisionTraverser.h @@ -53,6 +53,8 @@ PUBLISHED: INLINE void set_respect_prev_transform(bool flag); INLINE bool get_respect_prev_transform() const; + MAKE_PROPERTY(respect_preV_transform, get_respect_prev_transform, + set_respect_prev_transform); void add_collider(const NodePath &collider, CollisionHandler *handler); bool remove_collider(const NodePath &collider); @@ -70,6 +72,8 @@ PUBLISHED: INLINE bool has_recorder() const; INLINE CollisionRecorder *get_recorder() const; INLINE void clear_recorder(); + MAKE_PROPERTY2(recorder, has_recorder, get_recorder, + set_recorder, clear_recorder); CollisionVisualizer *show_collisions(const NodePath &root); void hide_collisions(); diff --git a/panda/src/collide/collisionTube.h b/panda/src/collide/collisionTube.h index 90ca393cee..09a00d025e 100644 --- a/panda/src/collide/collisionTube.h +++ b/panda/src/collide/collisionTube.h @@ -65,6 +65,11 @@ PUBLISHED: INLINE void set_radius(PN_stdfloat radius); INLINE PN_stdfloat get_radius() const; +PUBLISHED: + MAKE_PROPERTY(point_a, get_point_a, set_point_a); + MAKE_PROPERTY(point_b, get_point_b, set_point_b); + MAKE_PROPERTY(radius, get_radius, set_radius); + protected: virtual PT(BoundingVolume) compute_internal_bounds() const; diff --git a/panda/src/collide/collisionVisualizer.h b/panda/src/collide/collisionVisualizer.h index 1578bdce9f..e5ddf76833 100644 --- a/panda/src/collide/collisionVisualizer.h +++ b/panda/src/collide/collisionVisualizer.h @@ -47,6 +47,10 @@ PUBLISHED: void clear(); +PUBLISHED: + MAKE_PROPERTY(point_scale, get_point_scale, set_point_scale); + MAKE_PROPERTY(normal_scale, get_normal_scale, set_normal_scale); + public: // from parent class PandaNode. virtual PandaNode *make_copy() const; diff --git a/panda/src/cull/cullBinStateSorted.I b/panda/src/cull/cullBinStateSorted.I index 4b9d2bf601..fd8558e846 100644 --- a/panda/src/cull/cullBinStateSorted.I +++ b/panda/src/cull/cullBinStateSorted.I @@ -33,9 +33,13 @@ CullBinStateSorted(const string &name, GraphicsStateGuardianBase *gsg, //////////////////////////////////////////////////////////////////// INLINE CullBinStateSorted::ObjectData:: ObjectData(CullableObject *object) : - _object(object), - _format(object->_munged_data->get_format()) + _object(object) { + if (object->_munged_data == NULL) { + _format = NULL; + } else { + _format = object->_munged_data->get_format(); + } } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index c005a3a861..f4808f36da 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1067,6 +1067,18 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name, spc[0],spc[1],spc[2],spc[3]); return &t; } + case Shader::SMO_attr_material2: { + const MaterialAttrib *target_material = (const MaterialAttrib *) + _target_rs->get_attrib_def(MaterialAttrib::get_class_slot()); + if (target_material->is_off()) { + t = LMatrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + return &t; + } + Material *m = target_material->get_material(); + t.set_row(0, m->get_base_color()); + t.set_row(3, LVecBase4(m->get_metallic(), m->get_refractive_index(), 0, m->get_roughness())); + return &t; + } case Shader::SMO_attr_color: { const ColorAttrib *target_color = (const ColorAttrib *) _target_rs->get_attrib_def(ColorAttrib::get_class_slot()); @@ -1483,6 +1495,7 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name, const LMatrix4 *GraphicsStateGuardian:: fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) { // This system is not ideal. It will be improved in the future. + static const CPT_InternalName IN_color("color"); static const CPT_InternalName IN_ambient("ambient"); static const CPT_InternalName IN_diffuse("diffuse"); static const CPT_InternalName IN_specular("specular"); @@ -1498,7 +1511,15 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) static const CPT_InternalName IN_quadraticAttenuation("quadraticAttenuation"); static const CPT_InternalName IN_shadowMatrix("shadowMatrix"); - if (attrib == IN_ambient) { + if (attrib == IN_color) { + Light *light = np.node()->as_light(); + nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); + LColor c = light->get_color(); + c.componentwise_mult(_light_color_scale); + t.set_row(3, c); + return &t; + + } else if (attrib == IN_ambient) { Light *light = np.node()->as_light(); nassertr(light != (Light *)NULL, &LMatrix4::ident_mat()); if (np.node()->is_of_type(AmbientLight::get_class_type())) { diff --git a/panda/src/egg/eggMaterial.I b/panda/src/egg/eggMaterial.I index 9fcee231c3..4b6560ec13 100644 --- a/panda/src/egg/eggMaterial.I +++ b/panda/src/egg/eggMaterial.I @@ -13,6 +13,53 @@ //////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::set_base +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void EggMaterial:: +set_base(const LColor &base) { + _base = base; + _flags |= F_base; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::clear_base +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void EggMaterial:: +clear_base() { + _flags &= ~F_base; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::has_base +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool EggMaterial:: +has_base() const { + return (_flags & F_base) != 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::get_base +// Access: Public +// Description: It is legal to call this even if has_base() returns +// false. If so, it simply returns the default base +// color. +//////////////////////////////////////////////////////////////////// +INLINE LColor EggMaterial:: +get_base() const { + if (has_base()) { + return _base; + } else { + return LColor(1.0, 1.0, 1.0, 1.0); + } +} + //////////////////////////////////////////////////////////////////// // Function: EggMaterial::set_diff // Access: Public @@ -336,6 +383,51 @@ get_metallic() const { } } +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::set_ior +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void EggMaterial:: +set_ior(double ior) { + _ior = ior; + _flags |= F_ior; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::clear_ior +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void EggMaterial:: +clear_ior() { + _flags &= ~F_ior; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::has_ior +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool EggMaterial:: +has_ior() const { + return (_flags & F_ior) != 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggMaterial::get_ior +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE double EggMaterial:: +get_ior() const { + if (has_ior()) { + return _ior; + } else { + return 1.0; + } +} + //////////////////////////////////////////////////////////////////// // Function: EggMaterial::set_local // Access: Public diff --git a/panda/src/egg/eggMaterial.cxx b/panda/src/egg/eggMaterial.cxx index 3a7007d025..c9121a0d39 100644 --- a/panda/src/egg/eggMaterial.cxx +++ b/panda/src/egg/eggMaterial.cxx @@ -39,6 +39,7 @@ EggMaterial(const string &mref_name) EggMaterial:: EggMaterial(const EggMaterial ©) : EggNode(copy), + _base(copy._base), _diff(copy._diff), _amb(copy._amb), _emit(copy._emit), @@ -46,6 +47,7 @@ EggMaterial(const EggMaterial ©) _shininess(copy._shininess), _roughness(copy._roughness), _metallic(copy._metallic), + _ior(copy._ior), _local(copy._local), _flags(copy._flags) { @@ -62,6 +64,19 @@ void EggMaterial:: write(ostream &out, int indent_level) const { write_header(out, indent_level, ""); + if (has_base()) { + indent(out, indent_level + 2) + << " baser { " << get_base()[0] << " }\n"; + indent(out, indent_level + 2) + << " baseg { " << get_base()[1] << " }\n"; + indent(out, indent_level + 2) + << " baseb { " << get_base()[2] << " }\n"; + if (get_base()[3] != 1.0) { + indent(out, indent_level + 2) + << " basea { " << get_base()[3] << " }\n"; + } + } + if (has_diff()) { indent(out, indent_level + 2) << " diffr { " << get_diff()[0] << " }\n"; @@ -129,6 +144,11 @@ write(ostream &out, int indent_level) const { << " metallic { " << get_metallic() << " }\n"; } + if (has_ior()) { + indent(out, indent_level + 2) + << " ior { " << get_ior() << " }\n"; + } + if (has_local()) { indent(out, indent_level + 2) << " local { " << get_local() << " }\n"; @@ -159,6 +179,7 @@ bool EggMaterial:: is_equivalent_to(const EggMaterial &other, int eq) const { if (eq & E_attributes) { if (_flags != other._flags || + (has_base() && get_base() != other.get_base()) || (has_diff() && get_diff() != other.get_diff()) || (has_amb() && get_amb() != other.get_amb()) || (has_emit() && get_emit() != other.get_emit()) || @@ -166,6 +187,7 @@ is_equivalent_to(const EggMaterial &other, int eq) const { (has_shininess() && get_shininess() != other.get_shininess()) || (has_roughness() && get_roughness() != other.get_roughness()) || (has_metallic() && get_metallic() != other.get_metallic()) || + (has_ior() && get_ior() != other.get_ior()) || (has_local() && get_local() != other.get_local())) { return false; } @@ -216,6 +238,9 @@ sorts_less_than(const EggMaterial &other, int eq) const { if (has_metallic() && get_metallic() != other.get_metallic()) { return get_metallic() < other.get_metallic(); } + if (has_ior() && get_ior() != other.get_ior()) { + return get_ior() < other.get_ior(); + } if (has_local() && get_local() != other.get_local()) { return get_local() < other.get_local(); } diff --git a/panda/src/egg/eggMaterial.h b/panda/src/egg/eggMaterial.h index 33fcbf8abf..ddc4fcfd60 100644 --- a/panda/src/egg/eggMaterial.h +++ b/panda/src/egg/eggMaterial.h @@ -40,6 +40,11 @@ PUBLISHED: bool is_equivalent_to(const EggMaterial &other, int eq) const; bool sorts_less_than(const EggMaterial &other, int eq) const; + INLINE void set_base(const LColor &base); + INLINE void clear_base(); + INLINE bool has_base() const; + INLINE LColor get_base() const; + INLINE void set_diff(const LColor &diff); INLINE void clear_diff(); INLINE bool has_diff() const; @@ -75,12 +80,18 @@ PUBLISHED: INLINE bool has_metallic() const; INLINE double get_metallic() const; + INLINE void set_ior(double ior); + INLINE void clear_ior(); + INLINE bool has_ior() const; + INLINE double get_ior() const; + INLINE void set_local(bool local); INLINE void clear_local(); INLINE bool has_local() const; INLINE bool get_local() const; PUBLISHED: + MAKE_PROPERTY2(base, has_base, get_base, set_base, clear_base); MAKE_PROPERTY2(diff, has_diff, get_diff, set_diff, clear_diff); MAKE_PROPERTY2(amb, has_amb, get_amb, set_amb, clear_amb); MAKE_PROPERTY2(emit, has_emit, get_emit, set_emit, clear_emit); @@ -88,21 +99,25 @@ PUBLISHED: MAKE_PROPERTY2(shininess, has_shininess, get_shininess, set_shininess, clear_shininess); MAKE_PROPERTY2(roughness, has_roughness, get_roughness, set_roughness, clear_roughness); MAKE_PROPERTY2(metallic, has_metallic, get_metallic, set_metallic, clear_metallic); + MAKE_PROPERTY2(ior, has_ior, get_ior, set_ior, clear_ior); MAKE_PROPERTY2(local, has_local, get_local, set_local, clear_local); private: enum Flags { - F_diff = 0x001, - F_amb = 0x002, - F_emit = 0x004, - F_spec = 0x008, - F_shininess = 0x010, - F_roughness = 0x020, - F_metallic = 0x040, - F_local = 0x080 + F_base = 0x001, + F_diff = 0x002, + F_amb = 0x004, + F_emit = 0x008, + F_spec = 0x010, + F_shininess = 0x020, + F_roughness = 0x040, + F_metallic = 0x080, + F_ior = 0x100, + F_local = 0x200 }; + LColor _base; LColor _diff; LColor _amb; LColor _emit; @@ -110,6 +125,7 @@ private: double _shininess; double _roughness; double _metallic; + double _ior; bool _local; int _flags; diff --git a/panda/src/egg/parser.cxx.prebuilt b/panda/src/egg/parser.cxx.prebuilt index 63c27af88e..7791e8de4a 100644 --- a/panda/src/egg/parser.cxx.prebuilt +++ b/panda/src/egg/parser.cxx.prebuilt @@ -2933,7 +2933,24 @@ yyreduce: string name = (yyvsp[(3) - (6)]._string); double value = (yyvsp[(5) - (6)]._number); - if (cmp_nocase_uh(name, "diffr") == 0) { + if (cmp_nocase_uh(name, "baser") == 0) { + LColor base = material->get_base(); + base[0] = value; + material->set_base(base); + } else if (cmp_nocase_uh(name, "baseg") == 0) { + LColor base = material->get_base(); + base[1] = value; + material->set_base(base); + } else if (cmp_nocase_uh(name, "baseb") == 0) { + LColor base = material->get_base(); + base[2] = value; + material->set_base(base); + } else if (cmp_nocase_uh(name, "basea") == 0) { + LColor base = material->get_base(); + base[3] = value; + material->set_base(base); + + } else if (cmp_nocase_uh(name, "diffr") == 0) { LColor diff = material->get_diff(); diff[0] = value; material->set_diff(diff); @@ -3010,6 +3027,9 @@ yyreduce: } else if (cmp_nocase_uh(name, "metallic") == 0) { material->set_metallic(value); + } else if (cmp_nocase_uh(name, "ior") == 0) { + material->set_ior(value); + } else if (cmp_nocase_uh(name, "local") == 0) { material->set_local(value != 0.0); diff --git a/panda/src/egg/parser.yxx b/panda/src/egg/parser.yxx index f786ac8d71..5dbb8f743d 100644 --- a/panda/src/egg/parser.yxx +++ b/panda/src/egg/parser.yxx @@ -757,7 +757,24 @@ material_body: string name = $3; double value = $<_number>5; - if (cmp_nocase_uh(name, "diffr") == 0) { + if (cmp_nocase_uh(name, "baser") == 0) { + LColor base = material->get_base(); + base[0] = value; + material->set_base(base); + } else if (cmp_nocase_uh(name, "baseg") == 0) { + LColor base = material->get_base(); + base[1] = value; + material->set_base(base); + } else if (cmp_nocase_uh(name, "baseb") == 0) { + LColor base = material->get_base(); + base[2] = value; + material->set_base(base); + } else if (cmp_nocase_uh(name, "basea") == 0) { + LColor base = material->get_base(); + base[3] = value; + material->set_base(base); + + } else if (cmp_nocase_uh(name, "diffr") == 0) { LColor diff = material->get_diff(); diff[0] = value; material->set_diff(diff); @@ -834,6 +851,9 @@ material_body: } else if (cmp_nocase_uh(name, "metallic") == 0) { material->set_metallic(value); + } else if (cmp_nocase_uh(name, "ior") == 0) { + material->set_ior(value); + } else if (cmp_nocase_uh(name, "local") == 0) { material->set_local(value != 0.0); diff --git a/panda/src/egg2pg/eggRenderState.cxx b/panda/src/egg2pg/eggRenderState.cxx index 426240d998..079aca3beb 100644 --- a/panda/src/egg2pg/eggRenderState.cxx +++ b/panda/src/egg2pg/eggRenderState.cxx @@ -495,6 +495,9 @@ get_material_attrib(const EggMaterial *egg_mat, bool bface) { // Ok, this is the first time we've seen this particular // EggMaterial. Create a new Material that matches it. PT(Material) mat = new Material(egg_mat->get_name()); + if (egg_mat->has_base()) { + mat->set_base_color(egg_mat->get_base()); + } if (egg_mat->has_diff()) { mat->set_diffuse(egg_mat->get_diff()); // By default, ambient is the same as diffuse, if diffuse is @@ -519,6 +522,9 @@ get_material_attrib(const EggMaterial *egg_mat, bool bface) { if (egg_mat->has_metallic()) { mat->set_metallic(egg_mat->get_metallic()); } + if (egg_mat->has_ior()) { + mat->set_refractive_index(egg_mat->get_ior()); + } if (egg_mat->has_local()) { mat->set_local(egg_mat->get_local()); } diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index a8be565b83..e4511ca64b 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -1031,6 +1031,10 @@ EggMaterial *EggSaver:: get_egg_material(Material *mat) { if (mat != (Material *)NULL) { EggMaterial temp(mat->get_name()); + if (mat->has_base_color()) { + temp.set_base(mat->get_base_color()); + } + if (mat->has_ambient()) { temp.set_amb(mat->get_ambient()); } @@ -1057,6 +1061,10 @@ get_egg_material(Material *mat) { temp.set_metallic(mat->get_metallic()); } + if (mat->has_refractive_index()) { + temp.set_ior(mat->get_refractive_index()); + } + temp.set_local(mat->get_local()); return _materials.create_unique_material(temp, ~EggMaterial::E_mref_name); diff --git a/panda/src/express/ordered_vector.I b/panda/src/express/ordered_vector.I index ec0f23bfb6..6a5350f079 100644 --- a/panda/src/express/ordered_vector.I +++ b/panda/src/express/ordered_vector.I @@ -694,6 +694,34 @@ pop_back() { _vector.pop_back(); } +//////////////////////////////////////////////////////////////////// +// Function: ordered_vector::resize +// Access: Public +// Description: Resizes the vector to contain n elements. This +// should not be used except to populate the vector +// for the first time. +//////////////////////////////////////////////////////////////////// +template +INLINE void ordered_vector:: +resize(SIZE_TYPE n) { + TAU_PROFILE("ordered_vector::resize()", " ", TAU_USER); + _vector.resize(n); +} + +//////////////////////////////////////////////////////////////////// +// Function: ordered_vector::resize +// Access: Public +// Description: Resizes the vector to contain n elements. This +// should not be used except to populate the vector +// for the first time. +//////////////////////////////////////////////////////////////////// +template +INLINE void ordered_vector:: +resize(SIZE_TYPE n, const VALUE_TYPE &value) { + TAU_PROFILE("ordered_vector::resize()", " ", TAU_USER); + _vector.resize(n, value); +} + //////////////////////////////////////////////////////////////////// // Function: ordered_vector::nci // Access: Private diff --git a/panda/src/express/ordered_vector.h b/panda/src/express/ordered_vector.h index 705212b98d..2eebdcfa23 100644 --- a/panda/src/express/ordered_vector.h +++ b/panda/src/express/ordered_vector.h @@ -219,6 +219,8 @@ public: INLINE void push_back(const VALUE_TYPE &key); INLINE void pop_back(); + INLINE void resize(SIZE_TYPE n); + INLINE void resize(SIZE_TYPE n, const VALUE_TYPE &value); private: INLINE ITERATOR nci(CONST_ITERATOR i); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 943ee4e7d5..69a3f2cbab 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -6749,7 +6749,7 @@ do_issue_material() { call_glMaterialfv(face, GL_SPECULAR, material->get_specular()); call_glMaterialfv(face, GL_EMISSION, material->get_emission()); - glMaterialf(face, GL_SHININESS, min(material->get_shininess(), (PN_stdfloat)128.0)); + glMaterialf(face, GL_SHININESS, max(min(material->get_shininess(), (PN_stdfloat)128), (PN_stdfloat)0)); if (material->has_ambient() && material->has_diffuse()) { // The material has both an ambient and diffuse specified. This @@ -11419,7 +11419,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { } #ifndef OPENGLES // OpenGL ES doesn't have GL_TEXTURE_MAX_LEVEL. - if (_supports_texture_lod) { + if (is_at_least_gl_version(1, 2)) { // By the time we get here, we have a pretty good prediction for // the number of mipmaps we're going to have, so tell the GL that's // all it's going to get. @@ -11934,7 +11934,7 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, << "No mipmap level " << n << " defined for " << tex->get_name() << "\n"; #ifndef OPENGLES - if (_supports_texture_lod) { + if (is_at_least_gl_version(1, 2)) { // Tell the GL we have no more mipmaps for it to use. glTexParameteri(texture_target, GL_TEXTURE_MAX_LEVEL, n - mipmap_bias); } @@ -12154,7 +12154,7 @@ upload_simple_texture(CLP(TextureContext) *gtc) { #ifndef OPENGLES // Turn off mipmaps for the simple texture. - if (tex->uses_mipmaps() && _supports_texture_lod) { + if (tex->uses_mipmaps() && is_at_least_gl_version(1, 2)) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); } #endif @@ -12820,7 +12820,7 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { GLint num_expected_levels = tex->get_expected_num_mipmap_levels(); GLint highest_level = num_expected_levels; #ifndef OPENGLES - if (_supports_texture_lod) { + if (is_at_least_gl_version(1, 2)) { glGetTexParameteriv(target, GL_TEXTURE_MAX_LEVEL, &highest_level); highest_level = min(highest_level, num_expected_levels); } diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index a3cafd7d9b..bbc49412f4 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -687,6 +687,15 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { _glgsg->_glGetActiveUniform(_glsl_program, i, name_buflen, NULL, ¶m_size, ¶m_type, name_buffer); GLint p = _glgsg->_glGetUniformLocation(_glsl_program, name_buffer); + + // Some NVidia drivers (361.43 for example) (incorrectly) include "internal" uniforms in + // the list starting with "_main_" (for example, "_main_0_gp5fp[0]") + // we need to skip those, because we don't know anything about them + if (strncmp(name_buffer, "_main_", 6) == 0) { + GLCAT.warning() << "Ignoring uniform " << name_buffer << " which may be generated by buggy Nvidia driver.\n"; + return; + } + if (GLCAT.is_debug()) { GLCAT.debug() << "Active uniform " << name_buffer << " with size " << param_size @@ -905,7 +914,19 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._arg[1] = NULL; bind._dep[1] = Shader::SSD_NONE; - if (noprefix == "Material.ambient") { + if (noprefix == "Material.baseColor") { + if (param_type != GL_FLOAT_VEC4) { + GLCAT.error() + << "p3d_Material.baseColor should be vec4\n"; + } + bind._part[0] = Shader::SMO_attr_material2; + bind._piece = Shader::SMP_row0; + bind._dep[0] |= Shader::SSD_color; + _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; + return; + + } else if (noprefix == "Material.ambient") { if (param_type != GL_FLOAT_VEC4) { GLCAT.error() << "p3d_Material.ambient should be vec4\n"; @@ -954,6 +975,39 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { _shader->_mat_spec.push_back(bind); _shader->_mat_deps |= bind._dep[0]; return; + + } else if (noprefix == "Material.roughness") { + if (param_type != GL_FLOAT) { + GLCAT.error() + << "p3d_Material.roughness should be float\n"; + } + bind._part[0] = Shader::SMO_attr_material2; + bind._piece = Shader::SMP_cell15; + _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; + return; + + } else if (noprefix == "Material.metallic") { + if (param_type != GL_FLOAT && param_type != GL_BOOL) { + GLCAT.error() + << "p3d_Material.metallic should be bool or float\n"; + } + bind._part[0] = Shader::SMO_attr_material2; + bind._piece = Shader::SMP_row3x1; + _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; + return; + + } else if (noprefix == "Material.refractiveIndex") { + if (param_type != GL_FLOAT) { + GLCAT.error() + << "p3d_Material.refractiveIndex should be float\n"; + } + bind._part[0] = Shader::SMO_attr_material2; + bind._piece = Shader::SMP_cell13; + _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; + return; } } if (noprefix == "ColorScale") { @@ -1982,6 +2036,12 @@ issue_parameters(int altered) { case Shader::SMP_cell15: _glgsg->_glUniform1fv(p, 1, data+15); continue; + case Shader::SMP_cell14: + _glgsg->_glUniform1fv(p, 1, data+14); + continue; + case Shader::SMP_cell13: + _glgsg->_glUniform1fv(p, 1, data+13); + continue; } } } diff --git a/panda/src/gobj/material.I b/panda/src/gobj/material.I index 724d33c5e2..e41362a1d2 100644 --- a/panda/src/gobj/material.I +++ b/panda/src/gobj/material.I @@ -20,6 +20,7 @@ //////////////////////////////////////////////////////////////////// INLINE Material:: Material(const string &name) : Namable(name) { + _base_color.set(1.0f, 1.0f, 1.0f, 1.0f); _ambient.set(1.0f, 1.0f, 1.0f, 1.0f); _diffuse.set(1.0f, 1.0f, 1.0f, 1.0f); _specular.set(0.0f, 0.0f, 0.0f, 1.0f); @@ -27,6 +28,7 @@ Material(const string &name) : Namable(name) { _shininess = 0; _roughness = 1; _metallic = 0; + _refractive_index = 1; _flags = 0; } @@ -62,6 +64,33 @@ get_default() { return _default; } +//////////////////////////////////////////////////////////////////// +// Function: Material::has_base_color +// Access: Published +// Description: Returns true if the base color has been explicitly +// set for this material, false otherwise. +//////////////////////////////////////////////////////////////////// +INLINE bool Material:: +has_base_color() const { + return (_flags & F_base_color) != 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: Material::get_base_color +// Access: Published +// Description: Returns the base_color color setting, if it has been +// set. If neither the base color nor the metallic +// have been set, this returns the diffuse color. +//////////////////////////////////////////////////////////////////// +INLINE const LColor &Material:: +get_base_color() const { + if (!has_base_color() && !has_metallic()) { + return _diffuse; + } else { + return _base_color; + } +} + //////////////////////////////////////////////////////////////////// // Function: Material::has_ambient // Access: Published @@ -96,7 +125,7 @@ clear_ambient() { nassertv(!is_attrib_locked()); } _flags &= ~F_ambient; - _ambient.set(0.0f, 0.0f, 0.0f, 0.0f); + _ambient = _base_color; } //////////////////////////////////////////////////////////////////// @@ -133,7 +162,7 @@ clear_diffuse() { nassertv(!is_attrib_locked()); } _flags &= ~F_diffuse; - _diffuse.set(1.0f, 1.0f, 1.0f, 1.0f); + _diffuse = _base_color * (1 - _metallic); } //////////////////////////////////////////////////////////////////// @@ -159,20 +188,6 @@ get_specular() const { return _specular; } -//////////////////////////////////////////////////////////////////// -// Function: Material::clear_specular -// Access: Published -// Description: Removes the explicit specular color from the material. -//////////////////////////////////////////////////////////////////// -INLINE void Material:: -clear_specular() { - if (enforce_attrib_lock) { - nassertv(!is_attrib_locked()); - } - _flags &= ~F_specular; - _specular.set(0.0f, 0.0f, 0.0f, 0.0f); -} - //////////////////////////////////////////////////////////////////// // Function: Material::has_emission // Access: Published @@ -220,6 +235,17 @@ get_shininess() const { return _shininess; } +//////////////////////////////////////////////////////////////////// +// Function: Material::has_roughness +// Access: Published +// Description: Returns true if the roughness has been explicitly +// set for this material, false otherwise. +//////////////////////////////////////////////////////////////////// +INLINE bool Material:: +has_roughness() const { + return (_flags & F_roughness) != 0; +} + //////////////////////////////////////////////////////////////////// // Function: Material::has_metallic // Access: Published @@ -243,28 +269,25 @@ get_metallic() const { } //////////////////////////////////////////////////////////////////// -// Function: Material::clear_metallic +// Function: Material::has_refractive_index // Access: Published -// Description: Removes the explicit metallic setting from the material. +// Description: Returns true if a refractive index has explicitly +// been specified for this material. //////////////////////////////////////////////////////////////////// -INLINE void Material:: -clear_metallic() { - if (enforce_attrib_lock) { - nassertv(!is_attrib_locked()); - } - _flags &= ~F_metallic; - _metallic = 0; +INLINE bool Material:: +has_refractive_index() const { + return (_flags & F_refractive_index) != 0; } //////////////////////////////////////////////////////////////////// -// Function: Material::has_roughness +// Function: Material::get_refractive_index // Access: Published -// Description: Returns true if the roughness has been explicitly -// set for this material, false otherwise. +// Description: Returns the index of refraction, or 1 if none has +// been set for this material. //////////////////////////////////////////////////////////////////// -INLINE bool Material:: -has_roughness() const { - return (_flags & F_roughness) != 0; +INLINE PN_stdfloat Material:: +get_refractive_index() const { + return _refractive_index; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/gobj/material.cxx b/panda/src/gobj/material.cxx index 5d202f0c41..d2acb632c9 100644 --- a/panda/src/gobj/material.cxx +++ b/panda/src/gobj/material.cxx @@ -31,6 +31,7 @@ PT(Material) Material::_default; void Material:: operator = (const Material ©) { Namable::operator = (copy); + _base_color = copy._base_color; _ambient = copy._ambient; _diffuse = copy._diffuse; _specular = copy._specular; @@ -38,9 +39,80 @@ operator = (const Material ©) { _shininess = copy._shininess; _roughness = copy._roughness; _metallic = copy._metallic; + _refractive_index = copy._refractive_index; _flags = copy._flags & (~F_attrib_lock); } +//////////////////////////////////////////////////////////////////// +// Function: Material::set_base_color +// Access: Published +// Description: Specifies the base color of the material. In +// conjunction with set_metallic, this is an alternate +// way to specify the color of a material. For +// dielectrics, this will determine the value of the +// diffuse color, and for metals, this will determine +// the value of the specular color. +// +// Setting this will clear an explicit specular, +// diffuse or ambient color assignment. +// +// If this is not set, the object color will be used. +//////////////////////////////////////////////////////////////////// +void Material:: +set_base_color(const LColor &color) { + if (enforce_attrib_lock) { + if ((_flags & F_base_color) == 0) { + nassertv(!is_attrib_locked()); + } + } + _base_color = color; + _flags |= F_base_color | F_metallic; + _flags &= ~(F_ambient | F_diffuse | F_specular); + + // Recalculate the diffuse and specular colors. + _ambient = _base_color; + _diffuse = _base_color * (1 - _metallic); + + PN_stdfloat f0 = 0; + if (_refractive_index >= 1) { + f0 = (_refractive_index - 1) / (_refractive_index + 1); + f0 *= f0; + f0 *= (1 - _metallic); + } + _specular.set(f0, f0, f0, 0); + _specular += _base_color * _metallic; +} + +//////////////////////////////////////////////////////////////////// +// Function: Material::clear_base_color +// Access: Published +// Description: Removes the explicit base_color color from the material. +//////////////////////////////////////////////////////////////////// +void Material:: +clear_base_color() { + if (enforce_attrib_lock) { + nassertv(!is_attrib_locked()); + } + _flags &= ~F_base_color; + _base_color.set(0.0f, 0.0f, 0.0f, 0.0f); + + if ((_flags & F_ambient) == 0) { + _ambient.set(0, 0, 0, 0); + } + if ((_flags & F_diffuse) == 0) { + _diffuse.set(0, 0, 0, 0); + } + if ((_flags & F_specular) == 0) { + // Recalculate the specular color. + PN_stdfloat f0 = 0; + if (_refractive_index >= 1) { + f0 = (_refractive_index - 1) / (_refractive_index + 1); + f0 *= f0; + } + _specular.set(f0, f0, f0, 0); + } +} + //////////////////////////////////////////////////////////////////// // Function: Material::set_ambient // Access: Published @@ -92,7 +164,7 @@ set_diffuse(const LColor &color) { //////////////////////////////////////////////////////////////////// // Function: Material::set_specular // Access: Published -// Description: Specifies the diffuse color setting of the material. +// Description: Specifies the specular color setting of the material. // This will be multiplied by any lights in effect on // the material to compute the color of specular // highlights on the object. @@ -100,7 +172,9 @@ set_diffuse(const LColor &color) { // This is the highlight color of an object: the color // of small highlight reflections. // -// If this is not set, highlights will not appear. +// If this is not set, the specular color is taken from +// the index of refraction, which is 1 by default +// (meaning no specular reflections are generated). //////////////////////////////////////////////////////////////////// void Material:: set_specular(const LColor &color) { @@ -113,6 +187,29 @@ set_specular(const LColor &color) { _flags |= F_specular; } +//////////////////////////////////////////////////////////////////// +// Function: Material::clear_specular +// Access: Published +// Description: Removes the explicit specular color from the material. +//////////////////////////////////////////////////////////////////// +void Material:: +clear_specular() { + if (enforce_attrib_lock) { + nassertv(!is_attrib_locked()); + } + _flags &= ~F_specular; + + // Recalculate the specular color from the refractive index. + PN_stdfloat f0 = 0; + if (_refractive_index >= 1) { + f0 = (_refractive_index - 1) / (_refractive_index + 1); + f0 *= f0; + f0 *= (1 - _metallic); + } + _specular.set(f0, f0, f0, 0); + _specular += _base_color * _metallic; +} + //////////////////////////////////////////////////////////////////// // Function: Material::set_emission // Access: Published @@ -211,8 +308,10 @@ set_roughness(PN_stdfloat roughness) { // Description: Sets the metallic setting of the material, which is // is used for physically-based rendering models. // This is usually 0 for dielectric materials and 1 -// for metals. It usually does not make sense to set -// this to a value other than 0 or 1. +// for metals. It really does not make sense to set +// this to a value other than 0 or 1, but it is +// nonetheless a float for compatibility with tools +// that allow setting this to values other than 0 or 1. //////////////////////////////////////////////////////////////////// void Material:: set_metallic(PN_stdfloat metallic) { @@ -223,6 +322,80 @@ set_metallic(PN_stdfloat metallic) { } _metallic = metallic; _flags |= F_metallic; + + // Recalculate the diffuse and specular. + if ((_flags & F_diffuse) == 0) { + _diffuse = _base_color * (1 - _metallic); + } + if ((_flags & F_specular) == 0) { + // Recalculate the specular color. + PN_stdfloat f0 = 0; + if (_refractive_index >= 1) { + f0 = (_refractive_index - 1) / (_refractive_index + 1); + f0 *= f0; + f0 *= (1 - _metallic); + } + _specular.set(f0, f0, f0, 0); + _specular += _base_color * _metallic; + } +} + +//////////////////////////////////////////////////////////////////// +// Function: Material::clear_metallic +// Access: Published +// Description: Removes the explicit metallic setting from the material. +//////////////////////////////////////////////////////////////////// +void Material:: +clear_metallic() { + if (enforce_attrib_lock) { + nassertv(!is_attrib_locked()); + } + _flags &= ~F_metallic; + _metallic = 0; + + // If we had a base color, recalculate the diffuse and specular. + if (_flags & F_base_color) { + if ((_flags & F_diffuse) == 0) { + _diffuse = _base_color; + } + if ((_flags & F_specular) == 0) { + // Recalculate the specular color. + PN_stdfloat f0 = 0; + if (_refractive_index >= 1) { + f0 = (_refractive_index - 1) / (_refractive_index + 1); + f0 *= f0; + } + _specular.set(f0, f0, f0, 0); + } + } +} + +//////////////////////////////////////////////////////////////////// +// Function: Material::set_refractive_index +// Access: Published +// Description: Sets the index of refraction of the material, which +// is used to determine the specular color in absence +// of an explicit specular color assignment. +// This is usually 1.5 for dielectric materials. It +// is not very useful for metals, since they cannot +// be described as easily with a single number. +// +// Should be 1 or higher. The default is 1. +//////////////////////////////////////////////////////////////////// +void Material:: +set_refractive_index(PN_stdfloat refractive_index) { + _refractive_index = refractive_index; + _flags |= F_refractive_index; + + if ((_flags & F_specular) == 0) { + // Recalculate the specular color. + PN_stdfloat f0 = 0; + if (_refractive_index >= 1) { + f0 = (_refractive_index - 1) / (_refractive_index + 1); + f0 *= f0; + } + _specular.set(f0, f0, f0, 0); + } } //////////////////////////////////////////////////////////////////// @@ -239,6 +412,9 @@ compare_to(const Material &other) const { if (_flags != other._flags) { return _flags - other._flags; } + if (has_base_color() && get_base_color() != other.get_base_color()) { + return get_base_color().compare_to(other.get_base_color()); + } if (has_ambient() && get_ambient() != other.get_ambient()) { return get_ambient().compare_to(other.get_ambient()); } @@ -254,6 +430,12 @@ compare_to(const Material &other) const { if (get_shininess() != other.get_shininess()) { return get_shininess() < other.get_shininess() ? -1 : 1; } + if (get_metallic() != other.get_metallic()) { + return get_metallic() < other.get_metallic() ? -1 : 1; + } + if (get_refractive_index() != other.get_refractive_index()) { + return get_refractive_index() < other.get_refractive_index() ? -1 : 1; + } return strcmp(get_name().c_str(), other.get_name().c_str()); } @@ -266,14 +448,21 @@ compare_to(const Material &other) const { void Material:: output(ostream &out) const { out << "Material " << get_name(); - if (has_ambient()) { - out << " a(" << get_ambient() << ")"; + if (has_base_color()) { + out << " c(" << get_base_color() << ")"; + } else { + if (has_ambient()) { + out << " a(" << get_ambient() << ")"; + } + if (has_diffuse()) { + out << " d(" << get_diffuse() << ")"; + } + if (has_specular()) { + out << " s(" << get_specular() << ")"; + } } - if (has_diffuse()) { - out << " d(" << get_diffuse() << ")"; - } - if (has_specular()) { - out << " s(" << get_specular() << ")"; + if (has_refractive_index()) { + out << " ior" << get_refractive_index(); } if (has_emission()) { out << " e(" << get_emission() << ")"; @@ -283,7 +472,7 @@ output(ostream &out) const { } else { out << " s" << get_shininess(); } - if (has_metallic()) { + if (_flags & F_metallic) { out << " m" << _metallic; } out << " l" << get_local() @@ -298,6 +487,9 @@ output(ostream &out) const { void Material:: write(ostream &out, int indent_level) const { indent(out, indent_level) << "Material " << get_name() << "\n"; + if (has_base_color()) { + indent(out, indent_level + 2) << "base_color = " << get_ambient() << "\n"; + } if (has_ambient()) { indent(out, indent_level + 2) << "ambient = " << get_ambient() << "\n"; } @@ -306,6 +498,8 @@ write(ostream &out, int indent_level) const { } if (has_specular()) { indent(out, indent_level + 2) << "specular = " << get_specular() << "\n"; + } else { + indent(out, indent_level + 2) << "refractive_index = " << get_refractive_index() << "\n"; } if (has_emission()) { indent(out, indent_level + 2) << "emission = " << get_emission() << "\n"; @@ -343,11 +537,19 @@ register_with_read_factory() { void Material:: write_datagram(BamWriter *manager, Datagram &me) { me.add_string(get_name()); - _ambient.write_datagram(me); - _diffuse.write_datagram(me); - _specular.write_datagram(me); + + me.add_int32(_flags); + + if (_flags & F_metallic) { + // Metalness workflow. + _base_color.write_datagram(me); + me.add_stdfloat(_metallic); + } else { + _ambient.write_datagram(me); + _diffuse.write_datagram(me); + _specular.write_datagram(me); + } _emission.write_datagram(me); - me.add_stdfloat(_shininess); if (_flags & F_roughness) { me.add_stdfloat(_roughness); @@ -355,11 +557,7 @@ write_datagram(BamWriter *manager, Datagram &me) { me.add_stdfloat(_shininess); } - me.add_int32(_flags); - - if (_flags & F_metallic) { - me.add_stdfloat(_metallic); - } + me.add_stdfloat(_refractive_index); } //////////////////////////////////////////////////////////////////// @@ -389,19 +587,40 @@ make_Material(const FactoryParams ¶ms) { void Material:: fillin(DatagramIterator &scan, BamReader *manager) { set_name(scan.get_string()); - _ambient.read_datagram(scan); - _diffuse.read_datagram(scan); - _specular.read_datagram(scan); - _emission.read_datagram(scan); - _shininess = scan.get_stdfloat(); - _flags = scan.get_int32(); - if (_flags & F_roughness) { - // The shininess we read is actually a roughness value. - set_roughness(_shininess); - } + if (manager->get_file_minor_ver() >= 39) { + _flags = scan.get_int32(); - if (_flags & F_metallic) { - _metallic = scan.get_stdfloat(); + if (_flags & F_metallic) { + // Metalness workflow: read base color and metallic + _base_color.read_datagram(scan); + set_metallic(scan.get_stdfloat()); + + } else { + _ambient.read_datagram(scan); + _diffuse.read_datagram(scan); + _specular.read_datagram(scan); + } + _emission.read_datagram(scan); + + if (_flags & F_roughness) { + set_roughness(scan.get_stdfloat()); + } else { + _shininess = scan.get_stdfloat(); + } + _refractive_index = scan.get_stdfloat(); + + } else { + _ambient.read_datagram(scan); + _diffuse.read_datagram(scan); + _specular.read_datagram(scan); + _emission.read_datagram(scan); + _shininess = scan.get_stdfloat(); + _flags = scan.get_int32(); + + if (_flags & F_roughness) { + // The shininess we read is actually a roughness value. + set_roughness(_shininess); + } } } diff --git a/panda/src/gobj/material.h b/panda/src/gobj/material.h index d693bd9281..85d15a04b2 100644 --- a/panda/src/gobj/material.h +++ b/panda/src/gobj/material.h @@ -30,6 +30,18 @@ class FactoryParams; // Description : Defines the way an object appears in the presence of // lighting. A material is only necessary if lighting // is to be enabled; otherwise, the material isn't used. +// +// There are two workflows that are supported: the +// "classic" workflow of providing separate ambient, +// diffuse and specular colors, and the "metalness" +// workflow, in which a base color is specified along +// with a "metallic" value that indicates whether the +// material is a metal or a dielectric. +// +// The size of the specular highlight can be specified +// by either specifying the specular exponent (shininess) +// or by specifying a roughness value that in perceptually +// linear in the range of 0-1. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_GOBJ Material : public TypedWritableReferenceCount, public Namable { PUBLISHED: @@ -40,6 +52,11 @@ PUBLISHED: INLINE static Material *get_default(); + INLINE bool has_base_color() const; + INLINE const LColor &get_base_color() const; + void set_base_color(const LColor &color); + void clear_base_color(); + INLINE bool has_ambient() const; INLINE const LColor &get_ambient() const; void set_ambient(const LColor &color); @@ -53,7 +70,7 @@ PUBLISHED: INLINE bool has_specular() const; INLINE const LColor &get_specular() const; void set_specular(const LColor &color); - INLINE void clear_specular(); + void clear_specular(); INLINE bool has_emission() const; INLINE const LColor &get_emission() const; @@ -70,7 +87,11 @@ PUBLISHED: INLINE bool has_metallic() const; INLINE PN_stdfloat get_metallic() const; void set_metallic(PN_stdfloat metallic); - INLINE void clear_metallic(); + void clear_metallic(); + + INLINE bool has_refractive_index() const; + INLINE PN_stdfloat get_refractive_index() const; + void set_refractive_index(PN_stdfloat refractive_index); INLINE bool get_local() const; INLINE void set_local(bool local); @@ -90,6 +111,8 @@ PUBLISHED: INLINE void set_attrib_lock(); PUBLISHED: + MAKE_PROPERTY2(base_color, has_base_color, get_base_color, + set_base_color, clear_base_color); MAKE_PROPERTY2(ambient, has_ambient, get_ambient, set_ambient, clear_ambient); MAKE_PROPERTY2(diffuse, has_diffuse, get_diffuse, @@ -102,11 +125,14 @@ PUBLISHED: MAKE_PROPERTY(shininess, get_shininess, set_shininess); MAKE_PROPERTY(roughness, get_roughness, set_roughness); MAKE_PROPERTY(metallic, get_metallic, set_metallic); + MAKE_PROPERTY(refractive_index, get_refractive_index, + set_refractive_index); MAKE_PROPERTY(local, get_local, set_local); MAKE_PROPERTY(twoside, get_twoside, set_twoside); private: + LColor _base_color; LColor _ambient; LColor _diffuse; LColor _specular; @@ -114,6 +140,7 @@ private: PN_stdfloat _shininess; PN_stdfloat _roughness; PN_stdfloat _metallic; + PN_stdfloat _refractive_index; static PT(Material) _default; @@ -127,6 +154,8 @@ private: F_attrib_lock = 0x040, F_roughness = 0x080, F_metallic = 0x100, + F_base_color = 0x200, + F_refractive_index = 0x400, }; int _flags; diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 97717f591b..2ee015ccbc 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -405,7 +405,7 @@ cp_dependency(ShaderMatInput inp) { if (inp == SMO_INVALID) { return SSD_NONE; } - if (inp == SMO_attr_material) { + if (inp == SMO_attr_material || inp == SMO_attr_material2) { dep |= SSD_material; } if (inp == SMO_attr_color) { diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index f376740da2..ace9e76212 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -194,6 +194,9 @@ public: SMO_inv_texmat_i, + // Additional properties for PBR materials + SMO_attr_material2, + SMO_INVALID }; @@ -272,6 +275,8 @@ public: SMP_upper3x3, SMP_transpose3x3, SMP_cell15, + SMP_cell14, + SMP_cell13, }; enum ShaderStateDep { diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index b26c4ebca9..580b521241 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -489,7 +489,7 @@ read(const Filename &fullpath, const Filename &alpha_fullpath, size_t Texture:: estimate_texture_memory() const { CDReader cdata(_cycler); - size_t pixels = cdata->_x_size * cdata->_y_size; + size_t pixels = cdata->_x_size * cdata->_y_size * cdata->_z_size; size_t bpp = 4; switch (cdata->_format) { @@ -503,6 +503,7 @@ estimate_texture_memory() const { case Texture::F_blue: case Texture::F_luminance: case Texture::F_sluminance: + case Texture::F_r8i: bpp = 1; break; @@ -519,6 +520,8 @@ estimate_texture_memory() const { case Texture::F_rgb5: case Texture::F_rgba5: case Texture::F_srgb: + // Most of the above formats have only 3 bytes, but they are most likely to + // get padded by the driver bpp = 4; break; @@ -536,9 +539,15 @@ estimate_texture_memory() const { break; case Texture::F_depth_component: + case Texture::F_depth_component16: bpp = 2; break; + case Texture::F_depth_component24: // Gets padded + case Texture::F_depth_component32: + bpp = 4; + break; + case Texture::F_rgba12: case Texture::F_rgb12: bpp = 8; @@ -552,7 +561,6 @@ estimate_texture_memory() const { break; case Texture::F_r16: - case Texture::F_r8i: case Texture::F_rg8i: bpp = 2; break; @@ -564,17 +572,16 @@ estimate_texture_memory() const { break; case Texture::F_r32i: - bpp = 4; - break; - case Texture::F_r32: bpp = 4; break; + case Texture::F_rg32: bpp = 8; break; + case Texture::F_rgb32: - bpp = 12; + bpp = 16; break; case Texture::F_r11_g11_b10: @@ -582,6 +589,8 @@ estimate_texture_memory() const { break; default: + gobj_cat.warning() << "Unhandled format in estimate_texture_memory(): " + << cdata->_format << "\n"; break; } diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index 4377767089..ae9cf1bfd2 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -341,7 +341,7 @@ ns_load_texture(const Filename &orig_filename, int primary_file_num_channels, if (store_record && tex->is_cacheable()) { // Store the on-disk cache record for next time. - record->set_data(tex, tex); + record->set_data(tex); cache->store(record); } @@ -473,7 +473,7 @@ ns_load_texture(const Filename &orig_filename, if (store_record && tex->is_cacheable()) { // Store the on-disk cache record for next time. - record->set_data(tex, tex); + record->set_data(tex); cache->store(record); } @@ -585,7 +585,7 @@ ns_load_3d_texture(const Filename &filename_pattern, if (store_record && tex->is_cacheable()) { // Store the on-disk cache record for next time. - record->set_data(tex, tex); + record->set_data(tex); cache->store(record); } @@ -691,7 +691,7 @@ ns_load_2d_texture_array(const Filename &filename_pattern, if (store_record && tex->is_cacheable()) { // Store the on-disk cache record for next time. - record->set_data(tex, tex); + record->set_data(tex); cache->store(record); } @@ -790,7 +790,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps, if (store_record && tex->is_cacheable()) { // Store the on-disk cache record for next time. - record->set_data(tex, tex); + record->set_data(tex); cache->store(record); } @@ -1166,7 +1166,7 @@ try_load_cache(PT(Texture) &tex, BamCache *cache, const Filename &filename, // from the cache. To keep the cache current, // rewrite it to the cache now, in its newly // compressed form. - record->set_data(tex, tex); + record->set_data(tex); cache->store(record); compressed_cache_record = true; } diff --git a/panda/src/linmath/lpoint2_src.I b/panda/src/linmath/lpoint2_src.I index a3f27084f6..4c94dab00d 100644 --- a/panda/src/linmath/lpoint2_src.I +++ b/panda/src/linmath/lpoint2_src.I @@ -14,49 +14,21 @@ //////////////////////////////////////////////////////////////////// -// Function: LPoint2::Default Constructor +// Function: LPoint2::Constructor // Access: Public -// Description: +// Description: Constructs a new LPoint2 from a LVecBase2 //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LPoint2):: -FLOATNAME(LPoint2)() { -} - -//////////////////////////////////////////////////////////////////// -// Function: LPoint2::Copy Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint2):: -FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2) ©) : FLOATNAME(LVecBase2)(copy) { -} - -//////////////////////////////////////////////////////////////////// -// Function: LPoint2::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint2) &FLOATNAME(LPoint2):: -operator = (const FLOATNAME(LVecBase2) ©) { - FLOATNAME(LVecBase2)::operator = (copy); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LPoint2::Copy Fill Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint2) &FLOATNAME(LPoint2):: -operator = (FLOATTYPE fill_value) { - FLOATNAME(LVecBase2)::operator = (fill_value); - return *this; +FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2)& copy) : + FLOATNAME(LVecBase2)(copy) +{ } //////////////////////////////////////////////////////////////////// // Function: LPoint2::Constructor // Access: Public -// Description: +// Description: Constructs a new LPoint2 all components set to the +// fill value. //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LPoint2):: FLOATNAME(LPoint2)(FLOATTYPE fill_value) : @@ -67,7 +39,7 @@ FLOATNAME(LPoint2)(FLOATTYPE fill_value) : //////////////////////////////////////////////////////////////////// // Function: LPoint2::Constructor // Access: Public -// Description: +// Description: Constructs a new LPoint2 with the given components //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LPoint2):: FLOATNAME(LPoint2)(FLOATTYPE x, FLOATTYPE y) : @@ -186,6 +158,18 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT +//////////////////////////////////////////////////////////////////// +// Function: LPoint2::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LPoint2) FLOATNAME(LPoint2):: +normalized() const { + return FLOATNAME(LVecBase2)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LPoint2::project // Access: Published diff --git a/panda/src/linmath/lpoint2_src.h b/panda/src/linmath/lpoint2_src.h index 5347325800..cdac92e106 100644 --- a/panda/src/linmath/lpoint2_src.h +++ b/panda/src/linmath/lpoint2_src.h @@ -19,10 +19,9 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_LINMATH FLOATNAME(LPoint2) : public FLOATNAME(LVecBase2) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LPoint2)(); - INLINE_LINMATH FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2) ©); - INLINE_LINMATH FLOATNAME(LPoint2) &operator = (const FLOATNAME(LVecBase2) ©); - INLINE_LINMATH FLOATNAME(LPoint2) &operator = (FLOATTYPE fill_value); + + INLINE_LINMATH FLOATNAME(LPoint2)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2)& copy); INLINE_LINMATH FLOATNAME(LPoint2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint2)(FLOATTYPE x, FLOATTYPE y); @@ -51,6 +50,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint2) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LPoint2) normalized() const; INLINE_LINMATH FLOATNAME(LPoint2) project(const FLOATNAME(LVecBase2) &onto) const; #endif diff --git a/panda/src/linmath/lpoint3_src.I b/panda/src/linmath/lpoint3_src.I index 9f8143c7d7..71eb2f0b4d 100644 --- a/panda/src/linmath/lpoint3_src.I +++ b/panda/src/linmath/lpoint3_src.I @@ -13,15 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: LPoint3::Default Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint3):: -FLOATNAME(LPoint3)() { -} - //////////////////////////////////////////////////////////////////// // Function: LPoint3::Copy Constructor // Access: Public @@ -31,28 +22,6 @@ INLINE_LINMATH FLOATNAME(LPoint3):: FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) ©) : FLOATNAME(LVecBase3)(copy) { } -//////////////////////////////////////////////////////////////////// -// Function: LPoint3::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint3) &FLOATNAME(LPoint3):: -operator = (const FLOATNAME(LVecBase3) ©) { - FLOATNAME(LVecBase3)::operator = (copy); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LPoint3::Copy Fill Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint3) &FLOATNAME(LPoint3):: -operator = (FLOATTYPE fill_value) { - FLOATNAME(LVecBase3)::operator = (fill_value); - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: LPoint3::Constructor // Access: Public @@ -230,6 +199,18 @@ cross(const FLOATNAME(LVecBase3) &other) const { } #ifndef FLOATTYPE_IS_INT +//////////////////////////////////////////////////////////////////// +// Function: LPoint3::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LPoint3) FLOATNAME(LPoint3):: +normalized() const { + return FLOATNAME(LVecBase3)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LPoint3::project // Access: Published diff --git a/panda/src/linmath/lpoint3_src.h b/panda/src/linmath/lpoint3_src.h index e8645529ff..0be8774815 100644 --- a/panda/src/linmath/lpoint3_src.h +++ b/panda/src/linmath/lpoint3_src.h @@ -24,10 +24,8 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_LINMATH FLOATNAME(LPoint3) : public FLOATNAME(LVecBase3) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LPoint3)(); + INLINE_LINMATH FLOATNAME(LPoint3)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LPoint3) &operator = (const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LPoint3) &operator = (FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); @@ -61,6 +59,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint3) cross(const FLOATNAME(LVecBase3) &other) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LPoint3) normalized() const; INLINE_LINMATH FLOATNAME(LPoint3) project(const FLOATNAME(LVecBase3) &onto) const; #endif diff --git a/panda/src/linmath/lpoint4_src.I b/panda/src/linmath/lpoint4_src.I index d1a7e7b3ab..0e37a0c533 100644 --- a/panda/src/linmath/lpoint4_src.I +++ b/panda/src/linmath/lpoint4_src.I @@ -13,15 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: LPoint4::Default Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint4):: -FLOATNAME(LPoint4)() { -} - //////////////////////////////////////////////////////////////////// // Function: LPoint4::Copy Constructor // Access: Public @@ -31,28 +22,6 @@ INLINE_LINMATH FLOATNAME(LPoint4):: FLOATNAME(LPoint4)(const FLOATNAME(LVecBase4) ©) : FLOATNAME(LVecBase4)(copy) { } -//////////////////////////////////////////////////////////////////// -// Function: LPoint4::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint4) &FLOATNAME(LPoint4):: -operator = (const FLOATNAME(LVecBase4) ©) { - FLOATNAME(LVecBase4)::operator = (copy); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LPoint4::Copy Fill Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LPoint4) &FLOATNAME(LPoint4):: -operator = (FLOATTYPE fill_value) { - FLOATNAME(LVecBase4)::operator = (fill_value); - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: LPoint4::Constructor // Access: Public @@ -217,6 +186,19 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT + +//////////////////////////////////////////////////////////////////// +// Function: LPoint4::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LPoint4) FLOATNAME(LPoint4):: +normalized() const { + return FLOATNAME(LVecBase4)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LPoint4::project // Access: Published diff --git a/panda/src/linmath/lpoint4_src.h b/panda/src/linmath/lpoint4_src.h index 50eeb1ce5d..a9c4ed59fe 100644 --- a/panda/src/linmath/lpoint4_src.h +++ b/panda/src/linmath/lpoint4_src.h @@ -18,10 +18,8 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_LINMATH FLOATNAME(LPoint4) : public FLOATNAME(LVecBase4) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LPoint4)(); + INLINE_LINMATH FLOATNAME(LPoint4)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LPoint4) &operator = (const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LPoint4) &operator = (FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); @@ -53,6 +51,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint4) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LPoint4) normalized() const; INLINE_LINMATH FLOATNAME(LPoint4) project(const FLOATNAME(LVecBase4) &onto) const; #endif diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index 14057fbd50..c6745112ae 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -12,48 +12,6 @@ // //////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase2::Default Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase2):: -FLOATNAME(LVecBase2)() { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase2::Copy Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase2):: -FLOATNAME(LVecBase2)(const FLOATNAME(LVecBase2) ©) : _v(copy._v) { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase2::Copy Assignment Operator -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase2) &FLOATNAME(LVecBase2):: -operator = (const FLOATNAME(LVecBase2) ©) { - TAU_PROFILE("void LVecBase2::operator = (LVecBase2 &)", " ", TAU_USER); - _v = copy._v; - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase2::Fill Assignment Operator -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase2) &FLOATNAME(LVecBase2):: -operator = (FLOATTYPE fill_value) { - fill(fill_value); - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase2::Constructor // Access: Published @@ -107,15 +65,6 @@ unit_y() { return _unit_y; } -//////////////////////////////////////////////////////////////////// -// Function: LVecBase2::Destructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase2):: -~FLOATNAME(LVecBase2)() { -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase2::Indexing Operator // Access: Published @@ -143,7 +92,7 @@ operator [](int i) { // Access: Published, Static // Description: Returns 2: the number of components of a LVecBase2. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(LVecBase2):: +CONSTEXPR int FLOATNAME(LVecBase2):: size() { return 2; } @@ -274,8 +223,8 @@ get_data() const { // Access: Published // Description: Returns the number of elements in the vector, two. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(LVecBase2):: -get_num_components() const { +CONSTEXPR int FLOATNAME(LVecBase2):: +get_num_components() { return 2; } @@ -418,6 +367,22 @@ normalize() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase2::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase2) FLOATNAME(LVecBase2):: +normalized() const { + FLOATTYPE l2 = length_squared(); + if (l2 == (FLOATTYPE)0.0f) { + return FLOATNAME(LVecBase2)(0.0f); + } + return (*this) / csqrt(l2); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase2::project // Access: Published diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index f1f6d125e0..1094b03617 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -34,38 +34,38 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(LVecBase2)(); - INLINE_LINMATH FLOATNAME(LVecBase2)(const FLOATNAME(LVecBase2) ©); - INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (const FLOATNAME(LVecBase2) ©); - INLINE_LINMATH FLOATNAME(LVecBase2) &operator = (FLOATTYPE fill_value); + INLINE_LINMATH FLOATNAME(LVecBase2)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE x, FLOATTYPE y); + ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase2)); INLINE_LINMATH static const FLOATNAME(LVecBase2) &zero(); INLINE_LINMATH static const FLOATNAME(LVecBase2) &unit_x(); INLINE_LINMATH static const FLOATNAME(LVecBase2) &unit_y(); - INLINE_LINMATH ~FLOATNAME(LVecBase2)(); - EXTENSION(INLINE_LINMATH PyObject *__reduce__(PyObject *self) const); EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - INLINE_LINMATH static int size(); + CONSTEXPR static int size(); INLINE_LINMATH bool is_nan() const; INLINE_LINMATH FLOATTYPE get_cell(int i) const; + INLINE_LINMATH void set_cell(int i, FLOATTYPE value); + INLINE_LINMATH FLOATTYPE get_x() const; INLINE_LINMATH FLOATTYPE get_y() const; - - INLINE_LINMATH void set_cell(int i, FLOATTYPE value); INLINE_LINMATH void set_x(FLOATTYPE value); INLINE_LINMATH void set_y(FLOATTYPE value); +PUBLISHED: + MAKE_PROPERTY(x, get_x, set_x); + MAKE_PROPERTY(y, get_y, set_y); + // These next functions add to an existing value. // i.e. foo.set_x(foo.get_x() + value) // These are useful to reduce overhead in scripting @@ -75,7 +75,7 @@ PUBLISHED: INLINE_LINMATH void add_y(FLOATTYPE value); INLINE_LINMATH const FLOATTYPE *get_data() const; - INLINE_LINMATH int get_num_components() const; + CONSTEXPR static int get_num_components(); public: INLINE_LINMATH iterator begin(); @@ -94,6 +94,7 @@ PUBLISHED: #ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATTYPE length() const; INLINE_LINMATH bool normalize(); + INLINE_LINMATH FLOATNAME(LVecBase2) normalized() const; INLINE_LINMATH FLOATNAME(LVecBase2) project(const FLOATNAME(LVecBase2) &onto) const; #endif diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 35df48b008..b63fdd6f21 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -13,47 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: LVecBase3::Default Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase3):: -FLOATNAME(LVecBase3)() { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase3::Copy Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase3):: -FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase3) ©) : _v(copy._v) { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase3::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase3) &FLOATNAME(LVecBase3):: -operator = (const FLOATNAME(LVecBase3) ©) { - TAU_PROFILE("void LVecBase3::operator =(LVecBase3 &)", " ", TAU_USER); - _v = copy._v; - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase3::Fill Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase3) &FLOATNAME(LVecBase3):: -operator = (FLOATTYPE fill_value) { - fill(fill_value); - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase3::Constructor // Access: Public @@ -128,15 +87,6 @@ unit_z() { return _unit_z; } -//////////////////////////////////////////////////////////////////// -// Function: LVecBase3::Destructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase3):: -~FLOATNAME(LVecBase3)() { -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase3::Indexing Operator // Access: Public @@ -164,7 +114,7 @@ operator [](int i) { // Access: Public, Static // Description: Returns 3: the number of components of a LVecBase3. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(LVecBase3):: +CONSTEXPR int FLOATNAME(LVecBase3):: size() { return 3; } @@ -358,8 +308,8 @@ get_data() const { // Access: Public // Description: Returns the number of elements in the vector, three. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(LVecBase3):: -get_num_components() const { +CONSTEXPR int FLOATNAME(LVecBase3):: +get_num_components() { return 3; } @@ -509,6 +459,22 @@ normalize() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase3::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LVecBase3):: +normalized() const { + FLOATTYPE l2 = length_squared(); + if (l2 == (FLOATTYPE)0.0f) { + return FLOATNAME(LVecBase3)(0.0f); + } + return (*this) / csqrt(l2); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase3::project // Access: Published diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index f2820acd50..f7641df367 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -34,10 +34,7 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(LVecBase3)(); - INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LVecBase3) &operator = (FLOATTYPE fill_value); + INLINE_LINMATH FLOATNAME(LVecBase3)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); @@ -48,15 +45,13 @@ PUBLISHED: INLINE_LINMATH static const FLOATNAME(LVecBase3) &unit_y(); INLINE_LINMATH static const FLOATNAME(LVecBase3) &unit_z(); - INLINE_LINMATH ~FLOATNAME(LVecBase3)(); - EXTENSION(INLINE_LINMATH PyObject *__reduce__(PyObject *self) const); EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - INLINE_LINMATH static int size(); + CONSTEXPR static int size(); INLINE_LINMATH bool is_nan() const; @@ -74,6 +69,12 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVecBase2) get_xz() const; INLINE_LINMATH FLOATNAME(LVecBase2) get_yz() const; +PUBLISHED: + MAKE_PROPERTY(x, get_x, set_x); + MAKE_PROPERTY(y, get_y, set_y); + MAKE_PROPERTY(z, get_z, set_z); + MAKE_PROPERTY(xy, get_xy); + // These next functions add to an existing value. // i.e. foo.set_x(foo.get_x() + value) // These are useful to reduce overhead in scripting @@ -84,7 +85,7 @@ PUBLISHED: INLINE_LINMATH void add_z(FLOATTYPE value); INLINE_LINMATH const FLOATTYPE *get_data() const; - INLINE_LINMATH int get_num_components() const; + CONSTEXPR static int get_num_components(); public: INLINE_LINMATH iterator begin(); @@ -103,6 +104,7 @@ PUBLISHED: #ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATTYPE length() const; INLINE_LINMATH bool normalize(); + INLINE_LINMATH FLOATNAME(LVecBase3) normalized() const; INLINE_LINMATH FLOATNAME(LVecBase3) project(const FLOATNAME(LVecBase3) &onto) const; #endif diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index f8c8422c58..6ed6bbd009 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -13,24 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: LVecBase4::Default Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase4):: -FLOATNAME(LVecBase4)() { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase4::Copy Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase4):: -FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase4) ©) : _v(copy._v) { -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase4::Copy Constructor // Access: Public @@ -41,40 +23,6 @@ FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©) { set(copy[0], copy[1], copy[2], copy[3]); } -//////////////////////////////////////////////////////////////////// -// Function: LVecBase4::Copy Assignment Operator -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase4) &FLOATNAME(LVecBase4):: -operator = (const FLOATNAME(LVecBase4) ©) { - TAU_PROFILE("void LVecBase4::operator = (LVecBase4 &)", " ", TAU_USER); - _v = copy._v; - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase4::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase4) &FLOATNAME(LVecBase4):: -operator = (const FLOATNAME(UnalignedLVecBase4) ©) { - set(copy[0], copy[1], copy[2], copy[3]); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVecBase4::Fill Assignment Operator -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase4) &FLOATNAME(LVecBase4):: -operator = (FLOATTYPE fill_value) { - fill(fill_value); - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase4::Constructor // Access: Published @@ -128,15 +76,6 @@ FLOATNAME(LVecBase4)(const FLOATNAME(LVector3) &vector) { set(vector[0], vector[1], vector[2], 0); } -//////////////////////////////////////////////////////////////////// -// Function: LVecBase4::Destructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVecBase4):: -~FLOATNAME(LVecBase4)() { -} - //////////////////////////////////////////////////////////////////// // Function: LVecBase4::zero Named Constructor // Access: Published @@ -214,7 +153,7 @@ operator [](int i) { // Access: Published, Static // Description: Returns 4: the number of components of a LVecBase4. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(LVecBase4):: +CONSTEXPR int FLOATNAME(LVecBase4):: size() { return 4; } @@ -286,6 +225,26 @@ get_w() const { return _v(3); } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::get_xyz +// Access: Published +// Description: Returns the x, y and z component of this vector +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LVecBase4):: +get_xyz() const { + return FLOATNAME(LVecBase3)(_v(0), _v(1), _v(2)); +} + +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::get_xy +// Access: Published +// Description: Returns the x and y component of this vector +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase2) FLOATNAME(LVecBase4):: +get_xy() const { + return FLOATNAME(LVecBase2)(_v(0), _v(1)); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase4::set_cell // Access: Published @@ -405,8 +364,8 @@ get_data() const { // Access: Published // Description: Returns the number of elements in the vector, four. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(LVecBase4):: -get_num_components() const { +CONSTEXPR int FLOATNAME(LVecBase4):: +get_num_components() { return 4; } @@ -559,6 +518,22 @@ normalize() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVecBase4) FLOATNAME(LVecBase4):: +normalized() const { + FLOATTYPE l2 = length_squared(); + if (l2 == (FLOATTYPE)0.0f) { + return FLOATNAME(LVecBase4)(0.0f); + } + return (*this) / csqrt(l2); +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase4::project // Access: Published @@ -1107,15 +1082,6 @@ read_datagram(DatagramIterator &source) { #endif } -//////////////////////////////////////////////////////////////////// -// Function: UnalignedLVecBase4::Default Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(UnalignedLVecBase4):: -FLOATNAME(UnalignedLVecBase4)() { -} - //////////////////////////////////////////////////////////////////// // Function: UnalignedLVecBase4::Copy Constructor // Access: Public @@ -1126,38 +1092,6 @@ FLOATNAME(UnalignedLVecBase4)(const FLOATNAME(LVecBase4) ©) { set(copy[0], copy[1], copy[2], copy[3]); } -//////////////////////////////////////////////////////////////////// -// Function: UnalignedLVecBase4::Copy Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(UnalignedLVecBase4):: -FLOATNAME(UnalignedLVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©) : _v(copy._v) { -} - -//////////////////////////////////////////////////////////////////// -// Function: UnalignedLVecBase4::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(UnalignedLVecBase4) &FLOATNAME(UnalignedLVecBase4):: -operator = (const FLOATNAME(LVecBase4) ©) { - set(copy[0], copy[1], copy[2], copy[3]); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: UnalignedLVecBase4::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(UnalignedLVecBase4) &FLOATNAME(UnalignedLVecBase4):: -operator = (const FLOATNAME(UnalignedLVecBase4) ©) { - TAU_PROFILE("void UnalignedLVecBase4::operator =(UnalignedLVecBase4 &)", " ", TAU_USER); - _v = copy._v; - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: UnalignedLVecBase4::Constructor // Access: Public @@ -1210,7 +1144,7 @@ operator [](int i) { // Access: Public, Static // Description: Returns 4: the number of components of a LVecBase4. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(UnalignedLVecBase4):: +CONSTEXPR int FLOATNAME(UnalignedLVecBase4):: size() { return 4; } @@ -1232,7 +1166,7 @@ get_data() const { // Access: Public // Description: Returns the number of elements in the vector, 4. //////////////////////////////////////////////////////////////////// -INLINE_LINMATH int FLOATNAME(UnalignedLVecBase4):: -get_num_components() const { +CONSTEXPR int FLOATNAME(UnalignedLVecBase4):: +get_num_components() { return 4; } diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index 988d31b859..79b136eec1 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -39,14 +39,10 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(LVecBase4)(); - INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©); - INLINE_LINMATH FLOATNAME(LVecBase4) &operator = (const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LVecBase4) &operator = (const FLOATNAME(UnalignedLVecBase4) ©); - INLINE_LINMATH FLOATNAME(LVecBase4) &operator = (FLOATTYPE fill_value); + INLINE_LINMATH FLOATNAME(LVecBase4)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); + INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©); INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LPoint3) &point); INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVector3) &vector); @@ -58,30 +54,39 @@ PUBLISHED: INLINE_LINMATH static const FLOATNAME(LVecBase4) &unit_z(); INLINE_LINMATH static const FLOATNAME(LVecBase4) &unit_w(); - INLINE_LINMATH ~FLOATNAME(LVecBase4)(); - EXTENSION(INLINE_LINMATH PyObject *__reduce__(PyObject *self) const); EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - INLINE_LINMATH static int size(); + CONSTEXPR static int size(); INLINE_LINMATH bool is_nan() const; INLINE_LINMATH FLOATTYPE get_cell(int i) const; + INLINE_LINMATH void set_cell(int i, FLOATTYPE value); + INLINE_LINMATH FLOATTYPE get_x() const; INLINE_LINMATH FLOATTYPE get_y() const; INLINE_LINMATH FLOATTYPE get_z() const; INLINE_LINMATH FLOATTYPE get_w() const; - INLINE_LINMATH void set_cell(int i, FLOATTYPE value); + INLINE_LINMATH FLOATNAME(LVecBase3) get_xyz() const; + INLINE_LINMATH FLOATNAME(LVecBase2) get_xy() const; + INLINE_LINMATH void set_x(FLOATTYPE value); INLINE_LINMATH void set_y(FLOATTYPE value); INLINE_LINMATH void set_z(FLOATTYPE value); INLINE_LINMATH void set_w(FLOATTYPE value); +PUBLISHED: + MAKE_PROPERTY(x, get_x, set_x); + MAKE_PROPERTY(y, get_y, set_y); + MAKE_PROPERTY(z, get_z, set_z); + MAKE_PROPERTY(xy, get_xy); + MAKE_PROPERTY(xyz, get_xyz); + // These next functions add to an existing value. // i.e. foo.set_x(foo.get_x() + value) // These are useful to reduce overhead in scripting @@ -93,7 +98,7 @@ PUBLISHED: INLINE_LINMATH void add_w(FLOATTYPE value); INLINE_LINMATH const FLOATTYPE *get_data() const; - INLINE_LINMATH int get_num_components() const; + CONSTEXPR static int get_num_components(); INLINE_LINMATH void extract_data(float*){}; public: @@ -113,6 +118,7 @@ PUBLISHED: #ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATTYPE length() const; INLINE_LINMATH bool normalize(); + INLINE_LINMATH FLOATNAME(LVecBase4) normalized() const; INLINE_LINMATH FLOATNAME(LVecBase4) project(const FLOATNAME(LVecBase4) &onto) const; #endif @@ -223,21 +229,18 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(); + INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©); - INLINE_LINMATH FLOATNAME(UnalignedLVecBase4) &operator = (const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(UnalignedLVecBase4) &operator = (const FLOATNAME(UnalignedLVecBase4) ©); INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH void set(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - INLINE_LINMATH static int size(); + CONSTEXPR static int size(); INLINE_LINMATH const FLOATTYPE *get_data() const; - INLINE_LINMATH int get_num_components() const; + CONSTEXPR static int get_num_components(); public: typedef FLOATTYPE numeric_type; diff --git a/panda/src/linmath/lvector2_src.I b/panda/src/linmath/lvector2_src.I index 45c7975fea..19095a6a46 100644 --- a/panda/src/linmath/lvector2_src.I +++ b/panda/src/linmath/lvector2_src.I @@ -12,50 +12,23 @@ // //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// -// Function: LVector2::Default Constructor +// Function: LVector2::Constructor // Access: Public -// Description: +// Description: Constructs a new LVector2 from a LVecBase2 //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVector2):: -FLOATNAME(LVector2)() { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVector2::Copy Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector2):: -FLOATNAME(LVector2)(const FLOATNAME(LVecBase2) ©) : FLOATNAME(LVecBase2)(copy) { -} - -//////////////////////////////////////////////////////////////////// -// Function: LVector2::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector2) &FLOATNAME(LVector2):: -operator = (const FLOATNAME(LVecBase2) ©) { - FLOATNAME(LVecBase2)::operator = (copy); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVector2::Copy Fill Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector2) &FLOATNAME(LVector2):: -operator = (FLOATTYPE fill_value) { - FLOATNAME(LVecBase2)::operator = (fill_value); - return *this; +FLOATNAME(LVector2)(const FLOATNAME(LVecBase2)& copy) : + FLOATNAME(LVecBase2)(copy) +{ } //////////////////////////////////////////////////////////////////// // Function: LVector2::Constructor // Access: Public -// Description: +// Description: Constructs a new LVector2 with all components set +// to the fill value. //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVector2):: FLOATNAME(LVector2)(FLOATTYPE fill_value) : @@ -175,6 +148,18 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT +//////////////////////////////////////////////////////////////////// +// Function: LVector2::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVector2) FLOATNAME(LVector2):: +normalized() const { + return FLOATNAME(LVecBase2)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LVector2::project // Access: Published diff --git a/panda/src/linmath/lvector2_src.h b/panda/src/linmath/lvector2_src.h index 2ee50d34ab..3866be0269 100644 --- a/panda/src/linmath/lvector2_src.h +++ b/panda/src/linmath/lvector2_src.h @@ -18,10 +18,9 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_LINMATH FLOATNAME(LVector2) : public FLOATNAME(LVecBase2) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LVector2)(); - INLINE_LINMATH FLOATNAME(LVector2)(const FLOATNAME(LVecBase2) ©); - INLINE_LINMATH FLOATNAME(LVector2) &operator = (const FLOATNAME(LVecBase2) ©); - INLINE_LINMATH FLOATNAME(LVector2) &operator = (FLOATTYPE fill_value); + + INLINE_LINMATH FLOATNAME(LVector2)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVector2)(const FLOATNAME(LVecBase2)& copy); INLINE_LINMATH FLOATNAME(LVector2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector2)(FLOATTYPE x, FLOATTYPE y); @@ -44,6 +43,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector2) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LVector2) normalized() const; INLINE_LINMATH FLOATNAME(LVector2) project(const FLOATNAME(LVecBase2) &onto) const; INLINE_LINMATH FLOATTYPE signed_angle_rad(const FLOATNAME(LVector2) &other) const; INLINE_LINMATH FLOATTYPE signed_angle_deg(const FLOATNAME(LVector2) &other) const; diff --git a/panda/src/linmath/lvector3_src.I b/panda/src/linmath/lvector3_src.I index 318d32d2c9..1144c14e07 100644 --- a/panda/src/linmath/lvector3_src.I +++ b/panda/src/linmath/lvector3_src.I @@ -13,15 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: LVector3::Default Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector3):: -FLOATNAME(LVector3)() { -} - //////////////////////////////////////////////////////////////////// // Function: LVector3::Copy Constructor // Access: Published @@ -31,27 +22,6 @@ INLINE_LINMATH FLOATNAME(LVector3):: FLOATNAME(LVector3)(const FLOATNAME(LVecBase3) ©) : FLOATNAME(LVecBase3)(copy) { } -//////////////////////////////////////////////////////////////////// -// Function: LVector3::Copy Assignment Operator -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector3) &FLOATNAME(LVector3):: -operator = (const FLOATNAME(LVecBase3) ©) { - FLOATNAME(LVecBase3)::operator = (copy); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVector3::Copy Fill Operator -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector3) &FLOATNAME(LVector3):: -operator = (FLOATTYPE fill_value) { - FLOATNAME(LVecBase3)::operator = (fill_value); - return *this; -} //////////////////////////////////////////////////////////////////// // Function: LVector3::Constructor @@ -220,6 +190,19 @@ cross(const FLOATNAME(LVecBase3) &other) const { } #ifndef FLOATTYPE_IS_INT + +//////////////////////////////////////////////////////////////////// +// Function: LVector3::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVector3) FLOATNAME(LVector3):: +normalized() const { + return FLOATNAME(LVecBase3)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LVector3::project // Access: Published diff --git a/panda/src/linmath/lvector3_src.h b/panda/src/linmath/lvector3_src.h index 7e0dd196bb..926f5280bb 100644 --- a/panda/src/linmath/lvector3_src.h +++ b/panda/src/linmath/lvector3_src.h @@ -24,10 +24,8 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_LINMATH FLOATNAME(LVector3) : public FLOATNAME(LVecBase3) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LVector3)(); + INLINE_LINMATH FLOATNAME(LVector3)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LVector3) &operator = (const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LVector3) &operator = (FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); @@ -55,6 +53,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector3) cross(const FLOATNAME(LVecBase3) &other) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LVector3) normalized() const; INLINE_LINMATH FLOATNAME(LVector3) project(const FLOATNAME(LVecBase3) &onto) const; INLINE_LINMATH FLOATTYPE angle_rad(const FLOATNAME(LVector3) &other) const; INLINE_LINMATH FLOATTYPE angle_deg(const FLOATNAME(LVector3) &other) const; diff --git a/panda/src/linmath/lvector4_src.I b/panda/src/linmath/lvector4_src.I index 78333268f4..047b7b2232 100644 --- a/panda/src/linmath/lvector4_src.I +++ b/panda/src/linmath/lvector4_src.I @@ -13,15 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: LVector4::Default Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector4):: -FLOATNAME(LVector4)() { -} - //////////////////////////////////////////////////////////////////// // Function: LVector4::Copy Constructor // Access: Public @@ -31,28 +22,6 @@ INLINE_LINMATH FLOATNAME(LVector4):: FLOATNAME(LVector4)(const FLOATNAME(LVecBase4) ©) : FLOATNAME(LVecBase4)(copy) { } -//////////////////////////////////////////////////////////////////// -// Function: LVector4::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector4) &FLOATNAME(LVector4):: -operator = (const FLOATNAME(LVecBase4) ©) { - FLOATNAME(LVecBase4)::operator = (copy); - return *this; -} - -//////////////////////////////////////////////////////////////////// -// Function: LVector4::Copy Fill Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE_LINMATH FLOATNAME(LVector4) &FLOATNAME(LVector4):: -operator = (FLOATTYPE fill_value) { - FLOATNAME(LVecBase4)::operator = (fill_value); - return *this; -} - //////////////////////////////////////////////////////////////////// // Function: LVector4::Constructor // Access: Public @@ -207,6 +176,19 @@ operator / (FLOATTYPE scalar) const { } #ifndef FLOATTYPE_IS_INT + +//////////////////////////////////////////////////////////////////// +// Function: LVector4::normalized +// Access: Published +// Description: Normalizes the vector and returns the normalized +// vector as a copy. If the vector was a zero-length +// vector, a zero length vector will be returned. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LVector4) FLOATNAME(LVector4):: +normalized() const { + return FLOATNAME(LVecBase4)::normalized(); +} + //////////////////////////////////////////////////////////////////// // Function: LVector4::project // Access: Published diff --git a/panda/src/linmath/lvector4_src.h b/panda/src/linmath/lvector4_src.h index ebf87429f6..a4cda0f612 100644 --- a/panda/src/linmath/lvector4_src.h +++ b/panda/src/linmath/lvector4_src.h @@ -18,10 +18,8 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_LINMATH FLOATNAME(LVector4) : public FLOATNAME(LVecBase4) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LVector4)(); + INLINE_LINMATH FLOATNAME(LVector4)() DEFAULT_CTOR; INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LVector4) &operator = (const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LVector4) &operator = (FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); @@ -47,6 +45,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector4) operator / (FLOATTYPE scalar) const; #ifndef FLOATTYPE_IS_INT + INLINE_LINMATH FLOATNAME(LVector4) normalized() const; INLINE_LINMATH FLOATNAME(LVector4) project(const FLOATNAME(LVecBase4) &onto) const; #endif diff --git a/panda/src/pgraph/clipPlaneAttrib.cxx b/panda/src/pgraph/clipPlaneAttrib.cxx index b07052125e..74a7d31bf7 100644 --- a/panda/src/pgraph/clipPlaneAttrib.cxx +++ b/panda/src/pgraph/clipPlaneAttrib.cxx @@ -960,12 +960,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { // write the off planes pointers if any Planes::const_iterator fi; for (fi = _off_planes.begin(); fi != _off_planes.end(); ++fi) { - NodePath plane = (*fi); - - // Since we can't write out a NodePath, we write out just the - // plain PandaNode. The user can use the AttribNodeRegistry on - // re-read if there is any ambiguity that needs to be resolved. - manager->write_pointer(dg, plane.node()); + (*fi).write_datagram(manager, dg); } // write the number of on planes @@ -973,8 +968,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { // write the on planes pointers if any Planes::const_iterator nti; for (nti = _on_planes.begin(); nti != _on_planes.end(); ++nti) { - NodePath plane = (*nti); - manager->write_pointer(dg, plane.node()); + (*nti).write_datagram(manager, dg); } } @@ -990,38 +984,62 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = RenderAttrib::complete_pointers(p_list, manager); AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); - Planes::iterator ci = _off_planes.begin(); - while (ci != _off_planes.end()) { - PandaNode *node; - DCAST_INTO_R(node, p_list[pi++], pi); - - // We go through some effort to look up the node in the registry - // without creating a NodePath around it first (which would up, - // and then down, the reference count, possibly deleting the - // node). - int ni = areg->find_node(node->get_type(), node->get_name()); - if (ni != -1) { - (*ci) = areg->get_node(ni); - } else { - (*ci) = NodePath(node); + if (manager->get_file_minor_ver() >= 40) { + for (int i = 0; i < _off_planes.size(); ++i) { + pi += _off_planes[i].complete_pointers(p_list + pi, manager); + + int n = areg->find_node(_off_planes[i]); + if (n != -1) { + // If it's in the registry, replace it. + _off_planes[i] = areg->get_node(n); + } + } + + for (int i = 0; i < _on_planes.size(); ++i) { + pi += _on_planes[i].complete_pointers(p_list + pi, manager); + + int n = areg->find_node(_on_planes[i]); + if (n != -1) { + // If it's in the registry, replace it. + _on_planes[i] = areg->get_node(n); + } + } + + } else { + Planes::iterator ci = _off_planes.begin(); + while (ci != _off_planes.end()) { + PandaNode *node; + DCAST_INTO_R(node, p_list[pi++], pi); + + // We go through some effort to look up the node in the registry + // without creating a NodePath around it first (which would up, + // and then down, the reference count, possibly deleting the + // node). + int ni = areg->find_node(node->get_type(), node->get_name()); + if (ni != -1) { + (*ci) = areg->get_node(ni); + } else { + (*ci) = NodePath(node); + } + ++ci; + } + + ci = _on_planes.begin(); + while (ci != _on_planes.end()) { + PandaNode *node; + DCAST_INTO_R(node, p_list[pi++], pi); + + int ni = areg->find_node(node->get_type(), node->get_name()); + if (ni != -1) { + (*ci) = areg->get_node(ni); + } else { + (*ci) = NodePath(node); + } + ++ci; } - ++ci; } + _off_planes.sort(); - - ci = _on_planes.begin(); - while (ci != _on_planes.end()) { - PandaNode *node; - DCAST_INTO_R(node, p_list[pi++], pi); - - int ni = areg->find_node(node->get_type(), node->get_name()); - if (ni != -1) { - (*ci) = areg->get_node(ni); - } else { - (*ci) = NodePath(node); - } - ++ci; - } _on_planes.sort(); return pi; @@ -1073,31 +1091,28 @@ void ClipPlaneAttrib:: fillin(DatagramIterator &scan, BamReader *manager) { RenderAttrib::fillin(scan, manager); - // We cheat a little bit here. In the middle of bam version 4.10, - // we completely redefined the bam storage definition for - // ClipPlaneAttribs, without bothering to up the bam version or even to - // attempt to read the old definition. We get away with this, - // knowing that the egg loader doesn't create ClipPlaneAttribs, and - // hence no old bam files have the old definition for ClipPlaneAttrib - // within them. - _off_all_planes = scan.get_bool(); int num_off_planes = scan.get_uint16(); - + // Push back an empty NodePath for each off Plane for now, until we // get the actual list of pointers later in complete_pointers(). - _off_planes.reserve(num_off_planes); - int i; - for (i = 0; i < num_off_planes; i++) { - manager->read_pointer(scan); - _off_planes.push_back(NodePath()); + _off_planes.resize(num_off_planes); + if (manager->get_file_minor_ver() >= 40) { + for (int i = 0; i < num_off_planes; i++) { + _off_planes[i].fillin(scan, manager); + } + } else { + manager->read_pointers(scan, num_off_planes); } - + int num_on_planes = scan.get_uint16(); - _on_planes.reserve(num_on_planes); - for (i = 0; i < num_on_planes; i++) { - manager->read_pointer(scan); - _on_planes.push_back(NodePath()); + _on_planes.resize(num_on_planes); + if (manager->get_file_minor_ver() >= 40) { + for (int i = 0; i < num_on_planes; i++) { + manager->read_pointer(scan); + } + } else { + manager->read_pointers(scan, num_on_planes); } } diff --git a/panda/src/pgraph/light.I b/panda/src/pgraph/light.I index aa160fa38c..2ca49d2315 100644 --- a/panda/src/pgraph/light.I +++ b/panda/src/pgraph/light.I @@ -45,7 +45,9 @@ CData(const Light::CData ©) : //////////////////////////////////////////////////////////////////// INLINE Light:: Light() : - _priority(0) + _priority(0), + _has_color_temperature(true), + _color_temperature(6500) { } @@ -57,6 +59,8 @@ Light() : INLINE Light:: Light(const Light ©) : _priority(copy._priority), + _has_color_temperature(copy._has_color_temperature), + _color_temperature(copy._color_temperature), _cycler(copy._cycler) { } @@ -81,9 +85,34 @@ INLINE void Light:: set_color(const LColor &color) { CDWriter cdata(_cycler); cdata->_color = color; + _has_color_temperature = false; mark_viz_stale(); } +//////////////////////////////////////////////////////////////////// +// Function: Light::has_color_temperature +// Access: Published +// Description: Returns true if the color was specified as a +// temperature in kelvins, and get_color_temperature +// is defined. +//////////////////////////////////////////////////////////////////// +INLINE bool Light:: +has_color_temperature() const { + return _has_color_temperature; +} + +//////////////////////////////////////////////////////////////////// +// Function: Light::get_color_temperature +// Access: Published +// Description: Returns the basic color temperature of the light, +// assuming has_color_temperature() returns true. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat Light:: +get_color_temperature() const { + nassertr(_has_color_temperature, _color_temperature); + return _color_temperature; +} + //////////////////////////////////////////////////////////////////// // Function: Light::set_priority // Access: Published diff --git a/panda/src/pgraph/light.cxx b/panda/src/pgraph/light.cxx index 3d8ae3822a..1a2ea89095 100644 --- a/panda/src/pgraph/light.cxx +++ b/panda/src/pgraph/light.cxx @@ -76,6 +76,70 @@ is_ambient_light() const { return false; } +//////////////////////////////////////////////////////////////////// +// Function: Light::set_color_temperature +// Access: Published +// Description: Sets the color temperature of the light in kelvins. +// This will recalculate the light's color. +// +// The default value is 6500 K, corresponding to a +// perfectly white light assuming a D65 white point. +//////////////////////////////////////////////////////////////////// +void Light:: +set_color_temperature(PN_stdfloat temperature) { + if (_has_color_temperature && _color_temperature == temperature) { + return; + } + + _has_color_temperature = true; + _color_temperature = temperature; + + // Recalculate the color. + PN_stdfloat x, y; + + if (temperature == 6500) { + // sRGB D65 white point. + x = 0.31271; + y = 0.32902; + + } else { + PN_stdfloat mm = 1000.0 / temperature; + PN_stdfloat mm2 = mm * mm; + PN_stdfloat mm3 = mm2 * mm; + + if (temperature < 4000) { + x = -0.2661239 * mm3 - 0.2343580 * mm2 + 0.8776956 * mm + 0.179910; + } else { + x = -3.0258469 * mm3 + 2.1070379 * mm2 + 0.2226347 * mm + 0.240390; + } + + PN_stdfloat x2 = x * x; + PN_stdfloat x3 = x2 * x; + if (temperature < 2222) { + y = -1.1063814 * x3 - 1.34811020 * x2 + 2.18555832 * x - 0.20219683; + } else if (temperature < 4000) { + y = -0.9549476 * x3 - 1.37418593 * x2 + 2.09137015 * x - 0.16748867; + } else { + y = 3.0817580 * x3 - 5.87338670 * x2 + 3.75112997 * x - 0.37001483; + } + } + + // xyY to XYZ, assuming Y=1. + LVecBase3 xyz(x / y, 1, (1 - x - y) / y); + + // Convert XYZ to linearized sRGB. + const static LMatrix3 xyz_to_rgb( + 3.2406255, -0.9689307, 0.0557101, + -1.537208, 1.8757561, -0.2040211, + -0.4986286, 0.0415175, 1.0569959); + + LColor color(xyz_to_rgb.xform(xyz), 1); + + CDWriter cdata(_cycler); + cdata->_color = color; + mark_viz_stale(); +} + //////////////////////////////////////////////////////////////////// // Function: Light::get_exponent // Access: Public, Virtual @@ -175,7 +239,12 @@ fill_viz_geom(GeomNode *) { //////////////////////////////////////////////////////////////////// void Light:: write_datagram(BamWriter *manager, Datagram &dg) { - manager->write_cdata(dg, _cycler); + dg.add_bool(_has_color_temperature); + if (_has_color_temperature) { + dg.add_stdfloat(_color_temperature); + } else { + manager->write_cdata(dg, _cycler); + } dg.add_int32(_priority); } @@ -188,6 +257,15 @@ write_datagram(BamWriter *manager, Datagram &dg) { //////////////////////////////////////////////////////////////////// void Light:: fillin(DatagramIterator &scan, BamReader *manager) { - manager->read_cdata(scan, _cycler); + if (manager->get_file_minor_ver() >= 39) { + _has_color_temperature = scan.get_bool(); + } else { + _has_color_temperature = false; + } + if (_has_color_temperature) { + set_color_temperature(scan.get_stdfloat()); + } else { + manager->read_cdata(scan, _cycler); + } _priority = scan.get_int32(); } diff --git a/panda/src/pgraph/light.h b/panda/src/pgraph/light.h index 26d32f0c9a..0765a920c3 100644 --- a/panda/src/pgraph/light.h +++ b/panda/src/pgraph/light.h @@ -52,6 +52,12 @@ PUBLISHED: INLINE void set_color(const LColor &color); MAKE_PROPERTY(color, get_color, set_color); + INLINE bool has_color_temperature() const; + INLINE PN_stdfloat get_color_temperature() const; + void set_color_temperature(PN_stdfloat temperature); + MAKE_PROPERTY(color_temperature, get_color_temperature, + set_color_temperature); + virtual PN_stdfloat get_exponent() const; virtual const LColor &get_specular_color() const; virtual const LVecBase3 &get_attenuation() const; @@ -98,6 +104,11 @@ private: int _priority; static UpdateSeq _sort_seq; + // The color temperature is not cycled either, because we only need + // to pass down the computed color anyway. + bool _has_color_temperature; + PN_stdfloat _color_temperature; + // This is the data that must be cycled between pipeline stages. class EXPCL_PANDA_PGRAPH CData : public CycleData { public: diff --git a/panda/src/pgraph/lightAttrib.cxx b/panda/src/pgraph/lightAttrib.cxx index c063746824..59a83e10cb 100644 --- a/panda/src/pgraph/lightAttrib.cxx +++ b/panda/src/pgraph/lightAttrib.cxx @@ -990,12 +990,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { // write the off lights pointers if any Lights::const_iterator fi; for (fi = _off_lights.begin(); fi != _off_lights.end(); ++fi) { - NodePath light = (*fi); - - // Since we can't write out a NodePath, we write out just the - // plain PandaNode. The user can use the AttribNodeRegistry on - // re-read if there is any ambiguity that needs to be resolved. - manager->write_pointer(dg, light.node()); + (*fi).write_datagram(manager, dg); } // write the number of on lights @@ -1003,8 +998,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { // write the on lights pointers if any Lights::const_iterator nti; for (nti = _on_lights.begin(); nti != _on_lights.end(); ++nti) { - NodePath light = (*nti); - manager->write_pointer(dg, light.node()); + (*nti).write_datagram(manager, dg); } } @@ -1019,22 +1013,33 @@ int LightAttrib:: complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = RenderAttrib::complete_pointers(p_list, manager); - BamAuxData *aux = (BamAuxData *)manager->get_aux_data(this, "lights"); - nassertr(aux != NULL, pi); + if (manager->get_file_minor_ver() >= 40) { + for (int i = 0; i < _off_lights.size(); ++i) { + pi += _off_lights[i].complete_pointers(p_list + pi, manager); + } - int i; - aux->_off_list.reserve(aux->_num_off_lights); - for (i = 0; i < aux->_num_off_lights; ++i) { - PandaNode *node; - DCAST_INTO_R(node, p_list[pi++], pi); - aux->_off_list.push_back(node); - } + for (int i = 0; i < _on_lights.size(); ++i) { + pi += _on_lights[i].complete_pointers(p_list + pi, manager); + } - aux->_on_list.reserve(aux->_num_on_lights); - for (i = 0; i < aux->_num_on_lights; ++i) { - PandaNode *node; - DCAST_INTO_R(node, p_list[pi++], pi); - aux->_on_list.push_back(node); + } else { + BamAuxData *aux = (BamAuxData *)manager->get_aux_data(this, "lights"); + nassertr(aux != NULL, pi); + + int i; + aux->_off_list.reserve(aux->_num_off_lights); + for (i = 0; i < aux->_num_off_lights; ++i) { + PandaNode *node; + DCAST_INTO_R(node, p_list[pi++], pi); + aux->_off_list.push_back(node); + } + + aux->_on_list.reserve(aux->_num_on_lights); + for (i = 0; i < aux->_num_on_lights; ++i) { + PandaNode *node; + DCAST_INTO_R(node, p_list[pi++], pi); + aux->_on_list.push_back(node); + } } return pi; @@ -1049,43 +1054,68 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { //////////////////////////////////////////////////////////////////// void LightAttrib:: finalize(BamReader *manager) { - // Now it's safe to convert our saved PandaNodes into NodePaths. - BamAuxData *aux = (BamAuxData *)manager->get_aux_data(this, "lights"); - nassertv(aux != NULL); - nassertv(aux->_num_off_lights == (int)aux->_off_list.size()); - nassertv(aux->_num_on_lights == (int)aux->_on_list.size()); + if (manager->get_file_minor_ver() >= 40) { + AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); - AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); + // Check if any of the nodes we loaded are mentioned in the + // AttribNodeRegistry. If so, replace them. + for (int i = 0; i < _off_lights.size(); ++i) { + int n = areg->find_node(_off_lights[i]); + if (n != -1) { + // If it's in the registry, replace it. + _off_lights[i] = areg->get_node(n); + } + } - _off_lights.reserve(aux->_off_list.size()); - NodeList::iterator ni; - for (ni = aux->_off_list.begin(); ni != aux->_off_list.end(); ++ni) { - PandaNode *node = (*ni); - int n = areg->find_node(node->get_type(), node->get_name()); - if (n != -1) { - // If it's in the registry, add that NodePath. - _off_lights.push_back(areg->get_node(n)); - } else { - // Otherwise, add any arbitrary NodePath. Complain if it's - // ambiguous. - _off_lights.push_back(NodePath(node)); + for (int i = 0; i < _on_lights.size(); ++i) { + int n = areg->find_node(_on_lights[i]); + if (n != -1) { + // If it's in the registry, replace it. + _on_lights[i] = areg->get_node(n); + } + } + + } else { + // Now it's safe to convert our saved PandaNodes into NodePaths. + BamAuxData *aux = (BamAuxData *)manager->get_aux_data(this, "lights"); + nassertv(aux != NULL); + nassertv(aux->_num_off_lights == (int)aux->_off_list.size()); + nassertv(aux->_num_on_lights == (int)aux->_on_list.size()); + + AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); + + _off_lights.reserve(aux->_off_list.size()); + NodeList::iterator ni; + for (ni = aux->_off_list.begin(); ni != aux->_off_list.end(); ++ni) { + PandaNode *node = (*ni); + int n = areg->find_node(node->get_type(), node->get_name()); + if (n != -1) { + // If it's in the registry, add that NodePath. + _off_lights.push_back(areg->get_node(n)); + } else { + // Otherwise, add any arbitrary NodePath. Complain if it's + // ambiguous. + _off_lights.push_back(NodePath(node)); + } + } + + _on_lights.reserve(aux->_on_list.size()); + for (ni = aux->_on_list.begin(); ni != aux->_on_list.end(); ++ni) { + PandaNode *node = (*ni); + int n = areg->find_node(node->get_type(), node->get_name()); + if (n != -1) { + // If it's in the registry, add that NodePath. + _on_lights.push_back(areg->get_node(n)); + } else { + // Otherwise, add any arbitrary NodePath. Complain if it's + // ambiguous. + _on_lights.push_back(NodePath(node)); + } } } + + // Now that the NodePaths have been filled in, we can sort the list. _off_lights.sort(); - - _on_lights.reserve(aux->_on_list.size()); - for (ni = aux->_on_list.begin(); ni != aux->_on_list.end(); ++ni) { - PandaNode *node = (*ni); - int n = areg->find_node(node->get_type(), node->get_name()); - if (n != -1) { - // If it's in the registry, add that NodePath. - _on_lights.push_back(areg->get_node(n)); - } else { - // Otherwise, add any arbitrary NodePath. Complain if it's - // ambiguous. - _on_lights.push_back(NodePath(node)); - } - } _on_lights.sort(); } @@ -1124,12 +1154,24 @@ fillin(DatagramIterator &scan, BamReader *manager) { _off_all_lights = scan.get_bool(); - BamAuxData *aux = new BamAuxData; - manager->set_aux_data(this, "lights", aux); + if (manager->get_file_minor_ver() >= 40) { + _off_lights.resize(scan.get_uint16()); + for (int i = 0; i < _off_lights.size(); ++i) { + _off_lights[i].fillin(scan, manager); + } - aux->_num_off_lights = scan.get_uint16(); - manager->read_pointers(scan, aux->_num_off_lights); - - aux->_num_on_lights = scan.get_uint16(); - manager->read_pointers(scan, aux->_num_on_lights); + _on_lights.resize(scan.get_uint16()); + for (int i = 0; i < _on_lights.size(); ++i) { + _on_lights[i].fillin(scan, manager); + } + } else { + BamAuxData *aux = new BamAuxData; + manager->set_aux_data(this, "lights", aux); + + aux->_num_off_lights = scan.get_uint16(); + manager->read_pointers(scan, aux->_num_off_lights); + + aux->_num_on_lights = scan.get_uint16(); + manager->read_pointers(scan, aux->_num_on_lights); + } } diff --git a/panda/src/pgraph/loader.cxx b/panda/src/pgraph/loader.cxx index 1c3a000988..44cc41de60 100644 --- a/panda/src/pgraph/loader.cxx +++ b/panda/src/pgraph/loader.cxx @@ -357,7 +357,7 @@ try_load_file(const Filename &pathname, const LoaderOptions &options, if (result != (PandaNode *)NULL) { if (record != (BamCacheRecord *)NULL) { // Store the loaded model in the model cache. - record->set_data(result, result); + record->set_data(result); cache->store(record); } diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 94b02fcf84..e5896cbcb8 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -6345,6 +6345,10 @@ write_bam_file(const Filename &filename) const { bool okflag = false; if (bam_file.open_write(filename)) { + // Tell the BamWriter which node is the root node, for making + // NodePaths relative to when writing them out to the file. + bam_file.get_writer()->set_root_node(node()); + if (bam_file.write_object(node())) { okflag = true; } @@ -6368,6 +6372,10 @@ write_bam_stream(ostream &out) const { bool okflag = false; if (bam_file.open_write(out)) { + // Tell the BamWriter which node is the root node, for making + // NodePaths relative to when writing them out to the file. + bam_file.get_writer()->set_root_node(node()); + if (bam_file.write_object(node())) { okflag = true; } @@ -6434,6 +6442,10 @@ encode_to_bam_stream(string &data, BamWriter *writer) const { num_nodes = 1; } + // Tell the BamWriter which node is the root node, for making + // NodePaths relative to when writing them out to the file. + writer->set_root_node(node()); + // Write an initial Datagram to represent the error type and // number of nodes. Datagram dg; @@ -7451,3 +7463,125 @@ r_find_all_materials(PandaNode *node, const RenderState *state, } } +//////////////////////////////////////////////////////////////////// +// Function: NodePath::write_datagram +// Access: Public +// Description: Writes the contents of this object to the datagram +// for shipping out to a Bam file. +//////////////////////////////////////////////////////////////////// +void NodePath:: +write_datagram(BamWriter *manager, Datagram &dg) const { + PandaNode *root = DCAST(PandaNode, manager->get_root_node()); + + // We have no root node to measure from. + if (root == (PandaNode *)NULL || root == node()) { + manager->write_pointer(dg, node()); + manager->write_pointer(dg, NULL); + return; + } + + Thread *current_thread = Thread::get_current_thread(); + int pipeline_stage = current_thread->get_pipeline_stage(); + + // Record the chain of nodes from the root to this node. + pvector path; + NodePathComponent *comp = _head; + while (comp != NULL) { + PandaNode *node = comp->get_node(); + path.push_back(node); + + if (node == root) { + break; + } + + comp = comp->get_next(pipeline_stage, current_thread); + } + + if (comp == (NodePathComponent *)NULL) { + // We did not encounter the root node. Not much we can do. + manager->write_pointer(dg, node()); + manager->write_pointer(dg, NULL); + return; + } + + // Write out the nodes in reverse order, for fast reconstructing. + for (int i = path.size() - 1; i >= 0; --i) { + manager->write_pointer(dg, path[i]); + } + manager->write_pointer(dg, NULL); +} + +//////////////////////////////////////////////////////////////////// +// Function: NodePath::complete_pointers +// Access: Public +// Description: Receives an array of pointers, one for each time +// manager->read_pointer() was called in fillin(). +// Returns the number of pointers processed. +//////////////////////////////////////////////////////////////////// +int NodePath:: +complete_pointers(TypedWritable **p_list, BamReader *manager) { + int pi = 0; + PT(PandaNode) node = DCAST(PandaNode, p_list[pi++]); + if (node.is_null()) { + // An empty NodePath. + _head = (NodePathComponent *)NULL; + return pi; + } + + Thread *current_thread = Thread::get_current_thread(); + int pipeline_stage = current_thread->get_pipeline_stage(); + + // Take an arbitrary path to the root of the NodePath. This probably + // won't be ambiguous, as this is usually the root of the model or scene + // we are currently loading. + PT(NodePathComponent) comp = node->get_generic_component(false, pipeline_stage, current_thread); + nassertd(!comp.is_null()) { + while (p_list[pi++]) {} + return pi; + } + + // Build up the chain of NodePathComponents leading up to this node. + while (p_list[pi] != NULL) { + PT(PandaNode) node = DCAST(PandaNode, p_list[pi++]); + + LightReMutexHolder holder(node->_paths_lock); + + // First, walk through the list of NodePathComponents we already + // have on the child, looking for one that already exists, + // referencing the indicated parent component. + PandaNode::Paths::const_iterator it; + for (it = node->_paths.begin(); it != node->_paths.end(); ++it) { + if ((*it)->get_next(pipeline_stage, current_thread) == comp) { + // If we already have such a component, use that. + comp = (*it); + break; + } + } + + if (it == node->_paths.end()) { + // We don't already have a NodePathComponent referring to this + // parent-child relationship. Create a new one. Note that we can't + // verify that they are actually related because we may not have + // completed the node's pointers yet, so we trust that the .bam is right. + comp = new NodePathComponent(node, comp, pipeline_stage, current_thread); + node->_paths.insert(comp); + } + } + // One more for the final NULL node. + ++pi; + + _head = comp; + return pi; +} + +//////////////////////////////////////////////////////////////////// +// Function: NodePath::fillin +// Access: Protected +// Description: This internal function is called by make_from_bam to +// read in all of the relevant data from the BamFile for +// the new NodePath. +//////////////////////////////////////////////////////////////////// +void NodePath:: +fillin(DatagramIterator &scan, BamReader *manager) { + while(manager->read_pointer(scan)) {}; +} diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 0762600b2e..2ad15a06cb 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -994,6 +994,11 @@ private: static PStatCollector _get_transform_pcollector; static PStatCollector _verify_complete_pcollector; +public: + void write_datagram(BamWriter *manager, Datagram &dg) const; + int complete_pointers(TypedWritable **plist, BamReader *manager); + void fillin(DatagramIterator &scan, BamReader *manager); + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/pgraph/nodePathComponent.h b/panda/src/pgraph/nodePathComponent.h index c0d76f0e78..344170b000 100644 --- a/panda/src/pgraph/nodePathComponent.h +++ b/panda/src/pgraph/nodePathComponent.h @@ -129,6 +129,7 @@ public: private: static TypeHandle _type_handle; friend class PandaNode; + friend class NodePath; }; INLINE ostream &operator << (ostream &out, const NodePathComponent &comp); diff --git a/panda/src/pgraph/occluderEffect.cxx b/panda/src/pgraph/occluderEffect.cxx index 27405998d9..60a5ab0e9c 100644 --- a/panda/src/pgraph/occluderEffect.cxx +++ b/panda/src/pgraph/occluderEffect.cxx @@ -169,8 +169,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { // write the on occluders pointers if any Occluders::const_iterator nti; for (nti = _on_occluders.begin(); nti != _on_occluders.end(); ++nti) { - NodePath occluder = (*nti); - manager->write_pointer(dg, occluder.node()); + (*nti).write_datagram(manager, dg); } } @@ -186,19 +185,32 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = RenderEffect::complete_pointers(p_list, manager); AttribNodeRegistry *areg = AttribNodeRegistry::get_global_ptr(); - Occluders::iterator ci; - ci = _on_occluders.begin(); - while (ci != _on_occluders.end()) { - PandaNode *node; - DCAST_INTO_R(node, p_list[pi++], pi); + if (manager->get_file_minor_ver() >= 40) { + for (int i = 0; i < _on_occluders.size(); ++i) { + pi += _on_occluders[i].complete_pointers(p_list + pi, manager); - int ni = areg->find_node(node->get_type(), node->get_name()); - if (ni != -1) { - (*ci) = areg->get_node(ni); - } else { - (*ci) = NodePath(node); + int n = areg->find_node(_on_occluders[i]); + if (n != -1) { + // If it's in the registry, replace it. + _on_occluders[i] = areg->get_node(n); + } + } + + } else { + Occluders::iterator ci; + ci = _on_occluders.begin(); + while (ci != _on_occluders.end()) { + PandaNode *node; + DCAST_INTO_R(node, p_list[pi++], pi); + + int ni = areg->find_node(node->get_type(), node->get_name()); + if (ni != -1) { + (*ci) = areg->get_node(ni); + } else { + (*ci) = NodePath(node); + } + ++ci; } - ++ci; } _on_occluders.sort(); @@ -250,13 +262,16 @@ make_from_bam(const FactoryParams ¶ms) { void OccluderEffect:: fillin(DatagramIterator &scan, BamReader *manager) { RenderEffect::fillin(scan, manager); - + // Push back an empty NodePath for each Occluder for now, until we // get the actual list of pointers later in complete_pointers(). int num_on_occluders = scan.get_uint16(); - _on_occluders.reserve(num_on_occluders); - for (int i = 0; i < num_on_occluders; i++) { - manager->read_pointer(scan); - _on_occluders.push_back(NodePath()); + _on_occluders.resize(num_on_occluders); + if (manager->get_file_minor_ver() >= 40) { + for (int i = 0; i < num_on_occluders; i++) { + _on_occluders[i].fillin(scan, manager); + } + } else { + manager->read_pointers(scan, num_on_occluders); } } diff --git a/panda/src/pgraph/paramNodePath.cxx b/panda/src/pgraph/paramNodePath.cxx index 00fb5be24a..8f39b69b6c 100644 --- a/panda/src/pgraph/paramNodePath.cxx +++ b/panda/src/pgraph/paramNodePath.cxx @@ -48,15 +48,7 @@ register_with_read_factory() { void ParamNodePath:: write_datagram(BamWriter *manager, Datagram &dg) { ParamValueBase::write_datagram(manager, dg); - - // We can't store a NodePath, so we store a pointer to the - // underlying node, and pray that there is an unambiguous path - // from the root to it. - if (_node_path.is_empty()) { - manager->write_pointer(dg, NULL); - } else { - manager->write_pointer(dg, _node_path.node()); - } + _node_path.write_datagram(manager, dg); } //////////////////////////////////////////////////////////////////// @@ -69,7 +61,12 @@ write_datagram(BamWriter *manager, Datagram &dg) { int ParamNodePath:: complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = ParamValueBase::complete_pointers(p_list, manager); - _node_path = NodePath(DCAST(PandaNode, p_list[pi++])); + + if (manager->get_file_minor_ver() >= 40) { + pi += _node_path.complete_pointers(p_list + pi, manager); + } else { + _node_path = NodePath(DCAST(PandaNode, p_list[pi++])); + } return pi; } @@ -104,5 +101,10 @@ make_from_bam(const FactoryParams ¶ms) { void ParamNodePath:: fillin(DatagramIterator &scan, BamReader *manager) { ParamValueBase::fillin(scan, manager); - manager->read_pointer(scan); + + if (manager->get_file_minor_ver() >= 40) { + _node_path.fillin(scan, manager); + } else { + manager->read_pointer(scan); + } } diff --git a/panda/src/pgraphnodes/directionalLight.I b/panda/src/pgraphnodes/directionalLight.I index 06bc1f5fc6..66c2056900 100644 --- a/panda/src/pgraphnodes/directionalLight.I +++ b/panda/src/pgraphnodes/directionalLight.I @@ -43,12 +43,16 @@ CData(const DirectionalLight::CData ©) : // Function: DirectionalLight::get_specular_color // Access: Public, Final // Description: Returns the color of specular highlights generated by -// the light. +// the light. This is usually the same as get_color(). //////////////////////////////////////////////////////////////////// INLINE const LColor &DirectionalLight:: get_specular_color() const { - CDReader cdata(_cycler); - return cdata->_specular_color; + if (_has_specular_color) { + CDReader cdata(_cycler); + return cdata->_specular_color; + } else { + return get_color(); + } } //////////////////////////////////////////////////////////////////// @@ -60,9 +64,21 @@ get_specular_color() const { INLINE void DirectionalLight:: set_specular_color(const LColor &color) { CDWriter cdata(_cycler); + _has_specular_color = true; cdata->_specular_color = color; } +//////////////////////////////////////////////////////////////////// +// Function: DirectionalLight::clear_specular_color +// Access: Public +// Description: Clears a custom specular color setting, meaning that +// the specular color will now come from the color. +//////////////////////////////////////////////////////////////////// +INLINE void DirectionalLight:: +clear_specular_color() { + _has_specular_color = false; +} + //////////////////////////////////////////////////////////////////// // Function: DirectionalLight::get_point // Access: Public diff --git a/panda/src/pgraphnodes/directionalLight.cxx b/panda/src/pgraphnodes/directionalLight.cxx index 8bab9cbb91..0ad4a558ea 100644 --- a/panda/src/pgraphnodes/directionalLight.cxx +++ b/panda/src/pgraphnodes/directionalLight.cxx @@ -66,7 +66,8 @@ fillin(DatagramIterator &scan, BamReader *) { //////////////////////////////////////////////////////////////////// DirectionalLight:: DirectionalLight(const string &name) : - LightLensNode(name, new OrthographicLens()) + LightLensNode(name, new OrthographicLens()), + _has_specular_color(false) { } @@ -80,6 +81,7 @@ DirectionalLight(const string &name) : DirectionalLight:: DirectionalLight(const DirectionalLight ©) : LightLensNode(copy), + _has_specular_color(copy._has_specular_color), _cycler(copy._cycler) { } @@ -124,8 +126,10 @@ write(ostream &out, int indent_level) const { indent(out, indent_level) << *this << ":\n"; indent(out, indent_level + 2) << "color " << get_color() << "\n"; - indent(out, indent_level + 2) - << "specular color " << get_specular_color() << "\n"; + if (_has_specular_color) { + indent(out, indent_level + 2) + << "specular color " << get_specular_color() << "\n"; + } indent(out, indent_level + 2) << "direction " << get_direction() << "\n"; } @@ -201,6 +205,7 @@ register_with_read_factory() { void DirectionalLight:: write_datagram(BamWriter *manager, Datagram &dg) { LightLensNode::write_datagram(manager, dg); + dg.add_bool(_has_specular_color); manager->write_cdata(dg, _cycler); } @@ -234,5 +239,12 @@ make_from_bam(const FactoryParams ¶ms) { void DirectionalLight:: fillin(DatagramIterator &scan, BamReader *manager) { LightLensNode::fillin(scan, manager); + + if (manager->get_file_minor_ver() >= 39) { + _has_specular_color = scan.get_bool(); + } else { + _has_specular_color = true; + } + manager->read_cdata(scan, _cycler); } diff --git a/panda/src/pgraphnodes/directionalLight.h b/panda/src/pgraphnodes/directionalLight.h index aa030c908b..0bfde2c8cb 100644 --- a/panda/src/pgraphnodes/directionalLight.h +++ b/panda/src/pgraphnodes/directionalLight.h @@ -43,6 +43,7 @@ public: PUBLISHED: INLINE const LColor &get_specular_color() const FINAL; INLINE void set_specular_color(const LColor &color); + INLINE void clear_specular_color(); MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); INLINE const LPoint3 &get_point() const; @@ -60,6 +61,8 @@ public: int light_id); private: + bool _has_specular_color; + // This is the data that must be cycled between pipeline stages. class EXPCL_PANDA_PGRAPHNODES CData : public CycleData { public: diff --git a/panda/src/pgraphnodes/pointLight.I b/panda/src/pgraphnodes/pointLight.I index 49410a51a9..646bd0473c 100644 --- a/panda/src/pgraphnodes/pointLight.I +++ b/panda/src/pgraphnodes/pointLight.I @@ -43,12 +43,16 @@ CData(const PointLight::CData ©) : // Function: PointLight::get_specular_color // Access: Public, Final // Description: Returns the color of specular highlights generated by -// the light. +// the light. This is usually the same as get_color(). //////////////////////////////////////////////////////////////////// INLINE const LColor &PointLight:: get_specular_color() const { - CDReader cdata(_cycler); - return cdata->_specular_color; + if (_has_specular_color) { + CDReader cdata(_cycler); + return cdata->_specular_color; + } else { + return get_color(); + } } //////////////////////////////////////////////////////////////////// @@ -60,9 +64,21 @@ get_specular_color() const { INLINE void PointLight:: set_specular_color(const LColor &color) { CDWriter cdata(_cycler); + _has_specular_color = true; cdata->_specular_color = color; } +//////////////////////////////////////////////////////////////////// +// Function: PointLight::clear_specular_color +// Access: Public +// Description: Clears a custom specular color setting, meaning that +// the specular color will now come from the color. +//////////////////////////////////////////////////////////////////// +INLINE void PointLight:: +clear_specular_color() { + _has_specular_color = false; +} + //////////////////////////////////////////////////////////////////// // Function: PointLight::get_attenuation // Access: Public, Final diff --git a/panda/src/pgraphnodes/pointLight.cxx b/panda/src/pgraphnodes/pointLight.cxx index 20fb1dbd1e..99919a2287 100644 --- a/panda/src/pgraphnodes/pointLight.cxx +++ b/panda/src/pgraphnodes/pointLight.cxx @@ -65,7 +65,8 @@ fillin(DatagramIterator &scan, BamReader *) { //////////////////////////////////////////////////////////////////// PointLight:: PointLight(const string &name) : - LightLensNode(name) + LightLensNode(name), + _has_specular_color(false) { PT(Lens) lens; lens = new PerspectiveLens(90, 90); @@ -98,6 +99,7 @@ PointLight(const string &name) : PointLight:: PointLight(const PointLight ©) : LightLensNode(copy), + _has_specular_color(copy._has_specular_color), _cycler(copy._cycler) { } @@ -141,8 +143,10 @@ write(ostream &out, int indent_level) const { indent(out, indent_level) << *this << ":\n"; indent(out, indent_level + 2) << "color " << get_color() << "\n"; - indent(out, indent_level + 2) - << "specular color " << get_specular_color() << "\n"; + if (_has_specular_color) { + indent(out, indent_level + 2) + << "specular color " << get_specular_color() << "\n"; + } indent(out, indent_level + 2) << "attenuation " << get_attenuation() << "\n"; } @@ -219,6 +223,7 @@ register_with_read_factory() { void PointLight:: write_datagram(BamWriter *manager, Datagram &dg) { LightLensNode::write_datagram(manager, dg); + dg.add_bool(_has_specular_color); manager->write_cdata(dg, _cycler); } @@ -252,5 +257,12 @@ make_from_bam(const FactoryParams ¶ms) { void PointLight:: fillin(DatagramIterator &scan, BamReader *manager) { LightLensNode::fillin(scan, manager); + + if (manager->get_file_minor_ver() >= 39) { + _has_specular_color = scan.get_bool(); + } else { + _has_specular_color = true; + } + manager->read_cdata(scan, _cycler); } diff --git a/panda/src/pgraphnodes/pointLight.h b/panda/src/pgraphnodes/pointLight.h index 7cff02cfe8..f7274d92da 100644 --- a/panda/src/pgraphnodes/pointLight.h +++ b/panda/src/pgraphnodes/pointLight.h @@ -43,6 +43,7 @@ public: PUBLISHED: INLINE const LColor &get_specular_color() const FINAL; INLINE void set_specular_color(const LColor &color); + INLINE void clear_specular_color(); MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); INLINE const LVecBase3 &get_attenuation() const FINAL; @@ -60,6 +61,8 @@ public: int light_id); private: + bool _has_specular_color; + // This is the data that must be cycled between pipeline stages. class EXPCL_PANDA_PGRAPHNODES CData : public CycleData { public: diff --git a/panda/src/pgraphnodes/spotlight.I b/panda/src/pgraphnodes/spotlight.I index 8a81751ea6..7c1fdf7ddd 100644 --- a/panda/src/pgraphnodes/spotlight.I +++ b/panda/src/pgraphnodes/spotlight.I @@ -73,12 +73,16 @@ set_exponent(PN_stdfloat exponent) { // Function: Spotlight::get_specular_color // Access: Public, Final // Description: Returns the color of specular highlights generated by -// the light. +// the light. This is usually the same as get_color(). //////////////////////////////////////////////////////////////////// INLINE const LColor &Spotlight:: get_specular_color() const { - CDReader cdata(_cycler); - return cdata->_specular_color; + if (_has_specular_color) { + CDReader cdata(_cycler); + return cdata->_specular_color; + } else { + return get_color(); + } } //////////////////////////////////////////////////////////////////// @@ -90,9 +94,21 @@ get_specular_color() const { INLINE void Spotlight:: set_specular_color(const LColor &color) { CDWriter cdata(_cycler); + _has_specular_color = true; cdata->_specular_color = color; } +//////////////////////////////////////////////////////////////////// +// Function: Spotlight::clear_specular_color +// Access: Public +// Description: Clears a custom specular color setting, meaning that +// the specular color will now come from the color. +//////////////////////////////////////////////////////////////////// +INLINE void Spotlight:: +clear_specular_color() { + _has_specular_color = false; +} + //////////////////////////////////////////////////////////////////// // Function: Spotlight::get_attenuation // Access: Public, Final diff --git a/panda/src/pgraphnodes/spotlight.cxx b/panda/src/pgraphnodes/spotlight.cxx index 15ce5a7d98..ad4f75eb63 100644 --- a/panda/src/pgraphnodes/spotlight.cxx +++ b/panda/src/pgraphnodes/spotlight.cxx @@ -69,7 +69,8 @@ fillin(DatagramIterator &scan, BamReader *) { //////////////////////////////////////////////////////////////////// Spotlight:: Spotlight(const string &name) : - LightLensNode(name) + LightLensNode(name), + _has_specular_color(false) { } @@ -83,6 +84,7 @@ Spotlight(const string &name) : Spotlight:: Spotlight(const Spotlight ©) : LightLensNode(copy), + _has_specular_color(copy._has_specular_color), _cycler(copy._cycler) { } @@ -124,8 +126,10 @@ write(ostream &out, int indent_level) const { indent(out, indent_level) << *this << ":\n"; indent(out, indent_level + 2) << "color " << get_color() << "\n"; - indent(out, indent_level + 2) - << "specular color " << get_specular_color() << "\n"; + if (_has_specular_color) { + indent(out, indent_level + 2) + << "specular color " << get_specular_color() << "\n"; + } indent(out, indent_level + 2) << "attenuation " << get_attenuation() << "\n"; indent(out, indent_level + 2) @@ -286,6 +290,7 @@ register_with_read_factory() { void Spotlight:: write_datagram(BamWriter *manager, Datagram &dg) { LightLensNode::write_datagram(manager, dg); + dg.add_bool(_has_specular_color); manager->write_cdata(dg, _cycler); } @@ -319,5 +324,12 @@ make_from_bam(const FactoryParams ¶ms) { void Spotlight:: fillin(DatagramIterator &scan, BamReader *manager) { LightLensNode::fillin(scan, manager); + + if (manager->get_file_minor_ver() >= 39) { + _has_specular_color = scan.get_bool(); + } else { + _has_specular_color = true; + } + manager->read_cdata(scan, _cycler); } diff --git a/panda/src/pgraphnodes/spotlight.h b/panda/src/pgraphnodes/spotlight.h index 46bd3578f2..4b28d286e9 100644 --- a/panda/src/pgraphnodes/spotlight.h +++ b/panda/src/pgraphnodes/spotlight.h @@ -57,6 +57,7 @@ PUBLISHED: INLINE const LColor &get_specular_color() const FINAL; INLINE void set_specular_color(const LColor &color); + INLINE void clear_specular_color(); MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); INLINE const LVecBase3 &get_attenuation() const FINAL; @@ -79,6 +80,8 @@ private: CPT(RenderState) get_viz_state(); private: + bool _has_specular_color; + // This is the data that must be cycled between pipeline stages. class EXPCL_PANDA_PGRAPHNODES CData : public CycleData { public: diff --git a/panda/src/pnmtext/freetypeFont.I b/panda/src/pnmtext/freetypeFont.I index 0ecc93536a..af6fdda503 100644 --- a/panda/src/pnmtext/freetypeFont.I +++ b/panda/src/pnmtext/freetypeFont.I @@ -232,6 +232,30 @@ get_points_per_inch() { return _points_per_inch; } +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::set_winding_order +// Access: Published +// Description: Specifies an explicitly winding order on this +// particular font. This is only necessary if the +// render_mode is RM_polygon or RM_solid, and only if +// FreeType appears to guess wrong on this font. +// Normally, you should leave this at WO_default. +//////////////////////////////////////////////////////////////////// +INLINE void FreetypeFont:: +set_winding_order(WindingOrder winding_order) { + _winding_order = winding_order; +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::get_winding_order +// Access: Published +// Description: Returns the winding order set via set_winding_order(). +//////////////////////////////////////////////////////////////////// +INLINE FreetypeFont::WindingOrder FreetypeFont:: +get_winding_order() const { + return _winding_order; +} + //////////////////////////////////////////////////////////////////// // Function: FreetypeFont::acquire_face // Access: Protected @@ -259,3 +283,46 @@ release_face(FT_Face face) const { nassertv(_face != NULL); _face->release_face(face); } + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::ContourPoint::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE FreetypeFont::ContourPoint:: +ContourPoint(const LPoint2 &p, const LVector2 &in, const LVector2 &out) : + _p(p), _in(in), _out(out), _radius(0) +{ +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::ContourPoint::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE FreetypeFont::ContourPoint:: +ContourPoint(PN_stdfloat px, PN_stdfloat py, PN_stdfloat tx, PN_stdfloat ty) : + _p(px, py), _in(tx, ty), _out(tx, ty), _radius(0) +{ +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::connect_to +// Access: Public +// Description: Connects the indicated point to the next point, whose +// tangent is given. The given tangent becomes the out +// tangent at this point. If the in tangent and out +// tangent are sufficiently close, they will be smoothed +// together. +//////////////////////////////////////////////////////////////////// +INLINE void FreetypeFont::ContourPoint:: +connect_to(const LVector2 &out) { + _out = out; + if (_in.dot(_out) > 0.7071) { + // Less than 45 degrees of difference: smooth them. + LVector2 av = (_in + _out) * 0.5f; + av.normalize(); + _in = av; + _out = av; + } +} diff --git a/panda/src/pnmtext/freetypeFont.cxx b/panda/src/pnmtext/freetypeFont.cxx index 974787a331..6f89f5528a 100644 --- a/panda/src/pnmtext/freetypeFont.cxx +++ b/panda/src/pnmtext/freetypeFont.cxx @@ -20,6 +20,11 @@ #include "config_util.h" #include "config_express.h" #include "virtualFileSystem.h" +#include "nurbsCurveEvaluator.h" +#include "nurbsCurveResult.h" + +#undef interface // I don't know where this symbol is defined, but it interferes with FreeType. +#include FT_OUTLINE_H // This constant determines how big a particular point size font // appears to be. By convention, 10 points is 1 unit (e.g. 1 foot) @@ -44,6 +49,7 @@ FreetypeFont() { _requested_scale_factor = text_scale_factor; _scale_factor = text_scale_factor; _native_antialias = text_native_antialias; + _winding_order = WO_default; _line_height = 1.0f; _space_advance = 0.25f; @@ -69,6 +75,7 @@ FreetypeFont(const FreetypeFont ©) : _scale_factor(copy._scale_factor), _native_antialias(copy._native_antialias), _font_pixels_per_unit(copy._font_pixels_per_unit), + _winding_order(copy._winding_order), _line_height(copy._line_height), _space_advance(copy._space_advance), _face(copy._face), @@ -193,6 +200,26 @@ unload_font() { _face = NULL; } +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::string_winding_order +// Access: Public +// Description: Returns the WindingOrder value associated with the given +// string representation, or WO_invalid if the string +// does not match any known WindingOrder value. +//////////////////////////////////////////////////////////////////// +FreetypeFont::WindingOrder FreetypeFont:: +string_winding_order(const string &string) { + if (cmp_nocase_uh(string, "default") == 0) { + return WO_default; + } else if (cmp_nocase_uh(string, "left") == 0) { + return WO_left; + } else if (cmp_nocase_uh(string, "right") == 0) { + return WO_right; + } else { + return WO_invalid; + } +} + //////////////////////////////////////////////////////////////////// // Function: FreetypeFont::load_glyph // Access: Protected @@ -383,4 +410,408 @@ reset_scale() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::render_distance_field +// Access: Private +// Description: Renders a signed distance field to the PNMImage +// based on the contours. +//////////////////////////////////////////////////////////////////// +void FreetypeFont:: +render_distance_field(PNMImage &image, int outline, int min_x, int min_y) { + Contours::const_iterator ci; + + PN_stdfloat offset_x = -outline / _tex_pixels_per_unit; + PN_stdfloat offset_y = (image.get_y_size() - 1 - outline) / _tex_pixels_per_unit;; + + offset_x += min_x / (64.0f * _font_pixels_per_unit); + offset_y += min_y / (64.0f * _font_pixels_per_unit); + + PN_stdfloat scale = _tex_pixels_per_unit / (outline * 2); + + for (int y = 0; y < image.get_y_size(); ++y) { + LPoint2 p(0, offset_y - (y / _tex_pixels_per_unit)); + + for (int x = 0; x < image.get_x_size(); ++x) { + p[0] = offset_x + (x / _tex_pixels_per_unit); + + PN_stdfloat min_dist_sq = 100000000; + int winding_number = 0; + + for (ci = _contours.begin(); ci != _contours.end(); ++ci) { + // Find the shortest distance between this point and the contour. + // Also keep track of the winding number, so we will know whether + // this point is inside or outside the polygon. + const Contour &contour = (*ci); + + for (size_t i = 1; i < contour._points.size(); ++i) { + const LPoint2 &begin = contour._points[i - 1]._p; + const LPoint2 &end = contour._points[i]._p; + PN_stdfloat radius = contour._points[i]._radius; + + LVector2 v = end - begin; + PN_stdfloat length_sq = v.length_squared(); + PN_stdfloat dist_sq; + + if (length_sq == 0) { + dist_sq = (p - begin).length_squared(); + + } else if (radius != 0) { + // Circular arc approximation. + LVector2 v1 = begin - contour._points[i]._center; + LVector2 v2 = end - contour._points[i]._center; + LVector2 vp = p - contour._points[i]._center; + PN_stdfloat dist_to_center = vp.length(); + vp /= dist_to_center; + v1 /= radius; + v2 /= radius; + PN_stdfloat range = v1.dot(v2); + if (vp.dot(v1) > range && vp.dot(v2) > range) { + dist_sq = dist_to_center - radius; + bool inside = dist_sq < 0; + dist_sq *= dist_sq; + + //if (v1[0] * vp[1] - vp[0] * v1[1] < 0 && v2[0] * vp[1] - vp[0] * v2[1] < 0) { + //if (v1.signed_angle_deg(vp) < v1.signed_angle_deg(v2) && v1.signed_angle_deg(vp) > 0) { + if (begin[1] <= p[1]) { + if (end[1] > p[1]) { + if (inside != (v[0] * v1[1] > v[1] * v1[0])) { + ++winding_number; + } + } + } else { + if (end[1] <= p[1]) { + if (inside == (v[0] * v1[1] > v[1] * v1[0])) { + --winding_number; + } + } + } + + } else { + dist_sq = min((p - begin).length_squared(), (p - end).length_squared()); + if (begin[1] <= p[1]) { + if (end[1] > p[1]) { + if ((v[0] * (p[1] - begin[1]) > v[1] * (p[0] - begin[0]))) { + ++winding_number; + } + } + } else { + if (end[1] <= p[1]) { + if ((v[0] * (p[1] - begin[1]) < v[1] * (p[0] - begin[0]))) { + --winding_number; + } + } + } + } + + } else { + // Just a straight line. + if (begin[1] <= p[1]) { + if (end[1] > p[1]) { + if ((v[0] * (p[1] - begin[1]) > v[1] * (p[0] - begin[0]))) { + ++winding_number; + } + } + } else { + if (end[1] <= p[1]) { + if ((v[0] * (p[1] - begin[1]) < v[1] * (p[0] - begin[0]))) { + --winding_number; + } + } + } + + PN_stdfloat t = v.dot(p - begin) / length_sq; + if (t <= 0.0) { + dist_sq = (p - begin).length_squared(); + } else if (t >= 1.0) { + dist_sq = (p - end).length_squared(); + } else { + dist_sq = (p - (begin + v * t)).length_squared(); + } + } + + min_dist_sq = min(min_dist_sq, dist_sq); + } + } + // Determine the sign based on whether we're inside the contour. + int sign = (winding_number != 0) ? 1 : -1; + + PN_stdfloat signed_dist = csqrt(min_dist_sq) * sign; + image.set_gray(x, y, signed_dist * scale + (PN_stdfloat)0.5); + } + } +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::decompose_outline +// Access: Protected +// Description: Ask FreeType to extract the contours out of the +// outline description. +//////////////////////////////////////////////////////////////////// +void FreetypeFont:: +decompose_outline(FT_Outline &outline) { + FT_Outline_Funcs funcs; + memset(&funcs, 0, sizeof(funcs)); + funcs.move_to = (FT_Outline_MoveTo_Func)outline_move_to; + funcs.line_to = (FT_Outline_LineTo_Func)outline_line_to; + funcs.conic_to = (FT_Outline_ConicTo_Func)outline_conic_to; + funcs.cubic_to = (FT_Outline_CubicTo_Func)outline_cubic_to; + + WindingOrder wo = _winding_order; + if (wo == WO_default) { + // If we weren't told an explicit winding order, ask FreeType to + // figure it out. Sometimes it appears to guess wrong. +#ifdef FT_ORIENTATION_FILL_RIGHT + if (FT_Outline_Get_Orientation(&outline) == FT_ORIENTATION_FILL_RIGHT) { + wo = WO_right; + } else { + wo = WO_left; + } +#else + // Hmm. Assign a right-winding (TTF) orientation if FreeType + // can't tell us. + wo = WO_right; +#endif // FT_ORIENTATION_FILL_RIGHT + } + + if (wo != WO_left) { + FT_Outline_Reverse(&outline); + } + + _contours.clear(); + FT_Outline_Decompose(&outline, &funcs, (void *)this); +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::outline_move_to +// Access: Private, Static +// Description: A callback from FT_Outline_Decompose(). It marks the +// beginning of a new contour. +//////////////////////////////////////////////////////////////////// +int FreetypeFont:: +outline_move_to(const FT_Vector *to, void *user) { + FreetypeFont *self = (FreetypeFont *)user; + + // Convert from 26.6 pixel units to Panda units. + PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); + LPoint2 p = LPoint2(to->x, to->y) * scale; + + if (self->_contours.empty() || + !self->_contours.back()._points.empty()) { + self->_contours.push_back(Contour()); + } + self->_q = p; + return 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::outline_line_to +// Access: Private, Static +// Description: A callback from FT_Outline_Decompose(). It marks a +// straight line in the contour. +//////////////////////////////////////////////////////////////////// +int FreetypeFont:: +outline_line_to(const FT_Vector *to, void *user) { + FreetypeFont *self = (FreetypeFont *)user; + nassertr(!self->_contours.empty(), 1); + + // Convert from 26.6 pixel units to Panda units. + PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); + LPoint2 p = LPoint2(to->x, to->y) * scale; + + // Compute the tangent: this is just the vector from the last point. + LVector2 t = (p - self->_q); + t.normalize(); + + if (self->_contours.back()._points.empty()) { + self->_contours.back()._points.push_back(ContourPoint(self->_q, LVector2::zero(), t)); + } else { + self->_contours.back()._points.back().connect_to(t); + } + + self->_contours.back()._points.push_back(ContourPoint(p, t, LVector2::zero())); + self->_q = p; + return 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::outline_conic_to +// Access: Private, Static +// Description: A callback from FT_Outline_Decompose(). It marks a +// parabolic (3rd-order) Bezier curve in the contour. +//////////////////////////////////////////////////////////////////// +int FreetypeFont:: +outline_conic_to(const FT_Vector *control, + const FT_Vector *to, void *user) { + FreetypeFont *self = (FreetypeFont *)user; + nassertr(!self->_contours.empty(), 1); + + // Convert from 26.6 pixel units to Panda units. + PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); + + LPoint2 c = LPoint2(control->x, control->y) * scale; + LPoint2 p = LPoint2(to->x, to->y) * scale; + + // The NurbsCurveEvaluator will evaluate the Bezier segment for us. + NurbsCurveEvaluator nce; + nce.local_object(); + nce.set_order(3); + nce.reset(3); + nce.set_vertex(0, LVecBase3(self->_q[0], self->_q[1], 0.0f)); + nce.set_vertex(1, LVecBase3(c[0], c[1], 0.0f)); + nce.set_vertex(2, LVecBase3(p[0], p[1], 0.0f)); + + self->_q = p; + + PT(NurbsCurveResult) ncr = nce.evaluate(); + return self->outline_nurbs(ncr); +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::outline_cubic_to +// Access: Private, Static +// Description: A callback from FT_Outline_Decompose(). It marks a +// cubic (4th-order) Bezier curve in the contour. +//////////////////////////////////////////////////////////////////// +int FreetypeFont:: +outline_cubic_to(const FT_Vector *control1, const FT_Vector *control2, + const FT_Vector *to, void *user) { + FreetypeFont *self = (FreetypeFont *)user; + nassertr(!self->_contours.empty(), 1); + + // Convert from 26.6 pixel units to Panda units. + PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); + + LPoint2 c1 = LPoint2(control1->x, control1->y) * scale; + LPoint2 c2 = LPoint2(control2->x, control2->y) * scale; + LPoint2 p = LPoint2(to->x, to->y) * scale; + + // The NurbsCurveEvaluator will evaluate the Bezier segment for us. + NurbsCurveEvaluator nce; + nce.local_object(); + nce.set_order(4); + nce.reset(4); + nce.set_vertex(0, LVecBase3(self->_q[0], self->_q[1], 0.0f)); + nce.set_vertex(1, LVecBase3(c1[0], c1[1], 0.0f)); + nce.set_vertex(2, LVecBase3(c2[0], c2[1], 0.0f)); + nce.set_vertex(3, LVecBase3(p[0], p[1], 0.0f)); + + self->_q = p; + + PT(NurbsCurveResult) ncr = nce.evaluate(); + return self->outline_nurbs(ncr); +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::outline_nurbs +// Access: Private +// Description: Called internally by outline_cubic_to() and +// outline_conic_to(). +//////////////////////////////////////////////////////////////////// +int FreetypeFont:: +outline_nurbs(NurbsCurveResult *ncr) { + // Sample it down so that the lines approximate the curve to within + // a "pixel." + ncr->adaptive_sample(1.0f / _font_pixels_per_unit); + + int num_samples = ncr->get_num_samples(); + + bool needs_connect = false; + int start = 1; + if (_contours.back()._points.empty()) { + // If we haven't got the first point of this contour yet, we must + // add it now. + start = 0; + } else { + needs_connect = true; + } + + for (int i = start; i < num_samples; ++i) { + PN_stdfloat st = ncr->get_sample_t(i); + const LPoint3 &p = ncr->get_sample_point(i); + + PN_stdfloat st0 = st, st1 = st; + if (i > 0) { + PN_stdfloat last_t = ncr->get_sample_t(i - 1); + st0 = ncr->get_sample_t(i - 1) * 0.1f + st * 0.9f; + } + if (i < num_samples - 1) { + st1 = ncr->get_sample_t(i + 1) * 0.1f + st * 0.9f; + } + // Compute the tangent by deltaing nearby points. Don't evaluate + // the tangent from the NURBS, since that doesn't appear to be + // reliable. + LPoint3 p0, p1; + ncr->eval_point(st0, p0); + ncr->eval_point(st1, p1); + LVector3 t = p1 - p0; + t.normalize(); + + if (needs_connect) { + _contours.back()._points.back().connect_to(LVector2(t[0], t[1])); + needs_connect = false; + } + + _contours.back()._points.push_back(ContourPoint(p[0], p[1], t[0], t[1])); + + if (i > 0) { + // Approximate the curve using a circular arc. This is used in the + // signed distance field generation code. We do this by sampling a + // point in the middle of the segment and calculating the circle that + // goes through the three points. + LPoint2 v1 = ncr->get_sample_point(i - 1).get_xy(); + LPoint3 v2; + ncr->eval_point((ncr->get_sample_t(i - 1) + ncr->get_sample_t(i)) / 2, v2); + PN_stdfloat temp = v1.length_squared(); + PN_stdfloat bc = (v2[0]*v2[0] + v2[1]*v2[1] - temp) * (PN_stdfloat)0.5f; + PN_stdfloat cd = (temp - p[0]*p[0] - p[1]*p[1]) * (PN_stdfloat)0.5f; + PN_stdfloat det = (v2[0]-v1[0])*(v1[1]-p[1])-(v1[0]-p[0])*(v2[1]-v1[1]); + if (!IS_NEARLY_ZERO(det)) { + LPoint2 center; + center[0] = (bc*(v1[1]-p[1])-cd*(v2[1]-v1[1])); + center[1] = ((v2[0]-v1[0])*cd-(v1[0]-p[0])*bc); + center /= det; + _contours.back()._points.back()._center = center; + _contours.back()._points.back()._radius = (center - v1).length(); + } + } + } + + return 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::WindingOrder output operator +// Description: +//////////////////////////////////////////////////////////////////// +ostream & +operator << (ostream &out, FreetypeFont::WindingOrder wo) { + switch (wo) { + case FreetypeFont::WO_default: + return out << "default"; + case FreetypeFont::WO_left: + return out << "left"; + case FreetypeFont::WO_right: + return out << "right"; + + case FreetypeFont::WO_invalid: + return out << "invalid"; + } + + return out << "(**invalid FreetypeFont::WindingOrder(" << (int)wo << ")**)"; +} + +//////////////////////////////////////////////////////////////////// +// Function: FreetypeFont::WindingOrder input operator +// Description: +//////////////////////////////////////////////////////////////////// +istream & +operator >> (istream &in, FreetypeFont::WindingOrder &wo) { + string word; + in >> word; + + wo = FreetypeFont::string_winding_order(word); + return in; +} + + #endif // HAVE_FREETYPE diff --git a/panda/src/pnmtext/freetypeFont.h b/panda/src/pnmtext/freetypeFont.h index 9352701a4d..5501aa8008 100644 --- a/panda/src/pnmtext/freetypeFont.h +++ b/panda/src/pnmtext/freetypeFont.h @@ -30,6 +30,8 @@ #include #include FT_FREETYPE_H +class NurbsCurveResult; + //////////////////////////////////////////////////////////////////// // Class : FreetypeFont // Description : This is a common base class for both DynamicTextFont @@ -50,6 +52,14 @@ protected: PUBLISHED: INLINE ~FreetypeFont(); + enum WindingOrder { + WO_default, + WO_left, + WO_right, + + WO_invalid, + }; + INLINE bool set_point_size(PN_stdfloat point_size); INLINE PN_stdfloat get_point_size() const; @@ -73,16 +83,35 @@ PUBLISHED: INLINE static PN_stdfloat get_points_per_unit(); INLINE static PN_stdfloat get_points_per_inch(); + INLINE void set_winding_order(WindingOrder winding_order); + INLINE WindingOrder get_winding_order() const; + MAKE_PROPERTY(winding_order, get_winding_order, set_winding_order); + +public: + static WindingOrder string_winding_order(const string &string); + protected: INLINE FT_Face acquire_face() const; INLINE void release_face(FT_Face face) const; bool load_glyph(FT_Face face, int glyph_index, bool prerender = true); void copy_bitmap_to_pnmimage(const FT_Bitmap &bitmap, PNMImage &image); + void render_distance_field(PNMImage &image, int radius, int min_x, int min_y); + + void decompose_outline(FT_Outline &outline); private: bool reset_scale(); + static int outline_move_to(const FT_Vector *to, void *user); + static int outline_line_to(const FT_Vector *to, void *user); + static int outline_conic_to(const FT_Vector *control, + const FT_Vector *to, void *user); + static int outline_cubic_to(const FT_Vector *control1, + const FT_Vector *control2, + const FT_Vector *to, void *user); + int outline_nurbs(NurbsCurveResult *ncr); + protected: PN_stdfloat _point_size; PN_stdfloat _requested_pixels_per_unit; @@ -91,6 +120,7 @@ protected: PN_stdfloat _scale_factor; bool _native_antialias; PN_stdfloat _font_pixels_per_unit; + WindingOrder _winding_order; int _font_pixel_size; PN_stdfloat _line_height; @@ -102,6 +132,33 @@ protected: int _pixel_width; int _pixel_height; + class ContourPoint { + public: + INLINE ContourPoint(const LPoint2 &p, const LVector2 &in, + const LVector2 &out); + INLINE ContourPoint(PN_stdfloat px, PN_stdfloat py, PN_stdfloat tx, PN_stdfloat ty); + INLINE void connect_to(const LVector2 &out); + LPoint2 _p; + LVector2 _in, _out; // tangents into and out of the vertex. + + // Circular arc approximation of the curve from previous point. + // If radius is 0, this is a straight line. + LPoint2 _center; + PN_stdfloat _radius; + }; + typedef pvector Points; + + class Contour { + public: + Points _points; + bool _is_solid; + int _start_vertex; + }; + + typedef pvector Contours; + Contours _contours; + LPoint2 _q; // The "current point". + protected: static const PN_stdfloat _points_per_unit; static const PN_stdfloat _points_per_inch; @@ -109,6 +166,9 @@ protected: #include "freetypeFont.I" +EXPCL_PANDA_PNMTEXT ostream &operator << (ostream &out, FreetypeFont::WindingOrder wo); +EXPCL_PANDA_PNMTEXT istream &operator >> (istream &in, FreetypeFont::WindingOrder &wo); + #endif // HAVE_FREETYPE #endif diff --git a/panda/src/pnmtext/pnmTextMaker.I b/panda/src/pnmtext/pnmTextMaker.I index 9cd0e9044b..f74f04ab1e 100644 --- a/panda/src/pnmtext/pnmTextMaker.I +++ b/panda/src/pnmtext/pnmTextMaker.I @@ -124,6 +124,29 @@ get_interior() const { return _interior; } +//////////////////////////////////////////////////////////////////// +// Function: PNMTextMaker::set_distance_field_radius +// Access: Published +// Description: If this is set to something other than 0, Panda +// will generate a signed distance field with the +// given radius. +//////////////////////////////////////////////////////////////////// +INLINE void PNMTextMaker:: +set_distance_field_radius(int distance_field_radius) { + _distance_field_radius = distance_field_radius; +} + +//////////////////////////////////////////////////////////////////// +// Function: PNMTextMaker::get_distance_field_radius +// Access: Published +// Description: Returns the radius previously set with +// set_distance_field_radius, or 0 otherwise. +//////////////////////////////////////////////////////////////////// +INLINE int PNMTextMaker:: +get_distance_field_radius() const { + return _distance_field_radius; +} + //////////////////////////////////////////////////////////////////// // Function: PNMTextMaker::generate_into // Access: Public diff --git a/panda/src/pnmtext/pnmTextMaker.cxx b/panda/src/pnmtext/pnmTextMaker.cxx index e48e9e0445..809033d2cf 100644 --- a/panda/src/pnmtext/pnmTextMaker.cxx +++ b/panda/src/pnmtext/pnmTextMaker.cxx @@ -55,7 +55,8 @@ PNMTextMaker(const PNMTextMaker ©) : _align(copy._align), _interior_flag(copy._interior_flag), _fg(copy._fg), - _interior(copy._interior) + _interior(copy._interior), + _distance_field_radius(copy._distance_field_radius) { } @@ -180,6 +181,7 @@ initialize() { _interior_flag = false; _fg.set(0.0f, 0.0f, 0.0f, 1.0f); _interior.set(0.5f, 0.5f, 0.5f, 1.0f); + _distance_field_radius = 0; } //////////////////////////////////////////////////////////////////// @@ -210,15 +212,61 @@ make_glyph(int glyph_index) { } else { PNMImage &glyph_image = glyph->_image; - glyph_image.clear(bitmap.width, bitmap.rows, 3); - copy_bitmap_to_pnmimage(bitmap, glyph_image); - glyph->_top = slot->bitmap_top; - glyph->_left = slot->bitmap_left; + if (_distance_field_radius != 0) { + // Ask FreeType to extract the contours out of the outline + // description. + decompose_outline(slot->outline); - if (_interior_flag) { - glyph->determine_interior(); + PN_stdfloat tex_x_size, tex_y_size, tex_x_orig, tex_y_orig; + FT_BBox bounds; + TransparencyAttrib::Mode alpha_mode; + + // Calculate suitable texture dimensions for the signed distance field. + // This is the same calculation that Freetype uses in its bitmap renderer. + FT_Outline_Get_CBox(&slot->outline, &bounds); + + bounds.xMin = bounds.xMin & ~63; + bounds.yMin = bounds.yMin & ~63; + bounds.xMax = (bounds.xMax + 63) & ~63; + bounds.yMax = (bounds.yMax + 63) & ~63; + + tex_x_size = (bounds.xMax - bounds.xMin) >> 6; + tex_y_size = (bounds.yMax - bounds.yMin) >> 6; + tex_x_orig = (bounds.xMin >> 6); + tex_y_orig = (bounds.yMax >> 6); + + if (tex_x_size == 0 || tex_y_size == 0) { + // If we got an empty bitmap, it's a special case. + } else { + int outline = 0; + + int int_x_size = (int)ceil(tex_x_size); + int int_y_size = (int)ceil(tex_y_size); + + outline = _distance_field_radius; + int_x_size += outline * 2; + int_y_size += outline * 2; + + glyph_image.clear(int_x_size, int_y_size, 1); + render_distance_field(glyph_image, outline, bounds.xMin, bounds.yMin); + + glyph->_top = tex_y_orig + outline * _scale_factor; + glyph->_left = tex_x_orig + outline * _scale_factor; + + } + } else { + glyph_image.clear(bitmap.width, bitmap.rows, 3); + copy_bitmap_to_pnmimage(bitmap, glyph_image); + + glyph->_top = slot->bitmap_top; + glyph->_left = slot->bitmap_left; + + if (_interior_flag) { + glyph->determine_interior(); + } } + glyph->rescale(_scale_factor); } diff --git a/panda/src/pnmtext/pnmTextMaker.h b/panda/src/pnmtext/pnmTextMaker.h index e524465d27..4f4247c22e 100644 --- a/panda/src/pnmtext/pnmTextMaker.h +++ b/panda/src/pnmtext/pnmTextMaker.h @@ -64,6 +64,9 @@ PUBLISHED: INLINE void set_interior(const LColor &interior); INLINE const LColor &get_interior() const; + INLINE void set_distance_field_radius(int radius); + INLINE int get_distance_field_radius() const; + INLINE int generate_into(const string &text, PNMImage &dest_image, int x, int y); int generate_into(const wstring &text, @@ -87,6 +90,7 @@ private: bool _interior_flag; LColor _fg; LColor _interior; + int _distance_field_radius; }; #include "pnmTextMaker.I" diff --git a/panda/src/putil/bam.h b/panda/src/putil/bam.h index 1929dcab3b..ad3bd8ee3f 100644 --- a/panda/src/putil/bam.h +++ b/panda/src/putil/bam.h @@ -33,7 +33,7 @@ static const unsigned short _bam_major_ver = 6; // Bumped to major version 6 on 2/11/06 to factor out PandaNode::CData. static const unsigned short _bam_first_minor_ver = 14; -static const unsigned short _bam_minor_ver = 38; +static const unsigned short _bam_minor_ver = 40; // Bumped to minor version 14 on 12/19/07 to change default ColorAttrib. // Bumped to minor version 15 on 4/9/08 to add TextureAttrib::_implicit_sort. // Bumped to minor version 16 on 5/13/08 to add Texture::_quality_level. @@ -59,5 +59,7 @@ static const unsigned short _bam_minor_ver = 38; // Bumped to minor version 36 on 12/9/14 to add samplers and lod settings. // Bumped to minor version 37 on 1/22/15 to add GeomVertexArrayFormat::_divisor. // Bumped to minor version 38 on 4/15/15 to add various Bullet classes. +// Bumped to minor version 39 on 1/9/16 to change lights and materials. +// Bumped to minor version 40 on 1/11/16 to make NodePaths writable. #endif diff --git a/panda/src/putil/bamCache.cxx b/panda/src/putil/bamCache.cxx index 7616350e07..23e8dece01 100644 --- a/panda/src/putil/bamCache.cxx +++ b/panda/src/putil/bamCache.cxx @@ -258,6 +258,12 @@ store(BamCacheRecord *record) { writer.set_file_texture_mode(BamWriter::BTM_fullpath); } + // This is necessary for relative NodePaths to work. + TypeHandle node_type = type_registry->find_type("PandaNode"); + if (record->get_data()->is_of_type(node_type)) { + writer.set_root_node(record->get_data()); + } + if (!writer.write_object(record)) { util_cat.error() << "Unable to write object to " << temp_pathname << "\n"; diff --git a/panda/src/putil/bamCacheRecord.I b/panda/src/putil/bamCacheRecord.I index 9679a70a45..53d3d91cf8 100644 --- a/panda/src/putil/bamCacheRecord.I +++ b/panda/src/putil/bamCacheRecord.I @@ -206,6 +206,28 @@ set_data(TypedWritable *ptr, ReferenceCount *ref_ptr) { } } +//////////////////////////////////////////////////////////////////// +// Function: BamCacheRecord::set_data +// Access: Published +// Description: This variant on set_data() is provided to easily +// pass objects deriving from TypedWritable. +//////////////////////////////////////////////////////////////////// +INLINE void BamCacheRecord:: +set_data(TypedWritable *ptr) { + set_data(ptr, ptr->as_reference_count()); +} + +//////////////////////////////////////////////////////////////////// +// Function: BamCacheRecord::set_data +// Access: Published +// Description: This variant on set_data() is provided to easily +// pass objects deriving from TypedWritableReferenceCount. +//////////////////////////////////////////////////////////////////// +INLINE void BamCacheRecord:: +set_data(TypedWritableReferenceCount *ptr) { + set_data((TypedWritable *)ptr, (ReferenceCount *)ptr); +} + //////////////////////////////////////////////////////////////////// // Function: BamCacheRecord::set_data // Access: Published diff --git a/panda/src/putil/bamCacheRecord.h b/panda/src/putil/bamCacheRecord.h index c6260141ac..523fadc78a 100644 --- a/panda/src/putil/bamCacheRecord.h +++ b/panda/src/putil/bamCacheRecord.h @@ -72,8 +72,12 @@ PUBLISHED: INLINE TypedWritable *get_data() const; INLINE bool extract_data(TypedWritable *&ptr, ReferenceCount *&ref_ptr); INLINE void set_data(TypedWritable *ptr, ReferenceCount *ref_ptr); + INLINE void set_data(TypedWritable *ptr); + INLINE void set_data(TypedWritableReferenceCount *ptr); INLINE void set_data(TypedWritable *ptr, int dummy); + MAKE_PROPERTY2(data, has_data, get_data, set_data, clear_data); + void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/putil/bamWriter.I b/panda/src/putil/bamWriter.I index 06e235825a..555eb9abb1 100644 --- a/panda/src/putil/bamWriter.I +++ b/panda/src/putil/bamWriter.I @@ -94,3 +94,27 @@ INLINE void BamWriter:: set_file_texture_mode(BamTextureMode file_texture_mode) { _file_texture_mode = file_texture_mode; } + +//////////////////////////////////////////////////////////////////// +// Function: BamWriter::get_root_node +// Access: Published +// Description: Returns the root node of the part of the scene +// graph we are currently writing out. This is used +// for determining what to make NodePaths relative to. +//////////////////////////////////////////////////////////////////// +INLINE TypedWritable *BamWriter:: +get_root_node() const { + return _root_node; +} + +//////////////////////////////////////////////////////////////////// +// Function: BamWriter::set_root_node +// Access: Published +// Description: Sets the root node of the part of the scene graph +// we are currently writing out. NodePaths written +// to this bam file will be relative to this node. +//////////////////////////////////////////////////////////////////// +INLINE void BamWriter:: +set_root_node(TypedWritable *root_node) { + _root_node = root_node; +} diff --git a/panda/src/putil/bamWriter.h b/panda/src/putil/bamWriter.h index 4d4529360f..674aa7044a 100644 --- a/panda/src/putil/bamWriter.h +++ b/panda/src/putil/bamWriter.h @@ -90,12 +90,16 @@ PUBLISHED: INLINE BamTextureMode get_file_texture_mode() const; INLINE void set_file_texture_mode(BamTextureMode file_texture_mode); + INLINE TypedWritable *get_root_node() const; + INLINE void set_root_node(TypedWritable *root_node); + PUBLISHED: MAKE_PROPERTY(target, get_target, set_target); MAKE_PROPERTY(filename, get_filename); MAKE_PROPERTY(file_endian, get_file_endian); MAKE_PROPERTY(file_stdfloat_double, get_file_stdfloat_double); MAKE_PROPERTY(file_texture_mode, get_file_texture_mode); + MAKE_PROPERTY(root_node, get_root_node, set_root_node); public: // Functions to support classes that write themselves to the Bam. @@ -125,6 +129,11 @@ private: bool _file_stdfloat_double; BamTextureMode _file_texture_mode; + // Stores the PandaNode representing the root of the node hierarchy + // we are currently writing, if any, for the purpose of writing NodePaths. + // This is a TypedWritable since PandaNode is defined in pgraph. + TypedWritable *_root_node; + // This is the set of all TypeHandles already written. pset _types_written; diff --git a/panda/src/text/dynamicTextFont.I b/panda/src/text/dynamicTextFont.I index eff247e51c..2739a40e26 100644 --- a/panda/src/text/dynamicTextFont.I +++ b/panda/src/text/dynamicTextFont.I @@ -402,30 +402,6 @@ get_render_mode() const { return _render_mode; } -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::set_winding_order -// Access: Published -// Description: Specifies an explicitly winding order on this -// particular font. This is only necessary if the -// render_mode is RM_polygon or RM_solid, and only if -// FreeType appears to guess wrong on this font. -// Normally, you should leave this at WO_default. -//////////////////////////////////////////////////////////////////// -INLINE void DynamicTextFont:: -set_winding_order(DynamicTextFont::WindingOrder winding_order) { - _winding_order = winding_order; -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::get_winding_order -// Access: Published -// Description: Returns the winding order set via set_winding_order(). -//////////////////////////////////////////////////////////////////// -INLINE DynamicTextFont::WindingOrder DynamicTextFont:: -get_winding_order() const { - return _winding_order; -} - //////////////////////////////////////////////////////////////////// // Function: DynamicTextFont::set_fg // Access: Published @@ -585,49 +561,6 @@ get_tex_format() const { return _tex_format; } -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::ContourPoint::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE DynamicTextFont::ContourPoint:: -ContourPoint(const LPoint2 &p, const LVector2 &in, const LVector2 &out) : - _p(p), _in(in), _out(out) -{ -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::ContourPoint::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE DynamicTextFont::ContourPoint:: -ContourPoint(PN_stdfloat px, PN_stdfloat py, PN_stdfloat tx, PN_stdfloat ty) : - _p(px, py), _in(tx, ty), _out(tx, ty) -{ -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::connect_to -// Access: Public -// Description: Connects the indicated point to the next point, whose -// tangent is given. The given tangent becomes the out -// tangent at this point. If the in tangent and out -// tangent are sufficiently close, they will be smoothed -// together. -//////////////////////////////////////////////////////////////////// -INLINE void DynamicTextFont::ContourPoint:: -connect_to(const LVector2 &out) { - _out = out; - if (_in.dot(_out) > 0.7071) { - // Less than 45 degrees of difference: smooth them. - LVector2 av = (_in + _out) * 0.5f; - av.normalize(); - _in = av; - _out = av; - } -} - INLINE ostream & operator << (ostream &out, const DynamicTextFont &dtf) { diff --git a/panda/src/text/dynamicTextFont.cxx b/panda/src/text/dynamicTextFont.cxx index 533f548ec4..9824de0f41 100644 --- a/panda/src/text/dynamicTextFont.cxx +++ b/panda/src/text/dynamicTextFont.cxx @@ -40,8 +40,6 @@ #include "renderState.h" #include "string_utils.h" #include "triangulator.h" -#include "nurbsCurveEvaluator.h" -#include "nurbsCurveResult.h" //#include "renderModeAttrib.h" //#include "antialiasAttrib.h" #include "colorAttrib.h" @@ -117,7 +115,6 @@ DynamicTextFont(const DynamicTextFont ©) : _magfilter(copy._magfilter), _anisotropic_degree(copy._anisotropic_degree), _render_mode(copy._render_mode), - _winding_order(copy._winding_order), _fg(copy._fg), _bg(copy._bg), _outline_color(copy._outline_color), @@ -195,7 +192,7 @@ garbage_collect() { Cache new_cache; Cache::iterator ci; for (ci = _cache.begin(); ci != _cache.end(); ++ci) { - TextGlyph *glyph = (*ci).second; + const TextGlyph *glyph = (*ci).second; if (glyph == (TextGlyph *)NULL || glyph->get_ref_count() > 1) { // Keep this one. new_cache.insert(new_cache.end(), (*ci)); @@ -253,7 +250,7 @@ write(ostream &out, int indent_level) const { Cache::const_iterator ci; for (ci = _cache.begin(); ci != _cache.end(); ++ci) { int glyph_index = (*ci).first; - TextGlyph *glyph = (*ci).second; + const TextGlyph *glyph = (*ci).second; indent(out, indent_level + 2) << glyph_index; @@ -303,16 +300,15 @@ get_glyph(int character, CPT(TextGlyph) &glyph) { if (ci != _cache.end()) { glyph = (*ci).second; } else { - TextGlyph *dynamic_glyph = make_glyph(character, face, glyph_index); - _cache.insert(Cache::value_type(glyph_index, dynamic_glyph)); - glyph = dynamic_glyph; + glyph = make_glyph(character, face, glyph_index); + _cache.insert(Cache::value_type(glyph_index, glyph.p())); } - if (glyph == (TextGlyph *)NULL) { + if (glyph.is_null()) { glyph = get_invalid_glyph(); glyph_index = 0; } - + release_face(face); return (glyph_index != 0); } @@ -442,7 +438,7 @@ determine_tex_format() { // newly-created TextGlyph object, or NULL if the // glyph cannot be created for some reason. //////////////////////////////////////////////////////////////////// -TextGlyph *DynamicTextFont:: +CPT(TextGlyph) DynamicTextFont:: make_glyph(int character, FT_Face face, int glyph_index) { if (!load_glyph(face, glyph_index, false)) { return (TextGlyph *)NULL; @@ -490,36 +486,7 @@ make_glyph(int character, FT_Face face, int glyph_index) { // Ask FreeType to extract the contours out of the outline // description. - FT_Outline_Funcs funcs; - memset(&funcs, 0, sizeof(funcs)); - funcs.move_to = (FT_Outline_MoveTo_Func)outline_move_to; - funcs.line_to = (FT_Outline_LineTo_Func)outline_line_to; - funcs.conic_to = (FT_Outline_ConicTo_Func)outline_conic_to; - funcs.cubic_to = (FT_Outline_CubicTo_Func)outline_cubic_to; - - WindingOrder wo = _winding_order; - if (wo == WO_default) { - // If we weren't told an explicit winding order, ask FreeType to - // figure it out. Sometimes it appears to guess wrong. -#ifdef FT_ORIENTATION_FILL_RIGHT - if (FT_Outline_Get_Orientation(&slot->outline) == FT_ORIENTATION_FILL_RIGHT) { - wo = WO_right; - } else { - wo = WO_left; - } -#else - // Hmm. Assign a right-winding (TTF) orientation if FreeType - // can't tell us. - wo = WO_right; -#endif // FT_ORIENTATION_FILL_RIGHT - } - - if (wo != WO_left) { - FT_Outline_Reverse(&slot->outline); - } - - _contours.clear(); - FT_Outline_Decompose(&slot->outline, &funcs, (void *)this); + decompose_outline(slot->outline); PT(TextGlyph) glyph = new TextGlyph(character, advance); @@ -541,17 +508,46 @@ make_glyph(int character, FT_Face face, int glyph_index) { return glyph; case RM_texture: + case RM_distance_field: default: break; } } - // Render the glyph if necessary. - if (slot->format != ft_glyph_format_bitmap) { - FT_Render_Glyph(slot, ft_render_mode_normal); + PN_stdfloat tex_x_size, tex_y_size, tex_x_orig, tex_y_orig; + FT_BBox bounds; + TransparencyAttrib::Mode alpha_mode; + + if (_render_mode == RM_texture) { + // Render the glyph if necessary. + if (slot->format != ft_glyph_format_bitmap) { + FT_Render_Glyph(slot, ft_render_mode_normal); + } + + tex_x_size = bitmap.width; + tex_y_size = bitmap.rows; + tex_x_orig = slot->bitmap_left; + tex_y_orig = slot->bitmap_top; + alpha_mode = TransparencyAttrib::M_alpha; + + } else { + // Calculate suitable texture dimensions for the signed distance field. + // This is the same calculation that Freetype uses in its bitmap renderer. + FT_Outline_Get_CBox(&slot->outline, &bounds); + + bounds.xMin = bounds.xMin & ~63; + bounds.yMin = bounds.yMin & ~63; + bounds.xMax = (bounds.xMax + 63) & ~63; + bounds.yMax = (bounds.yMax + 63) & ~63; + + tex_x_size = (bounds.xMax - bounds.xMin) >> 6; + tex_y_size = (bounds.yMax - bounds.yMin) >> 6; + tex_x_orig = (bounds.xMin >> 6); + tex_y_orig = (bounds.yMax >> 6); + alpha_mode = TransparencyAttrib::M_binary; } - if (bitmap.width == 0 || bitmap.rows == 0) { + if (tex_x_size == 0 || tex_y_size == 0) { // If we got an empty bitmap, it's a special case. PT(TextGlyph) glyph = @@ -562,13 +558,32 @@ make_glyph(int character, FT_Face face, int glyph_index) { } else { DynamicTextGlyph *glyph; - PN_stdfloat tex_x_size = bitmap.width; - PN_stdfloat tex_y_size = bitmap.rows; - int outline = 0; - if (_tex_pixels_per_unit == _font_pixels_per_unit && - !_needs_image_processing) { + if (_render_mode == RM_distance_field) { + tex_x_size /= _scale_factor; + tex_y_size /= _scale_factor; + int int_x_size = (int)ceil(tex_x_size); + int int_y_size = (int)ceil(tex_y_size); + + outline = 4; + int_x_size += outline * 2; + int_y_size += outline * 2; + tex_x_size += outline * 2; + tex_y_size += outline * 2; + + PNMImage image(int_x_size, int_y_size, PNMImage::CT_grayscale); + render_distance_field(image, outline, bounds.xMin, bounds.yMin); + + glyph = slot_glyph(character, int_x_size, int_y_size, advance); + if (!_needs_image_processing) { + copy_pnmimage_to_texture(image, glyph); + } else { + blend_pnmimage_to_texture(image, glyph, _fg); + } + + } else if (_tex_pixels_per_unit == _font_pixels_per_unit && + !_needs_image_processing) { // If the bitmap produced from the font doesn't require scaling // or any other processing before it goes to the texture, we can // just copy it directly into the texture. @@ -615,8 +630,8 @@ make_glyph(int character, FT_Face face, int glyph_index) { DynamicTextPage *page = glyph->get_page(); if (page != NULL) { - int bitmap_top = (int)floor(slot->bitmap_top + outline * _scale_factor + 0.5f); - int bitmap_left = (int)floor(slot->bitmap_left - outline * _scale_factor + 0.5f); + int bitmap_top = (int)floor(tex_y_orig + outline * _scale_factor + 0.5f); + int bitmap_left = (int)floor(tex_x_orig - outline * _scale_factor + 0.5f); tex_x_size += glyph->_margin * 2; tex_y_size += glyph->_margin * 2; @@ -644,7 +659,7 @@ make_glyph(int character, FT_Face face, int glyph_index) { CPT(RenderState) state; state = RenderState::make(TextureAttrib::make(page), - TransparencyAttrib::make(TransparencyAttrib::M_alpha)); + TransparencyAttrib::make(alpha_mode)); state = state->add_attrib(ColorAttrib::make_flat(LColor(1.0f, 1.0f, 1.0f, 1.0f)), -1); glyph->set_quad(dimensions, texcoords, state); @@ -1123,179 +1138,4 @@ render_polygon_contours(TextGlyph *glyph, bool face, bool extrude) { _contours.clear(); } -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::outline_move_to -// Access: Private, Static -// Description: A callback from FT_Outline_Decompose(). It marks the -// beginning of a new contour. -//////////////////////////////////////////////////////////////////// -int DynamicTextFont:: -outline_move_to(const FT_Vector *to, void *user) { - DynamicTextFont *self = (DynamicTextFont *)user; - - // Convert from 26.6 pixel units to Panda units. - PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); - LPoint2 p = LPoint2(to->x, to->y) * scale; - - if (self->_contours.empty() || - !self->_contours.back()._points.empty()) { - self->_contours.push_back(Contour()); - } - self->_q = p; - return 0; -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::outline_line_to -// Access: Private, Static -// Description: A callback from FT_Outline_Decompose(). It marks a -// straight line in the contour. -//////////////////////////////////////////////////////////////////// -int DynamicTextFont:: -outline_line_to(const FT_Vector *to, void *user) { - DynamicTextFont *self = (DynamicTextFont *)user; - nassertr(!self->_contours.empty(), 1); - - // Convert from 26.6 pixel units to Panda units. - PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); - LPoint2 p = LPoint2(to->x, to->y) * scale; - - // Compute the tangent: this is just the vector from the last point. - LVector2 t = (p - self->_q); - t.normalize(); - - if (self->_contours.back()._points.empty()) { - self->_contours.back()._points.push_back(ContourPoint(self->_q, LVector2::zero(), t)); - } else { - self->_contours.back()._points.back().connect_to(t); - } - - self->_contours.back()._points.push_back(ContourPoint(p, t, LVector2::zero())); - self->_q = p; - return 0; -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::outline_conic_to -// Access: Private, Static -// Description: A callback from FT_Outline_Decompose(). It marks a -// parabolic (3rd-order) Bezier curve in the contour. -//////////////////////////////////////////////////////////////////// -int DynamicTextFont:: -outline_conic_to(const FT_Vector *control, - const FT_Vector *to, void *user) { - DynamicTextFont *self = (DynamicTextFont *)user; - nassertr(!self->_contours.empty(), 1); - - // Convert from 26.6 pixel units to Panda units. - PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); - - LPoint2 c = LPoint2(control->x, control->y) * scale; - LPoint2 p = LPoint2(to->x, to->y) * scale; - - // The NurbsCurveEvaluator will evaluate the Bezier segment for us. - NurbsCurveEvaluator nce; - nce.local_object(); - nce.set_order(3); - nce.reset(3); - nce.set_vertex(0, LVecBase3(self->_q[0], self->_q[1], 0.0f)); - nce.set_vertex(1, LVecBase3(c[0], c[1], 0.0f)); - nce.set_vertex(2, LVecBase3(p[0], p[1], 0.0f)); - - self->_q = p; - - PT(NurbsCurveResult) ncr = nce.evaluate(); - return self->outline_nurbs(ncr); -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::outline_cubic_to -// Access: Private, Static -// Description: A callback from FT_Outline_Decompose(). It marks a -// cubic (4th-order) Bezier curve in the contour. -//////////////////////////////////////////////////////////////////// -int DynamicTextFont:: -outline_cubic_to(const FT_Vector *control1, const FT_Vector *control2, - const FT_Vector *to, void *user) { - DynamicTextFont *self = (DynamicTextFont *)user; - nassertr(!self->_contours.empty(), 1); - - // Convert from 26.6 pixel units to Panda units. - PN_stdfloat scale = 1.0f / (64.0f * self->_font_pixels_per_unit); - - LPoint2 c1 = LPoint2(control1->x, control1->y) * scale; - LPoint2 c2 = LPoint2(control2->x, control2->y) * scale; - LPoint2 p = LPoint2(to->x, to->y) * scale; - - // The NurbsCurveEvaluator will evaluate the Bezier segment for us. - NurbsCurveEvaluator nce; - nce.local_object(); - nce.set_order(4); - nce.reset(4); - nce.set_vertex(0, LVecBase3(self->_q[0], self->_q[1], 0.0f)); - nce.set_vertex(1, LVecBase3(c1[0], c1[1], 0.0f)); - nce.set_vertex(2, LVecBase3(c2[0], c2[1], 0.0f)); - nce.set_vertex(3, LVecBase3(p[0], p[1], 0.0f)); - - self->_q = p; - - PT(NurbsCurveResult) ncr = nce.evaluate(); - return self->outline_nurbs(ncr); -} - -//////////////////////////////////////////////////////////////////// -// Function: DynamicTextFont::outline_nurbs -// Access: Private -// Description: Called internally by outline_cubic_to() and -// outline_conic_to(). -//////////////////////////////////////////////////////////////////// -int DynamicTextFont:: -outline_nurbs(NurbsCurveResult *ncr) { - // Sample it down so that the lines approximate the curve to within - // a "pixel." - ncr->adaptive_sample(1.0f / _font_pixels_per_unit); - - int num_samples = ncr->get_num_samples(); - - bool needs_connect = false; - int start = 1; - if (_contours.back()._points.empty()) { - // If we haven't got the first point of this contour yet, we must - // add it now. - start = 0; - } else { - needs_connect = true; - } - - for (int i = start; i < num_samples; ++i) { - PN_stdfloat st = ncr->get_sample_t(i); - const LPoint3 &p = ncr->get_sample_point(i); - - PN_stdfloat st0 = st, st1 = st; - if (i > 0) { - st0 = ncr->get_sample_t(i - 1) * 0.1f + st * 0.9f; - } - if (i < num_samples - 1) { - st1 = ncr->get_sample_t(i + 1) * 0.1f + st * 0.9f; - } - // Compute the tangent by deltaing nearby points. Don't evaluate - // the tangent from the NURBS, since that doesn't appear to be - // reliable. - LPoint3 p0, p1; - ncr->eval_point(st0, p0); - ncr->eval_point(st1, p1); - LVector3 t = p1 - p0; - t.normalize(); - - if (needs_connect) { - _contours.back()._points.back().connect_to(LVector2(t[0], t[1])); - needs_connect = false; - } - - _contours.back()._points.push_back(ContourPoint(p[0], p[1], t[0], t[1])); - } - - return 0; -} - #endif // HAVE_FREETYPE diff --git a/panda/src/text/dynamicTextFont.h b/panda/src/text/dynamicTextFont.h index 8c6f2a71fe..3ce9ee4cc3 100644 --- a/panda/src/text/dynamicTextFont.h +++ b/panda/src/text/dynamicTextFont.h @@ -99,10 +99,7 @@ PUBLISHED: INLINE void set_render_mode(RenderMode render_mode); INLINE RenderMode get_render_mode() const; - INLINE void set_winding_order(WindingOrder winding_order); - INLINE WindingOrder get_winding_order() const; MAKE_PROPERTY(render_mode, get_render_mode, set_render_mode); - MAKE_PROPERTY(winding_order, get_winding_order, set_winding_order); INLINE void set_fg(const LColor &fg); INLINE const LColor &get_fg() const; @@ -134,7 +131,7 @@ private: void initialize(); void update_filters(); void determine_tex_format(); - TextGlyph *make_glyph(int character, FT_Face face, int glyph_index); + CPT(TextGlyph) make_glyph(int character, FT_Face face, int glyph_index); void copy_bitmap_to_texture(const FT_Bitmap &bitmap, DynamicTextGlyph *glyph); void copy_pnmimage_to_texture(const PNMImage &image, DynamicTextGlyph *glyph); void blend_pnmimage_to_texture(const PNMImage &image, DynamicTextGlyph *glyph, @@ -144,15 +141,6 @@ private: void render_wireframe_contours(TextGlyph *glyph); void render_polygon_contours(TextGlyph *glyph, bool face, bool extrude); - static int outline_move_to(const FT_Vector *to, void *user); - static int outline_line_to(const FT_Vector *to, void *user); - static int outline_conic_to(const FT_Vector *control, - const FT_Vector *to, void *user); - static int outline_cubic_to(const FT_Vector *control1, - const FT_Vector *control2, - const FT_Vector *to, void *user); - int outline_nurbs(NurbsCurveResult *ncr); - int _texture_margin; PN_stdfloat _poly_margin; LVecBase2i _page_size; @@ -162,7 +150,6 @@ private: int _anisotropic_degree; RenderMode _render_mode; - WindingOrder _winding_order; LColor _fg, _bg, _outline_color; PN_stdfloat _outline_width; @@ -177,7 +164,7 @@ private: // This doesn't need to be a reference-counting pointer, because the // reference to each glyph is kept by the DynamicTextPage object. - typedef pmap Cache; + typedef pmap Cache; Cache _cache; // This is a list of the glyphs that do not have any printable @@ -187,28 +174,6 @@ private: typedef pvector< PT(TextGlyph) > EmptyGlyphs; EmptyGlyphs _empty_glyphs; - class ContourPoint { - public: - INLINE ContourPoint(const LPoint2 &p, const LVector2 &in, - const LVector2 &out); - INLINE ContourPoint(PN_stdfloat px, PN_stdfloat py, PN_stdfloat tx, PN_stdfloat ty); - INLINE void connect_to(const LVector2 &out); - LPoint2 _p; - LVector2 _in, _out; // tangents into and out of the vertex. - }; - typedef pvector Points; - - class Contour { - public: - Points _points; - bool _is_solid; - int _start_vertex; - }; - - typedef pvector Contours; - Contours _contours; - LPoint2 _q; // The "current point". - public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/text/staticTextFont.cxx b/panda/src/text/staticTextFont.cxx index 28b7e94c61..1ab0db55fd 100644 --- a/panda/src/text/staticTextFont.cxx +++ b/panda/src/text/staticTextFont.cxx @@ -343,7 +343,9 @@ find_characters(PandaNode *root, const RenderState *net_state) { // Get the first vertex from the "dot" geoset. This will be the // design size indicator. GeomVertexReader reader(dot->get_vertex_data(), InternalName::get_vertex()); - _line_height = reader.get_data3()[2]; + LVecBase3 data = reader.get_data3(); + _line_height = data[2]; + _total_poly_margin = data[0]; _space_advance = 0.25f * _line_height; } diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index bb81f91d6d..44ff4bcda2 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -1823,7 +1823,19 @@ get_character_glyphs(int character, const TextProperties *properties, if (!got_glyph && map_entry != NULL && map_entry->_ascii_equiv != 0) { // If we couldn't find the Unicode glyph, try the ASCII // equivalent (without the accent marks). - got_glyph = font->get_glyph(map_entry->_ascii_equiv, glyph); + if (map_entry->_ascii_equiv == 'i') { + // Special case for the i: we want to try the dotless variant first. + got_glyph = font->get_glyph(0x0131, glyph) || + font->get_glyph('i', glyph); + + } else if (map_entry->_ascii_equiv == 'j') { + // And the dotless j as well. + got_glyph = font->get_glyph(0x0237, glyph) || + font->get_glyph('j', glyph); + + } else { + got_glyph = font->get_glyph(map_entry->_ascii_equiv, glyph); + } if (!got_glyph && map_entry->_toupper_character != character) { // If we still couldn't find it, try the uppercase @@ -1845,7 +1857,7 @@ get_character_glyphs(int character, const TextProperties *properties, got_second_glyph = font->get_glyph(map_entry->_ascii_additional, second_glyph); } - + if ((additional_flags & UnicodeLatinMap::AF_ligature) != 0 && got_second_glyph) { // If we have two letters that are supposed to be in a @@ -1875,6 +1887,16 @@ tack_on_accent(UnicodeLatinMap::AccentType accent_type, const LPoint3 ¢roid, const TextProperties *properties, TextAssembler::GlyphPlacement &placement) const { + + // Look for a combining accent mark character. + wchar_t combine_char = UnicodeLatinMap::get_combining_accent(accent_type); + if (combine_char != 0 && + tack_on_accent(combine_char, CP_above, CT_none, min_vert, max_vert, + centroid, properties, placement)) { + return; + } + + switch (accent_type) { case UnicodeLatinMap::AT_grave: // We use the slash as the grave and acute accents. ASCII does @@ -1978,8 +2000,10 @@ tack_on_accent(UnicodeLatinMap::AccentType accent_type, break; case UnicodeLatinMap::AT_cedilla: - tack_on_accent('c', CP_bottom, CT_tiny_mirror_x, min_vert, max_vert, centroid, - properties, placement); + tack_on_accent(0xb8, CP_below, CT_none, min_vert, max_vert, centroid, + properties, placement) || + tack_on_accent('c', CP_bottom, CT_tiny_mirror_x, min_vert, max_vert, centroid, + properties, placement); //tack_on_accent(',', CP_bottom, CT_none, min_vert, max_vert, centroid, // properties, placement); break; @@ -2014,7 +2038,7 @@ tack_on_accent(UnicodeLatinMap::AccentType accent_type, // font. //////////////////////////////////////////////////////////////////// bool TextAssembler:: -tack_on_accent(char accent_mark, TextAssembler::CheesyPosition position, +tack_on_accent(wchar_t accent_mark, TextAssembler::CheesyPosition position, TextAssembler::CheesyTransform transform, const LPoint3 &min_vert, const LPoint3 &max_vert, const LPoint3 ¢roid, @@ -2208,28 +2232,34 @@ tack_on_accent(char accent_mark, TextAssembler::CheesyPosition position, has_mat = false; } + PN_stdfloat total_margin = font->get_total_poly_margin(); + LPoint3 accent_centroid = (min_accent + max_accent) / 2.0f; - PN_stdfloat accent_height = max_accent[2] - min_accent[2]; + PN_stdfloat accent_height = max_accent[2] - min_accent[2] - total_margin * 2; + PN_stdfloat accent_x = centroid[0] - accent_centroid[0]; PN_stdfloat accent_y = 0; + PN_stdfloat min_y = min_vert[2] + total_margin; + PN_stdfloat max_y = max_vert[2] - total_margin; + switch (position) { case CP_above: // A little above the character. - accent_y = max_vert[2] - accent_centroid[2] + accent_height * 0.5f; + accent_y = max_y - accent_centroid[2] + accent_height * 0.75f; break; case CP_below: // A little below the character. - accent_y = min_vert[2] - accent_centroid[2] - accent_height * 0.5f; + accent_y = min_y - accent_centroid[2] - accent_height * 0.75f; break; case CP_top: // Touching the top of the character. - accent_y = max_vert[2] - accent_centroid[2]; + accent_y = max_y - accent_centroid[2]; break; case CP_bottom: // Touching the bottom of the character. - accent_y = min_vert[2] - accent_centroid[2]; + accent_y = min_y - accent_centroid[2]; break; case CP_within: @@ -2238,7 +2268,7 @@ tack_on_accent(char accent_mark, TextAssembler::CheesyPosition position, break; } - placement._xpos += placement._scale * (centroid[0] - accent_centroid[0] + placement._slant * accent_y); + placement._xpos += placement._scale * (accent_x + placement._slant * accent_y); placement._ypos += placement._scale * accent_y; if (has_mat) { diff --git a/panda/src/text/textAssembler.h b/panda/src/text/textAssembler.h index 6c6ec4f92d..d86f7b4d51 100644 --- a/panda/src/text/textAssembler.h +++ b/panda/src/text/textAssembler.h @@ -315,7 +315,7 @@ private: const LPoint3 ¢roid, const TextProperties *properties, GlyphPlacement &placement) const; bool - tack_on_accent(char accent_mark, CheesyPosition position, + tack_on_accent(wchar_t accent_mark, CheesyPosition position, CheesyTransform transform, const LPoint3 &min_vert, const LPoint3 &max_vert, const LPoint3 ¢roid, diff --git a/panda/src/text/textFont.I b/panda/src/text/textFont.I index 278d8ebaf7..c8d1aec4a2 100644 --- a/panda/src/text/textFont.I +++ b/panda/src/text/textFont.I @@ -77,6 +77,18 @@ set_space_advance(PN_stdfloat space_advance) { _space_advance = space_advance; } +//////////////////////////////////////////////////////////////////// +// Function: TextFont::get_total_poly_margin +// Access: Public +// Description: Returns the total margin between the edge of the +// glyph and the edge of the cards. This includes +// _poly_margin and any additional outline. +//////////////////////////////////////////////////////////////////// +INLINE PN_stdfloat TextFont:: +get_total_poly_margin() const { + return _total_poly_margin; +} + //////////////////////////////////////////////////////////////////// // Function: DynamicTextFont::get_glyph // Access: Public, Virtual diff --git a/panda/src/text/textFont.cxx b/panda/src/text/textFont.cxx index 0a6156e075..3516bfb6d5 100644 --- a/panda/src/text/textFont.cxx +++ b/panda/src/text/textFont.cxx @@ -34,6 +34,7 @@ TextFont() { _is_valid = false; _line_height = 1.0f; _space_advance = 0.25f; + _total_poly_margin = 0.0f; } //////////////////////////////////////////////////////////////////// @@ -46,7 +47,8 @@ TextFont(const TextFont ©) : Namable(copy), _is_valid(copy._is_valid), _line_height(copy._line_height), - _space_advance(copy._space_advance) + _space_advance(copy._space_advance), + _total_poly_margin(copy._total_poly_margin) { } @@ -112,31 +114,13 @@ string_render_mode(const string &string) { return RM_extruded; } else if (cmp_nocase_uh(string, "solid") == 0) { return RM_solid; + } else if (cmp_nocase_uh(string, "distance_field") == 0) { + return RM_distance_field; } else { return RM_invalid; } } -//////////////////////////////////////////////////////////////////// -// Function: TextFont::string_winding_order -// Access: Public -// Description: Returns the WindingOrder value associated with the given -// string representation, or WO_invalid if the string -// does not match any known WindingOrder value. -//////////////////////////////////////////////////////////////////// -TextFont::WindingOrder TextFont:: -string_winding_order(const string &string) { - if (cmp_nocase_uh(string, "default") == 0) { - return WO_default; - } else if (cmp_nocase_uh(string, "left") == 0) { - return WO_left; - } else if (cmp_nocase_uh(string, "right") == 0) { - return WO_right; - } else { - return WO_invalid; - } -} - //////////////////////////////////////////////////////////////////// // Function: TextFont::make_invalid_glyph // Access: Private @@ -184,6 +168,8 @@ operator << (ostream &out, TextFont::RenderMode rm) { return out << "extruded"; case TextFont::RM_solid: return out << "solid"; + case TextFont::RM_distance_field: + return out << "distance-field"; case TextFont::RM_invalid: return out << "invalid"; @@ -204,37 +190,3 @@ operator >> (istream &in, TextFont::RenderMode &rm) { rm = TextFont::string_render_mode(word); return in; } - -//////////////////////////////////////////////////////////////////// -// Function: TextFont::WindingOrder output operator -// Description: -//////////////////////////////////////////////////////////////////// -ostream & -operator << (ostream &out, TextFont::WindingOrder wo) { - switch (wo) { - case TextFont::WO_default: - return out << "default"; - case TextFont::WO_left: - return out << "left"; - case TextFont::WO_right: - return out << "right"; - - case TextFont::WO_invalid: - return out << "invalid"; - } - - return out << "(**invalid TextFont::WindingOrder(" << (int)wo << ")**)"; -} - -//////////////////////////////////////////////////////////////////// -// Function: TextFont::WindingOrder input operator -// Description: -//////////////////////////////////////////////////////////////////// -istream & -operator >> (istream &in, TextFont::WindingOrder &wo) { - string word; - in >> word; - - wo = TextFont::string_winding_order(word); - return in; -} diff --git a/panda/src/text/textFont.h b/panda/src/text/textFont.h index 88b9869f44..79453a97f6 100644 --- a/panda/src/text/textFont.h +++ b/panda/src/text/textFont.h @@ -57,18 +57,12 @@ PUBLISHED: // combination of RM_extruded and RM_polygon RM_solid, + RM_distance_field, + // Returned by string_render_mode() for an invalid match. RM_invalid, }; - enum WindingOrder { - WO_default, - WO_left, - WO_right, - - WO_invalid, - }; - virtual PT(TextFont) make_copy() const=0; INLINE bool is_valid() const; @@ -87,11 +81,12 @@ PUBLISHED: virtual void write(ostream &out, int indent_level) const; public: + INLINE PN_stdfloat get_total_poly_margin() const; + virtual bool get_glyph(int character, CPT(TextGlyph) &glyph)=0; TextGlyph *get_invalid_glyph(); static RenderMode string_render_mode(const string &string); - static WindingOrder string_winding_order(const string &string); private: void make_invalid_glyph(); @@ -100,6 +95,7 @@ protected: bool _is_valid; PN_stdfloat _line_height; PN_stdfloat _space_advance; + PN_stdfloat _total_poly_margin; PT(TextGlyph) _invalid_glyph; public: @@ -122,8 +118,6 @@ private: EXPCL_PANDA_TEXT ostream &operator << (ostream &out, TextFont::RenderMode rm); EXPCL_PANDA_TEXT istream &operator >> (istream &in, TextFont::RenderMode &rm); -EXPCL_PANDA_TEXT ostream &operator << (ostream &out, TextFont::WindingOrder wo); -EXPCL_PANDA_TEXT istream &operator >> (istream &in, TextFont::WindingOrder &wo); #include "textFont.I" diff --git a/panda/src/text/textGlyph.cxx b/panda/src/text/textGlyph.cxx index c6689fecbf..2ae14329c8 100644 --- a/panda/src/text/textGlyph.cxx +++ b/panda/src/text/textGlyph.cxx @@ -132,7 +132,7 @@ set_quad(const LVecBase4 &dimensions, const LVecBase4 &texcoords, void TextGlyph:: set_geom(GeomVertexData *vdata, GeomPrimitive *prim, const RenderState *state) { - PT(Geom) geom = new Geom(vdata); + PT(Geom) geom = new GeomTextGlyph(this, vdata); geom->add_primitive(prim); _geom = geom; diff --git a/panda/src/text/textNode.h b/panda/src/text/textNode.h index eef4a7c25e..cb315e6744 100644 --- a/panda/src/text/textNode.h +++ b/panda/src/text/textNode.h @@ -239,6 +239,53 @@ PUBLISHED: PandaNode *get_internal_geom() const; +PUBLISHED: + MAKE_PROPERTY(max_rows, get_max_rows, set_max_rows); + MAKE_PROPERTY(frame_color, get_frame_color, set_frame_color); + MAKE_PROPERTY(card_color, get_card_color, set_card_color); + MAKE_PROPERTY(card_texture, get_card_texture, set_card_texture); + MAKE_PROPERTY(frame_line_width, get_frame_line_width, set_frame_line_width); + MAKE_PROPERTY(frame_corners, get_frame_corners, set_frame_corners); + MAKE_PROPERTY(transform, get_transform, set_transform); + MAKE_PROPERTY(coordinate_system, get_coordinate_system, set_coordinate_system); + MAKE_PROPERTY(usage_hint, get_usage_hint, set_usage_hint); + MAKE_PROPERTY(flatten_flags, get_flatten_flags, set_flatten_flags); + + MAKE_PROPERTY(text, get_text, set_text); + + MAKE_PROPERTY2(font, has_font, get_font, set_font, clear_font); + MAKE_PROPERTY2(small_caps, has_small_caps, get_small_caps, + set_small_caps, clear_small_caps); + MAKE_PROPERTY2(small_caps_scale, has_small_caps_scale, get_small_caps_scale, + set_small_caps_scale, clear_small_caps_scale); + MAKE_PROPERTY2(slant, has_slant, get_slant, set_slant, clear_slant); + MAKE_PROPERTY2(underscore, has_underscore, get_underscore, + set_underscore, clear_underscore); + MAKE_PROPERTY2(underscore_height, has_underscore_height, get_underscore_height, + set_underscore_height, clear_underscore_height); + MAKE_PROPERTY2(align, has_align, get_align, set_align, clear_align); + MAKE_PROPERTY2(indent, has_indent, get_indent, set_indent, clear_indent); + MAKE_PROPERTY2(wordwrap, has_wordwrap, get_wordwrap, set_wordwrap, clear_wordwrap); + MAKE_PROPERTY2(preserve_trailing_whitespace, + has_preserve_trailing_whitespace, get_preserve_trailing_whitespace, + set_preserve_trailing_whitespace, clear_preserve_trailing_whitespace); + MAKE_PROPERTY2(text_color, has_text_color, get_text_color, + set_text_color, clear_text_color); + MAKE_PROPERTY2(shadow_color, has_shadow_color, get_shadow_color, + set_shadow_color, clear_shadow_color); + MAKE_PROPERTY2(shadow, has_shadow, get_shadow, set_shadow, clear_shadow); + MAKE_PROPERTY2(bin, has_bin, get_bin, set_bin, clear_bin); + MAKE_PROPERTY2(draw_order, has_draw_order, get_draw_order, + set_draw_order, clear_draw_order); + MAKE_PROPERTY2(tab_width, has_tab_width, get_tab_width, + set_tab_width, clear_tab_width); + MAKE_PROPERTY2(glyph_scale, has_glyph_scale, get_glyph_scale, + set_glyph_scale, clear_glyph_scale); + MAKE_PROPERTY2(glyph_shift, has_glyph_shift, get_glyph_shift, + set_glyph_shift, clear_glyph_shift); + MAKE_PROPERTY2(text_scale, has_text_scale, get_text_scale, + set_text_scale, clear_text_scale); + public: // From parent class PandaNode virtual int get_unsafe_to_apply_attribs() const; diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index f0322dc506..30f5e2e6f8 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -32,6 +32,9 @@ #include "look_at.h" #include "texturePool.h" #include "character.h" +#include "animBundle.h" +#include "animBundleNode.h" +#include "animChannelMatrixXfmTable.h" #include "pvector.h" #include "pandaIOSystem.h" @@ -169,7 +172,7 @@ build_graph() { } //////////////////////////////////////////////////////////////////// -// Function: AssimpLoader::find_ndoe +// Function: AssimpLoader::find_node // Access: Private // Description: Finds a node by name. //////////////////////////////////////////////////////////////////// @@ -418,8 +421,7 @@ load_material(size_t index) { // Description: Creates a CharacterJoint from an aiNode //////////////////////////////////////////////////////////////////// void AssimpLoader:: -create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *parent, const aiNode &node) -{ +create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *parent, const aiNode &node) { const aiMatrix4x4 &t = node.mTransformation; LMatrix4 mat(t.a1, t.b1, t.c1, t.d1, t.a2, t.b2, t.c2, t.d2, @@ -427,6 +429,9 @@ create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *pare t.a4, t.b4, t.c4, t.d4); PT(CharacterJoint) joint = new CharacterJoint(character, bundle, parent, node.mName.C_Str(), mat); + assimp_cat.debug() + << "Creating joint for: " << node.mName.C_Str() << "\n"; + for (size_t i = 0; i < node.mNumChildren; ++i) { if (_bonemap.find(node.mChildren[i]->mName.C_Str()) != _bonemap.end()) { create_joint(character, bundle, joint, *node.mChildren[i]); @@ -434,6 +439,87 @@ create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *pare } } +//////////////////////////////////////////////////////////////////// +// Function: AssimpLoader::create_anim_channel +// Access: Private +// Description: Creates a AnimChannelMatrixXfmTable from an aiNodeAnim +//////////////////////////////////////////////////////////////////// +void AssimpLoader:: +create_anim_channel(const aiAnimation &anim, AnimBundle *bundle, AnimGroup *parent, const aiNode &node) { + PT(AnimChannelMatrixXfmTable) group = new AnimChannelMatrixXfmTable(parent, node.mName.C_Str()); + + // See if there is a channel for this node + aiNodeAnim *node_anim = NULL; + for (size_t i = 0; i < anim.mNumChannels; ++i) { + if (anim.mChannels[i]->mNodeName == node.mName) { + node_anim = anim.mChannels[i]; + } + } + + if (node_anim) { + assimp_cat.debug() + << "Found channel for node: " << node.mName.C_Str() << "\n"; + //assimp_cat.debug() + // << "Num Position Keys " << node_anim->mNumPositionKeys << "\n"; + //assimp_cat.debug() + // << "Num Rotation Keys " << node_anim->mNumRotationKeys << "\n"; + //assimp_cat.debug() + // << "Num Scaling Keys " << node_anim->mNumScalingKeys << "\n"; + + // Convert positions + PTA_stdfloat tablex = PTA_stdfloat::empty_array(node_anim->mNumPositionKeys); + PTA_stdfloat tabley = PTA_stdfloat::empty_array(node_anim->mNumPositionKeys); + PTA_stdfloat tablez = PTA_stdfloat::empty_array(node_anim->mNumPositionKeys); + for (size_t i = 0; i < node_anim->mNumPositionKeys; ++i) { + tablex[i] = node_anim->mPositionKeys[i].mValue.x; + tabley[i] = node_anim->mPositionKeys[i].mValue.y; + tablez[i] = node_anim->mPositionKeys[i].mValue.z; + } + group->set_table('x', tablex); + group->set_table('y', tabley); + group->set_table('z', tablez); + + // Convert rotations + PTA_stdfloat tableh = PTA_stdfloat::empty_array(node_anim->mNumRotationKeys); + PTA_stdfloat tablep = PTA_stdfloat::empty_array(node_anim->mNumRotationKeys); + PTA_stdfloat tabler = PTA_stdfloat::empty_array(node_anim->mNumRotationKeys); + for (size_t i = 0; i < node_anim->mNumRotationKeys; ++i) { + aiQuaternion ai_quat = node_anim->mRotationKeys[i].mValue; + LVecBase3 hpr = LQuaternion(ai_quat.w, ai_quat.x, ai_quat.y, ai_quat.z).get_hpr(); + tableh[i] = hpr.get_x(); + tablep[i] = hpr.get_y(); + tabler[i] = hpr.get_z(); + } + group->set_table('h', tableh); + group->set_table('p', tablep); + group->set_table('r', tabler); + + // Convert scales + PTA_stdfloat tablei = PTA_stdfloat::empty_array(node_anim->mNumScalingKeys); + PTA_stdfloat tablej = PTA_stdfloat::empty_array(node_anim->mNumScalingKeys); + PTA_stdfloat tablek = PTA_stdfloat::empty_array(node_anim->mNumScalingKeys); + for (size_t i = 0; i < node_anim->mNumScalingKeys; ++i) { + tablei[i] = node_anim->mScalingKeys[i].mValue.x; + tablej[i] = node_anim->mScalingKeys[i].mValue.y; + tablek[i] = node_anim->mScalingKeys[i].mValue.z; + } + group->set_table('i', tablei); + group->set_table('j', tablej); + group->set_table('k', tablek); + } + else { + assimp_cat.debug() + << "No channel found for node: " << node.mName.C_Str() << "\n"; + } + + + for (size_t i = 0; i < node.mNumChildren; ++i) { + if (_bonemap.find(node.mChildren[i]->mName.C_Str()) != _bonemap.end()) { + create_anim_channel(anim, bundle, group, *node.mChildren[i]); + } + } +} + //////////////////////////////////////////////////////////////////// // Function: AssimpLoader::load_mesh // Access: Private @@ -456,17 +542,27 @@ load_mesh(size_t index) { _bonemap[bone.mName.C_Str()] = node; } - // Find the root bone node - const aiNode *root = _bonemap[mesh.mBones[0]->mName.C_Str()]; - while (root->mParent && _bonemap.find(root->mParent->mName.C_Str()) != _bonemap.end()) { - root = root->mParent; - } - // Now create a character from the bones character = new Character(mesh.mName.C_Str()); PT(CharacterJointBundle) bundle = character->get_bundle(0); PT(PartGroup) skeleton = new PartGroup(bundle, ""); - create_joint(character, bundle, skeleton, *root); + + for (size_t i = 0; i < mesh.mNumBones; ++i) { + const aiBone &bone = *mesh.mBones[i]; + + // Find the root bone node + const aiNode *root = _bonemap[bone.mName.C_Str()]; + while (root->mParent && _bonemap.find(root->mParent->mName.C_Str()) != _bonemap.end()) { + root = root->mParent; + } + + // Don't process this root if we already have a joint for it + if (character->find_joint(root->mName.C_Str())) { + continue; + } + + create_joint(character, bundle, skeleton, *root); + } } // Create transform blend table @@ -475,7 +571,14 @@ load_mesh(size_t index) { if (character) { for (size_t i = 0; i < mesh.mNumBones; ++i) { const aiBone &bone = *mesh.mBones[i]; - CPT(JointVertexTransform) jvt = new JointVertexTransform(character->find_joint(bone.mName.C_Str())); + CharacterJoint *joint = character->find_joint(bone.mName.C_Str()); + if (joint == NULL) { + assimp_cat.debug() + << "Could not find joint for bone: " << bone.mName.C_Str() << "\n"; + continue; + } + + CPT(JointVertexTransform) jvt = new JointVertexTransform(joint); for (size_t j = 0; j < bone.mNumWeights; ++j) { const aiVertexWeight &weight = bone.mWeights[j]; @@ -508,6 +611,69 @@ load_mesh(size_t index) { PT(GeomVertexArrayFormat) tb_aformat = new GeomVertexArrayFormat; tb_aformat->add_column(InternalName::make("transform_blend"), 1, Geom::NT_uint16, Geom::C_index); + // Check to see if we need to convert any animations + for (size_t i = 0; i < _scene->mNumAnimations; ++i) { + aiAnimation &ai_anim = *_scene->mAnimations[i]; + bool convert_anim = false; + + assimp_cat.debug() + << "Checking to see if anim (" << ai_anim.mName.C_Str() << ") matches character (" << mesh.mName.C_Str() << ")\n"; + for (size_t j = 0; j < ai_anim.mNumChannels; ++j) { + assimp_cat.debug() + << "Searching for " << ai_anim.mChannels[j]->mNodeName.C_Str() << " in bone map" << "\n"; + if (_bonemap.find(ai_anim.mChannels[j]->mNodeName.C_Str()) != _bonemap.end()) { + convert_anim = true; + break; + } + } + + if (convert_anim) { + assimp_cat.debug() + << "Found animation (" << ai_anim.mName.C_Str() << ") for character (" << mesh.mName.C_Str() << ")\n"; + + // Now create the animation + unsigned int frames = 0; + for (size_t j = 0; j < ai_anim.mNumChannels; ++j) { + if (ai_anim.mChannels[j]->mNumPositionKeys > frames) { + frames = ai_anim.mChannels[j]->mNumPositionKeys; + } + if (ai_anim.mChannels[j]->mNumRotationKeys > frames) { + frames = ai_anim.mChannels[j]->mNumRotationKeys; + } + if (ai_anim.mChannels[j]->mNumScalingKeys > frames) { + frames = ai_anim.mChannels[j]->mNumScalingKeys; + } + } + PN_stdfloat fps = frames / (ai_anim.mTicksPerSecond * ai_anim.mDuration); + assimp_cat.debug() + << "FPS " << fps << "\n"; + assimp_cat.debug() + << "Frames " << frames << "\n"; + + PT(AnimBundle) bundle = new AnimBundle(mesh.mName.C_Str(), fps, frames); + PT(AnimGroup) skeleton = new AnimGroup(bundle, ""); + + for (size_t i = 0; i < mesh.mNumBones; ++i) { + const aiBone &bone = *mesh.mBones[i]; + + // Find the root bone node + const aiNode *root = _bonemap[bone.mName.C_Str()]; + while (root->mParent && _bonemap.find(root->mParent->mName.C_Str()) != _bonemap.end()) { + root = root->mParent; + } + + // Only convert root nodes + if (root->mName == bone.mName) { + create_anim_channel(ai_anim, bundle, skeleton, *root); + + // Attach the animation to the character node + PT(AnimBundleNode) bundle_node = new AnimBundleNode(bone.mName.C_Str(), bundle); + character->add_child(bundle_node); + } + } + } + } + //TODO: if there is only one UV set, hackily iterate over the texture stages and clear the texcoord name things PT(GeomVertexFormat) format = new GeomVertexFormat; diff --git a/pandatool/src/assimp/assimpLoader.h b/pandatool/src/assimp/assimpLoader.h index f9544d2ed5..ed390791db 100644 --- a/pandatool/src/assimp/assimpLoader.h +++ b/pandatool/src/assimp/assimpLoader.h @@ -27,6 +27,8 @@ class Character; class CharacterJointBundle; class PartGroup; +class AnimBundle; +class AnimGroup; struct char_cmp { bool operator () (const char *a, const char *b) const { @@ -76,6 +78,7 @@ private: void load_texture_stage(const aiMaterial &mat, const aiTextureType &ttype, CPT(TextureAttrib) &tattr); void load_material(size_t index); void create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *parent, const aiNode &node); + void create_anim_channel(const aiAnimation &anim, AnimBundle *bundle, AnimGroup *parent, const aiNode &node); void load_mesh(size_t index); void load_node(const aiNode &node, PandaNode *parent); void load_light(const aiLight &light); diff --git a/pandatool/src/egg-mkfont/eggMakeFont.cxx b/pandatool/src/egg-mkfont/eggMakeFont.cxx index 68403c5e62..981d932b79 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.cxx +++ b/pandatool/src/egg-mkfont/eggMakeFont.cxx @@ -95,7 +95,8 @@ EggMakeFont() : EggWriter(true, false) { "by commas and hyphens to indicate ranges, e.g. '32-126,0xfa0-0xfff'. " "It also may specify ranges of ASCII characters by enclosing them " "within square brackets, e.g. '[A-Za-z0-9]'. If this is not specified, " - "the default is the set of ASCII characters.", + "the default set has all ASCII characters and an assorted set of " + "latin-1 characters, diacritics and punctuation marks.", &EggMakeFont::dispatch_range, NULL, &_range); add_option @@ -114,7 +115,7 @@ EggMakeFont() : EggWriter(true, false) { "generated texture map that are used for each onscreen unit (or each " "10 points of font; see -ps). Setting this number larger results in " "an easier-to-read font, but at the cost of more texture memory. " - "The default is 30.", + "The default is 40.", &EggMakeFont::dispatch_double, NULL, &_pixels_per_unit); add_option @@ -124,6 +125,12 @@ EggMakeFont() : EggWriter(true, false) { "a 10 point font is 1 screen unit high, so the default is 10.", &EggMakeFont::dispatch_double, NULL, &_point_size); + add_option + ("sdf", "", 0, + "If this is set, a signed distance field will be generated, which " + "results in crisp text even when the text is enlarged or zoomed in.", + &EggMakeFont::dispatch_true, NULL, &_generate_distance_field); + add_option ("pm", "n", 0, "The number of extra pixels around a single character in the " @@ -215,13 +222,14 @@ EggMakeFont() : EggWriter(true, false) { _fg.set(1.0, 1.0, 1.0, 1.0); _bg.set(1.0, 1.0, 1.0, 0.0); _interior.set(1.0, 1.0, 1.0, 1.0); - _pixels_per_unit = 30.0; + _pixels_per_unit = 40.0; _point_size = 10.0; _poly_margin = 1.0; _tex_margin = 2; _render_margin = 0.0; - _palette_size[0] = _palette_size[1] = 256; + _palette_size[0] = _palette_size[1] = 512; _face_index = 0; + _generate_distance_field = false; _text_maker = NULL; _vpool = NULL; @@ -274,7 +282,9 @@ run() { if (!_got_scale_factor) { // The default scale factor is 4 if we are not using FreeType's // antialias, or 2 if we are. - if (_no_native_aa) { + if (_generate_distance_field) { + _scale_factor = 1.0; + } else if (_no_native_aa) { _scale_factor = 4.0; } else { _scale_factor = 2.0; @@ -327,9 +337,44 @@ run() { } if (_range.is_empty()) { - // If there's no specified range, the default is the entire ASCII - // set. + // If there's no specified range, the default is the entire ASCII set. _range.add_range(0x20, 0x7e); + + _range.add_singleton(0xa1); // Upside down exclamation mark + _range.add_singleton(0xa9); // Copyright sign + _range.add_singleton(0xab); // Left double angle quote + //_range.add_singleton(0xae); // Registered sign + _range.add_singleton(0xb0); // Degree symbol + _range.add_singleton(0xb5); // Mu/micro + _range.add_singleton(0xb8); // Cedilla + _range.add_singleton(0xbb); // Right double angle quote + _range.add_singleton(0xbf); // Upside down question mark + + _range.add_singleton(0xc6); // AE ligature + _range.add_singleton(0xc7); // C cedilla + //_range.add_singleton(0xd0); // Upper-case Eth + //_range.add_singleton(0xd8); // Upper-case O with line + //_range.add_singleton(0xde); // Upper-case Thorn + _range.add_singleton(0xdf); // German Eszet + _range.add_singleton(0xe6); // ae ligature + _range.add_singleton(0xe7); // c cedilla + _range.add_singleton(0xf0); // Lower-case Eth + _range.add_singleton(0xf8); // Lower-case O with line + _range.add_singleton(0xfe); // Lower-case Thorn + + //_range.add_singleton(0x03c0); // pi + + // Dotless i and j, for combining purposes. + _range.add_singleton(0x0131); + _range.add_singleton(0x0237); + + // And general punctuation. These don't take up much space anyway. + _range.add_range(0x2018, 0x201f); + + _range.add_singleton(0x2026); // Ellipses + + // Also add all the combining diacritic marks. + _range.add_range(0x0300, 0x030f); } if (_output_glyph_pattern.empty()) { // Create a default texture filename pattern. @@ -374,7 +419,7 @@ run() { _num_channels = 1; _format = EggTexture::F_luminance; } - } + } // Create a global Palettizer object. We'll use this even if the // user specified -nopal, if nothing else just to hold all of the @@ -413,10 +458,24 @@ run() { _group->set_switch_flag(true); _group->set_switch_fps(2.0); - // Also create an egg group indicating the font's design size. + double margin = _poly_margin; + if (_generate_distance_field) { + // Distance fields are always rendered with binary alpha. + _group->set_alpha_mode(EggRenderMode::AM_binary); + + // Fudged to make most fonts fit on 512x256. + if (_poly_margin >= 1) { + margin += 3.5; + _poly_margin -= 0.5; + } + + _text_maker->set_distance_field_radius(4); + } + + // Also create an egg group indicating the font's design size and poly margin. EggGroup *ds_group = new EggGroup("ds"); _group->add_child(ds_group); - EggVertex *vtx = make_vertex(LPoint2d(0.0, _text_maker->get_line_height())); + EggVertex *vtx = make_vertex(LPoint2d(margin / _pixels_per_unit, _text_maker->get_line_height())); EggPoint *point = new EggPoint; ds_group->add_child(point); point->add_vertex(vtx); diff --git a/pandatool/src/egg-mkfont/eggMakeFont.h b/pandatool/src/egg-mkfont/eggMakeFont.h index e5d456200e..b11712df4e 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.h +++ b/pandatool/src/egg-mkfont/eggMakeFont.h @@ -78,6 +78,7 @@ private: bool _no_native_aa; bool _no_palettize; int _palette_size[2]; + bool _generate_distance_field; double _palettize_scale_factor; Filename _input_font_filename;